diff --git a/README.md b/README.md index 0df7d67..3662d02 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # Corescripts -After installing Aftman and running `aftman install`, run `./compile.sh` to compile the corescripts from ./yue/\*.yue to ./processed/\*.lua. +After installing Aftman and running `aftman install`, run `./compile.sh` to compile the corescripts from ./lua/\*.lua to ./processed/\*.lua. diff --git a/dense.json5 b/dense.json5 index 13e7ef8..c02edcc 100644 --- a/dense.json5 +++ b/dense.json5 @@ -3,6 +3,7 @@ rules: [ "remove_comments", "remove_spaces", + "remove_compound_assignment", "group_local_assignment", // "compute_expression", "remove_unused_if_branch", diff --git a/lua/107893730.lua b/lua/107893730.lua index 02d066a..2bd94f1 100644 --- a/lua/107893730.lua +++ b/lua/107893730.lua @@ -145,7 +145,7 @@ function userPurchaseActionsEnded(isSuccess) local newPurchasedSucceededText = string.gsub( purchaseSucceededText, "itemName", - tostring(currentProductInfo["Name"]) + tostring(currentProductInfo.Name) ) purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText @@ -181,26 +181,26 @@ function updatePurchasePromptData(_) -- id to use when we request a purchase if not currentProductId then - currentProductId = currentProductInfo["ProductId"] + currentProductId = currentProductInfo.ProductId end if isFreeItem() then newItemDescription = string.gsub( freeItemPurchaseText, "itemName", - tostring(currentProductInfo["Name"]) + tostring(currentProductInfo.Name) ) newItemDescription = string.gsub( newItemDescription, "assetType", - tostring(assetTypeToString(currentProductInfo["AssetTypeId"])) + tostring(assetTypeToString(currentProductInfo.AssetTypeId)) ) setHeaderText(takeHeaderText) else -- otherwise item costs something, so different prompt newItemDescription = string.gsub( productPurchaseText, "itemName", - tostring(currentProductInfo["Name"]) + tostring(currentProductInfo.Name) ) newItemDescription = string.gsub( newItemDescription, @@ -221,7 +221,7 @@ function updatePurchasePromptData(_) if purchasingConsumable then purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl .. "thumbs/asset.ashx?assetid=" - .. tostring(currentProductInfo["IconImageAssetId"]) + .. tostring(currentProductInfo.IconImageAssetId) .. "&x=100&y=100&format=png" else purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl @@ -244,7 +244,7 @@ function doPlayerFundsCheck(checkIndefinitely) do wait(1 / 10) canPurchase, insufficientFunds = canPurchaseItem() - retries = retries - 1 + retries -= 1 end end if canPurchase and not insufficientFunds then @@ -372,7 +372,7 @@ end function purchaseFailed(inGamePurchasesDisabled) local name = "Item" if currentProductInfo then - name = currentProductInfo["Name"] + name = currentProductInfo.Name end local newPurchasedFailedText = @@ -467,14 +467,14 @@ function doAcceptPurchase(_) response = getRbxUtility().DecodeJSON(response) if response then - if response["success"] == false then - if response["status"] ~= "AlreadyOwned" then + if response.success == false then + if response.status ~= "AlreadyOwned" then print( "web return response of fail on purchase of", currentAssetId, currentProductId ) - purchaseFailed((response["status"] == "EconomyDisabled")) + purchaseFailed((response.status == "EconomyDisabled")) return end end @@ -492,7 +492,7 @@ function doAcceptPurchase(_) currentEquipOnPurchase and success and currentAssetId - and tonumber(currentProductInfo["AssetTypeId"]) == 19 + and tonumber(currentProductInfo.AssetTypeId) == 19 then local tool = getToolAssetID(tonumber(currentAssetId)) if tool then @@ -501,7 +501,7 @@ function doAcceptPurchase(_) end if purchasingConsumable then - if not response["receipt"] then + if not response.receipt then print( "tried to buy productId, but no receipt returned. productId was", currentProductId @@ -510,7 +510,7 @@ function doAcceptPurchase(_) return end Game:GetService("MarketplaceService"):SignalClientPurchaseSuccess( - tostring(response["receipt"]), + tostring(response.receipt), game.Players.LocalPlayer.userId, currentProductId ) @@ -746,8 +746,8 @@ end function isFreeItem() -- if both of these are true, then the item is free, just prompt user if they want to take one return currentProductInfo - and currentProductInfo["IsForSale"] == true - and currentProductInfo["IsPublicDomain"] == true + and currentProductInfo.IsForSale == true + and currentProductInfo.IsPublicDomain == true end ---------------------------------------------- End Currency Functions --------------------------------------------- @@ -847,8 +847,8 @@ function canPurchaseItem() end if - currentProductInfo["IsForSale"] == false - and currentProductInfo["IsPublicDomain"] == false + currentProductInfo.IsForSale == false + and currentProductInfo.IsPublicDomain == false then descText = "This item is no longer for sale." return true, nil, nil, true, descText @@ -857,8 +857,8 @@ function canPurchaseItem() -- now we start talking money, making sure we are going to be able to purchase this if not setCurrencyAmountAndType( - tonumber(currentProductInfo["PriceInRobux"]), - tonumber(currentProductInfo["PriceInTickets"]) + tonumber(currentProductInfo.PriceInRobux), + tonumber(currentProductInfo.PriceInTickets) ) then descText = @@ -873,7 +873,7 @@ function canPurchaseItem() end if - tonumber(currentProductInfo["MinimumMembershipLevel"]) + tonumber(currentProductInfo.MinimumMembershipLevel) > membershipTypeToNumber(game.Players.LocalPlayer.MembershipType) then notRightBc = true @@ -887,7 +887,7 @@ function canPurchaseItem() return true, insufficientFunds, notRightBc, false end - if currentProductInfo["ContentRatingTypeId"] == 1 then + if currentProductInfo.ContentRatingTypeId == 1 then if game.Players.LocalPlayer:GetUnder13() then descText = "Your account is under 13 so purchase of this item is not allowed." @@ -897,13 +897,13 @@ function canPurchaseItem() if ( - currentProductInfo["IsLimited"] == true - or currentProductInfo["IsLimitedUnique"] == true + currentProductInfo.IsLimited == true + or currentProductInfo.IsLimitedUnique == true ) and ( - currentProductInfo["Remaining"] == "" - or currentProductInfo["Remaining"] == 0 - or currentProductInfo["Remaining"] == nil + currentProductInfo.Remaining == "" + or currentProductInfo.Remaining == 0 + or currentProductInfo.Remaining == nil ) then descText = @@ -960,7 +960,7 @@ function startSpinner() "http://banland.xyz/Asset/?id=45880710" end - pos = pos + 1 + pos += 1 end spinPos = (spinPos + 1) % 8 wait(1 / 15) @@ -1019,7 +1019,7 @@ function createSpinner(size, position, parent) spinnerImage.Parent = spinnerFrame spinnerIcons[spinnerNum] = spinnerImage - spinnerNum = spinnerNum + 1 + spinnerNum += 1 end end @@ -1351,7 +1351,7 @@ function userPurchaseProductActionsEnded(userIsClosingDialog) if currentServerResponseTable then local isPurchased = false if - tostring(currentServerResponseTable["isValid"]):lower() + tostring(currentServerResponseTable.isValid):lower() == "true" then isPurchased = true @@ -1359,8 +1359,8 @@ function userPurchaseProductActionsEnded(userIsClosingDialog) Game:GetService("MarketplaceService") :SignalPromptProductPurchaseFinished( - tonumber(currentServerResponseTable["playerId"]), - tonumber(currentServerResponseTable["productId"]), + tonumber(currentServerResponseTable.playerId), + tonumber(currentServerResponseTable.productId), isPurchased ) else @@ -1371,7 +1371,7 @@ function userPurchaseProductActionsEnded(userIsClosingDialog) local newPurchasedSucceededText = string.gsub( purchaseSucceededText, "itemName", - tostring(currentProductInfo["Name"]) + tostring(currentProductInfo.Name) ) purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText @@ -1388,8 +1388,8 @@ function doProcessServerPurchaseResponse(serverResponseTable) end if - serverResponseTable["playerId"] - and tonumber(serverResponseTable["playerId"]) + serverResponseTable.playerId + and tonumber(serverResponseTable.playerId) == game.Players.LocalPlayer.userId then currentServerResponseTable = serverResponseTable diff --git a/lua/152908679.lua b/lua/152908679.lua index 0576cc1..81c67fe 100644 --- a/lua/152908679.lua +++ b/lua/152908679.lua @@ -9,8 +9,7 @@ local contextActionService = Game:GetService "ContextActionService" local isTouchDevice = Game:GetService("UserInputService").TouchEnabled local functionTable = {} local buttonVector = {} -local buttonScreenGui -local buttonFrame +local buttonScreenGui, buttonFrame local ContextDownImage = "http://www.banland.xyz/asset/?id=97166756" local ContextUpImage = "http://www.banland.xyz/asset/?id=97166444" @@ -169,10 +168,10 @@ function createNewButton(actionName, functionInfoTable) actionIcon.Size = UDim2.new(0.65, 0, 0.65, 0) actionIcon.BackgroundTransparency = 1 if - functionInfoTable["image"] - and type(functionInfoTable["image"]) == "string" + functionInfoTable.image + and type(functionInfoTable.image) == "string" then - actionIcon.Image = functionInfoTable["image"] + actionIcon.Image = functionInfoTable.image end actionIcon.Parent = contextButton @@ -187,10 +186,10 @@ function createNewButton(actionName, functionInfoTable) actionTitle.TextWrapped = true actionTitle.Text = "" if - functionInfoTable["title"] - and type(functionInfoTable["title"]) == "string" + functionInfoTable.title + and type(functionInfoTable.title) == "string" then - actionTitle.Text = functionInfoTable["title"] + actionTitle.Text = functionInfoTable.title end actionTitle.Parent = contextButton @@ -303,5 +302,5 @@ end) -- make sure any bound data before we setup connections is handled local boundActions = contextActionService:GetAllBoundActionInfo() for actionName, actionData in pairs(boundActions) do - addAction(actionName, actionData["createTouchButton"], actionData) + addAction(actionName, actionData.createTouchButton, actionData) end diff --git a/lua/153556783.lua b/lua/153556783.lua index 9a6ddaf..f723014 100644 --- a/lua/153556783.lua +++ b/lua/153556783.lua @@ -406,7 +406,7 @@ function constructThumbstick( end function setupCharacterMovement(parentFrame) - local lastMovementVector, lastMaxMovement = nil + local lastMovementVector, lastMaxMovement local moveCharacterFunc = localPlayer.MoveCharacter local moveCharacterFunction = function(movementVector, maxMovement) if localPlayer then diff --git a/lua/157877000.lua b/lua/157877000.lua index 92a8c82..629a47f 100644 --- a/lua/157877000.lua +++ b/lua/157877000.lua @@ -524,9 +524,9 @@ function initializeDeveloperConsole() repeat if optionsHidden then - frameNumber = frameNumber - 1 + frameNumber -= 1 else - frameNumber = frameNumber + 1 + frameNumber += 1 end local x = frameNumber / 5 @@ -554,9 +554,9 @@ function initializeDeveloperConsole() function changeOffset(value) if currentConsole == LOCAL_CONSOLE then - localOffset = localOffset + value + localOffset += value elseif currentConsole == SERVER_CONSOLE then - serverOffset = serverOffset + value + serverOffset += value end repositionList() @@ -622,7 +622,7 @@ function initializeDeveloperConsole() message.Size = UDim2.new(0.98, 0, 0, message.TextBounds.Y) message.Position = UDim2.new(0, 5, 0, posOffset) message.Parent = Dev_TextHolder - posOffset = posOffset + message.TextBounds.Y + posOffset += message.TextBounds.Y if movePosition then if @@ -680,12 +680,12 @@ function initializeDeveloperConsole() end scrollUpIsDown = true wait(0.6) - inside = inside + 1 + inside += 1 while scrollUpIsDown and inside < 2 do wait() changeOffset(12) end - inside = inside - 1 + inside -= 1 end function holdingDownButton() @@ -694,12 +694,12 @@ function initializeDeveloperConsole() end scrollDownIsDown = true wait(0.6) - inside = inside + 1 + inside += 1 while scrollDownIsDown and inside < 2 do wait() changeOffset(-12) end - inside = inside - 1 + inside -= 1 end Dev_Container.Body.ScrollBar.Up.MouseButton1Click:connect(function() @@ -864,10 +864,10 @@ function initializeDeveloperConsole() local hour = math.floor(dayTime / 3600) - dayTime = dayTime - (hour * 3600) + dayTime -= (hour * 3600) local minute = math.floor(dayTime / 60) - dayTime = dayTime - (minute * 60) + dayTime -= (minute * 60) local h = numberWithZero(hour) local m = numberWithZero(minute) @@ -957,9 +957,7 @@ function initializeDeveloperConsole() localConsole.BackgroundTransparency = 0.6 serverConsole.BackgroundTransparency = 0.8 - if - game:FindFirstChild "Players" and game.Players["LocalPlayer"] - then + if game:FindFirstChild "Players" and game.Players.LocalPlayer then local mouse = game.Players.LocalPlayer:GetMouse() refreshConsolePosition(mouse.X, mouse.Y) refreshConsoleSize(mouse.X, mouse.Y) @@ -993,9 +991,7 @@ function initializeDeveloperConsole() serverConsole.BackgroundTransparency = 0.6 localConsole.BackgroundTransparency = 0.8 - if - game:FindFirstChild "Players" and game.Players["LocalPlayer"] - then + if game:FindFirstChild "Players" and game.Players.LocalPlayer then local mouse = game.Players.LocalPlayer:GetMouse() refreshConsolePosition(mouse.X, mouse.Y) refreshConsoleSize(mouse.X, mouse.Y) @@ -1012,7 +1008,7 @@ function initializeDeveloperConsole() clean() end) - if game:FindFirstChild "Players" and game.Players["LocalPlayer"] then + if game:FindFirstChild "Players" and game.Players.LocalPlayer then local LocalMouse = game.Players.LocalPlayer:GetMouse() LocalMouse.Move:connect(function() if not Dev_Container.Visible then diff --git a/lua/38037565.lua b/lua/38037565.lua index 26bddcd..1fb94f5 100644 --- a/lua/38037565.lua +++ b/lua/38037565.lua @@ -28,8 +28,7 @@ inCharTag.Name = "InCharTag" local hider = Instance.new "BoolValue" hider.Name = "RobloxBuildTool" -local currentChildren -local backpackTools +local currentChildren, backpackTools if config == nil then config = Instance.new "Configuration" @@ -132,7 +131,7 @@ while true do local fire = config:FindFirstChild "Fire" local stun = config:FindFirstChild "Stun" if regen then - delta = delta + regen.Value.X + delta += regen.Value.X if regen.Value.Y >= 0 then regen.Value = Vector3.new( regen.Value.X + regen.Value.Z, @@ -150,7 +149,7 @@ while true do end -- infinity is -1 end if poison then - delta = delta - poison.Value.X + delta -= poison.Value.X if poison.Value.Y >= 0 then poison.Value = Vector3.new( poison.Value.X + poison.Value.Z, @@ -170,7 +169,7 @@ while true do if ice then --print("IN ICE") - delta = delta - ice.Value.X + delta -= ice.Value.X if ice.Value.Y >= 0 then ice.Value = Vector3.new(ice.Value.X, ice.Value.Y - s, ice.Value.Z) @@ -182,7 +181,7 @@ while true do if fire then fireEffect.Enabled = true fireEffect.Parent = Figure.Torso - delta = delta - fire.Value.X + delta -= fire.Value.X if fire.Value.Y >= 0 then fire.Value = Vector3.new( fire.Value.X, @@ -224,7 +223,7 @@ while true do backpackTools[i].Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack end - stun.Value = stun.Value - s + stun.Value -= s else Torso.Anchored = false for i = 1, #backpackTools do @@ -256,9 +255,9 @@ while true do if delta ~= 0 then coroutine.resume(coroutine.create(billboardHealthChange), delta) end - --delta = delta * .01 + --delta *= .01 end - --health = health + delta * s * Humanoid.MaxHealth + --health += delta * s * Humanoid.MaxHealth health = Humanoid.Health + delta * s if health * 1.01 < Humanoid.MaxHealth then diff --git a/lua/39250920.lua b/lua/39250920.lua index 787afa9..b90b0d8 100644 --- a/lua/39250920.lua +++ b/lua/39250920.lua @@ -15,9 +15,7 @@ local mainFrame local choices = {} local lastChoice local choiceMap = {} -local currentConversationDialog -local currentConversationPartner -local currentAbortDialogScript +local currentConversationDialog, currentConversationPartner, currentAbortDialogScript local tooFarAwayMessage = "You are too far away to chat!" local tooFarAwaySize = 300 @@ -26,11 +24,7 @@ local characterWanderedOffSize = 350 local conversationTimedOut = "Chat ended because you didn't reply" local conversationTimedOutSize = 350 -local player -local chatNotificationGui -local messageDialog -local timeoutScript -local reenableDialogScript +local player, chatNotificationGui, messageDialog, timeoutScript, reenableDialogScript local dialogMap = {} local dialogConnections = {} @@ -409,8 +403,8 @@ function presentDialogChoices(talkingPart, dialogChoices) choiceMap[choices[pos]] = obj - yPosition = yPosition + height - pos = pos + 1 + yPosition += height + pos += 1 end end diff --git a/lua/45284430.lua b/lua/45284430.lua index 2b2514e..47876ac 100644 --- a/lua/45284430.lua +++ b/lua/45284430.lua @@ -59,7 +59,7 @@ local function CreateButtons(frame, buttons, yPos, ySize) button.FontSize = Enum.FontSize.Size18 button.AutoButtonColor = true button.Modal = true - if obj["Style"] then + if obj.Style then button.Style = obj.Style else button.Style = Enum.ButtonStyle.RobloxButton @@ -70,7 +70,7 @@ local function CreateButtons(frame, buttons, yPos, ySize) button.Parent = frame buttonObjs[buttonNum] = button - buttonNum = buttonNum + 1 + buttonNum += 1 end local numButtons = buttonNum - 1 @@ -97,7 +97,7 @@ local function CreateButtons(frame, buttons, yPos, ySize) ) buttonObjs[buttonNum].Size = UDim2.new(buttonSize, 0, ySize.Scale, ySize.Offset) - buttonNum = buttonNum + 1 + buttonNum += 1 end end end @@ -110,7 +110,7 @@ local function setSliderPos(newAbsPosX, slider, sliderPosition, bar, steps) ) local wholeNum, remainder = math.modf(relativePosX * newStep) if remainder > 0.5 then - wholeNum = wholeNum + 1 + wholeNum += 1 end relativePosX = wholeNum / newStep @@ -382,7 +382,7 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) obj.TextColor3 = Color3.new(1, 1, 1) obj.BackgroundTransparency = 1 - childNum = childNum + 1 + childNum += 1 end end end @@ -417,7 +417,7 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) else obj.Font = Enum.Font.Arial end - childNum = childNum + 1 + childNum += 1 end end end @@ -439,7 +439,7 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) local function scrollDown() if scrollBarPosition + dropDownItemCount <= itemCount then - scrollBarPosition = scrollBarPosition + 1 + scrollBarPosition += 1 updateScroll() return true end @@ -447,7 +447,7 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) end local function scrollUp() if scrollBarPosition > 1 then - scrollBarPosition = scrollBarPosition - 1 + scrollBarPosition -= 1 updateScroll() return true end @@ -464,13 +464,13 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) scrollUpButton.Position = UDim2.new(1, -11, (1 * 0.8) / ((dropDownItemCount + 1) * 0.8), 0) scrollUpButton.MouseButton1Click:connect(function() - scrollMouseCount = scrollMouseCount + 1 + scrollMouseCount += 1 end) scrollUpButton.MouseLeave:connect(function() - scrollMouseCount = scrollMouseCount + 1 + scrollMouseCount += 1 end) scrollUpButton.MouseButton1Down:connect(function() - scrollMouseCount = scrollMouseCount + 1 + scrollMouseCount += 1 scrollUp() local val = scrollMouseCount @@ -493,13 +493,13 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) scrollDownButton.Position = UDim2.new(1, -11, 1, -11) scrollDownButton.Parent = droppedDownMenu scrollDownButton.MouseButton1Click:connect(function() - scrollMouseCount = scrollMouseCount + 1 + scrollMouseCount += 1 end) scrollDownButton.MouseLeave:connect(function() - scrollMouseCount = scrollMouseCount + 1 + scrollMouseCount += 1 end) scrollDownButton.MouseButton1Down:connect(function() - scrollMouseCount = scrollMouseCount + 1 + scrollMouseCount += 1 scrollDown() local val = scrollMouseCount @@ -670,10 +670,10 @@ local function layoutGuiObjectsHelper(frame, guiObjects, settingsTable) local isLabel = child:IsA "TextLabel" if isLabel then pixelsRemaining = pixelsRemaining - - settingsTable["TextLabelPositionPadY"] + - settingsTable.TextLabelPositionPadY else pixelsRemaining = pixelsRemaining - - settingsTable["TextButtonPositionPadY"] + - settingsTable.TextButtonPositionPadY end child.Position = UDim2.new( child.Position.X.Scale, @@ -695,14 +695,14 @@ local function layoutGuiObjectsHelper(frame, guiObjects, settingsTable) child.Size.X.Scale, child.Size.X.Offset, 0, - child.TextBounds.Y + settingsTable["TextLabelSizePadY"] + child.TextBounds.Y + settingsTable.TextLabelSizePadY ) else child.Size = UDim2.new( child.Size.X.Scale, child.Size.X.Offset, 0, - child.TextBounds.Y + settingsTable["TextButtonSizePadY"] + child.TextBounds.Y + settingsTable.TextButtonSizePadY ) end @@ -714,14 +714,14 @@ local function layoutGuiObjectsHelper(frame, guiObjects, settingsTable) child.AbsoluteSize.Y + 1 ) end - pixelsRemaining = pixelsRemaining - child.AbsoluteSize.Y + pixelsRemaining -= child.AbsoluteSize.Y if isLabel then pixelsRemaining = pixelsRemaining - - settingsTable["TextLabelPositionPadY"] + - settingsTable.TextLabelPositionPadY else pixelsRemaining = pixelsRemaining - - settingsTable["TextButtonPositionPadY"] + - settingsTable.TextButtonPositionPadY end else child.Visible = false @@ -735,7 +735,7 @@ local function layoutGuiObjectsHelper(frame, guiObjects, settingsTable) 0, totalPixels - pixelsRemaining ) - pixelsRemaining = pixelsRemaining - child.AbsoluteSize.Y + pixelsRemaining -= child.AbsoluteSize.Y child.Visible = (pixelsRemaining >= 0) end end @@ -755,17 +755,17 @@ t.LayoutGuiObjects = function(frame, guiObjects, settingsTable) settingsTable = {} end - if not settingsTable["TextLabelSizePadY"] then - settingsTable["TextLabelSizePadY"] = 0 + if not settingsTable.TextLabelSizePadY then + settingsTable.TextLabelSizePadY = 0 end - if not settingsTable["TextLabelPositionPadY"] then - settingsTable["TextLabelPositionPadY"] = 0 + if not settingsTable.TextLabelPositionPadY then + settingsTable.TextLabelPositionPadY = 0 end - if not settingsTable["TextButtonSizePadY"] then - settingsTable["TextButtonSizePadY"] = 12 + if not settingsTable.TextButtonSizePadY then + settingsTable.TextButtonSizePadY = 12 end - if not settingsTable["TextButtonPositionPadY"] then - settingsTable["TextButtonPositionPadY"] = 2 + if not settingsTable.TextButtonPositionPadY then + settingsTable.TextButtonPositionPadY = 2 end --Wrapper frame takes care of styled objects @@ -843,12 +843,12 @@ t.CreateSlider = function(steps, width, position) bar.Parent = sliderGui if - position["X"] - and position["X"]["Scale"] - and position["X"]["Offset"] - and position["Y"] - and position["Y"]["Scale"] - and position["Y"]["Offset"] + position.X + and position.X.Scale + and position.X.Offset + and position.Y + and position.Y.Scale + and position.Y.Offset then bar.Position = position end @@ -1609,20 +1609,20 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) pos = scrollPosition --count up from current scroll position to fill out grid while pos <= #guiObjects and pixelsBelowScrollbar < totalPixelsY do - xCounter = xCounter + guiObjects[pos].AbsoluteSize.X + xCounter += guiObjects[pos].AbsoluteSize.X --previous pos was the end of a row if xCounter >= totalPixelsX then - pixelsBelowScrollbar = pixelsBelowScrollbar + currentRowY + pixelsBelowScrollbar += currentRowY currentRowY = 0 xCounter = guiObjects[pos].AbsoluteSize.X end if guiObjects[pos].AbsoluteSize.Y > currentRowY then currentRowY = guiObjects[pos].AbsoluteSize.Y end - pos = pos + 1 + pos += 1 end --Count wherever current row left off - pixelsBelowScrollbar = pixelsBelowScrollbar + currentRowY + pixelsBelowScrollbar += currentRowY currentRowY = 0 pos = scrollPosition - 1 @@ -1633,20 +1633,20 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) --count backwards from current scrollPosition to see if we can add more rows while pixelsBelowScrollbar + currentRowY < totalPixelsY and pos >= 1 do - xCounter = xCounter + guiObjects[pos].AbsoluteSize.X - rowSizeCounter = rowSizeCounter + 1 + xCounter += guiObjects[pos].AbsoluteSize.X + rowSizeCounter += 1 if xCounter >= totalPixelsX then rowSize = rowSizeCounter - 1 rowSizeCounter = 0 xCounter = guiObjects[pos].AbsoluteSize.X if pixelsBelowScrollbar + currentRowY <= totalPixelsY then --It fits, so back up our scroll position - pixelsBelowScrollbar = pixelsBelowScrollbar + currentRowY + pixelsBelowScrollbar += currentRowY if scrollPosition <= rowSize then scrollPosition = 1 break else - scrollPosition = scrollPosition - rowSize + scrollPosition -= rowSize end currentRowY = 0 else @@ -1658,7 +1658,7 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) currentRowY = guiObjects[pos].AbsoluteSize.Y end - pos = pos - 1 + pos -= 1 end --Do check last time if pos = 0 @@ -1700,7 +1700,7 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) --print("Laying out " .. child.Name) --GuiObject if setRowSize then - rowSizeCounter = rowSizeCounter + 1 + rowSizeCounter += 1 end if xCounter + child.AbsoluteSize.X >= totalPixelsX then if setRowSize then @@ -1717,12 +1717,12 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) 0, totalPixelsY - pixelsRemainingY + yOffset ) - xCounter = xCounter + child.AbsoluteSize.X + xCounter += child.AbsoluteSize.X child.Visible = ( (pixelsRemainingY - child.AbsoluteSize.Y) >= 0 ) if child.Visible then - howManyDisplayed = howManyDisplayed + 1 + howManyDisplayed += 1 end lastChildSize = child.AbsoluteSize end @@ -1793,13 +1793,13 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) break else --local ("Backing up ScrollPosition from -- " ..scrollPosition) - scrollPosition = scrollPosition - 1 + scrollPosition -= 1 end else break end end - pos = pos - 1 + pos -= 1 end pos = scrollPosition @@ -1820,10 +1820,10 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) 0, totalPixels - pixelsRemaining ) - pixelsRemaining = pixelsRemaining - child.AbsoluteSize.Y + pixelsRemaining -= child.AbsoluteSize.Y if pixelsRemaining >= 0 then child.Visible = true - howManyDisplayed = howManyDisplayed + 1 + howManyDisplayed += 1 else child.Visible = false end @@ -1842,7 +1842,7 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) if children then for _, child in ipairs(children) do if child:IsA "GuiObject" then - guiObjects = guiObjects + 1 + guiObjects += 1 end end end @@ -1892,7 +1892,7 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) end reentrancyGuard = true wait() - local success, err = nil + local success, err if style == "grid" then success, err = pcall(function() layoutGridScrollBar() @@ -1910,7 +1910,7 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) end local doScrollUp = function() - scrollPosition = scrollPosition - rowSize + scrollPosition -= rowSize if scrollPosition < 1 then scrollPosition = 1 end @@ -1918,7 +1918,7 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) end local doScrollDown = function() - scrollPosition = scrollPosition + rowSize + scrollPosition += rowSize recalculate(nil) end @@ -2005,18 +2005,18 @@ t.CreateScrollingFrame = function(orderList, scrollStyle) local dragAbsSize = scrollDrag.AbsoluteSize.y local barAbsOne = barAbsPos + barAbsSize - dragAbsSize - y = y - mouseOffset + y -= mouseOffset y = y < barAbsPos and barAbsPos or y > barAbsOne and barAbsOne or y - y = y - barAbsPos + y -= barAbsPos local guiObjects = 0 local children = frame:GetChildren() if children then for _, child in ipairs(children) do if child:IsA "GuiObject" then - guiObjects = guiObjects + 1 + guiObjects += 1 end end end @@ -2609,7 +2609,7 @@ t.CreateImageTutorialPage = function( imageLabel.Position = UDim2.new(0.5 - (x / y) / 2, 0, 0, 0) end end - size = size + 50 + size += 50 frame.Size = UDim2.new(0, size, 0, size) frame.Position = UDim2.new(0.5, -size / 2, 0.5, -size / 2) end @@ -2733,7 +2733,7 @@ t.CreateSetPanel = function( -- used for water selections local waterForceDirection = "NegX" local waterForce = "None" - local waterGui, waterTypeChangedEvent = nil + local waterGui, waterTypeChangedEvent local Data = {} Data.CurrentCategory = nil @@ -3023,7 +3023,7 @@ t.CreateSetPanel = function( local numSkipped = 0 for i = 1, #sets do if not showAdminCategories and sets[i].Name == "Beta" then - numSkipped = numSkipped + 1 + numSkipped += 1 else setButtons[i - numSkipped] = buildSetButton( sets[i].Name, @@ -3254,10 +3254,10 @@ t.CreateSetPanel = function( for i = 1, #insertButtons do insertButtons[i].Position = UDim2.new(0, buttonWidth * x, 0, buttonHeight * y) - x = x + 1 + x += 1 if x >= columns then x = 0 - y = y + 1 + y += 1 end end end @@ -3321,7 +3321,7 @@ t.CreateSetPanel = function( insertButtons[arrayPosition], buttonCon = buildInsertButton() table.insert(insertButtonCons, buttonCon) insertButtons[arrayPosition].Parent = setGui.SetPanel.ItemsFrame - arrayPosition = arrayPosition + 1 + arrayPosition += 1 end realignButtonGrid(columns) @@ -3495,7 +3495,7 @@ t.CreateSetPanel = function( ) end) - currRow = currRow + 1 + currRow += 1 end local buttons = setGui.SetPanel.Sets.SetsLists:GetChildren() @@ -4293,7 +4293,7 @@ t.CreatePluginFrame = function(name, size, position, scrollable, parent) widgetContainer.Position = position + UDim2.new(0, 0, 0, 20) end - local frame, control, verticalDragger = nil + local frame, control, verticalDragger if scrollable then --frame for widgets frame, control = t.CreateTrueScrollingFrame() diff --git a/lua/46295863.lua b/lua/46295863.lua index c9935a3..aa5378c 100644 --- a/lua/46295863.lua +++ b/lua/46295863.lua @@ -19,9 +19,7 @@ else gui = script.Parent end -local helpButton -local updateCameraDropDownSelection -local updateVideoCaptureDropDownSelection +local helpButton, updateCameraDropDownSelection, updateVideoCaptureDropDownSelection local tweenTime = 0.2 local mouseLockLookScreenUrl = "http://banland.xyz/asset?id=54071825" @@ -233,7 +231,7 @@ local function CreateTextButtons(frame, buttons, yPos, ySize) button.Parent = frame buttonObjs[buttonNum] = button - buttonNum = buttonNum + 1 + buttonNum += 1 end toggleSelection(buttonObjs[1]) @@ -263,7 +261,7 @@ local function CreateTextButtons(frame, buttons, yPos, ySize) ) buttonObjs[buttonNum].Size = UDim2.new(buttonSize, 0, ySize.Scale, ySize.Offset) - buttonNum = buttonNum + 1 + buttonNum += 1 end end end @@ -306,7 +304,7 @@ function setDisabledState(guiObject) guiObject.TextTransparency = 0.9 guiObject.Active = false else - if guiObject["ClassName"] then + if guiObject.ClassName then print( "setDisabledState() got object of unsupported type. object type is ", guiObject.ClassName @@ -807,9 +805,7 @@ local function createGameMainMenu(baseZIndex, shield) gameSettingsButton.ZIndex = baseZIndex + 4 gameSettingsButton.Parent = gameMainMenuFrame gameSettingsButton.MouseButton1Click:connect(function() - if - game:FindFirstChild "Players" and game.Players["LocalPlayer"] - then + if game:FindFirstChild "Players" and game.Players.LocalPlayer then local loadingGui = game.Players.LocalPlayer:FindFirstChild "PlayerLoadingGui" if loadingGui then @@ -1266,7 +1262,7 @@ local function createGameSettingsMenu(baseZIndex, _) if (graphicsLevel.Value + 1) > GraphicsQualityLevels then return end - graphicsLevel.Value = graphicsLevel.Value + 1 + graphicsLevel.Value += 1 graphicsSetter.Text = tostring(graphicsLevel.Value) setGraphicsQualityLevel(graphicsLevel.Value) @@ -1281,7 +1277,7 @@ local function createGameSettingsMenu(baseZIndex, _) if (graphicsLevel.Value - 1) <= 0 then return end - graphicsLevel.Value = graphicsLevel.Value - 1 + graphicsLevel.Value -= 1 graphicsSetter.Text = tostring(graphicsLevel.Value) setGraphicsQualityLevel(graphicsLevel.Value) @@ -1451,7 +1447,7 @@ local function createGameSettingsMenu(baseZIndex, _) local videoNames = {} local videoNameToItem = {} videoNames[1] = "Just Save to Disk" - videoNameToItem[videoNames[1]] = Enum.UploadSetting["Never"] + videoNameToItem[videoNames[1]] = Enum.UploadSetting.Never videoNames[2] = "Upload to YouTube" videoNameToItem[videoNames[2]] = Enum.UploadSetting["Ask me first"] @@ -1474,7 +1470,7 @@ local function createGameSettingsMenu(baseZIndex, _) syncVideoCaptureSetting = function() if UserSettings().GameSettings.VideoUploadPromptBehavior - == Enum.UploadSetting["Never"] + == Enum.UploadSetting.Never then updateVideoCaptureDropDownSelection(videoNames[1]) elseif @@ -1972,7 +1968,7 @@ if LoadLibrary then errorBoxButtons[buttonOffset].Function = function() saveLocal() end - buttonOffset = buttonOffset + 1 + buttonOffset += 1 end errorBoxButtons[buttonOffset] = {} errorBoxButtons[buttonOffset].Text = "Keep Playing" @@ -2036,7 +2032,7 @@ if LoadLibrary then spinnerImage.Parent = spinnerFrame spinnerIcons[spinnerNum] = spinnerImage - spinnerNum = spinnerNum + 1 + spinnerNum += 1 end save = function() @@ -2060,7 +2056,7 @@ if LoadLibrary then "http://banland.xyz/Asset?id=45880710" end - pos = pos + 1 + pos += 1 end spinPos = (spinPos + 1) % 8 wait(0.2) @@ -2260,7 +2256,7 @@ if LoadLibrary then if player:IsA "Player" and player ~= localPlayer then playerNames[pos] = player.Name nameToPlayer[player.Name] = player - pos = pos + 1 + pos += 1 end end end diff --git a/lua/48488235.lua b/lua/48488235.lua index 247eaac..44bf27f 100644 --- a/lua/48488235.lua +++ b/lua/48488235.lua @@ -275,10 +275,10 @@ function MakePopupButton(nparent, ntext, index, last) elseif last then if index % 2 == 1 then tobj.Image = "http://banland.xyz/asset/?id=" - .. Images["LightPopupBottom"] + .. Images.LightPopupBottom else tobj.Image = "http://banland.xyz/asset/?id=" - .. Images["DarkPopupBottom"] + .. Images.DarkPopupBottom end else if index % 2 == 1 then @@ -936,8 +936,7 @@ local RightEdgeSpace = -0.04 local DefaultBottomClipPos = BottomClipFrame.Position.Y.Scale -local SelectedPlayerEntry -local SelectedPlayer +local SelectedPlayerEntry, SelectedPlayer -- locks(semaphores) for stopping race conditions local AddingFrameLock = false @@ -969,8 +968,7 @@ local Abuses = { "Rude or Mean Behavior", "False Reporting Me", } -local UpdateAbuseFunction -local AbuseDropDown +local UpdateAbuseFunction, AbuseDropDown local PrivilegeLevel = { Owner = 255, @@ -997,7 +995,7 @@ end) -- function GetEntryListLength() -- local numEnts = #PlayerFrames + #TeamFrames -- if NeutralTeam then --- numEnts = numEnts + 1 +-- numEnts += 1 -- end -- return numEnts -- end @@ -1105,16 +1103,16 @@ end @Return Normalized integer value for rank? --]] -- function GetPrivilegeType(rank) --- if rank <= PrivilegeLevel["Banned"] then --- return PrivilegeLevel["Banned"] --- elseif rank <= PrivilegeLevel["Visitor"] then --- return PrivilegeLevel["Visitor"] --- elseif rank <= PrivilegeLevel["Member"] then --- return PrivilegeLevel["Member"] --- elseif rank <= PrivilegeLevel["Admin"] then --- return PrivilegeLevel["Admin"] +-- if rank <= PrivilegeLevel.Banned then +-- return PrivilegeLevel.Banned +-- elseif rank <= PrivilegeLevel.Visitor then +-- return PrivilegeLevel.Visitor +-- elseif rank <= PrivilegeLevel.Member then +-- return PrivilegeLevel.Member +-- elseif rank <= PrivilegeLevel.Admin then +-- return PrivilegeLevel.Admin -- else --- return PrivilegeLevel["Owner"] +-- return PrivilegeLevel.Owner -- end -- end @@ -1172,27 +1170,25 @@ function HighlightMyRank( AdminButton ) BanPlayerButton.Image = "http://banland.xyz/asset/?id=" - .. Images["LightPopupMid"] - VisitorButton.Image = "http://banland.xyz/asset/?id=" - .. Images["DarkPopupMid"] - MemberButton.Image = "http://banland.xyz/asset/?id=" - .. Images["LightPopupMid"] + .. Images.LightPopupMid + VisitorButton.Image = "http://banland.xyz/asset/?id=" .. Images.DarkPopupMid + MemberButton.Image = "http://banland.xyz/asset/?id=" .. Images.LightPopupMid AdminButton.Image = "http://banland.xyz/asset/?id=" - .. Images["DarkPopupBottom"] + .. Images.DarkPopupBottom local rank = player.PersonalServerRank - if rank <= PrivilegeLevel["Banned"] then + if rank <= PrivilegeLevel.Banned then BanPlayerButton.Image = "http://banland.xyz/asset/?id=" - .. Images["LightBluePopupMid"] - elseif rank <= PrivilegeLevel["Visitor"] then + .. Images.LightBluePopupMid + elseif rank <= PrivilegeLevel.Visitor then VisitorButton.Image = "http://banland.xyz/asset/?id=" - .. Images["DarkBluePopupMid"] - elseif rank <= PrivilegeLevel["Member"] then + .. Images.DarkBluePopupMid + elseif rank <= PrivilegeLevel.Member then MemberButton.Image = "http://banland.xyz/asset/?id=" - .. Images["LightBluePopupMid"] - elseif rank <= PrivilegeLevel["Admin"] then + .. Images.LightBluePopupMid + elseif rank <= PrivilegeLevel.Admin then AdminButton.Image = "http://banland.xyz/asset/?id=" - .. Images["DarkBluePopupBottom"] + .. Images.DarkBluePopupBottom end end @@ -1351,16 +1347,16 @@ end --]] function PlayerSortFunction(a, b) -- prevents flipping out leaderboard - if a["Score"] == b["Score"] then - return a["Player"].Name:upper() < b["Player"].Name:upper() + if a.Score == b.Score then + return a.Player.Name:upper() < b.Player.Name:upper() end - if not a["Score"] then + if not a.Score then return false end - if not b["Score"] then + if not b.Score then return true end - return a["Score"] < b["Score"] + return a.Score < b.Score end --------------------------------- @@ -1431,27 +1427,27 @@ function StatAdded(nchild, playerEntry) else local haveScore = false for _, i in pairs(ScoreNames) do - if i["Name"] == nchild.Name then + if i.Name == nchild.Name then haveScore = true end end if not haveScore then local nstat = {} - nstat["Name"] = nchild.Name - nstat["Priority"] = 0 + nstat.Name = nchild.Name + nstat.Priority = 0 if nchild:FindFirstChild "Priority" then - nstat["Priority"] = nchild.Priority + nstat.Priority = nchild.Priority end - nstat["IsPrimary"] = false + nstat.IsPrimary = false if nchild:FindFirstChild "IsPrimary" then - nstat["IsPrimary"] = true + nstat.IsPrimary = true end nstat.AddId = AddId - AddId = AddId + 1 + AddId += 1 table.insert(ScoreNames, nstat) table.sort(ScoreNames, StatSort) - if not StatTitles:FindFirstChild(nstat["Name"]) then - CreateStatTitle(nstat["Name"]) + if not StatTitles:FindFirstChild(nstat.Name) then + CreateStatTitle(nstat.Name) end UpdateMaximize() end @@ -1466,9 +1462,9 @@ end function DoesStatExist(statName, exception) for _, playerf in pairs(PlayerFrames) do if - playerf["Player"] ~= exception - and playerf["Player"]:FindFirstChild "leaderstats" - and playerf["Player"].leaderstats:FindFirstChild(statName) + playerf.Player ~= exception + and playerf.Player:FindFirstChild "leaderstats" + and playerf.Player.leaderstats:FindFirstChild(statName) then --print('player:' .. playerf['Player'].Name ..' has stat') return true @@ -1492,20 +1488,20 @@ function StatRemoved(nchild, playerEntry) wait(1 / 30) end AddingStatLock = true - if playerEntry["Frame"]:FindFirstChild(nchild.Name) then + if playerEntry.Frame:FindFirstChild(nchild.Name) then debugprint "Destroyed frame!" - playerEntry["Frame"][nchild.Name].Parent = nil + playerEntry.Frame[nchild.Name].Parent = nil end - if not DoesStatExist(nchild.Name, playerEntry["Player"]) then + if not DoesStatExist(nchild.Name, playerEntry.Player) then for i, val in ipairs(ScoreNames) do - if val["Name"] == nchild.Name then + if val.Name == nchild.Name then table.remove(ScoreNames, i) if StatTitles:FindFirstChild(nchild.Name) then StatTitles[nchild.Name]:Destroy() end for _, teamf in pairs(TeamFrames) do - if teamf["Frame"]:FindFirstChild(nchild.Name) then - teamf["Frame"][nchild.Name]:Destroy() + if teamf.Frame:FindFirstChild(nchild.Name) then + teamf.Frame[nchild.Name]:Destroy() end end end @@ -1553,26 +1549,26 @@ function MakeScoreEntry(entry, scoreval, panel) --RIP the leaderstat bug, oct 2012-nov 2012 wait() if - entry["Player"]:FindFirstChild "leaderstats" - and entry["Player"].leaderstats:FindFirstChild(scoreval["Name"]) + entry.Player:FindFirstChild "leaderstats" + and entry.Player.leaderstats:FindFirstChild(scoreval.Name) then - thisScore = entry["Player"] + thisScore = entry.Player :FindFirstChild("leaderstats") - :FindFirstChild(scoreval["Name"]) + :FindFirstChild(scoreval.Name) else return end - if not entry["Player"].Parent then + if not entry.Player.Parent then return end - nscoretxt.Name = scoreval["Name"] + nscoretxt.Name = scoreval.Name nscoretxt.Text = tostring(GetScoreValue(thisScore)) - if scoreval["Name"] == ScoreNames[1]["Name"] then + if scoreval.Name == ScoreNames[1]["Name"] then debugprint "changing score" - entry["Score"] = GetScoreValue(thisScore) - if entry["Player"] == LocalPlayer then + entry.Score = GetScoreValue(thisScore) + if entry.Player == LocalPlayer then HeaderScore.Text = tostring(GetScoreValue(thisScore)) end end @@ -1581,9 +1577,9 @@ function MakeScoreEntry(entry, scoreval, panel) if not thisScore.Parent then return end - if scoreval["Name"] == ScoreNames[1]["Name"] then - entry["Score"] = GetScoreValue(thisScore) - if entry["Player"] == LocalPlayer then + if scoreval.Name == ScoreNames[1]["Name"] then + entry.Score = GetScoreValue(thisScore) + if entry.Player == LocalPlayer then HeaderScore.Text = tostring(GetScoreValue(thisScore)) end end @@ -1623,50 +1619,41 @@ function RecreateScoreColumns(ptable) MaxSizeColumn = 0 -- for each entry in this player table for _, entry in ipairs(ptable) do - local panel = entry["Frame"] - local tplayer = entry["Player"] + local panel = entry.Frame + local tplayer = entry.Player -- if this panel does not have an element named after this stat - if not panel:FindFirstChild(scoreval["Name"]) then + if not panel:FindFirstChild(scoreval.Name) then -- make an entry for this object local nentry = MakeScoreEntry(entry, scoreval, panel) if nentry then debugprint( - "adding " - .. nentry.Name - .. " to " - .. entry["Player"].Name + "adding " .. nentry.Name .. " to " .. entry.Player.Name ) nentry.Parent = panel -- add score to team if - entry["MyTeam"] - and entry["MyTeam"] ~= NeutralTeam - and not entry["MyTeam"]["Frame"]:FindFirstChild( - scoreval["Name"] - ) + entry.MyTeam + and entry.MyTeam ~= NeutralTeam + and not entry.MyTeam.Frame:FindFirstChild(scoreval.Name) then local ntitle = nentry:Clone() --ntitle.TextXAlignment = 'Right' - ntitle.Parent = entry["MyTeam"]["Frame"] + ntitle.Parent = entry.MyTeam.Frame end end end - scoreval["XOffset"] = Xoffset + scoreval.XOffset = Xoffset - if panel:FindFirstChild(scoreval["Name"]) then - MaxSizeColumn = math.max( - MaxSizeColumn, - panel[scoreval["Name"]].TextBounds.X - ) + if panel:FindFirstChild(scoreval.Name) then + MaxSizeColumn = + math.max(MaxSizeColumn, panel[scoreval.Name].TextBounds.X) end end if AreNamesExpanded.Value then - MaxSizeColumn = math.max( - MaxSizeColumn, - StatTitles[scoreval["Name"]].TextBounds.X - ) - StatTitles[scoreval["Name"]]:TweenPosition( + MaxSizeColumn = + math.max(MaxSizeColumn, StatTitles[scoreval.Name].TextBounds.X) + StatTitles[scoreval.Name]:TweenPosition( UDim2.new(RightEdgeSpace, -Xoffset, 0, 0), "Out", "Linear", @@ -1674,7 +1661,7 @@ function RecreateScoreColumns(ptable) true ) else - StatTitles[scoreval["Name"]]:TweenPosition( + StatTitles[scoreval.Name]:TweenPosition( UDim2.new((0.4 + ((0.6 / #ScoreNames) * (j - 1))) - 1, 0, 0, 0), "Out", "Linear", @@ -1682,8 +1669,8 @@ function RecreateScoreColumns(ptable) true ) end - scoreval["ColumnSize"] = MaxSizeColumn - Xoffset = Xoffset + SpacingPerStat + MaxSizeColumn + scoreval.ColumnSize = MaxSizeColumn + Xoffset += SpacingPerStat + MaxSizeColumn maxXOffset = math.max(Xoffset, maxXOffset) end NormalBounds = @@ -1829,7 +1816,7 @@ function UpdateMaximize() if IsMaximized.Value then for j = 1, #ScoreNames, 1 do local scoreval = ScoreNames[j] - StatTitles[scoreval["Name"]]:TweenPosition( + StatTitles[scoreval.Name]:TweenPosition( UDim2.new(0.4 + ((0.6 / #ScoreNames) * (j - 1)) - 1, 0, 0, 0), "Out", "Linear", @@ -1872,16 +1859,16 @@ function UpdateMaximize() true ) HeaderFrame.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["LargeHeader"] + .. Images.LargeHeader BottomFrame.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["LargeBottom"] + .. Images.LargeBottom for index, i in ipairs(MiddleFrameBackgrounds) do if (index % 2) ~= 1 then i.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["LargeDark"] + .. Images.LargeDark else i.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["LargeLight"] + .. Images.LargeLight end end for _, i in ipairs(MiddleFrames) do @@ -1891,8 +1878,8 @@ function UpdateMaximize() end for j = 1, #ScoreNames, 1 do local scoreval = ScoreNames[j] - if i:FindFirstChild(scoreval["Name"]) then - i[scoreval["Name"]]:TweenPosition( + if i:FindFirstChild(scoreval.Name) then + i[scoreval.Name]:TweenPosition( UDim2.new( 0.4 + ((0.6 / #ScoreNames) * (j - 1)) - 1, 0, @@ -1908,13 +1895,13 @@ function UpdateMaximize() end end for _, entry in ipairs(PlayerFrames) do - WaitForChild(entry["Frame"], "TitleFrame").Size = - UDim2.new(0.38, 0, entry["Frame"].TitleFrame.Size.Y.Scale, 0) + WaitForChild(entry.Frame, "TitleFrame").Size = + UDim2.new(0.38, 0, entry.Frame.TitleFrame.Size.Y.Scale, 0) end for _, entry in ipairs(TeamFrames) do - WaitForChild(entry["Frame"], "TitleFrame").Size = - UDim2.new(0.38, 0, entry["Frame"].TitleFrame.Size.Y.Scale, 0) + WaitForChild(entry.Frame, "TitleFrame").Size = + UDim2.new(0.38, 0, entry.Frame.TitleFrame.Size.Y.Scale, 0) end else if not IsMinimized.Value then @@ -1942,16 +1929,16 @@ function UpdateMaximize() true ) HeaderFrame.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["NormalHeader"] + .. Images.NormalHeader BottomFrame.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["NormalBottom"] + .. Images.NormalBottom for index, i in ipairs(MiddleFrameBackgrounds) do if index % 2 ~= 1 then i.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["midDark"] + .. Images.midDark else i.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["midLight"] + .. Images.midLight end end for _, i in ipairs(MiddleFrames) do @@ -1960,18 +1947,10 @@ function UpdateMaximize() UDim2.new(0.96, 0, i.ClickListener.Size.Y.Scale, 0) for j = 1, #ScoreNames, 1 do local scoreval = ScoreNames[j] - if - i:FindFirstChild(scoreval["Name"]) - and scoreval["XOffset"] - then + if i:FindFirstChild(scoreval.Name) and scoreval.XOffset then --print('updateing stat position: ' .. scoreval['Name']) - i[scoreval["Name"]]:TweenPosition( - UDim2.new( - RightEdgeSpace, - -scoreval["XOffset"], - 0, - 0 - ), + i[scoreval.Name]:TweenPosition( + UDim2.new(RightEdgeSpace, -scoreval.XOffset, 0, 0), "Out", "Linear", BASE_TWEEN, @@ -1983,18 +1962,18 @@ function UpdateMaximize() end for _, entry in ipairs(TeamFrames) do - WaitForChild(entry["Frame"], "TitleFrame").Size = UDim2.new( + WaitForChild(entry.Frame, "TitleFrame").Size = UDim2.new( 0, BaseScreenXSize * 0.9, - entry["Frame"].TitleFrame.Size.Y.Scale, + entry.Frame.TitleFrame.Size.Y.Scale, 0 ) end for _, entry in ipairs(PlayerFrames) do - WaitForChild(entry["Frame"], "TitleFrame").Size = UDim2.new( + WaitForChild(entry.Frame, "TitleFrame").Size = UDim2.new( 0, BaseScreenXSize * 0.9, - entry["Frame"].TitleFrame.Size.Y.Scale, + entry.Frame.TitleFrame.Size.Y.Scale, 0 ) end @@ -2219,15 +2198,15 @@ end function StartDrag(entry, startx, starty) local openPanel = true --[[local draggedFrame = ]] - WaitForChild(entry["Frame"], "ClickListener") + WaitForChild(entry.Frame, "ClickListener") local function dragExit() -- stopDrag = true if - entry["Player"] + entry.Player and SelectedPlayer and openPanel - and entry["Player"] ~= LocalPlayer + and entry.Player ~= LocalPlayer and SelectedPlayer.userId > 1 and LocalPlayer.userId > 1 then @@ -2389,18 +2368,18 @@ function AddMiddleBGFrame() if (#MiddleFrameBackgrounds + 1) % 2 ~= 1 then if IsMaximized.Value then nBGFrame.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["LargeDark"] + .. Images.LargeDark else nBGFrame.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["midDark"] + .. Images.midDark end else if IsMaximized.Value then nBGFrame.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["LargeLight"] + .. Images.LargeLight else nBGFrame.Background.Image = "http://banland.xyz/asset/?id=" - .. Images["midLight"] + .. Images.midLight end end nBGFrame.Parent = ListFrame @@ -2465,7 +2444,7 @@ function UpdateHeaderNameSize() wait(1 / 30) end while tHeader.TextBounds.x - NormalBounds.X.Offset > 1 do - fSize = fSize - 1 + fSize -= 1 tHeader.FontSize = FONT_SIZES[fSize] wait(0.2) end @@ -2483,7 +2462,7 @@ ScreenGui.Changed:connect(UpdateHeaderNameSize) --]] function LeaderstatsAdded(playerEntry) --RemoveAllStats(playerEntry) - local nplayer = playerEntry["Player"] + local nplayer = playerEntry.Player for _, i in pairs(nplayer.leaderstats:GetChildren()) do StatAdded(i, playerEntry) end @@ -2503,7 +2482,7 @@ end --]] function LeaderstatsRemoved(_, playerEntry) while AddingFrameLock do - debugprint("waiting to insert " .. playerEntry["Player"].Name) + debugprint("waiting to insert " .. playerEntry.Player.Name) wait(1 / 30) end AddingFrameLock = true @@ -2513,7 +2492,7 @@ end function ClosePopUpPanel() if SelectedPlayerEntry then - local tframe = SelectedPlayerEntry["Frame"] + local tframe = SelectedPlayerEntry.Frame Spawn(function() TweenProperty(tframe, "BackgroundTransparency", 0.5, 1, BASE_TWEEN) end) @@ -2547,7 +2526,7 @@ function InitMovingPanel(entry, player) local friendStatus = GetFriendStatus(player) debugprint(tostring(friendStatus)) local showRankMenu = IsPersonalServer - and LocalPlayer.PersonalServerRank >= PrivilegeLevel["Admin"] + and LocalPlayer.PersonalServerRank >= PrivilegeLevel.Admin and LocalPlayer.PersonalServerRank > SelectedPlayer.PersonalServerRank @@ -2578,7 +2557,7 @@ function InitMovingPanel(entry, player) local FriendRefuseButton = MakePopupButton(PopUpPanel, "Decline Friend", 2, not showRankMenu) FriendRefuseButton.MouseButton1Click:connect(OnFriendRefuseButtonSelect) - nextIndex = nextIndex + 1 + nextIndex += 1 end if showRankMenu then @@ -2593,7 +2572,7 @@ function InitMovingPanel(entry, player) BanPlayerButton.MouseButton1Click:connect(function() OnPrivilegeLevelSelect( player, - PrivilegeLevel["Banned"], + PrivilegeLevel.Banned, BanPlayerButton, VisitorButton, MemberButton, @@ -2603,7 +2582,7 @@ function InitMovingPanel(entry, player) VisitorButton.MouseButton1Click:connect(function() OnPrivilegeLevelSelect( player, - PrivilegeLevel["Visitor"], + PrivilegeLevel.Visitor, BanPlayerButton, VisitorButton, MemberButton, @@ -2613,7 +2592,7 @@ function InitMovingPanel(entry, player) MemberButton.MouseButton1Click:connect(function() OnPrivilegeLevelSelect( player, - PrivilegeLevel["Member"], + PrivilegeLevel.Member, BanPlayerButton, VisitorButton, MemberButton, @@ -2623,7 +2602,7 @@ function InitMovingPanel(entry, player) AdminButton.MouseButton1Click:connect(function() OnPrivilegeLevelSelect( player, - PrivilegeLevel["Admin"], + PrivilegeLevel.Admin, BanPlayerButton, VisitorButton, MemberButton, @@ -2655,7 +2634,7 @@ function InitMovingPanel(entry, player) end) end) - local myFrame = entry["Frame"] + local myFrame = entry.Frame -- THIS IS GARBAGE. -- if I parent to frame to auto update position, it gets clipped -- sometimes garbage is the only option. @@ -2681,19 +2660,19 @@ end function OnPlayerEntrySelect(entry, startx, starty) if not InPopupWaitForClick then SelectedPlayerEntry = entry - SelectedPlayer = entry["Player"] + SelectedPlayer = entry.Player StartDrag(entry, startx, starty) end end function ActivatePlayerEntryPanel(entry) - entry["Frame"].BackgroundColor3 = Color3.new(0, 1, 1) + entry.Frame.BackgroundColor3 = Color3.new(0, 1, 1) Spawn(function() - TweenProperty(entry["Frame"], "BackgroundTransparency", 1, 0.5, 0.5) + TweenProperty(entry.Frame, "BackgroundTransparency", 1, 0.5, 0.5) end) InPopupWaitForClick = true - InitMovingPanel(entry, entry["Player"]) + InitMovingPanel(entry, entry.Player) end --[[ @@ -2704,7 +2683,7 @@ function PlayerListModeUpdate() RecreateScoreColumns(PlayerFrames) table.sort(PlayerFrames, PlayerSortFunction) for i, val in ipairs(PlayerFrames) do - MiddleFrames[i] = val["Frame"] + MiddleFrames[i] = val.Frame end for i = #PlayerFrames + 1, #MiddleFrames, 1 do MiddleFrames[i] = nil @@ -2779,14 +2758,14 @@ function InsertPlayerFrame(nplayer) ) UpdateMinimize() local nentry = {} - nentry["Frame"] = nFrame - nentry["Player"] = nplayer - nentry["ID"] = AddId - AddId = AddId + 1 + nentry.Frame = nFrame + nentry.Player = nplayer + nentry.ID = AddId + AddId += 1 table.insert(PlayerFrames, nentry) if #TeamFrames ~= 0 then if nplayer.Neutral then - nentry["MyTeam"] = nil + nentry.MyTeam = nil if not NeutralTeam then AddNeutralTeam() else @@ -2795,20 +2774,20 @@ function InsertPlayerFrame(nplayer) else local addedToTeam = false for _, tval in ipairs(TeamFrames) do - if tval["MyTeam"].TeamColor == nplayer.TeamColor then + if tval.MyTeam.TeamColor == nplayer.TeamColor then AddPlayerToTeam(tval, nentry) - nentry["MyTeam"] = tval + nentry.MyTeam = tval addedToTeam = true end end if not addedToTeam then - nentry["MyTeam"] = nil + nentry.MyTeam = nil if not NeutralTeam then AddNeutralTeam() else AddPlayerToTeam(NeutralTeam, nentry) end - nentry["MyTeam"] = NeutralTeam + nentry.MyTeam = NeutralTeam end end end @@ -2862,18 +2841,18 @@ function RemovePlayerFrame(tplayer) local tteam for i, key in ipairs(PlayerFrames) do - if tplayer == key["Player"] then - if PopUpClipFrame.Parent == key["Frame"] then + if tplayer == key.Player then + if PopUpClipFrame.Parent == key.Frame then PopUpClipFrame.Parent = nil end - key["Frame"]:Destroy() - tteam = key["MyTeam"] + key.Frame:Destroy() + tteam = key.MyTeam table.remove(PlayerFrames, i) end end if tteam then - for j, tentry in ipairs(tteam["MyPlayers"]) do - if tentry["Player"] == tplayer then + for j, tentry in ipairs(tteam.MyPlayers) do + if tentry.Player == tplayer then RemovePlayerFromTeam(tteam, j) end end @@ -2899,22 +2878,22 @@ Players.ChildRemoved:connect(RemovePlayerFrame) --]] function UnrollTeams(tframes, outframes) local numEntries = 0 - if NeutralTeam and not NeutralTeam["IsHidden"] then - for _, val in ipairs(NeutralTeam["MyPlayers"]) do - numEntries = numEntries + 1 - outframes[numEntries] = val["Frame"] + if NeutralTeam and not NeutralTeam.IsHidden then + for _, val in ipairs(NeutralTeam.MyPlayers) do + numEntries += 1 + outframes[numEntries] = val.Frame end - numEntries = numEntries + 1 - outframes[numEntries] = NeutralTeam["Frame"] + numEntries += 1 + outframes[numEntries] = NeutralTeam.Frame end for _, val in ipairs(tframes) do - if not val["IsHidden"] then + if not val.IsHidden then for _, pval in ipairs(val.MyPlayers) do - numEntries = numEntries + 1 - outframes[numEntries] = pval["Frame"] + numEntries += 1 + outframes[numEntries] = pval.Frame end - numEntries = numEntries + 1 - outframes[numEntries] = val["Frame"] + numEntries += 1 + outframes[numEntries] = val.Frame end end -- clear any additional entries from outframes @@ -2926,16 +2905,16 @@ end uses lua's table.sort to sort the teams --]] function TeamSortFunc(a, b) - if a["TeamScore"] == b["TeamScore"] then - return a["ID"] < b["ID"] + if a.TeamScore == b.TeamScore then + return a.ID < b.ID end - if not a["TeamScore"] then + if not a.TeamScore then return false end - if not b["TeamScore"] then + if not b.TeamScore then return true end - return a["TeamScore"] < b["TeamScore"] + return a.TeamScore < b.TeamScore end --[[ consider adding lock with wait for performance @@ -2945,7 +2924,7 @@ end --]] function SortTeams(tentries) for _, val in ipairs(tentries) do - table.sort(val["MyPlayers"], PlayerSortFunction) + table.sort(val.MyPlayers, PlayerSortFunction) AddTeamScores(val) end table.sort(tentries, TeamSortFunc) @@ -2972,17 +2951,21 @@ function AddTeamScores(team) for j = 1, #ScoreNames, 1 do local i = ScoreNames[j] local tscore = 0 - for _, j in ipairs(team["MyPlayers"]) do - local tval = j["Player"]:FindFirstChild "leaderstats" - and j["Player"].leaderstats:FindFirstChild(i["Name"]) + for _, j in ipairs(team.MyPlayers) do + local tval = j.Player:FindFirstChild "leaderstats" + and j.Player.leaderstats:FindFirstChild(i.Name) if tval and not tval:IsA "StringValue" then - tscore = tscore - + GetScoreValue((j["Player"].leaderstats)[i["Name"]]) + tscore += GetScoreValue((j.Player.leaderstats)[i.Name]) end end - if team["Frame"]:FindFirstChild(i["Name"]) then - --team['Frame'][i['Name'] ].Size = UDim2.new(1 - (ScrollBarFrame.Size.X.Scale * 2),- ((j-1) * SpacingPerStat),1,0) - team["Frame"][i["Name"]].Text = tostring(tscore) + if team.Frame:FindFirstChild(i.Name) then + -- team.Frame[i.Name].Size = UDim2.new( + -- 1 - (ScrollBarFrame.Size.X.Scale * 2), + -- -((j - 1) * SpacingPerStat), + -- 1, + -- 0 + -- ) + team.Frame[i.Name].Text = tostring(tscore) end end UpdateMinimize() @@ -2994,16 +2977,16 @@ end entry Player entry --]] function FindRemovePlayerFromTeam(entry) - if entry["MyTeam"] then - for j, oldEntry in ipairs(entry["MyTeam"]["MyPlayers"]) do - if oldEntry["Player"] == entry["Player"] then - RemovePlayerFromTeam(entry["MyTeam"], j) + if entry.MyTeam then + for j, oldEntry in ipairs(entry.MyTeam.MyPlayers) do + if oldEntry.Player == entry.Player then + RemovePlayerFromTeam(entry.MyTeam, j) return end end elseif NeutralTeam then - for j, oldEntry in ipairs(NeutralTeam["MyPlayers"]) do - if oldEntry["Player"] == entry["Player"] then + for j, oldEntry in ipairs(NeutralTeam.MyPlayers) do + if oldEntry.Player == entry.Player then RemovePlayerFromTeam(NeutralTeam, j) return end @@ -3017,9 +3000,9 @@ end index index of player in 'MyPlayers' list to remove --]] function RemovePlayerFromTeam(teamEntry, index) - table.remove(teamEntry["MyPlayers"], index) - --if teamEntry['AutoHide'] and #teamEntry['MyPlayers'] == 0 then - if teamEntry == NeutralTeam and #teamEntry["MyPlayers"] == 0 then + table.remove(teamEntry.MyPlayers, index) + --if teamEntry.AutoHide and #teamEntry.MyPlayers == 0 then + if teamEntry == NeutralTeam and #teamEntry.MyPlayers == 0 then RemoveNeutralTeam() end end @@ -3032,13 +3015,13 @@ end --]] function AddPlayerToTeam(teamEntry, entry) FindRemovePlayerFromTeam(entry) - table.insert(teamEntry["MyPlayers"], entry) - entry["MyTeam"] = teamEntry - if teamEntry["IsHidden"] then - teamEntry["Frame"].Parent = ListFrame + table.insert(teamEntry.MyPlayers, entry) + entry.MyTeam = teamEntry + if teamEntry.IsHidden then + teamEntry.Frame.Parent = ListFrame AddMiddleBGFrame() end - teamEntry["IsHidden"] = false + teamEntry.IsHidden = false end function SetPlayerToTeam(entry) @@ -3047,15 +3030,15 @@ function SetPlayerToTeam(entry) local setToTeam = false for _, tframe in ipairs(TeamFrames) do -- add my entry on the new team - if tframe["MyTeam"].TeamColor == entry["Player"].TeamColor then + if tframe.MyTeam.TeamColor == entry.Player.TeamColor then AddPlayerToTeam(tframe, entry) setToTeam = true end end -- if player was set to an invalid team, then set it back to neutral if not setToTeam and #(game.Teams:GetTeams()) > 0 then - debugprint(entry["Player"].Name .. "could not find team") - entry["MyTeam"] = nil + debugprint(entry.Player.Name .. "could not find team") + entry.MyTeam = nil if not NeutralTeam then AddNeutralTeam() else @@ -3080,44 +3063,43 @@ function PlayerChanged(entry, property) PlayerChangedLock = true if property == "Neutral" then -- if player changing to neutral - if entry["Player"].Neutral and #(game.Teams:GetTeams()) > 0 then - debugprint(entry["Player"].Name .. "setting to neutral") + if entry.Player.Neutral and #(game.Teams:GetTeams()) > 0 then + debugprint(entry.Player.Name .. "setting to neutral") FindRemovePlayerFromTeam(entry) - entry["MyTeam"] = nil + entry.MyTeam = nil if not NeutralTeam then - debugprint(entry["Player"].Name .. "creating neutral team") + debugprint(entry.Player.Name .. "creating neutral team") AddNeutralTeam() else - debugprint(entry["Player"].Name .. "adding to neutral team") + debugprint(entry.Player.Name .. "adding to neutral team") AddPlayerToTeam(NeutralTeam, entry) end elseif #(game.Teams:GetTeams()) > 0 then -- else player switching to a team, or a weird edgecase - debugprint(entry["Player"].Name .. "has been set non-neutral") + debugprint(entry.Player.Name .. "has been set non-neutral") SetPlayerToTeam(entry) end BaseUpdate() elseif property == "TeamColor" - and not entry["Player"].Neutral - and entry["Player"] ~= entry["MyTeam"] + and not entry.Player.Neutral + and entry.Player ~= entry.MyTeam then - debugprint(entry["Player"].Name .. "setting to new team") + debugprint(entry.Player.Name .. "setting to new team") SetPlayerToTeam(entry) BaseUpdate() elseif property == "Name" or property == "MembershipType" then - entry["Frame"]:FindFirstChild("BCLabel").Image = getMembershipTypeIcon( - entry["Player"].MembershipType, - entry["Player"].Name + entry.Frame:FindFirstChild("BCLabel").Image = getMembershipTypeIcon( + entry.Player.MembershipType, + entry.Player.Name ) - entry["Frame"].Name = entry["Player"].Name - entry["Frame"].TitleFrame.Title.Text = entry["Player"].Name - if entry["Frame"].BCLabel.Image ~= "" then - entry["Frame"].TitleFrame.Title.Position = - UDim2.new(0.01, 30, 0.1, 0) + entry.Frame.Name = entry.Player.Name + entry.Frame.TitleFrame.Title.Text = entry.Player.Name + if entry.Frame.BCLabel.Image ~= "" then + entry.Frame.TitleFrame.Title.Position = UDim2.new(0.01, 30, 0.1, 0) end - if entry["Player"] == LocalPlayer then - entry["Frame"].TitleFrame.DropShadow.Text = entry["Player"].Name - ChangeHeaderName(entry["Player"].Name) + if entry.Player == LocalPlayer then + entry.Frame.TitleFrame.DropShadow.Text = entry.Player.Name + ChangeHeaderName(entry.Player.Name) end BaseUpdate() end @@ -3135,19 +3117,17 @@ function OnFriendshipChanged(player, friendStatus) .. tostring(GetFriendStatus(player)) ) for _, entry in ipairs(PlayerFrames) do - if entry["Player"] == player then + if entry.Player == player then local nicon = getFriendStatusIcon(friendStatus) - if nicon == "" and entry["Frame"].FriendLabel.Image ~= "" then - entry["Frame"].TitleFrame.Title.Position = entry["Frame"].TitleFrame.Title.Position + if nicon == "" and entry.Frame.FriendLabel.Image ~= "" then + entry.Frame.TitleFrame.Title.Position = entry.Frame.TitleFrame.Title.Position - UDim2.new(0, 17, 0, 0) - elseif - nicon ~= "" and entry["Frame"].FriendLabel.Image == "" - then - entry["Frame"].TitleFrame.Title.Position = entry["Frame"].TitleFrame.Title.Position + elseif nicon ~= "" and entry.Frame.FriendLabel.Image == "" then + entry.Frame.TitleFrame.Title.Position = entry.Frame.TitleFrame.Title.Position + UDim2.new(0, 17, 0, 0) debugprint("confirmed status:" .. player.Name) end - entry["Frame"].FriendLabel.Image = nicon + entry.Frame.FriendLabel.Image = nicon return end end @@ -3171,42 +3151,42 @@ function AddNeutralTeam() defaultTeam.TeamColor = BrickColor.new "White" defaultTeam.Name = "Neutral" local nentry = {} - nentry["MyTeam"] = defaultTeam - nentry["MyPlayers"] = {} - nentry["Frame"] = MiddleTemplate:Clone() - WaitForChild(WaitForChild(nentry["Frame"], "TitleFrame"), "Title").Text = + nentry.MyTeam = defaultTeam + nentry.MyPlayers = {} + nentry.Frame = MiddleTemplate:Clone() + WaitForChild(WaitForChild(nentry.Frame, "TitleFrame"), "Title").Text = defaultTeam.Name - nentry["Frame"].TitleFrame.Position = UDim2.new( - nentry["Frame"].TitleFrame.Position.X.Scale, - nentry["Frame"].TitleFrame.Position.X.Offset, + nentry.Frame.TitleFrame.Position = UDim2.new( + nentry.Frame.TitleFrame.Position.X.Scale, + nentry.Frame.TitleFrame.Position.X.Offset, 0.1, 0 ) - nentry["Frame"].TitleFrame.Size = UDim2.new( - nentry["Frame"].TitleFrame.Size.X.Scale, - nentry["Frame"].TitleFrame.Size.X.Offset, + nentry.Frame.TitleFrame.Size = UDim2.new( + nentry.Frame.TitleFrame.Size.X.Scale, + nentry.Frame.TitleFrame.Size.X.Offset, 0.8, 0 ) - nentry["Frame"].TitleFrame.Title.Font = "ArialBold" - nentry["Frame"].Position = - UDim2.new(1, 0, (#MiddleFrames * nentry["Frame"].Size.Y.Scale), 0) - WaitForChild(nentry["Frame"], "ClickListener").MouseButton1Down:connect( + nentry.Frame.TitleFrame.Title.Font = "ArialBold" + nentry.Frame.Position = + UDim2.new(1, 0, (#MiddleFrames * nentry.Frame.Size.Y.Scale), 0) + WaitForChild(nentry.Frame, "ClickListener").MouseButton1Down:connect( function(nx, ny) StartDrag(nentry, nx, ny) end ) - nentry["Frame"].ClickListener.BackgroundColor3 = Color3.new(1, 1, 1) - nentry["Frame"].ClickListener.BackgroundTransparency = 0.7 - nentry["Frame"].ClickListener.AutoButtonColor = false - nentry["AutoHide"] = true - nentry["IsHidden"] = true + nentry.Frame.ClickListener.BackgroundColor3 = Color3.new(1, 1, 1) + nentry.Frame.ClickListener.BackgroundTransparency = 0.7 + nentry.Frame.ClickListener.AutoButtonColor = false + nentry.AutoHide = true + nentry.IsHidden = true for _, i in pairs(PlayerFrames) do - if i["Player"].Neutral or not i["MyTeam"] then + if i.Player.Neutral or not i.MyTeam then AddPlayerToTeam(nentry, i) end end - if #nentry["MyPlayers"] > 0 then + if #nentry.MyPlayers > 0 then NeutralTeam = nentry UpdateMinimize() BaseUpdate() @@ -3220,7 +3200,7 @@ function RemoveNeutralTeam() wait() end NeutralTeamLock = true - NeutralTeam["Frame"]:Destroy() + NeutralTeam.Frame:Destroy() NeutralTeam = nil RemoveMiddleBGFrame() NeutralTeamLock = false @@ -3230,8 +3210,8 @@ end --]] function TeamScoreChanged(entry, nscore) - WaitForChild(entry["Frame"], "PlayerScore").Text = tostring(nscore) - entry["TeamScore"] = nscore + WaitForChild(entry.Frame, "PlayerScore").Text = tostring(nscore) + entry.TeamScore = nscore end --[[ called when child added to a team, used for autohide functionality @@ -3239,11 +3219,10 @@ end --]] function TeamChildAdded(entry, nchild) if nchild.Name == "AutoHide" then - entry["AutoHide"] = true + entry.AutoHide = true elseif nchild.Name == "TeamScore" then - WaitForChild(entry["Frame"], "PlayerScore").Text = - tostring(nchild.Value) - entry["TeamScore"] = nchild.Value + WaitForChild(entry.Frame, "PlayerScore").Text = tostring(nchild.Value) + entry.TeamScore = nchild.Value nchild.Changed:connect(function() TeamScoreChanged(entry, nchild.Value) end) @@ -3255,28 +3234,28 @@ end --]] function TeamChildRemoved(entry, nchild) if nchild.Name == "AutoHide" then - entry["AutoHide"] = false + entry.AutoHide = false elseif nchild.Name == "TeamScore" then - WaitForChild(entry["Frame"], "PlayerScore").Text = "" - entry["TeamScore"] = nil + WaitForChild(entry.Frame, "PlayerScore").Text = "" + entry.TeamScore = nil end end function TeamChanged(entry, property) if property == "Name" then - WaitForChild(WaitForChild(entry["Frame"], "TitleFrame"), "Title").Text = - entry["MyTeam"].Name + WaitForChild(WaitForChild(entry.Frame, "TitleFrame"), "Title").Text = + entry.MyTeam.Name elseif property == "TeamColor" then - entry["Frame"].ClickListener.BackgroundColor3 = - entry["MyTeam"].TeamColor.Color + entry.Frame.ClickListener.BackgroundColor3 = + entry.MyTeam.TeamColor.Color for _, i in pairs(TeamFrames) do - if i["MyTeam"].TeamColor == entry["MyTeam"] then - RemoveTeamFrame(entry["MyTeam"]) --NO DUPLICATE TEAMS! + if i.MyTeam.TeamColor == entry.MyTeam then + RemoveTeamFrame(entry.MyTeam) --NO DUPLICATE TEAMS! end end - entry["MyPlayers"] = {} + entry.MyPlayers = {} for _, i in pairs(PlayerFrames) do SetPlayerToTeam(i) @@ -3300,40 +3279,40 @@ function InsertTeamFrame(nteam) AddingFrameLock = true --for _,i in pairs(TeamFrames) do local nentry = {} - nentry["MyTeam"] = nteam - nentry["MyPlayers"] = {} - nentry["Frame"] = MiddleTemplate:Clone() - WaitForChild(WaitForChild(nentry["Frame"], "TitleFrame"), "Title").Text = + nentry.MyTeam = nteam + nentry.MyPlayers = {} + nentry.Frame = MiddleTemplate:Clone() + WaitForChild(WaitForChild(nentry.Frame, "TitleFrame"), "Title").Text = nteam.Name - nentry["Frame"].TitleFrame.Title.Font = "ArialBold" - nentry["Frame"].TitleFrame.Title.FontSize = "Size18" - nentry["Frame"].TitleFrame.Position = UDim2.new( - nentry["Frame"].TitleFrame.Position.X.Scale, - nentry["Frame"].TitleFrame.Position.X.Offset, + nentry.Frame.TitleFrame.Title.Font = "ArialBold" + nentry.Frame.TitleFrame.Title.FontSize = "Size18" + nentry.Frame.TitleFrame.Position = UDim2.new( + nentry.Frame.TitleFrame.Position.X.Scale, + nentry.Frame.TitleFrame.Position.X.Offset, 0.1, 0 ) - nentry["Frame"].TitleFrame.Size = UDim2.new( - nentry["Frame"].TitleFrame.Size.X.Scale, - nentry["Frame"].TitleFrame.Size.X.Offset, + nentry.Frame.TitleFrame.Size = UDim2.new( + nentry.Frame.TitleFrame.Size.X.Scale, + nentry.Frame.TitleFrame.Size.X.Offset, 0.8, 0 ) - nentry["Frame"].Position = - UDim2.new(1, 0, (#MiddleFrames * nentry["Frame"].Size.Y.Scale), 0) - WaitForChild(nentry["Frame"], "ClickListener").MouseButton1Down:connect( + nentry.Frame.Position = + UDim2.new(1, 0, (#MiddleFrames * nentry.Frame.Size.Y.Scale), 0) + WaitForChild(nentry.Frame, "ClickListener").MouseButton1Down:connect( function(nx, ny) StartDrag(nentry, nx, ny) end ) - nentry["Frame"].ClickListener.BackgroundColor3 = nteam.TeamColor.Color - nentry["Frame"].ClickListener.BackgroundTransparency = 0.7 - nentry["Frame"].ClickListener.AutoButtonColor = false - AddId = AddId + 1 - nentry["ID"] = AddId - nentry["AutoHide"] = false + nentry.Frame.ClickListener.BackgroundColor3 = nteam.TeamColor.Color + nentry.Frame.ClickListener.BackgroundTransparency = 0.7 + nentry.Frame.ClickListener.AutoButtonColor = false + AddId += 1 + nentry.ID = AddId + nentry.AutoHide = false if nteam:FindFirstChild "AutoHide" then - nentry["AutoHide"] = true + nentry.AutoHide = true end if nteam:FindFirstChild "TeamScore" then TeamChildAdded(nentry, nteam.TeamScore) @@ -3350,18 +3329,15 @@ function InsertTeamFrame(nteam) end) for _, i in pairs(PlayerFrames) do - if - not i["Player"].Neutral - and i["Player"].TeamColor == nteam.TeamColor - then + if not i.Player.Neutral and i.Player.TeamColor == nteam.TeamColor then AddPlayerToTeam(nentry, i) end end - nentry["IsHidden"] = false - if not nentry["AutoHide"] or #nentry["MyPlayers"] > 0 then - nentry["Frame"].Parent = ListFrame - nentry["Frame"]:TweenPosition( - UDim2.new(0.5, 0, (#MiddleFrames * nentry["Frame"].Size.Y.Scale), 0), + nentry.IsHidden = false + if not nentry.AutoHide or #nentry.MyPlayers > 0 then + nentry.Frame.Parent = ListFrame + nentry.Frame:TweenPosition( + UDim2.new(0.5, 0, (#MiddleFrames * nentry.Frame.Size.Y.Scale), 0), "Out", "Linear", BASE_TWEEN, @@ -3369,8 +3345,8 @@ function InsertTeamFrame(nteam) ) AddMiddleBGFrame() else - nentry["IsHidden"] = true - nentry["Frame"].Parent = nil + nentry.IsHidden = true + nentry.Frame.Parent = nil end table.insert(TeamFrames, nentry) @@ -3396,9 +3372,9 @@ function RemoveTeamFrame(nteam) -- end local myEntry for i, key in ipairs(TeamFrames) do - if nteam == key["MyTeam"] then + if nteam == key.MyTeam then myEntry = key - key["Frame"]:Destroy() + key.Frame:Destroy() table.remove(TeamFrames, i) end end @@ -3408,7 +3384,7 @@ function RemoveTeamFrame(nteam) RemoveNeutralTeam() end end - for i, key in ipairs(myEntry["MyPlayers"]) do + for i, key in ipairs(myEntry.MyPlayers) do RemovePlayerFromTeam(myEntry, i) PlayerChanged(key, "TeamColor") end diff --git a/lua/53878057.lua b/lua/53878057.lua index c354fe1..4137e9f 100644 --- a/lua/53878057.lua +++ b/lua/53878057.lua @@ -42,15 +42,15 @@ end local function moveHealthBar(pGui) waitForChild(pGui, "HealthGUI") - waitForChild(pGui["HealthGUI"], "tray") - local tray = pGui["HealthGUI"]["tray"] + waitForChild(pGui.HealthGUI, "tray") + local tray = pGui.HealthGUI.tray tray.Position = UDim2.new(0.5, -85, 1, -26) end local function setHealthBarVisible(pGui, visible) waitForChild(pGui, "HealthGUI") - waitForChild(pGui["HealthGUI"], "tray") - local tray = pGui["HealthGUI"]["tray"] + waitForChild(pGui.HealthGUI, "tray") + local tray = pGui.HealthGUI.tray tray.Visible = visible end @@ -92,8 +92,7 @@ if robloxGui.AbsoluteSize.Y <= 320 then maxNumLoadoutItems = 4 end -local characterChildAddedCon -local backpackChildCon +local characterChildAddedCon, backpackChildCon local debounce = false @@ -147,8 +146,8 @@ function unregisterNumberKeys() end function characterInWorkspace() - if game.Players["LocalPlayer"] then - if game.Players.LocalPlayer["Character"] then + if game.Players.LocalPlayer then + if game.Players.LocalPlayer.Character then if game.Players.LocalPlayer.Character ~= nil then if game.Players.LocalPlayer.Character.Parent ~= nil then return true @@ -751,7 +750,7 @@ local addingPlayerChild = function( gearClone.MouseEnter:connect(function() if gearClone.GearReference - and gearClone.GearReference.Value["ToolTip"] + and gearClone.GearReference.Value.ToolTip and gearClone.GearReference.Value.ToolTip ~= "" then showToolTip(gearClone, gearClone.GearReference.Value.ToolTip) @@ -761,7 +760,7 @@ local addingPlayerChild = function( gearClone.MouseLeave:connect(function() if gearClone.GearReference - and gearClone.GearReference.Value["ToolTip"] + and gearClone.GearReference.Value.ToolTip and gearClone.GearReference.Value.ToolTip ~= "" then hideToolTip(gearClone, gearClone.GearReference.Value.ToolTip) diff --git a/lua/60595411.lua b/lua/60595411.lua index b013cab..9666814 100644 --- a/lua/60595411.lua +++ b/lua/60595411.lua @@ -200,7 +200,7 @@ function StringReader:Peek() end function StringReader:Next() - self.i = self.i + 1 + self.i += 1 if self.i <= #self.s then return string.sub(self.s, self.i, self.i) end @@ -629,7 +629,7 @@ t.SelectTerrainRegion = function( -- helper function to update tag function incrementAliveCounter() - aliveCounter = aliveCounter + 1 + aliveCounter += 1 if aliveCounter > 1000000 then aliveCounter = 0 end diff --git a/lua/60595695.lua b/lua/60595695.lua index 97fd97d..9b773b0 100644 --- a/lua/60595695.lua +++ b/lua/60595695.lua @@ -8,7 +8,7 @@ local sc = game:GetService "ScriptContext" local tries = 0 while not sc and tries < 3 do - tries = tries + 1 + tries += 1 sc = game:GetService "ScriptContext" wait(0.2) end diff --git a/lua/73157242.lua b/lua/73157242.lua index 77aea71..188b02b 100644 --- a/lua/73157242.lua +++ b/lua/73157242.lua @@ -363,8 +363,8 @@ local function getBoundingBox2(partOrModel) 4 * math.ceil(actualBox.z / 4) ) local adjustment = containingGridBox - actualBox - minVec = minVec - 0.5 * adjustment * justify - maxVec = maxVec + 0.5 * adjustment * (two - justify) + minVec -= 0.5 * adjustment * justify + maxVec += 0.5 * adjustment * (two - justify) end return minVec, maxVec @@ -510,7 +510,7 @@ local function findConfigAtMouseTarget(Mouse, stampData) error "findConfigAtMouseTarget: stampData is nil" return nil end - if not stampData["CurrentParts"] then + if not stampData.CurrentParts then return nil end @@ -658,10 +658,8 @@ local function findConfigAtMouseTarget(Mouse, stampData) clampToSurface = Vector3.new(1, 1, 0) end - targetRefPointInTarget = targetRefPointInTarget * (0.5 * diagBBTarget) - + 0.5 * (maxBBTarget + minBBTarget) - insertRefPointInInsert = insertRefPointInInsert * (0.5 * diagBB) - + 0.5 * (maxBB + minBB) + targetRefPointInTarget *= (0.5 * diagBBTarget) + 0.5 * (maxBBTarget + minBBTarget) + insertRefPointInInsert *= (0.5 * diagBB) + 0.5 * (maxBB + minBB) -- To Do: For cases that are not aligned to the world grid, account for the minimal rotation -- needed to bring the Insert part(s) into alignment with the Target Part @@ -673,7 +671,7 @@ local function findConfigAtMouseTarget(Mouse, stampData) grid * math.modf(delta.y / grid), grid * math.modf(delta.z / grid) ) - deltaClamped = deltaClamped * clampToSurface + deltaClamped *= clampToSurface local targetTouchInTarget = deltaClamped + targetRefPointInTarget local TargetTouchRelToWorld = @@ -903,7 +901,7 @@ t.GetStampModel = function(assetId, terrainShape, useAssetVersionId) while loading and totalTime < maxWait do lastGameTime = tick() wait(1) - totalTime = totalTime + tick() - lastGameTime + totalTime += tick() - lastGameTime end loading = false @@ -1163,7 +1161,7 @@ t.SetupStamperDragger = function( line2 = HighScalabilityLine.End - HighScalabilityLine.MorePoints[1] -- take out any component of line2 along line1, so you get perpendicular to line1 component - line2 = line2 - line.unit * line.unit:Dot(line2) + line2 -= line.unit * line.unit:Dot(line2) tempCFrame = CFrame.new( HighScalabilityLine.Start, @@ -1178,9 +1176,9 @@ t.SetupStamperDragger = function( local yComp = yAxis:Dot(line2) if math.abs(yComp) > math.abs(xComp) then - line2 = line2 - xAxis * xComp + line2 -= xAxis * xComp else - line2 = line2 - yAxis * yComp + line2 -= yAxis * yComp end HighScalabilityLine.InternalLine = line2 @@ -1190,8 +1188,8 @@ t.SetupStamperDragger = function( line3 = HighScalabilityLine.End - HighScalabilityLine.MorePoints[2] -- zero out all components of previous lines - line3 = line3 - line.unit * line.unit:Dot(line3) - line3 = line3 - line2.unit * line2.unit:Dot(line3) + line3 -= line.unit * line.unit:Dot(line3) + line3 -= line2.unit * line2.unit:Dot(line3) HighScalabilityLine.InternalLine = line3 end @@ -1225,7 +1223,7 @@ t.SetupStamperDragger = function( -- make player able to see this ish local gui - if game.Players["LocalPlayer"] then + if game.Players.LocalPlayer then gui = game.Players.LocalPlayer:FindFirstChild "PlayerGui" if gui and gui:IsA "PlayerGui" then if @@ -1309,7 +1307,7 @@ t.SetupStamperDragger = function( end local ry = math.pi / 2 - gInitial90DegreeRotations = gInitial90DegreeRotations + numRotations + gInitial90DegreeRotations += numRotations if stampData.CurrentParts:IsA "Model" or stampData.CurrentParts:IsA "Tool" @@ -1336,8 +1334,8 @@ t.SetupStamperDragger = function( currModelCFrame = stampData.CurrentParts.CFrame end - minBB = minBB + targetCFrame.p - currModelCFrame.p - maxBB = maxBB + targetCFrame.p - currModelCFrame.p + minBB += targetCFrame.p - currModelCFrame.p + maxBB += targetCFrame.p - currModelCFrame.p -- don't drag into terrain if @@ -1521,13 +1519,13 @@ t.SetupStamperDragger = function( end local function setupKeyListener(key, Mouse) - if control and control["Paused"] then + if control and control.Paused then return end -- don't do this if we have no stamp key = string.lower(key) if key == "r" and not autoAlignToFace(stampData.CurrentParts) then -- rotate the model - gInitial90DegreeRotations = gInitial90DegreeRotations + 1 + gInitial90DegreeRotations += 1 -- Update orientation value if this is a fake terrain part local clusterValues = @@ -1600,13 +1598,13 @@ t.SetupStamperDragger = function( local function flashRedBox() local gui = game.CoreGui if game:FindFirstChild "Players" then - if game.Players["LocalPlayer"] then + if game.Players.LocalPlayer then if game.Players.LocalPlayer:FindFirstChild "PlayerGui" then gui = game.Players.LocalPlayer.PlayerGui end end end - if not stampData["ErrorBox"] then + if not stampData.ErrorBox then return end @@ -1619,16 +1617,16 @@ t.SetupStamperDragger = function( delay(0, function() for _ = 1, 3 do - if stampData["ErrorBox"] then + if stampData.ErrorBox then stampData.ErrorBox.Visible = true end wait(0.13) - if stampData["ErrorBox"] then + if stampData.ErrorBox then stampData.ErrorBox.Visible = false end wait(0.13) end - if stampData["ErrorBox"] then + if stampData.ErrorBox then stampData.ErrorBox.Adornee = nil stampData.ErrorBox.Parent = Tool end @@ -1778,7 +1776,7 @@ t.SetupStamperDragger = function( * (gStaticTrans - gDesiredTrans) ) if - stampData["TransparencyTable"] + stampData.TransparencyTable and stampData.TransparencyTable[part] then part.Transparency = newTrans @@ -1790,7 +1788,7 @@ t.SetupStamperDragger = function( end if part and part:IsA "BasePart" then if - stampData["TransparencyTable"] + stampData.TransparencyTable and stampData.TransparencyTable[part] then part.Transparency = gDesiredTrans @@ -2163,7 +2161,7 @@ t.SetupStamperDragger = function( end end end - stepVect[1] = stepVect[1] + incrementVect[1] + stepVect[1] += incrementVect[1] end if incrementVect[2] then while @@ -2173,7 +2171,7 @@ t.SetupStamperDragger = function( ) == 0 do - innerStepVectIndex = innerStepVectIndex + 1 + innerStepVectIndex += 1 end if innerStepVectIndex < 4 then stepVect[2] = stepVect[2] @@ -2182,7 +2180,7 @@ t.SetupStamperDragger = function( incrementVect[2] ) end - innerStepVectIndex = innerStepVectIndex + 1 + innerStepVectIndex += 1 else stepVect[2] = Vector3.new(1, 0, 0) innerStepVectIndex = 4 -- skip all remaining loops @@ -2202,7 +2200,7 @@ t.SetupStamperDragger = function( ) == 0 do - outerStepVectIndex = outerStepVectIndex + 1 + outerStepVectIndex += 1 end if outerStepVectIndex < 4 then stepVect[3] = stepVect[3] @@ -2211,7 +2209,7 @@ t.SetupStamperDragger = function( incrementVect[3] ) end - outerStepVectIndex = outerStepVectIndex + 1 + outerStepVectIndex += 1 else -- skip all remaining loops stepVect[3] = Vector3.new(1, 0, 0) outerStepVectIndex = 4 @@ -2395,8 +2393,8 @@ t.SetupStamperDragger = function( -- something will be stamped! so set the "StampedSomething" toggle to true if game:FindFirstChild "Players" then - if game.Players["LocalPlayer"] then - if game.Players.LocalPlayer["Character"] then + if game.Players.LocalPlayer then + if game.Players.LocalPlayer.Character then local localChar = game.Players.LocalPlayer.Character local stampTracker = localChar:FindFirstChild "StampTracker" if stampTracker and not stampTracker.Value then @@ -2545,7 +2543,7 @@ t.SetupStamperDragger = function( local function getPlayer() if game:FindFirstChild "Players" then - if game.Players["LocalPlayer"] then + if game.Players.LocalPlayer then return game.Players.LocalPlayer end end @@ -2584,7 +2582,7 @@ t.SetupStamperDragger = function( if playerNameTag ~= nil then if game:FindFirstChild "Players" - and game.Players["LocalPlayer"] + and game.Players.LocalPlayer then tempPlayerValue = game.Players.LocalPlayer if tempPlayerValue ~= nil then @@ -2717,8 +2715,8 @@ t.SetupStamperDragger = function( { Vector3.new(1, 0, 0), Vector3.new(0, 1, 0), Vector3.new(0, 0, 1) } -- maybe last one is negative? TODO: check this! local isPositive = 1 if whichSurface < 0 then - isPositive = isPositive * -1 - whichSurface = whichSurface * -1 + isPositive *= -1 + whichSurface *= -1 end local surfaceNormal = isPositive * modelCFrame:vectorToWorldSpace(AXIS_VECTORS[whichSurface]) @@ -2967,14 +2965,14 @@ t.SetupStamperDragger = function( errorBox:Destroy() end if stampData then - if stampData["Dragger"] then + if stampData.Dragger then stampData.Dragger:Destroy() end if stampData.CurrentParts then stampData.CurrentParts:Destroy() end end - if control and control["Stamped"] then + if control and control.Stamped then control.Stamped:Destroy() end control = nil diff --git a/lua/89449008.lua b/lua/89449008.lua index 95a352f..bf7b33e 100644 --- a/lua/89449008.lua +++ b/lua/89449008.lua @@ -49,9 +49,7 @@ local browsingMenu = false local mouseEnterCons = {} local mouseClickCons = {} -local characterChildAddedCon -local characterChildRemovedCon -local backpackAddCon +local characterChildAddedCon, characterChildRemovedCon, backpackAddCon local playerBackpack = waitForChild(player, "Backpack") @@ -346,13 +344,13 @@ function resizeGrid() local beginPos buttonClone.DragBegin:connect(function(value) waitForChild(buttonClone, "Background") - buttonClone["Background"].ZIndex = 10 + buttonClone.Background.ZIndex = 10 buttonClone.ZIndex = 10 beginPos = value end) buttonClone.DragStopped:connect(function(x, y) waitForChild(buttonClone, "Background") - buttonClone["Background"].ZIndex = 1 + buttonClone.Background.ZIndex = 1 buttonClone.ZIndex = 2 if beginPos ~= buttonClone.Position then if not checkForSwap(buttonClone, x, y) then @@ -994,7 +992,7 @@ if not backpack.Visible then end -- make sure that inventory is listening to gear reparenting -if characterChildAddedCon == nil and game.Players.LocalPlayer["Character"] then +if characterChildAddedCon == nil and game.Players.LocalPlayer.Character then setupCharacterConnections() end if not backpackAddCon then diff --git a/lua/89449093.lua b/lua/89449093.lua index 171feaf..cb4aefd 100644 --- a/lua/89449093.lua +++ b/lua/89449093.lua @@ -221,7 +221,7 @@ function toggleBackpack() if not game.Players.LocalPlayer then return end - if not game.Players.LocalPlayer["Character"] then + if not game.Players.LocalPlayer.Character then return end if not canToggle then @@ -477,7 +477,7 @@ backpackButton.MouseButton1Click:connect(function() toggleBackpack() end) -if game.Players.LocalPlayer["Character"] then +if game.Players.LocalPlayer.Character then activateBackpack() end diff --git a/lua/97188756.lua b/lua/97188756.lua index 90194a4..0c68380 100644 --- a/lua/97188756.lua +++ b/lua/97188756.lua @@ -921,12 +921,12 @@ local function GetNameValue(pName) local cValue = string.byte(string.sub(pName, index, index)) local reverseIndex = #pName - index + 1 if #pName % 2 == 1 then - reverseIndex = reverseIndex - 1 + reverseIndex -= 1 end if reverseIndex % 4 >= 2 then cValue = -cValue end - value = value + cValue + value += cValue end return value % 8 end @@ -994,9 +994,9 @@ end -- local next = self.MessageQueue[i].Next -- local previous = self.MessageQueue[i].Previous -- if label and label:IsA('TextLabel') or label:IsA('TextButton') then --- if value > 0 and previous and previous['Message'] then +-- if value > 0 and previous and previous.Message then -- label.Position = previous['Message'].Position --- elseif value < 1 and next['Message'] then +-- elseif value < 1 and next.Message then -- label.Position = previous['Message'].Position -- end -- end @@ -1026,7 +1026,7 @@ function Chat:UpdateQueue(field, diff) self.Configuration.XScale, 0, label.Position.Y.Scale - - field["Message"].Size.Y.Scale, + - field.Message.Size.Y.Scale, 0 ) -- Just to show up popping effect for the latest message in chat @@ -1037,7 +1037,7 @@ function Chat:UpdateQueue(field, diff) - 0.2 wait(0.03) end - if label == field["Message"] then + if label == field.Message then label.TextStrokeTransparency = 0.8 else label.TextStrokeTransparency = 1 @@ -1048,7 +1048,7 @@ function Chat:UpdateQueue(field, diff) self.Configuration.XScale, 0, label.Position.Y.Scale - - field["Message"].Size.Y.Scale, + - field.Message.Size.Y.Scale, 0 ) end @@ -1141,7 +1141,7 @@ function Chat:UpdateChat(cPlayer, message) Chat.MessageThread = coroutine.create(function() for i = 1, #Chat.Messages_List do local field = Chat.Messages_List[i] - Chat:CreateMessage(field["Player"], field["Message"]) + Chat:CreateMessage(field.Player, field.Message) end Chat.Messages_List = {} end) @@ -1306,9 +1306,9 @@ function Chat:CreateMessage(cPlayer, message) pLabel.Size = mLabel.Size local queueField = {} - queueField["Player"] = pLabel - queueField["Message"] = mLabel - queueField["SpawnTime"] = tick() -- Used for identifying when to make the message invisible + queueField.Player = pLabel + queueField.Message = mLabel + queueField.SpawnTime = tick() -- Used for identifying when to make the message invisible table.insert(self.MessageQueue, 1, queueField) Chat:UpdateQueue(queueField) @@ -1317,7 +1317,7 @@ end function Chat:ScreenSizeChanged() wait() while self.Frame.AbsoluteSize.Y > 120 do - self.Frame.Size = self.Frame.Size - UDim2.new(0, 0, 0.005, 0) + self.Frame.Size -= UDim2.new(0, 0, 0.005, 0) end Chat:RecalculateSpacing() end @@ -1374,7 +1374,7 @@ function Chat:CreateSafeChatOptions(list, rootButton) ), } - count = count + 1 + count += 1 if type(list[msg]) == "table" then text_List[rootButton][chatText] = @@ -1438,7 +1438,7 @@ function Chat:FocusOnChatBar() end self.GotFocus = true - if self.Frame["Background"] then + if self.Frame.Background then self.Frame.Background.Visible = false end self.ChatBar:CaptureFocus() @@ -1675,12 +1675,12 @@ function Input:OnMouseScroll() while Input.Speed ~= 0 do if Input.Speed > 1 then while Input.Speed > 0 do - Input.Speed = Input.Speed - 1 + Input.Speed -= 1 wait(0.25) end elseif Input.Speed < 0 then while Input.Speed < 0 do - Input.Speed = Input.Speed + 1 + Input.Speed += 1 wait(0.25) end end @@ -1694,7 +1694,7 @@ function Input:OnMouseScroll() end function Input:ApplySpeed(value) - Input.Speed = Input.Speed + value + Input.Speed += value if not self.Simulating then Input:OnMouseScroll() end @@ -1770,14 +1770,14 @@ function Chat:CullThread() if #self.MessageQueue > 0 then for _, field in pairs(self.MessageQueue) do if - field["SpawnTime"] - and field["Player"] - and field["Message"] - and tick() - field["SpawnTime"] + field.SpawnTime + and field.Player + and field.Message + and tick() - field.SpawnTime > self.Configuration.LifeTime then - field["Player"].Visible = false - field["Message"].Visible = false + field.Player.Visible = false + field.Message.Visible = false end end end diff --git a/lua/host.lua b/lua/host.lua index 7808ae2..c121fba 100644 --- a/lua/host.lua +++ b/lua/host.lua @@ -181,8 +181,8 @@ settings().Diagnostics.LuaRamLimit = 0 --settings().Network.SendRate = 35 --settings().Network.PhysicsSend = 0 -- 1==RoundRobin ---shared["__time"] = 0 ---game:GetService("RunService").Stepped:connect(function (time) shared["__time"] = time end) +--shared.__time = 0 +--game:GetService("RunService").Stepped:connect(function (time) shared.__time = time end) if placeId ~= nil and killID ~= nil and deathID ~= nil and url ~= nil then -- listen for the death of a Player