From bb1eb0faa63b71083627c7be2bc0c29fb87af518 Mon Sep 17 00:00:00 2001 From: Lewin Kelly Date: Sat, 8 Apr 2023 08:13:02 +0100 Subject: [PATCH] Fuck with the CoreScripts despite task telling me very clearly not to fuck with the corescripts --- 107893730.lua | 760 ++-- 152908679.lua | 100 +- 153556783.lua | 457 ++- 157877000.lua | 1012 +++--- 36868950.lua | 76 +- 37801172.lua | 94 +- 38037565.lua | 323 +- 39250920.lua | 350 +- 45284430.lua | 2675 ++++++++------ 45374389.lua | 31 +- 46295863.lua | 2484 +++++++------ 48488235.lua | 2921 ++++++++------- 48488398.lua | 317 +- 48488451.lua | 40 +- 53878047.lua | 1569 ++++---- 53878057.lua | 867 +++-- 59002209.lua | 1 - 60595411.lua | 640 ++-- 60595695.lua | 10 +- 73157242.lua | 1535 ++++---- 89449008.lua | 529 +-- 89449093.lua | 288 +- 97188756.lua | 2359 +++++++----- mercury.yml | 9505 +++++++++++++++++++++++++++++++++++++++++++++++++ selene.toml | 1 + stylua.toml | 6 + 26 files changed, 20382 insertions(+), 8568 deletions(-) create mode 100644 mercury.yml create mode 100644 selene.toml create mode 100644 stylua.toml diff --git a/107893730.lua b/107893730.lua index 189c6cf..51e23ed 100644 --- a/107893730.lua +++ b/107893730.lua @@ -4,13 +4,13 @@ while not Game do wait(0.1) end -while not game:GetService("MarketplaceService") do +while not game:GetService "MarketplaceService" do wait(0.1) end -while not game:FindFirstChild("CoreGui") do +while not game:FindFirstChild "CoreGui" do wait(0.1) end -while not game.CoreGui:FindFirstChild("RobloxGui") do +while not game.CoreGui:FindFirstChild "RobloxGui" do wait(0.1) end @@ -22,7 +22,7 @@ local baseUrl = game:GetService("ContentProvider").BaseUrl:lower() -- data variables local currentProductInfo, currentAssetId, currentCurrencyType, currentCurrencyAmount, currentEquipOnPurchase, currentProductId, currentServerResponseTable local checkingPlayerFunds = false -local openBCUpSellWindowConnection = nil +local openBCUpSellWindowConnection = nil local purchasingConsumable = false local enableBrowserWindowClosedEvent = true @@ -31,8 +31,8 @@ local openBuyCurrencyWindowConnection = nil local currentlyPrompting = false local purchaseDialog, errorDialog = nil local tweenTime = 0.3 -local showPosition = UDim2.new(0.5,-330,0.5,-200) -local hidePosition = UDim2.new(0.5,-330,1,25) +local showPosition = UDim2.new(0.5, -330, 0.5, -200) +local hidePosition = UDim2.new(0.5, -330, 1, 25) local isSmallScreen = nil local spinning = false local spinnerIcons = nil @@ -40,19 +40,31 @@ local smallScreenThreshold = 450 -- user facing images local assetUrls = {} -local assetUrl = "http://www.roblox.com/Asset/?id=" -local errorImageUrl = assetUrl .. "42557901" table.insert(assetUrls, errorImageUrl) -local buyImageUrl = assetUrl .. "104651457" table.insert(assetUrls,buyImageUrl) -local buyImageDownUrl = assetUrl .. "104651515" table.insert(assetUrls, buyImageDownUrl) -local buyImageDisabledUrl = assetUrl .. "104651532" table.insert(assetUrls, buyImageDisabledUrl) -local cancelButtonImageUrl = assetUrl .. "104651592" table.insert(assetUrls, cancelButtonImageUrl) -local cancelButtonDownUrl = assetUrl .. "104651639" table.insert(assetUrls, cancelButtonDownUrl) -local okButtonUrl = assetUrl .. "104651665" table.insert(assetUrls, okButtonUrl) -local okButtonPressedrl = assetUrl .."104651707" table.insert(assetUrls, okButtonPressedrl) -local freeButtonImageUrl = assetUrl .. "104651733" table.insert(assetUrls, freeButtonImageUrl) -local freeButtonImageDownUrl = assetUrl .. "104651761" table.insert(assetUrls, freeButtonImageDownUrl) -local tixIcon = assetUrl .. "102481431" table.insert(assetUrls,tixIcon) -local robuxIcon = assetUrl .. "102481419" table.insert(assetUrls,robuxIcon) +local assetUrl = "http://www.roblox.com/Asset/?id=" +local errorImageUrl = assetUrl .. "42557901" +table.insert(assetUrls, errorImageUrl) +local buyImageUrl = assetUrl .. "104651457" +table.insert(assetUrls, buyImageUrl) +local buyImageDownUrl = assetUrl .. "104651515" +table.insert(assetUrls, buyImageDownUrl) +local buyImageDisabledUrl = assetUrl .. "104651532" +table.insert(assetUrls, buyImageDisabledUrl) +local cancelButtonImageUrl = assetUrl .. "104651592" +table.insert(assetUrls, cancelButtonImageUrl) +local cancelButtonDownUrl = assetUrl .. "104651639" +table.insert(assetUrls, cancelButtonDownUrl) +local okButtonUrl = assetUrl .. "104651665" +table.insert(assetUrls, okButtonUrl) +local okButtonPressedrl = assetUrl .. "104651707" +table.insert(assetUrls, okButtonPressedrl) +local freeButtonImageUrl = assetUrl .. "104651733" +table.insert(assetUrls, freeButtonImageUrl) +local freeButtonImageDownUrl = assetUrl .. "104651761" +table.insert(assetUrls, freeButtonImageDownUrl) +local tixIcon = assetUrl .. "102481431" +table.insert(assetUrls, tixIcon) +local robuxIcon = assetUrl .. "102481419" +table.insert(assetUrls, robuxIcon) -- user facing string local buyHeaderText = "Buy" @@ -63,27 +75,25 @@ local errorPurchasesDisabledText = "in-game purchases are disabled" local errorPurchasesUnknownText = "Roblox is performing maintenance" local purchaseSucceededText = "Your purchase of itemName succeeded!" -local purchaseFailedText = "Your purchase of itemName failed because errorReason. Your account has not been charged. Please try again soon." -local itemPurchaseText = "Would you like to buy the assetType 'itemName' for currencyType currencyAmount?" +local purchaseFailedText = + "Your purchase of itemName failed because errorReason. Your account has not been charged. Please try again soon." local productPurchaseText = "Would you like to buy 'itemName' for currencyType currencyAmount?" local freeItemPurchaseText = "Would you like to take the assetType 'itemName' for FREE?" local freeItemBalanceText = "Your balance of Robux or Tix will not be affected by this transaction." -local buildsClubUpsellText = "You don't have the appropriate membership to buy this item. Please click here to upgrade your builders club" -------------------------------- End Global Variables ---------------------------------------- - ----------------------------- Util Functions --------------------------------------------- function getSecureApiBaseUrl() local secureApiUrl = baseUrl - secureApiUrl = string.gsub(secureApiUrl,"http","https") - secureApiUrl = string.gsub(secureApiUrl,"www","api") + secureApiUrl = string.gsub(secureApiUrl, "http", "https") + secureApiUrl = string.gsub(secureApiUrl, "www", "api") return secureApiUrl end function getRbxUtility() if not RbxUtility then - RbxUtility = LoadLibrary("RbxUtility") + RbxUtility = LoadLibrary "RbxUtility" end return RbxUtility end @@ -95,7 +105,6 @@ function preloadAssets() end ----------------------------- End Util Functions --------------------------------------------- - -------------------------------- Accept/Decline Functions -------------------------------------- function removeCurrentPurchaseInfo() currentAssetId = nil @@ -110,19 +119,27 @@ function removeCurrentPurchaseInfo() end function closePurchasePrompt() - purchaseDialog:TweenPosition(hidePosition, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTime, true, function() - game.GuiService:RemoveCenterDialog(purchaseDialog) - hidePurchasing() - purchaseDialog.Visible = false - currentlyPrompting = false - end) + purchaseDialog:TweenPosition( + hidePosition, + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + tweenTime, + true, + function() + game.GuiService:RemoveCenterDialog(purchaseDialog) + hidePurchasing() + purchaseDialog.Visible = false + currentlyPrompting = false + end + ) end function userPurchaseActionsEnded(isSuccess) checkingPlayerFunds = false if isSuccess then -- show the user we bought the item successfully, when they close this dialog we will call signalPromptEnded - local newPurchasedSucceededText = string.gsub( purchaseSucceededText,"itemName", tostring(currentProductInfo["Name"])) + local newPurchasedSucceededText = + string.gsub(purchaseSucceededText, "itemName", tostring(currentProductInfo["Name"])) purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton) hidePurchasing() @@ -134,9 +151,11 @@ end function signalPromptEnded(isSuccess) closePurchasePrompt() if purchasingConsumable then - game:GetService("MarketplaceService"):SignalPromptProductPurchaseFinished(game.Players.LocalPlayer.userId, currentProductId, isSuccess) + game:GetService("MarketplaceService") + :SignalPromptProductPurchaseFinished(game.Players.LocalPlayer.userId, currentProductId, isSuccess) else - game:GetService("MarketplaceService"):SignalPromptPurchaseFinished(game.Players.LocalPlayer, currentAssetId, isSuccess) + game:GetService("MarketplaceService") + :SignalPromptPurchaseFinished(game.Players.LocalPlayer, currentAssetId, isSuccess) end removeCurrentPurchaseInfo() end @@ -151,22 +170,30 @@ function updatePurchasePromptData(toggleColoredText) end if isFreeItem() then - newItemDescription = string.gsub( freeItemPurchaseText,"itemName", tostring(currentProductInfo["Name"])) - newItemDescription = string.gsub( newItemDescription,"assetType", tostring(assetTypeToString(currentProductInfo["AssetTypeId"])) ) + newItemDescription = string.gsub(freeItemPurchaseText, "itemName", tostring(currentProductInfo["Name"])) + newItemDescription = + string.gsub(newItemDescription, "assetType", tostring(assetTypeToString(currentProductInfo["AssetTypeId"]))) setHeaderText(takeHeaderText) else -- otherwise item costs something, so different prompt - newItemDescription = string.gsub( productPurchaseText,"itemName", tostring(currentProductInfo["Name"])) - newItemDescription = string.gsub( newItemDescription,"currencyType", tostring(currencyTypeToString(currentCurrencyType)) ) - newItemDescription = string.gsub( newItemDescription,"currencyAmount", tostring(currentCurrencyAmount)) - setHeaderText(buyHeaderText) + newItemDescription = string.gsub(productPurchaseText, "itemName", tostring(currentProductInfo["Name"])) + newItemDescription = + string.gsub(newItemDescription, "currencyType", tostring(currencyTypeToString(currentCurrencyType))) + newItemDescription = string.gsub(newItemDescription, "currencyAmount", tostring(currentCurrencyAmount)) + setHeaderText(buyHeaderText) end purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newItemDescription if purchasingConsumable then - purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl .. "thumbs/asset.ashx?assetid=" .. tostring(currentProductInfo["IconImageAssetId"]) .. '&x=100&y=100&format=png' + purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl + .. "thumbs/asset.ashx?assetid=" + .. tostring(currentProductInfo["IconImageAssetId"]) + .. "&x=100&y=100&format=png" else - purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl .. "thumbs/asset.ashx?assetid=" .. tostring(currentAssetId) .. '&x=100&y=100&format=png' + purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl + .. "thumbs/asset.ashx?assetid=" + .. tostring(currentAssetId) + .. "&x=100&y=100&format=png" end end @@ -175,65 +202,96 @@ function doPlayerFundsCheck(checkIndefinitely) canPurchase, insufficientFunds = canPurchaseItem() -- check again to see if we can buy item if canPurchase and insufficientFunds then -- wait a bit and try a few more times local retries = 1000 - while (retries > 0 or checkIndefinitely) and insufficientFunds and checkingPlayerFunds and canPurchase do - wait(1/10) + while (retries > 0 or checkIndefinitely) and insufficientFunds and checkingPlayerFunds and canPurchase do + wait(1 / 10) canPurchase, insufficientFunds = canPurchaseItem() retries = retries - 1 end end if canPurchase and not insufficientFunds then -- we can buy item! set our buttons up and we will exit this loop - setButtonsVisible(purchaseDialog.BodyFrame.BuyButton,purchaseDialog.BodyFrame.CancelButton, purchaseDialog.BodyFrame.AfterBalanceButton) + setButtonsVisible( + purchaseDialog.BodyFrame.BuyButton, + purchaseDialog.BodyFrame.CancelButton, + purchaseDialog.BodyFrame.AfterBalanceButton + ) end end end function showPurchasePrompt() - local canPurchase, insufficientFunds, notRightBC, override, descText = canPurchaseItem() + local canPurchase, insufficientFunds, notRightBC, override, descText = canPurchaseItem() if canPurchase then updatePurchasePromptData() - if override and descText then + if override and descText then purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = descText purchaseDialog.BodyFrame.AfterBalanceButton.Visible = false - end - game.GuiService:AddCenterDialog(purchaseDialog, Enum.CenterDialogType.ModalDialog, - --ShowFunction - function() - -- set the state for our buttons - purchaseDialog.Visible = true - if isFreeItem() then - setButtonsVisible(purchaseDialog.BodyFrame.FreeButton, purchaseDialog.BodyFrame.CancelButton, purchaseDialog.BodyFrame.AfterBalanceButton) - elseif notRightBC then - purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade." - if not openBCUpSellWindowConnection then - openBCUpSellWindowConnection = purchaseDialog.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(function() - if purchaseDialog.BodyFrame.AfterBalanceButton.Text == "You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade." then - openBCUpSellWindow() - end - end) - end - setButtonsVisible(purchaseDialog.BodyFrame.BuyDisabledButton, purchaseDialog.BodyFrame.CancelButton, purchaseDialog.BodyFrame.AfterBalanceButton) - elseif insufficientFunds then - setButtonsVisible(purchaseDialog.BodyFrame.BuyDisabledButton, purchaseDialog.BodyFrame.CancelButton, purchaseDialog.BodyFrame.AfterBalanceButton) - elseif override then - setButtonsVisible(purchaseDialog.BodyFrame.BuyDisabledButton, purchaseDialog.BodyFrame.CancelButton) -- , purchaseDialog.BodyFrame.AfterBalanceButton) - else - setButtonsVisible(purchaseDialog.BodyFrame.BuyButton, purchaseDialog.BodyFrame.CancelButton) -- , purchaseDialog.BodyFrame.AfterBalanceButton) - end + end + game.GuiService:AddCenterDialog( + purchaseDialog, + Enum.CenterDialogType.ModalDialog, + --ShowFunction + function() + -- set the state for our buttons + purchaseDialog.Visible = true + if isFreeItem() then + setButtonsVisible( + purchaseDialog.BodyFrame.FreeButton, + purchaseDialog.BodyFrame.CancelButton, + purchaseDialog.BodyFrame.AfterBalanceButton + ) + elseif notRightBC then + purchaseDialog.BodyFrame.AfterBalanceButton.Text = + "You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade." + if not openBCUpSellWindowConnection then + openBCUpSellWindowConnection = purchaseDialog.BodyFrame.AfterBalanceButton.MouseButton1Click:connect( + function() + if + purchaseDialog.BodyFrame.AfterBalanceButton.Text + == "You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade." + then + openBCUpSellWindow() + end + end + ) + end + setButtonsVisible( + purchaseDialog.BodyFrame.BuyDisabledButton, + purchaseDialog.BodyFrame.CancelButton, + purchaseDialog.BodyFrame.AfterBalanceButton + ) + elseif insufficientFunds then + setButtonsVisible( + purchaseDialog.BodyFrame.BuyDisabledButton, + purchaseDialog.BodyFrame.CancelButton, + purchaseDialog.BodyFrame.AfterBalanceButton + ) + elseif override then + setButtonsVisible(purchaseDialog.BodyFrame.BuyDisabledButton, purchaseDialog.BodyFrame.CancelButton) -- , purchaseDialog.BodyFrame.AfterBalanceButton) + else + setButtonsVisible(purchaseDialog.BodyFrame.BuyButton, purchaseDialog.BodyFrame.CancelButton) -- , purchaseDialog.BodyFrame.AfterBalanceButton) + end - purchaseDialog:TweenPosition(showPosition, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTime, true) + purchaseDialog:TweenPosition( + showPosition, + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + tweenTime, + true + ) - if canPurchase and insufficientFunds and not enableBrowserWindowClosedEvent then - checkingPlayerFunds = true - doPlayerFundsCheck(true) - end - end, - --HideFunction - function() - purchaseDialog.Visible = false - end) + if canPurchase and insufficientFunds and not enableBrowserWindowClosedEvent then + checkingPlayerFunds = true + doPlayerFundsCheck(true) + end + end, + --HideFunction + function() + purchaseDialog.Visible = false + end + ) else -- we failed in prompting a purchase, do a decline doDeclinePurchase() end @@ -242,15 +300,17 @@ end -- given an asset id, this function will grab that asset from the website, and return the first "Tool" object found inside it function getToolAssetID(assetID) local newTool = game:GetService("InsertService"):LoadAsset(assetID) - if not newTool then return nil end + if not newTool then + return nil + end - if newTool:IsA("Tool") then + if newTool:IsA "Tool" then return newTool end local toolChildren = newTool:GetChildren() for i = 1, #toolChildren do - if toolChildren[i]:IsA("Tool") then + if toolChildren[i]:IsA "Tool" then return toolChildren[i] end end @@ -258,16 +318,19 @@ function getToolAssetID(assetID) end -- the user tried to purchase by clicking the purchase button, but something went wrong. --- let them know their account was not charged, and that they do not own the item yet. +-- let them know their account was not charged, and that they do not own the item yet. function purchaseFailed(inGamePurchasesDisabled) local name = "Item" - if currentProductInfo then name = currentProductInfo["Name"] end + if currentProductInfo then + name = currentProductInfo["Name"] + end - local newPurchasedFailedText = string.gsub( purchaseFailedText,"itemName", tostring(name)) + local newPurchasedFailedText = string.gsub(purchaseFailedText, "itemName", tostring(name)) if inGamePurchasesDisabled then - newPurchasedFailedText = string.gsub( newPurchasedFailedText,"errorReason", tostring(errorPurchasesDisabledText) ) + newPurchasedFailedText = + string.gsub(newPurchasedFailedText, "errorReason", tostring(errorPurchasesDisabledText)) else - newPurchasedFailedText = string.gsub( newPurchasedFailedText,"errorReason", tostring(errorPurchasesUnknownText) ) + newPurchasedFailedText = string.gsub(newPurchasedFailedText, "errorReason", tostring(errorPurchasesUnknownText)) end purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedFailedText @@ -292,31 +355,42 @@ function doAcceptPurchase(currencyPreferredByUser) -- consumables need to use a different url if purchasingConsumable then - url = getSecureApiBaseUrl() .. "marketplace/submitpurchase?productId=" .. tostring(currentProductId) .. - "¤cyTypeId=" .. tostring(currencyEnumToInt(currentCurrencyType)) .. - "&expectedUnitPrice=" .. tostring(currentCurrencyAmount) .. - "&placeId=" .. tostring(Game.PlaceId) + url = getSecureApiBaseUrl() + .. "marketplace/submitpurchase?productId=" + .. tostring(currentProductId) + .. "¤cyTypeId=" + .. tostring(currencyEnumToInt(currentCurrencyType)) + .. "&expectedUnitPrice=" + .. tostring(currentCurrencyAmount) + .. "&placeId=" + .. tostring(Game.PlaceId) else - url = getSecureApiBaseUrl() .. "marketplace/purchase?productId=" .. tostring(currentProductId) .. - "¤cyTypeId=" .. tostring(currencyEnumToInt(currentCurrencyType)) .. - "&purchasePrice=" .. tostring(currentCurrencyAmount) .. - "&locationType=Game" .. "&locationId=" .. Game.PlaceId + url = getSecureApiBaseUrl() + .. "marketplace/purchase?productId=" + .. tostring(currentProductId) + .. "¤cyTypeId=" + .. tostring(currencyEnumToInt(currentCurrencyType)) + .. "&purchasePrice=" + .. tostring(currentCurrencyAmount) + .. "&locationType=Game" + .. "&locationId=" + .. Game.PlaceId end - local success, reason = ypcall(function() - response = game:HttpPostAsync(url, "RobloxPurchaseRequest") + local success, reason = ypcall(function() + response = game:HttpPostAsync(url, "RobloxPurchaseRequest") end) -- debug output for us (found in the logs from local) - print("doAcceptPurchase success from ypcall is ",success,"reason is",reason) + print("doAcceptPurchase success from ypcall is ", success, "reason is", reason) if (tick() - startTime) < 1 then wait(1) -- allow the purchasing waiting dialog to at least be readable (otherwise it might flash, looks bad)... end -- check to make sure purchase actually happened on the web end - if response == "none" or response == nil or response == '' then - print("did not get a proper response from web on purchase of",currentAssetId,currentProductId) + if response == "none" or response == nil or response == "" then + print("did not get a proper response from web on purchase of", currentAssetId, currentProductId) purchaseFailed() return end @@ -327,13 +401,13 @@ function doAcceptPurchase(currencyPreferredByUser) if response 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") ) + print("web return response of fail on purchase of", currentAssetId, currentProductId) + purchaseFailed((response["status"] == "EconomyDisabled")) return end end else - print("web return response of non parsable JSON on purchase of",currentAssetId) + print("web return response of non parsable JSON on purchase of", currentAssetId) purchaseFailed() return end @@ -348,11 +422,16 @@ function doAcceptPurchase(currencyPreferredByUser) if purchasingConsumable then if not response["receipt"] then - print("tried to buy productId, but no receipt returned. productId was",currentProductId) + print("tried to buy productId, but no receipt returned. productId was", currentProductId) purchaseFailed() return end - Game:GetService("MarketplaceService"):SignalClientPurchaseSuccess( tostring(response["receipt"]), game.Players.LocalPlayer.userId, currentProductId ) + Game:GetService("MarketplaceService") + :SignalClientPurchaseSuccess( + tostring(response["receipt"]), + game.Players.LocalPlayer.userId, + currentProductId + ) else userPurchaseActionsEnded(success) end @@ -364,7 +443,6 @@ function doDeclinePurchase() end -------------------------------- End Accept/Decline Functions -------------------------------------- - ---------------------------------------------- Currency Functions --------------------------------------------- -- enums have no implicit conversion to numbers in lua, has to have a function to do this function currencyEnumToInt(currencyEnum) @@ -377,44 +455,75 @@ end -- oi, this is ugly function assetTypeToString(assetType) - if assetType == 1 then return "Image" - elseif assetType == 2 then return "T-Shirt" - elseif assetType == 3 then return "Audio" - elseif assetType == 4 then return "Mesh" - elseif assetType == 5 then return "Lua" - elseif assetType == 6 then return "HTML" - elseif assetType == 7 then return "Text" - elseif assetType == 8 then return "Hat" - elseif assetType == 9 then return "Place" - elseif assetType == 10 then return "Model" - elseif assetType == 11 then return "Shirt" - elseif assetType == 12 then return "Pants" - elseif assetType == 13 then return "Decal" - elseif assetType == 16 then return "Avatar" - elseif assetType == 17 then return "Head" - elseif assetType == 18 then return "Face" - elseif assetType == 19 then return "Gear" - elseif assetType == 21 then return "Badge" - elseif assetType == 22 then return "Group Emblem" - elseif assetType == 24 then return "Animation" - elseif assetType == 25 then return "Arms" - elseif assetType == 26 then return "Legs" - elseif assetType == 27 then return "Torso" - elseif assetType == 28 then return "Right Arm" - elseif assetType == 29 then return "Left Arm" - elseif assetType == 30 then return "Left Leg" - elseif assetType == 31 then return "Right Leg" - elseif assetType == 32 then return "Package" - elseif assetType == 33 then return "YouTube Video" - elseif assetType == 34 then return "Game Pass" - elseif assetType == 0 then return "Product" + if assetType == 1 then + return "Image" + elseif assetType == 2 then + return "T-Shirt" + elseif assetType == 3 then + return "Audio" + elseif assetType == 4 then + return "Mesh" + elseif assetType == 5 then + return "Lua" + elseif assetType == 6 then + return "HTML" + elseif assetType == 7 then + return "Text" + elseif assetType == 8 then + return "Hat" + elseif assetType == 9 then + return "Place" + elseif assetType == 10 then + return "Model" + elseif assetType == 11 then + return "Shirt" + elseif assetType == 12 then + return "Pants" + elseif assetType == 13 then + return "Decal" + elseif assetType == 16 then + return "Avatar" + elseif assetType == 17 then + return "Head" + elseif assetType == 18 then + return "Face" + elseif assetType == 19 then + return "Gear" + elseif assetType == 21 then + return "Badge" + elseif assetType == 22 then + return "Group Emblem" + elseif assetType == 24 then + return "Animation" + elseif assetType == 25 then + return "Arms" + elseif assetType == 26 then + return "Legs" + elseif assetType == 27 then + return "Torso" + elseif assetType == 28 then + return "Right Arm" + elseif assetType == 29 then + return "Left Arm" + elseif assetType == 30 then + return "Left Leg" + elseif assetType == 31 then + return "Right Leg" + elseif assetType == 32 then + return "Package" + elseif assetType == 33 then + return "YouTube Video" + elseif assetType == 34 then + return "Game Pass" + elseif assetType == 0 then + return "Product" end return "" end function currencyTypeToString(currencyType) - if currencyType == Enum.CurrencyType.Tix then + if currencyType == Enum.CurrencyType.Tix then return "Tix" else return "R$" @@ -453,13 +562,15 @@ end -- will get the player's balance of robux and tix, return in a table function getPlayerBalance() local playerBalance = nil - local success, errorCode = ypcall(function() playerBalance = game:HttpGetAsync(getSecureApiBaseUrl() .. "currency/balance") end) + local success, errorCode = ypcall(function() + playerBalance = game:HttpGetAsync(getSecureApiBaseUrl() .. "currency/balance") + end) if not success then - print("Get player balance failed because",errorCode) + print("Get player balance failed because", errorCode) return nil end - if playerBalance == '' then + if playerBalance == "" then return nil end @@ -475,8 +586,8 @@ function openBuyCurrencyWindow() end function openBCUpSellWindow() - Game:GetService('GuiService'):OpenBrowserWindow(baseUrl .. "Upgrades/BuildersClubMemberships.aspx") -end + Game:GetService("GuiService"):OpenBrowserWindow(baseUrl .. "Upgrades/BuildersClubMemberships.aspx") +end -- set up the gui text at the bottom of the prompt (alerts user to how much money they will have left, or if they need to buy more to buy the item) function updateAfterBalanceText(playerBalance, notRightBc) @@ -504,35 +615,49 @@ function updateAfterBalanceText(playerBalance, notRightBc) local afterBalanceNumber = playerBalanceNumber - currentCurrencyAmount -- check to see if we have enough of the desired currency to allow a purchase, if not we need to prompt user to buy robux - if not notRightBc then + if not notRightBc then if afterBalanceNumber < 0 and keyWord == "robux" then if openBuyCurrencyWindowConnection == nil then - openBuyCurrencyWindowConnection = purchaseDialog.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(openBuyCurrencyWindow) + openBuyCurrencyWindowConnection = + purchaseDialog.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(openBuyCurrencyWindow) end - purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need " .. currencyTypeToString(currentCurrencyType) .. " " .. tostring(-afterBalanceNumber) .. " more to buy this, click here to purchase more." + purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need " + .. currencyTypeToString(currentCurrencyType) + .. " " + .. tostring(-afterBalanceNumber) + .. " more to buy this, click here to purchase more." return true, true elseif afterBalanceNumber < 0 and keyWord == "tickets" then - purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need " .. tostring(-afterBalanceNumber) .. " " .. currencyTypeToString(currentCurrencyType) .. " more to buy this item." + purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need " + .. tostring(-afterBalanceNumber) + .. " " + .. currencyTypeToString(currentCurrencyType) + .. " more to buy this item." return true, true -- user can't buy more tickets, so we say fail the transaction (maybe instead we can prompt them to trade currency???) end - end + end -- this ensures that we only have one connection to openBuyCurrencyWindow at a time (otherwise might open multiple browser windows) - if(openBuyCurrencyWindowConnection) then + if openBuyCurrencyWindowConnection then openBuyCurrencyWindowConnection:disconnect() openBuyCurrencyWindowConnection = nil end - purchaseDialog.BodyFrame.AfterBalanceButton.Text = "Your balance after this transaction will be " .. currencyTypeToString(currentCurrencyType) .. " " .. tostring(afterBalanceNumber) .. "." + purchaseDialog.BodyFrame.AfterBalanceButton.Text = "Your balance after this transaction will be " + .. currencyTypeToString(currentCurrencyType) + .. " " + .. tostring(afterBalanceNumber) + .. "." return true, false 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 + return currentProductInfo + and currentProductInfo["IsForSale"] == true + and currentProductInfo["IsPublicDomain"] == true end ---------------------------------------------- End Currency Functions --------------------------------------------- - ---------------------------------------------- Data Functions ----------------------------------------------------- -- more enum to int fun! @@ -552,61 +677,65 @@ end -- This functions checks to make sure the purchase is even possible, if not it returns false and we don't prompt user (some situations require user feedback when we won't prompt) function canPurchaseItem() - -- first we see if player already owns the asset/get the productinfo - local playerOwnsAsset = false - local notRightBc = false + local playerOwnsAsset = false + local notRightBc = false local descText = nil local success = false if purchasingConsumable then local currentProductInfoRaw = nil - success = ypcall(function() - currentProductInfoRaw = Game:HttpGetAsync(getSecureApiBaseUrl() .. "marketplace/productDetails?productid=" .. tostring(currentProductId)) + success = ypcall(function() + currentProductInfoRaw = Game:HttpGetAsync( + getSecureApiBaseUrl() .. "marketplace/productDetails?productid=" .. tostring(currentProductId) + ) end) if success then currentProductInfo = getRbxUtility().DecodeJSON(currentProductInfoRaw) end else success = ypcall(function() - currentProductInfo = game:GetService("MarketplaceService"):GetProductInfo(currentAssetId) + currentProductInfo = game:GetService("MarketplaceService"):GetProductInfo(currentAssetId) end) end if currentProductInfo == nil or not success then descText = "In-game sales are temporarily disabled. Please try again later." - return true, nil, nil, true, descText + return true, nil, nil, true, descText end if not purchasingConsumable then - if not currentAssetId then - print("current asset id is nil, this should always have a value") + print "current asset id is nil, this should always have a value" return false end if currentAssetId <= 0 then - print("current asset id is negative, this should always be positive") + print "current asset id is negative, this should always be positive" return false end - local success, errorCode = ypcall(function() playerOwnsAsset = game:HttpGetAsync(getSecureApiBaseUrl() - .. "ownership/hasAsset?userId=" - .. tostring(game.Players.LocalPlayer.userId) - .. "&assetId=" .. tostring(currentAssetId)) + local success, errorCode = ypcall(function() + playerOwnsAsset = game:HttpGetAsync( + getSecureApiBaseUrl() + .. "ownership/hasAsset?userId=" + .. tostring(game.Players.LocalPlayer.userId) + .. "&assetId=" + .. tostring(currentAssetId) + ) end) if not success then - print("could not tell if player owns asset because",errorCode) + print("could not tell if player owns asset because", errorCode) return false end - if playerOwnsAsset == true or playerOwnsAsset == "true" then - descText = "You already own this item." - return true, nil, nil, true, descText + if playerOwnsAsset == true or playerOwnsAsset == "true" then + descText = "You already own this item." + return true, nil, nil, true, descText end end - purchaseDialog.BodyFrame.AfterBalanceButton.Visible = true + purchaseDialog.BodyFrame.AfterBalanceButton.Visible = true -- next we parse through product info and see if we can purchase @@ -620,15 +749,20 @@ function canPurchaseItem() end if currentProductInfo["IsForSale"] == false and currentProductInfo["IsPublicDomain"] == false then - descText = "This item is no longer for sale." - return true, nil, nil, true, descText + descText = "This item is no longer for sale." + return true, nil, nil, true, descText end -- 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"])) then - descText = "We could retrieve the price of the item correctly. Please try again later." + if + not setCurrencyAmountAndType( + tonumber(currentProductInfo["PriceInRobux"]), + tonumber(currentProductInfo["PriceInTickets"]) + ) + then + descText = "We could retrieve the price of the item correctly. Please try again later." return true, nil, nil, true, descText - end + end local playerBalance = getPlayerBalance() if not playerBalance then @@ -636,32 +770,41 @@ function canPurchaseItem() return true, nil, nil, true, descText end - if tonumber(currentProductInfo["MinimumMembershipLevel"]) > membershipTypeToNumber(game.Players.LocalPlayer.MembershipType) then - notRightBc = true + if + tonumber(currentProductInfo["MinimumMembershipLevel"]) + > membershipTypeToNumber(game.Players.LocalPlayer.MembershipType) + then + notRightBc = true end local updatedBalance, insufficientFunds = updateAfterBalanceText(playerBalance, notRightBc) - if notRightBc then + if notRightBc then purchaseDialog.BodyFrame.AfterBalanceButton.Active = true - return true, insufficientFunds, notRightBc, false - end + return true, insufficientFunds, notRightBc, false + end 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." - return true, nil, nil, true, descText + descText = "Your account is under 13 so purchase of this item is not allowed." + return true, nil, nil, true, descText end end - if (currentProductInfo["IsLimited"] == true or currentProductInfo["IsLimitedUnique"] == true) and - (currentProductInfo["Remaining"] == "" or currentProductInfo["Remaining"] == 0 or currentProductInfo["Remaining"] == nil) then - descText = "All copies of this item have been sold out! Try buying from other users on the website." - return true, nil, nil, true, descText - end + if + (currentProductInfo["IsLimited"] == true or currentProductInfo["IsLimitedUnique"] == true) + and ( + currentProductInfo["Remaining"] == "" + or currentProductInfo["Remaining"] == 0 + or currentProductInfo["Remaining"] == nil + ) + then + descText = "All copies of this item have been sold out! Try buying from other users on the website." + return true, nil, nil, true, descText + end if not updatedBalance then - descText = 'Could not update your balance. Please check back after some time.' + descText = "Could not update your balance. Please check back after some time." return true, nil, nil, true, descText end @@ -671,46 +814,45 @@ function canPurchaseItem() end function computeSpaceString(pLabel) - local nString = " " - local tempSpaceLabel = Instance.new('TextButton') - tempSpaceLabel.Size = UDim2.new(0, pLabel.AbsoluteSize.X, 0, pLabel.AbsoluteSize.Y); - tempSpaceLabel.FontSize = pLabel.FontSize; - tempSpaceLabel.Parent = pLabel.Parent; - tempSpaceLabel.BackgroundTransparency = 1.0; - tempSpaceLabel.Text = nString; - tempSpaceLabel.Name = 'SpaceButton' + local nString = " " + local tempSpaceLabel = Instance.new "TextButton" + tempSpaceLabel.Size = UDim2.new(0, pLabel.AbsoluteSize.X, 0, pLabel.AbsoluteSize.Y) + tempSpaceLabel.FontSize = pLabel.FontSize + tempSpaceLabel.Parent = pLabel.Parent + tempSpaceLabel.BackgroundTransparency = 1 + tempSpaceLabel.Text = nString + tempSpaceLabel.Name = "SpaceButton" - while tempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do + while tempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do nString = nString .. " " - tempSpaceLabel.Text = nString - end - nString = nString .. " " + tempSpaceLabel.Text = nString + end + nString = nString .. " " tempSpaceLabel.Text = "" - return nString + return nString end ---------------------------------------------- End Data Functions ----------------------------------------------------- - ---------------------------------------------- Gui Functions ---------------------------------------------- function startSpinner() spinning = true - Spawn( function() + Spawn(function() local spinPos = 0 while spinning do local pos = 0 while pos < 8 do - if pos == spinPos or pos == ((spinPos+1)%8) then - spinnerIcons[pos+1].Image = "http://www.roblox.com/Asset/?id=45880668" + if pos == spinPos or pos == ((spinPos + 1) % 8) then + spinnerIcons[pos + 1].Image = "http://www.roblox.com/Asset/?id=45880668" else - spinnerIcons[pos+1].Image = "http://www.roblox.com/Asset/?id=45880710" + spinnerIcons[pos + 1].Image = "http://www.roblox.com/Asset/?id=45880710" end - + pos = pos + 1 end spinPos = (spinPos + 1) % 8 - wait(1/15) + wait(1 / 15) end end) end @@ -721,12 +863,12 @@ end -- convenience method to say exactly what buttons should be visible (all others are not!) function setButtonsVisible(...) - local args = {...} - local argCount = select('#', ...) + local args = { ... } + local argCount = select("#", ...) local bodyFrameChildren = purchaseDialog.BodyFrame:GetChildren() for i = 1, #bodyFrameChildren do - if bodyFrameChildren[i]:IsA("GuiButton") then + if bodyFrameChildren[i]:IsA "GuiButton" then bodyFrameChildren[i].Visible = false for j = 1, argCount do if bodyFrameChildren[i] == args[j] then @@ -739,8 +881,8 @@ function setButtonsVisible(...) end -- used for the "Purchasing..." frame -function createSpinner(size,position,parent) - local spinnerFrame = Instance.new("Frame") +function createSpinner(size, position, parent) + local spinnerFrame = Instance.new "Frame" spinnerFrame.Name = "Spinner" spinnerFrame.Size = size spinnerFrame.Position = position @@ -751,57 +893,62 @@ function createSpinner(size,position,parent) spinnerIcons = {} local spinnerNum = 1 while spinnerNum <= 8 do - local spinnerImage = Instance.new("ImageLabel") - spinnerImage.Name = "Spinner"..spinnerNum + local spinnerImage = Instance.new "ImageLabel" + spinnerImage.Name = "Spinner" .. spinnerNum spinnerImage.Size = UDim2.new(0, 16, 0, 16) - spinnerImage.Position = UDim2.new(.5+.3*math.cos(math.rad(45*spinnerNum)), -8, .5+.3*math.sin(math.rad(45*spinnerNum)), -8) + spinnerImage.Position = UDim2.new( + 0.5 + 0.3 * math.cos(math.rad(45 * spinnerNum)), + -8, + 0.5 + 0.3 * math.sin(math.rad(45 * spinnerNum)), + -8 + ) spinnerImage.BackgroundTransparency = 1 spinnerImage.ZIndex = 10 - spinnerImage.Image = "http://www.roblox.com/Asset/?id=45880710" + spinnerImage.Image = "http://www.roblox.com/Asset/?id=45880710" spinnerImage.Parent = spinnerFrame - spinnerIcons[spinnerNum] = spinnerImage - spinnerNum = spinnerNum + 1 + spinnerIcons[spinnerNum] = spinnerImage + spinnerNum = spinnerNum + 1 end end -- all the gui init. Would be nice if this didn't have to be a script function createPurchasePromptGui() - purchaseDialog = Instance.new("Frame") + purchaseDialog = Instance.new "Frame" purchaseDialog.Name = "PurchaseFrame" - purchaseDialog.Size = UDim2.new(0,660,0,400) + purchaseDialog.Size = UDim2.new(0, 660, 0, 400) purchaseDialog.Position = hidePosition purchaseDialog.Visible = false - purchaseDialog.BackgroundColor3 = Color3.new(141/255,141/255,141/255) - purchaseDialog.BorderColor3 = Color3.new(204/255,204/255,204/255) + purchaseDialog.BackgroundColor3 = Color3.new(141 / 255, 141 / 255, 141 / 255) + purchaseDialog.BorderColor3 = Color3.new(204 / 255, 204 / 255, 204 / 255) purchaseDialog.Parent = game.CoreGui.RobloxGui - local bodyFrame = Instance.new("Frame") + local bodyFrame = Instance.new "Frame" bodyFrame.Name = "BodyFrame" - bodyFrame.Size = UDim2.new(1,0,1,-60) - bodyFrame.Position = UDim2.new(0,0,0,60) - bodyFrame.BackgroundColor3 = Color3.new(67/255, 67/255, 67/255) + bodyFrame.Size = UDim2.new(1, 0, 1, -60) + bodyFrame.Position = UDim2.new(0, 0, 0, 60) + bodyFrame.BackgroundColor3 = Color3.new(67 / 255, 67 / 255, 67 / 255) bodyFrame.BorderSizePixel = 0 bodyFrame.ZIndex = 8 bodyFrame.Parent = purchaseDialog local titleLabel = createTextObject("TitleLabel", "Buy Item", "TextLabel", Enum.FontSize.Size48) titleLabel.ZIndex = 8 - titleLabel.Size = UDim2.new(1,0,0,60) + titleLabel.Size = UDim2.new(1, 0, 0, 60) local titleBackdrop = titleLabel:Clone() titleBackdrop.Name = "TitleBackdrop" - titleBackdrop.TextColor3 = Color3.new(32/255,32/255,32/255) + titleBackdrop.TextColor3 = Color3.new(32 / 255, 32 / 255, 32 / 255) titleBackdrop.BackgroundTransparency = 0.0 - titleBackdrop.BackgroundColor3 = Color3.new(54/255, 96/255, 171/255) - titleBackdrop.Position = UDim2.new(0,0,0,-2) + titleBackdrop.BackgroundColor3 = Color3.new(54 / 255, 96 / 255, 171 / 255) + titleBackdrop.Position = UDim2.new(0, 0, 0, -2) titleBackdrop.ZIndex = 8 titleBackdrop.Parent = purchaseDialog titleLabel.Parent = purchaseDialog local distanceBetweenButtons = 90 - local cancelButton = createImageButton("CancelButton") - cancelButton.Position = UDim2.new(0.5,(distanceBetweenButtons/2),1,-120) + local cancelButton = createImageButton "CancelButton" + cancelButton.Position = UDim2.new(0.5, (distanceBetweenButtons / 2), 1, -120) cancelButton.BackgroundTransparency = 1 cancelButton.BorderSizePixel = 0 cancelButton.Parent = bodyFrame @@ -811,16 +958,16 @@ function createPurchasePromptGui() cancelButton.MouseButton1Down:connect(function() cancelButton.Image = cancelButtonDownUrl end) - cancelButton.MouseButton1Up:connect(function( ) + cancelButton.MouseButton1Up:connect(function() cancelButton.Image = cancelButtonImageUrl end) - cancelButton.MouseLeave:connect(function( ) + cancelButton.MouseLeave:connect(function() cancelButton.Image = cancelButtonImageUrl end) cancelButton.MouseButton1Click:connect(doDeclinePurchase) - local buyButton = createImageButton("BuyButton") - buyButton.Position = UDim2.new(0.5,-153-(distanceBetweenButtons/2),1,-120) + local buyButton = createImageButton "BuyButton" + buyButton.Position = UDim2.new(0.5, -153 - (distanceBetweenButtons / 2), 1, -120) buyButton.BackgroundTransparency = 1 buyButton.BorderSizePixel = 0 buyButton.Image = buyImageUrl @@ -828,10 +975,10 @@ function createPurchasePromptGui() buyButton.MouseButton1Down:connect(function() buyButton.Image = buyImageDownUrl end) - buyButton.MouseButton1Up:connect(function( ) + buyButton.MouseButton1Up:connect(function() buyButton.Image = buyImageUrl end) - buyButton.MouseLeave:connect(function( ) + buyButton.MouseLeave:connect(function() buyButton.Image = buyImageUrl end) buyButton.Parent = bodyFrame @@ -854,10 +1001,10 @@ function createPurchasePromptGui() freeButton.MouseButton1Down:connect(function() freeButton.Image = freeButtonImageDownUrl end) - freeButton.MouseButton1Up:connect(function( ) + freeButton.MouseButton1Up:connect(function() freeButton.Image = freeButtonImageUrl end) - freeButton.MouseLeave:connect(function( ) + freeButton.MouseLeave:connect(function() freeButton.Image = freeButtonImageUrl end) freeButton.Parent = bodyFrame @@ -866,17 +1013,17 @@ function createPurchasePromptGui() okButton.Name = "OkButton" okButton.BackgroundTransparency = 1 okButton.Visible = false - okButton.Position = UDim2.new(0.5,-okButton.Size.X.Offset/2,1,-120) + okButton.Position = UDim2.new(0.5, -okButton.Size.X.Offset / 2, 1, -120) okButton.Modal = true okButton.Image = okButtonUrl okButton.ZIndex = 8 okButton.MouseButton1Down:connect(function() okButton.Image = okButtonPressedrl end) - okButton.MouseButton1Up:connect(function( ) + okButton.MouseButton1Up:connect(function() okButton.Image = okButtonUrl end) - okButton.MouseLeave:connect(function( ) + okButton.MouseLeave:connect(function() okButton.Image = okButtonUrl end) okButton.Parent = bodyFrame @@ -887,52 +1034,68 @@ function createPurchasePromptGui() okPurchasedButton.MouseButton1Down:connect(function() okPurchasedButton.Image = okButtonPressedrl end) - okPurchasedButton.MouseButton1Up:connect(function( ) + okPurchasedButton.MouseButton1Up:connect(function() okPurchasedButton.Image = okButtonUrl end) - okPurchasedButton.MouseLeave:connect(function( ) + okPurchasedButton.MouseLeave:connect(function() okPurchasedButton.Image = okButtonUrl end) okPurchasedButton.Parent = bodyFrame - okButton.MouseButton1Click:connect(function () userPurchaseActionsEnded(false) end) - okPurchasedButton.MouseButton1Click:connect(function() + okButton.MouseButton1Click:connect(function() + userPurchaseActionsEnded(false) + end) + okPurchasedButton.MouseButton1Click:connect(function() if purchasingConsumable then userPurchaseProductActionsEnded(true) else - signalPromptEnded(true) + signalPromptEnded(true) end end) - buyButton.MouseButton1Click:connect(function() doAcceptPurchase(Enum.CurrencyType.Robux) end) - freeButton.MouseButton1Click:connect(function() doAcceptPurchase(false) end) + buyButton.MouseButton1Click:connect(function() + doAcceptPurchase(Enum.CurrencyType.Robux) + end) + freeButton.MouseButton1Click:connect(function() + doAcceptPurchase(false) + end) - local itemPreview = Instance.new("ImageLabel") + local itemPreview = Instance.new "ImageLabel" itemPreview.Name = "ItemPreview" - itemPreview.BackgroundColor3 = Color3.new(32/255,32/255,32/255) - itemPreview.BorderColor3 = Color3.new(141/255,141/255,141/255) - itemPreview.Position = UDim2.new(0,30,0,20) - itemPreview.Size = UDim2.new(0,180,0,180) + itemPreview.BackgroundColor3 = Color3.new(32 / 255, 32 / 255, 32 / 255) + itemPreview.BorderColor3 = Color3.new(141 / 255, 141 / 255, 141 / 255) + itemPreview.Position = UDim2.new(0, 30, 0, 20) + itemPreview.Size = UDim2.new(0, 180, 0, 180) itemPreview.ZIndex = 9 itemPreview.Parent = bodyFrame - local itemDescription = createTextObject("ItemDescription", "Would you like to buy the 'itemName' for currencyType currencyAmount?","TextLabel",Enum.FontSize.Size24) - itemDescription.Position = UDim2.new(1,20,0,0) - itemDescription.Size = UDim2.new(0,410,1,0) + local itemDescription = createTextObject( + "ItemDescription", + "Would you like to buy the 'itemName' for currencyType currencyAmount?", + "TextLabel", + Enum.FontSize.Size24 + ) + itemDescription.Position = UDim2.new(1, 20, 0, 0) + itemDescription.Size = UDim2.new(0, 410, 1, 0) itemDescription.ZIndex = 8 itemDescription.Parent = itemPreview - local afterBalanceButton = createTextObject("AfterBalanceButton","Place holder text ip sum lorem dodo ashs","TextButton",Enum.FontSize.Size24) + local afterBalanceButton = createTextObject( + "AfterBalanceButton", + "Place holder text ip sum lorem dodo ashs", + "TextButton", + Enum.FontSize.Size24 + ) afterBalanceButton.AutoButtonColor = false - afterBalanceButton.TextColor3 = Color3.new(222/255,59/255,30/255) - afterBalanceButton.Position = UDim2.new(0,5,1,-55) - afterBalanceButton.Size = UDim2.new(1,-10,0,50) + afterBalanceButton.TextColor3 = Color3.new(222 / 255, 59 / 255, 30 / 255) + afterBalanceButton.Position = UDim2.new(0, 5, 1, -55) + afterBalanceButton.Size = UDim2.new(1, -10, 0, 50) afterBalanceButton.ZIndex = 8 afterBalanceButton.Parent = bodyFrame - local purchasingFrame = Instance.new("Frame") + local purchasingFrame = Instance.new "Frame" purchasingFrame.Name = "PurchasingFrame" - purchasingFrame.Size = UDim2.new(1,0,1,0) - purchasingFrame.BackgroundColor3 = Color3.new(0,0,0) + purchasingFrame.Size = UDim2.new(1, 0, 1, 0) + purchasingFrame.BackgroundColor3 = Color3.new(0, 0, 0) purchasingFrame.BackgroundTransparency = 0.2 purchasingFrame.BorderSizePixel = 0 purchasingFrame.ZIndex = 9 @@ -940,12 +1103,12 @@ function createPurchasePromptGui() purchasingFrame.Active = true purchasingFrame.Parent = purchaseDialog - local purchasingLabel = createTextObject("PurchasingLabel","Purchasing...","TextLabel",Enum.FontSize.Size48) - purchasingLabel.Size = UDim2.new(1,0,1,0) + local purchasingLabel = createTextObject("PurchasingLabel", "Purchasing...", "TextLabel", Enum.FontSize.Size48) + purchasingLabel.Size = UDim2.new(1, 0, 1, 0) purchasingLabel.ZIndex = 10 purchasingLabel.Parent = purchasingFrame - createSpinner(UDim2.new(0,50,0,50), UDim2.new(0.5,-25,0.5,30), purchasingLabel) + createSpinner(UDim2.new(0, 50, 0, 50), UDim2.new(0.5, -25, 0.5, 30), purchasingLabel) end -- next two functions control the "Purchasing..." overlay @@ -963,7 +1126,7 @@ end function createTextObject(name, text, type, size) local textLabel = Instance.new(type) textLabel.Font = Enum.Font.ArialBold - textLabel.TextColor3 = Color3.new(217/255, 217/255, 217/255) + textLabel.TextColor3 = Color3.new(217 / 255, 217 / 255, 217 / 255) textLabel.TextWrapped = true textLabel.Name = name textLabel.Text = text @@ -975,8 +1138,8 @@ function createTextObject(name, text, type, size) end function createImageButton(name) - local imageButton = Instance.new("ImageButton") - imageButton.Size = UDim2.new(0,153,0,46) + local imageButton = Instance.new "ImageButton" + imageButton.Size = UDim2.new(0, 153, 0, 46) imageButton.Name = name return imageButton end @@ -1029,7 +1192,9 @@ function doPurchasePrompt(player, assetId, equipIfPurchased, currencyType, produ end if player == game.Players.LocalPlayer then - if currentlyPrompting then return end + if currentlyPrompting then + return + end currentlyPrompting = true @@ -1055,13 +1220,18 @@ function userPurchaseProductActionsEnded(userIsClosingDialog) isPurchased = true end - Game:GetService("MarketplaceService"):SignalPromptProductPurchaseFinished(tonumber(currentServerResponseTable["playerId"]), tonumber(currentServerResponseTable["productId"]), isPurchased) + Game:GetService("MarketplaceService"):SignalPromptProductPurchaseFinished( + tonumber(currentServerResponseTable["playerId"]), + tonumber(currentServerResponseTable["productId"]), + isPurchased + ) else - print("Something went wrong, no currentServerResponseTable") + print "Something went wrong, no currentServerResponseTable" end removeCurrentPurchaseInfo() else - local newPurchasedSucceededText = string.gsub( purchaseSucceededText,"itemName", tostring(currentProductInfo["Name"])) + local newPurchasedSucceededText = + string.gsub(purchaseSucceededText, "itemName", tostring(currentProductInfo["Name"])) purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton) hidePurchasing() @@ -1070,12 +1240,15 @@ end function doProcessServerPurchaseResponse(serverResponseTable) if not serverResponseTable then - print("Server response table was nil, cancelling purchase") + print "Server response table was nil, cancelling purchase" purchaseFailed() return end - if serverResponseTable["playerId"] and tonumber(serverResponseTable["playerId"]) == game.Players.LocalPlayer.userId then + if + serverResponseTable["playerId"] + and tonumber(serverResponseTable["playerId"]) == game.Players.LocalPlayer.userId + then currentServerResponseTable = serverResponseTable userPurchaseProductActionsEnded(false) end @@ -1083,24 +1256,27 @@ end ---------------------------------------------- End Gui Functions ---------------------------------------------- - ---------------------------------------------- Script Event start/initialization ---------------------------------------------- preloadAssets() -game:GetService("MarketplaceService").PromptProductPurchaseRequested:connect(function(player, productId, equipIfPurchased, currencyType) - doPurchasePrompt(player, nil, equipIfPurchased, currencyType, productId) -end) +game:GetService("MarketplaceService").PromptProductPurchaseRequested + :connect(function(player, productId, equipIfPurchased, currencyType) + doPurchasePrompt(player, nil, equipIfPurchased, currencyType, productId) + end) -Game:GetService("MarketplaceService").PromptPurchaseRequested:connect(function(player, assetId, equipIfPurchased, currencyType) - doPurchasePrompt(player, assetId, equipIfPurchased, currencyType, nil) -end) +Game:GetService("MarketplaceService").PromptPurchaseRequested + :connect(function(player, assetId, equipIfPurchased, currencyType) + doPurchasePrompt(player, assetId, equipIfPurchased, currencyType, nil) + end) Game:GetService("MarketplaceService").ServerPurchaseVerification:connect(function(serverResponseTable) doProcessServerPurchaseResponse(serverResponseTable) end) if enableBrowserWindowClosedEvent then - Game:GetService("GuiService").BrowserWindowClosed:connect(function() doPlayerFundsCheck(false) end) + Game:GetService("GuiService").BrowserWindowClosed:connect(function() + doPlayerFundsCheck(false) + end) end Game.CoreGui.RobloxGui.Changed:connect(function() diff --git a/152908679.lua b/152908679.lua index 2986071..c4dc31e 100644 --- a/152908679.lua +++ b/152908679.lua @@ -4,7 +4,7 @@ -- Essentially a user can bind a lua function to a key code, input type (mousebutton1 etc.) and this -- Variables -local contextActionService = Game:GetService("ContextActionService") +local contextActionService = Game:GetService "ContextActionService" local isTouchDevice = Game:GetService("UserInputService").TouchEnabled local functionTable = {} local buttonVector = {} @@ -16,15 +16,15 @@ local ContextUpImage = "http://www.banland.xyz/asset/?id=97166444" local oldTouches = {} -local buttonPositionTable = { - [1] = UDim2.new(0,123,0,70), - [2] = UDim2.new(0,30,0,60), - [3] = UDim2.new(0,180,0,160), - [4] = UDim2.new(0,85,0,-25), - [5] = UDim2.new(0,185,0,-25), - [6] = UDim2.new(0,185,0,260), - [7] = UDim2.new(0,216,0,65) - } +local buttonPositionTable = { + [1] = UDim2.new(0, 123, 0, 70), + [2] = UDim2.new(0, 30, 0, 60), + [3] = UDim2.new(0, 180, 0, 160), + [4] = UDim2.new(0, 85, 0, -25), + [5] = UDim2.new(0, 185, 0, -25), + [6] = UDim2.new(0, 185, 0, 260), + [7] = UDim2.new(0, 216, 0, 65), +} local maxButtons = #buttonPositionTable -- Preload images @@ -41,13 +41,13 @@ end function createContextActionGui() if not buttonScreenGui and isTouchDevice then - buttonScreenGui = Instance.new("ScreenGui") + buttonScreenGui = Instance.new "ScreenGui" buttonScreenGui.Name = "ContextActionGui" - buttonFrame = Instance.new("Frame") + buttonFrame = Instance.new "Frame" buttonFrame.BackgroundTransparency = 1 - buttonFrame.Size = UDim2.new(0.3,0,0.5,0) - buttonFrame.Position = UDim2.new(0.7,0,0.5,0) + buttonFrame.Size = UDim2.new(0.3, 0, 0.5, 0) + buttonFrame.Position = UDim2.new(0.7, 0, 0.5, 0) buttonFrame.Name = "ContextButtonFrame" buttonFrame.Parent = buttonScreenGui end @@ -66,7 +66,7 @@ function setButtonSizeAndPosition(object) xOffset = 40 end - object.Size = UDim2.new(0,buttonSize,0,buttonSize) + object.Size = UDim2.new(0, buttonSize, 0, buttonSize) end function contextButtonDown(button, inputObject, actionName) @@ -85,7 +85,10 @@ end function contextButtonUp(button, inputObject, actionName) button.Image = ContextUpImage - if inputObject.UserInputType == Enum.UserInputType.Touch and inputObject.UserInputState == Enum.UserInputState.End then + if + inputObject.UserInputType == Enum.UserInputType.Touch + and inputObject.UserInputState == Enum.UserInputState.End + then contextActionService:CallFunction(actionName, Enum.UserInputState.End, inputObject) end end @@ -94,26 +97,27 @@ function isSmallScreenDevice() return Game:GetService("GuiService"):GetScreenResolution().y <= 320 end - function createNewButton(actionName, functionInfoTable) - local contextButton = Instance.new("ImageButton") + local contextButton = Instance.new "ImageButton" contextButton.Name = "ContextActionButton" contextButton.BackgroundTransparency = 1 - contextButton.Size = UDim2.new(0,90,0,90) + contextButton.Size = UDim2.new(0, 90, 0, 90) contextButton.Active = true - if isSmallScreenDevice() then - contextButton.Size = UDim2.new(0,70,0,70) + if isSmallScreenDevice() then + contextButton.Size = UDim2.new(0, 70, 0, 70) end contextButton.Image = ContextUpImage contextButton.Parent = buttonFrame local currentButtonTouch = nil - Game:GetService("UserInputService").InputEnded:connect(function ( inputObject ) + Game:GetService("UserInputService").InputEnded:connect(function(inputObject) oldTouches[inputObject] = nil end) contextButton.InputBegan:connect(function(inputObject) - if oldTouches[inputObject] then return end + if oldTouches[inputObject] then + return + end if inputObject.UserInputState == Enum.UserInputState.Begin and currentButtonTouch == nil then currentButtonTouch = inputObject @@ -121,21 +125,29 @@ function createNewButton(actionName, functionInfoTable) end end) contextButton.InputChanged:connect(function(inputObject) - if oldTouches[inputObject] then return end - if currentButtonTouch ~= inputObject then return end + if oldTouches[inputObject] then + return + end + if currentButtonTouch ~= inputObject then + return + end contextButtonMoved(contextButton, inputObject, actionName) end) contextButton.InputEnded:connect(function(inputObject) - if oldTouches[inputObject] then return end - if currentButtonTouch ~= inputObject then return end + if oldTouches[inputObject] then + return + end + if currentButtonTouch ~= inputObject then + return + end currentButtonTouch = nil oldTouches[inputObject] = true contextButtonUp(contextButton, inputObject, actionName) end) - local actionIcon = Instance.new("ImageLabel") + local actionIcon = Instance.new "ImageLabel" actionIcon.Name = "ActionIcon" actionIcon.Position = UDim2.new(0.175, 0, 0.175, 0) actionIcon.Size = UDim2.new(0.65, 0, 0.65, 0) @@ -145,12 +157,12 @@ function createNewButton(actionName, functionInfoTable) end actionIcon.Parent = contextButton - local actionTitle = Instance.new("TextLabel") + local actionTitle = Instance.new "TextLabel" actionTitle.Name = "ActionTitle" - actionTitle.Size = UDim2.new(1,0,1,0) + actionTitle.Size = UDim2.new(1, 0, 1, 0) actionTitle.BackgroundTransparency = 1 actionTitle.Font = Enum.Font.SourceSansBold - actionTitle.TextColor3 = Color3.new(1,1,1) + actionTitle.TextColor3 = Color3.new(1, 1, 1) actionTitle.TextStrokeTransparency = 0 actionTitle.FontSize = Enum.FontSize.Size18 actionTitle.TextWrapped = true @@ -163,11 +175,11 @@ function createNewButton(actionName, functionInfoTable) return contextButton end -function createButton( actionName, functionInfoTable ) +function createButton(actionName, functionInfoTable) local button = createNewButton(actionName, functionInfoTable) local position = nil - for i = 1,#buttonVector do + for i = 1, #buttonVector do if buttonVector[i] == "empty" then position = i break @@ -194,14 +206,16 @@ function createButton( actionName, functionInfoTable ) end function removeAction(actionName) - if not functionTable[actionName] then return end + if not functionTable[actionName] then + return + end local actionButton = functionTable[actionName]["button"] - + if actionButton then actionButton.Parent = nil - for i = 1,#buttonVector do + for i = 1, #buttonVector do if buttonVector[i] == actionButton then buttonVector[i] = "empty" break @@ -214,11 +228,11 @@ function removeAction(actionName) functionTable[actionName] = nil end -function addAction(actionName,createTouchButton,functionInfoTable) +function addAction(actionName, createTouchButton, functionInfoTable) if functionTable[actionName] then removeAction(actionName) end - functionTable[actionName] = {functionInfoTable} + functionTable[actionName] = { functionInfoTable } if createTouchButton and isTouchDevice then createContextActionGui() createButton(actionName, functionInfoTable) @@ -226,7 +240,7 @@ function addAction(actionName,createTouchButton,functionInfoTable) end -- Connections -contextActionService.BoundActionChanged:connect( function(actionName, changeName, changeTable) +contextActionService.BoundActionChanged:connect(function(actionName, changeName, changeTable) if functionTable[actionName] and changeTable then local button = functionTable[actionName]["button"] if button then @@ -243,15 +257,15 @@ contextActionService.BoundActionChanged:connect( function(actionName, changeName end end) -contextActionService.BoundActionAdded:connect( function(actionName, createTouchButton, functionInfoTable) +contextActionService.BoundActionAdded:connect(function(actionName, createTouchButton, functionInfoTable) addAction(actionName, createTouchButton, functionInfoTable) end) -contextActionService.BoundActionRemoved:connect( function(actionName, functionInfoTable) +contextActionService.BoundActionRemoved:connect(function(actionName, functionInfoTable) removeAction(actionName) end) -contextActionService.GetActionButtonEvent:connect( function(actionName) +contextActionService.GetActionButtonEvent:connect(function(actionName) if functionTable[actionName] then contextActionService:FireActionButtonFoundSignal(actionName, functionTable[actionName]["button"]) end @@ -260,5 +274,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/153556783.lua b/153556783.lua index 5b7e632..6d1e977 100644 --- a/153556783.lua +++ b/153556783.lua @@ -6,21 +6,23 @@ while not Game do wait() end -while not Game:FindFirstChild("Players") do +while not Game:FindFirstChild "Players" do wait() end while not Game.Players.LocalPlayer do wait() end -while not Game:FindFirstChild("CoreGui") do +while not Game:FindFirstChild "CoreGui" do wait() end -while not Game.CoreGui:FindFirstChild("RobloxGui") do +while not Game.CoreGui:FindFirstChild "RobloxGui" do wait() end -local userInputService = Game:GetService("UserInputService") -local success = pcall(function() userInputService:IsLuaTouchControls() end) +local userInputService = Game:GetService "UserInputService" +local success = pcall(function() + userInputService:IsLuaTouchControls() +end) if not success then script:Destroy() end @@ -34,9 +36,8 @@ function isSmallScreenDevice() end local localPlayer = Game.Players.LocalPlayer -local thumbstickInactiveAlpha = 0.3 local thumbstickSize = 120 -if isSmallScreenDevice() then +if isSmallScreenDevice() then thumbstickSize = 70 end @@ -46,7 +47,7 @@ local ThumbstickMaxPercentGive = 0.92 local thumbstickTouches = {} local jumpButtonSize = 90 -if isSmallScreenDevice() then +if isSmallScreenDevice() then jumpButtonSize = 70 end local oldJumpTouches = {} @@ -58,7 +59,6 @@ local CameraZoomSensitivity = 0.03 local PinchZoomDelay = 0.2 local cameraTouch = nil - -- make sure all of our images are good to go Game:GetService("ContentProvider"):Preload(touchControlsSheet) @@ -67,134 +67,181 @@ Game:GetService("ContentProvider"):Preload(touchControlsSheet) -- Functions function DistanceBetweenTwoPoints(point1, point2) - local dx = point2.x - point1.x - local dy = point2.y - point1.y - return math.sqrt( (dx*dx) + (dy*dy) ) + local dx = point2.x - point1.x + local dy = point2.y - point1.y + return math.sqrt((dx * dx) + (dy * dy)) end function transformFromCenterToTopLeft(pointToTranslate, guiObject) - return UDim2.new(0,pointToTranslate.x - guiObject.AbsoluteSize.x/2,0,pointToTranslate.y - guiObject.AbsoluteSize.y/2) + return UDim2.new( + 0, + pointToTranslate.x - guiObject.AbsoluteSize.x / 2, + 0, + pointToTranslate.y - guiObject.AbsoluteSize.y / 2 + ) end function rotatePointAboutLocation(pointToRotate, pointToRotateAbout, radians) - local sinAnglePercent = math.sin(radians) - local cosAnglePercent = math.cos(radians) - - local transformedPoint = pointToRotate - - -- translate point back to origin: - transformedPoint = Vector2.new(transformedPoint.x - pointToRotateAbout.x, transformedPoint.y - pointToRotateAbout.y) - - -- rotate point - local xNew = transformedPoint.x * cosAnglePercent - transformedPoint.y * sinAnglePercent - local yNew = transformedPoint.x * sinAnglePercent + transformedPoint.y * cosAnglePercent - - -- translate point back: - transformedPoint = Vector2.new(xNew + pointToRotateAbout.x, yNew + pointToRotateAbout.y) + local sinAnglePercent = math.sin(radians) + local cosAnglePercent = math.cos(radians) - return transformedPoint + local transformedPoint = pointToRotate + + -- translate point back to origin: + transformedPoint = Vector2.new(transformedPoint.x - pointToRotateAbout.x, transformedPoint.y - pointToRotateAbout.y) + + -- rotate point + local xNew = transformedPoint.x * cosAnglePercent - transformedPoint.y * sinAnglePercent + local yNew = transformedPoint.x * sinAnglePercent + transformedPoint.y * cosAnglePercent + + -- translate point back: + transformedPoint = Vector2.new(xNew + pointToRotateAbout.x, yNew + pointToRotateAbout.y) + + return transformedPoint end -function dotProduct(v1,v2) - return ((v1.x*v2.x) + (v1.y*v2.y)) +function dotProduct(v1, v2) + return ((v1.x * v2.x) + (v1.y * v2.y)) end function stationaryThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLocation) - local thumbstickOuterCenterPosition = Vector2.new(thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x/2, thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y/2) - local centerDiff = DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenterPosition) - - -- thumbstick is moving outside our region, need to cap its distance - if centerDiff > (thumbstickSize/2) then - local thumbVector = Vector2.new(touchLocation.x - thumbstickOuterCenterPosition.x,touchLocation.y - thumbstickOuterCenterPosition.y); - local normal = thumbVector.unit - if normal.x == math.nan or normal.x == math.inf then - normal = Vector2.new(0,normal.y) - end - if normal.y == math.nan or normal.y == math.inf then - normal = Vector2.new(normal.x,0) - end - - local newThumbstickInnerPosition = thumbstickOuterCenterPosition + (normal * (thumbstickSize/2)) - thumbstickFrame.Position = transformFromCenterToTopLeft(newThumbstickInnerPosition, thumbstickFrame) - else - thumbstickFrame.Position = transformFromCenterToTopLeft(touchLocation,thumbstickFrame) - end + local thumbstickOuterCenterPosition = Vector2.new( + thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x / 2, + thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y / 2 + ) + local centerDiff = DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenterPosition) - return Vector2.new(thumbstickFrame.Position.X.Offset - thumbstickOuter.Position.X.Offset,thumbstickFrame.Position.Y.Offset - thumbstickOuter.Position.Y.Offset) + -- thumbstick is moving outside our region, need to cap its distance + if centerDiff > (thumbstickSize / 2) then + local thumbVector = Vector2.new( + touchLocation.x - thumbstickOuterCenterPosition.x, + touchLocation.y - thumbstickOuterCenterPosition.y + ) + local normal = thumbVector.unit + if normal.x == math.nan or normal.x == math.inf then + normal = Vector2.new(0, normal.y) + end + if normal.y == math.nan or normal.y == math.inf then + normal = Vector2.new(normal.x, 0) + end + + local newThumbstickInnerPosition = thumbstickOuterCenterPosition + (normal * (thumbstickSize / 2)) + thumbstickFrame.Position = transformFromCenterToTopLeft(newThumbstickInnerPosition, thumbstickFrame) + else + thumbstickFrame.Position = transformFromCenterToTopLeft(touchLocation, thumbstickFrame) + end + + return Vector2.new( + thumbstickFrame.Position.X.Offset - thumbstickOuter.Position.X.Offset, + thumbstickFrame.Position.Y.Offset - thumbstickOuter.Position.Y.Offset + ) end function followThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLocation) - local thumbstickOuterCenter = Vector2.new(thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x/2, thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y/2) - - -- thumbstick is moving outside our region, need to position outer thumbstick texture carefully (to make look and feel like actual joystick controller) - if DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenter) > thumbstickSize/2 then - local thumbstickInnerCenter = Vector2.new(thumbstickFrame.Position.X.Offset + thumbstickFrame.AbsoluteSize.x/2, thumbstickFrame.Position.Y.Offset + thumbstickFrame.AbsoluteSize.y/2) - local movementVectorUnit = Vector2.new(touchLocation.x - thumbstickInnerCenter.x, touchLocation.y - thumbstickInnerCenter.y).unit + local thumbstickOuterCenter = Vector2.new( + thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x / 2, + thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y / 2 + ) - local outerToInnerVectorCurrent = Vector2.new(thumbstickInnerCenter.x - thumbstickOuterCenter.x, thumbstickInnerCenter.y - thumbstickOuterCenter.y) - local outerToInnerVectorCurrentUnit = outerToInnerVectorCurrent.unit - local movementVector = Vector2.new(touchLocation.x - thumbstickInnerCenter.x, touchLocation.y - thumbstickInnerCenter.y) - - -- First, find the angle between the new thumbstick movement vector, - -- and the vector between thumbstick inner and thumbstick outer. - -- We will use this to pivot thumbstick outer around thumbstick inner, gives a nice joystick feel - local crossOuterToInnerWithMovement = (outerToInnerVectorCurrentUnit.x * movementVectorUnit.y) - (outerToInnerVectorCurrentUnit.y * movementVectorUnit.x) - local angle = math.atan2(crossOuterToInnerWithMovement, dotProduct(outerToInnerVectorCurrentUnit, movementVectorUnit)) - local anglePercent = angle * math.min( (movementVector.magnitude)/(outerToInnerVectorCurrent.magnitude), 1.0); - - -- If angle is significant, rotate about the inner thumbsticks current center - if math.abs(anglePercent) > 0.00001 then - local outerThumbCenter = rotatePointAboutLocation(thumbstickOuterCenter, thumbstickInnerCenter, anglePercent) - thumbstickOuter.Position = transformFromCenterToTopLeft(Vector2.new(outerThumbCenter.x,outerThumbCenter.y), thumbstickOuter) - end + -- thumbstick is moving outside our region, need to position outer thumbstick texture carefully (to make look and feel like actual joystick controller) + if DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenter) > thumbstickSize / 2 then + local thumbstickInnerCenter = Vector2.new( + thumbstickFrame.Position.X.Offset + thumbstickFrame.AbsoluteSize.x / 2, + thumbstickFrame.Position.Y.Offset + thumbstickFrame.AbsoluteSize.y / 2 + ) + local movementVectorUnit = + Vector2.new(touchLocation.x - thumbstickInnerCenter.x, touchLocation.y - thumbstickInnerCenter.y).unit - -- now just translate outer thumbstick to make sure it stays nears inner thumbstick - thumbstickOuter.Position = UDim2.new(0,thumbstickOuter.Position.X.Offset+movementVector.x,0,thumbstickOuter.Position.Y.Offset+movementVector.y) - end + local outerToInnerVectorCurrent = Vector2.new( + thumbstickInnerCenter.x - thumbstickOuterCenter.x, + thumbstickInnerCenter.y - thumbstickOuterCenter.y + ) + local outerToInnerVectorCurrentUnit = outerToInnerVectorCurrent.unit + local movementVector = + Vector2.new(touchLocation.x - thumbstickInnerCenter.x, touchLocation.y - thumbstickInnerCenter.y) - thumbstickFrame.Position = transformFromCenterToTopLeft(touchLocation,thumbstickFrame) + -- First, find the angle between the new thumbstick movement vector, + -- and the vector between thumbstick inner and thumbstick outer. + -- We will use this to pivot thumbstick outer around thumbstick inner, gives a nice joystick feel + local crossOuterToInnerWithMovement = (outerToInnerVectorCurrentUnit.x * movementVectorUnit.y) + - (outerToInnerVectorCurrentUnit.y * movementVectorUnit.x) + local angle = + math.atan2(crossOuterToInnerWithMovement, dotProduct(outerToInnerVectorCurrentUnit, movementVectorUnit)) + local anglePercent = angle * math.min(movementVector.magnitude / outerToInnerVectorCurrent.magnitude, 1.0) - -- a bit of error checking to make sure thumbsticks stay close to eachother - thumbstickFramePosition = Vector2.new(thumbstickFrame.Position.X.Offset,thumbstickFrame.Position.Y.Offset) - thumbstickOuterPosition = Vector2.new(thumbstickOuter.Position.X.Offset,thumbstickOuter.Position.Y.Offset) - if DistanceBetweenTwoPoints(thumbstickFramePosition, thumbstickOuterPosition) > thumbstickSize/2 then - local vectorWithLength = (thumbstickOuterPosition - thumbstickFramePosition).unit * thumbstickSize/2 - thumbstickOuter.Position = UDim2.new(0,thumbstickFramePosition.x + vectorWithLength.x,0,thumbstickFramePosition.y + vectorWithLength.y) - end + -- If angle is significant, rotate about the inner thumbsticks current center + if math.abs(anglePercent) > 0.00001 then + local outerThumbCenter = + rotatePointAboutLocation(thumbstickOuterCenter, thumbstickInnerCenter, anglePercent) + thumbstickOuter.Position = + transformFromCenterToTopLeft(Vector2.new(outerThumbCenter.x, outerThumbCenter.y), thumbstickOuter) + end - return Vector2.new(thumbstickFrame.Position.X.Offset - thumbstickOuter.Position.X.Offset,thumbstickFrame.Position.Y.Offset - thumbstickOuter.Position.Y.Offset) + -- now just translate outer thumbstick to make sure it stays nears inner thumbstick + thumbstickOuter.Position = UDim2.new( + 0, + thumbstickOuter.Position.X.Offset + movementVector.x, + 0, + thumbstickOuter.Position.Y.Offset + movementVector.y + ) + end + + thumbstickFrame.Position = transformFromCenterToTopLeft(touchLocation, thumbstickFrame) + + -- a bit of error checking to make sure thumbsticks stay close to eachother + thumbstickFramePosition = Vector2.new(thumbstickFrame.Position.X.Offset, thumbstickFrame.Position.Y.Offset) + thumbstickOuterPosition = Vector2.new(thumbstickOuter.Position.X.Offset, thumbstickOuter.Position.Y.Offset) + if DistanceBetweenTwoPoints(thumbstickFramePosition, thumbstickOuterPosition) > thumbstickSize / 2 then + local vectorWithLength = (thumbstickOuterPosition - thumbstickFramePosition).unit * thumbstickSize / 2 + thumbstickOuter.Position = UDim2.new( + 0, + thumbstickFramePosition.x + vectorWithLength.x, + 0, + thumbstickFramePosition.y + vectorWithLength.y + ) + end + + return Vector2.new( + thumbstickFrame.Position.X.Offset - thumbstickOuter.Position.X.Offset, + thumbstickFrame.Position.Y.Offset - thumbstickOuter.Position.Y.Offset + ) end function movementOutsideDeadZone(movementVector) - return ( (math.abs(movementVector.x) > ThumbstickDeadZone) or (math.abs(movementVector.y) > ThumbstickDeadZone) ) + return ((math.abs(movementVector.x) > ThumbstickDeadZone) or (math.abs(movementVector.y) > ThumbstickDeadZone)) end function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThumbstick) - local thumbstickFrame = Instance.new("Frame") + local thumbstickFrame = Instance.new "Frame" thumbstickFrame.Name = "ThumbstickFrame" thumbstickFrame.Active = true - thumbstickFrame.Size = UDim2.new(0,thumbstickSize,0,thumbstickSize) + thumbstickFrame.Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize) thumbstickFrame.Position = defaultThumbstickPos thumbstickFrame.BackgroundTransparency = 1 - local outerThumbstick = Instance.new("ImageLabel") + local outerThumbstick = Instance.new "ImageLabel" outerThumbstick.Name = "OuterThumbstick" outerThumbstick.Image = touchControlsSheet - outerThumbstick.ImageRectOffset = Vector2.new(0,0) - outerThumbstick.ImageRectSize = Vector2.new(220,220) + outerThumbstick.ImageRectOffset = Vector2.new(0, 0) + outerThumbstick.ImageRectSize = Vector2.new(220, 220) outerThumbstick.BackgroundTransparency = 1 - outerThumbstick.Size = UDim2.new(0,thumbstickSize,0,thumbstickSize) + outerThumbstick.Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize) outerThumbstick.Position = defaultThumbstickPos outerThumbstick.Parent = Game.CoreGui.RobloxGui - local innerThumbstick = Instance.new("ImageLabel") + local innerThumbstick = Instance.new "ImageLabel" innerThumbstick.Name = "InnerThumbstick" innerThumbstick.Image = touchControlsSheet - innerThumbstick.ImageRectOffset = Vector2.new(220,0) - innerThumbstick.ImageRectSize = Vector2.new(111,111) + innerThumbstick.ImageRectOffset = Vector2.new(220, 0) + innerThumbstick.ImageRectSize = Vector2.new(111, 111) innerThumbstick.BackgroundTransparency = 1 - innerThumbstick.Size = UDim2.new(0,thumbstickSize/2,0,thumbstickSize/2) - innerThumbstick.Position = UDim2.new(0, thumbstickFrame.Size.X.Offset/2 - thumbstickSize/4, 0, thumbstickFrame.Size.Y.Offset/2 - thumbstickSize/4) + innerThumbstick.Size = UDim2.new(0, thumbstickSize / 2, 0, thumbstickSize / 2) + innerThumbstick.Position = UDim2.new( + 0, + thumbstickFrame.Size.X.Offset / 2 - thumbstickSize / 4, + 0, + thumbstickFrame.Size.Y.Offset / 2 - thumbstickSize / 4 + ) innerThumbstick.Parent = thumbstickFrame innerThumbstick.ZIndex = 2 @@ -203,35 +250,51 @@ function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThu local userInputSeviceTouchEndedCon = nil local startInputTracking = function(inputObject) - if thumbstickTouch then return end - if inputObject == cameraTouch then return end - if inputObject == currentJumpTouch then return end - if inputObject.UserInputType ~= Enum.UserInputType.Touch then return end + if thumbstickTouch then + return + end + if inputObject == cameraTouch then + return + end + if inputObject == currentJumpTouch then + return + end + if inputObject.UserInputType ~= Enum.UserInputType.Touch then + return + end thumbstickTouch = inputObject - table.insert(thumbstickTouches,thumbstickTouch) + table.insert(thumbstickTouches, thumbstickTouch) - thumbstickFrame.Position = transformFromCenterToTopLeft(thumbstickTouch.Position,thumbstickFrame) + thumbstickFrame.Position = transformFromCenterToTopLeft(thumbstickTouch.Position, thumbstickFrame) outerThumbstick.Position = thumbstickFrame.Position userInputServiceTouchMovedCon = userInputService.TouchMoved:connect(function(movedInput) if movedInput == thumbstickTouch then local movementVector = nil if stationaryThumbstick then - movementVector = stationaryThumbstickTouchMove(thumbstickFrame,outerThumbstick,Vector2.new(movedInput.Position.x,movedInput.Position.y)) + movementVector = stationaryThumbstickTouchMove( + thumbstickFrame, + outerThumbstick, + Vector2.new(movedInput.Position.x, movedInput.Position.y) + ) else - movementVector = followThumbstickTouchMove(thumbstickFrame,outerThumbstick,Vector2.new(movedInput.Position.x,movedInput.Position.y)) + movementVector = followThumbstickTouchMove( + thumbstickFrame, + outerThumbstick, + Vector2.new(movedInput.Position.x, movedInput.Position.y) + ) end if updateFunction then - updateFunction(movementVector,outerThumbstick.Size.X.Offset/2) + updateFunction(movementVector, outerThumbstick.Size.X.Offset / 2) end end end) userInputSeviceTouchEndedCon = userInputService.TouchEnded:connect(function(endedInput) if endedInput == thumbstickTouch then if updateFunction then - updateFunction(Vector2.new(0,0),1) + updateFunction(Vector2.new(0, 0), 1) end userInputSeviceTouchEndedCon:disconnect() @@ -242,7 +305,7 @@ function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThu for i, object in pairs(thumbstickTouches) do if object == thumbstickTouch then - table.remove(thumbstickTouches,i) + table.remove(thumbstickTouches, i) break end end @@ -262,31 +325,31 @@ function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThu return thumbstickFrame end -function setupCharacterMovement( parentFrame ) +function setupCharacterMovement(parentFrame) local lastMovementVector, lastMaxMovement = nil local moveCharacterFunc = localPlayer.MoveCharacter - local moveCharacterFunction = function ( movementVector, maxMovement ) + local moveCharacterFunction = function(movementVector, maxMovement) if localPlayer then if movementOutsideDeadZone(movementVector) then lastMovementVector = movementVector lastMaxMovement = maxMovement -- sometimes rounding error will not allow us to go max speed at some -- thumbstick angles, fix this with a bit of fudging near 100% throttle - if movementVector.magnitude/maxMovement > ThumbstickMaxPercentGive then + if movementVector.magnitude / maxMovement > ThumbstickMaxPercentGive then maxMovement = movementVector.magnitude - 1 end moveCharacterFunc(localPlayer, movementVector, maxMovement) else - lastMovementVector = Vector2.new(0,0) + lastMovementVector = Vector2.new(0, 0) lastMaxMovement = 1 moveCharacterFunc(localPlayer, lastMovementVector, lastMaxMovement) end end end - local thumbstickPos = UDim2.new(0,thumbstickSize/2,1,-thumbstickSize*1.75) + local thumbstickPos = UDim2.new(0, thumbstickSize / 2, 1, -thumbstickSize * 1.75) if isSmallScreenDevice() then - thumbstickPos = UDim2.new(0,(thumbstickSize/2) - 10,1,-thumbstickSize - 20) + thumbstickPos = UDim2.new(0, (thumbstickSize / 2) - 10, 1, -thumbstickSize - 20) end local characterThumbstick = constructThumbstick(thumbstickPos, moveCharacterFunction, false) characterThumbstick.Name = "CharacterThumbstick" @@ -300,36 +363,41 @@ function setupCharacterMovement( parentFrame ) return refreshCharacterMovement end - -function setupJumpButton( parentFrame ) - local jumpButton = Instance.new("ImageButton") +function setupJumpButton(parentFrame) + local jumpButton = Instance.new "ImageButton" jumpButton.Name = "JumpButton" jumpButton.BackgroundTransparency = 1 jumpButton.Image = touchControlsSheet - jumpButton.ImageRectOffset = Vector2.new(176,222) - jumpButton.ImageRectSize = Vector2.new(174,174) - jumpButton.Size = UDim2.new(0,jumpButtonSize,0,jumpButtonSize) - if isSmallScreenDevice() then - jumpButton.Position = UDim2.new(1, -(jumpButtonSize*2.25), 1, -jumpButtonSize - 20) + jumpButton.ImageRectOffset = Vector2.new(176, 222) + jumpButton.ImageRectSize = Vector2.new(174, 174) + jumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize) + if isSmallScreenDevice() then + jumpButton.Position = UDim2.new(1, -(jumpButtonSize * 2.25), 1, -jumpButtonSize - 20) else - jumpButton.Position = UDim2.new(1, -(jumpButtonSize*2.75), 1, -jumpButtonSize - 120) + jumpButton.Position = UDim2.new(1, -(jumpButtonSize * 2.75), 1, -jumpButtonSize - 120) end local playerJumpFunc = localPlayer.JumpCharacter - local doJumpLoop = function () + local doJumpLoop = function() while currentJumpTouch do if localPlayer then playerJumpFunc(localPlayer) end - wait(1/60) + wait(1 / 60) end end jumpButton.InputBegan:connect(function(inputObject) - if inputObject.UserInputType ~= Enum.UserInputType.Touch then return end - if currentJumpTouch then return end - if inputObject == cameraTouch then return end + if inputObject.UserInputType ~= Enum.UserInputType.Touch then + return + end + if currentJumpTouch then + return + end + if inputObject == cameraTouch then + return + end for i, touch in pairs(oldJumpTouches) do if touch == inputObject then return @@ -337,25 +405,27 @@ function setupJumpButton( parentFrame ) end currentJumpTouch = inputObject - jumpButton.ImageRectOffset = Vector2.new(0,222) - jumpButton.ImageRectSize = Vector2.new(174,174) - doJumpLoop() + jumpButton.ImageRectOffset = Vector2.new(0, 222) + jumpButton.ImageRectSize = Vector2.new(174, 174) + doJumpLoop() end) - jumpButton.InputEnded:connect(function (inputObject) - if inputObject.UserInputType ~= Enum.UserInputType.Touch then return end - - jumpButton.ImageRectOffset = Vector2.new(176,222) - jumpButton.ImageRectSize = Vector2.new(174,174) + jumpButton.InputEnded:connect(function(inputObject) + if inputObject.UserInputType ~= Enum.UserInputType.Touch then + return + end + + jumpButton.ImageRectOffset = Vector2.new(176, 222) + jumpButton.ImageRectSize = Vector2.new(174, 174) if inputObject == currentJumpTouch then - table.insert(oldJumpTouches,currentJumpTouch) + table.insert(oldJumpTouches, currentJumpTouch) currentJumpTouch = nil end end) - userInputService.InputEnded:connect(function ( globalInputObject ) + userInputService.InputEnded:connect(function(globalInputObject) for i, touch in pairs(oldJumpTouches) do if touch == globalInputObject then - table.remove(oldJumpTouches,i) + table.remove(oldJumpTouches, i) break end end @@ -370,8 +440,10 @@ function setupJumpButton( parentFrame ) jumpButton.Parent = parentFrame end -function isTouchUsedByJumpButton( touch ) - if touch == currentJumpTouch then return true end +function isTouchUsedByJumpButton(touch) + if touch == currentJumpTouch then + return true + end for i, touchToCompare in pairs(oldJumpTouches) do if touch == touchToCompare then return true @@ -409,28 +481,30 @@ function setupCameraControl(parentFrame, refreshCharacterMoveFunc) lastPos = nil end - local resetPinchState = function () + local resetPinchState = function() pinchTouches = {} lastPinchScale = nil shouldPinch = false - pinchFrame:Destroy() - pinchFrame = nil + pinchFrame:Destroy() + pinchFrame = nil end local startPinch = function(firstTouch, secondTouch) -- track pinching in new frame - if pinchFrame then pinchFrame:Destroy() end -- make sure we didn't track in any mud - pinchFrame = Instance.new("Frame") - pinchFrame.Name = "PinchFrame" - pinchFrame.BackgroundTransparency = 1 - pinchFrame.Parent = parentFrame - pinchFrame.Size = UDim2.new(1,0,1,0) + if pinchFrame then + pinchFrame:Destroy() + end -- make sure we didn't track in any mud + pinchFrame = Instance.new "Frame" + pinchFrame.Name = "PinchFrame" + pinchFrame.BackgroundTransparency = 1 + pinchFrame.Parent = parentFrame + pinchFrame.Size = UDim2.new(1, 0, 1, 0) - pinchFrame.InputChanged:connect(function(inputObject) - if not shouldPinch then - resetPinchState() - return - end + pinchFrame.InputChanged:connect(function(inputObject) + if not shouldPinch then + resetPinchState() + return + end resetCameraRotateState() if lastPinchScale == nil then -- first pinch move, just set up scale @@ -458,34 +532,38 @@ function setupCameraControl(parentFrame, refreshCharacterMoveFunc) lastPinchScale = newPinchDistance end end - end) - pinchFrame.InputEnded:connect(function(inputObject) -- pinch is over, destroy all - if inputObject == firstTouch or inputObject == secondTouch then - resetPinchState() + end) + pinchFrame.InputEnded:connect(function(inputObject) -- pinch is over, destroy all + if inputObject == firstTouch or inputObject == secondTouch then + resetPinchState() end - end) + end) end local pinchGestureReceivedTouch = function(inputObject) - if #pinchTouches < 1 then - table.insert(pinchTouches,inputObject) - pinchTime = tick() - shouldPinch = false - elseif #pinchTouches == 1 then - shouldPinch = ( (tick() - pinchTime) <= PinchZoomDelay ) + if #pinchTouches < 1 then + table.insert(pinchTouches, inputObject) + pinchTime = tick() + shouldPinch = false + elseif #pinchTouches == 1 then + shouldPinch = ((tick() - pinchTime) <= PinchZoomDelay) - if shouldPinch then - table.insert(pinchTouches,inputObject) - startPinch(pinchTouches[1], pinchTouches[2]) - else -- shouldn't ever get here, but just in case - pinchTouches = {} - end - end + if shouldPinch then + table.insert(pinchTouches, inputObject) + startPinch(pinchTouches[1], pinchTouches[2]) + else -- shouldn't ever get here, but just in case + pinchTouches = {} + end + end end - parentFrame.InputBegan:connect(function (inputObject) - if inputObject.UserInputType ~= Enum.UserInputType.Touch then return end - if isTouchUsedByJumpButton(inputObject) then return end + parentFrame.InputBegan:connect(function(inputObject) + if inputObject.UserInputType ~= Enum.UserInputType.Touch then + return + end + if isTouchUsedByJumpButton(inputObject) then + return + end local usedByThumbstick = isTouchUsedByThumbstick(inputObject) if not usedByThumbstick then @@ -494,15 +572,19 @@ function setupCameraControl(parentFrame, refreshCharacterMoveFunc) if cameraTouch == nil and not usedByThumbstick then cameraTouch = inputObject - lastPos = Vector2.new(cameraTouch.Position.x,cameraTouch.Position.y) + lastPos = Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y) lastTick = tick() end end) - userInputService.InputChanged:connect(function (inputObject) - if inputObject.UserInputType ~= Enum.UserInputType.Touch then return end - if cameraTouch ~= inputObject then return end + userInputService.InputChanged:connect(function(inputObject) + if inputObject.UserInputType ~= Enum.UserInputType.Touch then + return + end + if cameraTouch ~= inputObject then + return + end - local newPos = Vector2.new(cameraTouch.Position.x,cameraTouch.Position.y) + local newPos = Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y) local touchDiff = (lastPos - newPos) * CameraRotateSensitivity -- first time rotating outside deadzone, just setup for next changed event @@ -518,23 +600,23 @@ function setupCameraControl(parentFrame, refreshCharacterMoveFunc) lastPos = newPos end end) - userInputService.InputEnded:connect(function (inputObject) + userInputService.InputEnded:connect(function(inputObject) if cameraTouch == inputObject or cameraTouch == nil then resetCameraRotateState() end for i, touch in pairs(pinchTouches) do if touch == inputObject then - table.remove(pinchTouches,i) + table.remove(pinchTouches, i) end end end) end function setupTouchControls() - local touchControlFrame = Instance.new("Frame") + local touchControlFrame = Instance.new "Frame" touchControlFrame.Name = "TouchControlFrame" - touchControlFrame.Size = UDim2.new(1,0,1,0) + touchControlFrame.Size = UDim2.new(1, 0, 1, 0) touchControlFrame.BackgroundTransparency = 1 touchControlFrame.Parent = Game.CoreGui.RobloxGui @@ -543,7 +625,9 @@ function setupTouchControls() setupCameraControl(touchControlFrame, refreshCharacterMoveFunc) userInputService.ProcessedEvent:connect(function(inputObject, processed) - if not processed then return end + if not processed then + return + end -- kill camera pan if the touch is used by some user controls if inputObject == cameraTouch and inputObject.UserInputState == Enum.UserInputState.Begin then @@ -552,7 +636,6 @@ function setupTouchControls() end) end - ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -- Start of Script @@ -561,4 +644,4 @@ if true then --userInputService:IsLuaTouchControls() then setupTouchControls() else script:Destroy() -end \ No newline at end of file +end diff --git a/157877000.lua b/157877000.lua index b92f6ab..470a2f4 100644 --- a/157877000.lua +++ b/157877000.lua @@ -1,33 +1,31 @@ --Include -local Create = assert(LoadLibrary("RbxUtility")).Create +local Create = assert(LoadLibrary "RbxUtility").Create -- A Few Script Globals local gui -if script.Parent:FindFirstChild("ControlFrame") then - gui = script.Parent:FindFirstChild("ControlFrame") +if script.Parent:FindFirstChild "ControlFrame" then + gui = script.Parent:FindFirstChild "ControlFrame" else gui = script.Parent end -- Dev-Console Root -local Dev_Container = Create'Frame'{ - Name = 'DevConsoleContainer'; - Parent = gui; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.9; - Position = UDim2.new(0, 100, 0, 10); - Size = UDim2.new(0.5, 20, 0.5, 20); - Visible = false; - BackgroundTransparency = 0.9; +local Dev_Container = Create "Frame" { + Name = "DevConsoleContainer", + Parent = gui, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.9, + Position = UDim2.new(0, 100, 0, 10), + Size = UDim2.new(0.5, 20, 0.5, 20), + Visible = false, } -local ToggleConsole = Create'BindableFunction'{ - Name = 'ToggleDevConsole'; - Parent = gui +local ToggleConsole = Create "BindableFunction" { + Name = "ToggleDevConsole", + Parent = gui, } - local devConsoleInitialized = false function initializeDeveloperConsole() if devConsoleInitialized then @@ -49,393 +47,389 @@ function initializeDeveloperConsole() local localOffset = 0 local serverOffset = 0 - + local errorToggleOn = true local warningToggleOn = true local infoToggleOn = true local outputToggleOn = true local wordWrapToggleOn = false - + local textHolderSize = 0 - + local frameNumber = 0 --Create Dev-Console - local Dev_Body = Create'Frame'{ - Name = 'Body'; - Parent = Dev_Container; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.5; - Position = UDim2.new(0, 0, 0, 21); - Size = UDim2.new(1, 0, 1, -25); - } - - local Dev_OptionsHolder = Create'Frame'{ - Name = 'OptionsHolder'; - Parent = Dev_Body; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 1.0; - Position = UDim2.new(0, 220, 0, 0); - Size = UDim2.new(1, -255, 0, 24); - ClipsDescendants = true - } - - local Dev_OptionsBar = Create'Frame'{ - Name = 'OptionsBar'; - Parent = Dev_OptionsHolder; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 1.0; - Position = UDim2.new(0.0, -250, 0, 4); - Size = UDim2.new(0, 234, 0, 18); - } - - local Dev_ErrorToggleFilter = Create'TextButton'{ - Name = 'ErrorToggleButton'; - Parent = Dev_OptionsBar; - BackgroundColor3 = Color3.new(0,0,0); - BorderColor3 = Color3.new(1.0, 0, 0); - Position = UDim2.new(0, 115, 0, 0); - Size = UDim2.new(0, 18, 0, 18); - Font = "SourceSansBold"; - FontSize = Enum.FontSize.Size14; - Text = ""; - TextColor3 = Color3.new(1.0, 0, 0); - } - - Create'Frame'{ - Name = 'CheckFrame'; - Parent = Dev_ErrorToggleFilter; - BackgroundColor3 = Color3.new(1.0,0,0); - BorderColor3 = Color3.new(1.0, 0, 0); - Position = UDim2.new(0, 4, 0, 4); - Size = UDim2.new(0, 10, 0, 10); - } - - local Dev_InfoToggleFilter = Create'TextButton'{ - Name = 'InfoToggleButton'; - Parent = Dev_OptionsBar; - BackgroundColor3 = Color3.new(0,0,0); - BorderColor3 = Color3.new(0.4, 0.5, 1.0); - Position = UDim2.new(0, 65, 0, 0); - Size = UDim2.new(0, 18, 0, 18); - Font = "SourceSansBold"; - FontSize = Enum.FontSize.Size14; - Text = ""; - TextColor3 = Color3.new(0.4, 0.5, 1.0); - } - - Create'Frame'{ - Name = 'CheckFrame'; - Parent = Dev_InfoToggleFilter; - BackgroundColor3 = Color3.new(0.4, 0.5, 1.0); - BorderColor3 = Color3.new(0.4, 0.5, 1.0); - Position = UDim2.new(0, 4, 0, 4); - Size = UDim2.new(0, 10, 0, 10); - } - - local Dev_OutputToggleFilter = Create'TextButton'{ - Name = 'OutputToggleButton'; - Parent = Dev_OptionsBar; - BackgroundColor3 = Color3.new(0,0,0); - BorderColor3 = Color3.new(1.0, 1.0, 1.0); - Position = UDim2.new(0, 40, 0, 0); - Size = UDim2.new(0, 18, 0, 18); - Font = "SourceSansBold"; - FontSize = Enum.FontSize.Size14; - Text = ""; - TextColor3 = Color3.new(1.0, 1.0, 1.0); - } - - Create'Frame'{ - Name = 'CheckFrame'; - Parent = Dev_OutputToggleFilter; - BackgroundColor3 = Color3.new(1.0, 1.0, 1.0); - BorderColor3 = Color3.new(1.0, 1.0, 1.0); - Position = UDim2.new(0, 4, 0, 4); - Size = UDim2.new(0, 10, 0, 10); - } - - local Dev_WarningToggleFilter = Create'TextButton'{ - Name = 'WarningToggleButton'; - Parent = Dev_OptionsBar; - BackgroundColor3 = Color3.new(0,0,0); - BorderColor3 = Color3.new(1.0, 0.6, 0.4); - Position = UDim2.new(0, 90, 0, 0); - Size = UDim2.new(0, 18, 0, 18); - Font = "SourceSansBold"; - FontSize = Enum.FontSize.Size14; - Text = ""; - TextColor3 = Color3.new(1.0, 0.6, 0.4); - } - - Create'Frame'{ - Name = 'CheckFrame'; - Parent = Dev_WarningToggleFilter; - BackgroundColor3 = Color3.new(1.0, 0.6, 0.4); - BorderColor3 = Color3.new(1.0, 0.6, 0.4); - Position = UDim2.new(0, 4, 0, 4); - Size = UDim2.new(0, 10, 0, 10); - } - - local Dev_WordWrapToggle = Create'TextButton'{ - Name = 'WordWrapToggleButton'; - Parent = Dev_OptionsBar; - BackgroundColor3 = Color3.new(0,0,0); - BorderColor3 = Color3.new(0.8, 0.8, 0.8); - Position = UDim2.new(0, 215, 0, 0); - Size = UDim2.new(0, 18, 0, 18); - Font = "SourceSansBold"; - FontSize = Enum.FontSize.Size14; - Text = ""; - TextColor3 = Color3.new(0.8, 0.8, 0.8); - } - - Create'Frame'{ - Name = 'CheckFrame'; - Parent = Dev_WordWrapToggle; - BackgroundColor3 = Color3.new(0.8, 0.8, 0.8); - BorderColor3 = Color3.new(0.8, 0.8, 0.8); - Position = UDim2.new(0, 4, 0, 4); - Size = UDim2.new(0, 10, 0, 10); - Visible = false - } - - Create'TextLabel'{ - Name = 'Filter'; - Parent = Dev_OptionsBar; - BackgroundTransparency = 1.0; - Position = UDim2.new(0, 0, 0, 0); - Size = UDim2.new(0, 40, 0, 18); - Font = "SourceSansBold"; - FontSize = Enum.FontSize.Size14; - Text = "Filter"; - TextColor3 = Color3.new(1, 1, 1); - } - - Create'TextLabel'{ - Name = 'WordWrap'; - Parent = Dev_OptionsBar; - BackgroundTransparency = 1; - Position = UDim2.new(0, 150, 0, 0); - Size = UDim2.new(0, 50, 0, 18); - Font = "SourceSansBold"; - FontSize = Enum.FontSize.Size14; - Text = "Word Wrap"; - TextColor3 = Color3.new(1, 1, 1); + local Dev_Body = Create "Frame" { + Name = "Body", + Parent = Dev_Container, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 0, 21), + Size = UDim2.new(1, 0, 1, -25), } - local Dev_ScrollBar = Create'Frame'{ - Name = 'ScrollBar'; - Parent = Dev_Body; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.9; - Position = UDim2.new(1, -20, 0, 26); - Size = UDim2.new(0, 20, 1, -50); - Visible = false; - BackgroundTransparency = 0.9; + local Dev_OptionsHolder = Create "Frame" { + Name = "OptionsHolder", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 1, + Position = UDim2.new(0, 220, 0, 0), + Size = UDim2.new(1, -255, 0, 24), + ClipsDescendants = true, } - local Dev_ScrollArea = Create'Frame'{ - Name = 'ScrollArea'; - Parent = Dev_ScrollBar; - BackgroundTransparency = 1; - Position = UDim2.new(0, 0, 0, 23); - Size = UDim2.new(1, 0, 1, -46); - BackgroundTransparency = 1; + local Dev_OptionsBar = Create "Frame" { + Name = "OptionsBar", + Parent = Dev_OptionsHolder, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 1, + Position = UDim2.new(0, -250, 0, 4), + Size = UDim2.new(0, 234, 0, 18), } - local Dev_Handle = Create'ImageButton'{ - Name = 'Handle'; - Parent = Dev_ScrollArea; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.5; - Position = UDim2.new(0, 0, .2, 0); - Size = UDim2.new(0, 20, 0, 40); - BackgroundTransparency = 0.5; - } - - Create'ImageLabel'{ - Name = 'ImageLabel'; - Parent = Dev_Handle; - BackgroundTransparency = 1; - Position = UDim2.new(0, 0, 0.5, -8); - Rotation = 180; - Size = UDim2.new(1, 0, 0, 16); - Image = "http://www.roblox.com/Asset?id=151205881"; + local Dev_ErrorToggleFilter = Create "TextButton" { + Name = "ErrorToggleButton", + Parent = Dev_OptionsBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(1, 0, 0), + Position = UDim2.new(0, 115, 0, 0), + Size = UDim2.new(0, 18, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "", + TextColor3 = Color3.new(1, 0, 0), } - local Dev_DownButton = Create'ImageButton'{ - Name = 'Down'; - Parent = Dev_ScrollBar; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.5; - Position = UDim2.new(0, 0, 1, -20); - Size = UDim2.new(0, 20, 0, 20); - BackgroundTransparency = 0.5; + Create "Frame" { + Name = "CheckFrame", + Parent = Dev_ErrorToggleFilter, + BackgroundColor3 = Color3.new(1, 0, 0), + BorderColor3 = Color3.new(1, 0, 0), + Position = UDim2.new(0, 4, 0, 4), + Size = UDim2.new(0, 10, 0, 10), } - Create'ImageLabel'{ - Name = 'ImageLabel'; - Parent = Dev_DownButton; - BackgroundTransparency = 1; - Position = UDim2.new(0, 3, 0, 3); - Size = UDim2.new(0, 14, 0, 14); - Rotation = 180; - Image = "http://www.roblox.com/Asset?id=151205813"; + local Dev_InfoToggleFilter = Create "TextButton" { + Name = "InfoToggleButton", + Parent = Dev_OptionsBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(0.4, 0.5, 1.0), + Position = UDim2.new(0, 65, 0, 0), + Size = UDim2.new(0, 18, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "", + TextColor3 = Color3.new(0.4, 0.5, 1.0), } - local Dev_UpButton = Create'ImageButton'{ - Name = 'Up'; - Parent = Dev_ScrollBar; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.5; - Position = UDim2.new(0, 0, 0, 0); - Size = UDim2.new(0, 20, 0, 20); + Create "Frame" { + Name = "CheckFrame", + Parent = Dev_InfoToggleFilter, + BackgroundColor3 = Color3.new(0.4, 0.5, 1.0), + BorderColor3 = Color3.new(0.4, 0.5, 1.0), + Position = UDim2.new(0, 4, 0, 4), + Size = UDim2.new(0, 10, 0, 10), } - Create'ImageLabel'{ - Name = 'ImageLabel'; - Parent = Dev_UpButton; - BackgroundTransparency = 1; - Position = UDim2.new(0, 3, 0, 3); - Size = UDim2.new(0, 14, 0, 14); - Image = "http://www.roblox.com/Asset?id=151205813"; + local Dev_OutputToggleFilter = Create "TextButton" { + Name = "OutputToggleButton", + Parent = Dev_OptionsBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(1, 1, 1.0), + Position = UDim2.new(0, 40, 0, 0), + Size = UDim2.new(0, 18, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "", + TextColor3 = Color3.new(1, 1, 1.0), } - local Dev_TextBox = Create'Frame'{ - Name = 'TextBox'; - Parent = Dev_Body; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.6; - Position = UDim2.new(0, 2, 0, 26); - Size = UDim2.new(1, -4, 1, -28); - ClipsDescendants = true; + Create "Frame" { + Name = "CheckFrame", + Parent = Dev_OutputToggleFilter, + BackgroundColor3 = Color3.new(1, 1, 1.0), + BorderColor3 = Color3.new(1, 1, 1.0), + Position = UDim2.new(0, 4, 0, 4), + Size = UDim2.new(0, 10, 0, 10), } - local Dev_TextHolder = Create'Frame'{ - Name = 'TextHolder'; - Parent = Dev_TextBox; - BackgroundTransparency = 1; - Position = UDim2.new(0, 0, 0, 0); - Size = UDim2.new(1, 0, 1, 0); - } - - local Dev_OptionsButton = Create'ImageButton'{ - Name = 'OptionsButton'; - Parent = Dev_Body; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 1.0; - Position = UDim2.new(0, 200, 0, 2); - Size = UDim2.new(0, 20, 0, 20); - } - - Create'ImageLabel'{ - Name = 'ImageLabel'; - Parent = Dev_OptionsButton; - BackgroundTransparency = 1.0; - Position = UDim2.new(0, 0, 0, 0); - Size = UDim2.new(1, 0, 1, 0); - Rotation = 0; - Image = "http://www.roblox.com/Asset?id=152093917"; + local Dev_WarningToggleFilter = Create "TextButton" { + Name = "WarningToggleButton", + Parent = Dev_OptionsBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(1, 0.6, 0.4), + Position = UDim2.new(0, 90, 0, 0), + Size = UDim2.new(0, 18, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "", + TextColor3 = Color3.new(1, 0.6, 0.4), } - local Dev_ResizeButton = Create'ImageButton'{ - Name = 'ResizeButton'; - Parent = Dev_Body; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.5; - Position = UDim2.new(1, -20, 1, -20); - Size = UDim2.new(0, 20, 0, 20); - } - - Create'ImageLabel'{ - Name = 'ImageLabel'; - Parent = Dev_ResizeButton; - BackgroundTransparency = 1; - Position = UDim2.new(0, 6, 0, 6); - Size = UDim2.new(0.8, 0, 0.8, 0); - Rotation = 135; - Image = "http://www.roblox.com/Asset?id=151205813"; + Create "Frame" { + Name = "CheckFrame", + Parent = Dev_WarningToggleFilter, + BackgroundColor3 = Color3.new(1, 0.6, 0.4), + BorderColor3 = Color3.new(1, 0.6, 0.4), + Position = UDim2.new(0, 4, 0, 4), + Size = UDim2.new(0, 10, 0, 10), } - Create'TextButton'{ - Name = 'LocalConsole'; - Parent = Dev_Body; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.6; - Position = UDim2.new(0, 7, 0, 5); - Size = UDim2.new(0, 90, 0, 20); - Font = "SourceSansBold"; - FontSize = Enum.FontSize.Size14; - Text = "Local Console"; - TextColor3 = Color3.new(1, 1, 1); - TextYAlignment = Enum.TextYAlignment.Center; + local Dev_WordWrapToggle = Create "TextButton" { + Name = "WordWrapToggleButton", + Parent = Dev_OptionsBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(0.8, 0.8, 0.8), + Position = UDim2.new(0, 215, 0, 0), + Size = UDim2.new(0, 18, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "", + TextColor3 = Color3.new(0.8, 0.8, 0.8), } - Create'TextButton'{ - Name = 'ServerConsole'; - Parent = Dev_Body; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.8; - Position = UDim2.new(0, 102, 0, 5); - Size = UDim2.new(0, 90, 0, 17); - Font = "SourceSansBold"; - FontSize = Enum.FontSize.Size14; - Text = "Server Console"; - TextColor3 = Color3.new(1, 1, 1); - TextYAlignment = Enum.TextYAlignment.Center; + Create "Frame" { + Name = "CheckFrame", + Parent = Dev_WordWrapToggle, + BackgroundColor3 = Color3.new(0.8, 0.8, 0.8), + BorderColor3 = Color3.new(0.8, 0.8, 0.8), + Position = UDim2.new(0, 4, 0, 4), + Size = UDim2.new(0, 10, 0, 10), + Visible = false, } - local Dev_TitleBar = Create'Frame'{ - Name = 'TitleBar'; - Parent = Dev_Container; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.5; - Position = UDim2.new(0, 0, 0, 0); - Size = UDim2.new(1, 0, 0, 20); + Create "TextLabel" { + Name = "Filter", + Parent = Dev_OptionsBar, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(0, 40, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "Filter", + TextColor3 = Color3.new(1, 1, 1), } - local Dev_CloseButton = Create'ImageButton'{ - Name = 'CloseButton'; - Parent = Dev_TitleBar; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.5; - Position = UDim2.new(1, -20, 0, 0); - Size = UDim2.new(0, 20, 0, 20); - } - - Create'ImageLabel'{ - Parent = Dev_CloseButton; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 1; - Position = UDim2.new(0, 3, 0, 3); - Size = UDim2.new(0, 14, 0, 14); - Image = "http://www.roblox.com/Asset?id=151205852"; + Create "TextLabel" { + Name = "WordWrap", + Parent = Dev_OptionsBar, + BackgroundTransparency = 1, + Position = UDim2.new(0, 150, 0, 0), + Size = UDim2.new(0, 50, 0, 18), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "Word Wrap", + TextColor3 = Color3.new(1, 1, 1), } - Create'TextButton'{ - Name = 'TextButton'; - Parent = Dev_TitleBar; - BackgroundColor3 = Color3.new(0,0,0); - BackgroundTransparency = 0.5; - Position = UDim2.new(0, 0, 0, 0); - Size = UDim2.new(1, -23, 1, 0); - Text = ""; + local Dev_ScrollBar = Create "Frame" { + Name = "ScrollBar", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.9, + Position = UDim2.new(1, -20, 0, 26), + Size = UDim2.new(0, 20, 1, -50), + Visible = false, } - Create'TextLabel'{ - Name = 'TitleText'; - Parent = Dev_TitleBar; - BackgroundTransparency = 1; - Position = UDim2.new(0, 0, 0, 0); - Size = UDim2.new(0, 185, 0, 20); - Font = "SourceSansBold"; - FontSize = Enum.FontSize.Size18; - Text = "Server Console"; - TextColor3 = Color3.new(1, 1, 1); - Text = "Roblox Developer Console"; - TextYAlignment = Enum.TextYAlignment.Top; + local Dev_ScrollArea = Create "Frame" { + Name = "ScrollArea", + Parent = Dev_ScrollBar, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0, 23), + Size = UDim2.new(1, 0, 1, -46), + } + + local Dev_Handle = Create "ImageButton" { + Name = "Handle", + Parent = Dev_ScrollArea, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 0.2, 0), + Size = UDim2.new(0, 20, 0, 40), + } + + Create "ImageLabel" { + Name = "ImageLabel", + Parent = Dev_Handle, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0.5, -8), + Rotation = 180, + Size = UDim2.new(1, 0, 0, 16), + Image = "http://www.roblox.com/Asset?id=151205881", + } + + local Dev_DownButton = Create "ImageButton" { + Name = "Down", + Parent = Dev_ScrollBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 1, -20), + Size = UDim2.new(0, 20, 0, 20), + } + + Create "ImageLabel" { + Name = "ImageLabel", + Parent = Dev_DownButton, + BackgroundTransparency = 1, + Position = UDim2.new(0, 3, 0, 3), + Size = UDim2.new(0, 14, 0, 14), + Rotation = 180, + Image = "http://www.roblox.com/Asset?id=151205813", + } + + local Dev_UpButton = Create "ImageButton" { + Name = "Up", + Parent = Dev_ScrollBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(0, 20, 0, 20), + } + + Create "ImageLabel" { + Name = "ImageLabel", + Parent = Dev_UpButton, + BackgroundTransparency = 1, + Position = UDim2.new(0, 3, 0, 3), + Size = UDim2.new(0, 14, 0, 14), + Image = "http://www.roblox.com/Asset?id=151205813", + } + + local Dev_TextBox = Create "Frame" { + Name = "TextBox", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.6, + Position = UDim2.new(0, 2, 0, 26), + Size = UDim2.new(1, -4, 1, -28), + ClipsDescendants = true, + } + + local Dev_TextHolder = Create "Frame" { + Name = "TextHolder", + Parent = Dev_TextBox, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, 0, 1, 0), + } + + local Dev_OptionsButton = Create "ImageButton" { + Name = "OptionsButton", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 1, + Position = UDim2.new(0, 200, 0, 2), + Size = UDim2.new(0, 20, 0, 20), + } + + Create "ImageLabel" { + Name = "ImageLabel", + Parent = Dev_OptionsButton, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, 0, 1, 0), + Rotation = 0, + Image = "http://www.roblox.com/Asset?id=152093917", + } + + local Dev_ResizeButton = Create "ImageButton" { + Name = "ResizeButton", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(1, -20, 1, -20), + Size = UDim2.new(0, 20, 0, 20), + } + + Create "ImageLabel" { + Name = "ImageLabel", + Parent = Dev_ResizeButton, + BackgroundTransparency = 1, + Position = UDim2.new(0, 6, 0, 6), + Size = UDim2.new(0.8, 0, 0.8, 0), + Rotation = 135, + Image = "http://www.roblox.com/Asset?id=151205813", + } + + Create "TextButton" { + Name = "LocalConsole", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.6, + Position = UDim2.new(0, 7, 0, 5), + Size = UDim2.new(0, 90, 0, 20), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "Local Console", + TextColor3 = Color3.new(1, 1, 1), + TextYAlignment = Enum.TextYAlignment.Center, + } + + Create "TextButton" { + Name = "ServerConsole", + Parent = Dev_Body, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.8, + Position = UDim2.new(0, 102, 0, 5), + Size = UDim2.new(0, 90, 0, 17), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size14, + Text = "Server Console", + TextColor3 = Color3.new(1, 1, 1), + TextYAlignment = Enum.TextYAlignment.Center, + } + + local Dev_TitleBar = Create "Frame" { + Name = "TitleBar", + Parent = Dev_Container, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, 0, 0, 20), + } + + local Dev_CloseButton = Create "ImageButton" { + Name = "CloseButton", + Parent = Dev_TitleBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(1, -20, 0, 0), + Size = UDim2.new(0, 20, 0, 20), + } + + Create "ImageLabel" { + Parent = Dev_CloseButton, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 1, + Position = UDim2.new(0, 3, 0, 3), + Size = UDim2.new(0, 14, 0, 14), + Image = "http://www.roblox.com/Asset?id=151205852", + } + + Create "TextButton" { + Name = "TextButton", + Parent = Dev_TitleBar, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.5, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, -23, 1, 0), + Text = "", + } + + Create "TextLabel" { + Name = "TitleText", + Parent = Dev_TitleBar, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(0, 185, 0, 20), + Font = "SourceSansBold", + FontSize = Enum.FontSize.Size18, + Text = "Server Console", + TextColor3 = Color3.new(1, 1, 1), + Text = "Roblox Developer Console", + TextYAlignment = Enum.TextYAlignment.Top, } ---Saved Mouse Information @@ -446,7 +440,6 @@ function initializeDeveloperConsole() local pSize = nil local previousMousePosScroll = nil - local pScrollHandle = nil local pOffset = nil local scrollUpIsDown = false @@ -464,13 +457,12 @@ function initializeDeveloperConsole() scrollDownIsDown = false end - ---Handle Dev-Console Position function refreshConsolePosition(x, y) if not previousMousePos then return end - + local delta = Vector2.new(x, y) - previousMousePos Dev_Container.Position = UDim2.new(0, pPos.X + delta.X, 0, pPos.Y + delta.Y) end @@ -489,132 +481,139 @@ function initializeDeveloperConsole() if not previousMousePosResize then return end - + local delta = Vector2.new(x, y) - previousMousePosResize - Dev_Container.Size = UDim2.new(0, math.max(pSize.X + delta.X, minimumSize.X), 0, math.max(pSize.Y + delta.Y, minimumSize.Y)) + Dev_Container.Size = + UDim2.new(0, math.max(pSize.X + delta.X, minimumSize.X), 0, math.max(pSize.Y + delta.Y, minimumSize.Y)) end Dev_Container.Body.ResizeButton.MouseButton1Down:connect(function(x, y) previousMousePosResize = Vector2.new(x, y) pSize = Dev_Container.AbsoluteSize end) - Dev_Container.Body.ResizeButton.MouseButton1Up:connect(function(x, y) + Dev_Container.Body.ResizeButton.MouseButton1Up:connect(function(_, _) clean() end) - ---Handle Dev-Console Close Button - Dev_TitleBar.CloseButton.MouseButton1Down:connect(function(x, y) + Dev_TitleBar.CloseButton.MouseButton1Down:connect(function(_, _) Dev_Container.Visible = false end) Dev_Container.TitleBar.CloseButton.MouseButton1Up:connect(function() clean() end) - + local optionsHidden = true local animating = false --Options function startAnimation() - if animating then return end + if animating then + return + end animating = true - + repeat if optionsHidden then frameNumber = frameNumber - 1 else frameNumber = frameNumber + 1 end - + local x = frameNumber / 5 local smoothStep = x * x * (3 - (2 * x)) Dev_OptionsButton.ImageLabel.Rotation = smoothStep * 5 * 9 Dev_OptionsBar.Position = UDim2.new(0, (smoothStep * 5 * 50) - 250, 0, 4) - + wait() if (frameNumber <= 0 and optionsHidden) or (frameNumber >= 5 and not optionsHidden) then animating = false end until not animating end - - Dev_OptionsButton.MouseButton1Down:connect(function(x, y) + + Dev_OptionsButton.MouseButton1Down:connect(function(_, _) optionsHidden = not optionsHidden startAnimation() end) - + --Scroll Position - + function changeOffset(value) - if (currentConsole == LOCAL_CONSOLE) then + if currentConsole == LOCAL_CONSOLE then localOffset = localOffset + value - elseif (currentConsole == SERVER_CONSOLE) then + elseif currentConsole == SERVER_CONSOLE then serverOffset = serverOffset + value end - + repositionList() end --Refresh Dev-Console Text function refreshTextHolderForReal() local childMessages = Dev_TextHolder:GetChildren() - + local messageList - - if (currentConsole == LOCAL_CONSOLE) then + + if currentConsole == LOCAL_CONSOLE then messageList = localMessageList - elseif (currentConsole == SERVER_CONSOLE) then + elseif currentConsole == SERVER_CONSOLE then messageList = serverMessageList end - + local posOffset = 0 for i = 1, #childMessages do childMessages[i].Visible = false end - + for i = 1, #messageList do local message - + local movePosition = false - + if i > #childMessages then - message = Create'TextLabel'{ - Name = 'Message'; - Parent = Dev_TextHolder; - BackgroundTransparency = 1; - TextXAlignment = 'Left'; - Size = UDim2.new(1, 0, 0, 14); - FontSize = 'Size10'; - ZIndex = 1; + message = Create "TextLabel" { + Name = "Message", + Parent = Dev_TextHolder, + BackgroundTransparency = 1, + TextXAlignment = "Left", + Size = UDim2.new(1, 0, 0, 14), + FontSize = "Size10", + ZIndex = 1, } movePosition = true else message = childMessages[i] end - - if (outputToggleOn or messageList[i].Type ~= Enum.MessageType.MessageOutput) and - (infoToggleOn or messageList[i].Type ~= Enum.MessageType.MessageInfo) and - (warningToggleOn or messageList[i].Type ~= Enum.MessageType.MessageWarning) and - (errorToggleOn or messageList[i].Type ~= Enum.MessageType.MessageError) then + + if + (outputToggleOn or messageList[i].Type ~= Enum.MessageType.MessageOutput) + and (infoToggleOn or messageList[i].Type ~= Enum.MessageType.MessageInfo) + and (warningToggleOn or messageList[i].Type ~= Enum.MessageType.MessageWarning) + and (errorToggleOn or messageList[i].Type ~= Enum.MessageType.MessageError) + then message.TextWrapped = wordWrapToggleOn message.Size = UDim2.new(0.98, 0, 0, 2000) message.Parent = Dev_Container - message.Text = messageList[i].Time.." -- "..messageList[i].Message - + message.Text = messageList[i].Time .. " -- " .. messageList[i].Message + 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 - + if movePosition then - if (currentConsole == LOCAL_CONSOLE and localOffset > 0) or (currentConsole == SERVER_CONSOLE and serverOffset > 0) then + if + (currentConsole == LOCAL_CONSOLE and localOffset > 0) + or (currentConsole == SERVER_CONSOLE and serverOffset > 0) + then changeOffset(message.TextBounds.Y) end end - + message.Visible = true - + if messageList[i].Type == Enum.MessageType.MessageError then message.TextColor3 = Color3.new(1, 0, 0) elseif messageList[i].Type == Enum.MessageType.MessageInfo then @@ -625,12 +624,9 @@ function initializeDeveloperConsole() message.TextColor3 = Color3.new(1, 1, 1) end end - - end - + textHolderSize = posOffset - end -- Refreshing the textholder every 0.1 (if needed) is good enough, surely fast enough @@ -639,11 +635,14 @@ function initializeDeveloperConsole() -- This will make it behave better in a situation of a lot of output comming in) local refreshQueued = false function refreshTextHolder() - if refreshQueued then return end - Delay(0.1,function() + if refreshQueued then + return + end + Delay(0.1, function() refreshQueued = false refreshTextHolderForReal() - end) refreshQueued = true + end) + refreshQueued = true end --Handle Dev-Console Scrollbar @@ -654,7 +653,7 @@ function initializeDeveloperConsole() return end scrollUpIsDown = true - wait(.6) + wait(0.6) inside = inside + 1 while scrollUpIsDown and inside < 2 do wait() @@ -668,7 +667,7 @@ function initializeDeveloperConsole() return end scrollDownIsDown = true - wait(.6) + wait(0.6) inside = inside + 1 while scrollDownIsDown and inside < 2 do wait() @@ -703,21 +702,21 @@ function initializeDeveloperConsole() if not previousMousePosScroll then return end - + local delta = (Vector2.new(x, y) - previousMousePosScroll).Y - + local backRatio = 1 - (Dev_Container.Body.TextBox.AbsoluteSize.Y / Dev_TextHolder.AbsoluteSize.Y) - + local movementSize = Dev_ScrollArea.AbsoluteSize.Y - Dev_ScrollArea.Handle.AbsoluteSize.Y local normalDelta = math.max(math.min(delta, movementSize), 0 - movementSize) local normalRatio = normalDelta / movementSize - + local textMovementSize = (backRatio * Dev_TextHolder.AbsoluteSize.Y) local offsetChange = textMovementSize * normalRatio - - if (currentConsole == LOCAL_CONSOLE) then + + if currentConsole == LOCAL_CONSOLE then localOffset = pOffset - offsetChange - elseif (currentConsole == SERVER_CONSOLE) then + elseif currentConsole == SERVER_CONSOLE then serverOffset = pOffset - offsetChange end end @@ -725,18 +724,17 @@ function initializeDeveloperConsole() Dev_ScrollArea.Handle.MouseButton1Down:connect(function(x, y) previousMousePosScroll = Vector2.new(x, y) pScrollHandle = Dev_ScrollArea.Handle.AbsolutePosition - if (currentConsole == LOCAL_CONSOLE) then + if currentConsole == LOCAL_CONSOLE then pOffset = localOffset - elseif (currentConsole == SERVER_CONSOLE) then + elseif currentConsole == SERVER_CONSOLE then pOffset = serverOffset end - end) Dev_ScrollArea.Handle.MouseButton1Up:connect(function(x, y) clean() end) - + local function existsInsideContainer(container, x, y) local pos = container.AbsolutePosition local size = container.AbsoluteSize @@ -746,125 +744,120 @@ function initializeDeveloperConsole() return true end - - --Refresh Dev-Console Message Positions function repositionList() - - if (currentConsole == LOCAL_CONSOLE) then + if currentConsole == LOCAL_CONSOLE then localOffset = math.min(math.max(localOffset, 0), textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y) Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize) - - elseif (currentConsole == SERVER_CONSOLE) then - serverOffset = math.min(math.max(serverOffset, 0), textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y) + elseif currentConsole == SERVER_CONSOLE then + serverOffset = + math.min(math.max(serverOffset, 0), textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y) Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize) end - + local ratio = Dev_Container.Body.TextBox.AbsoluteSize.Y / Dev_TextHolder.AbsoluteSize.Y if ratio >= 1 then Dev_Container.Body.ScrollBar.Visible = false Dev_Container.Body.TextBox.Size = UDim2.new(1, -4, 1, -28) - - if (currentConsole == LOCAL_CONSOLE) then - Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize) - elseif (currentConsole == SERVER_CONSOLE) then + + if currentConsole == LOCAL_CONSOLE or currentConsole == SERVER_CONSOLE then Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize) end - - else Dev_Container.Body.ScrollBar.Visible = true Dev_Container.Body.TextBox.Size = UDim2.new(1, -25, 1, -28) - + local backRatio = 1 - ratio local offsetRatio - - if (currentConsole == LOCAL_CONSOLE) then + + if currentConsole == LOCAL_CONSOLE then offsetRatio = localOffset / Dev_TextHolder.AbsoluteSize.Y - elseif (currentConsole == SERVER_CONSOLE) then + elseif currentConsole == SERVER_CONSOLE then offsetRatio = serverOffset / Dev_TextHolder.AbsoluteSize.Y end - + local topRatio = math.max(0, backRatio - offsetRatio) - - local scrollHandleSize = math.max((Dev_ScrollArea.AbsoluteSize.Y) * ratio, 21) - + + local scrollHandleSize = math.max(Dev_ScrollArea.AbsoluteSize.Y * ratio, 21) + local scrollRatio = scrollHandleSize / Dev_ScrollArea.AbsoluteSize.Y local ratioConversion = (1 - scrollRatio) / (1 - ratio) - + local topScrollRatio = topRatio * ratioConversion - - local sPos = math.min((Dev_ScrollArea.AbsoluteSize.Y) * topScrollRatio, Dev_ScrollArea.AbsoluteSize.Y - scrollHandleSize) - + + local sPos = math.min( + Dev_ScrollArea.AbsoluteSize.Y * topScrollRatio, + Dev_ScrollArea.AbsoluteSize.Y - scrollHandleSize + ) + Dev_ScrollArea.Handle.Size = UDim2.new(1, 0, 0, scrollHandleSize) Dev_ScrollArea.Handle.Position = UDim2.new(0, 0, 0, sPos) - - if (currentConsole == LOCAL_CONSOLE) then + + if currentConsole == LOCAL_CONSOLE then Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize + localOffset) - elseif (currentConsole == SERVER_CONSOLE) then + elseif currentConsole == SERVER_CONSOLE then Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize + serverOffset) end - end end - + -- Easy, fast, and working nicely local function numberWithZero(num) - return (num < 10 and "0" or "")..num + return (num < 10 and "0" or "") .. num end - + local str = "%s:%s:%s" function ConvertTimeStamp(timeStamp) local localTime = timeStamp - os.time() + math.floor(tick()) local dayTime = localTime % 86400 - - local hour = math.floor(dayTime/3600) - + + local hour = math.floor(dayTime / 3600) + dayTime = dayTime - (hour * 3600) - local minute = math.floor(dayTime/60) - + local minute = math.floor(dayTime / 60) + dayTime = dayTime - (minute * 60) local second = dayTime - + local h = numberWithZero(hour) local m = numberWithZero(minute) local s = numberWithZero(dayTime) - return str:format(h,m,s) + return str:format(h, m, s) end - + --Filter - + Dev_OptionsBar.ErrorToggleButton.MouseButton1Down:connect(function(x, y) errorToggleOn = not errorToggleOn Dev_OptionsBar.ErrorToggleButton.CheckFrame.Visible = errorToggleOn refreshTextHolder() repositionList() end) - + Dev_OptionsBar.WarningToggleButton.MouseButton1Down:connect(function(x, y) warningToggleOn = not warningToggleOn Dev_OptionsBar.WarningToggleButton.CheckFrame.Visible = warningToggleOn refreshTextHolder() repositionList() end) - + Dev_OptionsBar.InfoToggleButton.MouseButton1Down:connect(function(x, y) infoToggleOn = not infoToggleOn Dev_OptionsBar.InfoToggleButton.CheckFrame.Visible = infoToggleOn refreshTextHolder() repositionList() end) - + Dev_OptionsBar.OutputToggleButton.MouseButton1Down:connect(function(x, y) outputToggleOn = not outputToggleOn Dev_OptionsBar.OutputToggleButton.CheckFrame.Visible = outputToggleOn refreshTextHolder() repositionList() end) - + Dev_OptionsBar.WordWrapToggleButton.MouseButton1Down:connect(function(x, y) wordWrapToggleOn = not wordWrapToggleOn Dev_OptionsBar.WordWrapToggleButton.CheckFrame.Visible = wordWrapToggleOn @@ -874,86 +867,83 @@ function initializeDeveloperConsole() ---Dev-Console Message Functionality function AddLocalMessage(str, messageType, timeStamp) - localMessageList[#localMessageList+1] = {Message = str, Time = ConvertTimeStamp(timeStamp), Type = messageType} + localMessageList[#localMessageList + 1] = + { Message = str, Time = ConvertTimeStamp(timeStamp), Type = messageType } while #localMessageList > MAX_LIST_SIZE do table.remove(localMessageList, 1) end - + refreshTextHolder() - + repositionList() end function AddServerMessage(str, messageType, timeStamp) - serverMessageList[#serverMessageList+1] = {Message = str, Time = ConvertTimeStamp(timeStamp), Type = messageType} + serverMessageList[#serverMessageList + 1] = + { Message = str, Time = ConvertTimeStamp(timeStamp), Type = messageType } while #serverMessageList > MAX_LIST_SIZE do table.remove(serverMessageList, 1) end - + refreshTextHolder() - + repositionList() end - - --Handle Dev-Console Local/Server Buttons Dev_Container.Body.LocalConsole.MouseButton1Click:connect(function(x, y) - if (currentConsole == SERVER_CONSOLE) then + if currentConsole == SERVER_CONSOLE then currentConsole = LOCAL_CONSOLE local localConsole = Dev_Container.Body.LocalConsole local serverConsole = Dev_Container.Body.ServerConsole - + localConsole.Size = UDim2.new(0, 90, 0, 20) serverConsole.Size = UDim2.new(0, 90, 0, 17) 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() local mousePos = Vector2.new(mouse.X, mouse.Y) refreshConsolePosition(mouse.X, mouse.Y) refreshConsoleSize(mouse.X, mouse.Y) handleScroll(mouse.X, mouse.Y) end - + refreshTextHolder() repositionList() - end end) Dev_Container.Body.LocalConsole.MouseButton1Up:connect(function() clean() end) - - local serverHistoryRequested = false; + + local serverHistoryRequested = false Dev_Container.Body.ServerConsole.MouseButton1Click:connect(function(x, y) - if not serverHistoryRequested then serverHistoryRequested = true game:GetService("LogService"):RequestServerOutput() end - - if (currentConsole == LOCAL_CONSOLE) then + + if currentConsole == LOCAL_CONSOLE then currentConsole = SERVER_CONSOLE local localConsole = Dev_Container.Body.LocalConsole local serverConsole = Dev_Container.Body.ServerConsole - + serverConsole.Size = UDim2.new(0, 90, 0, 20) localConsole.Size = UDim2.new(0, 90, 0, 17) 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() - local mousePos = Vector2.new(mouse.X, mouse.Y) refreshConsolePosition(mouse.X, mouse.Y) refreshConsoleSize(mouse.X, mouse.Y) handleScroll(mouse.X, mouse.Y) end - + refreshTextHolder() repositionList() end @@ -963,19 +953,18 @@ function initializeDeveloperConsole() Dev_Container.Body.ServerConsole.MouseButton1Up:connect(function() 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 return end local mouse = game.Players.LocalPlayer:GetMouse() - local mousePos = Vector2.new(mouse.X, mouse.Y) refreshConsolePosition(mouse.X, mouse.Y) refreshConsoleSize(mouse.X, mouse.Y) handleScroll(mouse.X, mouse.Y) - + refreshTextHolder() repositionList() end) @@ -983,7 +972,7 @@ function initializeDeveloperConsole() LocalMouse.Button1Up:connect(function() clean() end) - + LocalMouse.WheelForward:connect(function() if not Dev_Container.Visible then return @@ -992,7 +981,7 @@ function initializeDeveloperConsole() changeOffset(10) end end) - + LocalMouse.WheelBackward:connect(function() if not Dev_Container.Visible then return @@ -1001,28 +990,25 @@ function initializeDeveloperConsole() changeOffset(-10) end end) - end - + Dev_ScrollArea.Handle.MouseButton1Down:connect(function() repositionList() end) - - + ---Populate Dev-Console with dummy messages - + local history = game:GetService("LogService"):GetLogHistory() - + for i = 1, #history do AddLocalMessage(history[i].message, history[i].messageType, history[i].timestamp) end - + game:GetService("LogService").MessageOut:connect(function(message, messageType) AddLocalMessage(message, messageType, os.time()) end) - + game:GetService("LogService").ServerMessageOut:connect(AddServerMessage) - end local currentlyToggling = false diff --git a/36868950.lua b/36868950.lua index f0fee74..7920eb7 100644 --- a/36868950.lua +++ b/36868950.lua @@ -1,28 +1,28 @@ -local controlFrame = script.Parent:FindFirstChild("ControlFrame") +local controlFrame = script.Parent:FindFirstChild "ControlFrame" -if not controlFrame then return end +if not controlFrame then + return +end -local topLeftControl = controlFrame:FindFirstChild("TopLeftControl") -local bottomLeftControl = controlFrame:FindFirstChild("BottomLeftControl") -local bottomRightControl = controlFrame:FindFirstChild("BottomRightControl") +local bottomLeftControl = controlFrame:FindFirstChild "BottomLeftControl" +local bottomRightControl = controlFrame:FindFirstChild "BottomRightControl" - -local frameTip = Instance.new("TextLabel") +local frameTip = Instance.new "TextLabel" frameTip.Name = "ToolTip" frameTip.Text = "" frameTip.Font = Enum.Font.ArialBold frameTip.FontSize = Enum.FontSize.Size12 -frameTip.TextColor3 = Color3.new(1,1,1) +frameTip.TextColor3 = Color3.new(1, 1, 1) frameTip.BorderSizePixel = 0 frameTip.ZIndex = 10 -frameTip.Size = UDim2.new(2,0,1,0) -frameTip.Position = UDim2.new(1,0,0,0) -frameTip.BackgroundColor3 = Color3.new(0,0,0) +frameTip.Size = UDim2.new(2, 0, 1, 0) +frameTip.Position = UDim2.new(1, 0, 0, 0) +frameTip.BackgroundColor3 = Color3.new(0, 0, 0) frameTip.BackgroundTransparency = 1 frameTip.TextTransparency = 1 frameTip.TextWrap = true -local inside = Instance.new("BoolValue") +local inside = Instance.new "BoolValue" inside.Name = "inside" inside.Value = false inside.Parent = frameTip @@ -30,7 +30,7 @@ inside.Parent = frameTip function setUpListeners(frameToListen) local fadeSpeed = 0.1 frameToListen.Parent.MouseEnter:connect(function() - if frameToListen:FindFirstChild("inside") then + if frameToListen:FindFirstChild "inside" then frameToListen.inside.Value = true wait(1.2) if frameToListen.inside.Value then @@ -47,22 +47,26 @@ function setUpListeners(frameToListen) killFrame.BackgroundTransparency = 1 killFrame.TextTransparency = 1 end - frameToListen.Parent.MouseLeave:connect(function() killTip(frameToListen) end) - frameToListen.Parent.MouseButton1Click:connect(function() killTip(frameToListen) end) + frameToListen.Parent.MouseLeave:connect(function() + killTip(frameToListen) + end) + frameToListen.Parent.MouseButton1Click:connect(function() + killTip(frameToListen) + end) end function createSettingsButtonTip(parent) if parent == nil then - parent = bottomLeftControl:FindFirstChild("SettingsButton") + parent = bottomLeftControl:FindFirstChild "SettingsButton" end - + local toolTip = frameTip:clone() - toolTip.RobloxLocked = true - toolTip.Text = "Settings/Leave Game" - toolTip.Position = UDim2.new(0,0,0,-18) - toolTip.Size = UDim2.new(0,120,0,20) - toolTip.Parent = parent - setUpListeners(toolTip) + toolTip.RobloxLocked = true + toolTip.Text = "Settings/Leave Game" + toolTip.Position = UDim2.new(0, 0, 0, -18) + toolTip.Size = UDim2.new(0, 120, 0, 20) + toolTip.Parent = parent + setUpListeners(toolTip) end wait(5) -- make sure we are loaded in, won't need tool tips for first 5 seconds anyway @@ -70,18 +74,16 @@ wait(5) -- make sure we are loaded in, won't need tool tips for first 5 seconds ---------------- set up Bottom Left Tool Tips ------------------------- local bottomLeftChildren = bottomLeftControl:GetChildren() -local hasSettingsTip = false for i = 1, #bottomLeftChildren do - if bottomLeftChildren[i].Name == "Exit" then - local exitTip = frameTip:clone() - exitTip.RobloxLocked = true - exitTip.Text = "Leave Place" - exitTip.Position = UDim2.new(0,0,-1,0) - exitTip.Size = UDim2.new(1,0,1,0) - exitTip.Parent = bottomLeftChildren[i] - setUpListeners(exitTip) + local exitTip = frameTip:clone() + exitTip.RobloxLocked = true + exitTip.Text = "Leave Place" + exitTip.Position = UDim2.new(0, 0, -1, 0) + exitTip.Size = UDim2.new(1, 0, 1, 0) + exitTip.Parent = bottomLeftChildren[i] + setUpListeners(exitTip) elseif bottomLeftChildren[i].Name == "SettingsButton" then hasSettingsTip = true createSettingsButtonTip(bottomLeftChildren[i]) @@ -93,16 +95,16 @@ end local bottomRightChildren = bottomRightControl:GetChildren() for i = 1, #bottomRightChildren do - if bottomRightChildren[i].Name:find("Camera") ~= nil then + if bottomRightChildren[i].Name:find "Camera" ~= nil then local cameraTip = frameTip:clone() cameraTip.RobloxLocked = true cameraTip.Text = "Camera View" - if bottomRightChildren[i].Name:find("Zoom") then - cameraTip.Position = UDim2.new(-1,0,-1.5) + if bottomRightChildren[i].Name:find "Zoom" then + cameraTip.Position = UDim2.new(-1, 0, -1.5) else - cameraTip.Position = UDim2.new(0,0,-1.5,0) + cameraTip.Position = UDim2.new(0, 0, -1.5, 0) end - cameraTip.Size = UDim2.new(2,0,1.25,0) + cameraTip.Size = UDim2.new(2, 0, 1.25, 0) cameraTip.Parent = bottomRightChildren[i] setUpListeners(cameraTip) end diff --git a/37801172.lua b/37801172.lua index c1ed560..61c8eda 100644 --- a/37801172.lua +++ b/37801172.lua @@ -1,13 +1,14 @@ - -- Creates all neccessary scripts for the gui on initial load, everything except build tools -- Created by Ben T. 10/29/10 -- Please note that these are loaded in a specific order to diminish errors/perceived load time by user -local scriptContext = game:GetService("ScriptContext") +local scriptContext = game:GetService "ScriptContext" local touchEnabled = false -pcall(function() touchEnabled = game:GetService("UserInputService").TouchEnabled end) +pcall(function() + touchEnabled = game:GetService("UserInputService").TouchEnabled +end) -- library registration -scriptContext:AddCoreScript(60595695, scriptContext,"/Libraries/LibraryRegistration/LibraryRegistration") +scriptContext:AddCoreScript(60595695, scriptContext, "/Libraries/LibraryRegistration/LibraryRegistration") local function waitForChild(instance, name) while not instance:FindFirstChild(name) do @@ -21,90 +22,87 @@ local function waitForProperty(instance, property) end -- Responsible for tracking logging items -local scriptContext = game:GetService("ScriptContext") +local scriptContext = game:GetService "ScriptContext" scriptContext:AddCoreScript(59002209, scriptContext, "CoreScripts/Sections") -waitForChild(game:GetService("CoreGui"),"RobloxGui") -local screenGui = game:GetService("CoreGui"):FindFirstChild("RobloxGui") +waitForChild(game:GetService "CoreGui", "RobloxGui") +local screenGui = game:GetService("CoreGui"):FindFirstChild "RobloxGui" if not touchEnabled then -- ToolTipper (creates tool tips for gui) - scriptContext:AddCoreScript(36868950,screenGui,"CoreScripts/ToolTip") - -- SettingsScript - scriptContext:AddCoreScript(46295863,screenGui,"CoreScripts/Settings") + scriptContext:AddCoreScript(36868950, screenGui, "CoreScripts/ToolTip") + -- SettingsScript + scriptContext:AddCoreScript(46295863, screenGui, "CoreScripts/Settings") else - scriptContext:AddCoreScript(153556783,screenGui,"CoreScripts/TouchControls") + scriptContext:AddCoreScript(153556783, screenGui, "CoreScripts/TouchControls") end -- MainBotChatScript -scriptContext:AddCoreScript(39250920,screenGui,"CoreScripts/MainBotChatScript") +scriptContext:AddCoreScript(39250920, screenGui, "CoreScripts/MainBotChatScript") -- Popup Script -scriptContext:AddCoreScript(48488451,screenGui,"CoreScripts/PopupScript") +scriptContext:AddCoreScript(48488451, screenGui, "CoreScripts/PopupScript") -- Friend Notification Script (probably can use this script to expand out to other notifications) -scriptContext:AddCoreScript(48488398,screenGui,"CoreScripts/NotificationScript") +scriptContext:AddCoreScript(48488398, screenGui, "CoreScripts/NotificationScript") -- Chat script -scriptContext:AddCoreScript(97188756, screenGui, "CoreScripts/ChatScript") +scriptContext:AddCoreScript(97188756, screenGui, "CoreScripts/ChatScript") -- Purchase Prompt Script scriptContext:AddCoreScript(107893730, screenGui, "CoreScripts/PurchasePromptScript") -if not touchEnabled then +if not touchEnabled or screenGui.AbsoluteSize.Y > 600 then -- New Player List - scriptContext:AddCoreScript(48488235,screenGui,"CoreScripts/PlayerListScript") -elseif screenGui.AbsoluteSize.Y > 600 then - -- New Player List - scriptContext:AddCoreScript(48488235,screenGui,"CoreScripts/PlayerListScript") -else + scriptContext:AddCoreScript(48488235, screenGui, "CoreScripts/PlayerListScript") +else delay(5, function() - if screenGui.AbsoluteSize.Y >= 600 then + if screenGui.AbsoluteSize.Y >= 600 then -- New Player List - scriptContext:AddCoreScript(48488235,screenGui,"CoreScripts/PlayerListScript") - end - end) -end + scriptContext:AddCoreScript(48488235, screenGui, "CoreScripts/PlayerListScript") + end + end) +end if game.CoreGui.Version >= 3 and game.PlaceId ~= 130815926 then --todo: remove placeid hack for halloween -- Backpack Builder, creates most of the backpack gui - scriptContext:AddCoreScript(53878047,screenGui,"CoreScripts/BackpackScripts/BackpackBuilder") + scriptContext:AddCoreScript(53878047, screenGui, "CoreScripts/BackpackScripts/BackpackBuilder") - waitForChild(screenGui,"CurrentLoadout") - waitForChild(screenGui,"Backpack") + waitForChild(screenGui, "CurrentLoadout") + waitForChild(screenGui, "Backpack") local Backpack = screenGui.Backpack - + -- Manager handles all big backpack state changes, other scripts subscribe to this and do things accordingly if game.CoreGui.Version >= 7 then - scriptContext:AddCoreScript(89449093,Backpack,"CoreScripts/BackpackScripts/BackpackManager") + scriptContext:AddCoreScript(89449093, Backpack, "CoreScripts/BackpackScripts/BackpackManager") end - + -- Backpack Gear (handles all backpack gear tab stuff) - game:GetService("ScriptContext"):AddCoreScript(89449008,Backpack,"CoreScripts/BackpackScripts/BackpackGear") + game:GetService("ScriptContext"):AddCoreScript(89449008, Backpack, "CoreScripts/BackpackScripts/BackpackGear") -- Loadout Script, used for gear hotkeys - scriptContext:AddCoreScript(53878057,screenGui.CurrentLoadout,"CoreScripts/BackpackScripts/LoadoutScript") + scriptContext:AddCoreScript(53878057, screenGui.CurrentLoadout, "CoreScripts/BackpackScripts/LoadoutScript") if game.CoreGui.Version >= 8 then -- Wardrobe script handles all character dressing operations - scriptContext:AddCoreScript(-1,Backpack,"CoreScripts/BackpackScripts/BackpackWardrobe") + scriptContext:AddCoreScript(-1, Backpack, "CoreScripts/BackpackScripts/BackpackWardrobe") end end -local IsPersonalServer = not not game.Workspace:FindFirstChild("PSVariable") -if IsPersonalServer then - game:GetService("ScriptContext"):AddCoreScript(64164692,game.Players.LocalPlayer,"BuildToolManager") +local IsPersonalServer = not not game.Workspace:FindFirstChild "PSVariable" +if IsPersonalServer then + game:GetService("ScriptContext"):AddCoreScript(64164692, game.Players.LocalPlayer, "BuildToolManager") end game.Workspace.ChildAdded:connect(function(nchild) - if nchild.Name=='PSVariable' and nchild:IsA('BoolValue') then - IsPersonalServer = true - game:GetService("ScriptContext"):AddCoreScript(64164692,game.Players.LocalPlayer,"BuildToolManager") + if nchild.Name == "PSVariable" and nchild:IsA "BoolValue" then + IsPersonalServer = true + game:GetService("ScriptContext"):AddCoreScript(64164692, game.Players.LocalPlayer, "BuildToolManager") end end) if touchEnabled then -- touch devices don't use same control frame -- only used for touch device button generation - scriptContext:AddCoreScript(152908679,screenGui,"CoreScripts/ContextActionTouch") - - waitForChild(screenGui, 'ControlFrame') - waitForChild(screenGui.ControlFrame, 'BottomLeftControl') + scriptContext:AddCoreScript(152908679, screenGui, "CoreScripts/ContextActionTouch") + + waitForChild(screenGui, "ControlFrame") + waitForChild(screenGui.ControlFrame, "BottomLeftControl") screenGui.ControlFrame.BottomLeftControl.Visible = false - waitForChild(screenGui.ControlFrame, 'TopLeftControl') - screenGui.ControlFrame.TopLeftControl.Visible = false -end \ No newline at end of file + waitForChild(screenGui.ControlFrame, "TopLeftControl") + screenGui.ControlFrame.TopLeftControl.Visible = false +end diff --git a/38037565.lua b/38037565.lua index cefc7e9..af7ab04 100644 --- a/38037565.lua +++ b/38037565.lua @@ -1,52 +1,52 @@ -local damageGuiWidth = 5.0 +local damageGuiWidth = 5.0 local damageGuiHeight = 5.0 - function waitForChild(parent, childName) - local child = parent:findFirstChild(childName) - if child then return child end - while true do - child = parent.ChildAdded:wait() - if child.Name==childName then return child end - end + local child = parent:findFirstChild(childName) + if child then + return child + end + while true do + child = parent.ChildAdded:wait() + if child.Name == childName then + return child + end + end end -- declarations local Figure = script.Parent -local Head = waitForChild(Figure, "Head") -local Humanoid = waitForChild(Figure, "Humanoid") -local walkSpeed = Humanoid.WalkSpeed -local Torso = waitForChild(Figure, "Torso") +local Humanoid = waitForChild(Figure, "Humanoid") +local Torso = waitForChild(Figure, "Torso") -local config = Figure:FindFirstChild("PlayerStats") +local config = Figure:FindFirstChild "PlayerStats" -local inCharTag = Instance.new("BoolValue") -inCharTag.Name = "InCharTag" +local inCharTag = Instance.new "BoolValue" +inCharTag.Name = "InCharTag" -local hider = Instance.new("BoolValue") -hider.Name = "RobloxBuildTool" +local hider = Instance.new "BoolValue" +hider.Name = "RobloxBuildTool" local currentChildren local backpackTools -if config == nil then - config = Instance.new("Configuration") +if config == nil then + config = Instance.new "Configuration" config.Parent = Figure - config.Name = "PlayerStats" + config.Name = "PlayerStats" end -local myHealth = config:FindFirstChild("MaxHealth") -if myHealth == nil then - myHealth = Instance.new("NumberValue") +local myHealth = config:FindFirstChild "MaxHealth" +if myHealth == nil then + myHealth = Instance.new "NumberValue" myHealth.Parent = config myHealth.Value = 100 - myHealth.Name = "MaxHealth" + myHealth.Name = "MaxHealth" end Humanoid.MaxHealth = myHealth.Value Humanoid.Health = myHealth.Value - function onMaxHealthChange() Humanoid.MaxHealth = myHealth.Value Humanoid.Health = myHealth.Value @@ -54,52 +54,56 @@ end myHealth.Changed:connect(onMaxHealthChange) - --Humanoid.MaxHealth = myHealth.Value --Humanoid.Health = Humanoid.MaxHealth local vPlayer = game.Players:GetPlayerFromCharacter(script.Parent) -local dotGui = vPlayer.PlayerGui:FindFirstChild("DamageOverTimeGui") +local dotGui = vPlayer.PlayerGui:FindFirstChild "DamageOverTimeGui" if dotGui == nil then - dotGui = Instance.new("BillboardGui") - dotGui.Name = "DamageOverTimeGui" + dotGui = Instance.new "BillboardGui" + dotGui.Name = "DamageOverTimeGui" dotGui.Parent = vPlayer.PlayerGui - dotGui.Adornee = script.Parent:FindFirstChild("Head") + dotGui.Adornee = script.Parent:FindFirstChild "Head" dotGui.Active = true - dotGui.size = UDim2.new(damageGuiWidth, 0.0, damageGuiHeight, 0.0) - dotGui.StudsOffset = Vector3.new(0.0, 2.0, 0.0) + dotGui.size = UDim2.new(damageGuiWidth, 0, damageGuiHeight, 0.0) + dotGui.StudsOffset = Vector3.new(0, 2.0, 0.0) end -print("newHealth declarations finished") +print "newHealth declarations finished" -function billboardHealthChange(dmg) - local textLabel = Instance.new("TextLabel") - if dmg > 0 then textLabel.Text = tostring(dmg) textLabel.TextColor3 = Color3.new(0, 1, 0) - else textLabel.Text = tostring(dmg) textLabel.TextColor3 = Color3.new(1, 0, 1) end - textLabel.size = UDim2.new(1.0, 0.0, 1.0, 0.0) - textLabel.Active = true - textLabel.FontSize = 6 - textLabel.BackgroundTransparency = 1 - textLabel.Parent = dotGui +function billboardHealthChange(dmg) + local textLabel = Instance.new "TextLabel" + if dmg > 0 then + textLabel.Text = tostring(dmg) + textLabel.TextColor3 = Color3.new(0, 1, 0) + else + textLabel.Text = tostring(dmg) + textLabel.TextColor3 = Color3.new(1, 0, 1) + end + textLabel.size = UDim2.new(1, 0, 1, 0.0) + textLabel.Active = true + textLabel.FontSize = 6 + textLabel.BackgroundTransparency = 1 + textLabel.Parent = dotGui - for t = 1, 10 do - wait(.1) - textLabel.TextTransparency = t/10 - textLabel.Position = UDim2.new(0, 0, 0, -t*5) - textLabel.FontSize = 6-t*.6 - end + for t = 1, 10 do + wait(0.1) + textLabel.TextTransparency = t / 10 + textLabel.Position = UDim2.new(0, 0, 0, -t * 5) + textLabel.FontSize = 6 - t * 0.6 + end - textLabel:remove() + textLabel:remove() end function setMaxHealth() --print(Humanoid.Health) - if myHealth.Value >=0 then - Humanoid.MaxHealth = myHealth.Value + if myHealth.Value >= 0 then + Humanoid.MaxHealth = myHealth.Value print(Humanoid.MaxHealth) - if Humanoid.Health > Humanoid.MaxHealth then - Humanoid.Health = Humanoid.MaxHealth - end + if Humanoid.Health > Humanoid.MaxHealth then + Humanoid.Health = Humanoid.MaxHealth + end end end @@ -107,121 +111,130 @@ myHealth.Changed:connect(setMaxHealth) -- Visual Effects -- -fireEffect = Instance.new("Fire") +fireEffect = Instance.new "Fire" fireEffect.Heat = 0.1 fireEffect.Size = 3.0 -fireEffect.Name = "FireEffect" +fireEffect.Name = "FireEffect" fireEffect.Enabled = false -- - - -- regeneration - while true do - local s = wait(1) - local health = Humanoid.Health - if health > 0 then -- and health < Humanoid.MaxHealth then - local delta = 0 - if config then - regen = config:FindFirstChild("Regen") - poison = config:FindFirstChild("Poison") - ice = config:FindFirstChild("Ice") - fire = config:FindFirstChild("Fire") - stun = config:FindFirstChild("Stun") - if regen then - delta = delta + regen.Value.X - if regen.Value.Y >= 0 then regen.Value = Vector3.new(regen.Value.X+regen.Value.Z, regen.Value.Y - s, regen.Value.Z) -- maybe have 3rd parameter be an increaser/decreaser? - elseif regen.Value.Y == -1 then regen.Value = Vector3.new(regen.Value.X+regen.Value.Z, -1, regen.Value.Z) - else regen:remove() end -- infinity is -1 - end - if poison then - delta = delta - poison.Value.X - if poison.Value.Y >= 0 then poison.Value = Vector3.new(poison.Value.X+poison.Value.Z, poison.Value.Y - s, poison.Value.Z) - elseif poison.Value.Y == -1 then poison.Value = Vector3.new(poison.Value.X+poison.Value.Z, -1, poison.Value.Z) - else poison:remove() end -- infinity is -1 - end - - if ice then - --print("IN ICE") - delta = delta - ice.Value.X - if ice.Value.Y >=0 then - ice.Value = Vector3.new(ice.Value.X, ice.Value.Y - s, ice.Value.Z) - else - ice:remove() - end - end - - if fire then - fireEffect.Enabled = true - fireEffect.Parent = Figure.Torso - delta = delta - fire.Value.X - if fire.Value.Y >= 0 then - fire.Value = Vector3.new(fire.Value.X, fire.Value.Y - s, fire.Value.Z) - else - fire:remove() - fireEffect.Enabled = false - fireEffect.Parent = nil +-- regeneration +while true do + local s = wait(1) + local health = Humanoid.Health + if health > 0 then -- and health < Humanoid.MaxHealth then + local delta = 0 + if config then + regen = config:FindFirstChild "Regen" + poison = config:FindFirstChild "Poison" + ice = config:FindFirstChild "Ice" + fire = config:FindFirstChild "Fire" + stun = config:FindFirstChild "Stun" + if regen then + delta = delta + regen.Value.X + if regen.Value.Y >= 0 then + regen.Value = Vector3.new(regen.Value.X + regen.Value.Z, regen.Value.Y - s, regen.Value.Z) -- maybe have 3rd parameter be an increaser/decreaser? + elseif regen.Value.Y == -1 then + regen.Value = Vector3.new(regen.Value.X + regen.Value.Z, -1, regen.Value.Z) + else + regen:remove() + end -- infinity is -1 + end + if poison then + delta = delta - poison.Value.X + if poison.Value.Y >= 0 then + poison.Value = Vector3.new(poison.Value.X + poison.Value.Z, poison.Value.Y - s, poison.Value.Z) + elseif poison.Value.Y == -1 then + poison.Value = Vector3.new(poison.Value.X + poison.Value.Z, -1, poison.Value.Z) + else + poison:remove() + end -- infinity is -1 end - end - if stun then - if stun.Value > 0 then - Torso.Anchored = true - currentChildren = script.Parent:GetChildren() - backpackTools = game.Players:GetPlayerFromCharacter(script.Parent).Backpack:GetChildren() - for i = 1, #currentChildren do - if currentChildren[i].className == "Tool" then - inCharTag:Clone().Parent = currentChildren[i] - print(backpackTools) - table.insert(backpackTools, currentChildren[i]) + if ice then + --print("IN ICE") + delta = delta - ice.Value.X + if ice.Value.Y >= 0 then + ice.Value = Vector3.new(ice.Value.X, ice.Value.Y - s, ice.Value.Z) + else + ice:remove() + end + end + + if fire then + fireEffect.Enabled = true + fireEffect.Parent = Figure.Torso + delta = delta - fire.Value.X + if fire.Value.Y >= 0 then + fire.Value = Vector3.new(fire.Value.X, fire.Value.Y - s, fire.Value.Z) + else + fire:remove() + fireEffect.Enabled = false + fireEffect.Parent = nil + end + end + + if stun then + if stun.Value > 0 then + Torso.Anchored = true + currentChildren = script.Parent:GetChildren() + backpackTools = game.Players:GetPlayerFromCharacter(script.Parent).Backpack:GetChildren() + for i = 1, #currentChildren do + if currentChildren[i].className == "Tool" then + inCharTag:Clone().Parent = currentChildren[i] + print(backpackTools) + table.insert(backpackTools, currentChildren[i]) + end end - end - for i = 1, #backpackTools do - if backpackTools[i]:FindFirstChild("RobloxBuildTool") == nil then - hider:Clone().Parent = backpackTools[i] - backpackTools[i].Parent = game.Lighting + for i = 1, #backpackTools do + if backpackTools[i]:FindFirstChild "RobloxBuildTool" == nil then + hider:Clone().Parent = backpackTools[i] + backpackTools[i].Parent = game.Lighting + end end - end - wait(0.2) - for i = 1, #backpackTools do - backpackTools[i].Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack - end - stun.Value = stun.Value - s - else - Torso.Anchored = false - for i = 1, #backpackTools do - rbTool = backpackTools[i]:FindFirstChild("RobloxBuildTool") - if rbTool then rbTool:Remove() end - backpackTools[i].Parent = game.Lighting - end - wait(0.2) - for i = 1, #backpackTools do - wasInCharacter = backpackTools[i]:FindFirstChild("InCharTag") - if wasInChar then - wasInChar:Remove() - backpackTools[i].Parent = script.Parent - else + wait(0.2) + for i = 1, #backpackTools do backpackTools[i].Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack end + stun.Value = stun.Value - s + else + Torso.Anchored = false + for i = 1, #backpackTools do + rbTool = backpackTools[i]:FindFirstChild "RobloxBuildTool" + if rbTool then + rbTool:Remove() + end + backpackTools[i].Parent = game.Lighting + end + wait(0.2) + for i = 1, #backpackTools do + wasInCharacter = backpackTools[i]:FindFirstChild "InCharTag" + if wasInChar then + wasInChar:Remove() + backpackTools[i].Parent = script.Parent + else + backpackTools[i].Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack + end + end + stun:Remove() end - stun:Remove() end - end - if delta ~= 0 then - newCo = coroutine.create(billboardHealthChange) - coroutine.resume(newCo, delta) + if delta ~= 0 then + newCo = coroutine.create(billboardHealthChange) + coroutine.resume(newCo, delta) + end + --delta = delta * .01 end - --delta = delta * .01 - end - --health = health + delta * s * Humanoid.MaxHealth - - health = Humanoid.Health + delta * s - if health * 1.01 < Humanoid.MaxHealth then - Humanoid.Health = health + --health = health + delta * s * Humanoid.MaxHealth + + health = Humanoid.Health + delta * s + if health * 1.01 < Humanoid.MaxHealth then + Humanoid.Health = health --myHealth.Value = math.floor(Humanoid.Health) - elseif delta > 0 then - Humanoid.Health = Humanoid.MaxHealth - --myHealth.Value = Humanoid.Health + elseif delta > 0 then + Humanoid.Health = Humanoid.MaxHealth + --myHealth.Value = Humanoid.Health + end end - end - end \ No newline at end of file +end diff --git a/39250920.lua b/39250920.lua index 5356cdf..405b283 100644 --- a/39250920.lua +++ b/39250920.lua @@ -10,7 +10,6 @@ function waitForChild(instance, name) end end - local mainFrame local choices = {} local lastChoice @@ -19,15 +18,14 @@ local currentConversationDialog local currentConversationPartner local currentAbortDialogScript -local tooFarAwayMessage = "You are too far away to chat!" +local tooFarAwayMessage = "You are too far away to chat!" local tooFarAwaySize = 300 local characterWanderedOffMessage = "Chat ended because you walked away" local characterWanderedOffSize = 350 -local conversationTimedOut = "Chat ended because you didn't reply" +local conversationTimedOut = "Chat ended because you didn't reply" local conversationTimedOutSize = 350 local player -local screenGui local chatNotificationGui local messageDialog local timeoutScript @@ -36,9 +34,9 @@ local dialogMap = {} local dialogConnections = {} local gui = nil -waitForChild(game,"CoreGui") -waitForChild(game.CoreGui,"RobloxGui") -if game.CoreGui.RobloxGui:FindFirstChild("ControlFrame") then +waitForChild(game, "CoreGui") +waitForChild(game.CoreGui, "RobloxGui") +if game.CoreGui.RobloxGui:FindFirstChild "ControlFrame" then gui = game.CoreGui.RobloxGui.ControlFrame else gui = game.CoreGui.RobloxGui @@ -51,38 +49,36 @@ function currentTone() return Enum.DialogTone.Neutral end end - function createChatNotificationGui() - chatNotificationGui = Instance.new("BillboardGui") + chatNotificationGui = Instance.new "BillboardGui" chatNotificationGui.Name = "ChatNotificationGui" - chatNotificationGui.ExtentsOffset = Vector3.new(0,1,0) + chatNotificationGui.ExtentsOffset = Vector3.new(0, 1, 0) chatNotificationGui.Size = UDim2.new(4, 0, 5.42857122, 0) - chatNotificationGui.SizeOffset = Vector2.new(0,0) + chatNotificationGui.SizeOffset = Vector2.new(0, 0) chatNotificationGui.StudsOffset = Vector3.new(0.4, 4.3, 0) chatNotificationGui.Enabled = true - chatNotificationGui.RobloxLocked = true + chatNotificationGui.RobloxLocked = true chatNotificationGui.Active = true - local image = Instance.new("ImageLabel") + local image = Instance.new "ImageLabel" image.Name = "Image" image.Active = false image.BackgroundTransparency = 1 - image.Position = UDim2.new(0,0,0,0) - image.Size = UDim2.new(1.0,0,1.0,0) + image.Position = UDim2.new(0, 0, 0, 0) + image.Size = UDim2.new(1, 0, 1, 0) image.Image = "" - image.RobloxLocked = true + image.RobloxLocked = true image.Parent = chatNotificationGui - - local button = Instance.new("ImageButton") + local button = Instance.new "ImageButton" button.Name = "Button" button.AutoButtonColor = false button.Position = UDim2.new(0.0879999995, 0, 0.0529999994, 0) button.Size = UDim2.new(0.829999983, 0, 0.460000008, 0) button.Image = "" button.BackgroundTransparency = 1 - button.RobloxLocked = true + button.RobloxLocked = true button.Parent = image end @@ -97,7 +93,7 @@ function getChatColor(tone) end function styleChoices(tone) - for i, obj in pairs(choices) do + for _, obj in pairs(choices) do resetColor(obj, tone) end resetColor(lastChoice, tone) @@ -114,7 +110,7 @@ function styleMainFrame(tone) mainFrame.Style = Enum.FrameStyle.ChatRed mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botRed_tailRight.png" end - + styleChoices(tone) end function setChatNotificationTone(gui, purpose, tone) @@ -135,26 +131,26 @@ function setChatNotificationTone(gui, purpose, tone) end function createMessageDialog() - messageDialog = Instance.new("Frame"); + messageDialog = Instance.new "Frame" messageDialog.Name = "DialogScriptMessage" messageDialog.Style = Enum.FrameStyle.RobloxRound messageDialog.Visible = false - local text = Instance.new("TextLabel") + local text = Instance.new "TextLabel" text.Name = "Text" - text.Position = UDim2.new(0,0,0,-1) - text.Size = UDim2.new(1,0,1,0) + text.Position = UDim2.new(0, 0, 0, -1) + text.Size = UDim2.new(1, 0, 1, 0) text.FontSize = Enum.FontSize.Size14 text.BackgroundTransparency = 1 - text.TextColor3 = Color3.new(1,1,1) - text.RobloxLocked = true + text.TextColor3 = Color3.new(1, 1, 1) + text.RobloxLocked = true text.Parent = messageDialog end function showMessage(msg, size) messageDialog.Text.Text = msg - messageDialog.Size = UDim2.new(0,size,0,40) - messageDialog.Position = UDim2.new(0.5, -size/2, 0.5, -40) + messageDialog.Size = UDim2.new(0, size, 0, 40) + messageDialog.Position = UDim2.new(0.5, -size / 2, 0.5, -40) messageDialog.Visible = true wait(2) messageDialog.Visible = false @@ -162,60 +158,60 @@ end function variableDelay(str) local length = math.min(string.len(str), 100) - wait(0.75 + ((length/75) * 1.5)) + wait(0.75 + ((length / 75) * 1.5)) end function resetColor(frame, tone) if tone == Enum.DialogTone.Neutral then - frame.BackgroundColor3 = Color3.new(0/255, 0/255, 179/255) - frame.Number.TextColor3 = Color3.new(45/255, 142/255, 245/255) + frame.BackgroundColor3 = Color3.new(0 / 255, 0 / 255, 179 / 255) + frame.Number.TextColor3 = Color3.new(45 / 255, 142 / 255, 245 / 255) elseif tone == Enum.DialogTone.Friendly then - frame.BackgroundColor3 = Color3.new(0/255, 77/255, 0/255) - frame.Number.TextColor3 = Color3.new(0/255, 190/255, 0/255) + frame.BackgroundColor3 = Color3.new(0 / 255, 77 / 255, 0 / 255) + frame.Number.TextColor3 = Color3.new(0 / 255, 190 / 255, 0 / 255) elseif tone == Enum.DialogTone.Enemy then - frame.BackgroundColor3 = Color3.new(140/255, 0/255, 0/255) - frame.Number.TextColor3 = Color3.new(255/255,88/255, 79/255) + frame.BackgroundColor3 = Color3.new(140 / 255, 0 / 255, 0 / 255) + frame.Number.TextColor3 = Color3.new(255 / 255, 88 / 255, 79 / 255) end end function highlightColor(frame, tone) if tone == Enum.DialogTone.Neutral then - frame.BackgroundColor3 = Color3.new(2/255, 108/255, 255/255) - frame.Number.TextColor3 = Color3.new(1, 1, 1) + frame.BackgroundColor3 = Color3.new(2 / 255, 108 / 255, 255 / 255) + frame.Number.TextColor3 = Color3.new(1, 1, 1) elseif tone == Enum.DialogTone.Friendly then - frame.BackgroundColor3 = Color3.new(0/255, 128/255, 0/255) - frame.Number.TextColor3 = Color3.new(1, 1, 1) + frame.BackgroundColor3 = Color3.new(0 / 255, 128 / 255, 0 / 255) + frame.Number.TextColor3 = Color3.new(1, 1, 1) elseif tone == Enum.DialogTone.Enemy then - frame.BackgroundColor3 = Color3.new(204/255, 0/255, 0/255) - frame.Number.TextColor3 = Color3.new(1, 1, 1) + frame.BackgroundColor3 = Color3.new(204 / 255, 0 / 255, 0 / 255) + frame.Number.TextColor3 = Color3.new(1, 1, 1) end end function wanderDialog() - print("Wander") + print "Wander" mainFrame.Visible = false endDialog() showMessage(characterWanderedOffMessage, characterWanderedOffSize) end function timeoutDialog() - print("Timeout") + print "Timeout" mainFrame.Visible = false endDialog() showMessage(conversationTimedOut, conversationTimedOutSize) end function normalEndDialog() - print("Done") + print "Done" endDialog() end function endDialog() - if currentAbortDialogScript then + if currentAbortDialogScript then currentAbortDialogScript:Remove() currentAbortDialogScript = nil end - local dialog = currentConversationDialog + local dialog = currentConversationDialog currentConversationDialog = nil if dialog and dialog.InUse then local reenableScript = reenableDialogScript:Clone() @@ -234,11 +230,11 @@ function endDialog() end function sanitizeMessage(msg) - if string.len(msg) == 0 then - return "..." - else - return msg - end + if string.len(msg) == 0 then + return "..." + else + return msg + end end function selectChoice(choice) @@ -248,109 +244,125 @@ function selectChoice(choice) mainFrame.Visible = false if choice == lastChoice then game.Chat:Chat(game.Players.LocalPlayer.Character, "Goodbye!", getChatColor(currentTone())) - + normalEndDialog() - else + else local dialogChoice = choiceMap[choice] - game.Chat:Chat(game.Players.LocalPlayer.Character, sanitizeMessage(dialogChoice.UserDialog), getChatColor(currentTone())) + game.Chat:Chat( + game.Players.LocalPlayer.Character, + sanitizeMessage(dialogChoice.UserDialog), + getChatColor(currentTone()) + ) wait(1) currentConversationDialog:SignalDialogChoiceSelected(player, dialogChoice) - game.Chat:Chat(currentConversationPartner, sanitizeMessage(dialogChoice.ResponseDialog), getChatColor(currentTone())) - + game.Chat:Chat( + currentConversationPartner, + sanitizeMessage(dialogChoice.ResponseDialog), + getChatColor(currentTone()) + ) + variableDelay(dialogChoice.ResponseDialog) presentDialogChoices(currentConversationPartner, dialogChoice:GetChildren()) - end + end end function newChoice(numberText) - local frame = Instance.new("TextButton") - frame.BackgroundColor3 = Color3.new(0/255, 0/255, 179/255) + local frame = Instance.new "TextButton" + frame.BackgroundColor3 = Color3.new(0 / 255, 0 / 255, 179 / 255) frame.AutoButtonColor = false frame.BorderSizePixel = 0 frame.Text = "" - frame.MouseEnter:connect(function() highlightColor(frame, currentTone()) end) - frame.MouseLeave:connect(function() resetColor(frame, currentTone()) end) - frame.MouseButton1Click:connect(function() selectChoice(frame) end) - frame.RobloxLocked = true + frame.MouseEnter:connect(function() + highlightColor(frame, currentTone()) + end) + frame.MouseLeave:connect(function() + resetColor(frame, currentTone()) + end) + frame.MouseButton1Click:connect(function() + selectChoice(frame) + end) + frame.RobloxLocked = true - local number = Instance.new("TextLabel") + local number = Instance.new "TextLabel" number.Name = "Number" - number.TextColor3 = Color3.new(127/255, 212/255, 255/255) + number.TextColor3 = Color3.new(127 / 255, 212 / 255, 255 / 255) number.Text = numberText number.FontSize = Enum.FontSize.Size14 number.BackgroundTransparency = 1 - number.Position = UDim2.new(0,4,0,2) - number.Size = UDim2.new(0,20,0,24) + number.Position = UDim2.new(0, 4, 0, 2) + number.Size = UDim2.new(0, 20, 0, 24) number.TextXAlignment = Enum.TextXAlignment.Left number.TextYAlignment = Enum.TextYAlignment.Top - number.RobloxLocked = true + number.RobloxLocked = true number.Parent = frame - local prompt = Instance.new("TextLabel") + local prompt = Instance.new "TextLabel" prompt.Name = "UserPrompt" prompt.BackgroundTransparency = 1 - prompt.TextColor3 = Color3.new(1,1,1) + prompt.TextColor3 = Color3.new(1, 1, 1) prompt.FontSize = Enum.FontSize.Size14 - prompt.Position = UDim2.new(0,28, 0, 2) - prompt.Size = UDim2.new(1,-32, 1, -4) + prompt.Position = UDim2.new(0, 28, 0, 2) + prompt.Size = UDim2.new(1, -32, 1, -4) prompt.TextXAlignment = Enum.TextXAlignment.Left prompt.TextYAlignment = Enum.TextYAlignment.Top prompt.TextWrap = true - prompt.RobloxLocked = true + prompt.RobloxLocked = true prompt.Parent = frame return frame end function initialize(parent) - choices[1] = newChoice("1)") - choices[2] = newChoice("2)") - choices[3] = newChoice("3)") - choices[4] = newChoice("4)") + choices[1] = newChoice "1)" + choices[2] = newChoice "2)" + choices[3] = newChoice "3)" + choices[4] = newChoice "4)" - lastChoice = newChoice("5)") + lastChoice = newChoice "5)" lastChoice.UserPrompt.Text = "Goodbye!" - lastChoice.Size = UDim2.new(1,0,0,28) + lastChoice.Size = UDim2.new(1, 0, 0, 28) - mainFrame = Instance.new("Frame") + mainFrame = Instance.new "Frame" mainFrame.Name = "UserDialogArea" mainFrame.Size = UDim2.new(0, 350, 0, 200) mainFrame.Style = Enum.FrameStyle.ChatBlue mainFrame.Visible = false - - imageLabel = Instance.new("ImageLabel") + + imageLabel = Instance.new "ImageLabel" imageLabel.Name = "Tail" - imageLabel.Size = UDim2.new(0,62,0,53) - imageLabel.Position = UDim2.new(1,8,0.25) + imageLabel.Size = UDim2.new(0, 62, 0, 53) + imageLabel.Position = UDim2.new(1, 8, 0.25) imageLabel.Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png" imageLabel.BackgroundTransparency = 1 - imageLabel.RobloxLocked = true + imageLabel.RobloxLocked = true imageLabel.Parent = mainFrame - + for n, obj in pairs(choices) do - obj.RobloxLocked = true + obj.RobloxLocked = true obj.Parent = mainFrame end - lastChoice.RobloxLocked = true + lastChoice.RobloxLocked = true lastChoice.Parent = mainFrame - mainFrame.RobloxLocked = true + mainFrame.RobloxLocked = true mainFrame.Parent = parent end function presentDialogChoices(talkingPart, dialogChoices) - if not currentConversationDialog then - return + if not currentConversationDialog then + return end currentConversationPartner = talkingPart sortedDialogChoices = {} for n, obj in pairs(dialogChoices) do - if obj:IsA("DialogChoice") then + if obj:IsA "DialogChoice" then table.insert(sortedDialogChoices, obj) end end - table.sort(sortedDialogChoices, function(a,b) return a.Name < b.Name end) + table.sort(sortedDialogChoices, function(a, b) + return a.Name < b.Name + end) if #sortedDialogChoices == 0 then normalEndDialog() @@ -358,7 +370,7 @@ function presentDialogChoices(talkingPart, dialogChoices) end local pos = 1 - local yPosition = 0 + local yPosition = 0 choiceMap = {} for n, obj in pairs(choices) do obj.Visible = false @@ -367,14 +379,14 @@ function presentDialogChoices(talkingPart, dialogChoices) for n, obj in pairs(sortedDialogChoices) do if pos <= #choices then --3 lines is the maximum, set it to that temporarily - choices[pos].Size = UDim2.new(1, 0, 0, 24*3) + choices[pos].Size = UDim2.new(1, 0, 0, 24 * 3) choices[pos].UserPrompt.Text = obj.UserDialog - local height = math.ceil(choices[pos].UserPrompt.TextBounds.Y/24)*24 + local height = math.ceil(choices[pos].UserPrompt.TextBounds.Y / 24) * 24 choices[pos].Position = UDim2.new(0, 0, 0, yPosition) choices[pos].Size = UDim2.new(1, 0, 0, height) choices[pos].Visible = true - + choiceMap[choices[pos]] = obj yPosition = yPosition + height @@ -382,11 +394,11 @@ function presentDialogChoices(talkingPart, dialogChoices) end end - lastChoice.Position = UDim2.new(0,0,0,yPosition) + lastChoice.Position = UDim2.new(0, 0, 0, yPosition) lastChoice.Number.Text = pos .. ")" - mainFrame.Size = UDim2.new(0, 350, 0, yPosition+24+32) - mainFrame.Position = UDim2.new(0,20,0.0, -mainFrame.Size.Y.Offset-20) + mainFrame.Size = UDim2.new(0, 350, 0, yPosition + 24 + 32) + mainFrame.Position = UDim2.new(0, 20, 0, -mainFrame.Size.Y.Offset - 20) styleMainFrame(currentTone()) mainFrame.Visible = true end @@ -398,7 +410,7 @@ function doDialog(dialog) if dialog.InUse then Instance.Unlock(dialog) - return + return else dialog.InUse = true Instance.Unlock(dialog) @@ -425,20 +437,26 @@ end function checkForLeaveArea() while currentConversationDialog do - if currentConversationDialog.Parent and (player:DistanceFromCharacter(currentConversationDialog.Parent.Position) >= currentConversationDialog.ConversationDistance) then + if + currentConversationDialog.Parent + and ( + player:DistanceFromCharacter(currentConversationDialog.Parent.Position) + >= currentConversationDialog.ConversationDistance + ) + then wanderDialog() end - wait(1) + wait(1) end end function startDialog(dialog) - if dialog.Parent and dialog.Parent:IsA("BasePart") then + if dialog.Parent and dialog.Parent:IsA "BasePart" then if player:DistanceFromCharacter(dialog.Parent.Position) >= dialog.ConversationDistance then showMessage(tooFarAwayMessage, tooFarAwaySize) return - end - + end + for dialog, gui in pairs(dialogMap) do if dialog and gui then gui.Enabled = false @@ -453,34 +471,36 @@ function startDialog(dialog) end function removeDialog(dialog) - if dialogMap[dialog] then - dialogMap[dialog]:Remove() - dialogMap[dialog] = nil - end + if dialogMap[dialog] then + dialogMap[dialog]:Remove() + dialogMap[dialog] = nil + end if dialogConnections[dialog] then dialogConnections[dialog]:disconnect() dialogConnections[dialog] = nil end -end +end function addDialog(dialog) if dialog.Parent then - if dialog.Parent:IsA("BasePart") then + if dialog.Parent:IsA "BasePart" then local chatGui = chatNotificationGui:clone() - chatGui.Enabled = not dialog.InUse + chatGui.Enabled = not dialog.InUse chatGui.Adornee = dialog.Parent chatGui.RobloxLocked = true chatGui.Parent = game.CoreGui - chatGui.Image.Button.MouseButton1Click:connect(function() startDialog(dialog) end) + chatGui.Image.Button.MouseButton1Click:connect(function() + startDialog(dialog) + end) setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone) - + dialogMap[dialog] = chatGui dialogConnections[dialog] = dialog.Changed:connect(function(prop) - if prop == "Parent" and dialog.Parent then + if prop == "Parent" and dialog.Parent then --This handles the reparenting case, seperate from removal case - removeDialog(dialog) - addDialog(dialog) + removeDialog(dialog) + addDialog(dialog) elseif prop == "InUse" then chatGui.Enabled = not currentConversationDialog and not dialog.InUse if dialog == currentConversationDialog then @@ -488,15 +508,15 @@ function addDialog(dialog) end elseif prop == "Tone" or prop == "Purpose" then setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone) - end + end end) else -- still need to listen to parent changes even if current parent is not a BasePart dialogConnections[dialog] = dialog.Changed:connect(function(prop) - if prop == "Parent" and dialog.Parent then + if prop == "Parent" and dialog.Parent then --This handles the reparenting case, seperate from removal case - removeDialog(dialog) - addDialog(dialog) - end + removeDialog(dialog) + addDialog(dialog) + end end) end end @@ -504,57 +524,65 @@ end function fetchScripts() local model = game:GetService("InsertService"):LoadAsset(39226062) - if type(model) == "string" then -- load failed, lets try again + if type(model) == "string" then -- load failed, lets try again wait(0.1) model = game:GetService("InsertService"):LoadAsset(39226062) end if type(model) == "string" then -- not going to work, lets bail return end - - waitForChild(model,"TimeoutScript") + + waitForChild(model, "TimeoutScript") timeoutScript = model.TimeoutScript - waitForChild(model,"ReenableDialogScript") + waitForChild(model, "ReenableDialogScript") reenableDialogScript = model.ReenableDialogScript end function onLoad() - waitForProperty(game.Players, "LocalPlayer") - player = game.Players.LocalPlayer - waitForProperty(player, "Character") + waitForProperty(game.Players, "LocalPlayer") + player = game.Players.LocalPlayer + waitForProperty(player, "Character") - --print("Fetching Scripts") - fetchScripts() + --print("Fetching Scripts") + fetchScripts() - --print("Creating Guis") - createChatNotificationGui() + --print("Creating Guis") + createChatNotificationGui() - --print("Creating MessageDialog") - createMessageDialog() - messageDialog.RobloxLocked = true - messageDialog.Parent = gui - - --print("Waiting for BottomLeftControl") - waitForChild(gui, "BottomLeftControl") - - --print("Initializing Frame") - local frame = Instance.new("Frame") - frame.Name = "DialogFrame" - frame.Position = UDim2.new(0,0,0,0) - frame.Size = UDim2.new(0,0,0,0) - frame.BackgroundTransparency = 1 - frame.RobloxLocked = true - frame.Parent = gui.BottomLeftControl - initialize(frame) + --print("Creating MessageDialog") + createMessageDialog() + messageDialog.RobloxLocked = true + messageDialog.Parent = gui - --print("Adding Dialogs") - game.CollectionService.ItemAdded:connect(function(obj) if obj:IsA("Dialog") then addDialog(obj) end end) - game.CollectionService.ItemRemoved:connect(function(obj) if obj:IsA("Dialog") then removeDialog(obj) end end) - for i, obj in pairs(game.CollectionService:GetCollection("Dialog")) do - if obj:IsA("Dialog") then - addDialog(obj) - end - end + --print("Waiting for BottomLeftControl") + waitForChild(gui, "BottomLeftControl") + + --print("Initializing Frame") + local frame = Instance.new "Frame" + frame.Name = "DialogFrame" + frame.Position = UDim2.new(0, 0, 0, 0) + frame.Size = UDim2.new(0, 0, 0, 0) + frame.BackgroundTransparency = 1 + frame.RobloxLocked = true + frame.Parent = gui.BottomLeftControl + initialize(frame) + + --print("Adding Dialogs") + game.CollectionService.ItemAdded:connect(function(obj) + if obj:IsA "Dialog" then + addDialog(obj) + end + end) + game.CollectionService.ItemRemoved:connect(function(obj) + if obj:IsA "Dialog" then + removeDialog(obj) + end + end) + for _, obj in pairs(game.CollectionService:GetCollection "Dialog") do + if obj:IsA "Dialog" then + addDialog(obj) + end + end end -onLoad() \ No newline at end of file +onLoad() diff --git a/45284430.lua b/45284430.lua index 36f0b0a..1ae8983 100644 --- a/45284430.lua +++ b/45284430.lua @@ -9,29 +9,33 @@ local function ScopedConnect(parentInstance, instance, event, signalFunc, syncFu --Entering the world, make sure we are connected/synced if not eventConnection then eventConnection = instance[event]:connect(signalFunc) - if syncFunc then syncFunc() end + if syncFunc then + syncFunc() + end end else --Probably leaving the world, so disconnect for now if eventConnection then eventConnection:disconnect() - if removeFunc then removeFunc() end + if removeFunc then + removeFunc() + end end end end --Hook it up to ancestryChanged signal local connection = parentInstance.AncestryChanged:connect(tryConnect) - + --Now connect us if we're already in the world tryConnect() - + return connection end local function getScreenGuiAncestor(instance) local localInstance = instance - while localInstance and not localInstance:IsA("ScreenGui") do + while localInstance and not localInstance:IsA "ScreenGui" do localInstance = localInstance.Parent end return localInstance @@ -40,8 +44,8 @@ end local function CreateButtons(frame, buttons, yPos, ySize) local buttonNum = 1 local buttonObjs = {} - for i, obj in ipairs(buttons) do - local button = Instance.new("TextButton") + for i, obj in ipairs(buttons) do + local button = Instance.new "TextButton" button.Name = "Button" .. buttonNum button.Font = Enum.Font.Arial button.FontSize = Enum.FontSize.Size18 @@ -53,72 +57,74 @@ local function CreateButtons(frame, buttons, yPos, ySize) button.Style = Enum.ButtonStyle.RobloxButton end button.Text = obj.Text - button.TextColor3 = Color3.new(1,1,1) + button.TextColor3 = Color3.new(1, 1, 1) button.MouseButton1Click:connect(obj.Function) button.Parent = frame buttonObjs[buttonNum] = button buttonNum = buttonNum + 1 end - local numButtons = buttonNum-1 + local numButtons = buttonNum - 1 if numButtons == 1 then frame.Button1.Position = UDim2.new(0.35, 0, yPos.Scale, yPos.Offset) - frame.Button1.Size = UDim2.new(.4,0,ySize.Scale, ySize.Offset) + frame.Button1.Size = UDim2.new(0.4, 0, ySize.Scale, ySize.Offset) elseif numButtons == 2 then frame.Button1.Position = UDim2.new(0.1, 0, yPos.Scale, yPos.Offset) - frame.Button1.Size = UDim2.new(.8/3,0, ySize.Scale, ySize.Offset) + frame.Button1.Size = UDim2.new(0.8 / 3, 0, ySize.Scale, ySize.Offset) frame.Button2.Position = UDim2.new(0.55, 0, yPos.Scale, yPos.Offset) - frame.Button2.Size = UDim2.new(.35,0, ySize.Scale, ySize.Offset) + frame.Button2.Size = UDim2.new(0.35, 0, ySize.Scale, ySize.Offset) elseif numButtons >= 3 then - local spacing = .1 / numButtons - local buttonSize = .9 / numButtons + local spacing = 0.1 / numButtons + local buttonSize = 0.9 / numButtons buttonNum = 1 while buttonNum <= numButtons do - buttonObjs[buttonNum].Position = UDim2.new(spacing*buttonNum + (buttonNum-1) * buttonSize, 0, yPos.Scale, yPos.Offset) + buttonObjs[buttonNum].Position = + UDim2.new(spacing * buttonNum + (buttonNum - 1) * buttonSize, 0, yPos.Scale, yPos.Offset) buttonObjs[buttonNum].Size = UDim2.new(buttonSize, 0, ySize.Scale, ySize.Offset) buttonNum = buttonNum + 1 end end end -local function setSliderPos(newAbsPosX,slider,sliderPosition,bar,steps) - +local function setSliderPos(newAbsPosX, slider, sliderPosition, bar, steps) local newStep = steps - 1 --otherwise we really get one more step than we want - local relativePosX = math.min(1, math.max(0, (newAbsPosX - bar.AbsolutePosition.X) / bar.AbsoluteSize.X )) + local relativePosX = math.min(1, math.max(0, (newAbsPosX - bar.AbsolutePosition.X) / bar.AbsoluteSize.X)) local wholeNum, remainder = math.modf(relativePosX * newStep) if remainder > 0.5 then wholeNum = wholeNum + 1 end - relativePosX = wholeNum/newStep + relativePosX = wholeNum / newStep local result = math.ceil(relativePosX * newStep) if sliderPosition.Value ~= (result + 1) then --only update if we moved a step sliderPosition.Value = result + 1 - slider.Position = UDim2.new(relativePosX,-slider.AbsoluteSize.X/2,slider.Position.Y.Scale,slider.Position.Y.Offset) + slider.Position = + UDim2.new(relativePosX, -slider.AbsoluteSize.X / 2, slider.Position.Y.Scale, slider.Position.Y.Offset) end - end local function cancelSlide(areaSoak) areaSoak.Visible = false - if areaSoakMouseMoveCon then areaSoakMouseMoveCon:disconnect() end + if areaSoakMouseMoveCon then + areaSoakMouseMoveCon:disconnect() + end end t.CreateStyledMessageDialog = function(title, message, style, buttons) - local frame = Instance.new("Frame") + local frame = Instance.new "Frame" frame.Size = UDim2.new(0.5, 0, 0, 165) frame.Position = UDim2.new(0.25, 0, 0.5, -72.5) frame.Name = "MessageDialog" frame.Active = true - frame.Style = Enum.FrameStyle.RobloxRound - - local styleImage = Instance.new("ImageLabel") + frame.Style = Enum.FrameStyle.RobloxRound + + local styleImage = Instance.new "ImageLabel" styleImage.Name = "StyleImage" styleImage.BackgroundTransparency = 1 - styleImage.Position = UDim2.new(0,5,0,15) + styleImage.Position = UDim2.new(0, 5, 0, 15) if style == "error" or style == "Error" then styleImage.Size = UDim2.new(0, 71, 0, 71) styleImage.Image = "http://www.roblox.com/asset?id=42565285" @@ -129,16 +135,16 @@ t.CreateStyledMessageDialog = function(title, message, style, buttons) styleImage.Size = UDim2.new(0, 74, 0, 76) styleImage.Image = "http://www.roblox.com/asset?id=42557901" else - return t.CreateMessageDialog(title,message,buttons) + return t.CreateMessageDialog(title, message, buttons) end styleImage.Parent = frame - - local titleLabel = Instance.new("TextLabel") + + local titleLabel = Instance.new "TextLabel" titleLabel.Name = "Title" titleLabel.Text = title titleLabel.TextStrokeTransparency = 0 titleLabel.BackgroundTransparency = 1 - titleLabel.TextColor3 = Color3.new(221/255,221/255,221/255) + titleLabel.TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255) titleLabel.Position = UDim2.new(0, 80, 0, 0) titleLabel.Size = UDim2.new(1, -80, 0, 40) titleLabel.Font = Enum.Font.ArialBold @@ -147,11 +153,11 @@ t.CreateStyledMessageDialog = function(title, message, style, buttons) titleLabel.TextYAlignment = Enum.TextYAlignment.Center titleLabel.Parent = frame - local messageLabel = Instance.new("TextLabel") + local messageLabel = Instance.new "TextLabel" messageLabel.Name = "Message" messageLabel.Text = message messageLabel.TextStrokeTransparency = 0 - messageLabel.TextColor3 = Color3.new(221/255,221/255,221/255) + messageLabel.TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255) messageLabel.Position = UDim2.new(0.025, 80, 0, 45) messageLabel.Size = UDim2.new(0.95, -80, 0, 55) messageLabel.BackgroundTransparency = 1 @@ -162,24 +168,24 @@ t.CreateStyledMessageDialog = function(title, message, style, buttons) messageLabel.TextYAlignment = Enum.TextYAlignment.Top messageLabel.Parent = frame - CreateButtons(frame, buttons, UDim.new(0, 105), UDim.new(0, 40) ) + CreateButtons(frame, buttons, UDim.new(0, 105), UDim.new(0, 40)) return frame end t.CreateMessageDialog = function(title, message, buttons) - local frame = Instance.new("Frame") + local frame = Instance.new "Frame" frame.Size = UDim2.new(0.5, 0, 0.5, 0) frame.Position = UDim2.new(0.25, 0, 0.25, 0) frame.Name = "MessageDialog" frame.Active = true frame.Style = Enum.FrameStyle.RobloxRound - local titleLabel = Instance.new("TextLabel") + local titleLabel = Instance.new "TextLabel" titleLabel.Name = "Title" titleLabel.Text = title titleLabel.BackgroundTransparency = 1 - titleLabel.TextColor3 = Color3.new(221/255,221/255,221/255) + titleLabel.TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255) titleLabel.Position = UDim2.new(0, 0, 0, 0) titleLabel.Size = UDim2.new(1, 0, 0.15, 0) titleLabel.Font = Enum.Font.ArialBold @@ -188,12 +194,12 @@ t.CreateMessageDialog = function(title, message, buttons) titleLabel.TextYAlignment = Enum.TextYAlignment.Center titleLabel.Parent = frame - local messageLabel = Instance.new("TextLabel") + local messageLabel = Instance.new "TextLabel" messageLabel.Name = "Message" messageLabel.Text = message - messageLabel.TextColor3 = Color3.new(221/255,221/255,221/255) + messageLabel.TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255) messageLabel.Position = UDim2.new(0.025, 0, 0.175, 0) - messageLabel.Size = UDim2.new(0.95, 0, .55, 0) + messageLabel.Size = UDim2.new(0.95, 0, 0.55, 0) messageLabel.BackgroundTransparency = 1 messageLabel.Font = Enum.Font.Arial messageLabel.FontSize = Enum.FontSize.Size18 @@ -202,7 +208,7 @@ t.CreateMessageDialog = function(title, message, buttons) messageLabel.TextYAlignment = Enum.TextYAlignment.Top messageLabel.Parent = frame - CreateButtons(frame, buttons, UDim.new(0.8,0), UDim.new(0.15, 0)) + CreateButtons(frame, buttons, UDim.new(0.8, 0), UDim.new(0.15, 0)) return frame end @@ -212,15 +218,15 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) local height = UDim.new(0, 32) local xPos = 0.055 - local frame = Instance.new("Frame") + local frame = Instance.new "Frame" frame.Name = "DropDownMenu" frame.BackgroundTransparency = 1 frame.Size = UDim2.new(width, height) - local dropDownMenu = Instance.new("TextButton") + local dropDownMenu = Instance.new "TextButton" dropDownMenu.Name = "DropDownMenuButton" dropDownMenu.TextWrap = true - dropDownMenu.TextColor3 = Color3.new(1,1,1) + dropDownMenu.TextColor3 = Color3.new(1, 1, 1) dropDownMenu.Text = "Choose One" dropDownMenu.Font = Enum.Font.ArialBold dropDownMenu.FontSize = Enum.FontSize.Size18 @@ -229,20 +235,20 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) dropDownMenu.BackgroundTransparency = 1 dropDownMenu.AutoButtonColor = true dropDownMenu.Style = Enum.ButtonStyle.RobloxButton - dropDownMenu.Size = UDim2.new(1,0,1,0) + dropDownMenu.Size = UDim2.new(1, 0, 1, 0) dropDownMenu.Parent = frame dropDownMenu.ZIndex = 2 - local dropDownIcon = Instance.new("ImageLabel") + local dropDownIcon = Instance.new "ImageLabel" dropDownIcon.Name = "Icon" dropDownIcon.Active = false dropDownIcon.Image = "http://www.roblox.com/asset/?id=45732894" dropDownIcon.BackgroundTransparency = 1 - dropDownIcon.Size = UDim2.new(0,11,0,6) - dropDownIcon.Position = UDim2.new(1,-11,0.5, -2) + dropDownIcon.Size = UDim2.new(0, 11, 0, 6) + dropDownIcon.Position = UDim2.new(1, -11, 0.5, -2) dropDownIcon.Parent = dropDownMenu dropDownIcon.ZIndex = 2 - + local itemCount = #items local dropDownItemCount = #items local useScrollButtons = false @@ -250,63 +256,63 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) useScrollButtons = true dropDownItemCount = 6 end - - local droppedDownMenu = Instance.new("TextButton") + + local droppedDownMenu = Instance.new "TextButton" droppedDownMenu.Name = "List" droppedDownMenu.Text = "" droppedDownMenu.BackgroundTransparency = 1 --droppedDownMenu.AutoButtonColor = true droppedDownMenu.Style = Enum.ButtonStyle.RobloxButton droppedDownMenu.Visible = false - droppedDownMenu.Active = true --Blocks clicks - droppedDownMenu.Position = UDim2.new(0,0,0,0) - droppedDownMenu.Size = UDim2.new(1,0, (1 + dropDownItemCount)*.8, 0) + droppedDownMenu.Active = true --Blocks clicks + droppedDownMenu.Position = UDim2.new(0, 0, 0, 0) + droppedDownMenu.Size = UDim2.new(1, 0, (1 + dropDownItemCount) * 0.8, 0) droppedDownMenu.Parent = frame droppedDownMenu.ZIndex = 2 - local choiceButton = Instance.new("TextButton") + local choiceButton = Instance.new "TextButton" choiceButton.Name = "ChoiceButton" choiceButton.BackgroundTransparency = 1 choiceButton.BorderSizePixel = 0 choiceButton.Text = "ReplaceMe" - choiceButton.TextColor3 = Color3.new(1,1,1) + choiceButton.TextColor3 = Color3.new(1, 1, 1) choiceButton.TextXAlignment = Enum.TextXAlignment.Left choiceButton.TextYAlignment = Enum.TextYAlignment.Center choiceButton.BackgroundColor3 = Color3.new(1, 1, 1) choiceButton.Font = Enum.Font.Arial choiceButton.FontSize = Enum.FontSize.Size18 if useScrollButtons then - choiceButton.Size = UDim2.new(1,-13, .8/((dropDownItemCount + 1)*.8),0) + choiceButton.Size = UDim2.new(1, -13, 0.8 / ((dropDownItemCount + 1) * 0.8), 0) else - choiceButton.Size = UDim2.new(1, 0, .8/((dropDownItemCount + 1)*.8),0) + choiceButton.Size = UDim2.new(1, 0, 0.8 / ((dropDownItemCount + 1) * 0.8), 0) end choiceButton.TextWrap = true choiceButton.ZIndex = 2 - local areaSoak = Instance.new("TextButton") + local areaSoak = Instance.new "TextButton" areaSoak.Name = "AreaSoak" areaSoak.Text = "" areaSoak.BackgroundTransparency = 1 areaSoak.Active = true - areaSoak.Size = UDim2.new(1,0,1,0) + areaSoak.Size = UDim2.new(1, 0, 1, 0) areaSoak.Visible = false areaSoak.ZIndex = 3 local dropDownSelected = false - local scrollUpButton + local scrollUpButton local scrollDownButton local scrollMouseCount = 0 local setZIndex = function(baseZIndex) - droppedDownMenu.ZIndex = baseZIndex +1 + droppedDownMenu.ZIndex = baseZIndex + 1 if scrollUpButton then scrollUpButton.ZIndex = baseZIndex + 3 end if scrollDownButton then scrollDownButton.ZIndex = baseZIndex + 3 end - + local children = droppedDownMenu:GetChildren() if children then for i, child in ipairs(children) do @@ -322,25 +328,28 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) local scrollBarPosition = 1 local updateScroll = function() if scrollUpButton then - scrollUpButton.Active = scrollBarPosition > 1 + scrollUpButton.Active = scrollBarPosition > 1 end if scrollDownButton then - scrollDownButton.Active = scrollBarPosition + dropDownItemCount <= itemCount + scrollDownButton.Active = scrollBarPosition + dropDownItemCount <= itemCount end local children = droppedDownMenu:GetChildren() - if not children then return end + if not children then + return + end - local childNum = 1 + local childNum = 1 for i, obj in ipairs(children) do if obj.Name == "ChoiceButton" then if childNum < scrollBarPosition or childNum >= scrollBarPosition + dropDownItemCount then obj.Visible = false else - obj.Position = UDim2.new(0,0,((childNum-scrollBarPosition+1)*.8)/((dropDownItemCount+1)*.8),0) + obj.Position = + UDim2.new(0, 0, ((childNum - scrollBarPosition + 1) * 0.8) / ((dropDownItemCount + 1) * 0.8), 0) obj.Visible = true end - obj.TextColor3 = Color3.new(1,1,1) + obj.TextColor3 = Color3.new(1, 1, 1) obj.BackgroundTransparency = 1 childNum = childNum + 1 @@ -373,7 +382,7 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) if obj.Name == "ChoiceButton" then if obj.Text == text then obj.Font = Enum.Font.ArialBold - foundItem = true + foundItem = true scrollBarPosition = childNum else obj.Font = Enum.Font.Arial @@ -397,7 +406,7 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) dropDownMenu.Text = text end end - + local function scrollDown() if scrollBarPosition + dropDownItemCount <= itemCount then scrollBarPosition = scrollBarPosition + 1 @@ -414,90 +423,84 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) end return false end - + if useScrollButtons then --Make some scroll buttons - scrollUpButton = Instance.new("ImageButton") + scrollUpButton = Instance.new "ImageButton" scrollUpButton.Name = "ScrollUpButton" scrollUpButton.BackgroundTransparency = 1 scrollUpButton.Image = "rbxasset://textures/ui/scrollbuttonUp.png" - scrollUpButton.Size = UDim2.new(0,17,0,17) - scrollUpButton.Position = UDim2.new(1,-11,(1*.8)/((dropDownItemCount+1)*.8),0) - scrollUpButton.MouseButton1Click:connect( - function() - scrollMouseCount = scrollMouseCount + 1 - end) - scrollUpButton.MouseLeave:connect( - function() - scrollMouseCount = scrollMouseCount + 1 - end) - scrollUpButton.MouseButton1Down:connect( - function() - scrollMouseCount = scrollMouseCount + 1 - - scrollUp() - local val = scrollMouseCount - wait(0.5) - while val == scrollMouseCount do - if scrollUp() == false then - break - end - wait(0.1) - end - end) + scrollUpButton.Size = UDim2.new(0, 17, 0, 17) + scrollUpButton.Position = UDim2.new(1, -11, (1 * 0.8) / ((dropDownItemCount + 1) * 0.8), 0) + scrollUpButton.MouseButton1Click:connect(function() + scrollMouseCount = scrollMouseCount + 1 + end) + scrollUpButton.MouseLeave:connect(function() + scrollMouseCount = scrollMouseCount + 1 + end) + scrollUpButton.MouseButton1Down:connect(function() + scrollMouseCount = scrollMouseCount + 1 + + scrollUp() + local val = scrollMouseCount + wait(0.5) + while val == scrollMouseCount do + if scrollUp() == false then + break + end + wait(0.1) + end + end) scrollUpButton.Parent = droppedDownMenu - scrollDownButton = Instance.new("ImageButton") + scrollDownButton = Instance.new "ImageButton" scrollDownButton.Name = "ScrollDownButton" scrollDownButton.BackgroundTransparency = 1 scrollDownButton.Image = "rbxasset://textures/ui/scrollbuttonDown.png" - scrollDownButton.Size = UDim2.new(0,17,0,17) - scrollDownButton.Position = UDim2.new(1,-11,1,-11) + scrollDownButton.Size = UDim2.new(0, 17, 0, 17) + scrollDownButton.Position = UDim2.new(1, -11, 1, -11) scrollDownButton.Parent = droppedDownMenu - scrollDownButton.MouseButton1Click:connect( - function() - scrollMouseCount = scrollMouseCount + 1 - end) - scrollDownButton.MouseLeave:connect( - function() - scrollMouseCount = scrollMouseCount + 1 - end) - scrollDownButton.MouseButton1Down:connect( - function() - scrollMouseCount = scrollMouseCount + 1 + scrollDownButton.MouseButton1Click:connect(function() + scrollMouseCount = scrollMouseCount + 1 + end) + scrollDownButton.MouseLeave:connect(function() + scrollMouseCount = scrollMouseCount + 1 + end) + scrollDownButton.MouseButton1Down:connect(function() + scrollMouseCount = scrollMouseCount + 1 - scrollDown() - local val = scrollMouseCount - wait(0.5) - while val == scrollMouseCount do - if scrollDown() == false then - break - end - wait(0.1) - end - end) + scrollDown() + local val = scrollMouseCount + wait(0.5) + while val == scrollMouseCount do + if scrollDown() == false then + break + end + wait(0.1) + end + end) - local scrollbar = Instance.new("ImageLabel") + local scrollbar = Instance.new "ImageLabel" scrollbar.Name = "ScrollBar" scrollbar.Image = "rbxasset://textures/ui/scrollbar.png" scrollbar.BackgroundTransparency = 1 - scrollbar.Size = UDim2.new(0, 18, (dropDownItemCount*.8)/((dropDownItemCount+1)*.8), -(17) - 11 - 4) - scrollbar.Position = UDim2.new(1,-11,(1*.8)/((dropDownItemCount+1)*.8),17+2) + scrollbar.Size = UDim2.new(0, 18, (dropDownItemCount * 0.8) / ((dropDownItemCount + 1) * 0.8), -17 - 11 - 4) + scrollbar.Position = UDim2.new(1, -11, (1 * 0.8) / ((dropDownItemCount + 1) * 0.8), 17 + 2) scrollbar.Parent = droppedDownMenu end - for i,item in ipairs(items) do + for i, item in ipairs(items) do -- needed to maintain local scope for items in event listeners below local button = choiceButton:clone() if forRoblox then button.RobloxLocked = true - end + end button.Text = item button.Parent = droppedDownMenu button.MouseButton1Click:connect(function() --Remove Highlight - button.TextColor3 = Color3.new(1,1,1) + button.TextColor3 = Color3.new(1, 1, 1) button.BackgroundTransparency = 1 updateSelection(item) @@ -506,22 +509,22 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) toggleVisibility() end) button.MouseEnter:connect(function() - --Add Highlight - button.TextColor3 = Color3.new(0,0,0) + --Add Highlight + button.TextColor3 = Color3.new(0, 0, 0) button.BackgroundTransparency = 0 end) button.MouseLeave:connect(function() --Remove Highlight - button.TextColor3 = Color3.new(1,1,1) + button.TextColor3 = Color3.new(1, 1, 1) button.BackgroundTransparency = 1 end) end - --This does the initial layout of the buttons + --This does the initial layout of the buttons updateScroll() - - frame.AncestryChanged:connect(function(child,parent) + + frame.AncestryChanged:connect(function(child, parent) if parent == nil then areaSoak.Parent = nil else @@ -535,35 +538,34 @@ t.CreateDropDownMenu = function(items, onSelect, forRoblox) end t.CreatePropertyDropDownMenu = function(instance, property, enum) - local items = enum:GetEnumItems() local names = {} local nameToItem = {} - for i,obj in ipairs(items) do + for i, obj in ipairs(items) do names[i] = obj.Name nameToItem[obj.Name] = obj end local frame local updateSelection - frame, updateSelection = t.CreateDropDownMenu(names, function(text) instance[property] = nameToItem[text] end) + frame, updateSelection = t.CreateDropDownMenu(names, function(text) + instance[property] = nameToItem[text] + end) - ScopedConnect(frame, instance, "Changed", - function(prop) - if prop == property then - updateSelection(instance[property].Name) - end - end, - function() + ScopedConnect(frame, instance, "Changed", function(prop) + if prop == property then updateSelection(instance[property].Name) - end) + end + end, function() + updateSelection(instance[property].Name) + end) return frame end t.GetFontHeight = function(font, fontSize) if font == nil or fontSize == nil then - error("Font and FontSize must be non-nil") + error "Font and FontSize must be non-nil" end if font == Enum.Font.Legacy then @@ -588,7 +590,7 @@ t.GetFontHeight = function(font, fontSize) elseif fontSize == Enum.FontSize.Size48 then return 72 else - error("Unknown FontSize") + error "Unknown FontSize" end elseif font == Enum.Font.Arial or font == Enum.Font.ArialBold then if fontSize == Enum.FontSize.Size8 then @@ -612,7 +614,7 @@ t.GetFontHeight = function(font, fontSize) elseif fontSize == Enum.FontSize.Size48 then return 48 else - error("Unknown FontSize") + error "Unknown FontSize" end else error("Unknown Font " .. font) @@ -623,28 +625,39 @@ local function layoutGuiObjectsHelper(frame, guiObjects, settingsTable) local totalPixels = frame.AbsoluteSize.Y local pixelsRemaining = frame.AbsoluteSize.Y for i, child in ipairs(guiObjects) do - if child:IsA("TextLabel") or child:IsA("TextButton") then - local isLabel = child:IsA("TextLabel") + if child:IsA "TextLabel" or child:IsA "TextButton" then + local isLabel = child:IsA "TextLabel" if isLabel then pixelsRemaining = pixelsRemaining - settingsTable["TextLabelPositionPadY"] else pixelsRemaining = pixelsRemaining - settingsTable["TextButtonPositionPadY"] end - child.Position = UDim2.new(child.Position.X.Scale, child.Position.X.Offset, 0, totalPixels - pixelsRemaining) + child.Position = + UDim2.new(child.Position.X.Scale, child.Position.X.Offset, 0, totalPixels - pixelsRemaining) child.Size = UDim2.new(child.Size.X.Scale, child.Size.X.Offset, 0, pixelsRemaining) if child.TextFits and child.TextBounds.Y < pixelsRemaining then child.Visible = true if isLabel then - child.Size = UDim2.new(child.Size.X.Scale, child.Size.X.Offset, 0, 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.Size = UDim2.new( + child.Size.X.Scale, + child.Size.X.Offset, + 0, + child.TextBounds.Y + settingsTable["TextLabelSizePadY"] + ) + else + child.Size = UDim2.new( + child.Size.X.Scale, + child.Size.X.Offset, + 0, + child.TextBounds.Y + settingsTable["TextButtonSizePadY"] + ) end while not child.TextFits do child.Size = UDim2.new(child.Size.X.Scale, child.Size.X.Offset, 0, child.AbsoluteSize.Y + 1) end - pixelsRemaining = pixelsRemaining - child.AbsoluteSize.Y + pixelsRemaining = pixelsRemaining - child.AbsoluteSize.Y if isLabel then pixelsRemaining = pixelsRemaining - settingsTable["TextLabelPositionPadY"] @@ -654,11 +667,11 @@ local function layoutGuiObjectsHelper(frame, guiObjects, settingsTable) else child.Visible = false pixelsRemaining = -1 - end - + end else --GuiObject - child.Position = UDim2.new(child.Position.X.Scale, child.Position.X.Offset, 0, totalPixels - pixelsRemaining) + child.Position = + UDim2.new(child.Position.X.Scale, child.Position.X.Offset, 0, totalPixels - pixelsRemaining) pixelsRemaining = pixelsRemaining - child.AbsoluteSize.Y child.Visible = (pixelsRemaining >= 0) end @@ -666,12 +679,12 @@ local function layoutGuiObjectsHelper(frame, guiObjects, settingsTable) end t.LayoutGuiObjects = function(frame, guiObjects, settingsTable) - if not frame:IsA("GuiObject") then - error("Frame must be a GuiObject") + if not frame:IsA "GuiObject" then + error "Frame must be a GuiObject" end for i, child in ipairs(guiObjects) do - if not child:IsA("GuiObject") then - error("All elements that are layed out must be of type GuiObject") + if not child:IsA "GuiObject" then + error "All elements that are layed out must be of type GuiObject" end end @@ -693,10 +706,10 @@ t.LayoutGuiObjects = function(frame, guiObjects, settingsTable) end --Wrapper frame takes care of styled objects - local wrapperFrame = Instance.new("Frame") + local wrapperFrame = Instance.new "Frame" wrapperFrame.Name = "WrapperFrame" wrapperFrame.BackgroundTransparency = 1 - wrapperFrame.Size = UDim2.new(1,0,1,0) + wrapperFrame.Size = UDim2.new(1, 0, 1, 0) wrapperFrame.Parent = frame for i, child in ipairs(guiObjects) do @@ -707,84 +720,89 @@ t.LayoutGuiObjects = function(frame, guiObjects, settingsTable) wait() layoutGuiObjectsHelper(wrapperFrame, guiObjects, settingsTable) end - - frame.Changed:connect( - function(prop) - if prop == "AbsoluteSize" then - --Wait a heartbeat for it to sync in - recalculate(nil) - end - end) + + frame.Changed:connect(function(prop) + if prop == "AbsoluteSize" then + --Wait a heartbeat for it to sync in + recalculate(nil) + end + end) frame.AncestryChanged:connect(recalculate) layoutGuiObjectsHelper(wrapperFrame, guiObjects, settingsTable) end - -t.CreateSlider = function(steps,width,position) - local sliderGui = Instance.new("Frame") - sliderGui.Size = UDim2.new(1,0,1,0) +t.CreateSlider = function(steps, width, position) + local sliderGui = Instance.new "Frame" + sliderGui.Size = UDim2.new(1, 0, 1, 0) sliderGui.BackgroundTransparency = 1 sliderGui.Name = "SliderGui" - - local sliderSteps = Instance.new("IntValue") + + local sliderSteps = Instance.new "IntValue" sliderSteps.Name = "SliderSteps" sliderSteps.Value = steps sliderSteps.Parent = sliderGui - - local areaSoak = Instance.new("TextButton") + + local areaSoak = Instance.new "TextButton" areaSoak.Name = "AreaSoak" areaSoak.Text = "" areaSoak.BackgroundTransparency = 1 areaSoak.Active = false - areaSoak.Size = UDim2.new(1,0,1,0) + areaSoak.Size = UDim2.new(1, 0, 1, 0) areaSoak.Visible = false areaSoak.ZIndex = 4 - - sliderGui.AncestryChanged:connect(function(child,parent) + + sliderGui.AncestryChanged:connect(function(child, parent) if parent == nil then areaSoak.Parent = nil else areaSoak.Parent = getScreenGuiAncestor(sliderGui) end end) - - local sliderPosition = Instance.new("IntValue") + + local sliderPosition = Instance.new "IntValue" sliderPosition.Name = "SliderPosition" sliderPosition.Value = 0 sliderPosition.Parent = sliderGui - - local id = math.random(1,100) - - local bar = Instance.new("TextButton") + + local id = math.random(1, 100) + + local bar = Instance.new "TextButton" bar.Text = "" bar.AutoButtonColor = false bar.Name = "Bar" - bar.BackgroundColor3 = Color3.new(0,0,0) + bar.BackgroundColor3 = Color3.new(0, 0, 0) if type(width) == "number" then - bar.Size = UDim2.new(0,width,0,5) + bar.Size = UDim2.new(0, width, 0, 5) else - bar.Size = UDim2.new(0,200,0,5) + bar.Size = UDim2.new(0, 200, 0, 5) end - bar.BorderColor3 = Color3.new(95/255,95/255,95/255) + bar.BorderColor3 = Color3.new(95 / 255, 95 / 255, 95 / 255) bar.ZIndex = 2 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"] then + + if + 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 - - local slider = Instance.new("ImageButton") + + local slider = Instance.new "ImageButton" slider.Name = "Slider" slider.BackgroundTransparency = 1 slider.Image = "rbxasset://textures/ui/Slider.png" - slider.Position = UDim2.new(0,0,0.5,-10) - slider.Size = UDim2.new(0,20,0,20) + slider.Position = UDim2.new(0, 0, 0.5, -10) + slider.Size = UDim2.new(0, 20, 0, 20) slider.ZIndex = 3 slider.Parent = bar - + local areaSoakMouseMoveCon = nil - + areaSoak.MouseLeave:connect(function() if areaSoak.Visible then cancelSlide(areaSoak) @@ -795,35 +813,39 @@ t.CreateSlider = function(steps,width,position) cancelSlide(areaSoak) end end) - + slider.MouseButton1Down:connect(function() areaSoak.Visible = true - if areaSoakMouseMoveCon then areaSoakMouseMoveCon:disconnect() end - areaSoakMouseMoveCon = areaSoak.MouseMoved:connect(function(x,y) - setSliderPos(x,slider,sliderPosition,bar,steps) + if areaSoakMouseMoveCon then + areaSoakMouseMoveCon:disconnect() + end + areaSoakMouseMoveCon = areaSoak.MouseMoved:connect(function(x, y) + setSliderPos(x, slider, sliderPosition, bar, steps) end) end) - - slider.MouseButton1Up:connect(function() cancelSlide(areaSoak) end) - - sliderPosition.Changed:connect(function(prop) - sliderPosition.Value = math.min(steps, math.max(1,sliderPosition.Value)) - local relativePosX = (sliderPosition.Value - 1) / (steps - 1) - slider.Position = UDim2.new(relativePosX,-slider.AbsoluteSize.X/2,slider.Position.Y.Scale,slider.Position.Y.Offset) - end) - - bar.MouseButton1Down:connect(function(x,y) - setSliderPos(x,slider,sliderPosition,bar,steps) - end) - - return sliderGui, sliderPosition, sliderSteps + slider.MouseButton1Up:connect(function() + cancelSlide(areaSoak) + end) + + sliderPosition.Changed:connect(function(prop) + sliderPosition.Value = math.min(steps, math.max(1, sliderPosition.Value)) + local relativePosX = (sliderPosition.Value - 1) / (steps - 1) + slider.Position = + UDim2.new(relativePosX, -slider.AbsoluteSize.X / 2, slider.Position.Y.Scale, slider.Position.Y.Offset) + end) + + bar.MouseButton1Down:connect(function(x, y) + setSliderPos(x, slider, sliderPosition, bar, steps) + end) + + return sliderGui, sliderPosition, sliderSteps end t.CreateTrueScrollingFrame = function() local lowY = nil local highY = nil - + local dragCon = nil local upCon = nil @@ -831,47 +853,47 @@ t.CreateTrueScrollingFrame = function() local descendantsChangeConMap = {} - local scrollingFrame = Instance.new("Frame") + local scrollingFrame = Instance.new "Frame" scrollingFrame.Name = "ScrollingFrame" scrollingFrame.Active = true - scrollingFrame.Size = UDim2.new(1,0,1,0) + scrollingFrame.Size = UDim2.new(1, 0, 1, 0) scrollingFrame.ClipsDescendants = true - local controlFrame = Instance.new("Frame") + local controlFrame = Instance.new "Frame" controlFrame.Name = "ControlFrame" controlFrame.BackgroundTransparency = 1 - controlFrame.Size = UDim2.new(0,18,1,0) - controlFrame.Position = UDim2.new(1,-20,0,0) + controlFrame.Size = UDim2.new(0, 18, 1, 0) + controlFrame.Position = UDim2.new(1, -20, 0, 0) controlFrame.Parent = scrollingFrame - - local scrollBottom = Instance.new("BoolValue") + + local scrollBottom = Instance.new "BoolValue" scrollBottom.Value = false scrollBottom.Name = "ScrollBottom" scrollBottom.Parent = controlFrame - - local scrollUp = Instance.new("BoolValue") + + local scrollUp = Instance.new "BoolValue" scrollUp.Value = false scrollUp.Name = "scrollUp" scrollUp.Parent = controlFrame - local scrollUpButton = Instance.new("TextButton") + local scrollUpButton = Instance.new "TextButton" scrollUpButton.Name = "ScrollUpButton" scrollUpButton.Text = "" scrollUpButton.AutoButtonColor = false - scrollUpButton.BackgroundColor3 = Color3.new(0,0,0) - scrollUpButton.BorderColor3 = Color3.new(1,1,1) + scrollUpButton.BackgroundColor3 = Color3.new(0, 0, 0) + scrollUpButton.BorderColor3 = Color3.new(1, 1, 1) scrollUpButton.BackgroundTransparency = 0.5 - scrollUpButton.Size = UDim2.new(0,18,0,18) + scrollUpButton.Size = UDim2.new(0, 18, 0, 18) scrollUpButton.ZIndex = 2 scrollUpButton.Parent = controlFrame for i = 1, 6 do - local triFrame = Instance.new("Frame") - triFrame.BorderColor3 = Color3.new(1,1,1) + local triFrame = Instance.new "Frame" + triFrame.BorderColor3 = Color3.new(1, 1, 1) triFrame.Name = "tri" .. tostring(i) triFrame.ZIndex = 3 triFrame.BackgroundTransparency = 0.5 - triFrame.Size = UDim2.new(0,12 - ((i -1) * 2),0,0) - triFrame.Position = UDim2.new(0,3 + (i -1),0.5,2 - (i -1)) + triFrame.Size = UDim2.new(0, 12 - ((i - 1) * 2), 0, 0) + triFrame.Position = UDim2.new(0, 3 + (i - 1), 0.5, 2 - (i - 1)) triFrame.Parent = scrollUpButton end scrollUpButton.MouseEnter:connect(function() @@ -891,10 +913,10 @@ t.CreateTrueScrollingFrame = function() local scrollDownButton = scrollUpButton:clone() scrollDownButton.Name = "ScrollDownButton" - scrollDownButton.Position = UDim2.new(0,0,1,-18) + scrollDownButton.Position = UDim2.new(0, 0, 1, -18) local downChildren = scrollDownButton:GetChildren() for i = 1, #downChildren do - downChildren[i].Position = UDim2.new(0,3 + (i -1),0.5,-2 + (i - 1)) + downChildren[i].Position = UDim2.new(0, 3 + (i - 1), 0.5, -2 + (i - 1)) end scrollDownButton.MouseEnter:connect(function() scrollDownButton.BackgroundTransparency = 0.1 @@ -911,17 +933,17 @@ t.CreateTrueScrollingFrame = function() end end) scrollDownButton.Parent = controlFrame - - local scrollTrack = Instance.new("Frame") + + local scrollTrack = Instance.new "Frame" scrollTrack.Name = "ScrollTrack" scrollTrack.BackgroundTransparency = 1 - scrollTrack.Size = UDim2.new(0,18,1,-38) - scrollTrack.Position = UDim2.new(0,0,0,19) + scrollTrack.Size = UDim2.new(0, 18, 1, -38) + scrollTrack.Position = UDim2.new(0, 0, 0, 19) scrollTrack.Parent = controlFrame - local scrollbar = Instance.new("TextButton") - scrollbar.BackgroundColor3 = Color3.new(0,0,0) - scrollbar.BorderColor3 = Color3.new(1,1,1) + local scrollbar = Instance.new "TextButton" + scrollbar.BackgroundColor3 = Color3.new(0, 0, 0) + scrollbar.BorderColor3 = Color3.new(1, 1, 1) scrollbar.BackgroundTransparency = 0.5 scrollbar.AutoButtonColor = false scrollbar.Text = "" @@ -930,24 +952,24 @@ t.CreateTrueScrollingFrame = function() scrollbar.ZIndex = 2 scrollbar.BackgroundTransparency = 0.5 scrollbar.Size = UDim2.new(0, 18, 0.1, 0) - scrollbar.Position = UDim2.new(0,0,0,0) + scrollbar.Position = UDim2.new(0, 0, 0, 0) scrollbar.Parent = scrollTrack - local scrollNub = Instance.new("Frame") + local scrollNub = Instance.new "Frame" scrollNub.Name = "ScrollNub" - scrollNub.BorderColor3 = Color3.new(1,1,1) - scrollNub.Size = UDim2.new(0,10,0,0) - scrollNub.Position = UDim2.new(0.5,-5,0.5,0) + scrollNub.BorderColor3 = Color3.new(1, 1, 1) + scrollNub.Size = UDim2.new(0, 10, 0, 0) + scrollNub.Position = UDim2.new(0.5, -5, 0.5, 0) scrollNub.ZIndex = 2 scrollNub.BackgroundTransparency = 0.5 scrollNub.Parent = scrollbar local newNub = scrollNub:clone() - newNub.Position = UDim2.new(0.5,-5,0.5,-2) + newNub.Position = UDim2.new(0.5, -5, 0.5, -2) newNub.Parent = scrollbar - + local lastNub = scrollNub:clone() - lastNub.Position = UDim2.new(0.5,-5,0.5,2) + lastNub.Position = UDim2.new(0.5, -5, 0.5, 2) lastNub.Parent = scrollbar scrollbar.MouseEnter:connect(function() @@ -963,7 +985,7 @@ t.CreateTrueScrollingFrame = function() lastNub.BackgroundTransparency = 0.5 end) - local mouseDrag = Instance.new("ImageButton") + local mouseDrag = Instance.new "ImageButton" mouseDrag.Active = false mouseDrag.Size = UDim2.new(1.5, 0, 1.5, 0) mouseDrag.AutoButtonColor = false @@ -971,22 +993,22 @@ t.CreateTrueScrollingFrame = function() mouseDrag.Name = "mouseDrag" mouseDrag.Position = UDim2.new(-0.25, 0, -0.25, 0) mouseDrag.ZIndex = 10 - - local function positionScrollBar(x,y,offset) + + local function positionScrollBar(x, y, offset) local oldPos = scrollbar.Position if y < scrollTrack.AbsolutePosition.y then - scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale,scrollbar.Position.X.Offset,0,0) + scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, 0, 0) return (oldPos ~= scrollbar.Position) end - - local relativeSize = scrollbar.AbsoluteSize.Y/scrollTrack.AbsoluteSize.Y + + local relativeSize = scrollbar.AbsoluteSize.Y / scrollTrack.AbsoluteSize.Y if y > (scrollTrack.AbsolutePosition.y + scrollTrack.AbsoluteSize.y) then - scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale,scrollbar.Position.X.Offset,1 - relativeSize,0) + scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, 1 - relativeSize, 0) return (oldPos ~= scrollbar.Position) end - local newScaleYPos = (y - scrollTrack.AbsolutePosition.y - offset)/scrollTrack.AbsoluteSize.y + local newScaleYPos = (y - scrollTrack.AbsolutePosition.y - offset) / scrollTrack.AbsoluteSize.y if newScaleYPos + relativeSize > 1 then newScaleYPos = 1 - relativeSize scrollBottom.Value = true @@ -999,16 +1021,24 @@ t.CreateTrueScrollingFrame = function() scrollUp.Value = false scrollBottom.Value = false end - scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale,scrollbar.Position.X.Offset,newScaleYPos,0) - + scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, newScaleYPos, 0) + return (oldPos ~= scrollbar.Position) end local function drillDownSetHighLow(instance) - if not instance or not instance:IsA("GuiObject") then return end - if instance == controlFrame then return end - if instance:IsDescendantOf(controlFrame) then return end - if not instance.Visible then return end + if not instance or not instance:IsA "GuiObject" then + return + end + if instance == controlFrame then + return + end + if instance:IsDescendantOf(controlFrame) then + return + end + if not instance.Visible then + return + end if lowY and lowY > instance.AbsolutePosition.Y then lowY = instance.AbsolutePosition.Y @@ -1040,20 +1070,27 @@ t.CreateTrueScrollingFrame = function() local percentFrame = 0 if scrollbar.Position.Y.Scale > 0 then if scrollbar.Visible then - percentFrame = scrollbar.Position.Y.Scale/((scrollTrack.AbsoluteSize.Y - scrollbar.AbsoluteSize.Y)/scrollTrack.AbsoluteSize.Y) + percentFrame = scrollbar.Position.Y.Scale + / ((scrollTrack.AbsoluteSize.Y - scrollbar.AbsoluteSize.Y) / scrollTrack.AbsoluteSize.Y) else percentFrame = 0 end end - if percentFrame > 0.99 then percentFrame = 1 end + if percentFrame > 0.99 then + percentFrame = 1 + end local hiddenYAmount = (scrollingFrame.AbsoluteSize.Y - (highY - lowY)) * percentFrame - + local guiChildren = scrollingFrame:GetChildren() for i = 1, #guiChildren do if guiChildren[i] ~= controlFrame then - guiChildren[i].Position = UDim2.new(guiChildren[i].Position.X.Scale,guiChildren[i].Position.X.Offset, - 0, math.ceil(guiChildren[i].AbsolutePosition.Y) - math.ceil(lowY) + hiddenYAmount) + guiChildren[i].Position = UDim2.new( + guiChildren[i].Position.X.Scale, + guiChildren[i].Position.X.Offset, + 0, + math.ceil(guiChildren[i].AbsolutePosition.Y) - math.ceil(lowY) + hiddenYAmount + ) end end @@ -1064,7 +1101,9 @@ t.CreateTrueScrollingFrame = function() end local function setSliderSizeAndPosition() - if not highY or not lowY then return end + if not highY or not lowY then + return + end local totalYSpan = math.abs(highY - lowY) if totalYSpan == 0 then @@ -1072,12 +1111,18 @@ t.CreateTrueScrollingFrame = function() scrollDownButton.Visible = false scrollUpButton.Visible = false - if dragCon then dragCon:disconnect() dragCon = nil end - if upCon then upCon:disconnect() upCon = nil end + if dragCon then + dragCon:disconnect() + dragCon = nil + end + if upCon then + upCon:disconnect() + upCon = nil + end return end - local percentShown = scrollingFrame.AbsoluteSize.Y/totalYSpan + local percentShown = scrollingFrame.AbsoluteSize.Y / totalYSpan if percentShown >= 1 then scrollbar.Visible = false scrollDownButton.Visible = false @@ -1088,42 +1133,54 @@ t.CreateTrueScrollingFrame = function() scrollDownButton.Visible = true scrollUpButton.Visible = true - scrollbar.Size = UDim2.new(scrollbar.Size.X.Scale,scrollbar.Size.X.Offset,percentShown,0) + scrollbar.Size = UDim2.new(scrollbar.Size.X.Scale, scrollbar.Size.X.Offset, percentShown, 0) end - local percentPosition = (scrollingFrame.AbsolutePosition.Y - lowY)/totalYSpan - scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale,scrollbar.Position.X.Offset,percentPosition,-scrollbar.AbsoluteSize.X/2) + local percentPosition = (scrollingFrame.AbsolutePosition.Y - lowY) / totalYSpan + scrollbar.Position = UDim2.new( + scrollbar.Position.X.Scale, + scrollbar.Position.X.Offset, + percentPosition, + -scrollbar.AbsoluteSize.X / 2 + ) if scrollbar.AbsolutePosition.y < scrollTrack.AbsolutePosition.y then - scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale,scrollbar.Position.X.Offset,0,0) + scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, 0, 0) end - if (scrollbar.AbsolutePosition.y + scrollbar.AbsoluteSize.Y) > (scrollTrack.AbsolutePosition.y + scrollTrack.AbsoluteSize.y) then - local relativeSize = scrollbar.AbsoluteSize.Y/scrollTrack.AbsoluteSize.Y - scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale,scrollbar.Position.X.Offset,1 - relativeSize,0) + if + (scrollbar.AbsolutePosition.y + scrollbar.AbsoluteSize.Y) + > (scrollTrack.AbsolutePosition.y + scrollTrack.AbsoluteSize.y) + then + local relativeSize = scrollbar.AbsoluteSize.Y / scrollTrack.AbsoluteSize.Y + scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, 1 - relativeSize, 0) end end - + local buttonScrollAmountPixels = 7 local reentrancyGuardScrollUp = false local function doScrollUp() - if reentrancyGuardScrollUp then return end - + if reentrancyGuardScrollUp then + return + end + reentrancyGuardScrollUp = true - if positionScrollBar(0,scrollbar.AbsolutePosition.Y - buttonScrollAmountPixels,0) then - recalculate() - end + if positionScrollBar(0, scrollbar.AbsolutePosition.Y - buttonScrollAmountPixels, 0) then + recalculate() + end reentrancyGuardScrollUp = false end - + local reentrancyGuardScrollDown = false local function doScrollDown() - if reentrancyGuardScrollDown then return end - + if reentrancyGuardScrollDown then + return + end + reentrancyGuardScrollDown = true - if positionScrollBar(0,scrollbar.AbsolutePosition.Y + buttonScrollAmountPixels,0) then - recalculate() - end + if positionScrollBar(0, scrollbar.AbsolutePosition.Y + buttonScrollAmountPixels, 0) then + recalculate() + end reentrancyGuardScrollDown = false end @@ -1147,10 +1204,12 @@ t.CreateTrueScrollingFrame = function() if mouseYPos and mouseYPos > scrollbar.AbsolutePosition.y then break end - if not scrollUpButton.Active then break end - if tick()-t > 5 then + if not scrollUpButton.Active then + break + end + if tick() - t > 5 then w = 0 - elseif tick()-t > 2 then + elseif tick() - t > 2 then w = 0.06 end wait(w) @@ -1178,40 +1237,51 @@ t.CreateTrueScrollingFrame = function() if mouseYPos and mouseYPos < (scrollbar.AbsolutePosition.y + scrollbar.AbsoluteSize.x) then break end - if not scrollDownButton.Active then break end - if tick()-t > 5 then + if not scrollDownButton.Active then + break + end + if tick() - t > 5 then w = 0 - elseif tick()-t > 2 then + elseif tick() - t > 2 then w = 0.06 end wait(w) end end end - - scrollbar.MouseButton1Down:connect(function(x,y) + + scrollbar.MouseButton1Down:connect(function(x, y) if scrollbar.Active then scrollStamp = tick() local mouseOffset = y - scrollbar.AbsolutePosition.y - if dragCon then dragCon:disconnect() dragCon = nil end - if upCon then upCon:disconnect() upCon = nil end + if dragCon then + dragCon:disconnect() + dragCon = nil + end + if upCon then + upCon:disconnect() + upCon = nil + end local prevY = y local reentrancyGuardMouseScroll = false - dragCon = mouseDrag.MouseMoved:connect(function(x,y) - if reentrancyGuardMouseScroll then return end - + dragCon = mouseDrag.MouseMoved:connect(function(x, y) + if reentrancyGuardMouseScroll then + return + end + reentrancyGuardMouseScroll = true - if positionScrollBar(x,y,mouseOffset) then - recalculate() - end + if positionScrollBar(x, y, mouseOffset) then + recalculate() + end reentrancyGuardMouseScroll = false - end) upCon = mouseDrag.MouseButton1Up:connect(function() scrollStamp = tick() mouseDrag.Parent = nil - dragCon:disconnect(); dragCon = nil - upCon:disconnect(); drag = nil + dragCon:disconnect() + dragCon = nil + upCon:disconnect() + drag = nil end) mouseDrag.Parent = getScreenGuiAncestor(scrollbar) end @@ -1230,13 +1300,13 @@ t.CreateTrueScrollingFrame = function() scrollStamp = tick() end) scrollDownButton.MouseButton1Down:connect(function() - scrollDown() + scrollDown() end) - + scrollbar.MouseButton1Up:connect(function() scrollStamp = tick() end) - + local function heightCheck(instance) if highY and (instance.AbsolutePosition.Y + instance.AbsoluteSize.Y) > highY then highY = instance.AbsolutePosition.Y + instance.AbsoluteSize.Y @@ -1245,7 +1315,7 @@ t.CreateTrueScrollingFrame = function() end setSliderSizeAndPosition() end - + local function highLowRecheck() local oldLowY = lowY local oldHighY = highY @@ -1259,8 +1329,12 @@ t.CreateTrueScrollingFrame = function() end local function descendantChanged(this, prop) - if internalChange then return end - if not this.Visible then return end + if internalChange then + return + end + if not this.Visible then + return + end if prop == "Size" or prop == "Position" then wait() @@ -1269,18 +1343,24 @@ t.CreateTrueScrollingFrame = function() end scrollingFrame.DescendantAdded:connect(function(instance) - if not instance:IsA("GuiObject") then return end + if not instance:IsA "GuiObject" then + return + end if instance.Visible then wait() -- wait a heartbeat for sizes to reconfig highLowRecheck() end - descendantsChangeConMap[instance] = instance.Changed:connect(function(prop) descendantChanged(instance, prop) end) + descendantsChangeConMap[instance] = instance.Changed:connect(function(prop) + descendantChanged(instance, prop) + end) end) scrollingFrame.DescendantRemoving:connect(function(instance) - if not instance:IsA("GuiObject") then return end + if not instance:IsA "GuiObject" then + return + end if descendantsChangeConMap[instance] then descendantsChangeConMap[instance]:disconnect() descendantsChangeConMap[instance] = nil @@ -1288,10 +1368,12 @@ t.CreateTrueScrollingFrame = function() wait() -- wait a heartbeat for sizes to reconfig highLowRecheck() end) - + scrollingFrame.Changed:connect(function(prop) if prop == "AbsoluteSize" then - if not highY or not lowY then return end + if not highY or not lowY then + return + end highLowRecheck() setSliderSizeAndPosition() @@ -1301,42 +1383,41 @@ t.CreateTrueScrollingFrame = function() return scrollingFrame, controlFrame end -t.CreateScrollingFrame = function(orderList,scrollStyle) - local frame = Instance.new("Frame") +t.CreateScrollingFrame = function(orderList, scrollStyle) + local frame = Instance.new "Frame" frame.Name = "ScrollingFrame" frame.BackgroundTransparency = 1 - frame.Size = UDim2.new(1,0,1,0) - - local scrollUpButton = Instance.new("ImageButton") + frame.Size = UDim2.new(1, 0, 1, 0) + + local scrollUpButton = Instance.new "ImageButton" scrollUpButton.Name = "ScrollUpButton" scrollUpButton.BackgroundTransparency = 1 scrollUpButton.Image = "rbxasset://textures/ui/scrollbuttonUp.png" - scrollUpButton.Size = UDim2.new(0,17,0,17) + scrollUpButton.Size = UDim2.new(0, 17, 0, 17) - - local scrollDownButton = Instance.new("ImageButton") + local scrollDownButton = Instance.new "ImageButton" scrollDownButton.Name = "ScrollDownButton" scrollDownButton.BackgroundTransparency = 1 scrollDownButton.Image = "rbxasset://textures/ui/scrollbuttonDown.png" - scrollDownButton.Size = UDim2.new(0,17,0,17) - - local scrollbar = Instance.new("ImageButton") + scrollDownButton.Size = UDim2.new(0, 17, 0, 17) + + local scrollbar = Instance.new "ImageButton" scrollbar.Name = "ScrollBar" scrollbar.Image = "rbxasset://textures/ui/scrollbar.png" scrollbar.BackgroundTransparency = 1 scrollbar.Size = UDim2.new(0, 18, 0, 150) local scrollStamp = 0 - - local scrollDrag = Instance.new("ImageButton") + + local scrollDrag = Instance.new "ImageButton" scrollDrag.Image = "http://www.roblox.com/asset/?id=61367186" scrollDrag.Size = UDim2.new(1, 0, 0, 16) scrollDrag.BackgroundTransparency = 1 scrollDrag.Name = "ScrollDrag" scrollDrag.Active = true scrollDrag.Parent = scrollbar - - local mouseDrag = Instance.new("ImageButton") + + local mouseDrag = Instance.new "ImageButton" mouseDrag.Active = false mouseDrag.Size = UDim2.new(1.5, 0, 1.5, 0) mouseDrag.AutoButtonColor = false @@ -1349,11 +1430,11 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) if scrollStyle and tostring(scrollStyle) then style = scrollStyle end - + local scrollPosition = 1 local rowSize = 0 local howManyDisplayed = 0 - + local layoutGridScrollBar = function() howManyDisplayed = 0 local guiObjects = {} @@ -1366,8 +1447,8 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) else local children = frame:GetChildren() if children then - for i, child in ipairs(children) do - if child:IsA("GuiObject") then + for i, child in ipairs(children) do + if child:IsA "GuiObject" then table.insert(guiObjects, child) end end @@ -1384,21 +1465,23 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) if scrollPosition > #guiObjects then scrollPosition = #guiObjects end - - if scrollPosition < 1 then scrollPosition = 1 end - + + if scrollPosition < 1 then + scrollPosition = 1 + end + local totalPixelsY = frame.AbsoluteSize.Y local pixelsRemainingY = frame.AbsoluteSize.Y - - local totalPixelsX = frame.AbsoluteSize.X - + + local totalPixelsX = frame.AbsoluteSize.X + local xCounter = 0 local rowSizeCounter = 0 local setRowSize = true local pixelsBelowScrollbar = 0 local pos = #guiObjects - + local currentRowY = 0 pos = scrollPosition @@ -1419,13 +1502,13 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) --Count wherever current row left off pixelsBelowScrollbar = pixelsBelowScrollbar + currentRowY currentRowY = 0 - + pos = scrollPosition - 1 xCounter = 0 - + --objects with varying X,Y dimensions can rarely cause minor errors --rechecking every new scrollPosition is necessary to avoid 100% of errors - + --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 @@ -1438,7 +1521,7 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) --It fits, so back up our scroll position pixelsBelowScrollbar = pixelsBelowScrollbar + currentRowY if scrollPosition <= rowSize then - scrollPosition = 1 + scrollPosition = 1 break else scrollPosition = scrollPosition - rowSize @@ -1448,14 +1531,14 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) break end end - + if guiObjects[pos].AbsoluteSize.Y > currentRowY then currentRowY = guiObjects[pos].AbsoluteSize.Y end pos = pos - 1 end - + --Do check last time if pos = 0 if (pos == 0) and (pixelsBelowScrollbar + currentRowY <= totalPixelsY) then scrollPosition = 1 @@ -1466,13 +1549,13 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) rowSizeCounter = 0 setRowSize = true local lastChildSize = 0 - - local xOffset,yOffset = 0 + + local xOffset, yOffset = 0 if guiObjects[1] then - yOffset = math.ceil(math.floor(math.fmod(totalPixelsY,guiObjects[1].AbsoluteSize.X))/2) - xOffset = math.ceil(math.floor(math.fmod(totalPixelsX,guiObjects[1].AbsoluteSize.Y))/2) + yOffset = math.ceil(math.floor(math.fmod(totalPixelsY, guiObjects[1].AbsoluteSize.X)) / 2) + xOffset = math.ceil(math.floor(math.fmod(totalPixelsX, guiObjects[1].AbsoluteSize.Y)) / 2) end - + for i, child in ipairs(guiObjects) do if i < scrollPosition then --print("Hiding " .. child.Name) @@ -1484,7 +1567,9 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) else --print("Laying out " .. child.Name) --GuiObject - if setRowSize then rowSizeCounter = rowSizeCounter + 1 end + if setRowSize then + rowSizeCounter = rowSizeCounter + 1 + end if xCounter + child.AbsoluteSize.X >= totalPixelsX then if setRowSize then rowSize = rowSizeCounter - 1 @@ -1493,19 +1578,24 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) xCounter = 0 pixelsRemainingY = pixelsRemainingY - child.AbsoluteSize.Y end - child.Position = UDim2.new(child.Position.X.Scale,xCounter + xOffset, 0, totalPixelsY - pixelsRemainingY + yOffset) + child.Position = UDim2.new( + child.Position.X.Scale, + xCounter + xOffset, + 0, + totalPixelsY - pixelsRemainingY + yOffset + ) xCounter = xCounter + child.AbsoluteSize.X child.Visible = ((pixelsRemainingY - child.AbsoluteSize.Y) >= 0) if child.Visible then howManyDisplayed = howManyDisplayed + 1 end - lastChildSize = child.AbsoluteSize + lastChildSize = child.AbsoluteSize end end end scrollUpButton.Active = (scrollPosition > 1) - if lastChildSize == 0 then + if lastChildSize == 0 then scrollDownButton.Active = false else scrollDownButton.Active = ((pixelsRemainingY - lastChildSize.Y) < 0) @@ -1514,12 +1604,10 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) scrollDrag.Visible = scrollDrag.Active end - - local layoutSimpleScrollBar = function() - local guiObjects = {} + local guiObjects = {} howManyDisplayed = 0 - + if orderList then for i, child in ipairs(orderList) do if child.Parent == frame then @@ -1529,8 +1617,8 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) else local children = frame:GetChildren() if children then - for i, child in ipairs(children) do - if child:IsA("GuiObject") then + for i, child in ipairs(children) do + if child:IsA "GuiObject" then table.insert(guiObjects, child) end end @@ -1547,7 +1635,7 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) if scrollPosition > #guiObjects then scrollPosition = #guiObjects end - + local totalPixels = frame.AbsoluteSize.Y local pixelsRemaining = frame.AbsoluteSize.Y @@ -1586,14 +1674,15 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) else --print("Laying out " .. child.Name) --GuiObject - child.Position = UDim2.new(child.Position.X.Scale, child.Position.X.Offset, 0, totalPixels - pixelsRemaining) + child.Position = + UDim2.new(child.Position.X.Scale, child.Position.X.Offset, 0, totalPixels - pixelsRemaining) pixelsRemaining = pixelsRemaining - child.AbsoluteSize.Y - if (pixelsRemaining >= 0) then + if pixelsRemaining >= 0 then child.Visible = true howManyDisplayed = howManyDisplayed + 1 else child.Visible = false - end + end end end end @@ -1602,35 +1691,43 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) scrollDrag.Active = #guiObjects > howManyDisplayed scrollDrag.Visible = scrollDrag.Active end - - - local moveDragger = function() + + local moveDragger = function() local guiObjects = 0 local children = frame:GetChildren() if children then - for i, child in ipairs(children) do - if child:IsA("GuiObject") then + for i, child in ipairs(children) do + if child:IsA "GuiObject" then guiObjects = guiObjects + 1 end end end - - if not scrollDrag.Parent then return end - - local dragSizeY = scrollDrag.Parent.AbsoluteSize.y * (1/(guiObjects - howManyDisplayed + 1)) - if dragSizeY < 16 then dragSizeY = 16 end - scrollDrag.Size = UDim2.new(scrollDrag.Size.X.Scale,scrollDrag.Size.X.Offset,scrollDrag.Size.Y.Scale,dragSizeY) - local relativeYPos = (scrollPosition - 1)/(guiObjects - (howManyDisplayed)) - if relativeYPos > 1 then relativeYPos = 1 - elseif relativeYPos < 0 then relativeYPos = 0 end + if not scrollDrag.Parent then + return + end + + local dragSizeY = scrollDrag.Parent.AbsoluteSize.y * (1 / (guiObjects - howManyDisplayed + 1)) + if dragSizeY < 16 then + dragSizeY = 16 + end + scrollDrag.Size = + UDim2.new(scrollDrag.Size.X.Scale, scrollDrag.Size.X.Offset, scrollDrag.Size.Y.Scale, dragSizeY) + + local relativeYPos = (scrollPosition - 1) / (guiObjects - howManyDisplayed) + if relativeYPos > 1 then + relativeYPos = 1 + elseif relativeYPos < 0 then + relativeYPos = 0 + end local absYPos = 0 - + if relativeYPos ~= 0 then absYPos = (relativeYPos * scrollbar.AbsoluteSize.y) - (relativeYPos * scrollDrag.AbsoluteSize.y) end - - scrollDrag.Position = UDim2.new(scrollDrag.Position.X.Scale,scrollDrag.Position.X.Offset,scrollDrag.Position.Y.Scale,absYPos) + + scrollDrag.Position = + UDim2.new(scrollDrag.Position.X.Scale, scrollDrag.Position.X.Offset, scrollDrag.Position.Y.Scale, absYPos) end local reentrancyGuard = false @@ -1642,23 +1739,31 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) wait() local success, err = nil if style == "grid" then - success, err = pcall(function() layoutGridScrollBar() end) + success, err = pcall(function() + layoutGridScrollBar() + end) elseif style == "simple" then - success, err = pcall(function() layoutSimpleScrollBar() end) + success, err = pcall(function() + layoutSimpleScrollBar() + end) + end + if not success then + print(err) end - if not success then print(err) end moveDragger() reentrancyGuard = false end - + local doScrollUp = function() - scrollPosition = (scrollPosition) - rowSize - if scrollPosition < 1 then scrollPosition = 1 end + scrollPosition = scrollPosition - rowSize + if scrollPosition < 1 then + scrollPosition = 1 + end recalculate(nil) end - + local doScrollDown = function() - scrollPosition = (scrollPosition) + rowSize + scrollPosition = scrollPosition + rowSize recalculate(nil) end @@ -1682,10 +1787,12 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) if mouseYPos and mouseYPos > scrollDrag.AbsolutePosition.y then break end - if not scrollUpButton.Active then break end - if tick()-t > 5 then + if not scrollUpButton.Active then + break + end + if tick() - t > 5 then w = 0 - elseif tick()-t > 2 then + elseif tick() - t > 2 then w = 0.06 end wait(w) @@ -1713,64 +1820,68 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) if mouseYPos and mouseYPos < (scrollDrag.AbsolutePosition.y + scrollDrag.AbsoluteSize.x) then break end - if not scrollDownButton.Active then break end - if tick()-t > 5 then + if not scrollDownButton.Active then + break + end + if tick() - t > 5 then w = 0 - elseif tick()-t > 2 then + elseif tick() - t > 2 then w = 0.06 end wait(w) end end end - + local y = 0 - scrollDrag.MouseButton1Down:connect(function(x,y) + scrollDrag.MouseButton1Down:connect(function(x, y) if scrollDrag.Active then scrollStamp = tick() local mouseOffset = y - scrollDrag.AbsolutePosition.y local dragCon local upCon - dragCon = mouseDrag.MouseMoved:connect(function(x,y) + dragCon = mouseDrag.MouseMoved:connect(function(x, y) local barAbsPos = scrollbar.AbsolutePosition.y local barAbsSize = scrollbar.AbsoluteSize.y - + local dragAbsSize = scrollDrag.AbsoluteSize.y local barAbsOne = barAbsPos + barAbsSize - dragAbsSize y = y - mouseOffset y = y < barAbsPos and barAbsPos or y > barAbsOne and barAbsOne or y y = y - barAbsPos - + local guiObjects = 0 local children = frame:GetChildren() if children then - for i, child in ipairs(children) do - if child:IsA("GuiObject") then + for i, child in ipairs(children) do + if child:IsA "GuiObject" then guiObjects = guiObjects + 1 end end end - - local doublePercent = y/(barAbsSize-dragAbsSize) + + local doublePercent = y / (barAbsSize - dragAbsSize) local rowDiff = rowSize local totalScrollCount = guiObjects - (howManyDisplayed - 1) local newScrollPosition = math.floor((doublePercent * totalScrollCount) + 0.5) + rowDiff if newScrollPosition < scrollPosition then rowDiff = -rowDiff end - + if newScrollPosition < 1 then newScrollPosition = 1 end - + scrollPosition = newScrollPosition recalculate(nil) end) upCon = mouseDrag.MouseButton1Up:connect(function() scrollStamp = tick() mouseDrag.Parent = nil - dragCon:disconnect(); dragCon = nil - upCon:disconnect(); drag = nil + dragCon:disconnect() + dragCon = nil + upCon:disconnect() + drag = nil end) mouseDrag.Parent = getScreenGuiAncestor(scrollbar) end @@ -1778,35 +1889,30 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) local scrollMouseCount = 0 - scrollUpButton.MouseButton1Down:connect( - function() - scrollUp() - end) + scrollUpButton.MouseButton1Down:connect(function() + scrollUp() + end) scrollUpButton.MouseButton1Up:connect(function() scrollStamp = tick() end) - scrollDownButton.MouseButton1Up:connect(function() scrollStamp = tick() end) - scrollDownButton.MouseButton1Down:connect( - function() - scrollDown() - end) - + scrollDownButton.MouseButton1Down:connect(function() + scrollDown() + end) + scrollbar.MouseButton1Up:connect(function() scrollStamp = tick() end) - scrollbar.MouseButton1Down:connect( - function(x,y) - if y > (scrollDrag.AbsoluteSize.y + scrollDrag.AbsolutePosition.y) then - scrollDown(y) - elseif y < (scrollDrag.AbsolutePosition.y) then - scrollUp(y) - end - end) - + scrollbar.MouseButton1Down:connect(function(x, y) + if y > (scrollDrag.AbsoluteSize.y + scrollDrag.AbsolutePosition.y) then + scrollDown(y) + elseif y < scrollDrag.AbsolutePosition.y then + scrollUp(y) + end + end) frame.ChildAdded:connect(function() recalculate(nil) @@ -1815,15 +1921,16 @@ t.CreateScrollingFrame = function(orderList,scrollStyle) frame.ChildRemoved:connect(function() recalculate(nil) end) - - frame.Changed:connect( - function(prop) - if prop == "AbsoluteSize" then - --Wait a heartbeat for it to sync in - recalculate(nil) - end - end) - frame.AncestryChanged:connect(function() recalculate(nil) end) + + frame.Changed:connect(function(prop) + if prop == "AbsoluteSize" then + --Wait a heartbeat for it to sync in + recalculate(nil) + end + end) + frame.AncestryChanged:connect(function() + recalculate(nil) + end) return frame, scrollUpButton, scrollDownButton, recalculate, scrollbar end @@ -1837,7 +1944,7 @@ local function binaryGrow(min, max, fits) local mid = min + math.floor((max - min) / 2) if fits(mid) and (biggestLegal == nil or biggestLegal < mid) then biggestLegal = mid - + --Try growing min = mid + 1 else @@ -1848,7 +1955,6 @@ local function binaryGrow(min, max, fits) return biggestLegal end - local function binaryShrink(min, max, fits) if min > max then return min @@ -1859,9 +1965,9 @@ local function binaryShrink(min, max, fits) local mid = min + math.floor((max - min) / 2) if fits(mid) and (smallestLegal == nil or smallestLegal > mid) then smallestLegal = mid - + --It fits, shrink - max = mid - 1 + max = mid - 1 else --Doesn't fit, grow min = mid + 1 @@ -1870,10 +1976,9 @@ local function binaryShrink(min, max, fits) return smallestLegal end - local function getGuiOwner(instance) while instance ~= nil do - if instance:IsA("ScreenGui") or instance:IsA("BillboardGui") then + if instance:IsA "ScreenGui" or instance:IsA "BillboardGui" then return instance end instance = instance.Parent @@ -1885,26 +1990,26 @@ t.AutoTruncateTextObject = function(textLabel) local text = textLabel.Text local fullLabel = textLabel:Clone() - fullLabel.Name = "Full" .. textLabel.Name + fullLabel.Name = "Full" .. textLabel.Name fullLabel.BorderSizePixel = 0 fullLabel.BackgroundTransparency = 0 fullLabel.Text = text fullLabel.TextXAlignment = Enum.TextXAlignment.Center - fullLabel.Position = UDim2.new(0,-3,0,0) - fullLabel.Size = UDim2.new(0,100,1,0) + fullLabel.Position = UDim2.new(0, -3, 0, 0) + fullLabel.Size = UDim2.new(0, 100, 1, 0) fullLabel.Visible = false fullLabel.Parent = textLabel local shortText = nil local mouseEnterConnection = nil - local mouseLeaveConnection= nil + local mouseLeaveConnection = nil local checkForResize = function() if getGuiOwner(textLabel) == nil then return end textLabel.Text = text - if textLabel.TextFits then + if textLabel.TextFits then --Tear down the rollover if it is active if mouseEnterConnection then mouseEnterConnection:disconnect() @@ -1919,57 +2024,52 @@ t.AutoTruncateTextObject = function(textLabel) textLabel.Text = text .. "~" --Shrink the text - local textSize = binaryGrow(0, len, - function(pos) - if pos == 0 then - textLabel.Text = "~" - else - textLabel.Text = string.sub(text, 1, pos) .. "~" - end - return textLabel.TextFits - end) + local textSize = binaryGrow(0, len, function(pos) + if pos == 0 then + textLabel.Text = "~" + else + textLabel.Text = string.sub(text, 1, pos) .. "~" + end + return textLabel.TextFits + end) shortText = string.sub(text, 1, textSize) .. "~" textLabel.Text = shortText - + --Make sure the fullLabel fits if not fullLabel.TextFits then --Already too small, grow it really bit to start fullLabel.Size = UDim2.new(0, 10000, 1, 0) end - + --Okay, now try to binary shrink it back down - local fullLabelSize = binaryShrink(textLabel.AbsoluteSize.X,fullLabel.AbsoluteSize.X, - function(size) - fullLabel.Size = UDim2.new(0, size, 1, 0) - return fullLabel.TextFits - end) - fullLabel.Size = UDim2.new(0,fullLabelSize+6,1,0) + local fullLabelSize = binaryShrink(textLabel.AbsoluteSize.X, fullLabel.AbsoluteSize.X, function(size) + fullLabel.Size = UDim2.new(0, size, 1, 0) + return fullLabel.TextFits + end) + fullLabel.Size = UDim2.new(0, fullLabelSize + 6, 1, 0) --Now setup the rollover effects, if they are currently off if mouseEnterConnection == nil then - mouseEnterConnection = textLabel.MouseEnter:connect( - function() - fullLabel.ZIndex = textLabel.ZIndex + 1 - fullLabel.Visible = true - --textLabel.Text = "" - end) + mouseEnterConnection = textLabel.MouseEnter:connect(function() + fullLabel.ZIndex = textLabel.ZIndex + 1 + fullLabel.Visible = true + --textLabel.Text = "" + end) end if mouseLeaveConnection == nil then - mouseLeaveConnection = textLabel.MouseLeave:connect( - function() - fullLabel.Visible = false - --textLabel.Text = shortText - end) + mouseLeaveConnection = textLabel.MouseLeave:connect(function() + fullLabel.Visible = false + --textLabel.Text = shortText + end) end end end textLabel.AncestryChanged:connect(checkForResize) - textLabel.Changed:connect( - function(prop) - if prop == "AbsoluteSize" then - checkForResize() - end - end) + textLabel.Changed:connect(function(prop) + if prop == "AbsoluteSize" then + checkForResize() + end + end) checkForResize() @@ -1982,7 +2082,7 @@ t.AutoTruncateTextObject = function(textLabel) return textLabel, changeText end -local function TransitionTutorialPages(fromPage, toPage, transitionFrame, currentPageValue) +local function TransitionTutorialPages(fromPage, toPage, transitionFrame, currentPageValue) if fromPage then fromPage.Visible = false if transitionFrame.Visible == false then @@ -1991,8 +2091,8 @@ local function TransitionTutorialPages(fromPage, toPage, transitionFrame, curren end else if transitionFrame.Visible == false then - transitionFrame.Size = UDim2.new(0.0,50,0.0,50) - transitionFrame.Position = UDim2.new(0.5,-25,0.5,-25) + transitionFrame.Size = UDim2.new(0, 50, 0, 50) + transitionFrame.Position = UDim2.new(0.5, -25, 0.5, -25) end end transitionFrame.Visible = true @@ -2008,10 +2108,16 @@ local function TransitionTutorialPages(fromPage, toPage, transitionFrame, curren toPage.Visible = false else - newSize = UDim2.new(0.0,50,0.0,50) - newPosition = UDim2.new(0.5,-25,0.5,-25) + newSize = UDim2.new(0, 50, 0, 50) + newPosition = UDim2.new(0.5, -25, 0.5, -25) end - transitionFrame:TweenSizeAndPosition(newSize, newPosition, Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.3, true, + transitionFrame:TweenSizeAndPosition( + newSize, + newPosition, + Enum.EasingDirection.InOut, + Enum.EasingStyle.Quad, + 0.3, + true, function(state) if state == Enum.TweenStatus.Completed then transitionFrame.Visible = false @@ -2020,17 +2126,18 @@ local function TransitionTutorialPages(fromPage, toPage, transitionFrame, curren currentPageValue.Value = toPage end end - end) + end + ) end t.CreateTutorial = function(name, tutorialKey, createButtons) - local frame = Instance.new("Frame") + local frame = Instance.new "Frame" frame.Name = "Tutorial-" .. name frame.BackgroundTransparency = 1 frame.Size = UDim2.new(0.6, 0, 0.6, 0) frame.Position = UDim2.new(0.2, 0, 0.2, 0) - local transitionFrame = Instance.new("Frame") + local transitionFrame = Instance.new "Frame" transitionFrame.Name = "TransitionFrame" transitionFrame.Style = Enum.FrameStyle.RobloxRound transitionFrame.Size = UDim2.new(0.6, 0, 0.6, 0) @@ -2038,27 +2145,27 @@ t.CreateTutorial = function(name, tutorialKey, createButtons) transitionFrame.Visible = false transitionFrame.Parent = frame - local currentPageValue = Instance.new("ObjectValue") + local currentPageValue = Instance.new "ObjectValue" currentPageValue.Name = "CurrentTutorialPage" currentPageValue.Value = nil currentPageValue.Parent = frame - local boolValue = Instance.new("BoolValue") + local boolValue = Instance.new "BoolValue" boolValue.Name = "Buttons" boolValue.Value = createButtons boolValue.Parent = frame - local pages = Instance.new("Frame") + local pages = Instance.new "Frame" pages.Name = "Pages" pages.BackgroundTransparency = 1 - pages.Size = UDim2.new(1,0,1,0) + pages.Size = UDim2.new(1, 0, 1, 0) pages.Parent = frame local function getVisiblePageAndHideOthers() local visiblePage = nil local children = pages:GetChildren() if children then - for i,child in ipairs(children) do + for i, child in ipairs(children) do if child.Visible then if visiblePage then child.Visible = false @@ -2073,14 +2180,14 @@ t.CreateTutorial = function(name, tutorialKey, createButtons) local showTutorial = function(alwaysShow) if alwaysShow or UserSettings().GameSettings:GetTutorialState(tutorialKey) == false then - print("Showing tutorial-",tutorialKey) + print("Showing tutorial-", tutorialKey) local currentTutorialPage = getVisiblePageAndHideOthers() - local firstPage = pages:FindFirstChild("TutorialPage1") + local firstPage = pages:FindFirstChild "TutorialPage1" if firstPage then - TransitionTutorialPages(currentTutorialPage, firstPage, transitionFrame, currentPageValue) + TransitionTutorialPages(currentTutorialPage, firstPage, transitionFrame, currentPageValue) else - error("Could not find TutorialPage1") + error "Could not find TutorialPage1" end end end @@ -2102,30 +2209,30 @@ t.CreateTutorial = function(name, tutorialKey, createButtons) end return frame, showTutorial, dismissTutorial, gotoPage -end +end local function CreateBasicTutorialPage(name, handleResize, skipTutorial, giveDoneButton) - local frame = Instance.new("Frame") + local frame = Instance.new "Frame" frame.Name = "TutorialPage" frame.Style = Enum.FrameStyle.RobloxRound frame.Size = UDim2.new(0.6, 0, 0.6, 0) frame.Position = UDim2.new(0.2, 0, 0.2, 0) frame.Visible = false - - local frameHeader = Instance.new("TextLabel") + + local frameHeader = Instance.new "TextLabel" frameHeader.Name = "Header" frameHeader.Text = name frameHeader.BackgroundTransparency = 1 frameHeader.FontSize = Enum.FontSize.Size24 frameHeader.Font = Enum.Font.ArialBold - frameHeader.TextColor3 = Color3.new(1,1,1) + frameHeader.TextColor3 = Color3.new(1, 1, 1) frameHeader.TextXAlignment = Enum.TextXAlignment.Center frameHeader.TextWrap = true - frameHeader.Size = UDim2.new(1,-55, 0, 22) - frameHeader.Position = UDim2.new(0,0,0,0) + frameHeader.Size = UDim2.new(1, -55, 0, 22) + frameHeader.Position = UDim2.new(0, 0, 0, 0) frameHeader.Parent = frame - local skipButton = Instance.new("ImageButton") + local skipButton = Instance.new "ImageButton" skipButton.Name = "SkipButton" skipButton.AutoButtonColor = false skipButton.BackgroundTransparency = 1 @@ -2142,62 +2249,63 @@ local function CreateBasicTutorialPage(name, handleResize, skipTutorial, giveDon skipButton.Size = UDim2.new(0, 25, 0, 25) skipButton.Position = UDim2.new(1, -25, 0, 0) skipButton.Parent = frame - - + if giveDoneButton then - local doneButton = Instance.new("TextButton") + local doneButton = Instance.new "TextButton" doneButton.Name = "DoneButton" doneButton.Style = Enum.ButtonStyle.RobloxButtonDefault doneButton.Text = "Done" - doneButton.TextColor3 = Color3.new(1,1,1) + doneButton.TextColor3 = Color3.new(1, 1, 1) doneButton.Font = Enum.Font.ArialBold doneButton.FontSize = Enum.FontSize.Size18 - doneButton.Size = UDim2.new(0,100,0,50) - doneButton.Position = UDim2.new(0.5,-50,1,-50) - + doneButton.Size = UDim2.new(0, 100, 0, 50) + doneButton.Position = UDim2.new(0.5, -50, 1, -50) + if skipTutorial then - doneButton.MouseButton1Click:connect(function() skipTutorial() end) + doneButton.MouseButton1Click:connect(function() + skipTutorial() + end) end - + doneButton.Parent = frame end - local innerFrame = Instance.new("Frame") + local innerFrame = Instance.new "Frame" innerFrame.Name = "ContentFrame" innerFrame.BackgroundTransparency = 1 - innerFrame.Position = UDim2.new(0,0,0,25) + innerFrame.Position = UDim2.new(0, 0, 0, 25) innerFrame.Parent = frame - local nextButton = Instance.new("TextButton") + local nextButton = Instance.new "TextButton" nextButton.Name = "NextButton" nextButton.Text = "Next" - nextButton.TextColor3 = Color3.new(1,1,1) + nextButton.TextColor3 = Color3.new(1, 1, 1) nextButton.Font = Enum.Font.Arial nextButton.FontSize = Enum.FontSize.Size18 nextButton.Style = Enum.ButtonStyle.RobloxButtonDefault - nextButton.Size = UDim2.new(0,80, 0, 32) + nextButton.Size = UDim2.new(0, 80, 0, 32) nextButton.Position = UDim2.new(0.5, 5, 1, -32) nextButton.Active = false nextButton.Visible = false nextButton.Parent = frame - local prevButton = Instance.new("TextButton") + local prevButton = Instance.new "TextButton" prevButton.Name = "PrevButton" prevButton.Text = "Previous" - prevButton.TextColor3 = Color3.new(1,1,1) + prevButton.TextColor3 = Color3.new(1, 1, 1) prevButton.Font = Enum.Font.Arial prevButton.FontSize = Enum.FontSize.Size18 prevButton.Style = Enum.ButtonStyle.RobloxButton - prevButton.Size = UDim2.new(0,80, 0, 32) + prevButton.Size = UDim2.new(0, 80, 0, 32) prevButton.Position = UDim2.new(0.5, -85, 1, -32) prevButton.Active = false prevButton.Visible = false prevButton.Parent = frame if giveDoneButton then - innerFrame.Size = UDim2.new(1,0,1,-75) + innerFrame.Size = UDim2.new(1, 0, 1, -75) else - innerFrame.Size = UDim2.new(1,0,1,-22) + innerFrame.Size = UDim2.new(1, 0, 1, -22) end local parentConnection = nil @@ -2205,33 +2313,31 @@ local function CreateBasicTutorialPage(name, handleResize, skipTutorial, giveDon local function basicHandleResize() if frame.Visible and frame.Parent then local maxSize = math.min(frame.Parent.AbsoluteSize.X, frame.Parent.AbsoluteSize.Y) - handleResize(200,maxSize) + handleResize(200, maxSize) end end - frame.Changed:connect( - function(prop) - if prop == "Parent" then - if parentConnection ~= nil then - parentConnection:disconnect() - parentConnection = nil - end - if frame.Parent and frame.Parent:IsA("GuiObject") then - parentConnection = frame.Parent.Changed:connect( - function(parentProp) - if parentProp == "AbsoluteSize" then - wait() - basicHandleResize() - end - end) - basicHandleResize() - end + frame.Changed:connect(function(prop) + if prop == "Parent" then + if parentConnection ~= nil then + parentConnection:disconnect() + parentConnection = nil end - - if prop == "Visible" then + if frame.Parent and frame.Parent:IsA "GuiObject" then + parentConnection = frame.Parent.Changed:connect(function(parentProp) + if parentProp == "AbsoluteSize" then + wait() + basicHandleResize() + end + end) basicHandleResize() end - end) + end + + if prop == "Visible" then + basicHandleResize() + end + end) return frame, innerFrame end @@ -2240,25 +2346,24 @@ t.CreateTextTutorialPage = function(name, text, skipTutorialFunc) local frame = nil local contentFrame = nil - local textLabel = Instance.new("TextLabel") + local textLabel = Instance.new "TextLabel" textLabel.BackgroundTransparency = 1 - textLabel.TextColor3 = Color3.new(1,1,1) + textLabel.TextColor3 = Color3.new(1, 1, 1) textLabel.Text = text textLabel.TextWrap = true textLabel.TextXAlignment = Enum.TextXAlignment.Left textLabel.TextYAlignment = Enum.TextYAlignment.Center textLabel.Font = Enum.Font.Arial textLabel.FontSize = Enum.FontSize.Size14 - textLabel.Size = UDim2.new(1,0,1,0) + textLabel.Size = UDim2.new(1, 0, 1, 0) local function handleResize(minSize, maxSize) - size = binaryShrink(minSize, maxSize, - function(size) - frame.Size = UDim2.new(0, size, 0, size) - return textLabel.TextFits - end) + size = binaryShrink(minSize, maxSize, function(size) + frame.Size = UDim2.new(0, size, 0, size) + return textLabel.TextFits + end) frame.Size = UDim2.new(0, size, 0, size) - frame.Position = UDim2.new(0.5, -size/2, 0.5, -size/2) + frame.Position = UDim2.new(0.5, -size / 2, 0.5, -size / 2) end frame, contentFrame = CreateBasicTutorialPage(name, handleResize, skipTutorialFunc) @@ -2271,34 +2376,33 @@ t.CreateImageTutorialPage = function(name, imageAsset, x, y, skipTutorialFunc, g local frame = nil local contentFrame = nil - local imageLabel = Instance.new("ImageLabel") + local imageLabel = Instance.new "ImageLabel" imageLabel.BackgroundTransparency = 1 imageLabel.Image = imageAsset - imageLabel.Size = UDim2.new(0,x,0,y) - imageLabel.Position = UDim2.new(0.5,-x/2,0.5,-y/2) + imageLabel.Size = UDim2.new(0, x, 0, y) + imageLabel.Position = UDim2.new(0.5, -x / 2, 0.5, -y / 2) local function handleResize(minSize, maxSize) - size = binaryShrink(minSize, maxSize, - function(size) - return size >= x and size >= y - end) + size = binaryShrink(minSize, maxSize, function(size) + return size >= x and size >= y + end) if size >= x and size >= y then - imageLabel.Size = UDim2.new(0,x, 0,y) - imageLabel.Position = UDim2.new(0.5,-x/2, 0.5, -y/2) + imageLabel.Size = UDim2.new(0, x, 0, y) + imageLabel.Position = UDim2.new(0.5, -x / 2, 0.5, -y / 2) else if x > y then - --X is limiter, so - imageLabel.Size = UDim2.new(1,0,y/x,0) - imageLabel.Position = UDim2.new(0,0, 0.5 - (y/x)/2, 0) + --X is limiter, so + imageLabel.Size = UDim2.new(1, 0, y / x, 0) + imageLabel.Position = UDim2.new(0, 0, 0.5 - (y / x) / 2, 0) else --Y is limiter - imageLabel.Size = UDim2.new(x/y,0,1, 0) - imageLabel.Position = UDim2.new(0.5-(x/y)/2, 0, 0, 0) + imageLabel.Size = UDim2.new(x / y, 0, 1, 0) + imageLabel.Position = UDim2.new(0.5 - (x / y) / 2, 0, 0, 0) end end size = size + 50 frame.Size = UDim2.new(0, size, 0, size) - frame.Position = UDim2.new(0.5, -size/2, 0.5, -size/2) + frame.Position = UDim2.new(0.5, -size / 2, 0.5, -size / 2) end frame, contentFrame = CreateBasicTutorialPage(name, handleResize, skipTutorialFunc, giveDoneButton) @@ -2318,30 +2422,28 @@ t.AddTutorialPage = function(tutorial, tutorialPage) local children = tutorial.Pages:GetChildren() if children and #children > 0 then - tutorialPage.Name = "TutorialPage" .. (#children+1) + tutorialPage.Name = "TutorialPage" .. (#children + 1) local previousPage = children[#children] - if not previousPage:IsA("GuiObject") then - error("All elements under Pages must be GuiObjects") + if not previousPage:IsA "GuiObject" then + error "All elements under Pages must be GuiObjects" end if tutorial.Buttons.Value then if previousPage.NextButton.Active then - error("NextButton already Active on previousPage, please only add pages with RbxGui.AddTutorialPage function") + error "NextButton already Active on previousPage, please only add pages with RbxGui.AddTutorialPage function" end - previousPage.NextButton.MouseButton1Click:connect( - function() - TransitionTutorialPages(previousPage, tutorialPage, transitionFrame, currentPageValue) - end) + previousPage.NextButton.MouseButton1Click:connect(function() + TransitionTutorialPages(previousPage, tutorialPage, transitionFrame, currentPageValue) + end) previousPage.NextButton.Active = true previousPage.NextButton.Visible = true if tutorialPage.PrevButton.Active then - error("PrevButton already Active on tutorialPage, please only add pages with RbxGui.AddTutorialPage function") + error "PrevButton already Active on tutorialPage, please only add pages with RbxGui.AddTutorialPage function" end - tutorialPage.PrevButton.MouseButton1Click:connect( - function() - TransitionTutorialPages(tutorialPage, previousPage, transitionFrame, currentPageValue) - end) + tutorialPage.PrevButton.MouseButton1Click:connect(function() + TransitionTutorialPages(tutorialPage, previousPage, transitionFrame, currentPageValue) + end) tutorialPage.PrevButton.Active = true tutorialPage.PrevButton.Visible = true end @@ -2352,26 +2454,45 @@ t.AddTutorialPage = function(tutorial, tutorialPage) tutorialPage.Name = "TutorialPage1" tutorialPage.Parent = tutorial.Pages end -end - -t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, position, showAdminCategories, useAssetVersionId) +end +t.CreateSetPanel = function( + userIdsForSets, + objectSelected, + dialogClosed, + size, + position, + showAdminCategories, + useAssetVersionId +) if not userIdsForSets then - error("CreateSetPanel: userIdsForSets (first arg) is nil, should be a table of number ids") + error "CreateSetPanel: userIdsForSets (first arg) is nil, should be a table of number ids" end if type(userIdsForSets) ~= "table" and type(userIdsForSets) ~= "userdata" then - error("CreateSetPanel: userIdsForSets (first arg) is of type " ..type(userIdsForSets) .. ", should be of type table or userdata") + error( + "CreateSetPanel: userIdsForSets (first arg) is of type " + .. type(userIdsForSets) + .. ", should be of type table or userdata" + ) end if not objectSelected then - error("CreateSetPanel: objectSelected (second arg) is nil, should be a callback function!") + error "CreateSetPanel: objectSelected (second arg) is nil, should be a callback function!" end if type(objectSelected) ~= "function" then - error("CreateSetPanel: objectSelected (second arg) is of type " .. type(objectSelected) .. ", should be of type function!") + error( + "CreateSetPanel: objectSelected (second arg) is of type " + .. type(objectSelected) + .. ", should be of type function!" + ) end if dialogClosed and type(dialogClosed) ~= "function" then - error("CreateSetPanel: dialogClosed (third arg) is of type " .. type(dialogClosed) .. ", should be of type function!") + error( + "CreateSetPanel: dialogClosed (third arg) is of type " + .. type(dialogClosed) + .. ", should be of type function!" + ) end - + if showAdminCategories == nil then -- by default, don't show beta sets showAdminCategories = false end @@ -2386,21 +2507,21 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, local waterForceDirection = "NegX" local waterForce = "None" local waterGui, waterTypeChangedEvent = nil - + local Data = {} Data.CurrentCategory = nil Data.Category = {} local SetCache = {} - + local userCategoryButtons = nil - + local buttonWidth = 64 local buttonHeight = buttonWidth - + local SmallThumbnailUrl = nil local LargeThumbnailUrl = nil local BaseUrl = game:GetService("ContentProvider").BaseUrl:lower() - + if useAssetVersionId then LargeThumbnailUrl = BaseUrl .. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&assetversionid=" SmallThumbnailUrl = BaseUrl .. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=75&ht=75&assetversionid=" @@ -2408,43 +2529,44 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, LargeThumbnailUrl = BaseUrl .. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&aid=" SmallThumbnailUrl = BaseUrl .. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=75&ht=75&aid=" end - + local function drillDownSetZIndex(parent, index) local children = parent:GetChildren() for i = 1, #children do - if children[i]:IsA("GuiObject") then + if children[i]:IsA "GuiObject" then children[i].ZIndex = index end drillDownSetZIndex(children[i], index) end end - + -- for terrain stamping local currTerrainDropDownFrame = nil - local terrainShapes = {"Block","Vertical Ramp","Corner Wedge","Inverse Corner Wedge","Horizontal Ramp","Auto-Wedge"} + local terrainShapes = + { "Block", "Vertical Ramp", "Corner Wedge", "Inverse Corner Wedge", "Horizontal Ramp", "Auto-Wedge" } local terrainShapeMap = {} for i = 1, #terrainShapes do terrainShapeMap[terrainShapes[i]] = i - 1 - end + end terrainShapeMap[terrainShapes[#terrainShapes]] = 6 local function createWaterGui() - local waterForceDirections = {"NegX","X","NegY","Y","NegZ","Z"} - local waterForces = {"None", "Small", "Medium", "Strong", "Max"} + local waterForceDirections = { "NegX", "X", "NegY", "Y", "NegZ", "Z" } + local waterForces = { "None", "Small", "Medium", "Strong", "Max" } - local waterFrame = Instance.new("Frame") + local waterFrame = Instance.new "Frame" waterFrame.Name = "WaterFrame" waterFrame.Style = Enum.FrameStyle.RobloxSquare - waterFrame.Size = UDim2.new(0,150,0,110) + waterFrame.Size = UDim2.new(0, 150, 0, 110) waterFrame.Visible = false - local waterForceLabel = Instance.new("TextLabel") + local waterForceLabel = Instance.new "TextLabel" waterForceLabel.Name = "WaterForceLabel" waterForceLabel.BackgroundTransparency = 1 - waterForceLabel.Size = UDim2.new(1,0,0,12) + waterForceLabel.Size = UDim2.new(1, 0, 0, 12) waterForceLabel.Font = Enum.Font.ArialBold waterForceLabel.FontSize = Enum.FontSize.Size12 - waterForceLabel.TextColor3 = Color3.new(1,1,1) + waterForceLabel.TextColor3 = Color3.new(1, 1, 1) waterForceLabel.TextXAlignment = Enum.TextXAlignment.Left waterForceLabel.Text = "Water Force" waterForceLabel.Parent = waterFrame @@ -2452,31 +2574,33 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, local waterForceDirLabel = waterForceLabel:Clone() waterForceDirLabel.Name = "WaterForceDirectionLabel" waterForceDirLabel.Text = "Water Force Direction" - waterForceDirLabel.Position = UDim2.new(0,0,0,50) + waterForceDirLabel.Position = UDim2.new(0, 0, 0, 50) waterForceDirLabel.Parent = waterFrame - local waterTypeChangedEvent = Instance.new("BindableEvent",waterFrame) + local waterTypeChangedEvent = Instance.new "BindableEvent" waterTypeChangedEvent.Name = "WaterTypeChangedEvent" + waterTypeChangedEvent.Parent = waterFrame local waterForceDirectionSelectedFunc = function(newForceDirection) waterForceDirection = newForceDirection - waterTypeChangedEvent:Fire({waterForce, waterForceDirection}) + waterTypeChangedEvent:Fire { waterForce, waterForceDirection } end local waterForceSelectedFunc = function(newForce) waterForce = newForce - waterTypeChangedEvent:Fire({waterForce, waterForceDirection}) + waterTypeChangedEvent:Fire { waterForce, waterForceDirection } end - local waterForceDirectionDropDown, forceWaterDirectionSelection = t.CreateDropDownMenu(waterForceDirections, waterForceDirectionSelectedFunc) - waterForceDirectionDropDown.Size = UDim2.new(1,0,0,25) - waterForceDirectionDropDown.Position = UDim2.new(0,0,1,3) - forceWaterDirectionSelection("NegX") + local waterForceDirectionDropDown, forceWaterDirectionSelection = + t.CreateDropDownMenu(waterForceDirections, waterForceDirectionSelectedFunc) + waterForceDirectionDropDown.Size = UDim2.new(1, 0, 0, 25) + waterForceDirectionDropDown.Position = UDim2.new(0, 0, 1, 3) + forceWaterDirectionSelection "NegX" waterForceDirectionDropDown.Parent = waterForceDirLabel local waterForceDropDown, forceWaterForceSelection = t.CreateDropDownMenu(waterForces, waterForceSelectedFunc) - forceWaterForceSelection("None") - waterForceDropDown.Size = UDim2.new(1,0,0,25) - waterForceDropDown.Position = UDim2.new(0,0,1,3) + forceWaterForceSelection "None" + waterForceDropDown.Size = UDim2.new(1, 0, 0, 25) + waterForceDropDown.Position = UDim2.new(0, 0, 1, 3) waterForceDropDown.Parent = waterForceLabel return waterFrame, waterTypeChangedEvent @@ -2484,11 +2608,10 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, -- Helper Function that contructs gui elements local function createSetGui() - - local setGui = Instance.new("ScreenGui") + local setGui = Instance.new "ScreenGui" setGui.Name = "SetGui" - - local setPanel = Instance.new("Frame") + + local setPanel = Instance.new "Frame" setPanel.Name = "SetPanel" setPanel.Active = true setPanel.BackgroundTransparency = 1 @@ -2505,152 +2628,155 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, setPanel.Style = Enum.FrameStyle.RobloxRound setPanel.ZIndex = 6 setPanel.Parent = setGui - - -- Children of SetPanel - local itemPreview = Instance.new("Frame") - itemPreview.Name = "ItemPreview" - itemPreview.BackgroundTransparency = 1 - itemPreview.Position = UDim2.new(0.8,5,0.085,0) - itemPreview.Size = UDim2.new(0.21,0,0.9,0) - itemPreview.ZIndex = 6 - itemPreview.Parent = setPanel - - -- Children of ItemPreview - local textPanel = Instance.new("Frame") - textPanel.Name = "TextPanel" - textPanel.BackgroundTransparency = 1 - textPanel.Position = UDim2.new(0,0,0.45,0) - textPanel.Size = UDim2.new(1,0,0.55,0) - textPanel.ZIndex = 6 - textPanel.Parent = itemPreview - - -- Children of TextPanel - local rolloverText = Instance.new("TextLabel") - rolloverText.Name = "RolloverText" - rolloverText.BackgroundTransparency = 1 - rolloverText.Size = UDim2.new(1,0,0,48) - rolloverText.ZIndex = 6 - rolloverText.Font = Enum.Font.ArialBold - rolloverText.FontSize = Enum.FontSize.Size24 - rolloverText.Text = "" - rolloverText.TextColor3 = Color3.new(1,1,1) - rolloverText.TextWrap = true - rolloverText.TextXAlignment = Enum.TextXAlignment.Left - rolloverText.TextYAlignment = Enum.TextYAlignment.Top - rolloverText.Parent = textPanel - - local largePreview = Instance.new("ImageLabel") - largePreview.Name = "LargePreview" - largePreview.BackgroundTransparency = 1 - largePreview.Image = "" - largePreview.Size = UDim2.new(1,0,0,170) - largePreview.ZIndex = 6 - largePreview.Parent = itemPreview - - local sets = Instance.new("Frame") - sets.Name = "Sets" - sets.BackgroundTransparency = 1 - sets.Position = UDim2.new(0,0,0,5) - sets.Size = UDim2.new(0.23,0,1,-5) - sets.ZIndex = 6 - sets.Parent = setPanel - - -- Children of Sets - local line = Instance.new("Frame") - line.Name = "Line" - line.BackgroundColor3 = Color3.new(1,1,1) - line.BackgroundTransparency = 0.7 - line.BorderSizePixel = 0 - line.Position = UDim2.new(1,-3,0.06,0) - line.Size = UDim2.new(0,3,0.9,0) - line.ZIndex = 6 - line.Parent = sets - - local setsLists, controlFrame = t.CreateTrueScrollingFrame() - setsLists.Size = UDim2.new(1,-6,0.94,0) - setsLists.Position = UDim2.new(0,0,0.06,0) - setsLists.BackgroundTransparency = 1 - setsLists.Name = "SetsLists" - setsLists.ZIndex = 6 - setsLists.Parent = sets - drillDownSetZIndex(controlFrame, 7) - - local setsHeader = Instance.new("TextLabel") - setsHeader.Name = "SetsHeader" - setsHeader.BackgroundTransparency = 1 - setsHeader.Size = UDim2.new(0,47,0,24) - setsHeader.ZIndex = 6 - setsHeader.Font = Enum.Font.ArialBold - setsHeader.FontSize = Enum.FontSize.Size24 - setsHeader.Text = "Sets" - setsHeader.TextColor3 = Color3.new(1,1,1) - setsHeader.TextXAlignment = Enum.TextXAlignment.Left - setsHeader.TextYAlignment = Enum.TextYAlignment.Top - setsHeader.Parent = sets - - local cancelButton = Instance.new("TextButton") - cancelButton.Name = "CancelButton" - cancelButton.Position = UDim2.new(1,-32,0,-2) - cancelButton.Size = UDim2.new(0,34,0,34) - cancelButton.Style = Enum.ButtonStyle.RobloxButtonDefault - cancelButton.ZIndex = 6 - cancelButton.Text = "" - cancelButton.Modal = true - cancelButton.Parent = setPanel - - -- Children of Cancel Button - local cancelImage = Instance.new("ImageLabel") - cancelImage.Name = "CancelImage" - cancelImage.BackgroundTransparency = 1 - cancelImage.Image = "http://www.roblox.com/asset?id=54135717" - cancelImage.Position = UDim2.new(0,-2,0,-2) - cancelImage.Size = UDim2.new(0,16,0,16) - cancelImage.ZIndex = 6 - cancelImage.Parent = cancelButton - + + -- Children of SetPanel + local itemPreview = Instance.new "Frame" + itemPreview.Name = "ItemPreview" + itemPreview.BackgroundTransparency = 1 + itemPreview.Position = UDim2.new(0.8, 5, 0.085, 0) + itemPreview.Size = UDim2.new(0.21, 0, 0.9, 0) + itemPreview.ZIndex = 6 + itemPreview.Parent = setPanel + + -- Children of ItemPreview + local textPanel = Instance.new "Frame" + textPanel.Name = "TextPanel" + textPanel.BackgroundTransparency = 1 + textPanel.Position = UDim2.new(0, 0, 0.45, 0) + textPanel.Size = UDim2.new(1, 0, 0.55, 0) + textPanel.ZIndex = 6 + textPanel.Parent = itemPreview + + -- Children of TextPanel + local rolloverText = Instance.new "TextLabel" + rolloverText.Name = "RolloverText" + rolloverText.BackgroundTransparency = 1 + rolloverText.Size = UDim2.new(1, 0, 0, 48) + rolloverText.ZIndex = 6 + rolloverText.Font = Enum.Font.ArialBold + rolloverText.FontSize = Enum.FontSize.Size24 + rolloverText.Text = "" + rolloverText.TextColor3 = Color3.new(1, 1, 1) + rolloverText.TextWrap = true + rolloverText.TextXAlignment = Enum.TextXAlignment.Left + rolloverText.TextYAlignment = Enum.TextYAlignment.Top + rolloverText.Parent = textPanel + + local largePreview = Instance.new "ImageLabel" + largePreview.Name = "LargePreview" + largePreview.BackgroundTransparency = 1 + largePreview.Image = "" + largePreview.Size = UDim2.new(1, 0, 0, 170) + largePreview.ZIndex = 6 + largePreview.Parent = itemPreview + + local sets = Instance.new "Frame" + sets.Name = "Sets" + sets.BackgroundTransparency = 1 + sets.Position = UDim2.new(0, 0, 0, 5) + sets.Size = UDim2.new(0.23, 0, 1, -5) + sets.ZIndex = 6 + sets.Parent = setPanel + + -- Children of Sets + local line = Instance.new "Frame" + line.Name = "Line" + line.BackgroundColor3 = Color3.new(1, 1, 1) + line.BackgroundTransparency = 0.7 + line.BorderSizePixel = 0 + line.Position = UDim2.new(1, -3, 0.06, 0) + line.Size = UDim2.new(0, 3, 0.9, 0) + line.ZIndex = 6 + line.Parent = sets + + local setsLists, controlFrame = t.CreateTrueScrollingFrame() + setsLists.Size = UDim2.new(1, -6, 0.94, 0) + setsLists.Position = UDim2.new(0, 0, 0.06, 0) + setsLists.BackgroundTransparency = 1 + setsLists.Name = "SetsLists" + setsLists.ZIndex = 6 + setsLists.Parent = sets + drillDownSetZIndex(controlFrame, 7) + + local setsHeader = Instance.new "TextLabel" + setsHeader.Name = "SetsHeader" + setsHeader.BackgroundTransparency = 1 + setsHeader.Size = UDim2.new(0, 47, 0, 24) + setsHeader.ZIndex = 6 + setsHeader.Font = Enum.Font.ArialBold + setsHeader.FontSize = Enum.FontSize.Size24 + setsHeader.Text = "Sets" + setsHeader.TextColor3 = Color3.new(1, 1, 1) + setsHeader.TextXAlignment = Enum.TextXAlignment.Left + setsHeader.TextYAlignment = Enum.TextYAlignment.Top + setsHeader.Parent = sets + + local cancelButton = Instance.new "TextButton" + cancelButton.Name = "CancelButton" + cancelButton.Position = UDim2.new(1, -32, 0, -2) + cancelButton.Size = UDim2.new(0, 34, 0, 34) + cancelButton.Style = Enum.ButtonStyle.RobloxButtonDefault + cancelButton.ZIndex = 6 + cancelButton.Text = "" + cancelButton.Modal = true + cancelButton.Parent = setPanel + + -- Children of Cancel Button + local cancelImage = Instance.new "ImageLabel" + cancelImage.Name = "CancelImage" + cancelImage.BackgroundTransparency = 1 + cancelImage.Image = "http://www.roblox.com/asset?id=54135717" + cancelImage.Position = UDim2.new(0, -2, 0, -2) + cancelImage.Size = UDim2.new(0, 16, 0, 16) + cancelImage.ZIndex = 6 + cancelImage.Parent = cancelButton + return setGui end - + local function createSetButton(text) - local setButton = Instance.new("TextButton") - - if text then setButton.Text = text - else setButton.Text = "" end - + local setButton = Instance.new "TextButton" + + if text then + setButton.Text = text + else + setButton.Text = "" + end + setButton.AutoButtonColor = false setButton.BackgroundTransparency = 1 - setButton.BackgroundColor3 = Color3.new(1,1,1) + setButton.BackgroundColor3 = Color3.new(1, 1, 1) setButton.BorderSizePixel = 0 - setButton.Size = UDim2.new(1,-5,0,18) + setButton.Size = UDim2.new(1, -5, 0, 18) setButton.ZIndex = 6 setButton.Visible = false setButton.Font = Enum.Font.Arial setButton.FontSize = Enum.FontSize.Size18 - setButton.TextColor3 = Color3.new(1,1,1) + setButton.TextColor3 = Color3.new(1, 1, 1) setButton.TextXAlignment = Enum.TextXAlignment.Left - + return setButton end - - local function buildSetButton(name, setId, setImageId, i, count) + + local function buildSetButton(name, setId, setImageId, i, count) local button = createSetButton(name) button.Text = name button.Name = "SetButton" button.Visible = true - - local setValue = Instance.new("IntValue") + + local setValue = Instance.new "IntValue" setValue.Name = "SetId" setValue.Value = setId setValue.Parent = button - local setName = Instance.new("StringValue") + local setName = Instance.new "StringValue" setName.Name = "SetName" setName.Value = name setName.Parent = button return button end - + local function processCategory(sets) local setButtons = {} local numSkipped = 0 @@ -2658,56 +2784,58 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, if not showAdminCategories and sets[i].Name == "Beta" then numSkipped = numSkipped + 1 else - setButtons[i - numSkipped] = buildSetButton(sets[i].Name, sets[i].CategoryId, sets[i].ImageAssetId, i - numSkipped, #sets) + setButtons[i - numSkipped] = + buildSetButton(sets[i].Name, sets[i].CategoryId, sets[i].ImageAssetId, i - numSkipped, #sets) end end return setButtons end - + local function handleResize() wait() -- neccessary to insure heartbeat happened - + local itemPreview = setGui.SetPanel.ItemPreview - - itemPreview.LargePreview.Size = UDim2.new(1,0,0,itemPreview.AbsoluteSize.X) - itemPreview.LargePreview.Position = UDim2.new(0.5,-itemPreview.LargePreview.AbsoluteSize.X/2,0,0) - itemPreview.TextPanel.Position = UDim2.new(0,0,0,itemPreview.LargePreview.AbsoluteSize.Y) - itemPreview.TextPanel.Size = UDim2.new(1,0,0,itemPreview.AbsoluteSize.Y - itemPreview.LargePreview.AbsoluteSize.Y) + + itemPreview.LargePreview.Size = UDim2.new(1, 0, 0, itemPreview.AbsoluteSize.X) + itemPreview.LargePreview.Position = UDim2.new(0.5, -itemPreview.LargePreview.AbsoluteSize.X / 2, 0, 0) + itemPreview.TextPanel.Position = UDim2.new(0, 0, 0, itemPreview.LargePreview.AbsoluteSize.Y) + itemPreview.TextPanel.Size = + UDim2.new(1, 0, 0, itemPreview.AbsoluteSize.Y - itemPreview.LargePreview.AbsoluteSize.Y) end - + local function makeInsertAssetButton() - local insertAssetButtonExample = Instance.new("Frame") + local insertAssetButtonExample = Instance.new "Frame" insertAssetButtonExample.Name = "InsertAssetButtonExample" - insertAssetButtonExample.Position = UDim2.new(0,128,0,64) - insertAssetButtonExample.Size = UDim2.new(0,64,0,64) + insertAssetButtonExample.Position = UDim2.new(0, 128, 0, 64) + insertAssetButtonExample.Size = UDim2.new(0, 64, 0, 64) insertAssetButtonExample.BackgroundTransparency = 1 insertAssetButtonExample.ZIndex = 6 insertAssetButtonExample.Visible = false - local assetId = Instance.new("IntValue") + local assetId = Instance.new "IntValue" assetId.Name = "AssetId" assetId.Value = 0 assetId.Parent = insertAssetButtonExample - - local assetName = Instance.new("StringValue") + + local assetName = Instance.new "StringValue" assetName.Name = "AssetName" assetName.Value = "" assetName.Parent = insertAssetButtonExample - local button = Instance.new("TextButton") + local button = Instance.new "TextButton" button.Name = "Button" button.Text = "" button.Style = Enum.ButtonStyle.RobloxButton - button.Position = UDim2.new(0.025,0,0.025,0) - button.Size = UDim2.new(0.95,0,0.95,0) + button.Position = UDim2.new(0.025, 0, 0.025, 0) + button.Size = UDim2.new(0.95, 0, 0.95, 0) button.ZIndex = 6 button.Parent = insertAssetButtonExample - local buttonImage = Instance.new("ImageLabel") + local buttonImage = Instance.new "ImageLabel" buttonImage.Name = "ButtonImage" buttonImage.Image = "" - buttonImage.Position = UDim2.new(0,-7,0,-7) - buttonImage.Size = UDim2.new(1,14,1,14) + buttonImage.Position = UDim2.new(0, -7, 0, -7) + buttonImage.Size = UDim2.new(1, 14, 1, 14) buttonImage.BackgroundTransparency = 1 buttonImage.ZIndex = 7 buttonImage.Parent = button @@ -2715,61 +2843,66 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, local configIcon = buttonImage:clone() configIcon.Name = "ConfigIcon" configIcon.Visible = false - configIcon.Position = UDim2.new(1,-23,1,-24) - configIcon.Size = UDim2.new(0,16,0,16) + configIcon.Position = UDim2.new(1, -23, 1, -24) + configIcon.Size = UDim2.new(0, 16, 0, 16) configIcon.Image = "" configIcon.ZIndex = 6 configIcon.Parent = insertAssetButtonExample - + return insertAssetButtonExample end - + local function showLargePreview(insertButton) - if insertButton:FindFirstChild("AssetId") then - delay(0,function() + if insertButton:FindFirstChild "AssetId" then + delay(0, function() game:GetService("ContentProvider"):Preload(LargeThumbnailUrl .. tostring(insertButton.AssetId.Value)) - setGui.SetPanel.ItemPreview.LargePreview.Image = LargeThumbnailUrl .. tostring(insertButton.AssetId.Value) + setGui.SetPanel.ItemPreview.LargePreview.Image = LargeThumbnailUrl + .. tostring(insertButton.AssetId.Value) end) end - if insertButton:FindFirstChild("AssetName") then + if insertButton:FindFirstChild "AssetName" then setGui.SetPanel.ItemPreview.TextPanel.RolloverText.Text = insertButton.AssetName.Value end end - + local function selectTerrainShape(shape) if currTerrainDropDownFrame then - objectSelected(tostring(currTerrainDropDownFrame.AssetName.Value), tonumber(currTerrainDropDownFrame.AssetId.Value), shape) + objectSelected( + tostring(currTerrainDropDownFrame.AssetName.Value), + tonumber(currTerrainDropDownFrame.AssetId.Value), + shape + ) end end - + local function createTerrainTypeButton(name, parent) - local dropDownTextButton = Instance.new("TextButton") + local dropDownTextButton = Instance.new "TextButton" dropDownTextButton.Name = name .. "Button" dropDownTextButton.Font = Enum.Font.ArialBold dropDownTextButton.FontSize = Enum.FontSize.Size14 dropDownTextButton.BorderSizePixel = 0 - dropDownTextButton.TextColor3 = Color3.new(1,1,1) + dropDownTextButton.TextColor3 = Color3.new(1, 1, 1) dropDownTextButton.Text = name dropDownTextButton.TextXAlignment = Enum.TextXAlignment.Left dropDownTextButton.BackgroundTransparency = 1 dropDownTextButton.ZIndex = parent.ZIndex + 1 - dropDownTextButton.Size = UDim2.new(0,parent.Size.X.Offset - 2,0,16) - dropDownTextButton.Position = UDim2.new(0,1,0,0) + dropDownTextButton.Size = UDim2.new(0, parent.Size.X.Offset - 2, 0, 16) + dropDownTextButton.Position = UDim2.new(0, 1, 0, 0) dropDownTextButton.MouseEnter:connect(function() dropDownTextButton.BackgroundTransparency = 0 - dropDownTextButton.TextColor3 = Color3.new(0,0,0) + dropDownTextButton.TextColor3 = Color3.new(0, 0, 0) end) dropDownTextButton.MouseLeave:connect(function() dropDownTextButton.BackgroundTransparency = 1 - dropDownTextButton.TextColor3 = Color3.new(1,1,1) + dropDownTextButton.TextColor3 = Color3.new(1, 1, 1) end) dropDownTextButton.MouseButton1Click:connect(function() dropDownTextButton.BackgroundTransparency = 1 - dropDownTextButton.TextColor3 = Color3.new(1,1,1) - if dropDownTextButton.Parent and dropDownTextButton.Parent:IsA("GuiObject") then + dropDownTextButton.TextColor3 = Color3.new(1, 1, 1) + if dropDownTextButton.Parent and dropDownTextButton.Parent:IsA "GuiObject" then dropDownTextButton.Parent.Visible = false end selectTerrainShape(terrainShapeMap[dropDownTextButton.Text]) @@ -2777,22 +2910,22 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, return dropDownTextButton end - + local function createTerrainDropDownMenu(zIndex) - local dropDown = Instance.new("Frame") + local dropDown = Instance.new "Frame" dropDown.Name = "TerrainDropDown" - dropDown.BackgroundColor3 = Color3.new(0,0,0) - dropDown.BorderColor3 = Color3.new(1,0,0) - dropDown.Size = UDim2.new(0,200,0,0) + dropDown.BackgroundColor3 = Color3.new(0, 0, 0) + dropDown.BorderColor3 = Color3.new(1, 0, 0) + dropDown.Size = UDim2.new(0, 200, 0, 0) dropDown.Visible = false dropDown.ZIndex = zIndex dropDown.Parent = setGui for i = 1, #terrainShapes do - local shapeButton = createTerrainTypeButton(terrainShapes[i],dropDown) - shapeButton.Position = UDim2.new(0,1,0,(i - 1) * (shapeButton.Size.Y.Offset)) + local shapeButton = createTerrainTypeButton(terrainShapes[i], dropDown) + shapeButton.Position = UDim2.new(0, 1, 0, (i - 1) * shapeButton.Size.Y.Offset) shapeButton.Parent = dropDown - dropDown.Size = UDim2.new(0,200,0,dropDown.Size.Y.Offset + (shapeButton.Size.Y.Offset)) + dropDown.Size = UDim2.new(0, 200, 0, dropDown.Size.Y.Offset + shapeButton.Size.Y.Offset) end dropDown.MouseLeave:connect(function() @@ -2800,28 +2933,27 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, end) end - local function createDropDownMenuButton(parent) - local dropDownButton = Instance.new("ImageButton") + local dropDownButton = Instance.new "ImageButton" dropDownButton.Name = "DropDownButton" dropDownButton.Image = "http://www.roblox.com/asset/?id=67581509" dropDownButton.BackgroundTransparency = 1 - dropDownButton.Size = UDim2.new(0,16,0,16) - dropDownButton.Position = UDim2.new(1,-24,0,6) + dropDownButton.Size = UDim2.new(0, 16, 0, 16) + dropDownButton.Position = UDim2.new(1, -24, 0, 6) dropDownButton.ZIndex = parent.ZIndex + 2 dropDownButton.Parent = parent - - if not setGui:FindFirstChild("TerrainDropDown") then + + if not setGui:FindFirstChild "TerrainDropDown" then createTerrainDropDownMenu(8) end - + dropDownButton.MouseButton1Click:connect(function() setGui.TerrainDropDown.Visible = true - setGui.TerrainDropDown.Position = UDim2.new(0,parent.AbsolutePosition.X,0,parent.AbsolutePosition.Y) + setGui.TerrainDropDown.Position = UDim2.new(0, parent.AbsolutePosition.X, 0, parent.AbsolutePosition.Y) currTerrainDropDownFrame = parent end) end - + local function buildInsertButton() local insertButton = makeInsertAssetButton() insertButton.Name = "InsertAssetButton" @@ -2834,7 +2966,7 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, local lastEnter = nil local mouseEnterCon = insertButton.MouseEnter:connect(function() lastEnter = insertButton - delay(0.1,function() + delay(0.1, function() if lastEnter == insertButton then showLargePreview(insertButton) end @@ -2842,10 +2974,10 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, end) return insertButton, mouseEnterCon end - + local function realignButtonGrid(columns) local x = 0 - local y = 0 + local y = 0 for i = 1, #insertButtons do insertButtons[i].Position = UDim2.new(0, buttonWidth * x, 0, buttonHeight * y) x = x + 1 @@ -2860,17 +2992,19 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, if visible then insertFrame.AssetName.Value = name insertFrame.AssetId.Value = assetId - local newImageUrl = SmallThumbnailUrl .. assetId + local newImageUrl = SmallThumbnailUrl .. assetId if newImageUrl ~= insertFrame.Button.ButtonImage.Image then - delay(0,function() - game:GetService("ContentProvider"):Preload(SmallThumbnailUrl .. assetId) - insertFrame.Button.ButtonImage.Image = SmallThumbnailUrl .. assetId + delay(0, function() + game:GetService("ContentProvider"):Preload(SmallThumbnailUrl .. assetId) + insertFrame.Button.ButtonImage.Image = SmallThumbnailUrl .. assetId end) end - table.insert(insertButtonCons, + table.insert( + insertButtonCons, insertFrame.Button.MouseButton1Click:connect(function() -- special case for water, show water selection gui - local isWaterSelected = (name == "Water") and (Data.Category[Data.CurrentCategory].SetName == "High Scalability") + local isWaterSelected = (name == "Water") + and (Data.Category[Data.CurrentCategory].SetName == "High Scalability") waterGui.Visible = isWaterSelected if isWaterSelected then objectSelected(name, tonumber(assetId), nil) @@ -2884,23 +3018,25 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, insertFrame.Visible = false end end - + local function loadSectionOfItems(setGui, rows, columns) local pageSize = rows * columns - if arrayPosition > #contents then return end + if arrayPosition > #contents then + return + end local origArrayPos = arrayPosition local yCopy = 0 - for i = 1, pageSize + 1 do + for i = 1, pageSize + 1 do if arrayPosition >= #contents + 1 then break end local buttonCon insertButtons[arrayPosition], buttonCon = buildInsertButton() - table.insert(insertButtonCons,buttonCon) + table.insert(insertButtonCons, buttonCon) insertButtons[arrayPosition].Parent = setGui.SetPanel.ItemsFrame arrayPosition = arrayPosition + 1 end @@ -2910,11 +3046,10 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, for index = origArrayPos, arrayPosition do if insertButtons[index] then if contents[index] then - -- we don't want water to have a drop down button if contents[index].Name == "Water" then if Data.Category[Data.CurrentCategory].SetName == "High Scalability" then - insertButtons[index]:FindFirstChild("DropDownButton",true):Destroy() + insertButtons[index]:FindFirstChild("DropDownButton", true):Destroy() end end @@ -2934,12 +3069,12 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, indexCopy = index end end - + local function setSetIndex() Data.Category[Data.CurrentCategory].Index = 0 rows = 7 - columns = math.floor(setGui.SetPanel.ItemsFrame.AbsoluteSize.X/buttonWidth) + columns = math.floor(setGui.SetPanel.ItemsFrame.AbsoluteSize.X / buttonWidth) contents = Data.Category[Data.CurrentCategory].Contents if contents then @@ -2948,7 +3083,9 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, insertButtons[i]:remove() end for i = 1, #insertButtonCons do - if insertButtonCons[i] then insertButtonCons[i]:disconnect() end + if insertButtonCons[i] then + insertButtonCons[i]:disconnect() + end end insertButtonCons = {} insertButtons = {} @@ -2957,7 +3094,7 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, loadSectionOfItems(setGui, rows, columns) end end - + local function selectSet(button, setName, setId, setIndex) if button and Data.Category[Data.CurrentCategory] ~= nil then if button ~= Data.Category[Data.CurrentCategory].Button then @@ -2974,7 +3111,7 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, setSetIndex() end end - + local function selectCategoryPage(buttons, page) if buttons ~= Data.CurrentCategory then if Data.CurrentCategory then @@ -2991,59 +3128,64 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, end else Data.Category[Data.CurrentCategory].Button = nil - selectSet(Data.Category[Data.CurrentCategory].ButtonFrame, Data.Category[Data.CurrentCategory].SetName, Data.Category[Data.CurrentCategory].SetId, Data.Category[Data.CurrentCategory].Index) + selectSet( + Data.Category[Data.CurrentCategory].ButtonFrame, + Data.Category[Data.CurrentCategory].SetName, + Data.Category[Data.CurrentCategory].SetId, + Data.Category[Data.CurrentCategory].Index + ) end end end - + local function selectCategory(category) selectCategoryPage(category, 0) end - + local function resetAllSetButtonSelection() local setButtons = setGui.SetPanel.Sets.SetsLists:GetChildren() for i = 1, #setButtons do - if setButtons[i]:IsA("TextButton") then + if setButtons[i]:IsA "TextButton" then setButtons[i].Selected = false setButtons[i].BackgroundTransparency = 1 - setButtons[i].TextColor3 = Color3.new(1,1,1) - setButtons[i].BackgroundColor3 = Color3.new(1,1,1) + setButtons[i].TextColor3 = Color3.new(1, 1, 1) + setButtons[i].BackgroundColor3 = Color3.new(1, 1, 1) end end end - + local function populateSetsFrame() local currRow = 0 for i = 1, #userCategoryButtons do local button = userCategoryButtons[i] button.Visible = true - button.Position = UDim2.new(0,5,0,currRow * button.Size.Y.Offset) + button.Position = UDim2.new(0, 5, 0, currRow * button.Size.Y.Offset) button.Parent = setGui.SetPanel.Sets.SetsLists - + if i == 1 then -- we will have this selected by default, so show it button.Selected = true - button.BackgroundColor3 = Color3.new(0,204/255,0) - button.TextColor3 = Color3.new(0,0,0) + button.BackgroundColor3 = Color3.new(0, 204 / 255, 0) + button.TextColor3 = Color3.new(0, 0, 0) button.BackgroundTransparency = 0 end button.MouseEnter:connect(function() if not button.Selected then button.BackgroundTransparency = 0 - button.TextColor3 = Color3.new(0,0,0) + button.TextColor3 = Color3.new(0, 0, 0) end end) button.MouseLeave:connect(function() if not button.Selected then button.BackgroundTransparency = 1 - button.TextColor3 = Color3.new(1,1,1) + button.TextColor3 = Color3.new(1, 1, 1) end end) button.MouseButton1Click:connect(function() resetAllSetButtonSelection() button.Selected = not button.Selected - button.BackgroundColor3 = Color3.new(0,204/255,0) - button.TextColor3 = Color3.new(0,0,0) + button.BackgroundColor3 = Color3.new(0, 204 / 255, 0) + button.TextColor3 = Color3.new(0, 0, 0) button.BackgroundTransparency = 0 selectSet(button, button.Text, userCategoryButtons[i].SetId.Value, 0) end) @@ -3051,12 +3193,12 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, currRow = currRow + 1 end - local buttons = setGui.SetPanel.Sets.SetsLists:GetChildren() + local buttons = setGui.SetPanel.Sets.SetsLists:GetChildren() -- set first category as loaded for default if buttons then for i = 1, #buttons do - if buttons[i]:IsA("TextButton") then + if buttons[i]:IsA "TextButton" then selectSet(buttons[i], buttons[i].Text, userCategoryButtons[i].SetId.Value, 0) selectCategory(userCategoryButtons) break @@ -3067,7 +3209,7 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, setGui = createSetGui() waterGui, waterTypeChangedEvent = createWaterGui() - waterGui.Position = UDim2.new(0,55,0,0) + waterGui.Position = UDim2.new(0, 55, 0, 0) waterGui.Parent = setGui setGui.Changed:connect(function(prop) -- this resizes the preview image to always be the right size if prop == "AbsoluteSize" then @@ -3075,16 +3217,16 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, setSetIndex() end end) - + local scrollFrame, controlFrame = t.CreateTrueScrollingFrame() - scrollFrame.Size = UDim2.new(0.54,0,0.85,0) - scrollFrame.Position = UDim2.new(0.24,0,0.085,0) + scrollFrame.Size = UDim2.new(0.54, 0, 0.85, 0) + scrollFrame.Position = UDim2.new(0.24, 0, 0.085, 0) scrollFrame.Name = "ItemsFrame" scrollFrame.ZIndex = 6 scrollFrame.Parent = setGui.SetPanel scrollFrame.BackgroundTransparency = 1 - drillDownSetZIndex(controlFrame,7) + drillDownSetZIndex(controlFrame, 7) controlFrame.Parent = setGui.SetPanel controlFrame.Position = UDim2.new(0.76, 5, 0, 0) @@ -3092,9 +3234,11 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, local debounce = false controlFrame.ScrollBottom.Changed:connect(function(prop) if controlFrame.ScrollBottom.Value == true then - if debounce then return end + if debounce then + return + end debounce = true - loadSectionOfItems(setGui, rows, columns) + loadSectionOfItems(setGui, rows, columns) debounce = false end end) @@ -3106,28 +3250,29 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, -- start at #3 to skip over My Decals and My Models for each account for category = 3, #newUserData do if newUserData[category].Name == "High Scalability" then -- we want high scalability parts to show first - table.insert(userData,1,newUserData[category]) + table.insert(userData, 1, newUserData[category]) else table.insert(userData, newUserData[category]) end end end - end if userData then userCategoryButtons = processCategory(userData) end - rows = math.floor(setGui.SetPanel.ItemsFrame.AbsoluteSize.Y/buttonHeight) - columns = math.floor(setGui.SetPanel.ItemsFrame.AbsoluteSize.X/buttonWidth) + rows = math.floor(setGui.SetPanel.ItemsFrame.AbsoluteSize.Y / buttonHeight) + columns = math.floor(setGui.SetPanel.ItemsFrame.AbsoluteSize.X / buttonWidth) populateSetsFrame() insertPanelCloseCon = setGui.SetPanel.CancelButton.MouseButton1Click:connect(function() setGui.SetPanel.Visible = false - if dialogClosed then dialogClosed() end + if dialogClosed then + dialogClosed() + end end) - + local setVisibilityFunction = function(visible) if visible then setGui.SetPanel.Visible = true @@ -3135,27 +3280,27 @@ t.CreateSetPanel = function(userIdsForSets, objectSelected, dialogClosed, size, setGui.SetPanel.Visible = false end end - + local getVisibilityFunction = function() if setGui then - if setGui:FindFirstChild("SetPanel") then + if setGui:FindFirstChild "SetPanel" then return setGui.SetPanel.Visible end end - + return false end - + return setGui, setVisibilityFunction, getVisibilityFunction, waterTypeChangedEvent end -t.CreateTerrainMaterialSelector = function(size,position) - local terrainMaterialSelectionChanged = Instance.new("BindableEvent") +t.CreateTerrainMaterialSelector = function(size, position) + local terrainMaterialSelectionChanged = Instance.new "BindableEvent" terrainMaterialSelectionChanged.Name = "TerrainMaterialSelectionChanged" local selectedButton = nil - local frame = Instance.new("Frame") + local frame = Instance.new "Frame" frame.Name = "TerrainMaterialSelector" if size then frame.Size = size @@ -3166,7 +3311,7 @@ t.CreateTerrainMaterialSelector = function(size,position) frame.Position = position end frame.BorderSizePixel = 0 - frame.BackgroundColor3 = Color3.new(0,0,0) + frame.BackgroundColor3 = Color3.new(0, 0, 0) frame.Active = true terrainMaterialSelectionChanged.Parent = frame @@ -3174,57 +3319,145 @@ t.CreateTerrainMaterialSelector = function(size,position) local waterEnabled = true -- todo: turn this on when water is ready local materialToImageMap = {} - local materialNames = {"Grass", "Sand", "Brick", "Granite", "Asphalt", "Iron", "Aluminum", "Gold", "Plank", "Log", "Gravel", "Cinder Block", "Stone Wall", "Concrete", "Plastic (red)", "Plastic (blue)"} + local materialNames = { + "Grass", + "Sand", + "Brick", + "Granite", + "Asphalt", + "Iron", + "Aluminum", + "Gold", + "Plank", + "Log", + "Gravel", + "Cinder Block", + "Stone Wall", + "Concrete", + "Plastic (red)", + "Plastic (blue)", + } if waterEnabled then - table.insert(materialNames,"Water") + table.insert(materialNames, "Water") end local currentMaterial = 1 function getEnumFromName(choice) - if choice == "Grass" then return 1 end - if choice == "Sand" then return 2 end - if choice == "Erase" then return 0 end - if choice == "Brick" then return 3 end - if choice == "Granite" then return 4 end - if choice == "Asphalt" then return 5 end - if choice == "Iron" then return 6 end - if choice == "Aluminum" then return 7 end - if choice == "Gold" then return 8 end - if choice == "Plank" then return 9 end - if choice == "Log" then return 10 end - if choice == "Gravel" then return 11 end - if choice == "Cinder Block" then return 12 end - if choice == "Stone Wall" then return 13 end - if choice == "Concrete" then return 14 end - if choice == "Plastic (red)" then return 15 end - if choice == "Plastic (blue)" then return 16 end - if choice == "Water" then return 17 end - end - - function getNameFromEnum(choice) - if choice == Enum.CellMaterial.Grass or choice == 1 then return "Grass"end - if choice == Enum.CellMaterial.Sand or choice == 2 then return "Sand" end - if choice == Enum.CellMaterial.Empty or choice == 0 then return "Erase" end - if choice == Enum.CellMaterial.Brick or choice == 3 then return "Brick" end - if choice == Enum.CellMaterial.Granite or choice == 4 then return "Granite" end - if choice == Enum.CellMaterial.Asphalt or choice == 5 then return "Asphalt" end - if choice == Enum.CellMaterial.Iron or choice == 6 then return "Iron" end - if choice == Enum.CellMaterial.Aluminum or choice == 7 then return "Aluminum" end - if choice == Enum.CellMaterial.Gold or choice == 8 then return "Gold" end - if choice == Enum.CellMaterial.WoodPlank or choice == 9 then return "Plank" end - if choice == Enum.CellMaterial.WoodLog or choice == 10 then return "Log" end - if choice == Enum.CellMaterial.Gravel or choice == 11 then return "Gravel" end - if choice == Enum.CellMaterial.CinderBlock or choice == 12 then return "Cinder Block" end - if choice == Enum.CellMaterial.MossyStone or choice == 13 then return "Stone Wall" end - if choice == Enum.CellMaterial.Cement or choice == 14 then return "Concrete" end - if choice == Enum.CellMaterial.RedPlastic or choice == 15 then return "Plastic (red)" end - if choice == Enum.CellMaterial.BluePlastic or choice == 16 then return "Plastic (blue)" end - - if waterEnabled then - if choice == Enum.CellMaterial.Water or choice == 17 then return "Water" end + if choice == "Grass" then + return 1 + end + if choice == "Sand" then + return 2 + end + if choice == "Erase" then + return 0 + end + if choice == "Brick" then + return 3 + end + if choice == "Granite" then + return 4 + end + if choice == "Asphalt" then + return 5 + end + if choice == "Iron" then + return 6 + end + if choice == "Aluminum" then + return 7 + end + if choice == "Gold" then + return 8 + end + if choice == "Plank" then + return 9 + end + if choice == "Log" then + return 10 + end + if choice == "Gravel" then + return 11 + end + if choice == "Cinder Block" then + return 12 + end + if choice == "Stone Wall" then + return 13 + end + if choice == "Concrete" then + return 14 + end + if choice == "Plastic (red)" then + return 15 + end + if choice == "Plastic (blue)" then + return 16 + end + if choice == "Water" then + return 17 end end + function getNameFromEnum(choice) + if choice == Enum.CellMaterial.Grass or choice == 1 then + return "Grass" + end + if choice == Enum.CellMaterial.Sand or choice == 2 then + return "Sand" + end + if choice == Enum.CellMaterial.Empty or choice == 0 then + return "Erase" + end + if choice == Enum.CellMaterial.Brick or choice == 3 then + return "Brick" + end + if choice == Enum.CellMaterial.Granite or choice == 4 then + return "Granite" + end + if choice == Enum.CellMaterial.Asphalt or choice == 5 then + return "Asphalt" + end + if choice == Enum.CellMaterial.Iron or choice == 6 then + return "Iron" + end + if choice == Enum.CellMaterial.Aluminum or choice == 7 then + return "Aluminum" + end + if choice == Enum.CellMaterial.Gold or choice == 8 then + return "Gold" + end + if choice == Enum.CellMaterial.WoodPlank or choice == 9 then + return "Plank" + end + if choice == Enum.CellMaterial.WoodLog or choice == 10 then + return "Log" + end + if choice == Enum.CellMaterial.Gravel or choice == 11 then + return "Gravel" + end + if choice == Enum.CellMaterial.CinderBlock or choice == 12 then + return "Cinder Block" + end + if choice == Enum.CellMaterial.MossyStone or choice == 13 then + return "Stone Wall" + end + if choice == Enum.CellMaterial.Cement or choice == 14 then + return "Concrete" + end + if choice == Enum.CellMaterial.RedPlastic or choice == 15 then + return "Plastic (red)" + end + if choice == Enum.CellMaterial.BluePlastic or choice == 16 then + return "Plastic (blue)" + end + + if waterEnabled then + if choice == Enum.CellMaterial.Water or choice == 17 then + return "Water" + end + end + end local function updateMaterialChoice(choice) currentMaterial = getEnumFromName(choice) @@ -3232,41 +3465,59 @@ t.CreateTerrainMaterialSelector = function(size,position) end -- we so need a better way to do this - for i,v in pairs(materialNames) do + for i, v in pairs(materialNames) do materialToImageMap[v] = {} - if v == "Grass" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=56563112" - elseif v == "Sand" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=62356652" - elseif v == "Brick" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=65961537" - elseif v == "Granite" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532153" - elseif v == "Asphalt" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532038" - elseif v == "Iron" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532093" - elseif v == "Aluminum" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67531995" - elseif v == "Gold" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532118" - elseif v == "Plastic (red)" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67531848" - elseif v == "Plastic (blue)" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67531924" - elseif v == "Plank" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532015" - elseif v == "Log" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532051" - elseif v == "Gravel" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532206" - elseif v == "Cinder Block" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532103" - elseif v == "Stone Wall" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67531804" - elseif v == "Concrete" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532059" - elseif v == "Water" then materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=81407474" - else materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=66887593" -- fill in the rest here!! + if v == "Grass" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=56563112" + elseif v == "Sand" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=62356652" + elseif v == "Brick" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=65961537" + elseif v == "Granite" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532153" + elseif v == "Asphalt" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532038" + elseif v == "Iron" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532093" + elseif v == "Aluminum" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67531995" + elseif v == "Gold" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532118" + elseif v == "Plastic (red)" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67531848" + elseif v == "Plastic (blue)" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67531924" + elseif v == "Plank" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532015" + elseif v == "Log" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532051" + elseif v == "Gravel" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532206" + elseif v == "Cinder Block" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532103" + elseif v == "Stone Wall" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67531804" + elseif v == "Concrete" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=67532059" + elseif v == "Water" then + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=81407474" + else + materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=66887593" -- fill in the rest here!! end end - local scrollFrame, scrollUp, scrollDown, recalculateScroll = t.CreateScrollingFrame(nil,"grid") - scrollFrame.Size = UDim2.new(0.85,0,1,0) - scrollFrame.Position = UDim2.new(0,0,0,0) + local scrollFrame, scrollUp, scrollDown, recalculateScroll = t.CreateScrollingFrame(nil, "grid") + scrollFrame.Size = UDim2.new(0.85, 0, 1, 0) + scrollFrame.Position = UDim2.new(0, 0, 0, 0) scrollFrame.Parent = frame scrollUp.Parent = frame scrollUp.Visible = true - scrollUp.Position = UDim2.new(1,-19,0,0) + scrollUp.Position = UDim2.new(1, -19, 0, 0) scrollDown.Parent = frame scrollDown.Visible = true - scrollDown.Position = UDim2.new(1,-19,1,-17) + scrollDown.Position = UDim2.new(1, -19, 1, -17) local function goToNewMaterial(buttonWrap, materialName) updateMaterialChoice(materialName) @@ -3275,30 +3526,30 @@ t.CreateTerrainMaterialSelector = function(size,position) selectedButton = buttonWrap end - local function createMaterialButton(name) - local buttonWrap = Instance.new("TextButton") + local function createMaterialButton(name) + local buttonWrap = Instance.new "TextButton" buttonWrap.Text = "" - buttonWrap.Size = UDim2.new(0,32,0,32) - buttonWrap.BackgroundColor3 = Color3.new(1,1,1) + buttonWrap.Size = UDim2.new(0, 32, 0, 32) + buttonWrap.BackgroundColor3 = Color3.new(1, 1, 1) buttonWrap.BorderSizePixel = 0 buttonWrap.BackgroundTransparency = 1 buttonWrap.AutoButtonColor = false buttonWrap.Name = tostring(name) - - local imageButton = Instance.new("ImageButton") + + local imageButton = Instance.new "ImageButton" imageButton.AutoButtonColor = false imageButton.BackgroundTransparency = 1 - imageButton.Size = UDim2.new(0,30,0,30) - imageButton.Position = UDim2.new(0,1,0,1) + imageButton.Size = UDim2.new(0, 30, 0, 30) + imageButton.Position = UDim2.new(0, 1, 0, 1) imageButton.Name = tostring(name) imageButton.Parent = buttonWrap imageButton.Image = materialToImageMap[name].Regular - local enumType = Instance.new("NumberValue") + local enumType = Instance.new "NumberValue" enumType.Name = "EnumType" enumType.Parent = buttonWrap enumType.Value = 0 - + imageButton.MouseEnter:connect(function() buttonWrap.BackgroundTransparency = 0 end) @@ -3312,38 +3563,48 @@ t.CreateTerrainMaterialSelector = function(size,position) goToNewMaterial(buttonWrap, tostring(name)) end end) - - return buttonWrap + + return buttonWrap end for i = 1, #materialNames do local imageButton = createMaterialButton(materialNames[i]) - + if materialNames[i] == "Grass" then -- always start with grass as the default selectedButton = imageButton imageButton.BackgroundTransparency = 0 end - + imageButton.Parent = scrollFrame end local forceTerrainMaterialSelection = function(newMaterialType) - if not newMaterialType then return end - if currentMaterial == newMaterialType then return end + if not newMaterialType then + return + end + if currentMaterial == newMaterialType then + return + end local matName = getNameFromEnum(newMaterialType) local buttons = scrollFrame:GetChildren() for i = 1, #buttons do - if buttons[i].Name == "Plastic (blue)" and matName == "Plastic (blue)" then goToNewMaterial(buttons[i],matName) return end - if buttons[i].Name == "Plastic (red)" and matName == "Plastic (red)" then goToNewMaterial(buttons[i],matName) return end + if buttons[i].Name == "Plastic (blue)" and matName == "Plastic (blue)" then + goToNewMaterial(buttons[i], matName) + return + end + if buttons[i].Name == "Plastic (red)" and matName == "Plastic (red)" then + goToNewMaterial(buttons[i], matName) + return + end if string.find(buttons[i].Name, matName) then - goToNewMaterial(buttons[i],matName) + goToNewMaterial(buttons[i], matName) return end end end - frame.Changed:connect(function ( prop ) + frame.Changed:connect(function(prop) if prop == "AbsoluteSize" then recalculateScroll() end @@ -3353,69 +3614,75 @@ t.CreateTerrainMaterialSelector = function(size,position) return frame, terrainMaterialSelectionChanged, forceTerrainMaterialSelection end -t.CreateLoadingFrame = function(name,size,position) - game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=35238053") +t.CreateLoadingFrame = function(name, size, position) + game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=35238053" - local loadingFrame = Instance.new("Frame") + local loadingFrame = Instance.new "Frame" loadingFrame.Name = "LoadingFrame" loadingFrame.Style = Enum.FrameStyle.RobloxRound - if size then loadingFrame.Size = size - else loadingFrame.Size = UDim2.new(0,300,0,160) end - if position then loadingFrame.Position = position - else loadingFrame.Position = UDim2.new(0.5, -150, 0.5,-80) end + if size then + loadingFrame.Size = size + else + loadingFrame.Size = UDim2.new(0, 300, 0, 160) + end + if position then + loadingFrame.Position = position + else + loadingFrame.Position = UDim2.new(0.5, -150, 0.5, -80) + end - local loadingBar = Instance.new("Frame") + local loadingBar = Instance.new "Frame" loadingBar.Name = "LoadingBar" - loadingBar.BackgroundColor3 = Color3.new(0,0,0) - loadingBar.BorderColor3 = Color3.new(79/255,79/255,79/255) - loadingBar.Position = UDim2.new(0,0,0,41) - loadingBar.Size = UDim2.new(1,0,0,30) + loadingBar.BackgroundColor3 = Color3.new(0, 0, 0) + loadingBar.BorderColor3 = Color3.new(79 / 255, 79 / 255, 79 / 255) + loadingBar.Position = UDim2.new(0, 0, 0, 41) + loadingBar.Size = UDim2.new(1, 0, 0, 30) loadingBar.Parent = loadingFrame - local loadingGreenBar = Instance.new("ImageLabel") - loadingGreenBar.Name = "LoadingGreenBar" - loadingGreenBar.Image = "http://www.roblox.com/asset/?id=35238053" - loadingGreenBar.Position = UDim2.new(0,0,0,0) - loadingGreenBar.Size = UDim2.new(0,0,1,0) - loadingGreenBar.Visible = false - loadingGreenBar.Parent = loadingBar + local loadingGreenBar = Instance.new "ImageLabel" + loadingGreenBar.Name = "LoadingGreenBar" + loadingGreenBar.Image = "http://www.roblox.com/asset/?id=35238053" + loadingGreenBar.Position = UDim2.new(0, 0, 0, 0) + loadingGreenBar.Size = UDim2.new(0, 0, 1, 0) + loadingGreenBar.Visible = false + loadingGreenBar.Parent = loadingBar - local loadingPercent = Instance.new("TextLabel") - loadingPercent.Name = "LoadingPercent" - loadingPercent.BackgroundTransparency = 1 - loadingPercent.Position = UDim2.new(0,0,1,0) - loadingPercent.Size = UDim2.new(1,0,0,14) - loadingPercent.Font = Enum.Font.Arial - loadingPercent.Text = "0%" - loadingPercent.FontSize = Enum.FontSize.Size14 - loadingPercent.TextColor3 = Color3.new(1,1,1) - loadingPercent.Parent = loadingBar + local loadingPercent = Instance.new "TextLabel" + loadingPercent.Name = "LoadingPercent" + loadingPercent.BackgroundTransparency = 1 + loadingPercent.Position = UDim2.new(0, 0, 1, 0) + loadingPercent.Size = UDim2.new(1, 0, 0, 14) + loadingPercent.Font = Enum.Font.Arial + loadingPercent.Text = "0%" + loadingPercent.FontSize = Enum.FontSize.Size14 + loadingPercent.TextColor3 = Color3.new(1, 1, 1) + loadingPercent.Parent = loadingBar - local cancelButton = Instance.new("TextButton") + local cancelButton = Instance.new "TextButton" cancelButton.Name = "CancelButton" - cancelButton.Position = UDim2.new(0.5,-60,1,-40) - cancelButton.Size = UDim2.new(0,120,0,40) + cancelButton.Position = UDim2.new(0.5, -60, 1, -40) + cancelButton.Size = UDim2.new(0, 120, 0, 40) cancelButton.Font = Enum.Font.Arial cancelButton.FontSize = Enum.FontSize.Size18 - cancelButton.TextColor3 = Color3.new(1,1,1) + cancelButton.TextColor3 = Color3.new(1, 1, 1) cancelButton.Text = "Cancel" cancelButton.Style = Enum.ButtonStyle.RobloxButton cancelButton.Parent = loadingFrame - local loadingName = Instance.new("TextLabel") + local loadingName = Instance.new "TextLabel" loadingName.Name = "loadingName" loadingName.BackgroundTransparency = 1 - loadingName.Size = UDim2.new(1,0,0,18) - loadingName.Position = UDim2.new(0,0,0,2) + loadingName.Size = UDim2.new(1, 0, 0, 18) + loadingName.Position = UDim2.new(0, 0, 0, 2) loadingName.Font = Enum.Font.Arial loadingName.Text = name - loadingName.TextColor3 = Color3.new(1,1,1) + loadingName.TextColor3 = Color3.new(1, 1, 1) loadingName.TextStrokeTransparency = 1 loadingName.FontSize = Enum.FontSize.Size18 loadingName.Parent = loadingFrame - local cancelButtonClicked = Instance.new("BindableEvent") + local cancelButtonClicked = Instance.new "BindableEvent" cancelButtonClicked.Name = "CancelButtonClicked" cancelButtonClicked.Parent = cancelButton cancelButton.MouseButton1Click:connect(function() @@ -3424,43 +3691,40 @@ t.CreateLoadingFrame = function(name,size,position) local updateLoadingGuiPercent = function(percent, tweenAction, tweenLength) if percent and type(percent) ~= "number" then - error("updateLoadingGuiPercent expects number as argument, got",type(percent),"instead") + error("updateLoadingGuiPercent expects number as argument, got", type(percent), "instead") end local newSize = nil if percent < 0 then - newSize = UDim2.new(0,0,1,0) + newSize = UDim2.new(0, 0, 1, 0) elseif percent > 1 then - newSize = UDim2.new(1,0,1,0) + newSize = UDim2.new(1, 0, 1, 0) else - newSize = UDim2.new(percent,0,1,0) + newSize = UDim2.new(percent, 0, 1, 0) end if tweenAction then if not tweenLength then - error("updateLoadingGuiPercent is set to tween new percentage, but got no tween time length! Please pass this in as third argument") + error "updateLoadingGuiPercent is set to tween new percentage, but got no tween time length! Please pass this in as third argument" end - if (newSize.X.Scale > 0) then + if newSize.X.Scale > 0 then loadingGreenBar.Visible = true - loadingGreenBar:TweenSize( newSize, - Enum.EasingDirection.Out, - Enum.EasingStyle.Quad, - tweenLength, - true) + loadingGreenBar:TweenSize(newSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenLength, true) else - loadingGreenBar:TweenSize( newSize, - Enum.EasingDirection.Out, - Enum.EasingStyle.Quad, - tweenLength, - true, - function() - if (newSize.X.Scale < 0) then - loadingGreenBar.Visible = false - end - end) + loadingGreenBar:TweenSize( + newSize, + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + tweenLength, + true, + function() + if newSize.X.Scale < 0 then + loadingGreenBar.Visible = false + end + end + ) end - else loadingGreenBar.Size = newSize loadingGreenBar.Visible = (newSize.X.Scale > 0) @@ -3469,16 +3733,16 @@ t.CreateLoadingFrame = function(name,size,position) loadingGreenBar.Changed:connect(function(prop) if prop == "Size" then - loadingPercent.Text = tostring( math.ceil(loadingGreenBar.Size.X.Scale * 100) ) .. "%" + loadingPercent.Text = tostring(math.ceil(loadingGreenBar.Size.X.Scale * 100)) .. "%" end end) return loadingFrame, updateLoadingGuiPercent, cancelButtonClicked end -t.CreatePluginFrame = function (name,size,position,scrollable,parent) - function createMenuButton(size,position,text,fontsize,name,parent) - local button = Instance.new("TextButton",parent) +t.CreatePluginFrame = function(name, size, position, scrollable, parent) + function createMenuButton(size, position, text, fontsize, name, parent) + local button = Instance.new "TextButton" button.AutoButtonColor = false button.Name = name button.BackgroundTransparency = 1 @@ -3486,32 +3750,37 @@ t.CreatePluginFrame = function (name,size,position,scrollable,parent) button.Size = size button.Font = Enum.Font.ArialBold button.FontSize = fontsize - button.Text = text - button.TextColor3 = Color3.new(1,1,1) + button.Text = text + button.TextColor3 = Color3.new(1, 1, 1) button.BorderSizePixel = 0 - button.BackgroundColor3 = Color3.new(20/255,20/255,20/255) + button.BackgroundColor3 = Color3.new(20 / 255, 20 / 255, 20 / 255) - button.MouseEnter:connect(function ( ) - if button.Selected then return end + button.MouseEnter:connect(function() + if button.Selected then + return + end button.BackgroundTransparency = 0 end) - button.MouseLeave:connect(function ( ) - if button.Selected then return end + button.MouseLeave:connect(function() + if button.Selected then + return + end button.BackgroundTransparency = 1 end) - return button + button.Parent = parent + return button end - local dragBar = Instance.new("Frame",parent) + local dragBar = Instance.new "Frame" dragBar.Name = tostring(name) .. "DragBar" - dragBar.BackgroundColor3 = Color3.new(39/255,39/255,39/255) - dragBar.BorderColor3 = Color3.new(0,0,0) + dragBar.BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255) + dragBar.BorderColor3 = Color3.new(0, 0, 0) if size then - dragBar.Size = UDim2.new(size.X.Scale,size.X.Offset,0,20) + UDim2.new(0,20,0,0) + dragBar.Size = UDim2.new(size.X.Scale, size.X.Offset, 0, 20) + UDim2.new(0, 20, 0, 0) else - dragBar.Size = UDim2.new(0,183,0,20) + dragBar.Size = UDim2.new(0, 183, 0, 20) end if position then dragBar.Position = position @@ -3519,47 +3788,64 @@ t.CreatePluginFrame = function (name,size,position,scrollable,parent) dragBar.Active = true dragBar.Draggable = true --dragBar.Visible = false - dragBar.MouseEnter:connect(function ( ) - dragBar.BackgroundColor3 = Color3.new(49/255,49/255,49/255) + dragBar.MouseEnter:connect(function() + dragBar.BackgroundColor3 = Color3.new(49 / 255, 49 / 255, 49 / 255) end) - dragBar.MouseLeave:connect(function ( ) - dragBar.BackgroundColor3 = Color3.new(39/255,39/255,39/255) + dragBar.MouseLeave:connect(function() + dragBar.BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255) end) + dragBar.Parent = parent -- plugin name label - local pluginNameLabel = Instance.new("TextLabel",dragBar) + local pluginNameLabel = Instance.new "TextLabel" pluginNameLabel.Name = "BarNameLabel" pluginNameLabel.Text = " " .. tostring(name) - pluginNameLabel.TextColor3 = Color3.new(1,1,1) + pluginNameLabel.TextColor3 = Color3.new(1, 1, 1) pluginNameLabel.TextStrokeTransparency = 0 - pluginNameLabel.Size = UDim2.new(1,0,1,0) + pluginNameLabel.Size = UDim2.new(1, 0, 1, 0) pluginNameLabel.Font = Enum.Font.ArialBold pluginNameLabel.FontSize = Enum.FontSize.Size18 pluginNameLabel.TextXAlignment = Enum.TextXAlignment.Left pluginNameLabel.BackgroundTransparency = 1 + pluginNameLabel.Parent = dragBar -- close button - local closeButton = createMenuButton(UDim2.new(0,15,0,17),UDim2.new(1,-16,0.5,-8),"X",Enum.FontSize.Size14,"CloseButton",dragBar) - local closeEvent = Instance.new("BindableEvent") + local closeButton = createMenuButton( + UDim2.new(0, 15, 0, 17), + UDim2.new(1, -16, 0.5, -8), + "X", + Enum.FontSize.Size14, + "CloseButton", + dragBar + ) + local closeEvent = Instance.new "BindableEvent" closeEvent.Name = "CloseEvent" closeEvent.Parent = closeButton - closeButton.MouseButton1Click:connect(function () + closeButton.MouseButton1Click:connect(function() closeEvent:Fire() closeButton.BackgroundTransparency = 1 end) -- help button - local helpButton = createMenuButton(UDim2.new(0,15,0,17),UDim2.new(1,-51,0.5,-8),"?",Enum.FontSize.Size14,"HelpButton",dragBar) - local helpFrame = Instance.new("Frame",dragBar) + local helpButton = createMenuButton( + UDim2.new(0, 15, 0, 17), + UDim2.new(1, -51, 0.5, -8), + "?", + Enum.FontSize.Size14, + "HelpButton", + dragBar + ) + local helpFrame = Instance.new "Frame" helpFrame.Name = "HelpFrame" - helpFrame.BackgroundColor3 = Color3.new(0,0,0) - helpFrame.Size = UDim2.new(0,300,0,552) - helpFrame.Position = UDim2.new(1,5,0,0) + helpFrame.BackgroundColor3 = Color3.new(0, 0, 0) + helpFrame.Size = UDim2.new(0, 300, 0, 552) + helpFrame.Position = UDim2.new(1, 5, 0, 0) helpFrame.Active = true helpFrame.BorderSizePixel = 0 helpFrame.Visible = false + helpFrame.Parent = dragBar - helpButton.MouseButton1Click:connect(function( ) + helpButton.MouseButton1Click:connect(function() helpFrame.Visible = not helpFrame.Visible if helpFrame.Visible then helpButton.Selected = true @@ -3567,12 +3853,12 @@ t.CreatePluginFrame = function (name,size,position,scrollable,parent) local screenGui = getScreenGuiAncestor(helpFrame) if screenGui then if helpFrame.AbsolutePosition.X + helpFrame.AbsoluteSize.X > screenGui.AbsoluteSize.X then --position on left hand side - helpFrame.Position = UDim2.new(0,-5 - helpFrame.AbsoluteSize.X,0,0) + helpFrame.Position = UDim2.new(0, -5 - helpFrame.AbsoluteSize.X, 0, 0) else -- position on right hand side - helpFrame.Position = UDim2.new(1,5,0,0) + helpFrame.Position = UDim2.new(1, 5, 0, 0) end else - helpFrame.Position = UDim2.new(1,5,0,0) + helpFrame.Position = UDim2.new(1, 5, 0, 0) end else helpButton.Selected = false @@ -3580,151 +3866,168 @@ t.CreatePluginFrame = function (name,size,position,scrollable,parent) end end) - local minimizeButton = createMenuButton(UDim2.new(0,16,0,17),UDim2.new(1,-34,0.5,-8),"-",Enum.FontSize.Size14,"MinimizeButton",dragBar) + local minimizeButton = createMenuButton( + UDim2.new(0, 16, 0, 17), + UDim2.new(1, -34, 0.5, -8), + "-", + Enum.FontSize.Size14, + "MinimizeButton", + dragBar + ) minimizeButton.TextYAlignment = Enum.TextYAlignment.Top - local minimizeFrame = Instance.new("Frame",dragBar) + local minimizeFrame = Instance.new "Frame" minimizeFrame.Name = "MinimizeFrame" - minimizeFrame.BackgroundColor3 = Color3.new(73/255,73/255,73/255) - minimizeFrame.BorderColor3 = Color3.new(0,0,0) - minimizeFrame.Position = UDim2.new(0,0,1,0) + minimizeFrame.BackgroundColor3 = Color3.new(73 / 255, 73 / 255, 73 / 255) + minimizeFrame.BorderColor3 = Color3.new(0, 0, 0) + minimizeFrame.Position = UDim2.new(0, 0, 1, 0) if size then - minimizeFrame.Size = UDim2.new(size.X.Scale,size.X.Offset,0,50) + UDim2.new(0,20,0,0) + minimizeFrame.Size = UDim2.new(size.X.Scale, size.X.Offset, 0, 50) + UDim2.new(0, 20, 0, 0) else - minimizeFrame.Size = UDim2.new(0,183,0,50) + minimizeFrame.Size = UDim2.new(0, 183, 0, 50) end minimizeFrame.Visible = false + minimizeFrame.Parent = dragBar - local minimizeBigButton = Instance.new("TextButton",minimizeFrame) - minimizeBigButton.Position = UDim2.new(0.5,-50,0.5,-20) + local minimizeBigButton = Instance.new "TextButton" + minimizeBigButton.Position = UDim2.new(0.5, -50, 0.5, -20) minimizeBigButton.Name = "MinimizeButton" - minimizeBigButton.Size = UDim2.new(0,100,0,40) + minimizeBigButton.Size = UDim2.new(0, 100, 0, 40) minimizeBigButton.Style = Enum.ButtonStyle.RobloxButton minimizeBigButton.Font = Enum.Font.ArialBold minimizeBigButton.FontSize = Enum.FontSize.Size18 - minimizeBigButton.TextColor3 = Color3.new(1,1,1) + minimizeBigButton.TextColor3 = Color3.new(1, 1, 1) minimizeBigButton.Text = "Show" + minimizeBigButton.Parent = minimizeFrame - local separatingLine = Instance.new("Frame",dragBar) + local separatingLine = Instance.new "Frame" separatingLine.Name = "SeparatingLine" - separatingLine.BackgroundColor3 = Color3.new(115/255,115/255,115/255) + separatingLine.BackgroundColor3 = Color3.new(115 / 255, 115 / 255, 115 / 255) separatingLine.BorderSizePixel = 0 - separatingLine.Position = UDim2.new(1,-18,0.5,-7) - separatingLine.Size = UDim2.new(0,1,0,14) + separatingLine.Position = UDim2.new(1, -18, 0.5, -7) + separatingLine.Size = UDim2.new(0, 1, 0, 14) + separatingLine.Parent = dragBar local otherSeparatingLine = separatingLine:clone() - otherSeparatingLine.Position = UDim2.new(1,-35,0.5,-7) + otherSeparatingLine.Position = UDim2.new(1, -35, 0.5, -7) otherSeparatingLine.Parent = dragBar - local widgetContainer = Instance.new("Frame",dragBar) + local widgetContainer = Instance.new "Frame" widgetContainer.Name = "WidgetContainer" widgetContainer.BackgroundTransparency = 1 - widgetContainer.Position = UDim2.new(0,0,1,0) - widgetContainer.BorderColor3 = Color3.new(0,0,0) + widgetContainer.Position = UDim2.new(0, 0, 1, 0) + widgetContainer.BorderColor3 = Color3.new(0, 0, 0) if not scrollable then widgetContainer.BackgroundTransparency = 0 - widgetContainer.BackgroundColor3 = Color3.new(72/255,72/255,72/255) + widgetContainer.BackgroundColor3 = Color3.new(72 / 255, 72 / 255, 72 / 255) end + widgetContainer.Parent = dragBar if size then if scrollable then widgetContainer.Size = size else - widgetContainer.Size = UDim2.new(0,dragBar.AbsoluteSize.X,size.Y.Scale,size.Y.Offset) + widgetContainer.Size = UDim2.new(0, dragBar.AbsoluteSize.X, size.Y.Scale, size.Y.Offset) end else if scrollable then - widgetContainer.Size = UDim2.new(0,163,0,400) + widgetContainer.Size = UDim2.new(0, 163, 0, 400) else - widgetContainer.Size = UDim2.new(0,dragBar.AbsoluteSize.X,0,400) + widgetContainer.Size = UDim2.new(0, dragBar.AbsoluteSize.X, 0, 400) end end if position then - widgetContainer.Position = position + UDim2.new(0,0,0,20) + widgetContainer.Position = position + UDim2.new(0, 0, 0, 20) end - local frame,control,verticalDragger = nil + local frame, control, verticalDragger = nil if scrollable then --frame for widgets - frame,control = t.CreateTrueScrollingFrame() + frame, control = t.CreateTrueScrollingFrame() frame.Size = UDim2.new(1, 0, 1, 0) - frame.BackgroundColor3 = Color3.new(72/255,72/255,72/255) - frame.BorderColor3 = Color3.new(0,0,0) + frame.BackgroundColor3 = Color3.new(72 / 255, 72 / 255, 72 / 255) + frame.BorderColor3 = Color3.new(0, 0, 0) frame.Active = true frame.Parent = widgetContainer control.Parent = dragBar - control.BackgroundColor3 = Color3.new(72/255,72/255,72/255) + control.BackgroundColor3 = Color3.new(72 / 255, 72 / 255, 72 / 255) control.BorderSizePixel = 0 control.BackgroundTransparency = 0 - control.Position = UDim2.new(1,-21,1,1) + control.Position = UDim2.new(1, -21, 1, 1) if size then - control.Size = UDim2.new(0,21,size.Y.Scale,size.Y.Offset) + control.Size = UDim2.new(0, 21, size.Y.Scale, size.Y.Offset) else - control.Size = UDim2.new(0,21,0,400) + control.Size = UDim2.new(0, 21, 0, 400) end - control:FindFirstChild("ScrollDownButton").Position = UDim2.new(0,0,1,-20) + control:FindFirstChild("ScrollDownButton").Position = UDim2.new(0, 0, 1, -20) - local fakeLine = Instance.new("Frame",control) + local fakeLine = Instance.new "Frame" fakeLine.Name = "FakeLine" fakeLine.BorderSizePixel = 0 - fakeLine.BackgroundColor3 = Color3.new(0,0,0) - fakeLine.Size = UDim2.new(0,1,1,1) - fakeLine.Position = UDim2.new(1,0,0,0) + fakeLine.BackgroundColor3 = Color3.new(0, 0, 0) + fakeLine.Size = UDim2.new(0, 1, 1, 1) + fakeLine.Position = UDim2.new(1, 0, 0, 0) + fakeLine.Parent = control - verticalDragger = Instance.new("TextButton",widgetContainer) + verticalDragger = Instance.new "TextButton" verticalDragger.ZIndex = 2 verticalDragger.AutoButtonColor = false verticalDragger.Name = "VerticalDragger" - verticalDragger.BackgroundColor3 = Color3.new(50/255,50/255,50/255) - verticalDragger.BorderColor3 = Color3.new(0,0,0) - verticalDragger.Size = UDim2.new(1,20,0,20) - verticalDragger.Position = UDim2.new(0,0,1,0) + verticalDragger.BackgroundColor3 = Color3.new(50 / 255, 50 / 255, 50 / 255) + verticalDragger.BorderColor3 = Color3.new(0, 0, 0) + verticalDragger.Size = UDim2.new(1, 20, 0, 20) + verticalDragger.Position = UDim2.new(0, 0, 1, 0) verticalDragger.Active = true verticalDragger.Text = "" + verticalDragger.Parent = widgetContainer - local scrubFrame = Instance.new("Frame",verticalDragger) + local scrubFrame = Instance.new "Frame" scrubFrame.Name = "ScrubFrame" - scrubFrame.BackgroundColor3 = Color3.new(1,1,1) + scrubFrame.BackgroundColor3 = Color3.new(1, 1, 1) scrubFrame.BorderSizePixel = 0 - scrubFrame.Position = UDim2.new(0.5,-5,0.5,0) - scrubFrame.Size = UDim2.new(0,10,0,1) + scrubFrame.Position = UDim2.new(0.5, -5, 0.5, 0) + scrubFrame.Size = UDim2.new(0, 10, 0, 1) scrubFrame.ZIndex = 5 + scrubFrame.Parent = verticalDragger local scrubTwo = scrubFrame:clone() - scrubTwo.Position = UDim2.new(0.5,-5,0.5,-2) + scrubTwo.Position = UDim2.new(0.5, -5, 0.5, -2) scrubTwo.Parent = verticalDragger local scrubThree = scrubFrame:clone() - scrubThree.Position = UDim2.new(0.5,-5,0.5,2) + scrubThree.Position = UDim2.new(0.5, -5, 0.5, 2) scrubThree.Parent = verticalDragger - local areaSoak = Instance.new("TextButton",getScreenGuiAncestor(parent)) + local areaSoak = Instance.new "TextButton" areaSoak.Name = "AreaSoak" - areaSoak.Size = UDim2.new(1,0,1,0) + areaSoak.Size = UDim2.new(1, 0, 1, 0) areaSoak.BackgroundTransparency = 1 areaSoak.BorderSizePixel = 0 areaSoak.Text = "" areaSoak.ZIndex = 10 areaSoak.Visible = false areaSoak.Active = true + areaSoak.Parent = getScreenGuiAncestor(parent) local draggingVertical = false local startYPos = nil - verticalDragger.MouseEnter:connect(function () - verticalDragger.BackgroundColor3 = Color3.new(60/255,60/255,60/255) + verticalDragger.MouseEnter:connect(function() + verticalDragger.BackgroundColor3 = Color3.new(60 / 255, 60 / 255, 60 / 255) end) - verticalDragger.MouseLeave:connect(function () - verticalDragger.BackgroundColor3 = Color3.new(50/255,50/255,50/255) + verticalDragger.MouseLeave:connect(function() + verticalDragger.BackgroundColor3 = Color3.new(50 / 255, 50 / 255, 50 / 255) end) - verticalDragger.MouseButton1Down:connect(function(x,y) + verticalDragger.MouseButton1Down:connect(function(_, y) draggingVertical = true areaSoak.Visible = true startYPos = y end) - areaSoak.MouseButton1Up:connect(function ( ) + areaSoak.MouseButton1Up:connect(function() draggingVertical = false areaSoak.Visible = false end) - areaSoak.MouseMoved:connect(function(x,y) - if not draggingVertical then return end + areaSoak.MouseMoved:connect(function(_, y) + if not draggingVertical then + return + end local yDelta = y - startYPos if not control.ScrollDownButton.Visible and yDelta > 0 then @@ -3732,16 +4035,26 @@ t.CreatePluginFrame = function (name,size,position,scrollable,parent) end if (widgetContainer.Size.Y.Offset + yDelta) < 150 then - widgetContainer.Size = UDim2.new(widgetContainer.Size.X.Scale, widgetContainer.Size.X.Offset,widgetContainer.Size.Y.Scale,150) - control.Size = UDim2.new (0,21,0,150) - return - end + widgetContainer.Size = UDim2.new( + widgetContainer.Size.X.Scale, + widgetContainer.Size.X.Offset, + widgetContainer.Size.Y.Scale, + 150 + ) + control.Size = UDim2.new(0, 21, 0, 150) + return + end startYPos = y if widgetContainer.Size.Y.Offset + yDelta >= 0 then - widgetContainer.Size = UDim2.new(widgetContainer.Size.X.Scale, widgetContainer.Size.X.Offset,widgetContainer.Size.Y.Scale,widgetContainer.Size.Y.Offset + yDelta) - control.Size = UDim2.new(0,21,0,control.Size.Y.Offset + yDelta ) + widgetContainer.Size = UDim2.new( + widgetContainer.Size.X.Scale, + widgetContainer.Size.X.Offset, + widgetContainer.Size.Y.Scale, + widgetContainer.Size.Y.Offset + yDelta + ) + control.Size = UDim2.new(0, 21, 0, control.Size.Y.Offset + yDelta) end end) end @@ -3763,11 +4076,11 @@ t.CreatePluginFrame = function (name,size,position,scrollable,parent) end end - minimizeBigButton.MouseButton1Click:connect(function ( ) + minimizeBigButton.MouseButton1Click:connect(function() switchMinimize() end) - minimizeButton.MouseButton1Click:connect(function( ) + minimizeButton.MouseButton1Click:connect(function() switchMinimize() end) @@ -3778,67 +4091,63 @@ t.CreatePluginFrame = function (name,size,position,scrollable,parent) end end -t.Help = - function(funcNameOrFunc) - --input argument can be a string or a function. Should return a description (of arguments and expected side effects) - if funcNameOrFunc == "CreatePropertyDropDownMenu" or funcNameOrFunc == t.CreatePropertyDropDownMenu then - return "Function CreatePropertyDropDownMenu. " .. - "Arguments: (instance, propertyName, enumType). " .. - "Side effect: returns a container with a drop-down-box that is linked to the 'property' field of 'instance' which is of type 'enumType'" - end - if funcNameOrFunc == "CreateDropDownMenu" or funcNameOrFunc == t.CreateDropDownMenu then - return "Function CreateDropDownMenu. " .. - "Arguments: (items, onItemSelected). " .. - "Side effect: Returns 2 results, a container to the gui object and a 'updateSelection' function for external updating. The container is a drop-down-box created around a list of items" - end - if funcNameOrFunc == "CreateMessageDialog" or funcNameOrFunc == t.CreateMessageDialog then - return "Function CreateMessageDialog. " .. - "Arguments: (title, message, buttons). " .. - "Side effect: Returns a gui object of a message box with 'title' and 'message' as passed in. 'buttons' input is an array of Tables contains a 'Text' and 'Function' field for the text/callback of each button" - end - if funcNameOrFunc == "CreateStyledMessageDialog" or funcNameOrFunc == t.CreateStyledMessageDialog then - return "Function CreateStyledMessageDialog. " .. - "Arguments: (title, message, style, buttons). " .. - "Side effect: Returns a gui object of a message box with 'title' and 'message' as passed in. 'buttons' input is an array of Tables contains a 'Text' and 'Function' field for the text/callback of each button, 'style' is a string, either Error, Notify or Confirm" - end - if funcNameOrFunc == "GetFontHeight" or funcNameOrFunc == t.GetFontHeight then - return "Function GetFontHeight. " .. - "Arguments: (font, fontSize). " .. - "Side effect: returns the size in pixels of the given font + fontSize" - end - if funcNameOrFunc == "LayoutGuiObjects" or funcNameOrFunc == t.LayoutGuiObjects then - - end - if funcNameOrFunc == "CreateScrollingFrame" or funcNameOrFunc == t.CreateScrollingFrame then - return "Function CreateScrollingFrame. " .. - "Arguments: (orderList, style) " .. - "Side effect: returns 4 objects, (scrollFrame, scrollUpButton, scrollDownButton, recalculateFunction). 'scrollFrame' can be filled with GuiObjects. It will lay them out and allow scrollUpButton/scrollDownButton to interact with them. Orderlist is optional (and specifies the order to layout the children. Without orderlist, it uses the children order. style is also optional, and allows for a 'grid' styling if style is passed 'grid' as a string. recalculateFunction can be called when a relayout is needed (when orderList changes)" - end - if funcNameOrFunc == "CreateTrueScrollingFrame" or funcNameOrFunc == t.CreateTrueScrollingFrame then - return "Function CreateTrueScrollingFrame. " .. - "Arguments: (nil) " .. - "Side effect: returns 2 objects, (scrollFrame, controlFrame). 'scrollFrame' can be filled with GuiObjects, and they will be clipped if not inside the frame's bounds. controlFrame has children scrollup and scrolldown, as well as a slider. controlFrame can be parented to any guiobject and it will readjust itself to fit." - end - if funcNameOrFunc == "AutoTruncateTextObject" or funcNameOrFunc == t.AutoTruncateTextObject then - return "Function AutoTruncateTextObject. " .. - "Arguments: (textLabel) " .. - "Side effect: returns 2 objects, (textLabel, changeText). The 'textLabel' input is modified to automatically truncate text (with ellipsis), if it gets too small to fit. 'changeText' is a function that can be used to change the text, it takes 1 string as an argument" - end - if funcNameOrFunc == "CreateSlider" or funcNameOrFunc == t.CreateSlider then - return "Function CreateSlider. " .. - "Arguments: (steps, width, position) " .. - "Side effect: returns 2 objects, (sliderGui, sliderPosition). The 'steps' argument specifies how many different positions the slider can hold along the bar. 'width' specifies in pixels how wide the bar should be (modifiable afterwards if desired). 'position' argument should be a UDim2 for slider positioning. 'sliderPosition' is an IntValue whose current .Value specifies the specific step the slider is currently on." - end - if funcNameOrFunc == "CreateLoadingFrame" or funcNameOrFunc == t.CreateLoadingFrame then - return "Function CreateLoadingFrame. " .. - "Arguments: (name, size, position) " .. - "Side effect: Creates a gui that can be manipulated to show progress for a particular action. Name appears above the loading bar, and size and position are udim2 values (both size and position are optional arguments). Returns 3 arguments, the first being the gui created. The second being updateLoadingGuiPercent, which is a bindable function. This function takes one argument (two optionally), which should be a number between 0 and 1, representing the percentage the loading gui should be at. The second argument to this function is a boolean value that if set to true will tween the current percentage value to the new percentage value, therefore our third argument is how long this tween should take. Our third returned argument is a BindableEvent, that when fired means that someone clicked the cancel button on the dialog." - end - if funcNameOrFunc == "CreateTerrainMaterialSelector" or funcNameOrFunc == t.CreateTerrainMaterialSelector then - return "Function CreateTerrainMaterialSelector. " .. - "Arguments: (size, position) " .. - "Side effect: Size and position are UDim2 values that specifies the selector's size and position. Both size and position are optional arguments. This method returns 3 objects (terrainSelectorGui, terrainSelected, forceTerrainSelection). terrainSelectorGui is just the gui object that we generate with this function, parent it as you like. TerrainSelected is a BindableEvent that is fired whenever a new terrain type is selected in the gui. ForceTerrainSelection is a function that takes an argument of Enum.CellMaterial and will force the gui to show that material as currently selected." - end +t.Help = function(funcNameOrFunc) + --input argument can be a string or a function. Should return a description (of arguments and expected side effects) + if funcNameOrFunc == "CreatePropertyDropDownMenu" or funcNameOrFunc == t.CreatePropertyDropDownMenu then + return "Function CreatePropertyDropDownMenu. " + .. "Arguments: (instance, propertyName, enumType). " + .. "Side effect: returns a container with a drop-down-box that is linked to the 'property' field of 'instance' which is of type 'enumType'" end - -return t \ No newline at end of file + if funcNameOrFunc == "CreateDropDownMenu" or funcNameOrFunc == t.CreateDropDownMenu then + return "Function CreateDropDownMenu. " + .. "Arguments: (items, onItemSelected). " + .. "Side effect: Returns 2 results, a container to the gui object and a 'updateSelection' function for external updating. The container is a drop-down-box created around a list of items" + end + if funcNameOrFunc == "CreateMessageDialog" or funcNameOrFunc == t.CreateMessageDialog then + return "Function CreateMessageDialog. " + .. "Arguments: (title, message, buttons). " + .. "Side effect: Returns a gui object of a message box with 'title' and 'message' as passed in. 'buttons' input is an array of Tables contains a 'Text' and 'Function' field for the text/callback of each button" + end + if funcNameOrFunc == "CreateStyledMessageDialog" or funcNameOrFunc == t.CreateStyledMessageDialog then + return "Function CreateStyledMessageDialog. " + .. "Arguments: (title, message, style, buttons). " + .. "Side effect: Returns a gui object of a message box with 'title' and 'message' as passed in. 'buttons' input is an array of Tables contains a 'Text' and 'Function' field for the text/callback of each button, 'style' is a string, either Error, Notify or Confirm" + end + if funcNameOrFunc == "GetFontHeight" or funcNameOrFunc == t.GetFontHeight then + return "Function GetFontHeight. " + .. "Arguments: (font, fontSize). " + .. "Side effect: returns the size in pixels of the given font + fontSize" + end + if funcNameOrFunc == "CreateScrollingFrame" or funcNameOrFunc == t.CreateScrollingFrame then + return "Function CreateScrollingFrame. " + .. "Arguments: (orderList, style) " + .. "Side effect: returns 4 objects, (scrollFrame, scrollUpButton, scrollDownButton, recalculateFunction). 'scrollFrame' can be filled with GuiObjects. It will lay them out and allow scrollUpButton/scrollDownButton to interact with them. Orderlist is optional (and specifies the order to layout the children. Without orderlist, it uses the children order. style is also optional, and allows for a 'grid' styling if style is passed 'grid' as a string. recalculateFunction can be called when a relayout is needed (when orderList changes)" + end + if funcNameOrFunc == "CreateTrueScrollingFrame" or funcNameOrFunc == t.CreateTrueScrollingFrame then + return "Function CreateTrueScrollingFrame. " + .. "Arguments: (nil) " + .. "Side effect: returns 2 objects, (scrollFrame, controlFrame). 'scrollFrame' can be filled with GuiObjects, and they will be clipped if not inside the frame's bounds. controlFrame has children scrollup and scrolldown, as well as a slider. controlFrame can be parented to any guiobject and it will readjust itself to fit." + end + if funcNameOrFunc == "AutoTruncateTextObject" or funcNameOrFunc == t.AutoTruncateTextObject then + return "Function AutoTruncateTextObject. " + .. "Arguments: (textLabel) " + .. "Side effect: returns 2 objects, (textLabel, changeText). The 'textLabel' input is modified to automatically truncate text (with ellipsis), if it gets too small to fit. 'changeText' is a function that can be used to change the text, it takes 1 string as an argument" + end + if funcNameOrFunc == "CreateSlider" or funcNameOrFunc == t.CreateSlider then + return "Function CreateSlider. " + .. "Arguments: (steps, width, position) " + .. "Side effect: returns 2 objects, (sliderGui, sliderPosition). The 'steps' argument specifies how many different positions the slider can hold along the bar. 'width' specifies in pixels how wide the bar should be (modifiable afterwards if desired). 'position' argument should be a UDim2 for slider positioning. 'sliderPosition' is an IntValue whose current .Value specifies the specific step the slider is currently on." + end + if funcNameOrFunc == "CreateLoadingFrame" or funcNameOrFunc == t.CreateLoadingFrame then + return "Function CreateLoadingFrame. " + .. "Arguments: (name, size, position) " + .. "Side effect: Creates a gui that can be manipulated to show progress for a particular action. Name appears above the loading bar, and size and position are udim2 values (both size and position are optional arguments). Returns 3 arguments, the first being the gui created. The second being updateLoadingGuiPercent, which is a bindable function. This function takes one argument (two optionally), which should be a number between 0 and 1, representing the percentage the loading gui should be at. The second argument to this function is a boolean value that if set to true will tween the current percentage value to the new percentage value, therefore our third argument is how long this tween should take. Our third returned argument is a BindableEvent, that when fired means that someone clicked the cancel button on the dialog." + end + if funcNameOrFunc == "CreateTerrainMaterialSelector" or funcNameOrFunc == t.CreateTerrainMaterialSelector then + return "Function CreateTerrainMaterialSelector. " + .. "Arguments: (size, position) " + .. "Side effect: Size and position are UDim2 values that specifies the selector's size and position. Both size and position are optional arguments. This method returns 3 objects (terrainSelectorGui, terrainSelected, forceTerrainSelection). terrainSelectorGui is just the gui object that we generate with this function, parent it as you like. TerrainSelected is a BindableEvent that is fired whenever a new terrain type is selected in the gui. ForceTerrainSelection is a function that takes an argument of Enum.CellMaterial and will force the gui to show that material as currently selected." + end +end + +return t diff --git a/45374389.lua b/45374389.lua index 51592b8..a197f9f 100644 --- a/45374389.lua +++ b/45374389.lua @@ -1,23 +1,20 @@ local t = {} -t.Foo = - function() - print("foo") - end +t.Foo = function() + print "foo" +end -t.Bar = - function() - print("bar") - end +t.Bar = function() + print "bar" +end -t.Help = - function(funcNameOrFunc) - --input argument can be a string or a function. Should return a description (of arguments and expected side effects) - if funcNameOrFunc == "Foo" or funcNameOrFunc == t.Foo then - return "Function Foo. Arguments: None. Side effect: prints foo" - elseif funcNameOrFunc == "Bar" or funcNameOrFunc == t.Bar then - return "Function Bar. Arguments: None. Side effect: prints bar" - end +t.Help = function(funcNameOrFunc) + --input argument can be a string or a function. Should return a description (of arguments and expected side effects) + if funcNameOrFunc == "Foo" or funcNameOrFunc == t.Foo then + return "Function Foo. Arguments: None. Side effect: prints foo" + elseif funcNameOrFunc == "Bar" or funcNameOrFunc == t.Bar then + return "Function Bar. Arguments: None. Side effect: prints bar" end +end -return t \ No newline at end of file +return t diff --git a/46295863.lua b/46295863.lua index dedf431..0a23a7f 100644 --- a/46295863.lua +++ b/46295863.lua @@ -12,8 +12,8 @@ end -- A Few Script Globals local gui -if script.Parent:FindFirstChild("ControlFrame") then - gui = script.Parent:FindFirstChild("ControlFrame") +if script.Parent:FindFirstChild "ControlFrame" then + gui = script.Parent:FindFirstChild "ControlFrame" else gui = script.Parent end @@ -33,8 +33,8 @@ local recordingVideo = false local currentMenuSelection = nil local lastMenuSelection = {} -local defaultPosition = UDim2.new(0,0,0,0) -local newGuiPlaces = {0,41324860} +local defaultPosition = UDim2.new(0, 0, 0, 0) +local newGuiPlaces = { 0, 41324860 } local centerDialogs = {} local mainShield = nil @@ -42,26 +42,34 @@ local mainShield = nil local inStudioMode = UserSettings().GameSettings:InStudioMode() local macClient = false -local success, isMac = pcall(function() return not game.GuiService.IsWindows end) +local success, isMac = pcall(function() + return not game.GuiService.IsWindows +end) macClient = success and isMac -local function Color3I(r,g,b) - return Color3.new(r/255,g/255,b/255) +local function Color3I(r, g, b) + return Color3.new(r / 255, g / 255, b / 255) end local function robloxLock(instance) - instance.RobloxLocked = true - children = instance:GetChildren() - if children then - for i, child in ipairs(children) do - robloxLock(child) - end - end + instance.RobloxLocked = true + children = instance:GetChildren() + if children then + for i, child in ipairs(children) do + robloxLock(child) + end + end end function resumeGameFunction(shield) - shield.Settings:TweenPosition(UDim2.new(0.5, -262,-0.5, -200),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) - delay(tweenTime,function() + shield.Settings:TweenPosition( + UDim2.new(0.5, -262, -0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + delay(tweenTime, function() shield.Visible = false for i = 1, #centerDialogs do centerDialogs[i].Visible = false @@ -70,14 +78,16 @@ function resumeGameFunction(shield) game.GuiService:RemoveCenterDialog(shield) settingsButton.Active = true currentMenuSelection = nil - lastMenuSelection = {} + lastMenuSelection = {} end) end -function goToMenu(container,menuName, moveDirection,size,position) - if type(menuName) ~= "string" then return end - - table.insert(lastMenuSelection,currentMenuSelection) +function goToMenu(container, menuName, moveDirection, size, position) + if type(menuName) ~= "string" then + return + end + + table.insert(lastMenuSelection, currentMenuSelection) if menuName == "GameMainMenu" then lastMenuSelection = {} end @@ -87,56 +97,101 @@ function goToMenu(container,menuName, moveDirection,size,position) for i = 1, #containerChildren do if containerChildren[i].Name == menuName then containerChildren[i].Visible = true - currentMenuSelection = {container = container,name = menuName, direction = moveDirection, lastSize = size} + currentMenuSelection = + { container = container, name = menuName, direction = moveDirection, lastSize = size } selectedMenu = true if size and position then - containerChildren[i]:TweenSizeAndPosition(size,position,Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) + containerChildren[i]:TweenSizeAndPosition( + size, + position, + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) elseif size then - containerChildren[i]:TweenSizeAndPosition(size,UDim2.new(0.5,-size.X.Offset/2,0.5,-size.Y.Offset/2),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) + containerChildren[i]:TweenSizeAndPosition( + size, + UDim2.new(0.5, -size.X.Offset / 2, 0.5, -size.Y.Offset / 2), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) else - containerChildren[i]:TweenPosition(UDim2.new(0,0,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) + containerChildren[i]:TweenPosition( + UDim2.new(0, 0, 0, 0), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) end else if moveDirection == "left" then - containerChildren[i]:TweenPosition(UDim2.new(-1,-525,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) + containerChildren[i]:TweenPosition( + UDim2.new(-1, -525, 0, 0), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) elseif moveDirection == "right" then - containerChildren[i]:TweenPosition(UDim2.new(1,525,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) + containerChildren[i]:TweenPosition( + UDim2.new(1, 525, 0, 0), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) elseif moveDirection == "up" then - containerChildren[i]:TweenPosition(UDim2.new(0,0,-1,-400),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) + containerChildren[i]:TweenPosition( + UDim2.new(0, 0, -1, -400), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) elseif moveDirection == "down" then - containerChildren[i]:TweenPosition(UDim2.new(0,0,1,400),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) + containerChildren[i]:TweenPosition( + UDim2.new(0, 0, 1, 400), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) end - delay(tweenTime,function() + delay(tweenTime, function() containerChildren[i].Visible = false end) end - end + end end function resetLocalCharacter() local player = game.Players.LocalPlayer if player then - if player.Character and player.Character:FindFirstChild("Humanoid") then + if player.Character and player.Character:FindFirstChild "Humanoid" then player.Character.Humanoid.Health = 0 end end end -local function createTextButton(text,style,fontSize,buttonSize,buttonPosition) - local newTextButton = Instance.new("TextButton") +local function createTextButton(text, style, fontSize, buttonSize, buttonPosition) + local newTextButton = Instance.new "TextButton" newTextButton.Font = Enum.Font.Arial newTextButton.FontSize = fontSize newTextButton.Size = buttonSize newTextButton.Position = buttonPosition newTextButton.Style = style - newTextButton.TextColor3 = Color3.new(1,1,1) + newTextButton.TextColor3 = Color3.new(1, 1, 1) newTextButton.Text = text return newTextButton end local function CreateTextButtons(frame, buttons, yPos, ySize) if #buttons < 1 then - error("Must have more than one button") + error "Must have more than one button" end local buttonNum = 1 @@ -152,42 +207,46 @@ local function CreateTextButtons(frame, buttons, yPos, ySize) end end - for i, obj in ipairs(buttons) do - local button = Instance.new("TextButton") + for i, obj in ipairs(buttons) do + local button = Instance.new "TextButton" button.Name = "Button" .. buttonNum button.Font = Enum.Font.Arial button.FontSize = Enum.FontSize.Size18 button.AutoButtonColor = true button.Style = Enum.ButtonStyle.RobloxButton button.Text = obj.Text - button.TextColor3 = Color3.new(1,1,1) - button.MouseButton1Click:connect(function() toggleSelection(button) obj.Function() end) + button.TextColor3 = Color3.new(1, 1, 1) + button.MouseButton1Click:connect(function() + toggleSelection(button) + obj.Function() + end) button.Parent = frame buttonObjs[buttonNum] = button buttonNum = buttonNum + 1 end - + toggleSelection(buttonObjs[1]) - local numButtons = buttonNum-1 + local numButtons = buttonNum - 1 if numButtons == 1 then frame.Button1.Position = UDim2.new(0.35, 0, yPos.Scale, yPos.Offset) - frame.Button1.Size = UDim2.new(.4,0,ySize.Scale, ySize.Offset) + frame.Button1.Size = UDim2.new(0.4, 0, ySize.Scale, ySize.Offset) elseif numButtons == 2 then frame.Button1.Position = UDim2.new(0.1, 0, yPos.Scale, yPos.Offset) - frame.Button1.Size = UDim2.new(.35,0, ySize.Scale, ySize.Offset) + frame.Button1.Size = UDim2.new(0.35, 0, ySize.Scale, ySize.Offset) frame.Button2.Position = UDim2.new(0.55, 0, yPos.Scale, yPos.Offset) - frame.Button2.Size = UDim2.new(.35,0, ySize.Scale, ySize.Offset) + frame.Button2.Size = UDim2.new(0.35, 0, ySize.Scale, ySize.Offset) elseif numButtons >= 3 then - local spacing = .1 / numButtons - local buttonSize = .9 / numButtons + local spacing = 0.1 / numButtons + local buttonSize = 0.9 / numButtons buttonNum = 1 while buttonNum <= numButtons do - buttonObjs[buttonNum].Position = UDim2.new(spacing*buttonNum + (buttonNum-1) * buttonSize, 0, yPos.Scale, yPos.Offset) + buttonObjs[buttonNum].Position = + UDim2.new(spacing * buttonNum + (buttonNum - 1) * buttonSize, 0, yPos.Scale, yPos.Offset) buttonObjs[buttonNum].Size = UDim2.new(buttonSize, 0, ySize.Scale, ySize.Offset) buttonNum = buttonNum + 1 end @@ -195,7 +254,7 @@ local function CreateTextButtons(frame, buttons, yPos, ySize) end function setRecordGui(recording, stopRecordButton, recordVideoButton) - if recording then + if recording then stopRecordButton.Visible = true recordVideoButton.Text = "Stop Recording" else @@ -222,74 +281,75 @@ function backToGame(buttonClicked, shield, settingsButton) end function setDisabledState(guiObject) - if not guiObject then return end - - if guiObject:IsA("TextLabel") then + if not guiObject then + return + end + + if guiObject:IsA "TextLabel" then guiObject.TextTransparency = 0.9 - elseif guiObject:IsA("TextButton") then + elseif guiObject:IsA "TextButton" then guiObject.TextTransparency = 0.9 guiObject.Active = false else if guiObject["ClassName"] then - print("setDisabledState() got object of unsupported type. object type is ",guiObject.ClassName) + print("setDisabledState() got object of unsupported type. object type is ", guiObject.ClassName) end end end local function createHelpDialog(baseZIndex) - if helpButton == nil then - if gui:FindFirstChild("TopLeftControl") and gui.TopLeftControl:FindFirstChild("Help") then + if gui:FindFirstChild "TopLeftControl" and gui.TopLeftControl:FindFirstChild "Help" then helpButton = gui.TopLeftControl.Help - elseif gui:FindFirstChild("BottomRightControl") and gui.BottomRightControl:FindFirstChild("Help") then + elseif gui:FindFirstChild "BottomRightControl" and gui.BottomRightControl:FindFirstChild "Help" then helpButton = gui.BottomRightControl.Help end end - local shield = Instance.new("Frame") + local shield = Instance.new "Frame" shield.Name = "HelpDialogShield" shield.Active = true shield.Visible = false - shield.Size = UDim2.new(1,0,1,0) - shield.BackgroundColor3 = Color3I(51,51,51) - shield.BorderColor3 = Color3I(27,42,53) + shield.Size = UDim2.new(1, 0, 1, 0) + shield.BackgroundColor3 = Color3I(51, 51, 51) + shield.BorderColor3 = Color3I(27, 42, 53) shield.BackgroundTransparency = 0.4 shield.ZIndex = baseZIndex + 1 - local helpDialog = Instance.new("Frame") + local helpDialog = Instance.new "Frame" helpDialog.Name = "HelpDialog" helpDialog.Style = Enum.FrameStyle.RobloxRound - helpDialog.Position = UDim2.new(.2, 0, .2, 0) + helpDialog.Position = UDim2.new(0.2, 0, 0.2, 0) helpDialog.Size = UDim2.new(0.6, 0, 0.6, 0) helpDialog.Active = true helpDialog.Parent = shield - local titleLabel = Instance.new("TextLabel") + local titleLabel = Instance.new "TextLabel" titleLabel.Name = "Title" titleLabel.Text = "Keyboard & Mouse Controls" titleLabel.Font = Enum.Font.ArialBold titleLabel.FontSize = Enum.FontSize.Size36 titleLabel.Position = UDim2.new(0, 0, 0.025, 0) titleLabel.Size = UDim2.new(1, 0, 0, 40) - titleLabel.TextColor3 = Color3.new(1,1,1) + titleLabel.TextColor3 = Color3.new(1, 1, 1) titleLabel.BackgroundTransparency = 1 titleLabel.Parent = helpDialog - local buttonRow = Instance.new("Frame") + local buttonRow = Instance.new "Frame" buttonRow.Name = "Buttons" - buttonRow.Position = UDim2.new(0.1, 0, .07, 40) + buttonRow.Position = UDim2.new(0.1, 0, 0.07, 40) buttonRow.Size = UDim2.new(0.8, 0, 0, 45) buttonRow.BackgroundTransparency = 1 buttonRow.Parent = helpDialog - local imageFrame = Instance.new("Frame") + local imageFrame = Instance.new "Frame" imageFrame.Name = "ImageFrame" imageFrame.Position = UDim2.new(0.05, 0, 0.075, 80) - imageFrame.Size = UDim2.new(0.9, 0, .9, -120) + imageFrame.Size = UDim2.new(0.9, 0, 0.9, -120) imageFrame.BackgroundTransparency = 1 imageFrame.Parent = helpDialog - local layoutFrame = Instance.new("Frame") + local layoutFrame = Instance.new "Frame" layoutFrame.Name = "LayoutFrame" layoutFrame.Position = UDim2.new(0.5, 0, 0, 0) layoutFrame.Size = UDim2.new(1.5, 0, 1, 0) @@ -297,7 +357,7 @@ local function createHelpDialog(baseZIndex) layoutFrame.SizeConstraint = Enum.SizeConstraint.RelativeYY layoutFrame.Parent = imageFrame - local image = Instance.new("ImageLabel") + local image = Instance.new "ImageLabel" image.Name = "Image" if UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then image.Image = mouseLockLookScreenUrl @@ -308,7 +368,7 @@ local function createHelpDialog(baseZIndex) image.Size = UDim2.new(1, 0, 1, 0) image.BackgroundTransparency = 1 image.Parent = layoutFrame - + local buttons = {} buttons[1] = {} buttons[1].Text = "Look" @@ -318,447 +378,552 @@ local function createHelpDialog(baseZIndex) else image.Image = classicLookScreenUrl end - end + end buttons[2] = {} buttons[2].Text = "Move" - buttons[2].Function = function() + buttons[2].Function = function() image.Image = "http://www.roblox.com/Asset?id=45915811" - end + end buttons[3] = {} buttons[3].Text = "Gear" - buttons[3].Function = function() + buttons[3].Function = function() image.Image = "http://www.roblox.com/Asset?id=45917596" end buttons[4] = {} buttons[4].Text = "Zoom" - buttons[4].Function = function() + buttons[4].Function = function() image.Image = "http://www.roblox.com/Asset?id=45915825" - end + end + + CreateTextButtons(buttonRow, buttons, UDim.new(0, 0), UDim.new(1, 0)) - CreateTextButtons(buttonRow, buttons, UDim.new(0, 0), UDim.new(1,0)) - - -- set up listeners for type of mouse mode, but keep constructing gui at same time delay(0, function() - waitForChild(gui,"UserSettingsShield") - waitForChild(gui.UserSettingsShield,"Settings") - waitForChild(gui.UserSettingsShield.Settings,"SettingsStyle") + waitForChild(gui, "UserSettingsShield") + waitForChild(gui.UserSettingsShield, "Settings") + waitForChild(gui.UserSettingsShield.Settings, "SettingsStyle") waitForChild(gui.UserSettingsShield.Settings.SettingsStyle, "GameSettingsMenu") waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu, "CameraField") waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField, "DropDownMenuButton") - gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Changed:connect(function(prop) - if prop ~= "Text" then return end - if buttonRow.Button1.Style == Enum.ButtonStyle.RobloxButtonDefault then -- only change if this is the currently selected panel - if gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Text == "Classic" then - image.Image = classicLookScreenUrl - else - image.Image = mouseLockLookScreenUrl + gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Changed:connect( + function(prop) + if prop ~= "Text" then + return + end + if buttonRow.Button1.Style == Enum.ButtonStyle.RobloxButtonDefault then -- only change if this is the currently selected panel + if + gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Text + == "Classic" + then + image.Image = classicLookScreenUrl + else + image.Image = mouseLockLookScreenUrl + end end end - end) + ) end) - - local okBtn = Instance.new("TextButton") + local okBtn = Instance.new "TextButton" okBtn.Name = "OkBtn" okBtn.Text = "OK" okBtn.Modal = true okBtn.Size = UDim2.new(0.3, 0, 0, 45) - okBtn.Position = UDim2.new(0.35, 0, .975, -50) + okBtn.Position = UDim2.new(0.35, 0, 0.975, -50) okBtn.Font = Enum.Font.Arial okBtn.FontSize = Enum.FontSize.Size18 okBtn.BackgroundTransparency = 1 - okBtn.TextColor3 = Color3.new(1,1,1) + okBtn.TextColor3 = Color3.new(1, 1, 1) okBtn.Style = Enum.ButtonStyle.RobloxButtonDefault - okBtn.MouseButton1Click:connect( - function() - shield.Visible = false - game.GuiService:RemoveCenterDialog(shield) - end) + okBtn.MouseButton1Click:connect(function() + shield.Visible = false + game.GuiService:RemoveCenterDialog(shield) + end) okBtn.Parent = helpDialog robloxLock(shield) return shield end -local function createLeaveConfirmationMenu(baseZIndex,shield) - local frame = Instance.new("Frame") +local function createLeaveConfirmationMenu(baseZIndex, shield) + local frame = Instance.new "Frame" frame.Name = "LeaveConfirmationMenu" frame.BackgroundTransparency = 1 - frame.Size = UDim2.new(1,0,1,0) - frame.Position = UDim2.new(0,0,2,400) + frame.Size = UDim2.new(1, 0, 1, 0) + frame.Position = UDim2.new(0, 0, 2, 400) frame.ZIndex = baseZIndex + 4 - - local yesButton = createTextButton("Leave",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0,313,0.8,0)) + + local yesButton = createTextButton( + "Leave", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 128, 0, 50), + UDim2.new(0, 313, 0.8, 0) + ) yesButton.Name = "YesButton" yesButton.ZIndex = baseZIndex + 4 yesButton.Parent = frame yesButton.Modal = true - yesButton:SetVerb("Exit") - - local noButton = createTextButton("Stay",Enum.ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0,90,0.8,0)) + yesButton:SetVerb "Exit" + + local noButton = createTextButton( + "Stay", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 128, 0, 50), + UDim2.new(0, 90, 0.8, 0) + ) noButton.Name = "NoButton" noButton.Parent = frame noButton.ZIndex = baseZIndex + 4 noButton.MouseButton1Click:connect(function() - goToMenu(shield.Settings.SettingsStyle,"GameMainMenu","down",UDim2.new(0,525,0,430)) - shield.Settings:TweenSize(UDim2.new(0,525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) + goToMenu(shield.Settings.SettingsStyle, "GameMainMenu", "down", UDim2.new(0, 525, 0, 430)) + shield.Settings:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) end) - - local leaveText = Instance.new("TextLabel") + + local leaveText = Instance.new "TextLabel" leaveText.Name = "LeaveText" leaveText.Text = "Leave this game?" - leaveText.Size = UDim2.new(1,0,0.8,0) + leaveText.Size = UDim2.new(1, 0, 0.8, 0) leaveText.TextWrap = true - leaveText.TextColor3 = Color3.new(1,1,1) + leaveText.TextColor3 = Color3.new(1, 1, 1) leaveText.Font = Enum.Font.ArialBold leaveText.FontSize = Enum.FontSize.Size36 leaveText.BackgroundTransparency = 1 leaveText.ZIndex = baseZIndex + 4 leaveText.Parent = frame - + return frame end -local function createResetConfirmationMenu(baseZIndex,shield) - local frame = Instance.new("Frame") +local function createResetConfirmationMenu(baseZIndex, shield) + local frame = Instance.new "Frame" frame.Name = "ResetConfirmationMenu" frame.BackgroundTransparency = 1 - frame.Size = UDim2.new(1,0,1,0) - frame.Position = UDim2.new(0,0,2,400) + frame.Size = UDim2.new(1, 0, 1, 0) + frame.Position = UDim2.new(0, 0, 2, 400) frame.ZIndex = baseZIndex + 4 - - local yesButton = createTextButton("Reset",Enum.ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0,313,0,299)) + + local yesButton = createTextButton( + "Reset", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 128, 0, 50), + UDim2.new(0, 313, 0, 299) + ) yesButton.Name = "YesButton" yesButton.ZIndex = baseZIndex + 4 yesButton.Parent = frame - yesButton.Modal = true + yesButton.Modal = true yesButton.MouseButton1Click:connect(function() resumeGameFunction(shield) resetLocalCharacter() end) - - local noButton = createTextButton("Cancel",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0,90,0,299)) + + local noButton = createTextButton( + "Cancel", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 128, 0, 50), + UDim2.new(0, 90, 0, 299) + ) noButton.Name = "NoButton" noButton.Parent = frame noButton.ZIndex = baseZIndex + 4 noButton.MouseButton1Click:connect(function() - goToMenu(shield.Settings.SettingsStyle,"GameMainMenu","down",UDim2.new(0,525,0,430)) - shield.Settings:TweenSize(UDim2.new(0,525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) + goToMenu(shield.Settings.SettingsStyle, "GameMainMenu", "down", UDim2.new(0, 525, 0, 430)) + shield.Settings:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) end) - - local resetCharacterText = Instance.new("TextLabel") + + local resetCharacterText = Instance.new "TextLabel" resetCharacterText.Name = "ResetCharacterText" resetCharacterText.Text = "Are you sure you want to reset your character?" - resetCharacterText.Size = UDim2.new(1,0,0.8,0) + resetCharacterText.Size = UDim2.new(1, 0, 0.8, 0) resetCharacterText.TextWrap = true - resetCharacterText.TextColor3 = Color3.new(1,1,1) + resetCharacterText.TextColor3 = Color3.new(1, 1, 1) resetCharacterText.Font = Enum.Font.ArialBold resetCharacterText.FontSize = Enum.FontSize.Size36 resetCharacterText.BackgroundTransparency = 1 resetCharacterText.ZIndex = baseZIndex + 4 resetCharacterText.Parent = frame - + local fineResetCharacterText = resetCharacterText:Clone() fineResetCharacterText.Name = "FineResetCharacterText" fineResetCharacterText.Text = "You will be put back on a spawn point" - fineResetCharacterText.Size = UDim2.new(0,303,0,18) + fineResetCharacterText.Size = UDim2.new(0, 303, 0, 18) fineResetCharacterText.Position = UDim2.new(0, 109, 0, 215) fineResetCharacterText.FontSize = Enum.FontSize.Size18 fineResetCharacterText.Parent = frame - + return frame end local function createGameMainMenu(baseZIndex, shield) - local gameMainMenuFrame = Instance.new("Frame") + local gameMainMenuFrame = Instance.new "Frame" gameMainMenuFrame.Name = "GameMainMenu" gameMainMenuFrame.BackgroundTransparency = 1 - gameMainMenuFrame.Size = UDim2.new(1,0,1,0) + gameMainMenuFrame.Size = UDim2.new(1, 0, 1, 0) gameMainMenuFrame.ZIndex = baseZIndex + 4 gameMainMenuFrame.Parent = settingsFrame -- GameMainMenu Children - - local gameMainMenuTitle = Instance.new("TextLabel") + + local gameMainMenuTitle = Instance.new "TextLabel" gameMainMenuTitle.Name = "Title" gameMainMenuTitle.Text = "Game Menu" gameMainMenuTitle.BackgroundTransparency = 1 gameMainMenuTitle.TextStrokeTransparency = 0 gameMainMenuTitle.Font = Enum.Font.ArialBold gameMainMenuTitle.FontSize = Enum.FontSize.Size36 - gameMainMenuTitle.Size = UDim2.new(1,0,0,36) - gameMainMenuTitle.Position = UDim2.new(0,0,0,4) - gameMainMenuTitle.TextColor3 = Color3.new(1,1,1) + gameMainMenuTitle.Size = UDim2.new(1, 0, 0, 36) + gameMainMenuTitle.Position = UDim2.new(0, 0, 0, 4) + gameMainMenuTitle.TextColor3 = Color3.new(1, 1, 1) gameMainMenuTitle.ZIndex = baseZIndex + 4 gameMainMenuTitle.Parent = gameMainMenuFrame - - local robloxHelpButton = createTextButton("Help",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0,164,0,50),UDim2.new(0,82,0,256)) + + local robloxHelpButton = createTextButton( + "Help", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 164, 0, 50), + UDim2.new(0, 82, 0, 256) + ) robloxHelpButton.Name = "HelpButton" robloxHelpButton.ZIndex = baseZIndex + 4 robloxHelpButton.Parent = gameMainMenuFrame helpButton = robloxHelpButton - + local helpDialog = createHelpDialog(baseZIndex) helpDialog.Parent = gui - - helpButton.MouseButton1Click:connect( - function() - table.insert(centerDialogs,helpDialog) - game.GuiService:AddCenterDialog(helpDialog, Enum.CenterDialogType.ModalDialog, - --ShowFunction - function() - helpDialog.Visible = true - mainShield.Visible = false - end, - --HideFunction - function() - helpDialog.Visible = false - end) - end) + + helpButton.MouseButton1Click:connect(function() + table.insert(centerDialogs, helpDialog) + game.GuiService:AddCenterDialog( + helpDialog, + Enum.CenterDialogType.ModalDialog, + --ShowFunction + function() + helpDialog.Visible = true + mainShield.Visible = false + end, + --HideFunction + function() + helpDialog.Visible = false + end + ) + end) helpButton.Active = true - - local helpShortcut = Instance.new("TextLabel") + + local helpShortcut = Instance.new "TextLabel" helpShortcut.Name = "HelpShortcutText" helpShortcut.Text = "F1" helpShortcut.Visible = false helpShortcut.BackgroundTransparency = 1 helpShortcut.Font = Enum.Font.Arial helpShortcut.FontSize = Enum.FontSize.Size12 - helpShortcut.Position = UDim2.new(0,85,0,0) - helpShortcut.Size = UDim2.new(0,30,0,30) - helpShortcut.TextColor3 = Color3.new(0,1,0) + helpShortcut.Position = UDim2.new(0, 85, 0, 0) + helpShortcut.Size = UDim2.new(0, 30, 0, 30) + helpShortcut.TextColor3 = Color3.new(0, 1, 0) helpShortcut.ZIndex = baseZIndex + 4 helpShortcut.Parent = robloxHelpButton - - local screenshotButton = createTextButton("Screenshot",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0,168,0,50),UDim2.new(0,254,0,256)) + + local screenshotButton = createTextButton( + "Screenshot", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 168, 0, 50), + UDim2.new(0, 254, 0, 256) + ) screenshotButton.Name = "ScreenshotButton" screenshotButton.ZIndex = baseZIndex + 4 screenshotButton.Parent = gameMainMenuFrame screenshotButton.Visible = not macClient - screenshotButton:SetVerb("Screenshot") - + screenshotButton:SetVerb "Screenshot" + local screenshotShortcut = helpShortcut:clone() screenshotShortcut.Name = "ScreenshotShortcutText" screenshotShortcut.Text = "PrintSc" - screenshotShortcut.Position = UDim2.new(0,118,0,0) + screenshotShortcut.Position = UDim2.new(0, 118, 0, 0) screenshotShortcut.Visible = true screenshotShortcut.Parent = screenshotButton - - - local recordVideoButton = createTextButton("Record Video",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0,168,0,50),UDim2.new(0,254,0,306)) + + local recordVideoButton = createTextButton( + "Record Video", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 168, 0, 50), + UDim2.new(0, 254, 0, 306) + ) recordVideoButton.Name = "RecordVideoButton" recordVideoButton.ZIndex = baseZIndex + 4 recordVideoButton.Parent = gameMainMenuFrame recordVideoButton.Visible = not macClient - recordVideoButton:SetVerb("RecordToggle") - + recordVideoButton:SetVerb "RecordToggle" + local recordVideoShortcut = helpShortcut:clone() recordVideoShortcut.Visible = hasGraphicsSlider recordVideoShortcut.Name = "RecordVideoShortcutText" recordVideoShortcut.Text = "F12" - recordVideoShortcut.Position = UDim2.new(0,120,0,0) + recordVideoShortcut.Position = UDim2.new(0, 120, 0, 0) recordVideoShortcut.Parent = recordVideoButton - - local stopRecordButton = Instance.new("ImageButton") + + local stopRecordButton = Instance.new "ImageButton" stopRecordButton.Name = "StopRecordButton" stopRecordButton.BackgroundTransparency = 1 stopRecordButton.Image = "rbxasset://textures/ui/RecordStop.png" - stopRecordButton.Size = UDim2.new(0,59,0,27) - stopRecordButton:SetVerb("RecordToggle") - - stopRecordButton.MouseButton1Click:connect(function() recordVideoClick(recordVideoButton, stopRecordButton) end) + stopRecordButton.Size = UDim2.new(0, 59, 0, 27) + stopRecordButton:SetVerb "RecordToggle" + + stopRecordButton.MouseButton1Click:connect(function() + recordVideoClick(recordVideoButton, stopRecordButton) + end) stopRecordButton.Visible = false stopRecordButton.Parent = gui - - local reportAbuseButton = createTextButton("Report Abuse",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0,164,0,50),UDim2.new(0,82,0,306)) + + local reportAbuseButton = createTextButton( + "Report Abuse", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 164, 0, 50), + UDim2.new(0, 82, 0, 306) + ) reportAbuseButton.Name = "ReportAbuseButton" reportAbuseButton.ZIndex = baseZIndex + 4 reportAbuseButton.Parent = gameMainMenuFrame - - local leaveGameButton = createTextButton("Leave Game",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0,82,0,358)) + + local leaveGameButton = createTextButton( + "Leave Game", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new(0, 82, 0, 358) + ) leaveGameButton.Name = "LeaveGameButton" leaveGameButton.ZIndex = baseZIndex + 4 leaveGameButton.Parent = gameMainMenuFrame - - local resumeGameButton = createTextButton("Resume Game",Enum.ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0,82,0,54)) + + local resumeGameButton = createTextButton( + "Resume Game", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new(0, 82, 0, 54) + ) resumeGameButton.Name = "resumeGameButton" resumeGameButton.ZIndex = baseZIndex + 4 resumeGameButton.Parent = gameMainMenuFrame resumeGameButton.Modal = true - resumeGameButton.MouseButton1Click:connect(function() resumeGameFunction(shield) end) - - local gameSettingsButton = createTextButton("Game Settings",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0,82,0,156)) + resumeGameButton.MouseButton1Click:connect(function() + resumeGameFunction(shield) + end) + + local gameSettingsButton = createTextButton( + "Game Settings", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new(0, 82, 0, 156) + ) gameSettingsButton.Name = "SettingsButton" gameSettingsButton.ZIndex = baseZIndex + 4 gameSettingsButton.Parent = gameMainMenuFrame - - if game:FindFirstChild("LoadingGuiService") and #game.LoadingGuiService:GetChildren() > 0 then - local gameSettingsButton = createTextButton("Game Instructions",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0,82,0,207)) + + if game:FindFirstChild "LoadingGuiService" and #game.LoadingGuiService:GetChildren() > 0 then + local gameSettingsButton = createTextButton( + "Game Instructions", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new(0, 82, 0, 207) + ) gameSettingsButton.Name = "GameInstructions" gameSettingsButton.ZIndex = baseZIndex + 4 gameSettingsButton.Parent = gameMainMenuFrame gameSettingsButton.MouseButton1Click:connect(function() - if game:FindFirstChild("Players") and game.Players["LocalPlayer"] then - local loadingGui = game.Players.LocalPlayer:FindFirstChild("PlayerLoadingGui") + if game:FindFirstChild "Players" and game.Players["LocalPlayer"] then + local loadingGui = game.Players.LocalPlayer:FindFirstChild "PlayerLoadingGui" if loadingGui then loadingGui.Visible = true end end end) end - - local resetButton = createTextButton("Reset Character",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0,82,0,105)) + + local resetButton = createTextButton( + "Reset Character", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new(0, 82, 0, 105) + ) resetButton.Name = "ResetButton" resetButton.ZIndex = baseZIndex + 4 resetButton.Parent = gameMainMenuFrame - + return gameMainMenuFrame end local function createGameSettingsMenu(baseZIndex, shield) - local gameSettingsMenuFrame = Instance.new("Frame") + local gameSettingsMenuFrame = Instance.new "Frame" gameSettingsMenuFrame.Name = "GameSettingsMenu" gameSettingsMenuFrame.BackgroundTransparency = 1 - gameSettingsMenuFrame.Size = UDim2.new(1,0,1,0) + gameSettingsMenuFrame.Size = UDim2.new(1, 0, 1, 0) gameSettingsMenuFrame.ZIndex = baseZIndex + 4 - - local title = Instance.new("TextLabel") + + local title = Instance.new "TextLabel" title.Name = "Title" title.Text = "Settings" - title.Size = UDim2.new(1,0,0,48) - title.Position = UDim2.new(0,9,0,-9) + title.Size = UDim2.new(1, 0, 0, 48) + title.Position = UDim2.new(0, 9, 0, -9) title.Font = Enum.Font.ArialBold title.FontSize = Enum.FontSize.Size36 - title.TextColor3 = Color3.new(1,1,1) + title.TextColor3 = Color3.new(1, 1, 1) title.ZIndex = baseZIndex + 4 title.BackgroundTransparency = 1 title.Parent = gameSettingsMenuFrame - - local fullscreenText = Instance.new("TextLabel") + + local fullscreenText = Instance.new "TextLabel" fullscreenText.Name = "FullscreenText" fullscreenText.Text = "Fullscreen Mode" - fullscreenText.Size = UDim2.new(0,124,0,18) - fullscreenText.Position = UDim2.new(0,62,0,145) + fullscreenText.Size = UDim2.new(0, 124, 0, 18) + fullscreenText.Position = UDim2.new(0, 62, 0, 145) fullscreenText.Font = Enum.Font.Arial fullscreenText.FontSize = Enum.FontSize.Size18 - fullscreenText.TextColor3 = Color3.new(1,1,1) + fullscreenText.TextColor3 = Color3.new(1, 1, 1) fullscreenText.ZIndex = baseZIndex + 4 fullscreenText.BackgroundTransparency = 1 fullscreenText.Parent = gameSettingsMenuFrame - - local fullscreenShortcut = Instance.new("TextLabel") + + local fullscreenShortcut = Instance.new "TextLabel" fullscreenShortcut.Visible = hasGraphicsSlider fullscreenShortcut.Name = "FullscreenShortcutText" fullscreenShortcut.Text = "F11" fullscreenShortcut.BackgroundTransparency = 1 fullscreenShortcut.Font = Enum.Font.Arial fullscreenShortcut.FontSize = Enum.FontSize.Size12 - fullscreenShortcut.Position = UDim2.new(0,186,0,141) - fullscreenShortcut.Size = UDim2.new(0,30,0,30) - fullscreenShortcut.TextColor3 = Color3.new(0,1,0) + fullscreenShortcut.Position = UDim2.new(0, 186, 0, 141) + fullscreenShortcut.Size = UDim2.new(0, 30, 0, 30) + fullscreenShortcut.TextColor3 = Color3.new(0, 1, 0) fullscreenShortcut.ZIndex = baseZIndex + 4 fullscreenShortcut.Parent = gameSettingsMenuFrame - - local studioText = Instance.new("TextLabel") + + local studioText = Instance.new "TextLabel" studioText.Visible = false studioText.Name = "StudioText" studioText.Text = "Studio Mode" - studioText.Size = UDim2.new(0,95,0,18) - studioText.Position = UDim2.new(0,62,0,179) + studioText.Size = UDim2.new(0, 95, 0, 18) + studioText.Position = UDim2.new(0, 62, 0, 179) studioText.Font = Enum.Font.Arial studioText.FontSize = Enum.FontSize.Size18 - studioText.TextColor3 = Color3.new(1,1,1) + studioText.TextColor3 = Color3.new(1, 1, 1) studioText.ZIndex = baseZIndex + 4 studioText.BackgroundTransparency = 1 studioText.Parent = gameSettingsMenuFrame - + local studioShortcut = fullscreenShortcut:clone() studioShortcut.Name = "StudioShortcutText" studioShortcut.Visible = false -- TODO: turn back on when f2 hack is fixed studioShortcut.Text = "F2" - studioShortcut.Position = UDim2.new(0,154,0,175) + studioShortcut.Position = UDim2.new(0, 154, 0, 175) studioShortcut.Parent = gameSettingsMenuFrame - + local studioCheckbox = nil - + if hasGraphicsSlider then - local qualityText = Instance.new("TextLabel") + local qualityText = Instance.new "TextLabel" qualityText.Name = "QualityText" qualityText.Text = "Graphics Quality" - qualityText.Size = UDim2.new(0,128,0,18) - qualityText.Position = UDim2.new(0,30,0,239) + qualityText.Size = UDim2.new(0, 128, 0, 18) + qualityText.Position = UDim2.new(0, 30, 0, 239) qualityText.Font = Enum.Font.Arial qualityText.FontSize = Enum.FontSize.Size18 - qualityText.TextColor3 = Color3.new(1,1,1) + qualityText.TextColor3 = Color3.new(1, 1, 1) qualityText.ZIndex = baseZIndex + 4 qualityText.BackgroundTransparency = 1 qualityText.Parent = gameSettingsMenuFrame qualityText.Visible = not inStudioMode - + local autoText = qualityText:clone() autoText.Name = "AutoText" autoText.Text = "Auto" - autoText.Position = UDim2.new(0,183,0,214) - autoText.TextColor3 = Color3.new(128/255,128/255,128/255) - autoText.Size = UDim2.new(0,34,0,18) + autoText.Position = UDim2.new(0, 183, 0, 214) + autoText.TextColor3 = Color3.new(128 / 255, 128 / 255, 128 / 255) + autoText.Size = UDim2.new(0, 34, 0, 18) autoText.Parent = gameSettingsMenuFrame autoText.Visible = not inStudioMode - + local fasterText = autoText:clone() fasterText.Name = "FasterText" fasterText.Text = "Faster" - fasterText.Position = UDim2.new(0,185,0,274) - fasterText.TextColor3 = Color3.new(95,95,95) + fasterText.Position = UDim2.new(0, 185, 0, 274) + fasterText.TextColor3 = Color3.new(95, 95, 95) fasterText.FontSize = Enum.FontSize.Size14 fasterText.Parent = gameSettingsMenuFrame fasterText.Visible = not inStudioMode - + local fasterShortcut = fullscreenShortcut:clone() fasterShortcut.Name = "FasterShortcutText" fasterShortcut.Text = "F10 + Shift" - fasterShortcut.Position = UDim2.new(0,185,0,283) + fasterShortcut.Position = UDim2.new(0, 185, 0, 283) fasterShortcut.Parent = gameSettingsMenuFrame fasterShortcut.Visible = not inStudioMode - + local betterQualityText = autoText:clone() betterQualityText.Name = "BetterQualityText" betterQualityText.Text = "Better Quality" betterQualityText.TextWrap = true - betterQualityText.Size = UDim2.new(0,41,0,28) - betterQualityText.Position = UDim2.new(0,390,0,269) - betterQualityText.TextColor3 = Color3.new(95,95,95) + betterQualityText.Size = UDim2.new(0, 41, 0, 28) + betterQualityText.Position = UDim2.new(0, 390, 0, 269) + betterQualityText.TextColor3 = Color3.new(95, 95, 95) betterQualityText.FontSize = Enum.FontSize.Size14 betterQualityText.Parent = gameSettingsMenuFrame betterQualityText.Visible = not inStudioMode - + local betterQualityShortcut = fullscreenShortcut:clone() betterQualityShortcut.Name = "BetterQualityShortcut" betterQualityShortcut.Text = "F10" - betterQualityShortcut.Position = UDim2.new(0,394,0,288) + betterQualityShortcut.Position = UDim2.new(0, 394, 0, 288) betterQualityShortcut.Parent = gameSettingsMenuFrame betterQualityShortcut.Visible = not inStudioMode - - local autoGraphicsButton = createTextButton("X",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0,25,0,25),UDim2.new(0,187,0,239)) + + local autoGraphicsButton = createTextButton( + "X", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 25, 0, 25), + UDim2.new(0, 187, 0, 239) + ) autoGraphicsButton.Name = "AutoGraphicsButton" autoGraphicsButton.ZIndex = baseZIndex + 4 autoGraphicsButton.Parent = gameSettingsMenuFrame autoGraphicsButton.Visible = not inStudioMode - - local graphicsSlider, graphicsLevel = RbxGui.CreateSlider(GraphicsQualityLevels,150,UDim2.new(0, 230, 0, 280)) -- graphics - 1 because slider starts at 1 instead of 0 + + local graphicsSlider, graphicsLevel = RbxGui.CreateSlider(GraphicsQualityLevels, 150, UDim2.new(0, 230, 0, 280)) -- graphics - 1 because slider starts at 1 instead of 0 graphicsSlider.Parent = gameSettingsMenuFrame graphicsSlider.Bar.ZIndex = baseZIndex + 4 graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5 graphicsSlider.Visible = not inStudioMode - graphicsLevel.Value = math.floor((settings().Rendering:GetMaxQualityLevel() - 1)/2) - - local graphicsSetter = Instance.new("TextBox") + graphicsLevel.Value = math.floor((settings().Rendering:GetMaxQualityLevel() - 1) / 2) + + local graphicsSetter = Instance.new "TextBox" graphicsSetter.Name = "GraphicsSetter" - graphicsSetter.BackgroundColor3 = Color3.new(0,0,0) - graphicsSetter.BorderColor3 = Color3.new(128/255,128/255,128/255) - graphicsSetter.Size = UDim2.new(0,50,0,25) - graphicsSetter.Position = UDim2.new(0,450,0,269) - graphicsSetter.TextColor3 = Color3.new(1,1,1) + graphicsSetter.BackgroundColor3 = Color3.new(0, 0, 0) + graphicsSetter.BorderColor3 = Color3.new(128 / 255, 128 / 255, 128 / 255) + graphicsSetter.Size = UDim2.new(0, 50, 0, 25) + graphicsSetter.Position = UDim2.new(0, 450, 0, 269) + graphicsSetter.TextColor3 = Color3.new(1, 1, 1) graphicsSetter.Font = Enum.Font.Arial graphicsSetter.FontSize = Enum.FontSize.Size18 graphicsSetter.Text = "Auto" @@ -773,9 +938,9 @@ local function createGameSettingsMenu(baseZIndex, shield) else settings().Rendering.EnableFRM = false end - + local listenToGraphicsLevelChange = true - + local function setAutoGraphicsGui(active) isAutoGraphics = active if active then @@ -799,17 +964,17 @@ local function createGameSettingsMenu(baseZIndex, shield) graphicsSetter.ZIndex = baseZIndex + 4 end end - + local function goToAutoGraphics() setAutoGraphicsGui(true) - + UserSettings().GameSettings.SavedQualityLevel = Enum.SavedQualitySetting.Automatic - + settings().Rendering.QualityLevel = Enum.QualityLevel.Automatic end - + local function setGraphicsQualityLevel(newLevel) - local percentage = newLevel/GraphicsQualityLevels + local percentage = newLevel / GraphicsQualityLevels local newSetting = math.floor((settings().Rendering:GetMaxQualityLevel() - 1) * percentage) if newSetting == 20 then -- Level 20 is the same as level 21, except it doesn't render ambient occlusion newSetting = 21 @@ -818,40 +983,43 @@ local function createGameSettingsMenu(baseZIndex, shield) elseif newSetting > settings().Rendering:GetMaxQualityLevel() then newSetting = settings().Rendering:GetMaxQualityLevel() - 1 end - + UserSettings().GameSettings.SavedQualityLevel = newLevel settings().Rendering.QualityLevel = newSetting end - + local function goToManualGraphics(explicitLevel) - setAutoGraphicsGui(false) - + setAutoGraphicsGui(false) + if explicitLevel then graphicsLevel.Value = explicitLevel else - graphicsLevel.Value = math.floor((settings().Rendering.AutoFRMLevel/(settings().Rendering:GetMaxQualityLevel() - 1)) * GraphicsQualityLevels) + graphicsLevel.Value = math.floor( + (settings().Rendering.AutoFRMLevel / (settings().Rendering:GetMaxQualityLevel() - 1)) + * GraphicsQualityLevels + ) end - + if explicitLevel == graphicsLevel.Value then -- make sure we are actually in right graphics mode setGraphicsQualityLevel(graphicsLevel.Value) end - + if not explicitLevel then UserSettings().GameSettings.SavedQualityLevel = graphicsLevel.Value end graphicsSetter.Text = tostring(graphicsLevel.Value) end - + local function showAutoGraphics() autoText.ZIndex = baseZIndex + 4 autoGraphicsButton.ZIndex = baseZIndex + 4 end - + local function hideAutoGraphics() autoText.ZIndex = 1 autoGraphicsButton.ZIndex = 1 end - + local function showManualGraphics() graphicsSlider.Bar.ZIndex = baseZIndex + 4 graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5 @@ -861,7 +1029,7 @@ local function createGameSettingsMenu(baseZIndex, shield) fasterText.ZIndex = baseZIndex + 4 graphicsSetter.ZIndex = baseZIndex + 4 end - + local function hideManualGraphics() betterQualityText.ZIndex = 1 betterQualityShortcut.ZIndex = 1 @@ -871,7 +1039,7 @@ local function createGameSettingsMenu(baseZIndex, shield) graphicsSlider.Bar.Slider.ZIndex = 1 graphicsSetter.ZIndex = 1 end - + local function translateSavedQualityLevelToInt(savedQualityLevel) if savedQualityLevel == Enum.SavedQualitySetting.Automatic then return 0 @@ -897,10 +1065,10 @@ local function createGameSettingsMenu(baseZIndex, shield) return 10 end end - + local function enableGraphicsWidget() settings().Rendering.EnableFRM = true - + isAutoGraphics = (UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic) if isAutoGraphics then showAutoGraphics() @@ -911,43 +1079,48 @@ local function createGameSettingsMenu(baseZIndex, shield) goToManualGraphics(translateSavedQualityLevelToInt(UserSettings().GameSettings.SavedQualityLevel)) end end - + local function disableGraphicsWidget() hideManualGraphics() hideAutoGraphics() settings().Rendering.EnableFRM = false end - + graphicsSetter.FocusLost:connect(function() - if isAutoGraphics then + if isAutoGraphics then graphicsSetter.Text = tostring(graphicsLevel.Value) return end - + local newGraphicsValue = tonumber(graphicsSetter.Text) if newGraphicsValue == nil then graphicsSetter.Text = tostring(graphicsLevel.Value) return end - - if newGraphicsValue < 1 then newGraphicsValue = 1 + + if newGraphicsValue < 1 then + newGraphicsValue = 1 elseif newGraphicsValue >= settings().Rendering:GetMaxQualityLevel() then newGraphicsValue = settings().Rendering:GetMaxQualityLevel() - 1 end - + graphicsLevel.Value = newGraphicsValue setGraphicsQualityLevel(graphicsLevel.Value) graphicsSetter.Text = tostring(graphicsLevel.Value) end) - + graphicsLevel.Changed:connect(function(prop) - if isAutoGraphics then return end - if not listenToGraphicsLevelChange then return end - + if isAutoGraphics then + return + end + if not listenToGraphicsLevelChange then + return + end + graphicsSetter.Text = tostring(graphicsLevel.Value) setGraphicsQualityLevel(graphicsLevel.Value) end) - + -- setup our graphic mode on load if inStudioMode or UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic then if inStudioMode then @@ -961,48 +1134,58 @@ local function createGameSettingsMenu(baseZIndex, shield) settings().Rendering.EnableFRM = true goToManualGraphics(translateSavedQualityLevelToInt(UserSettings().GameSettings.SavedQualityLevel)) end - + autoGraphicsButton.MouseButton1Click:connect(function() - if inStudioMode and not game.Players.LocalPlayer then return end - + if inStudioMode and not game.Players.LocalPlayer then + return + end + if not isAutoGraphics then goToAutoGraphics() else goToManualGraphics(graphicsLevel.Value) end end) - + local lastUpdate = nil game.GraphicsQualityChangeRequest:connect(function(graphicsIncrease) - if isAutoGraphics then return end -- only can set graphics in manual mode - + if isAutoGraphics then + return + end -- only can set graphics in manual mode + if graphicsIncrease then - if (graphicsLevel.Value + 1) > GraphicsQualityLevels then return end + if (graphicsLevel.Value + 1) > GraphicsQualityLevels then + return + end graphicsLevel.Value = graphicsLevel.Value + 1 graphicsSetter.Text = tostring(graphicsLevel.Value) setGraphicsQualityLevel(graphicsLevel.Value) - - game:GetService("GuiService"):SendNotification("Graphics Quality", + + game:GetService("GuiService"):SendNotification( + "Graphics Quality", "Increased to (" .. graphicsSetter.Text .. ")", "", 2, - function() - end) + function() end + ) else - if (graphicsLevel.Value - 1) <= 0 then return end + if (graphicsLevel.Value - 1) <= 0 then + return + end graphicsLevel.Value = graphicsLevel.Value - 1 graphicsSetter.Text = tostring(graphicsLevel.Value) setGraphicsQualityLevel(graphicsLevel.Value) - - game:GetService("GuiService"):SendNotification("Graphics Quality", + + game:GetService("GuiService"):SendNotification( + "Graphics Quality", "Decreased to (" .. graphicsSetter.Text .. ")", "", 2, - function() - end) + function() end + ) end end) - + game.Players.PlayerAdded:connect(function(player) if player == game.Players.LocalPlayer and inStudioMode then enableGraphicsWidget() @@ -1014,13 +1197,19 @@ local function createGameSettingsMenu(baseZIndex, shield) end end) - studioCheckbox = createTextButton("",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0,25,0,25),UDim2.new(0,30,0,176)) + studioCheckbox = createTextButton( + "", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 25, 0, 25), + UDim2.new(0, 30, 0, 176) + ) studioCheckbox.Name = "StudioCheckbox" studioCheckbox.ZIndex = baseZIndex + 4 --studioCheckbox.Parent = gameSettingsMenuFrame -- todo: enable when studio h4x aren't an issue anymore - studioCheckbox:SetVerb("TogglePlayMode") + studioCheckbox:SetVerb "TogglePlayMode" studioCheckbox.Visible = false -- todo: enabled when studio h4x aren't an issue anymore - + local wasManualGraphics = (settings().Rendering.QualityLevel ~= Enum.QualityLevel.Automatic) if inStudioMode and not game.Players.LocalPlayer then studioCheckbox.Text = "X" @@ -1030,7 +1219,7 @@ local function createGameSettingsMenu(baseZIndex, shield) enableGraphicsWidget() end if hasGraphicsSlider then - UserSettings().GameSettings.StudioModeChanged:connect(function(isStudioMode) + UserSettings().GameSettings.StudioModeChanged:connect(function(isStudioMode) inStudioMode = isStudioMode if isStudioMode then wasManualGraphics = (settings().Rendering.QualityLevel ~= Enum.QualityLevel.Automatic) @@ -1049,8 +1238,10 @@ local function createGameSettingsMenu(baseZIndex, shield) end) else studioCheckbox.MouseButton1Click:connect(function() - if not studioCheckbox.Active then return end - + if not studioCheckbox.Active then + return + end + if studioCheckbox.Text == "" then studioCheckbox.Text = "X" else @@ -1059,13 +1250,21 @@ local function createGameSettingsMenu(baseZIndex, shield) end) end end - - local fullscreenCheckbox = createTextButton("",Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0,25,0,25),UDim2.new(0,30,0,144)) + + local fullscreenCheckbox = createTextButton( + "", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 25, 0, 25), + UDim2.new(0, 30, 0, 144) + ) fullscreenCheckbox.Name = "FullscreenCheckbox" fullscreenCheckbox.ZIndex = baseZIndex + 4 fullscreenCheckbox.Parent = gameSettingsMenuFrame - fullscreenCheckbox:SetVerb("ToggleFullScreen") - if UserSettings().GameSettings:InFullScreen() then fullscreenCheckbox.Text = "X" end + fullscreenCheckbox:SetVerb "ToggleFullScreen" + if UserSettings().GameSettings:InFullScreen() then + fullscreenCheckbox.Text = "X" + end if hasGraphicsSlider then UserSettings().GameSettings.FullscreenChanged:connect(function(isFullscreen) if isFullscreen then @@ -1081,40 +1280,52 @@ local function createGameSettingsMenu(baseZIndex, shield) else fullscreenCheckbox.Text = "" end - end) + end) end - - if game:FindFirstChild("NetworkClient") then -- we are playing online + + if game:FindFirstChild "NetworkClient" then -- we are playing online setDisabledState(studioText) setDisabledState(studioShortcut) setDisabledState(studioCheckbox) end - + local backButton if hasGraphicsSlider then - backButton = createTextButton("OK",Enum.ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,180,0,50),UDim2.new(0,170,0,330)) + backButton = createTextButton( + "OK", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 180, 0, 50), + UDim2.new(0, 170, 0, 330) + ) backButton.Modal = true else - backButton = createTextButton("OK",Enum.ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,180,0,50),UDim2.new(0,170,0,270)) + backButton = createTextButton( + "OK", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 180, 0, 50), + UDim2.new(0, 170, 0, 270) + ) backButton.Modal = true end - + backButton.Name = "BackButton" backButton.ZIndex = baseZIndex + 4 backButton.Parent = gameSettingsMenuFrame - + local syncVideoCaptureSetting = nil if not macClient then - local videoCaptureLabel = Instance.new("TextLabel") + local videoCaptureLabel = Instance.new "TextLabel" videoCaptureLabel.Name = "VideoCaptureLabel" videoCaptureLabel.Text = "After Capturing Video" videoCaptureLabel.Font = Enum.Font.Arial videoCaptureLabel.FontSize = Enum.FontSize.Size18 - videoCaptureLabel.Position = UDim2.new(0,32,0,100) - videoCaptureLabel.Size = UDim2.new(0,164,0,18) + videoCaptureLabel.Position = UDim2.new(0, 32, 0, 100) + videoCaptureLabel.Size = UDim2.new(0, 164, 0, 18) videoCaptureLabel.BackgroundTransparency = 1 - videoCaptureLabel.TextColor3 = Color3I(255,255,255) + videoCaptureLabel.TextColor3 = Color3I(255, 255, 255) videoCaptureLabel.TextXAlignment = Enum.TextXAlignment.Left videoCaptureLabel.ZIndex = baseZIndex + 4 videoCaptureLabel.Parent = gameSettingsMenuFrame @@ -1127,16 +1338,15 @@ local function createGameSettingsMenu(baseZIndex, shield) videoNameToItem[videoNames[2]] = Enum.UploadSetting["Ask me first"] local videoCaptureDropDown = nil - videoCaptureDropDown, updateVideoCaptureDropDownSelection = RbxGui.CreateDropDownMenu(videoNames, - function(text) - UserSettings().GameSettings.VideoUploadPromptBehavior = videoNameToItem[text] - end) + videoCaptureDropDown, updateVideoCaptureDropDownSelection = RbxGui.CreateDropDownMenu(videoNames, function(text) + UserSettings().GameSettings.VideoUploadPromptBehavior = videoNameToItem[text] + end) videoCaptureDropDown.Name = "VideoCaptureField" videoCaptureDropDown.ZIndex = baseZIndex + 4 videoCaptureDropDown.DropDownMenuButton.ZIndex = baseZIndex + 4 videoCaptureDropDown.DropDownMenuButton.Icon.ZIndex = baseZIndex + 4 videoCaptureDropDown.Position = UDim2.new(0, 270, 0, 94) - videoCaptureDropDown.Size = UDim2.new(0,200,0,32) + videoCaptureDropDown.Size = UDim2.new(0, 200, 0, 32) videoCaptureDropDown.Parent = gameSettingsMenuFrame syncVideoCaptureSetting = function() @@ -1150,749 +1360,859 @@ local function createGameSettingsMenu(baseZIndex, shield) end end end - - local cameraLabel = Instance.new("TextLabel") + + local cameraLabel = Instance.new "TextLabel" cameraLabel.Name = "CameraLabel" cameraLabel.Text = "Character & Camera Controls" cameraLabel.Font = Enum.Font.Arial cameraLabel.FontSize = Enum.FontSize.Size18 - cameraLabel.Position = UDim2.new(0,31,0,58) - cameraLabel.Size = UDim2.new(0,224,0,18) - cameraLabel.TextColor3 = Color3I(255,255,255) + cameraLabel.Position = UDim2.new(0, 31, 0, 58) + cameraLabel.Size = UDim2.new(0, 224, 0, 18) + cameraLabel.TextColor3 = Color3I(255, 255, 255) cameraLabel.TextXAlignment = Enum.TextXAlignment.Left cameraLabel.BackgroundTransparency = 1 cameraLabel.ZIndex = baseZIndex + 4 cameraLabel.Parent = gameSettingsMenuFrame - local mouseLockLabel = game.CoreGui.RobloxGui:FindFirstChild("MouseLockLabel",true) + local mouseLockLabel = game.CoreGui.RobloxGui:FindFirstChild("MouseLockLabel", true) local enumItems = Enum.ControlMode:GetEnumItems() local enumNames = {} local enumNameToItem = {} - for i,obj in ipairs(enumItems) do + for i, obj in ipairs(enumItems) do enumNames[i] = obj.Name enumNameToItem[obj.Name] = obj end local cameraDropDown - cameraDropDown, updateCameraDropDownSelection = RbxGui.CreateDropDownMenu(enumNames, - function(text) - UserSettings().GameSettings.ControlMode = enumNameToItem[text] - - pcall(function() - if mouseLockLabel and UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then - mouseLockLabel.Visible = true - elseif mouseLockLabel then - mouseLockLabel.Visible = false - end - end) + cameraDropDown, updateCameraDropDownSelection = RbxGui.CreateDropDownMenu(enumNames, function(text) + UserSettings().GameSettings.ControlMode = enumNameToItem[text] + + pcall(function() + if mouseLockLabel and UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then + mouseLockLabel.Visible = true + elseif mouseLockLabel then + mouseLockLabel.Visible = false + end end) + end) cameraDropDown.Name = "CameraField" cameraDropDown.ZIndex = baseZIndex + 4 cameraDropDown.DropDownMenuButton.ZIndex = baseZIndex + 4 cameraDropDown.DropDownMenuButton.Icon.ZIndex = baseZIndex + 4 cameraDropDown.Position = UDim2.new(0, 270, 0, 52) - cameraDropDown.Size = UDim2.new(0,200,0,32) + cameraDropDown.Size = UDim2.new(0, 200, 0, 32) cameraDropDown.Parent = gameSettingsMenuFrame - + return gameSettingsMenuFrame end if LoadLibrary then - RbxGui = LoadLibrary("RbxGui") - local baseZIndex = 0 -if UserSettings then + RbxGui = LoadLibrary "RbxGui" + local baseZIndex = 0 + if UserSettings then + local createSettingsDialog = function() + waitForChild(gui, "BottomLeftControl") + settingsButton = gui.BottomLeftControl:FindFirstChild "SettingsButton" - local createSettingsDialog = function() - waitForChild(gui,"BottomLeftControl") - settingsButton = gui.BottomLeftControl:FindFirstChild("SettingsButton") - - if settingsButton == nil then - settingsButton = Instance.new("ImageButton") - settingsButton.Name = "SettingsButton" - settingsButton.Image = "rbxasset://textures/ui/SettingsButton.png" - settingsButton.BackgroundTransparency = 1 - settingsButton.Active = false - settingsButton.Size = UDim2.new(0,54,0,46) - settingsButton.Position = UDim2.new(0,2,0,50) - settingsButton.Parent = gui.BottomLeftControl - end + if settingsButton == nil then + settingsButton = Instance.new "ImageButton" + settingsButton.Name = "SettingsButton" + settingsButton.Image = "rbxasset://textures/ui/SettingsButton.png" + settingsButton.BackgroundTransparency = 1 + settingsButton.Active = false + settingsButton.Size = UDim2.new(0, 54, 0, 46) + settingsButton.Position = UDim2.new(0, 2, 0, 50) + settingsButton.Parent = gui.BottomLeftControl + end - local shield = Instance.new("TextButton") - shield.Text = "" - shield.Name = "UserSettingsShield" - shield.Active = true - shield.AutoButtonColor = false - shield.Visible = false - shield.Size = UDim2.new(1,0,1,0) - shield.BackgroundColor3 = Color3I(51,51,51) - shield.BorderColor3 = Color3I(27,42,53) - shield.BackgroundTransparency = 0.4 - shield.ZIndex = baseZIndex + 2 - mainShield = shield + local shield = Instance.new "TextButton" + shield.Text = "" + shield.Name = "UserSettingsShield" + shield.Active = true + shield.AutoButtonColor = false + shield.Visible = false + shield.Size = UDim2.new(1, 0, 1, 0) + shield.BackgroundColor3 = Color3I(51, 51, 51) + shield.BorderColor3 = Color3I(27, 42, 53) + shield.BackgroundTransparency = 0.4 + shield.ZIndex = baseZIndex + 2 + mainShield = shield - local frame = Instance.new("Frame") - frame.Name = "Settings" - frame.Position = UDim2.new(0.5, -262, -0.5, -200) - frame.Size = UDim2.new(0, 525, 0, 430) - frame.BackgroundTransparency = 1 - frame.Active = true - frame.Parent = shield + local frame = Instance.new "Frame" + frame.Name = "Settings" + frame.Position = UDim2.new(0.5, -262, -0.5, -200) + frame.Size = UDim2.new(0, 525, 0, 430) + frame.BackgroundTransparency = 1 + frame.Active = true + frame.Parent = shield - local settingsFrame = Instance.new("Frame") - settingsFrame.Name = "SettingsStyle" - settingsFrame.Size = UDim2.new(1, 0, 1, 0) - settingsFrame.Style = Enum.FrameStyle.RobloxRound - settingsFrame.Active = true - settingsFrame.ZIndex = baseZIndex + 3 - settingsFrame.Parent = frame - - local gameMainMenu = createGameMainMenu(baseZIndex, shield) - gameMainMenu.Parent = settingsFrame - - gameMainMenu.ScreenshotButton.MouseButton1Click:connect(function() - backToGame(gameMainMenu.ScreenshotButton, shield, settingsButton) - end) - - gameMainMenu.RecordVideoButton.MouseButton1Click:connect(function() - recordVideoClick(gameMainMenu.RecordVideoButton, gui.StopRecordButton) - backToGame(gameMainMenu.RecordVideoButton, shield, settingsButton) - end) - - if settings():FindFirstChild("Game Options") then - pcall(function() - settings():FindFirstChild("Game Options").VideoRecordingChangeRequest:connect(function(recording) - recordingVideo = recording - setRecordGui(recording, gui.StopRecordButton, gameMainMenu.RecordVideoButton) - end) + local settingsFrame = Instance.new "Frame" + settingsFrame.Name = "SettingsStyle" + settingsFrame.Size = UDim2.new(1, 0, 1, 0) + settingsFrame.Style = Enum.FrameStyle.RobloxRound + settingsFrame.Active = true + settingsFrame.ZIndex = baseZIndex + 3 + settingsFrame.Parent = frame + + local gameMainMenu = createGameMainMenu(baseZIndex, shield) + gameMainMenu.Parent = settingsFrame + + gameMainMenu.ScreenshotButton.MouseButton1Click:connect(function() + backToGame(gameMainMenu.ScreenshotButton, shield, settingsButton) end) - end - - game.CoreGui.RobloxGui.Changed:connect(function(prop) -- We have stopped recording when we resize - if prop == "AbsoluteSize" and recordingVideo then + + gameMainMenu.RecordVideoButton.MouseButton1Click:connect(function() recordVideoClick(gameMainMenu.RecordVideoButton, gui.StopRecordButton) - end - end) - - function localPlayerChange() - gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer - if game.Players.LocalPlayer then - settings().Rendering.EnableFRM = true - elseif inStudioMode then - settings().Rendering.EnableFRM = false - end - end - - gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer - if game.Players.LocalPlayer ~= nil then - game.Players.LocalPlayer.Changed:connect(function() - localPlayerChange() + backToGame(gameMainMenu.RecordVideoButton, shield, settingsButton) end) - else - delay(0,function() - waitForProperty(game.Players,"LocalPlayer") + + if settings():FindFirstChild "Game Options" then + pcall(function() + settings():FindFirstChild("Game Options").VideoRecordingChangeRequest:connect(function(recording) + recordingVideo = recording + setRecordGui(recording, gui.StopRecordButton, gameMainMenu.RecordVideoButton) + end) + end) + end + + game.CoreGui.RobloxGui.Changed:connect(function(prop) -- We have stopped recording when we resize + if prop == "AbsoluteSize" and recordingVideo then + recordVideoClick(gameMainMenu.RecordVideoButton, gui.StopRecordButton) + end + end) + + function localPlayerChange() gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer + if game.Players.LocalPlayer then + settings().Rendering.EnableFRM = true + elseif inStudioMode then + settings().Rendering.EnableFRM = false + end + end + + gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer + if game.Players.LocalPlayer ~= nil then game.Players.LocalPlayer.Changed:connect(function() localPlayerChange() end) + else + delay(0, function() + waitForProperty(game.Players, "LocalPlayer") + gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer + game.Players.LocalPlayer.Changed:connect(function() + localPlayerChange() + end) + end) + end + + gameMainMenu.ReportAbuseButton.Visible = game:FindFirstChild "NetworkClient" + if not gameMainMenu.ReportAbuseButton.Visible then + game.ChildAdded:connect(function(child) + if child:IsA "NetworkClient" then + gameMainMenu.ReportAbuseButton.Visible = game:FindFirstChild "NetworkClient" + end + end) + end + + gameMainMenu.ResetButton.MouseButton1Click:connect(function() + goToMenu(settingsFrame, "ResetConfirmationMenu", "up", UDim2.new(0, 525, 0, 370)) end) - end - - gameMainMenu.ReportAbuseButton.Visible = game:FindFirstChild("NetworkClient") - if not gameMainMenu.ReportAbuseButton.Visible then - game.ChildAdded:connect(function(child) - if child:IsA("NetworkClient") then - gameMainMenu.ReportAbuseButton.Visible = game:FindFirstChild("NetworkClient") - end + + gameMainMenu.LeaveGameButton.MouseButton1Click:connect(function() + goToMenu(settingsFrame, "LeaveConfirmationMenu", "down", UDim2.new(0, 525, 0, 300)) end) - end - - gameMainMenu.ResetButton.MouseButton1Click:connect(function() - goToMenu(settingsFrame,"ResetConfirmationMenu","up",UDim2.new(0,525,0,370)) - end) - - gameMainMenu.LeaveGameButton.MouseButton1Click:connect(function() - goToMenu(settingsFrame,"LeaveConfirmationMenu","down",UDim2.new(0,525,0,300)) - end) - - if game.CoreGui.Version >= 4 then -- we can use escape! - game:GetService("GuiService").EscapeKeyPressed:connect(function() - if currentMenuSelection == nil then - game.GuiService:AddCenterDialog(shield, Enum.CenterDialogType.ModalDialog, - --showFunction - function() - settingsButton.Active = false - updateCameraDropDownSelection(UserSettings().GameSettings.ControlMode.Name) - - if syncVideoCaptureSetting then - syncVideoCaptureSetting() + + if game.CoreGui.Version >= 4 then -- we can use escape! + game:GetService("GuiService").EscapeKeyPressed:connect(function() + if currentMenuSelection == nil then + game.GuiService:AddCenterDialog( + shield, + Enum.CenterDialogType.ModalDialog, + --showFunction + function() + settingsButton.Active = false + updateCameraDropDownSelection(UserSettings().GameSettings.ControlMode.Name) + + if syncVideoCaptureSetting then + syncVideoCaptureSetting() + end + + goToMenu(settingsFrame, "GameMainMenu", "right", UDim2.new(0, 525, 0, 430)) + shield.Visible = true + shield.Active = true + settingsFrame.Parent:TweenPosition( + UDim2.new(0.5, -262, 0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + end, + --hideFunction + function() + settingsFrame.Parent:TweenPosition( + UDim2.new(0.5, -262, -0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + shield.Visible = false + settingsButton.Active = true end - - goToMenu(settingsFrame,"GameMainMenu","right",UDim2.new(0,525,0,430)) - shield.Visible = true - shield.Active = true - settingsFrame.Parent:TweenPosition(UDim2.new(0.5, -262,0.5, -200),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) - settingsFrame.Parent:TweenSize(UDim2.new(0,525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) - end, - --hideFunction - function() - settingsFrame.Parent:TweenPosition(UDim2.new(0.5, -262,-0.5, -200),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) - settingsFrame.Parent:TweenSize(UDim2.new(0,525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) - shield.Visible = false - settingsButton.Active = true - end) - elseif #lastMenuSelection > 0 then - if #centerDialogs > 0 then - for i = 1, #centerDialogs do - game.GuiService:RemoveCenterDialog(centerDialogs[i]) - centerDialogs[i].Visible = false + ) + elseif #lastMenuSelection > 0 then + if #centerDialogs > 0 then + for i = 1, #centerDialogs do + game.GuiService:RemoveCenterDialog(centerDialogs[i]) + centerDialogs[i].Visible = false + end + centerDialogs = {} end - centerDialogs = {} + + goToMenu( + lastMenuSelection[#lastMenuSelection]["container"], + lastMenuSelection[#lastMenuSelection]["name"], + lastMenuSelection[#lastMenuSelection]["direction"], + lastMenuSelection[#lastMenuSelection]["lastSize"] + ) + + table.remove(lastMenuSelection, #lastMenuSelection) + if #lastMenuSelection == 1 then -- apparently lua can't reduce count to 0... T_T + lastMenuSelection = {} + end + else + resumeGameFunction(shield) end - - goToMenu(lastMenuSelection[#lastMenuSelection]["container"],lastMenuSelection[#lastMenuSelection]["name"], - lastMenuSelection[#lastMenuSelection]["direction"],lastMenuSelection[#lastMenuSelection]["lastSize"]) - - table.remove(lastMenuSelection,#lastMenuSelection) - if #lastMenuSelection == 1 then -- apparently lua can't reduce count to 0... T_T - lastMenuSelection = {} - end - else - resumeGameFunction(shield) - end + end) + end + + local gameSettingsMenu = createGameSettingsMenu(baseZIndex, shield) + gameSettingsMenu.Visible = false + gameSettingsMenu.Parent = settingsFrame + + gameMainMenu.SettingsButton.MouseButton1Click:connect(function() + goToMenu(settingsFrame, "GameSettingsMenu", "left", UDim2.new(0, 525, 0, 350)) end) - end - - local gameSettingsMenu = createGameSettingsMenu(baseZIndex, shield) - gameSettingsMenu.Visible = false - gameSettingsMenu.Parent = settingsFrame - - gameMainMenu.SettingsButton.MouseButton1Click:connect(function() - goToMenu(settingsFrame,"GameSettingsMenu","left",UDim2.new(0,525,0,350)) - end) - gameSettingsMenu.BackButton.MouseButton1Click:connect(function() - goToMenu(settingsFrame,"GameMainMenu","right",UDim2.new(0,525,0,430)) - end) - - local resetConfirmationWindow = createResetConfirmationMenu(baseZIndex, shield) - resetConfirmationWindow.Visible = false - resetConfirmationWindow.Parent = settingsFrame - - local leaveConfirmationWindow = createLeaveConfirmationMenu(baseZIndex,shield) - leaveConfirmationWindow.Visible = false - leaveConfirmationWindow.Parent = settingsFrame + gameSettingsMenu.BackButton.MouseButton1Click:connect(function() + goToMenu(settingsFrame, "GameMainMenu", "right", UDim2.new(0, 525, 0, 430)) + end) - robloxLock(shield) - - settingsButton.MouseButton1Click:connect( - function() - game.GuiService:AddCenterDialog(shield, Enum.CenterDialogType.ModalDialog, + local resetConfirmationWindow = createResetConfirmationMenu(baseZIndex, shield) + resetConfirmationWindow.Visible = false + resetConfirmationWindow.Parent = settingsFrame + + local leaveConfirmationWindow = createLeaveConfirmationMenu(baseZIndex, shield) + leaveConfirmationWindow.Visible = false + leaveConfirmationWindow.Parent = settingsFrame + + robloxLock(shield) + + settingsButton.MouseButton1Click:connect(function() + game.GuiService:AddCenterDialog( + shield, + Enum.CenterDialogType.ModalDialog, --showFunction function() settingsButton.Active = false updateCameraDropDownSelection(UserSettings().GameSettings.ControlMode.Name) - + if syncVideoCaptureSetting then - syncVideoCaptureSetting() + syncVideoCaptureSetting() end - goToMenu(settingsFrame,"GameMainMenu","right",UDim2.new(0,525,0,430)) + goToMenu(settingsFrame, "GameMainMenu", "right", UDim2.new(0, 525, 0, 430)) shield.Visible = true - settingsFrame.Parent:TweenPosition(UDim2.new(0.5, -262,0.5, -200),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) - settingsFrame.Parent:TweenSize(UDim2.new(0,525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) + settingsFrame.Parent:TweenPosition( + UDim2.new(0.5, -262, 0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) end, --hideFunction function() - settingsFrame.Parent:TweenPosition(UDim2.new(0.5, -262,-0.5, -200),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) - settingsFrame.Parent:TweenSize(UDim2.new(0,525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,tweenTime,true) + settingsFrame.Parent:TweenPosition( + UDim2.new(0.5, -262, -0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) shield.Visible = false settingsButton.Active = true - end) + end + ) end) - + + return shield + end + + delay(0, function() + createSettingsDialog().Parent = gui + + gui.BottomLeftControl.SettingsButton.Active = true + gui.BottomLeftControl.SettingsButton.Position = UDim2.new(0, 2, 0, -2) + + if mouseLockLabel and UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then + mouseLockLabel.Visible = true + elseif mouseLockLabel then + mouseLockLabel.Visible = false + end + + -- our script has loaded, get rid of older buttons now + local leaveGameButton = gui.BottomLeftControl:FindFirstChild "Exit" + if leaveGameButton then + leaveGameButton:Remove() + end + + local topLeft = gui:FindFirstChild "TopLeftControl" + if topLeft then + leaveGameButton = topLeft:FindFirstChild "Exit" + if leaveGameButton then + leaveGameButton:Remove() + end + + topLeft:Remove() + end + end) + end --UserSettings call + + local createSaveDialogs = function() + local shield = Instance.new "TextButton" + shield.Text = "" + shield.AutoButtonColor = false + shield.Name = "SaveDialogShield" + shield.Active = true + shield.Visible = false + shield.Size = UDim2.new(1, 0, 1, 0) + shield.BackgroundColor3 = Color3I(51, 51, 51) + shield.BorderColor3 = Color3I(27, 42, 53) + shield.BackgroundTransparency = 0.4 + shield.ZIndex = baseZIndex + 1 + + local clearAndResetDialog + local save + local saveLocal + local dontSave + local cancel + + local messageBoxButtons = {} + messageBoxButtons[1] = {} + messageBoxButtons[1].Text = "Save" + messageBoxButtons[1].Style = Enum.ButtonStyle.RobloxButtonDefault + messageBoxButtons[1].Function = function() + save() + end + messageBoxButtons[2] = {} + messageBoxButtons[2].Text = "Cancel" + messageBoxButtons[2].Function = function() + cancel() + end + messageBoxButtons[3] = {} + messageBoxButtons[3].Text = "Don't Save" + messageBoxButtons[3].Function = function() + dontSave() + end + + local saveDialogMessageBox = RbxGui.CreateStyledMessageDialog( + "Unsaved Changes", + "Save your changes to ROBLOX before leaving?", + "Confirm", + messageBoxButtons + ) + saveDialogMessageBox.Visible = true + saveDialogMessageBox.Parent = shield + + local errorBoxButtons = {} + + local buttonOffset = 1 + if game.LocalSaveEnabled then + errorBoxButtons[buttonOffset] = {} + errorBoxButtons[buttonOffset].Text = "Save to Disk" + errorBoxButtons[buttonOffset].Function = function() + saveLocal() + end + buttonOffset = buttonOffset + 1 + end + errorBoxButtons[buttonOffset] = {} + errorBoxButtons[buttonOffset].Text = "Keep Playing" + errorBoxButtons[buttonOffset].Function = function() + cancel() + end + errorBoxButtons[buttonOffset + 1] = {} + errorBoxButtons[buttonOffset + 1].Text = "Don't Save" + errorBoxButtons[buttonOffset + 1].Function = function() + dontSave() + end + + local errorDialogMessageBox = RbxGui.CreateStyledMessageDialog( + "Upload Failed", + "Sorry, we could not save your changes to ROBLOX.", + "Error", + errorBoxButtons + ) + errorDialogMessageBox.Visible = false + errorDialogMessageBox.Parent = shield + + local spinnerDialog = Instance.new "Frame" + spinnerDialog.Name = "SpinnerDialog" + spinnerDialog.Style = Enum.FrameStyle.RobloxRound + spinnerDialog.Size = UDim2.new(0, 350, 0, 150) + spinnerDialog.Position = UDim2.new(0.5, -175, 0.5, -75) + spinnerDialog.Visible = false + spinnerDialog.Active = true + spinnerDialog.Parent = shield + + local waitingLabel = Instance.new "TextLabel" + waitingLabel.Name = "WaitingLabel" + waitingLabel.Text = "Saving to ROBLOX..." + waitingLabel.Font = Enum.Font.ArialBold + waitingLabel.FontSize = Enum.FontSize.Size18 + waitingLabel.Position = UDim2.new(0.5, 25, 0.5, 0) + waitingLabel.TextColor3 = Color3.new(1, 1, 1) + waitingLabel.Parent = spinnerDialog + + local spinnerFrame = Instance.new "Frame" + spinnerFrame.Name = "Spinner" + spinnerFrame.Size = UDim2.new(0, 80, 0, 80) + spinnerFrame.Position = UDim2.new(0.5, -150, 0.5, -40) + spinnerFrame.BackgroundTransparency = 1 + spinnerFrame.Parent = spinnerDialog + + local spinnerIcons = {} + local spinnerNum = 1 + while spinnerNum <= 8 do + local spinnerImage = Instance.new "ImageLabel" + spinnerImage.Name = "Spinner" .. spinnerNum + spinnerImage.Size = UDim2.new(0, 16, 0, 16) + spinnerImage.Position = UDim2.new( + 0.5 + 0.3 * math.cos(math.rad(45 * spinnerNum)), + -8, + 0.5 + 0.3 * math.sin(math.rad(45 * spinnerNum)), + -8 + ) + spinnerImage.BackgroundTransparency = 1 + spinnerImage.Image = "http://www.roblox.com/Asset?id=45880710" + spinnerImage.Parent = spinnerFrame + + spinnerIcons[spinnerNum] = spinnerImage + spinnerNum = spinnerNum + 1 + end + + save = function() + saveDialogMessageBox.Visible = false + + --Show the spinner dialog + spinnerDialog.Visible = true + local spin = true + --Make it spin + delay(0, function() + local spinPos = 0 + while spin do + local pos = 0 + + while pos < 8 do + if pos == spinPos or pos == ((spinPos + 1) % 8) then + spinnerIcons[pos + 1].Image = "http://www.roblox.com/Asset?id=45880668" + else + spinnerIcons[pos + 1].Image = "http://www.roblox.com/Asset?id=45880710" + end + + pos = pos + 1 + end + spinPos = (spinPos + 1) % 8 + wait(0.2) + end + end) + + --Do the save while the spinner is going, function will wait + local result = game:SaveToRoblox() + if not result then + --Try once more + result = game:SaveToRoblox() + end + + --Hide the spinner dialog + spinnerDialog.Visible = false + --And cause the delay thread to stop + spin = false + + --Now process the result + if result then + --Success, close + game:FinishShutdown(false) + clearAndResetDialog() + else + --Failure, show the second dialog prompt + errorDialogMessageBox.Visible = true + end + end + + saveLocal = function() + errorDialogMessageBox.Visible = false + game:FinishShutdown(true) + clearAndResetDialog() + end + + dontSave = function() + saveDialogMessageBox.Visible = false + errorDialogMessageBox.Visible = false + game:FinishShutdown(false) + clearAndResetDialog() + end + cancel = function() + saveDialogMessageBox.Visible = false + errorDialogMessageBox.Visible = false + clearAndResetDialog() + end + + clearAndResetDialog = function() + saveDialogMessageBox.Visible = true + errorDialogMessageBox.Visible = false + spinnerDialog.Visible = false + shield.Visible = false + game.GuiService:RemoveCenterDialog(shield) + end + + robloxLock(shield) + shield.Visible = false return shield end - delay(0, function() - createSettingsDialog().Parent = gui - - gui.BottomLeftControl.SettingsButton.Active = true - gui.BottomLeftControl.SettingsButton.Position = UDim2.new(0,2,0,-2) - - if mouseLockLabel and UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then - mouseLockLabel.Visible = true - elseif mouseLockLabel then - mouseLockLabel.Visible = false - end - - -- our script has loaded, get rid of older buttons now - local leaveGameButton = gui.BottomLeftControl:FindFirstChild("Exit") - if leaveGameButton then leaveGameButton:Remove() end - - local topLeft = gui:FindFirstChild("TopLeftControl") - if topLeft then - leaveGameButton = topLeft:FindFirstChild("Exit") - if leaveGameButton then leaveGameButton:Remove() end + local createReportAbuseDialog = function() + --Only show things if we are a NetworkClient + waitForChild(game, "NetworkClient") - topLeft:Remove() - end - end) - -end --UserSettings call + waitForChild(game, "Players") + waitForProperty(game.Players, "LocalPlayer") + local localPlayer = game.Players.LocalPlayer -local createSaveDialogs = function() - local shield = Instance.new("TextButton") - shield.Text = "" - shield.AutoButtonColor = false - shield.Name = "SaveDialogShield" - shield.Active = true - shield.Visible = false - shield.Size = UDim2.new(1,0,1,0) - shield.BackgroundColor3 = Color3I(51,51,51) - shield.BorderColor3 = Color3I(27,42,53) - shield.BackgroundTransparency = 0.4 - shield.ZIndex = baseZIndex+1 + local reportAbuseButton + waitForChild(gui, "UserSettingsShield") + waitForChild(gui.UserSettingsShield, "Settings") + waitForChild(gui.UserSettingsShield.Settings, "SettingsStyle") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle, "GameMainMenu") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, "ReportAbuseButton") + reportAbuseButton = gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton - local clearAndResetDialog - local save - local saveLocal - local dontSave - local cancel - - local messageBoxButtons = {} - messageBoxButtons[1] = {} - messageBoxButtons[1].Text = "Save" - messageBoxButtons[1].Style = Enum.ButtonStyle.RobloxButtonDefault - messageBoxButtons[1].Function = function() save() end - messageBoxButtons[2] = {} - messageBoxButtons[2].Text = "Cancel" - messageBoxButtons[2].Function = function() cancel() end - messageBoxButtons[3] = {} - messageBoxButtons[3].Text = "Don't Save" - messageBoxButtons[3].Function = function() dontSave() end - - local saveDialogMessageBox = RbxGui.CreateStyledMessageDialog("Unsaved Changes", "Save your changes to ROBLOX before leaving?", "Confirm", messageBoxButtons) - saveDialogMessageBox.Visible = true - saveDialogMessageBox.Parent = shield - - - local errorBoxButtons = {} - - local buttonOffset = 1 - if game.LocalSaveEnabled then - errorBoxButtons[buttonOffset] = {} - errorBoxButtons[buttonOffset].Text = "Save to Disk" - errorBoxButtons[buttonOffset].Function = function() saveLocal() end - buttonOffset = buttonOffset + 1 - end - errorBoxButtons[buttonOffset] = {} - errorBoxButtons[buttonOffset].Text = "Keep Playing" - errorBoxButtons[buttonOffset].Function = function() cancel() end - errorBoxButtons[buttonOffset+1] = {} - errorBoxButtons[buttonOffset+1].Text = "Don't Save" - errorBoxButtons[buttonOffset+1].Function = function() dontSave() end - - local errorDialogMessageBox = RbxGui.CreateStyledMessageDialog("Upload Failed", "Sorry, we could not save your changes to ROBLOX.", "Error", errorBoxButtons) - errorDialogMessageBox.Visible = false - errorDialogMessageBox.Parent = shield - - local spinnerDialog = Instance.new("Frame") - spinnerDialog.Name = "SpinnerDialog" - spinnerDialog.Style = Enum.FrameStyle.RobloxRound - spinnerDialog.Size = UDim2.new(0, 350, 0, 150) - spinnerDialog.Position = UDim2.new(.5, -175, .5, -75) - spinnerDialog.Visible = false - spinnerDialog.Active = true - spinnerDialog.Parent = shield - - local waitingLabel = Instance.new("TextLabel") - waitingLabel.Name = "WaitingLabel" - waitingLabel.Text = "Saving to ROBLOX..." - waitingLabel.Font = Enum.Font.ArialBold - waitingLabel.FontSize = Enum.FontSize.Size18 - waitingLabel.Position = UDim2.new(0.5, 25, 0.5, 0) - waitingLabel.TextColor3 = Color3.new(1,1,1) - waitingLabel.Parent = spinnerDialog - - local spinnerFrame = Instance.new("Frame") - spinnerFrame.Name = "Spinner" - spinnerFrame.Size = UDim2.new(0, 80, 0, 80) - spinnerFrame.Position = UDim2.new(0.5, -150, 0.5, -40) - spinnerFrame.BackgroundTransparency = 1 - spinnerFrame.Parent = spinnerDialog - - local spinnerIcons = {} - local spinnerNum = 1 - while spinnerNum <= 8 do - local spinnerImage = Instance.new("ImageLabel") - spinnerImage.Name = "Spinner"..spinnerNum - spinnerImage.Size = UDim2.new(0, 16, 0, 16) - spinnerImage.Position = UDim2.new(.5+.3*math.cos(math.rad(45*spinnerNum)), -8, .5+.3*math.sin(math.rad(45*spinnerNum)), -8) - spinnerImage.BackgroundTransparency = 1 - spinnerImage.Image = "http://www.roblox.com/Asset?id=45880710" - spinnerImage.Parent = spinnerFrame - - spinnerIcons[spinnerNum] = spinnerImage - spinnerNum = spinnerNum + 1 - end - - save = function() - saveDialogMessageBox.Visible = false - - --Show the spinner dialog - spinnerDialog.Visible = true - local spin = true - --Make it spin - delay(0, function() - local spinPos = 0 - while spin do - local pos = 0 - - while pos < 8 do - if pos == spinPos or pos == ((spinPos+1)%8) then - spinnerIcons[pos+1].Image = "http://www.roblox.com/Asset?id=45880668" - else - spinnerIcons[pos+1].Image = "http://www.roblox.com/Asset?id=45880710" - end - - pos = pos + 1 - end - spinPos = (spinPos + 1) % 8 - wait(0.2) - end - end) - - --Do the save while the spinner is going, function will wait - local result = game:SaveToRoblox() - if not result then - --Try once more - result = game:SaveToRoblox() - end - - --Hide the spinner dialog - spinnerDialog.Visible = false - --And cause the delay thread to stop - spin = false - - --Now process the result - if result then - --Success, close - game:FinishShutdown(false) - clearAndResetDialog() - else - --Failure, show the second dialog prompt - errorDialogMessageBox.Visible = true - end - end - - saveLocal = function() - errorDialogMessageBox.Visible = false - game:FinishShutdown(true) - clearAndResetDialog() - end - - dontSave = function() - saveDialogMessageBox.Visible = false - errorDialogMessageBox.Visible = false - game:FinishShutdown(false) - clearAndResetDialog() - end - cancel = function() - saveDialogMessageBox.Visible = false - errorDialogMessageBox.Visible = false - clearAndResetDialog() - end - - clearAndResetDialog = function() - saveDialogMessageBox.Visible = true - errorDialogMessageBox.Visible = false - spinnerDialog.Visible = false + local shield = Instance.new "TextButton" + shield.Name = "ReportAbuseShield" + shield.Text = "" + shield.AutoButtonColor = false + shield.Active = true shield.Visible = false - game.GuiService:RemoveCenterDialog(shield) - end + shield.Size = UDim2.new(1, 0, 1, 0) + shield.BackgroundColor3 = Color3I(51, 51, 51) + shield.BorderColor3 = Color3I(27, 42, 53) + shield.BackgroundTransparency = 0.4 + shield.ZIndex = baseZIndex + 1 - robloxLock(shield) - shield.Visible = false - return shield -end + local closeAndResetDialgo -local createReportAbuseDialog = function() - --Only show things if we are a NetworkClient - waitForChild(game,"NetworkClient") + local messageBoxButtons = {} + messageBoxButtons[1] = {} + messageBoxButtons[1].Text = "Ok" + messageBoxButtons[1].Modal = true + messageBoxButtons[1].Function = function() + closeAndResetDialog() + end + local calmingMessageBox = RbxGui.CreateMessageDialog( + "Thanks for your report!", + "Our moderators will review the chat logs and determine what happened. The other user is probably just trying to make you mad.\n\nIf anyone used swear words, inappropriate language, or threatened you in real life, please report them for Bad Words or Threats", + messageBoxButtons + ) + calmingMessageBox.Visible = false + calmingMessageBox.Parent = shield - waitForChild(game,"Players") - waitForProperty(game.Players, "LocalPlayer") - local localPlayer = game.Players.LocalPlayer - - local reportAbuseButton - waitForChild(gui,"UserSettingsShield") - waitForChild(gui.UserSettingsShield, "Settings") - waitForChild(gui.UserSettingsShield.Settings,"SettingsStyle") - waitForChild(gui.UserSettingsShield.Settings.SettingsStyle,"GameMainMenu") - waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, "ReportAbuseButton") - reportAbuseButton = gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton + local recordedMessageBox = RbxGui.CreateMessageDialog( + "Thanks for your report!", + "We've recorded your report for evaluation.", + messageBoxButtons + ) + recordedMessageBox.Visible = false + recordedMessageBox.Parent = shield - local shield = Instance.new("TextButton") - shield.Name = "ReportAbuseShield" - shield.Text = "" - shield.AutoButtonColor = false - shield.Active = true - shield.Visible = false - shield.Size = UDim2.new(1,0,1,0) - shield.BackgroundColor3 = Color3I(51,51,51) - shield.BorderColor3 = Color3I(27,42,53) - shield.BackgroundTransparency = 0.4 - shield.ZIndex = baseZIndex + 1 + local normalMessageBox = RbxGui.CreateMessageDialog( + "Thanks for your report!", + "Our moderators will review the chat logs and determine what happened.", + messageBoxButtons + ) + normalMessageBox.Visible = false + normalMessageBox.Parent = shield - local closeAndResetDialgo + local frame = Instance.new "Frame" + frame.Name = "Settings" + frame.Position = UDim2.new(0.5, -250, 0.5, -200) + frame.Size = UDim2.new(0, 500, 0, 400) + frame.BackgroundTransparency = 1 + frame.Active = true + frame.Parent = shield - local messageBoxButtons = {} - messageBoxButtons[1] = {} - messageBoxButtons[1].Text = "Ok" - messageBoxButtons[1].Modal = true - messageBoxButtons[1].Function = function() closeAndResetDialog() end - local calmingMessageBox = RbxGui.CreateMessageDialog("Thanks for your report!", "Our moderators will review the chat logs and determine what happened. The other user is probably just trying to make you mad.\n\nIf anyone used swear words, inappropriate language, or threatened you in real life, please report them for Bad Words or Threats", messageBoxButtons) - calmingMessageBox.Visible = false - calmingMessageBox.Parent = shield + local settingsFrame = Instance.new "Frame" + settingsFrame.Name = "ReportAbuseStyle" + settingsFrame.Size = UDim2.new(1, 0, 1, 0) + settingsFrame.Style = Enum.FrameStyle.RobloxRound + settingsFrame.Active = true + settingsFrame.ZIndex = baseZIndex + 1 + settingsFrame.Parent = frame - local recordedMessageBox = RbxGui.CreateMessageDialog("Thanks for your report!","We've recorded your report for evaluation.", messageBoxButtons) - recordedMessageBox.Visible = false - recordedMessageBox.Parent = shield + local title = Instance.new "TextLabel" + title.Name = "Title" + title.Text = "Report Abuse" + title.TextColor3 = Color3I(221, 221, 221) + title.Position = UDim2.new(0.5, 0, 0, 30) + title.Font = Enum.Font.ArialBold + title.FontSize = Enum.FontSize.Size36 + title.ZIndex = baseZIndex + 2 + title.Parent = settingsFrame - local normalMessageBox = RbxGui.CreateMessageDialog("Thanks for your report!", "Our moderators will review the chat logs and determine what happened.", messageBoxButtons) - normalMessageBox.Visible = false - normalMessageBox.Parent = shield + local description = Instance.new "TextLabel" + description.Name = "Description" + description.Text = + "This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action." + description.TextColor3 = Color3I(221, 221, 221) + description.Position = UDim2.new(0, 0, 0, 55) + description.Size = UDim2.new(1, 0, 0, 40) + description.BackgroundTransparency = 1 + description.Font = Enum.Font.Arial + description.FontSize = Enum.FontSize.Size18 + description.TextWrap = true + description.ZIndex = baseZIndex + 2 + description.TextXAlignment = Enum.TextXAlignment.Left + description.TextYAlignment = Enum.TextYAlignment.Top + description.Parent = settingsFrame - local frame = Instance.new("Frame") - frame.Name = "Settings" - frame.Position = UDim2.new(0.5, -250, 0.5, -200) - frame.Size = UDim2.new(0.0, 500, 0.0, 400) - frame.BackgroundTransparency = 1 - frame.Active = true - frame.Parent = shield + local playerLabel = Instance.new "TextLabel" + playerLabel.Name = "PlayerLabel" + playerLabel.Text = "Which player?" + playerLabel.BackgroundTransparency = 1 + playerLabel.Font = Enum.Font.Arial + playerLabel.FontSize = Enum.FontSize.Size18 + playerLabel.Position = UDim2.new(0.025, 0, 0, 100) + playerLabel.Size = UDim2.new(0.4, 0, 0, 36) + playerLabel.TextColor3 = Color3I(255, 255, 255) + playerLabel.TextXAlignment = Enum.TextXAlignment.Left + playerLabel.ZIndex = baseZIndex + 2 + playerLabel.Parent = settingsFrame - local settingsFrame = Instance.new("Frame") - settingsFrame.Name = "ReportAbuseStyle" - settingsFrame.Size = UDim2.new(1, 0, 1, 0) - settingsFrame.Style = Enum.FrameStyle.RobloxRound - settingsFrame.Active = true - settingsFrame.ZIndex = baseZIndex + 1 - settingsFrame.Parent = frame + local abusingPlayer = nil + local abuse = nil + local submitReportButton = nil - local title = Instance.new("TextLabel") - title.Name = "Title" - title.Text = "Report Abuse" - title.TextColor3 = Color3I(221,221,221) - title.Position = UDim2.new(0.5, 0, 0, 30) - title.Font = Enum.Font.ArialBold - title.FontSize = Enum.FontSize.Size36 - title.ZIndex = baseZIndex + 2 - title.Parent = settingsFrame - - local description = Instance.new("TextLabel") - description.Name = "Description" - description.Text = "This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action." - description.TextColor3 = Color3I(221,221,221) - description.Position = UDim2.new(0, 0, 0, 55) - description.Size = UDim2.new(1, 0, 0, 40) - description.BackgroundTransparency = 1 - description.Font = Enum.Font.Arial - description.FontSize = Enum.FontSize.Size18 - description.TextWrap = true - description.ZIndex = baseZIndex + 2 - description.TextXAlignment = Enum.TextXAlignment.Left - description.TextYAlignment = Enum.TextYAlignment.Top - description.Parent = settingsFrame - - local playerLabel = Instance.new("TextLabel") - playerLabel.Name = "PlayerLabel" - playerLabel.Text = "Which player?" - playerLabel.BackgroundTransparency = 1 - playerLabel.Font = Enum.Font.Arial - playerLabel.FontSize = Enum.FontSize.Size18 - playerLabel.Position = UDim2.new(0.025,0,0,100) - playerLabel.Size = UDim2.new(0.4,0,0,36) - playerLabel.TextColor3 = Color3I(255,255,255) - playerLabel.TextXAlignment = Enum.TextXAlignment.Left - playerLabel.ZIndex = baseZIndex + 2 - playerLabel.Parent = settingsFrame - - local abusingPlayer = nil - local abuse = nil - local submitReportButton = nil - - local updatePlayerSelection = nil - local createPlayersDropDown = function() - local players = game:GetService("Players") - local playerNames = {} - local nameToPlayer = {} - local children = players:GetChildren() - local pos = 1 - if children then - for i, player in ipairs(children) do - if player:IsA("Player") and player ~= localPlayer then - playerNames[pos] = player.Name - nameToPlayer[player.Name] = player - pos = pos + 1 + local updatePlayerSelection = nil + local createPlayersDropDown = function() + local players = game:GetService "Players" + local playerNames = {} + local nameToPlayer = {} + local children = players:GetChildren() + local pos = 1 + if children then + for i, player in ipairs(children) do + if player:IsA "Player" and player ~= localPlayer then + playerNames[pos] = player.Name + nameToPlayer[player.Name] = player + pos = pos + 1 + end end end - end - local playerDropDown = nil - playerDropDown, updatePlayerSelection = RbxGui.CreateDropDownMenu(playerNames, - function(playerName) - abusingPlayer = nameToPlayer[playerName] + local playerDropDown = nil + playerDropDown, updatePlayerSelection = RbxGui.CreateDropDownMenu(playerNames, function(playerName) + abusingPlayer = nameToPlayer[playerName] if abuse and abusingPlayer then submitReportButton.Active = true end end) - playerDropDown.Name = "PlayersComboBox" - playerDropDown.ZIndex = baseZIndex + 2 - playerDropDown.Position = UDim2.new(.425, 0, 0, 102) - playerDropDown.Size = UDim2.new(.55,0,0,32) - - return playerDropDown - end - - local abuseLabel = Instance.new("TextLabel") - abuseLabel.Name = "AbuseLabel" - abuseLabel.Text = "Type of Abuse:" - abuseLabel.Font = Enum.Font.Arial - abuseLabel.BackgroundTransparency = 1 - abuseLabel.FontSize = Enum.FontSize.Size18 - abuseLabel.Position = UDim2.new(0.025,0,0,140) - abuseLabel.Size = UDim2.new(0.4,0,0,36) - abuseLabel.TextColor3 = Color3I(255,255,255) - abuseLabel.TextXAlignment = Enum.TextXAlignment.Left - abuseLabel.ZIndex = baseZIndex + 2 - abuseLabel.Parent = settingsFrame + playerDropDown.Name = "PlayersComboBox" + playerDropDown.ZIndex = baseZIndex + 2 + playerDropDown.Position = UDim2.new(0.425, 0, 0, 102) + playerDropDown.Size = UDim2.new(0.55, 0, 0, 32) - local abuses = {"Swearing","Bullying","Scamming","Dating","Cheating/Exploiting","Personal Questions","Offsite Links","Bad Model or Script","Bad Username"} - local abuseDropDown, updateAbuseSelection = RbxGui.CreateDropDownMenu(abuses, - function(abuseText) - abuse = abuseText + return playerDropDown + end + + local abuseLabel = Instance.new "TextLabel" + abuseLabel.Name = "AbuseLabel" + abuseLabel.Text = "Type of Abuse:" + abuseLabel.Font = Enum.Font.Arial + abuseLabel.BackgroundTransparency = 1 + abuseLabel.FontSize = Enum.FontSize.Size18 + abuseLabel.Position = UDim2.new(0.025, 0, 0, 140) + abuseLabel.Size = UDim2.new(0.4, 0, 0, 36) + abuseLabel.TextColor3 = Color3I(255, 255, 255) + abuseLabel.TextXAlignment = Enum.TextXAlignment.Left + abuseLabel.ZIndex = baseZIndex + 2 + abuseLabel.Parent = settingsFrame + + local abuses = { + "Swearing", + "Bullying", + "Scamming", + "Dating", + "Cheating/Exploiting", + "Personal Questions", + "Offsite Links", + "Bad Model or Script", + "Bad Username", + } + local abuseDropDown, updateAbuseSelection = RbxGui.CreateDropDownMenu(abuses, function(abuseText) + abuse = abuseText if abuse and abusingPlayer then submitReportButton.Active = true end end, true) - abuseDropDown.Name = "AbuseComboBox" - abuseDropDown.ZIndex = baseZIndex + 2 - abuseDropDown.Position = UDim2.new(0.425, 0, 0, 142) - abuseDropDown.Size = UDim2.new(0.55,0,0,32) - abuseDropDown.Parent = settingsFrame + abuseDropDown.Name = "AbuseComboBox" + abuseDropDown.ZIndex = baseZIndex + 2 + abuseDropDown.Position = UDim2.new(0.425, 0, 0, 142) + abuseDropDown.Size = UDim2.new(0.55, 0, 0, 32) + abuseDropDown.Parent = settingsFrame - local shortDescriptionLabel = Instance.new("TextLabel") - shortDescriptionLabel.Name = "ShortDescriptionLabel" - shortDescriptionLabel.Text = "Short Description: (optional)" - shortDescriptionLabel.Font = Enum.Font.Arial - shortDescriptionLabel.FontSize = Enum.FontSize.Size18 - shortDescriptionLabel.Position = UDim2.new(0.025,0,0,180) - shortDescriptionLabel.Size = UDim2.new(0.95,0,0,36) - shortDescriptionLabel.TextColor3 = Color3I(255,255,255) - shortDescriptionLabel.TextXAlignment = Enum.TextXAlignment.Left - shortDescriptionLabel.BackgroundTransparency = 1 - shortDescriptionLabel.ZIndex = baseZIndex + 2 - shortDescriptionLabel.Parent = settingsFrame + local shortDescriptionLabel = Instance.new "TextLabel" + shortDescriptionLabel.Name = "ShortDescriptionLabel" + shortDescriptionLabel.Text = "Short Description: (optional)" + shortDescriptionLabel.Font = Enum.Font.Arial + shortDescriptionLabel.FontSize = Enum.FontSize.Size18 + shortDescriptionLabel.Position = UDim2.new(0.025, 0, 0, 180) + shortDescriptionLabel.Size = UDim2.new(0.95, 0, 0, 36) + shortDescriptionLabel.TextColor3 = Color3I(255, 255, 255) + shortDescriptionLabel.TextXAlignment = Enum.TextXAlignment.Left + shortDescriptionLabel.BackgroundTransparency = 1 + shortDescriptionLabel.ZIndex = baseZIndex + 2 + shortDescriptionLabel.Parent = settingsFrame - local shortDescriptionWrapper = Instance.new("Frame") - shortDescriptionWrapper.Name = "ShortDescriptionWrapper" - shortDescriptionWrapper.Position = UDim2.new(0.025,0,0,220) - shortDescriptionWrapper.Size = UDim2.new(0.95,0,1,-310) - shortDescriptionWrapper.BackgroundColor3 = Color3I(0,0,0) - shortDescriptionWrapper.BorderSizePixel = 0 - shortDescriptionWrapper.ZIndex = baseZIndex + 2 - shortDescriptionWrapper.Parent = settingsFrame + local shortDescriptionWrapper = Instance.new "Frame" + shortDescriptionWrapper.Name = "ShortDescriptionWrapper" + shortDescriptionWrapper.Position = UDim2.new(0.025, 0, 0, 220) + shortDescriptionWrapper.Size = UDim2.new(0.95, 0, 1, -310) + shortDescriptionWrapper.BackgroundColor3 = Color3I(0, 0, 0) + shortDescriptionWrapper.BorderSizePixel = 0 + shortDescriptionWrapper.ZIndex = baseZIndex + 2 + shortDescriptionWrapper.Parent = settingsFrame - local shortDescriptionBox = Instance.new("TextBox") - shortDescriptionBox.Name = "TextBox" - shortDescriptionBox.Text = "" - shortDescriptionBox.ClearTextOnFocus = false - shortDescriptionBox.Font = Enum.Font.Arial - shortDescriptionBox.FontSize = Enum.FontSize.Size18 - shortDescriptionBox.Position = UDim2.new(0,3,0,3) - shortDescriptionBox.Size = UDim2.new(1,-6,1,-6) - shortDescriptionBox.TextColor3 = Color3I(255,255,255) - shortDescriptionBox.TextXAlignment = Enum.TextXAlignment.Left - shortDescriptionBox.TextYAlignment = Enum.TextYAlignment.Top - shortDescriptionBox.TextWrap = true - shortDescriptionBox.BackgroundColor3 = Color3I(0,0,0) - shortDescriptionBox.BorderSizePixel = 0 - shortDescriptionBox.ZIndex = baseZIndex + 2 - shortDescriptionBox.Parent = shortDescriptionWrapper - - submitReportButton = Instance.new("TextButton") - submitReportButton.Name = "SubmitReportBtn" - submitReportButton.Active = false - submitReportButton.Modal = true - submitReportButton.Font = Enum.Font.Arial - submitReportButton.FontSize = Enum.FontSize.Size18 - submitReportButton.Position = UDim2.new(0.1, 0, 1, -80) - submitReportButton.Size = UDim2.new(0.35,0,0,50) - submitReportButton.AutoButtonColor = true - submitReportButton.Style = Enum.ButtonStyle.RobloxButtonDefault - submitReportButton.Text = "Submit Report" - submitReportButton.TextColor3 = Color3I(255,255,255) - submitReportButton.ZIndex = baseZIndex + 2 - submitReportButton.Parent = settingsFrame - - submitReportButton.MouseButton1Click:connect(function() - if submitReportButton.Active then - if abuse and abusingPlayer then - frame.Visible = false - game.Players:ReportAbuse(abusingPlayer, abuse, shortDescriptionBox.Text) - if abuse == "Cheating/Exploiting" then - recordedMessageBox.Visible = true - elseif abuse == "Bullying" or abuse == "Swearing" then - calmingMessageBox.Visible = true - else - normalMessageBox.Visible = true - end - else - closeAndResetDialog() - end - end - end) - - local cancelButton = Instance.new("TextButton") - cancelButton.Name = "CancelBtn" - cancelButton.Font = Enum.Font.Arial - cancelButton.FontSize = Enum.FontSize.Size18 - cancelButton.Position = UDim2.new(0.55, 0, 1, -80) - cancelButton.Size = UDim2.new(0.35,0,0,50) - cancelButton.AutoButtonColor = true - cancelButton.Style = Enum.ButtonStyle.RobloxButtonDefault - cancelButton.Text = "Cancel" - cancelButton.TextColor3 = Color3I(255,255,255) - cancelButton.ZIndex = baseZIndex + 2 - cancelButton.Parent = settingsFrame - - closeAndResetDialog = function() - --Delete old player combo box - local oldComboBox = settingsFrame:FindFirstChild("PlayersComboBox") - if oldComboBox then - oldComboBox.Parent = nil - end - - abusingPlayer = nil updatePlayerSelection(nil) - abuse = nil updateAbuseSelection(nil) - submitReportButton.Active = false + local shortDescriptionBox = Instance.new "TextBox" + shortDescriptionBox.Name = "TextBox" shortDescriptionBox.Text = "" - frame.Visible = true - calmingMessageBox.Visible = false - recordedMessageBox.Visible = false - normalMessageBox.Visible = false - shield.Visible = false - reportAbuseButton.Active = true - game.GuiService:RemoveCenterDialog(shield) - end + shortDescriptionBox.ClearTextOnFocus = false + shortDescriptionBox.Font = Enum.Font.Arial + shortDescriptionBox.FontSize = Enum.FontSize.Size18 + shortDescriptionBox.Position = UDim2.new(0, 3, 0, 3) + shortDescriptionBox.Size = UDim2.new(1, -6, 1, -6) + shortDescriptionBox.TextColor3 = Color3I(255, 255, 255) + shortDescriptionBox.TextXAlignment = Enum.TextXAlignment.Left + shortDescriptionBox.TextYAlignment = Enum.TextYAlignment.Top + shortDescriptionBox.TextWrap = true + shortDescriptionBox.BackgroundColor3 = Color3I(0, 0, 0) + shortDescriptionBox.BorderSizePixel = 0 + shortDescriptionBox.ZIndex = baseZIndex + 2 + shortDescriptionBox.Parent = shortDescriptionWrapper - cancelButton.MouseButton1Click:connect(closeAndResetDialog) - - reportAbuseButton.MouseButton1Click:connect( - function() + submitReportButton = Instance.new "TextButton" + submitReportButton.Name = "SubmitReportBtn" + submitReportButton.Active = false + submitReportButton.Modal = true + submitReportButton.Font = Enum.Font.Arial + submitReportButton.FontSize = Enum.FontSize.Size18 + submitReportButton.Position = UDim2.new(0.1, 0, 1, -80) + submitReportButton.Size = UDim2.new(0.35, 0, 0, 50) + submitReportButton.AutoButtonColor = true + submitReportButton.Style = Enum.ButtonStyle.RobloxButtonDefault + submitReportButton.Text = "Submit Report" + submitReportButton.TextColor3 = Color3I(255, 255, 255) + submitReportButton.ZIndex = baseZIndex + 2 + submitReportButton.Parent = settingsFrame + + submitReportButton.MouseButton1Click:connect(function() + if submitReportButton.Active then + if abuse and abusingPlayer then + frame.Visible = false + game.Players:ReportAbuse(abusingPlayer, abuse, shortDescriptionBox.Text) + if abuse == "Cheating/Exploiting" then + recordedMessageBox.Visible = true + elseif abuse == "Bullying" or abuse == "Swearing" then + calmingMessageBox.Visible = true + else + normalMessageBox.Visible = true + end + else + closeAndResetDialog() + end + end + end) + + local cancelButton = Instance.new "TextButton" + cancelButton.Name = "CancelBtn" + cancelButton.Font = Enum.Font.Arial + cancelButton.FontSize = Enum.FontSize.Size18 + cancelButton.Position = UDim2.new(0.55, 0, 1, -80) + cancelButton.Size = UDim2.new(0.35, 0, 0, 50) + cancelButton.AutoButtonColor = true + cancelButton.Style = Enum.ButtonStyle.RobloxButtonDefault + cancelButton.Text = "Cancel" + cancelButton.TextColor3 = Color3I(255, 255, 255) + cancelButton.ZIndex = baseZIndex + 2 + cancelButton.Parent = settingsFrame + + closeAndResetDialog = function() + --Delete old player combo box + local oldComboBox = settingsFrame:FindFirstChild "PlayersComboBox" + if oldComboBox then + oldComboBox.Parent = nil + end + + abusingPlayer = nil + updatePlayerSelection(nil) + abuse = nil + updateAbuseSelection(nil) + submitReportButton.Active = false + shortDescriptionBox.Text = "" + frame.Visible = true + calmingMessageBox.Visible = false + recordedMessageBox.Visible = false + normalMessageBox.Visible = false + shield.Visible = false + reportAbuseButton.Active = true + game.GuiService:RemoveCenterDialog(shield) + end + + cancelButton.MouseButton1Click:connect(closeAndResetDialog) + + reportAbuseButton.MouseButton1Click:connect(function() createPlayersDropDown().Parent = settingsFrame - table.insert(centerDialogs,shield) - game.GuiService:AddCenterDialog(shield, Enum.CenterDialogType.ModalDialog, + table.insert(centerDialogs, shield) + game.GuiService:AddCenterDialog( + shield, + Enum.CenterDialogType.ModalDialog, --ShowFunction function() reportAbuseButton.Active = false @@ -1903,85 +2223,85 @@ local createReportAbuseDialog = function() function() reportAbuseButton.Active = true shield.Visible = false - end) + end + ) end) - robloxLock(shield) - return shield -end + robloxLock(shield) + return shield + end -local createChatBar = function() - --Only show a chat bar if we are a NetworkClient - waitForChild(game, "NetworkClient") + local createChatBar = function() + --Only show a chat bar if we are a NetworkClient + waitForChild(game, "NetworkClient") - waitForChild(game, "Players") - waitForProperty(game.Players, "LocalPlayer") - - local chatBar = Instance.new("Frame") - chatBar.Name = "ChatBar" - chatBar.Size = UDim2.new(1, 0, 0, 22) - chatBar.Position = UDim2.new(0, 0, 1, 0) - chatBar.BackgroundColor3 = Color3.new(0,0,0) - chatBar.BorderSizePixel = 0 + waitForChild(game, "Players") + waitForProperty(game.Players, "LocalPlayer") - local chatBox = Instance.new("TextBox") - chatBox.Text = "" - chatBox.Visible = false - chatBox.Size = UDim2.new(1,-4,1,0) - chatBox.Position = UDim2.new(0,2,0,0) - chatBox.TextXAlignment = Enum.TextXAlignment.Left - chatBox.Font = Enum.Font.Arial - chatBox.ClearTextOnFocus = false - chatBox.FontSize = Enum.FontSize.Size14 - chatBox.TextColor3 = Color3.new(1,1,1) - chatBox.BackgroundTransparency = 1 - --chatBox.Parent = chatBar + local chatBar = Instance.new "Frame" + chatBar.Name = "ChatBar" + chatBar.Size = UDim2.new(1, 0, 0, 22) + chatBar.Position = UDim2.new(0, 0, 1, 0) + chatBar.BackgroundColor3 = Color3.new(0, 0, 0) + chatBar.BorderSizePixel = 0 - local chatButton = Instance.new("TextButton") - chatButton.Size = UDim2.new(1,-4,1,0) - chatButton.Position = UDim2.new(0,2,0,0) - chatButton.AutoButtonColor = false - chatButton.Text = "To chat click here or press \"/\" key" - chatButton.TextXAlignment = Enum.TextXAlignment.Left - chatButton.Font = Enum.Font.Arial - chatButton.FontSize = Enum.FontSize.Size14 - chatButton.TextColor3 = Color3.new(1,1,1) - chatButton.BackgroundTransparency = 1 - --chatButton.Parent = chatBar - - local activateChat = function() - if chatBox.Visible then - return - end - chatButton.Visible = false + local chatBox = Instance.new "TextBox" chatBox.Text = "" - chatBox.Visible = true - chatBox:CaptureFocus() - end + chatBox.Visible = false + chatBox.Size = UDim2.new(1, -4, 1, 0) + chatBox.Position = UDim2.new(0, 2, 0, 0) + chatBox.TextXAlignment = Enum.TextXAlignment.Left + chatBox.Font = Enum.Font.Arial + chatBox.ClearTextOnFocus = false + chatBox.FontSize = Enum.FontSize.Size14 + chatBox.TextColor3 = Color3.new(1, 1, 1) + chatBox.BackgroundTransparency = 1 + --chatBox.Parent = chatBar - chatButton.MouseButton1Click:connect(activateChat) + local chatButton = Instance.new "TextButton" + chatButton.Size = UDim2.new(1, -4, 1, 0) + chatButton.Position = UDim2.new(0, 2, 0, 0) + chatButton.AutoButtonColor = false + chatButton.Text = 'To chat click here or press "/" key' + chatButton.TextXAlignment = Enum.TextXAlignment.Left + chatButton.Font = Enum.Font.Arial + chatButton.FontSize = Enum.FontSize.Size14 + chatButton.TextColor3 = Color3.new(1, 1, 1) + chatButton.BackgroundTransparency = 1 + --chatButton.Parent = chatBar - local hotKeyEnabled = true - local toggleHotKey = function(value) - hotKeyEnabled = value - end - - local guiService = game:GetService("GuiService") - local newChatMode = pcall(function() - --guiService:AddSpecialKey(Enum.SpecialKey.ChatHotkey) - --guiService.SpecialKeyPressed:connect(function(key) if key == Enum.SpecialKey.ChatHotkey and hotKeyEnabled then activateChat() end end) - end) - if not newChatMode then - --guiService:AddKey("/") - --guiService.KeyPressed:connect(function(key) if key == "/" and hotKeyEnabled then activateChat() end end) - end + local activateChat = function() + if chatBox.Visible then + return + end + chatButton.Visible = false + chatBox.Text = "" + chatBox.Visible = true + chatBox:CaptureFocus() + end - chatBox.FocusLost:connect( - function(enterPressed) + chatButton.MouseButton1Click:connect(activateChat) + + local hotKeyEnabled = true + local toggleHotKey = function(value) + hotKeyEnabled = value + end + + local guiService = game:GetService "GuiService" + local newChatMode = pcall(function() + --guiService:AddSpecialKey(Enum.SpecialKey.ChatHotkey) + --guiService.SpecialKeyPressed:connect(function(key) if key == Enum.SpecialKey.ChatHotkey and hotKeyEnabled then activateChat() end end) + end) + if not newChatMode then + --guiService:AddKey("/") + --guiService.KeyPressed:connect(function(key) if key == "/" and hotKeyEnabled then activateChat() end end) + end + + chatBox.FocusLost:connect(function(enterPressed) if enterPressed then if chatBox.Text ~= "" then local str = chatBox.Text - if string.sub(str, 1, 1) == '%' then + if string.sub(str, 1, 1) == "%" then game.Players:TeamChat(string.sub(str, 2)) else game.Players:Chat(str) @@ -1992,53 +2312,58 @@ local createChatBar = function() chatBox.Visible = false chatButton.Visible = true end) - robloxLock(chatBar) - return chatBar, toggleHotKey -end + robloxLock(chatBar) + return chatBar, toggleHotKey + end ---Spawn a thread for the Save dialogs -local isSaveDialogSupported = pcall(function() local var = game.LocalSaveEnabled end) -if isSaveDialogSupported then - delay(0, - function() + --Spawn a thread for the Save dialogs + local isSaveDialogSupported = pcall(function() + local var = game.LocalSaveEnabled + end) + if isSaveDialogSupported then + delay(0, function() local saveDialogs = createSaveDialogs() saveDialogs.Parent = gui - + game.RequestShutdown = function() - table.insert(centerDialogs,saveDialogs) - game.GuiService:AddCenterDialog(saveDialogs, Enum.CenterDialogType.QuitDialog, + table.insert(centerDialogs, saveDialogs) + game.GuiService:AddCenterDialog( + saveDialogs, + Enum.CenterDialogType.QuitDialog, --ShowFunction function() - saveDialogs.Visible = true + saveDialogs.Visible = true end, --HideFunction function() saveDialogs.Visible = false - end) + end + ) return true end end) -end + end ---Spawn a thread for the Report Abuse dialogs -delay(0, - function() + --Spawn a thread for the Report Abuse dialogs + delay(0, function() createReportAbuseDialog().Parent = gui - waitForChild(gui,"UserSettingsShield") + waitForChild(gui, "UserSettingsShield") waitForChild(gui.UserSettingsShield, "Settings") - waitForChild(gui.UserSettingsShield.Settings,"SettingsStyle") - waitForChild(gui.UserSettingsShield.Settings.SettingsStyle,"GameMainMenu") + waitForChild(gui.UserSettingsShield.Settings, "SettingsStyle") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle, "GameMainMenu") waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, "ReportAbuseButton") gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton.Active = true end) ---Spawn a thread for Chat Bar -local coreGuiVersion = game.CoreGui.Version -local success, luaChat = pcall(function() return game.GuiService.UseLuaChat end) -if success and luaChat then + --Spawn a thread for Chat Bar + local coreGuiVersion = game.CoreGui.Version + local success, luaChat = pcall(function() + return game.GuiService.UseLuaChat + end) + if success and luaChat then - --[[delay(0, + --[[delay(0, function() waitForChild(game, "Players") waitForProperty(game.Players, "LocalPlayer") @@ -2070,21 +2395,19 @@ if success and luaChat then --game.GuiService:SetGlobalSizeOffsetPixel(0,-22) end end)]] -end + end - -local BurningManPlaceID = 41324860 --- TODO: remove click to walk completely if testing shows we don't need it --- Removes click to walk option from Burning Man -delay(0, - function() - waitForChild(game,"NetworkClient") - waitForChild(game,"Players") + local BurningManPlaceID = 41324860 + -- TODO: remove click to walk completely if testing shows we don't need it + -- Removes click to walk option from Burning Man + delay(0, function() + waitForChild(game, "NetworkClient") + waitForChild(game, "Players") waitForProperty(game.Players, "LocalPlayer") waitForProperty(game.Players.LocalPlayer, "Character") waitForChild(game.Players.LocalPlayer.Character, "Humanoid") waitForProperty(game, "PlaceId") - + if game.PlaceId == BurningManPlaceID then game.Players.LocalPlayer.Character.Humanoid:SetClickToWalkEnabled(false) game.Players.LocalPlayer.CharacterAdded:connect(function(character) @@ -2093,5 +2416,4 @@ delay(0, end) end end) - end --LoadLibrary if diff --git a/48488235.lua b/48488235.lua index e76aea1..4fb6f38 100644 --- a/48488235.lua +++ b/48488235.lua @@ -1,8 +1,8 @@ --new playerlist by Zach Lindblad (fusroblox) --contact him for any revisions/issues --------------------- +-------------------- -- Super Util --------------------- +-------------------- --[[ local ADMINS = { @@ -122,40 +122,37 @@ ['matt dusek'] = 1, } --]] -local ADMINS = -{ +local ADMINS = { taskmanager = 1, Heliodex = 1, - multako = 'http://www.roblox.com/asset/?id=6923328292', + multako = "http://www.roblox.com/asset/?id=6923328292", mercury = 1, - pizzaboxer = 'http://www.roblox.com/asset/?id=6917566633' - + pizzaboxer = "http://www.roblox.com/asset/?id=6917566633", } local Images = { - bottomDark = '94691904', - bottomLight = '94691940', - midDark = '94691980', - midLight = '94692025', - LargeDark = '96098866', - LargeLight = '96098920', - LargeHeader = '96097470', - NormalHeader = '94692054', - LargeBottom = '96397271', - NormalBottom = '94754966', - DarkBluePopupMid = '97114905', - LightBluePopupMid = '97114905', - DarkPopupMid = '97112126', - LightPopupMid = '97109338', - DarkBluePopupTop = '97114838', - DarkBluePopupBottom = '97114758', - DarkPopupBottom = '100869219', - LightPopupBottom = '97109175', + bottomDark = "94691904", + bottomLight = "94691940", + midDark = "94691980", + midLight = "94692025", + LargeDark = "96098866", + LargeLight = "96098920", + LargeHeader = "96097470", + NormalHeader = "94692054", + LargeBottom = "96397271", + NormalBottom = "94754966", + DarkBluePopupMid = "97114905", + LightBluePopupMid = "97114905", + DarkPopupMid = "97112126", + LightPopupMid = "97109338", + DarkBluePopupTop = "97114838", + DarkBluePopupBottom = "97114758", + DarkPopupBottom = "100869219", + LightPopupBottom = "97109175", } -local BASE_TWEEN = .25 +local BASE_TWEEN = 0.25 -local MOUSE_HOLD_TIME = .15 local MOUSE_DRAG_DISTANCE = 15 --[[ @@ -167,7 +164,7 @@ function Obj.Create(guiType) return function(data) local obj = Instance.new(guiType) for k, v in pairs(data) do - if type(k) == 'number' then + if type(k) == "number" then v.Parent = obj else obj[k] = v @@ -175,7 +172,7 @@ function Obj.Create(guiType) end return obj end -end +end --[[ makes a full sized background for a guiobject @@ -184,18 +181,17 @@ end @Return: background gui object --]] function MakeBackgroundGuiObj(imgName) - return Obj.Create'ImageLabel' - { - Name = 'Background', + return Obj.Create "ImageLabel" { + Name = "Background", BackgroundTransparency = 1, Image = imgName, Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1,0,1,0), + Size = UDim2.new(1, 0, 1, 0), } end --[[ turns 255 integer color value to a color3 --]] -function Color3I(r,g,b) - return Color3.new(r/255,g/255,b/255) +function Color3I(r, g, b) + return Color3.new(r / 255, g / 255, b / 255) end --[[ @@ -204,8 +200,8 @@ end membershipType Enum of membership status @Return: string of image asset --]] -function getMembershipTypeIcon(membershipType,playerName) - if ADMINS[string.lower(playerName)]~=nil then +function getMembershipTypeIcon(membershipType, playerName) + if ADMINS[string.lower(playerName)] ~= nil then if ADMINS[string.lower(playerName)] == 1 then return "http://www.roblox.com/asset/?id=6923330951" else @@ -221,7 +217,7 @@ function getMembershipTypeIcon(membershipType,playerName) return "rbxasset://textures/ui/TinyObcIcon.png" else error("Unknown membershipType" .. membershipType) - end + end end local function getFriendStatusIcon(friendStatus) @@ -238,7 +234,6 @@ local function getFriendStatusIcon(friendStatus) end end - --[[ Utility function to create buttons for the popup menus @Args: @@ -248,50 +243,47 @@ end last is this the last element of the popup menu @Return: a popup menu button --]] -function MakePopupButton(nparent,ntext,index,last) - local tobj = Obj.Create"ImageButton" - { - Name = 'ReportButton', +function MakePopupButton(nparent, ntext, index, last) + local tobj = Obj.Create "ImageButton" { + Name = "ReportButton", BackgroundTransparency = 1, - Position = UDim2.new(0,0,1*index,0), + Position = UDim2.new(0, 0, 1 * index, 0), Size = UDim2.new(1, 0, 1, 0), - ZIndex=7, - Obj.Create'TextLabel' - { - Name = 'ButtonText', + ZIndex = 7, + Obj.Create "TextLabel" { + Name = "ButtonText", BackgroundTransparency = 1, - Position = UDim2.new(.07, 0, .07, 0), - Size = UDim2.new(.86,0,.86,0), + Position = UDim2.new(0.07, 0, 0.07, 0), + Size = UDim2.new(0.86, 0, 0.86, 0), Parent = HeaderFrame, - Font = 'ArialBold', + Font = "ArialBold", Text = ntext, - FontSize = 'Size14', + FontSize = "Size14", TextScaled = true, - TextColor3 = Color3.new(1,1,1), + TextColor3 = Color3.new(1, 1, 1), TextStrokeTransparency = 1, - ZIndex=7, + ZIndex = 7, }, Parent = nparent, } - if index==0 then - tobj.Image = 'http://www.roblox.com/asset/?id=97108784' + if index == 0 then + tobj.Image = "http://www.roblox.com/asset/?id=97108784" elseif last then - if index%2==1 then - tobj.Image = 'http://www.roblox.com/asset/?id='.. Images['LightPopupBottom'] + if index % 2 == 1 then + tobj.Image = "http://www.roblox.com/asset/?id=" .. Images["LightPopupBottom"] else - tobj.Image = 'http://www.roblox.com/asset/?id='.. Images['DarkPopupBottom'] + tobj.Image = "http://www.roblox.com/asset/?id=" .. Images["DarkPopupBottom"] end else - if index%2==1 then - tobj.Image = 'http://www.roblox.com/asset/?id=97112126' + if index % 2 == 1 then + tobj.Image = "http://www.roblox.com/asset/?id=97112126" else - tobj.Image = 'http://www.roblox.com/asset/?id=97109338' + tobj.Image = "http://www.roblox.com/asset/?id=97109338" end end return tobj end - --[[ obligatory wait for child function @Args: @@ -299,37 +291,36 @@ end child name of child object to look for @Return: object waited for --]] -function WaitForChild(parent,child) +function WaitForChild(parent, child) while not parent:FindFirstChild(child) do - wait() debugprint(" child "..parent.Name.." waiting for "..child) + wait() + debugprint(" child " .. parent.Name .. " waiting for " .. child) end return parent[child] end - --------------------------- - -- Workspace Objects - --------------------------- +--------------------------- +-- Workspace Objects +--------------------------- -- might want to move all this to an init function, wait for localplayer elsewhere -local Players = game:GetService('Players') +local Players = game:GetService "Players" -- make sure this doesn't run on the server(it will if you dont do this) while not Players.LocalPlayer do - Players.Changed:wait() + Players.Changed:wait() end local LocalPlayer = Players.LocalPlayer local Mouse = LocalPlayer:GetMouse() -local ScreenGui = Obj.Create"Frame" -{ - Name = 'PlayerListScreen', +local ScreenGui = Obj.Create "Frame" { + Name = "PlayerListScreen", Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, - Parent = script.Parent + Parent = script.Parent, } -local MainFrame = Obj.Create"Frame" -{ - Name = 'LeaderBoardFrame', +local MainFrame = Obj.Create "Frame" { + Name = "LeaderBoardFrame", Position = UDim2.new(1, -150, 0.005, 0), Size = UDim2.new(0, 150, 0, 800), BackgroundTransparency = 1, @@ -337,9 +328,8 @@ local MainFrame = Obj.Create"Frame" } --frame used for expanding leaderstats when frame is 'focused' -local FocusFrame = Obj.Create"Frame" -{ - Name = 'FocusFrame', +local FocusFrame = Obj.Create "Frame" { + Name = "FocusFrame", Position = UDim2.new(0, 0, 0, 0), Size = UDim2.new(1, 0, 0, 100), BackgroundTransparency = 1, @@ -347,318 +337,283 @@ local FocusFrame = Obj.Create"Frame" Parent = MainFrame, } -local TemplateFrameYSize = 0.670000017 - - -- HEADER -local HeaderFrame = Obj.Create"Frame" -{ - Name = 'Header', +-- HEADER +local HeaderFrame = Obj.Create "Frame" { + Name = "Header", BackgroundTransparency = 1, - Position = UDim2.new(0,0,0,0), - Size = UDim2.new(1, 0, .07, 0), + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, 0, 0.07, 0), Parent = MainFrame, - MakeBackgroundGuiObj('http://www.roblox.com/asset/?id=94692054'), + MakeBackgroundGuiObj "http://www.roblox.com/asset/?id=94692054", } - local HeaderFrameHeight = HeaderFrame.Size.Y.Scale - local MaximizeButton = Obj.Create"ImageButton" - { - Name = 'MaximizeButton', - Active = true, - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1,0,1,0), - Parent = HeaderFrame, - } - local HeaderName = Obj.Create"TextLabel" - { - Name = 'PlayerName', - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, .01, 0), - Size = UDim2.new(.98,0,.38,0), - Parent = HeaderFrame, - Font = 'ArialBold', - Text = LocalPlayer.Name, - FontSize='Size24', - --TextScaled = true, - TextColor3 = Color3.new(1,1,1), - TextStrokeColor3 = Color3.new(0,0,0), - TextStrokeTransparency = 0, - TextXAlignment = 'Right', - TextYAlignment = 'Center', - } - local HeaderScore = Obj.Create"TextLabel" - { - Name = 'PlayerScore', - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, .4, 0), - Size = UDim2.new(.98,0,0,30), - Parent = HeaderFrame, - Font = 'ArialBold', - Text = '', - FontSize='Size24', - TextYAlignment = 'Top', - --TextScaled = true, - TextColor3 = Color3.new(1,1,1), - TextStrokeTransparency = 1, - TextXAlignment = 'Right', - TextYAlignment = 'Top', - } - -- BOTTOM - --used for shifting bottom frame for mouse over effects -local BottomShiftFrame = Obj.Create"Frame" -{ - Name= 'BottomShiftFrame', +local HeaderFrameHeight = HeaderFrame.Size.Y.Scale +local MaximizeButton = Obj.Create "ImageButton" { + Name = "MaximizeButton", + Active = true, BackgroundTransparency = 1, - Position = UDim2.new(0,0,HeaderFrameHeight,0), - Size = UDim2.new(1,0,1,0), - Parent=MainFrame, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, 0, 1, 0), + Parent = HeaderFrame, } - local BottomFrame = Obj.Create"Frame" - { - Name = 'Bottom', - BackgroundTransparency = 1, - Position = UDim2.new(0,0,.07,0), - Size = UDim2.new(1, 0, .03, 0), - Parent = BottomShiftFrame, - MakeBackgroundGuiObj('http://www.roblox.com/asset/?id=94754966'), - } - local ExtendButton = Obj.Create"ImageButton" - { - Name = 'bigbutton', - Active = true, - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1,0,1.5,0), - ZIndex = 3, - Parent = BottomFrame, - } - local ExtendTab = Obj.Create"ImageButton" - { - Name = 'extendTab', - Active = true, - BackgroundTransparency = 1, - Image = 'http://www.roblox.com/asset/?id=94692731', - Position = UDim2.new(.608, 0, .3, 0), - Size = UDim2.new(.3,0,.7,0), - Parent = BottomFrame, - } -local TopClipFrame = Obj.Create"Frame" -{ - Name = 'ListFrame', +local HeaderName = Obj.Create "TextLabel" { + Name = "PlayerName", BackgroundTransparency = 1, - Position = UDim2.new(-1,0,.07,0), + Position = UDim2.new(0, 0, 0.01, 0), + Size = UDim2.new(0.98, 0, 0.38, 0), + Parent = HeaderFrame, + Font = "ArialBold", + Text = LocalPlayer.Name, + FontSize = "Size24", + --TextScaled = true, + TextColor3 = Color3.new(1, 1, 1), + TextStrokeColor3 = Color3.new(0, 0, 0), + TextStrokeTransparency = 0, + TextXAlignment = "Right", + TextYAlignment = "Center", +} +local HeaderScore = Obj.Create "TextLabel" { + Name = "PlayerScore", + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0.4, 0), + Size = UDim2.new(0.98, 0, 0, 30), + Parent = HeaderFrame, + Font = "ArialBold", + Text = "", + FontSize = "Size24", + TextYAlignment = "Top", + --TextScaled = true, + TextColor3 = Color3.new(1, 1, 1), + TextStrokeTransparency = 1, + TextXAlignment = "Right", +} +-- BOTTOM +--used for shifting bottom frame for mouse over effects +local BottomShiftFrame = Obj.Create "Frame" { + Name = "BottomShiftFrame", + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, HeaderFrameHeight, 0), + Size = UDim2.new(1, 0, 1, 0), + Parent = MainFrame, +} +local BottomFrame = Obj.Create "Frame" { + Name = "Bottom", + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0.07, 0), + Size = UDim2.new(1, 0, 0.03, 0), + Parent = BottomShiftFrame, + MakeBackgroundGuiObj "http://www.roblox.com/asset/?id=94754966", +} +local ExtendButton = Obj.Create "ImageButton" { + Name = "bigbutton", + Active = true, + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, 0, 1.5, 0), + ZIndex = 3, + Parent = BottomFrame, +} +local ExtendTab = Obj.Create "ImageButton" { + Name = "extendTab", + Active = true, + BackgroundTransparency = 1, + Image = "http://www.roblox.com/asset/?id=94692731", + Position = UDim2.new(0.608, 0, 0.3, 0), + Size = UDim2.new(0.3, 0, 0.7, 0), + Parent = BottomFrame, +} +local TopClipFrame = Obj.Create "Frame" { + Name = "ListFrame", + BackgroundTransparency = 1, + Position = UDim2.new(-1, 0, 0.07, 0), Size = UDim2.new(2, 0, 1, 0), Parent = MainFrame, ClipsDescendants = true, } - local BottomClipFrame = Obj.Create"Frame" - { - Name = 'BottomFrame', - BackgroundTransparency = 1, - Position = UDim2.new(0,0, - .8,0), - Size = UDim2.new(1, 0, 1, 0), - Parent = TopClipFrame, - ClipsDescendants = true, - } - local ScrollBarFrame = Obj.Create"Frame" - { - Name = 'ScrollBarFrame', - BackgroundTransparency = 1, - Position = UDim2.new(.987,0,.8,0), - Size = UDim2.new(.01, 0, .2, 0), - Parent = BottomClipFrame, - } - local ScrollBar = Obj.Create"Frame" - { - Name = 'ScrollBar', - BackgroundTransparency = 0, - BackgroundColor3 = Color3.new(.2,.2,.2), - Position = UDim2.new(0,0,0,0), - Size = UDim2.new(1, 0, .5, 0), - ZIndex = 5, - Parent = ScrollBarFrame, - - } - local ListFrame = Obj.Create"Frame" - { - Name = 'SubFrame', - BackgroundTransparency = 1, - Position = UDim2.new(0,0,.8,0), - Size = UDim2.new(1, 0, 1, 0), - Parent = BottomClipFrame, - } -local PopUpClipFrame = Obj.Create"Frame" -{ - Name = 'PopUpFrame', +local BottomClipFrame = Obj.Create "Frame" { + Name = "BottomFrame", BackgroundTransparency = 1, - SizeConstraint='RelativeXX', - Position = MainFrame.Position + UDim2.new( 0,-150,0,0), - Size = UDim2.new(0,150,0,800), + Position = UDim2.new(0, 0, -0.8, 0), + Size = UDim2.new(1, 0, 1, 0), + Parent = TopClipFrame, + ClipsDescendants = true, +} +local ScrollBarFrame = Obj.Create "Frame" { + Name = "ScrollBarFrame", + BackgroundTransparency = 1, + Position = UDim2.new(0.987, 0, 0.8, 0), + Size = UDim2.new(0.01, 0, 0.2, 0), + Parent = BottomClipFrame, +} +local ScrollBar = Obj.Create "Frame" { + Name = "ScrollBar", + BackgroundTransparency = 0, + BackgroundColor3 = Color3.new(0.2, 0.2, 0.2), + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(1, 0, 0.5, 0), + ZIndex = 5, + Parent = ScrollBarFrame, +} +local ListFrame = Obj.Create "Frame" { + Name = "SubFrame", + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 0.8, 0), + Size = UDim2.new(1, 0, 1, 0), + Parent = BottomClipFrame, +} +local PopUpClipFrame = Obj.Create "Frame" { + Name = "PopUpFrame", + BackgroundTransparency = 1, + SizeConstraint = "RelativeXX", + Position = MainFrame.Position + UDim2.new(0, -150, 0, 0), + Size = UDim2.new(0, 150, 0, 800), Parent = MainFrame, ClipsDescendants = true, - ZIndex=7, + ZIndex = 7, } local PopUpPanel = nil - local PopUpPanelTemplate = Obj.Create"Frame" - { - Name = 'Panel', - BackgroundTransparency = 1, - Position = UDim2.new(1,0,0,0), - Size = UDim2.new(1,0,.032,0), - Parent = PopUpClipFrame, - } - -local StatTitles = Obj.Create"Frame" -{ - Name = 'StatTitles', +local PopUpPanelTemplate = Obj.Create "Frame" { + Name = "Panel", BackgroundTransparency = 1, - Position = UDim2.new(0,0,1,-10), + Position = UDim2.new(1, 0, 0, 0), + Size = UDim2.new(1, 0, 0.032, 0), + Parent = PopUpClipFrame, +} + +local StatTitles = Obj.Create "Frame" { + Name = "StatTitles", + BackgroundTransparency = 1, + Position = UDim2.new(0, 0, 1, -10), Size = UDim2.new(1, 0, 0, 0), Parent = HeaderFrame, } -local IsMinimized = Instance.new('BoolValue') -local IsMaximized = Instance.new('BoolValue') -local IsTabified = Instance.new('BoolValue') -local AreNamesExpanded = Instance.new('BoolValue') +local IsMinimized = Instance.new "BoolValue" +local IsMaximized = Instance.new "BoolValue" +local IsTabified = Instance.new "BoolValue" +local AreNamesExpanded = Instance.new "BoolValue" - -local MiddleTemplate = Obj.Create"Frame" -{ - Name = 'MidTemplate', +local MiddleTemplate = Obj.Create "Frame" { + Name = "MidTemplate", BackgroundTransparency = 1, - Position = UDim2.new(100,0,.07,0), - Size = UDim2.new(.5, 0, .025, 0),--UDim2.new(1, 0, .03, 0), - Obj.Create'ImageLabel' - { - Name = 'BCLabel', + Position = UDim2.new(100, 0, 0.07, 0), + Size = UDim2.new(0.5, 0, 0.025, 0), --UDim2.new(1, 0, .03, 0), + Obj.Create "ImageLabel" { + Name = "BCLabel", Active = true, BackgroundTransparency = 1, - Position = UDim2.new(.005, 5, .20, 0), - Size = UDim2.new(0,16,0,16), - SizeConstraint = 'RelativeYY', + Position = UDim2.new(0.005, 5, 0.20, 0), + Size = UDim2.new(0, 16, 0, 16), + SizeConstraint = "RelativeYY", Image = "", ZIndex = 3, }, - Obj.Create'ImageLabel' - { - Name = 'FriendLabel', + Obj.Create "ImageLabel" { + Name = "FriendLabel", Active = true, BackgroundTransparency = 1, - Position = UDim2.new(.005, 5, .15, 0), - Size = UDim2.new(0,16,0,16), - SizeConstraint = 'RelativeYY', + Position = UDim2.new(0.005, 5, 0.15, 0), + Size = UDim2.new(0, 16, 0, 16), + SizeConstraint = "RelativeYY", Image = "", ZIndex = 3, }, - Obj.Create"ImageButton" - { - Name = 'ClickListener', + Obj.Create "ImageButton" { + Name = "ClickListener", Active = true, BackgroundTransparency = 1, - Position = UDim2.new(.005, 1, 0, 0), - Size = UDim2.new(.96,0,1,0), + Position = UDim2.new(0.005, 1, 0, 0), + Size = UDim2.new(0.96, 0, 1, 0), ZIndex = 3, }, - Obj.Create"Frame" - { - Name = 'TitleFrame', + Obj.Create "Frame" { + Name = "TitleFrame", BackgroundTransparency = 1, - Position = UDim2.new(.01, 0, 0, 0), - Size = UDim2.new(0,140,1,0), - ClipsDescendants=true, - Obj.Create"TextLabel" - { - Name = 'Title', + Position = UDim2.new(0.01, 0, 0, 0), + Size = UDim2.new(0, 140, 1, 0), + ClipsDescendants = true, + Obj.Create "TextLabel" { + Name = "Title", BackgroundTransparency = 1, Position = UDim2.new(0, 5, 0, 0), - Size = UDim2.new(100,0,1,0), - Font = 'Arial', - FontSize='Size14', - TextColor3 = Color3.new(1,1,1), - TextXAlignment = 'Left', - TextYAlignment = 'Center', + Size = UDim2.new(100, 0, 1, 0), + Font = "Arial", + FontSize = "Size14", + TextColor3 = Color3.new(1, 1, 1), + TextXAlignment = "Left", + TextYAlignment = "Center", ZIndex = 3, }, }, - - Obj.Create"TextLabel" - { - Name = 'PlayerScore', + + Obj.Create "TextLabel" { + Name = "PlayerScore", BackgroundTransparency = 1, Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1,0,1,0), - Font = 'ArialBold', - Text = '', - FontSize='Size14', - TextColor3 = Color3.new(1,1,1), - TextXAlignment = 'Right', - TextYAlignment = 'Center', + Size = UDim2.new(1, 0, 1, 0), + Font = "ArialBold", + Text = "", + FontSize = "Size14", + TextColor3 = Color3.new(1, 1, 1), + TextXAlignment = "Right", + TextYAlignment = "Center", ZIndex = 3, }, --Obj.Create'IntValue'{Name = 'ID'}, --Obj.Create'ObjectValue'{Name = 'Player'}, - --Obj.Create'IntValue'{Name = 'Score'}, + --Obj.Create'IntValue'{Name = 'Score'}, ZIndex = 3, } -local MiddleBGTemplate = Obj.Create"Frame" -{ - Name = 'MidBGTemplate', +local MiddleBGTemplate = Obj.Create "Frame" { + Name = "MidBGTemplate", BackgroundTransparency = 1, - Position = UDim2.new(100,0,.07,0), - Size = UDim2.new(.5, 0, .025, 0),--UDim2.new(1, 0, .03, 0), - MakeBackgroundGuiObj('http://www.roblox.com/asset/?id=94692025'), - + Position = UDim2.new(100, 0, 0.07, 0), + Size = UDim2.new(0.5, 0, 0.025, 0), --UDim2.new(1, 0, .03, 0), + MakeBackgroundGuiObj "http://www.roblox.com/asset/?id=94692025", } - -- REPORT ABUSE OBJECTS +-- REPORT ABUSE OBJECTS -local ReportAbuseShield = Obj.Create"TextButton" -{ +local ReportAbuseShield = Obj.Create "TextButton" { Name = "ReportAbuseShield", Text = "", AutoButtonColor = false, Active = true, Visible = true, - Size = UDim2.new(1,0,1,0), - BackgroundColor3 = Color3I(51,51,51), - BorderColor3 = Color3I(27,42,53), + Size = UDim2.new(1, 0, 1, 0), + BackgroundColor3 = Color3I(51, 51, 51), + BorderColor3 = Color3I(27, 42, 53), BackgroundTransparency = 1, } -local ReportAbuseFrame = Obj.Create "Frame" -{ +local ReportAbuseFrame = Obj.Create "Frame" { Name = "Settings", - Position = UDim2.new(0.5, - 250, 0.5, - 200), - Size = UDim2.new(0.0, 500, 0.0, 400), + Position = UDim2.new(0.5, -250, 0.5, -200), + Size = UDim2.new(0, 500, 0, 400), BackgroundTransparency = 1, Active = true, Parent = ReportAbuseShield, } -local AbuseSettingsFrame = Obj.Create"Frame" -{ +local AbuseSettingsFrame = Obj.Create "Frame" { Name = "ReportAbuseStyle", Size = UDim2.new(1, 0, 1, 0), Active = true, BackgroundTransparency = 1, - MakeBackgroundGuiObj('http://www.roblox.com/asset/?id=96488767'), -- 96480351'), - Obj.Create"TextLabel" - { + MakeBackgroundGuiObj "http://www.roblox.com/asset/?id=96488767", -- 96480351'), + Obj.Create "TextLabel" { Name = "Title", Text = "Report Abuse", - TextColor3 = Color3I(221,221,221), + TextColor3 = Color3I(221, 221, 221), Position = UDim2.new(0.5, 0, 0, 30), Font = Enum.Font.ArialBold, FontSize = Enum.FontSize.Size36, }, - Obj.Create"TextLabel" - { + Obj.Create "TextLabel" { Name = "Description", Text = "This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action.", - TextColor3 = Color3I(221,221,221), - Position = UDim2.new(.01, 0, 0, 55), - Size = UDim2.new(.99, 0, 0, 40), + TextColor3 = Color3I(221, 221, 221), + Position = UDim2.new(0.01, 0, 0, 55), + Size = UDim2.new(0.99, 0, 0, 40), BackgroundTransparency = 1, Font = Enum.Font.Arial, FontSize = Enum.FontSize.Size18, @@ -666,370 +621,338 @@ local AbuseSettingsFrame = Obj.Create"Frame" TextXAlignment = Enum.TextXAlignment.Left, TextYAlignment = Enum.TextYAlignment.Top, }, - Obj.Create"TextLabel" - { + Obj.Create "TextLabel" { Name = "AbuseLabel", Text = "What did they do?", Font = Enum.Font.Arial, BackgroundTransparency = 1, FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0.025,0,0,140), - Size = UDim2.new(0.4,0,0,36), - TextColor3 = Color3I(255,255,255), + Position = UDim2.new(0.025, 0, 0, 140), + Size = UDim2.new(0.4, 0, 0, 36), + TextColor3 = Color3I(255, 255, 255), TextXAlignment = Enum.TextXAlignment.Left, }, - Obj.Create"TextLabel" - { + Obj.Create "TextLabel" { Name = "ShortDescriptionLabel", Text = "Short Description: (optional)", Font = Enum.Font.Arial, FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0.025,0,0,180), - Size = UDim2.new(0.95,0,0,36), - TextColor3 = Color3I(255,255,255), + Position = UDim2.new(0.025, 0, 0, 180), + Size = UDim2.new(0.95, 0, 0, 36), + TextColor3 = Color3I(255, 255, 255), TextXAlignment = Enum.TextXAlignment.Left, BackgroundTransparency = 1, }, - Obj.Create"TextLabel" - { + Obj.Create "TextLabel" { Name = "ReportingPlayerLabel", Text = "Reporting Player", BackgroundTransparency = 1, Font = Enum.Font.Arial, FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0.025,0,0,100), - Size = UDim2.new(0.95,0,0,36), - TextColor3 = Color3I(255,255,255), + Position = UDim2.new(0.025, 0, 0, 100), + Size = UDim2.new(0.95, 0, 0, 36), + TextColor3 = Color3I(255, 255, 255), TextXAlignment = Enum.TextXAlignment.Left, - Parent = AbuseSettingsFrame + Parent = AbuseSettingsFrame, }, Parent = ReportAbuseFrame, } -local AbusePlayerLabel = Obj.Create"TextLabel" -{ +local AbusePlayerLabel = Obj.Create "TextLabel" { Name = "PlayerLabel", Text = "", BackgroundTransparency = 1, Font = Enum.Font.ArialBold, FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0.025,0,0,100), - Size = UDim2.new(0.95,0,0,36), - TextColor3 = Color3I(255,255,255), + Position = UDim2.new(0.025, 0, 0, 100), + Size = UDim2.new(0.95, 0, 0, 36), + TextColor3 = Color3I(255, 255, 255), TextXAlignment = Enum.TextXAlignment.Right, - Parent = AbuseSettingsFrame + Parent = AbuseSettingsFrame, } -local SubmitReportButton = Obj.Create"ImageButton" -{ +local SubmitReportButton = Obj.Create "ImageButton" { Name = "SubmitReportBtn", Active = false, BackgroundTransparency = 1, - Position = UDim2.new(.5, - 200, 1, - 80), - Size = UDim2.new(0,150,0,50), + Position = UDim2.new(0.5, -200, 1, -80), + Size = UDim2.new(0, 150, 0, 50), AutoButtonColor = false, - Image = 'http://www.roblox.com/asset/?id=96502438', -- 96501119', + Image = "http://www.roblox.com/asset/?id=96502438", -- 96501119', Parent = AbuseSettingsFrame, } -local CancelReportButton = Obj.Create"ImageButton" -{ +local CancelReportButton = Obj.Create "ImageButton" { Name = "CancelBtn", BackgroundTransparency = 1, - Position = UDim2.new(0.5, 50, 1, - 80), - Size = UDim2.new(0,150,0,50), + Position = UDim2.new(0.5, 50, 1, -80), + Size = UDim2.new(0, 150, 0, 50), AutoButtonColor = true, - Image = 'http://www.roblox.com/asset/?id=96500683', + Image = "http://www.roblox.com/asset/?id=96500683", Parent = AbuseSettingsFrame, } -local AbuseDescriptionWrapper = Obj.Create"Frame" -{ +local AbuseDescriptionWrapper = Obj.Create "Frame" { Name = "AbuseDescriptionWrapper", - Position = UDim2.new(0.025,0,0,220), - Size = UDim2.new(0.95,0,1, - 310), - BackgroundColor3 = Color3I(0,0,0), + Position = UDim2.new(0.025, 0, 0, 220), + Size = UDim2.new(0.95, 0, 1, -310), + BackgroundColor3 = Color3I(0, 0, 0), BorderSizePixel = 0, Parent = AbuseSettingsFrame, } -local AbuseDescriptionBox +local AbuseDescriptionBox -local OriginalAbuseDescriptionBox = Obj.Create"TextBox" -{ +local OriginalAbuseDescriptionBox = Obj.Create "TextBox" { Name = "TextBox", Text = "", ClearTextOnFocus = false, Font = Enum.Font.Arial, FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0,3,0,3), - Size = UDim2.new(1, - 6,1, - 6), - TextColor3 = Color3I(255,255,255), + Position = UDim2.new(0, 3, 0, 3), + Size = UDim2.new(1, -6, 1, -6), + TextColor3 = Color3I(255, 255, 255), TextXAlignment = Enum.TextXAlignment.Left, TextYAlignment = Enum.TextYAlignment.Top, TextWrap = true, - BackgroundColor3 = Color3I(0,0,0), + BackgroundColor3 = Color3I(0, 0, 0), BorderSizePixel = 0, } -local CalmingAbuseBox = Obj.Create'Frame' -{ - Name = 'AbuseFeedbackBox', - BackgroundTransparency = 1, - Position=UDim2.new(0.25, 0, 0.300000012, 0), - Size=UDim2.new(0.5, 0, 0.370000005, 0), - MakeBackgroundGuiObj('http://www.roblox.com/asset/?id=96506233'), - Obj.Create'TextLabel' - { - Name = 'Header', - Position=UDim2.new(0,10,.05,0), - Size=UDim2.new(1, -30, .15, 0), - TextScaled = true, - BackgroundTransparency = 1, - TextXAlignment = Enum.TextXAlignment.Center, - TextYAlignment = Enum.TextYAlignment.Top, - Text = 'Thanks for your report!', - TextColor3 = Color3.new(1,1,1), - FontSize = Enum.FontSize.Size48, - Font = 'ArialBold', - }, - Obj.Create'TextLabel' - { - Name = 'content', - Position = UDim2.new(0,10,.20,0), - Size = UDim2.new(1, -30, .40, 0), - TextScaled = true, - BackgroundTransparency = 1, - TextColor3 = Color3.new(1,1,1), - Text = 'Our moderators will review the chat logs and determine what happened. The other user is probably just trying to make you mad.\n\nIf anyone used swear words, inappropriate language, or threatened you in real life, please report them for Bad Words or Threats', - TextWrapped = true, - TextYAlignment = Enum.TextYAlignment.Top, - FontSize = Enum.FontSize.Size24, - Font = 'Arial', - }, - Obj.Create'ImageButton' - { - Name = "OkButton", - BackgroundTransparency = 1, - Position = UDim2.new(0.5, -75, 1, -80), - Size = UDim2.new(0,150,0,50), - AutoButtonColor = true, - Image = 'http://www.roblox.com/asset/?id=96507959', - } -} -local NormalAbuseBox = Obj.Create'Frame' -{ - Name = 'AbuseFeedbackBox', +local CalmingAbuseBox = Obj.Create "Frame" { + Name = "AbuseFeedbackBox", BackgroundTransparency = 1, Position = UDim2.new(0.25, 0, 0.300000012, 0), Size = UDim2.new(0.5, 0, 0.370000005, 0), - MakeBackgroundGuiObj('http://www.roblox.com/asset/?id=96506233'), - Obj.Create'TextLabel' - { - Name = 'Header', - Position = UDim2.new(0,10,.05,0), - Size = UDim2.new(1, -30, .15, 0), + MakeBackgroundGuiObj "http://www.roblox.com/asset/?id=96506233", + Obj.Create "TextLabel" { + Name = "Header", + Position = UDim2.new(0, 10, 0.05, 0), + Size = UDim2.new(1, -30, 0.15, 0), TextScaled = true, BackgroundTransparency = 1, - TextColor3 = Color3.new(1,1,1), TextXAlignment = Enum.TextXAlignment.Center, TextYAlignment = Enum.TextYAlignment.Top, - Text = 'Thanks for your report!', + Text = "Thanks for your report!", + TextColor3 = Color3.new(1, 1, 1), FontSize = Enum.FontSize.Size48, - Font ='ArialBold' + Font = "ArialBold", }, - Obj.Create'TextLabel' - { - Name = 'content', - Position = UDim2.new(0,10,.20,0), - Size = UDim2.new(1, -30, .15, 0), + Obj.Create "TextLabel" { + Name = "content", + Position = UDim2.new(0, 10, 0.20, 0), + Size = UDim2.new(1, -30, 0.40, 0), TextScaled = true, BackgroundTransparency = 1, - TextColor3 = Color3.new(1,1,1), + TextColor3 = Color3.new(1, 1, 1), + Text = "Our moderators will review the chat logs and determine what happened. The other user is probably just trying to make you mad.\n\nIf anyone used swear words, inappropriate language, or threatened you in real life, please report them for Bad Words or Threats", + TextWrapped = true, + TextYAlignment = Enum.TextYAlignment.Top, + FontSize = Enum.FontSize.Size24, + Font = "Arial", + }, + Obj.Create "ImageButton" { + Name = "OkButton", + BackgroundTransparency = 1, + Position = UDim2.new(0.5, -75, 1, -80), + Size = UDim2.new(0, 150, 0, 50), + AutoButtonColor = true, + Image = "http://www.roblox.com/asset/?id=96507959", + }, +} +local NormalAbuseBox = Obj.Create "Frame" { + Name = "AbuseFeedbackBox", + BackgroundTransparency = 1, + Position = UDim2.new(0.25, 0, 0.300000012, 0), + Size = UDim2.new(0.5, 0, 0.370000005, 0), + MakeBackgroundGuiObj "http://www.roblox.com/asset/?id=96506233", + Obj.Create "TextLabel" { + Name = "Header", + Position = UDim2.new(0, 10, 0.05, 0), + Size = UDim2.new(1, -30, 0.15, 0), + TextScaled = true, + BackgroundTransparency = 1, + TextColor3 = Color3.new(1, 1, 1), + TextXAlignment = Enum.TextXAlignment.Center, + TextYAlignment = Enum.TextYAlignment.Top, + Text = "Thanks for your report!", + FontSize = Enum.FontSize.Size48, + Font = "ArialBold", + }, + Obj.Create "TextLabel" { + Name = "content", + Position = UDim2.new(0, 10, 0.20, 0), + Size = UDim2.new(1, -30, 0.15, 0), + TextScaled = true, + BackgroundTransparency = 1, + TextColor3 = Color3.new(1, 1, 1), Text = "Our moderators will review the chat logs and determine what happened.", TextWrapped = true, TextYAlignment = Enum.TextYAlignment.Top, FontSize = Enum.FontSize.Size24, - Font = 'Arial', + Font = "Arial", }, - Obj.Create'ImageButton' - { + Obj.Create "ImageButton" { Name = "OkButton", BackgroundTransparency = 1, Position = UDim2.new(0.5, -75, 1, -80), - Size = UDim2.new(0,150,0,50), + Size = UDim2.new(0, 150, 0, 50), AutoButtonColor = true, - Image = 'http://www.roblox.com/asset/?id=96507959', + Image = "http://www.roblox.com/asset/?id=96507959", }, } -local BigButton=Instance.new('ImageButton') - BigButton.Size=UDim2.new(1,0,1,0) - BigButton.BackgroundTransparency=1 - BigButton.ZIndex=8 - BigButton.Visible=false - --BigButton.Active=false - BigButton.Parent=ScreenGui - - - local debugFrame = Obj.Create"Frame" - { - Name = 'debugframe', - --Position = UDim2.new(0, 0, 0, 0), - --Size = UDim2.new(0, 150, 0, 800),--0.99000001 - --BackgroundTransparency = 1, - BackgroundTransparency = 1, - Position = UDim2.new(0.25, 0, 0.300000012, 0), - Size = UDim2.new(0.5, 0, 0.370000005, 0), - MakeBackgroundGuiObj('http://www.roblox.com/asset/?id=96506233'), - - } - local debugplayers = Obj.Create"TextLabel" - { - BackgroundTransparency = .8, - Position = UDim2.new(0, 0, .01, 0), - Size = UDim2.new(1,0,.5,0), - Parent = debugFrame, - Font = 'ArialBold', - Text = '--', - FontSize='Size14', - TextWrapped=true, - TextColor3 = Color3.new(1,1,1), - TextStrokeColor3 = Color3.new(0,0,0), - TextStrokeTransparency = 0, - TextXAlignment = 'Right', - TextYAlignment = 'Center', - } - local debugOutput = Obj.Create"TextLabel" - { - BackgroundTransparency = .8, - Position = UDim2.new(0, 0, .5, 0), - Size = UDim2.new(1,0,.5,0), - Parent = debugFrame, - Font = 'ArialBold', - Text = '--', - FontSize='Size14', - TextWrapped=true, - TextColor3 = Color3.new(1,1,1), - TextStrokeColor3 = Color3.new(0,0,0), - TextStrokeTransparency = 0, - TextXAlignment = 'Right', - TextYAlignment = 'Center', - } +local BigButton = Instance.new "ImageButton" +BigButton.Size = UDim2.new(1, 0, 1, 0) +BigButton.BackgroundTransparency = 1 +BigButton.ZIndex = 8 +BigButton.Visible = false +--BigButton.Active=false +BigButton.Parent = ScreenGui +local debugFrame = Obj.Create "Frame" { + Name = "debugframe", + --Position = UDim2.new(0, 0, 0, 0), + --Size = UDim2.new(0, 150, 0, 800),--0.99000001 + --BackgroundTransparency = 1, + BackgroundTransparency = 1, + Position = UDim2.new(0.25, 0, 0.300000012, 0), + Size = UDim2.new(0.5, 0, 0.370000005, 0), + MakeBackgroundGuiObj "http://www.roblox.com/asset/?id=96506233", +} +local debugplayers = Obj.Create "TextLabel" { + BackgroundTransparency = 0.8, + Position = UDim2.new(0, 0, 0.01, 0), + Size = UDim2.new(1, 0, 0.5, 0), + Parent = debugFrame, + Font = "ArialBold", + Text = "--", + FontSize = "Size14", + TextWrapped = true, + TextColor3 = Color3.new(1, 1, 1), + TextStrokeColor3 = Color3.new(0, 0, 0), + TextStrokeTransparency = 0, + TextXAlignment = "Right", + TextYAlignment = "Center", +} +local debugOutput = Obj.Create "TextLabel" { + BackgroundTransparency = 0.8, + Position = UDim2.new(0, 0, 0.5, 0), + Size = UDim2.new(1, 0, 0.5, 0), + Parent = debugFrame, + Font = "ArialBold", + Text = "--", + FontSize = "Size14", + TextWrapped = true, + TextColor3 = Color3.new(1, 1, 1), + TextStrokeColor3 = Color3.new(0, 0, 0), + TextStrokeTransparency = 0, + TextXAlignment = "Right", + TextYAlignment = "Center", +} --[[ simple function to toggle the display of debug output --]] -local DebugPrintEnabled=true +local DebugPrintEnabled = true function debugprint(str) --print(str) if DebugPrintEnabled then - debugOutput.Text=str + debugOutput.Text = str end end +------------------------- +-- Script objects +------------------------- +local RbxGui = assert(LoadLibrary "RbxGui") - ------------------------- - -- Script objects - ------------------------- -local RbxGui = assert(LoadLibrary('RbxGui')) - - -- number of entries to show if you click minimize +-- number of entries to show if you click minimize local DefaultEntriesOnScreen = 8 - - - - -for _,i in pairs(Images) do - Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..i) +for _, i in pairs(Images) do + Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=" .. i) end - -- ordered array of 'score data', each entry has: - -- Name(String) - -- Priority(number) - -- IsPrimary (bool, should it be shown in upper right) - -- MaxLength (integer, of the length of the longest element for this column) +-- ordered array of 'score data', each entry has: +-- Name(String) +-- Priority(number) +-- IsPrimary (bool, should it be shown in upper right) +-- MaxLength (integer, of the length of the longest element for this column) local ScoreNames = {} - -- prevents flipping in playerlist panels +-- prevents flipping in playerlist panels local AddId = 0 - -- intermediate table form of all player entries in format of: - -- Frame - -- Player - -- Score - -- ID - -- MyTeam (team ENRTY(not actual team) I am currently on) +-- intermediate table form of all player entries in format of: +-- Frame +-- Player +-- Score +-- ID +-- MyTeam (team ENRTY(not actual team) I am currently on) local PlayerFrames = {} - -- intermediate ordered frame array, composed of Entrys of - -- Frame - -- MyTeam (my team object) - -- MyPlayers ( an ordered array of all player frames in team ) - -- AutoHide (bool saying whether it should be hidden) - -- IsHidden (bool) - -- ID (int to prevent flipping out of leaderboard, fun times) +-- intermediate ordered frame array, composed of Entrys of +-- Frame +-- MyTeam (my team object) +-- MyPlayers ( an ordered array of all player frames in team ) +-- AutoHide (bool saying whether it should be hidden) +-- IsHidden (bool) +-- ID (int to prevent flipping out of leaderboard, fun times) local TeamFrames = {} - -- one special entry from teamFrames, for unaffiliated players, only shown if players non - empty +-- one special entry from teamFrames, for unaffiliated players, only shown if players non - empty local NeutralTeam = nil - -- final 'to be displayed' list of frames +-- final 'to be displayed' list of frames local MiddleFrames = {} local MiddleFrameBackgrounds = {} -local MiddleFrameHeight = .03 - -- time of last click +local MiddleFrameHeight = 0.03 +-- time of last click local LastClick = 0 -local ButtonCooldown = .25 +local ButtonCooldown = 0.25 local OnIos = false -pcall(function() OnIos = Game:GetService('UserInputService').TouchEnabled end) +pcall(function() + OnIos = Game:GetService("UserInputService").TouchEnabled +end) - - -- you get 200 of x screen space per stat added, start width 16% +-- you get 200 of x screen space per stat added, start width 16% local BaseScreenXSize = 150 local SpacingPerStat = 10 --spacing between stats - -local MaximizedBounds = UDim2.new(.5,0,1,0) -local MaximizedPosition = UDim2.new(.25,0,.1,0) -local NormalBounds = UDim2.new(0,BaseScreenXSize, 0, 800) -local NormalPosition = UDim2.new(1 , - BaseScreenXSize, 0.005, 0) - -local MinimizedBounds = UDim2.new(0, BaseScreenXSize, 0.99000001, 0) +local MaximizedBounds = UDim2.new(0.5, 0, 1, 0) +local MaximizedPosition = UDim2.new(0.25, 0, 0.1, 0) +local NormalBounds = UDim2.new(0, BaseScreenXSize, 0, 800) +local NormalPosition = UDim2.new(1, -BaseScreenXSize, 0.005, 0) --free space to give last stat on the right -local RightEdgeSpace = -.04 +local RightEdgeSpace = -0.04 - -- where the scroll par currently is positioned -local ScrollPosition = 0.75999999 -local IsDragging = false -- am I dragging the player list +-- where the scroll par currently is positioned local DefaultBottomClipPos = BottomClipFrame.Position.Y.Scale -local LastSelectedPlayerEntry = nil local SelectedPlayerEntry = nil local SelectedPlayer = nil - -- locks(semaphores) for stopping race conditions +-- locks(semaphores) for stopping race conditions local AddingFrameLock = false -local ChangingOrderLock = false local AddingStatLock = false local BaseUpdateLock = false local WaitForClickLock = false -local InPopupWaitForClick=false +local InPopupWaitForClick = false local PlayerChangedLock = false local NeutralTeamLock = false local ScrollWheelConnections = {} - local DefaultListSize = 8 -if not OnIos then DefaultListSize = 12 end +if not OnIos then + DefaultListSize = 12 +end local DidMinimizeDrag = false --local PlaceCreatorId=game.CreatorId - -- report abuse objects +-- report abuse objects local AbuseName local Abuses = { "Bad Words or Threats", @@ -1038,13 +961,12 @@ local Abuses = { "Account Trading or Sharing", "Asking Personal Questions", "Rude or Mean Behavior", - "False Reporting Me" + "False Reporting Me", } local UpdateAbuseFunction -local AbuseDropDown, UpdateAbuseSelection +local AbuseDropDown -local PrivilegeLevel = -{ +local PrivilegeLevel = { Owner = 255, Admin = 240, Member = 128, @@ -1052,25 +974,24 @@ local PrivilegeLevel = Banned = 0, } - -local IsPersonalServer = not not game.Workspace:FindFirstChild("PSVariable") +local IsPersonalServer = not not game.Workspace:FindFirstChild "PSVariable" game.Workspace.ChildAdded:connect(function(nchild) - if nchild.Name=='PSVariable' and nchild:IsA('BoolValue') then - IsPersonalServer=true + if nchild.Name == "PSVariable" and nchild:IsA "BoolValue" then + IsPersonalServer = true end end) - ------------------------------- - -- Static Functions - ------------------------------- +------------------------------- +-- Static Functions +------------------------------- function GetTotalEntries() - return math.min(#MiddleFrameBackgrounds,DefaultEntriesOnScreen) + return math.min(#MiddleFrameBackgrounds, DefaultEntriesOnScreen) end function GetEntryListLength() - local numEnts=#PlayerFrames+#TeamFrames + local numEnts = #PlayerFrames + #TeamFrames if NeutralTeam then - numEnts=numEnts+1 + numEnts = numEnts + 1 end return numEnts end @@ -1084,9 +1005,9 @@ function GetLengthOfVisbleScroll() end function GetMaxScroll() - return DefaultBottomClipPos * - 1 + return DefaultBottomClipPos * -1 end - -- can be optimized by caching when this varible changes +-- can be optimized by caching when this varible changes function GetMinScroll() if AreAllEntriesOnScreen() then return GetMaxScroll() @@ -1095,8 +1016,8 @@ function GetMinScroll() end end -function AbsoluteToPercent(x,y) - return Vector2.new(x,y)/ScreenGui.AbsoluteSize +function AbsoluteToPercent(x, y) + return Vector2.new(x, y) / ScreenGui.AbsoluteSize end --[[ tweens property of element from starta to enda over length of time @@ -1110,11 +1031,11 @@ end --]] function TweenProperty(obj, propName, inita, enda, length) local startTime = tick() - while tick()-startTimenrank do + while player.PersonalServerRank > nrank do game:GetService("PersonalServerService"):Demote(player) end end @@ -1211,10 +1129,10 @@ end player player to set privileges on nlevel new privilege level for this player --]] -function OnPrivilegeLevelSelect(player,nlevel,BanPlayerButton,VisitorButton,MemberButton,AdminButton) - debugprint('setting privilege level') - SetPrivilegeRank(player,nlevel) - HighlightMyRank(player,BanPlayerButton,VisitorButton,MemberButton,AdminButton) +function OnPrivilegeLevelSelect(player, nlevel, BanPlayerButton, VisitorButton, MemberButton, AdminButton) + debugprint "setting privilege level" + SetPrivilegeRank(player, nlevel) + HighlightMyRank(player, BanPlayerButton, VisitorButton, MemberButton, AdminButton) end --[[ @@ -1222,27 +1140,27 @@ end @Args: player Player to check for rank on --]] -function HighlightMyRank(player,BanPlayerButton,VisitorButton,MemberButton,AdminButton) - BanPlayerButton.Image= 'http://www.roblox.com/asset/?id='..Images['LightPopupMid'] - VisitorButton.Image= 'http://www.roblox.com/asset/?id='..Images['DarkPopupMid'] - MemberButton.Image= 'http://www.roblox.com/asset/?id='..Images['LightPopupMid'] - AdminButton.Image= 'http://www.roblox.com/asset/?id='..Images['DarkPopupBottom'] - - local rank=player.PersonalServerRank - if rank <= PrivilegeLevel['Banned'] then - BanPlayerButton.Image='http://www.roblox.com/asset/?id='..Images['LightBluePopupMid'] - elseif rank <= PrivilegeLevel['Visitor'] then - VisitorButton.Image='http://www.roblox.com/asset/?id='..Images['DarkBluePopupMid'] - elseif rank <= PrivilegeLevel['Member'] then - MemberButton.Image='http://www.roblox.com/asset/?id='..Images['LightBluePopupMid'] - elseif rank <= PrivilegeLevel['Admin'] then - AdminButton.Image= 'http://www.roblox.com/asset/?id='..Images['DarkBluePopupBottom'] +function HighlightMyRank(player, BanPlayerButton, VisitorButton, MemberButton, AdminButton) + BanPlayerButton.Image = "http://www.roblox.com/asset/?id=" .. Images["LightPopupMid"] + VisitorButton.Image = "http://www.roblox.com/asset/?id=" .. Images["DarkPopupMid"] + MemberButton.Image = "http://www.roblox.com/asset/?id=" .. Images["LightPopupMid"] + AdminButton.Image = "http://www.roblox.com/asset/?id=" .. Images["DarkPopupBottom"] + + local rank = player.PersonalServerRank + if rank <= PrivilegeLevel["Banned"] then + BanPlayerButton.Image = "http://www.roblox.com/asset/?id=" .. Images["LightBluePopupMid"] + elseif rank <= PrivilegeLevel["Visitor"] then + VisitorButton.Image = "http://www.roblox.com/asset/?id=" .. Images["DarkBluePopupMid"] + elseif rank <= PrivilegeLevel["Member"] then + MemberButton.Image = "http://www.roblox.com/asset/?id=" .. Images["LightBluePopupMid"] + elseif rank <= PrivilegeLevel["Admin"] then + AdminButton.Image = "http://www.roblox.com/asset/?id=" .. Images["DarkBluePopupBottom"] end end - -------------------------- - -- Report abuse handling - -------------------------- +-------------------------- +-- Report abuse handling +-------------------------- --[[ does final reporting of abuse on selected player, calls closeAbuseDialog --]] @@ -1254,7 +1172,7 @@ function OnSubmitAbuse() if AbuseName == "Rude or Mean Behavior" or AbuseName == "False Reporting Me" then CalmingAbuseBox.Parent = ReportAbuseShield else - debugprint('opening abuse box') + debugprint "opening abuse box" NormalAbuseBox.Parent = ReportAbuseShield end else @@ -1267,11 +1185,11 @@ end opens the abuse dialog, initialises text to display selectedplayer --]] function OpenAbuseDialog() - debugprint('adding report dialog') + debugprint "adding report dialog" AbusePlayerLabel.Text = SelectedPlayer.Name --AbuseDescriptionBox.Text = "" - PopUpPanel:TweenPosition(UDim2.new(1,0,0,0), "Out", "Linear", BASE_TWEEN,true) - AbuseDescriptionBox=OriginalAbuseDescriptionBox:Clone() + PopUpPanel:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Linear", BASE_TWEEN, true) + AbuseDescriptionBox = OriginalAbuseDescriptionBox:Clone() AbuseDescriptionBox.Parent = AbuseDescriptionWrapper ReportAbuseShield.Parent = ScreenGui ClosePopUpPanel() @@ -1282,7 +1200,7 @@ end function CloseAbuseDialog() AbuseName = nil SubmitReportButton.Active = false - SubmitReportButton.Image = 'http://www.roblox.com/asset/?id=96502438' -- 96501119', + SubmitReportButton.Image = "http://www.roblox.com/asset/?id=96502438" -- 96501119', AbuseDescriptionBox:Destroy() CalmingAbuseBox.Parent = nil NormalAbuseBox.Parent = nil @@ -1294,27 +1212,25 @@ end creates dropdownbox, registers all listeners for abuse dialog --]] function InitReportAbuse() - - UpdateAbuseFunction = function(abuseText) - AbuseName = abuseText + UpdateAbuseFunction = function(abuseText) + AbuseName = abuseText if AbuseName and SelectedPlayer then SubmitReportButton.Active = true - SubmitReportButton.Image = 'http://www.roblox.com/asset/?id=96501119' + SubmitReportButton.Image = "http://www.roblox.com/asset/?id=96501119" end end - + AbuseDropDown, UpdateAbuseSelection = RbxGui.CreateDropDownMenu(Abuses, UpdateAbuseFunction, true) AbuseDropDown.Name = "AbuseComboBox" AbuseDropDown.Position = UDim2.new(0.425, 0, 0, 142) - AbuseDropDown.Size = UDim2.new(0.55,0,0,32) + AbuseDropDown.Size = UDim2.new(0.55, 0, 0, 32) AbuseDropDown.Parent = AbuseSettingsFrame - - + CancelReportButton.MouseButton1Click:connect(CloseAbuseDialog) SubmitReportButton.MouseButton1Click:connect(OnSubmitAbuse) - - CalmingAbuseBox:FindFirstChild('OkButton').MouseButton1Down:connect(CloseAbuseDialog) - NormalAbuseBox:FindFirstChild('OkButton').MouseButton1Down:connect(CloseAbuseDialog) + + CalmingAbuseBox:FindFirstChild("OkButton").MouseButton1Down:connect(CloseAbuseDialog) + NormalAbuseBox:FindFirstChild("OkButton").MouseButton1Down:connect(CloseAbuseDialog) end ------------------------------------- @@ -1330,7 +1246,9 @@ local function GetFriendStatus(player) if player == game.Players.LocalPlayer then return Enum.FriendStatus.NotFriend else - local success, result = pcall(function() return game.Players.LocalPlayer:GetFriendStatus(player) end) + local success, result = pcall(function() + return game.Players.LocalPlayer:GetFriendStatus(player) + end) if success then return result else @@ -1344,15 +1262,15 @@ end based on current friend status with SelectedPlayer --]] function OnFriendButtonSelect() - - local friendStatus=GetFriendStatus(SelectedPlayer) - if friendStatus==Enum.FriendStatus.Friend then + local friendStatus = GetFriendStatus(SelectedPlayer) + if friendStatus == Enum.FriendStatus.Friend then LocalPlayer:RevokeFriendship(SelectedPlayer) - elseif friendStatus==Enum.FriendStatus.Unknown or friendStatus==Enum.FriendStatus.NotFriend then - LocalPlayer:RequestFriendship(SelectedPlayer) - elseif friendStatus==Enum.FriendStatus.FriendRequestSent then - LocalPlayer:RevokeFriendship(SelectedPlayer) - elseif friendStatus==Enum.FriendStatus.FriendRequestReceived then + elseif + friendStatus == Enum.FriendStatus.Unknown + or friendStatus == Enum.FriendStatus.NotFriend + or friendStatus == Enum.FriendStatus.FriendRequestSent + or friendStatus == Enum.FriendStatus.FriendRequestReceived + then LocalPlayer:RequestFriendship(SelectedPlayer) end --PersonalServerPanel:TweenPosition(UDim2.new(1,0,0,0), "Out", "Quad", .5,true) @@ -1361,32 +1279,34 @@ function OnFriendButtonSelect() end function OnFriendRefuseButtonSelect() - - LocalPlayer:RevokeFriendship(SelectedPlayer) ClosePopUpPanel() - PopUpPanel:TweenPosition(UDim2.new(1,0,0,0), "Out", "Linear", BASE_TWEEN,true) + PopUpPanel:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Linear", BASE_TWEEN, true) end ------------------------------------- +------------------------------------ -- Player Entry Handling ------------------------------------- +------------------------------------ --[[ used by lua's table.sort to sort player entries --]] -function PlayerSortFunction(a,b) - -- prevents flipping out leaderboard - if a['Score'] == b['Score'] then - return a['Player'].Name:upper() < b['Player'].Name:upper() +function PlayerSortFunction(a, b) + -- prevents flipping out leaderboard + if a["Score"] == b["Score"] then + return a["Player"].Name:upper() < b["Player"].Name:upper() end - if not a['Score'] then return false end - if not b['Score'] then return true end - return a['Score'] < b['Score'] + if not a["Score"] then + return false + end + if not b["Score"] then + return true + end + return a["Score"] < b["Score"] end - --------------------------------- - -- Stat Handling - --------------------------------- - -- removes and closes all leaderboard stuffs +--------------------------------- +-- Stat Handling +--------------------------------- +-- removes and closes all leaderboard stuffs function BlowThisPopsicleStand() --ScreenGui:Destroy() --script:Destroy() @@ -1396,12 +1316,12 @@ end --[[ used by lua's table.sort to prioritize score entries --]] -function StatSort(a,b) - -- primary stats should be shown before all others +function StatSort(a, b) + -- primary stats should be shown before all others if a.IsPrimary ~= b.IsPrimary then return a.IsPrimary end - -- if priorities are equal, then return the first added one + -- if priorities are equal, then return the first added one if a.Priority == b.Priority then return a.AddId < b.AddId end @@ -1413,13 +1333,12 @@ end playerEntry Entry of player who had a stat change property Name of stat changed --]] -function StatChanged(playerEntry,property) - - -- if(playerEntry['MyTeam']) then - -- UpdateSingleTeam(playerEntry['MyTeam']) - -- else - BaseUpdate() - -- end +function StatChanged(playerEntry, property) + -- if(playerEntry['MyTeam']) then + -- UpdateSingleTeam(playerEntry['MyTeam']) + -- else + BaseUpdate() + -- end end --[[ Called when stat is added @@ -1431,49 +1350,66 @@ end nchild new child value to leaderstats playerEntry entry this stat was added to --]] -function StatAdded(nchild,playerEntry) - -- dont re - add a leaderstat I alreday have - while AddingStatLock do debugprint('in stat added function lock') wait(1/30) end +function StatAdded(nchild, playerEntry) + -- dont re - add a leaderstat I alreday have + while AddingStatLock do + debugprint "in stat added function lock" + wait(1 / 30) + end AddingStatLock = true - if not (nchild:IsA('StringValue') or nchild:IsA('IntValue') or nchild:IsA('BoolValue') or nchild:IsA('NumberValue') or nchild:IsA('DoubleConstrainedValue') or nchild:IsA('IntConstrainedValue')) then + if + not ( + nchild:IsA "StringValue" + or nchild:IsA "IntValue" + or nchild:IsA "BoolValue" + or nchild:IsA "NumberValue" + or nchild:IsA "DoubleConstrainedValue" + or nchild:IsA "IntConstrainedValue" + ) + then BlowThisPopsicleStand() else local haveScore = false - for _,i in pairs(ScoreNames) do - if i['Name']==nchild.Name then haveScore=true end + for _, i in pairs(ScoreNames) do + if i["Name"] == nchild.Name then + haveScore = true + end end if not haveScore then local nstat = {} - nstat['Name'] = nchild.Name - nstat['Priority'] = 0 - if(nchild:FindFirstChild('Priority')) then - nstat['Priority'] = nchild.Priority + nstat["Name"] = nchild.Name + nstat["Priority"] = 0 + if nchild:FindFirstChild "Priority" then + nstat["Priority"] = nchild.Priority end - nstat['IsPrimary'] = false - if(nchild:FindFirstChild('IsPrimary')) then - nstat['IsPrimary'] = true + nstat["IsPrimary"] = false + if nchild:FindFirstChild "IsPrimary" then + nstat["IsPrimary"] = true end nstat.AddId = AddId AddId = AddId + 1 - table.insert(ScoreNames,nstat) - table.sort(ScoreNames,StatSort) - if not StatTitles:FindFirstChild(nstat['Name']) then - CreateStatTitle(nstat['Name']) + table.insert(ScoreNames, nstat) + table.sort(ScoreNames, StatSort) + if not StatTitles:FindFirstChild(nstat["Name"]) then + CreateStatTitle(nstat["Name"]) end UpdateMaximize() - end end - AddingStatLock = false - StatChanged(playerEntry) - nchild.Changed:connect(function(property) StatChanged(playerEntry,property) end) - - + AddingStatLock = false + StatChanged(playerEntry) + nchild.Changed:connect(function(property) + StatChanged(playerEntry, property) + end) end --returns whether any of the existing players has this stat 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) then + for _, playerf in pairs(PlayerFrames) do + if + playerf["Player"] ~= exception + and playerf["Player"]:FindFirstChild "leaderstats" + and playerf["Player"].leaderstats:FindFirstChild(statName) + then --print('player:' .. playerf['Player'].Name ..' has stat') return true end @@ -1481,8 +1417,6 @@ function DoesStatExist(statName, exception) return false end - - --[[ Called when stat is removed from player for all players, destroys the stat frame associated with this value, @@ -1492,23 +1426,26 @@ end nchild ___value to be removed playerEntry entry of player value is being removed from --]] -function StatRemoved(nchild,playerEntry) - while AddingStatLock do debugprint('In Adding Stat Lock1') wait(1/30) end - AddingStatLock = true - if playerEntry['Frame']:FindFirstChild(nchild.Name) then - debugprint('Destroyed frame!') - playerEntry['Frame'][nchild.Name].Parent = nil +function StatRemoved(nchild, playerEntry) + while AddingStatLock do + debugprint "In Adding Stat Lock1" + wait(1 / 30) end - if not DoesStatExist(nchild.Name, playerEntry['Player']) then - for i,val in ipairs(ScoreNames) do - if val['Name'] == nchild.Name then - table.remove(ScoreNames,i) + AddingStatLock = true + if playerEntry["Frame"]:FindFirstChild(nchild.Name) then + debugprint "Destroyed frame!" + playerEntry["Frame"][nchild.Name].Parent = nil + end + if not DoesStatExist(nchild.Name, playerEntry["Player"]) then + for i, val in ipairs(ScoreNames) do + 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() + for _, teamf in pairs(TeamFrames) do + if teamf["Frame"]:FindFirstChild(nchild.Name) then + teamf["Frame"][nchild.Name]:Destroy() end end end @@ -1522,18 +1459,20 @@ end used when leaderstats are removed, or when new leaderstats are added(for weird edge case)+ --]] function RemoveAllStats(playerEntry) - for i,val in ipairs(ScoreNames) do - StatRemoved(val,playerEntry) + for i, val in ipairs(ScoreNames) do + StatRemoved(val, playerEntry) end - end - function GetScoreValue(score) - if score:IsA('DoubleConstrainedValue') or score:IsA('IntConstrainedValue') then + if score:IsA "DoubleConstrainedValue" or score:IsA "IntConstrainedValue" then return score.ConstrainedValue - elseif score:IsA('BoolValue') then - if score.Value then return 1 else return 0 end + elseif score:IsA "BoolValue" then + if score.Value then + return 1 + else + return 0 + end else return score.Value end @@ -1541,47 +1480,56 @@ end --[[ --]] -function MakeScoreEntry(entry,scoreval,panel) - if not panel:FindFirstChild('PlayerScore') then return end - local nscoretxt = panel:FindFirstChild('PlayerScore'):Clone() +function MakeScoreEntry(entry, scoreval, panel) + if not panel:FindFirstChild "PlayerScore" then + return + end + local nscoretxt = panel:FindFirstChild("PlayerScore"):Clone() local thisScore = nil --here lies the resting place of a once great and terrible bug --may its treachery never be forgoten, lest its survivors fall for it again --RIP the leaderstat bug, oct 2012-nov 2012 wait() - if entry['Player']:FindFirstChild('leaderstats') and entry['Player'].leaderstats:FindFirstChild(scoreval['Name']) then - thisScore = entry['Player']:FindFirstChild('leaderstats'):FindFirstChild(scoreval['Name']) + if + entry["Player"]:FindFirstChild "leaderstats" and entry["Player"].leaderstats:FindFirstChild(scoreval["Name"]) + then + thisScore = entry["Player"]:FindFirstChild("leaderstats"):FindFirstChild(scoreval["Name"]) else return end - - if not entry['Player'].Parent then return end - - nscoretxt.Name = scoreval['Name'] + + if not entry["Player"].Parent then + return + end + + nscoretxt.Name = scoreval["Name"] nscoretxt.Text = tostring(GetScoreValue(thisScore)) - if scoreval['Name'] == ScoreNames[1]['Name'] then - debugprint('changing score') - entry['Score'] = GetScoreValue(thisScore) - if entry['Player'] == LocalPlayer then HeaderScore.Text = tostring(GetScoreValue(thisScore)) end + if scoreval["Name"] == ScoreNames[1]["Name"] then + debugprint "changing score" + entry["Score"] = GetScoreValue(thisScore) + if entry["Player"] == LocalPlayer then + HeaderScore.Text = tostring(GetScoreValue(thisScore)) + end end thisScore.Changed:connect(function() - if not thisScore.Parent then return end - if scoreval['Name'] == ScoreNames[1]['Name'] then - - entry['Score'] = GetScoreValue(thisScore) - if entry['Player'] == LocalPlayer then HeaderScore.Text = tostring(GetScoreValue(thisScore)) end + if not thisScore.Parent then + return + end + if scoreval["Name"] == ScoreNames[1]["Name"] then + entry["Score"] = GetScoreValue(thisScore) + if entry["Player"] == LocalPlayer then + HeaderScore.Text = tostring(GetScoreValue(thisScore)) + end end nscoretxt.Text = tostring(GetScoreValue(thisScore)) BaseUpdate() end) return nscoretxt - end function CreateStatTitle(statName) - - local ntitle = MiddleTemplate:FindFirstChild('PlayerScore'):Clone() + local ntitle = MiddleTemplate:FindFirstChild("PlayerScore"):Clone() ntitle.Name = statName ntitle.Text = statName -- ntitle @@ -1594,64 +1542,82 @@ function CreateStatTitle(statName) end function RecreateScoreColumns(ptable) - while AddingStatLock do debugprint ('In Adding Stat Lock2') wait(1/30) end + while AddingStatLock do + debugprint "In Adding Stat Lock2" + wait(1 / 30) + end AddingStatLock = true - local Xoffset=5--15 --current offset from Right - local maxXOffset=Xoffset - local MaxSizeColumn=0 --max size for this column - + local Xoffset = 5 --15 --current offset from Right + local maxXOffset = Xoffset + local MaxSizeColumn = 0 --max size for this column + -- foreach known leaderstat - for j = #ScoreNames, 1,-1 do + for j = #ScoreNames, 1, -1 do local scoreval = ScoreNames[j] - MaxSizeColumn=0 + MaxSizeColumn = 0 -- for each entry in this player table - for i,entry in ipairs(ptable) do - local panel = entry['Frame'] - local tplayer = entry['Player'] + for i, entry in ipairs(ptable) do + 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) + local nentry = MakeScoreEntry(entry, scoreval, panel) if nentry then - debugprint('adding '..nentry.Name..' to '..entry['Player'].Name ) + debugprint("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']) then + if + 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(UDim2.new(RightEdgeSpace,-Xoffset,0,0),'Out','Linear',BASE_TWEEN,true) + MaxSizeColumn = math.max(MaxSizeColumn, StatTitles[scoreval["Name"]].TextBounds.X) + StatTitles[scoreval["Name"]]:TweenPosition( + UDim2.new(RightEdgeSpace, -Xoffset, 0, 0), + "Out", + "Linear", + BASE_TWEEN, + true + ) else - StatTitles[scoreval['Name'] ]:TweenPosition(UDim2.new((.4+((.6/#ScoreNames)*(j-1)))-1,0,0,0),'Out','Linear',BASE_TWEEN,true) + StatTitles[scoreval["Name"]]:TweenPosition( + UDim2.new((0.4 + ((0.6 / #ScoreNames) * (j - 1))) - 1, 0, 0, 0), + "Out", + "Linear", + BASE_TWEEN, + true + ) end - scoreval['ColumnSize']=MaxSizeColumn - Xoffset= Xoffset+SpacingPerStat+MaxSizeColumn - maxXOffset=math.max(Xoffset,maxXOffset) + scoreval["ColumnSize"] = MaxSizeColumn + Xoffset = Xoffset + SpacingPerStat + MaxSizeColumn + maxXOffset = math.max(Xoffset, maxXOffset) end - NormalBounds = UDim2.new(0, BaseScreenXSize+maxXOffset-SpacingPerStat,0,800) - NormalPosition = UDim2.new(1 , -NormalBounds.X.Offset, NormalPosition.Y.Scale, 0) + NormalBounds = UDim2.new(0, BaseScreenXSize + maxXOffset - SpacingPerStat, 0, 800) + NormalPosition = UDim2.new(1, -NormalBounds.X.Offset, NormalPosition.Y.Scale, 0) UpdateHeaderNameSize() UpdateMaximize() - + AddingStatLock = false end - --------------------------- - -- Minimizing and maximizing - --------------------------- +--------------------------- +-- Minimizing and maximizing +--------------------------- function ToggleMinimize() IsMinimized.Value = not IsMinimized.Value @@ -1664,18 +1630,24 @@ function ToggleMaximize() end function Tabify() - IsTabified.Value= true - IsMaximized.Value=false - IsMinimized.Value=true + IsTabified.Value = true + IsMaximized.Value = false + IsMinimized.Value = true UpdateMinimize() - IsTabified.Value= true - ScreenGui:TweenPosition(UDim2.new(NormalBounds.X.Scale, NormalBounds.X.Offset-10, 0,0),'Out','Linear',BASE_TWEEN*1.2,true) + IsTabified.Value = true + ScreenGui:TweenPosition( + UDim2.new(NormalBounds.X.Scale, NormalBounds.X.Offset - 10, 0, 0), + "Out", + "Linear", + BASE_TWEEN * 1.2, + true + ) end function UnTabify() if IsTabified.Value then - IsTabified.Value= false - ScreenGui:TweenPosition(UDim2.new(0, 0, 0,0),'Out','Linear',BASE_TWEEN*1.2,true) + IsTabified.Value = false + ScreenGui:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Linear", BASE_TWEEN * 1.2, true) end end @@ -1685,35 +1657,41 @@ end called from EVERYWHERE, too much probably --]] function UpdateMinimize() - if IsMinimized.Value then if IsMaximized.Value then ToggleMaximize() end if not IsTabified.Value then - MainFrame:TweenSizeAndPosition(UDim2.new(0.010, HeaderName.TextBounds.X, NormalBounds.Y.Scale,NormalBounds.Y.Offset), - UDim2.new(.990, -HeaderName.TextBounds.X, NormalPosition.Y.Scale,0),'Out','Linear',BASE_TWEEN*1.2,true) - else - MainFrame:TweenSizeAndPosition(NormalBounds,NormalPosition,'Out','Linear',BASE_TWEEN*1.2,true) + MainFrame:TweenSizeAndPosition( + UDim2.new(0.010, HeaderName.TextBounds.X, NormalBounds.Y.Scale, NormalBounds.Y.Offset), + UDim2.new(0.990, -HeaderName.TextBounds.X, NormalPosition.Y.Scale, 0), + "Out", + "Linear", + BASE_TWEEN * 1.2, + true + ) + else + MainFrame:TweenSizeAndPosition(NormalBounds, NormalPosition, "Out", "Linear", BASE_TWEEN * 1.2, true) end --(#MiddleFrameBackgrounds*MiddleBGTemplate.Size.Y.Scale) - BottomClipFrame:TweenPosition(UDim2.new(0,0,-1,0), "Out", "Linear", BASE_TWEEN*1.2,true) - BottomFrame:TweenPosition(UDim2.new(0,0,0,0), "Out", "Linear", BASE_TWEEN*1.2,true) - FocusFrame.Size=UDim2.new(1,0,HeaderFrameHeight,0) - ExtendTab.Image = 'http://www.roblox.com/asset/?id=94692731' + BottomClipFrame:TweenPosition(UDim2.new(0, 0, -1, 0), "Out", "Linear", BASE_TWEEN * 1.2, true) + BottomFrame:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Linear", BASE_TWEEN * 1.2, true) + FocusFrame.Size = UDim2.new(1, 0, HeaderFrameHeight, 0) + ExtendTab.Image = "http://www.roblox.com/asset/?id=94692731" else if not IsMaximized.Value then - MainFrame:TweenSizeAndPosition(NormalBounds,NormalPosition,'Out','Linear',BASE_TWEEN*1.2,true) + MainFrame:TweenSizeAndPosition(NormalBounds, NormalPosition, "Out", "Linear", BASE_TWEEN * 1.2, true) end --do limiting - DefaultBottomClipPos = math.min(math.max(DefaultBottomClipPos,-1),-1+(#MiddleFrameBackgrounds*MiddleBGTemplate.Size.Y.Scale)) + DefaultBottomClipPos = + math.min(math.max(DefaultBottomClipPos, -1), -1 + (#MiddleFrameBackgrounds * MiddleBGTemplate.Size.Y.Scale)) UpdateScrollPosition() - BottomClipFrame.Position=UDim2.new(0,0,DefaultBottomClipPos,0) - local bottomPositon = (DefaultBottomClipPos+BottomClipFrame.Size.Y.Scale) - BottomFrame.Position=UDim2.new(0,0,bottomPositon,0) - FocusFrame.Size=UDim2.new(1,0,bottomPositon + HeaderFrameHeight,0) - ExtendTab.Image = 'http://www.roblox.com/asset/?id=94825585' + BottomClipFrame.Position = UDim2.new(0, 0, DefaultBottomClipPos, 0) + local bottomPositon = (DefaultBottomClipPos + BottomClipFrame.Size.Y.Scale) + BottomFrame.Position = UDim2.new(0, 0, bottomPositon, 0) + FocusFrame.Size = UDim2.new(1, 0, bottomPositon + HeaderFrameHeight, 0) + ExtendTab.Image = "http://www.roblox.com/asset/?id=94825585" end end @@ -1723,83 +1701,120 @@ end --]] function UpdateMaximize() if IsMaximized.Value then - for j = 1, #ScoreNames,1 do + for j = 1, #ScoreNames, 1 do local scoreval = ScoreNames[j] - StatTitles[scoreval['Name'] ]:TweenPosition(UDim2.new(.4+((.6/#ScoreNames)*(j-1))-1,0,0,0),'Out','Linear',BASE_TWEEN,true) + StatTitles[scoreval["Name"]]:TweenPosition( + UDim2.new(0.4 + ((0.6 / #ScoreNames) * (j - 1)) - 1, 0, 0, 0), + "Out", + "Linear", + BASE_TWEEN, + true + ) end - + if IsMinimized.Value then ToggleMinimize() else UpdateMinimize() end - - MainFrame:TweenSizeAndPosition(MaximizedBounds,MaximizedPosition,'Out','Linear',BASE_TWEEN*1.2,true) - HeaderScore:TweenPosition(UDim2.new(0,0,HeaderName.Position.Y.Scale,0), "Out", "Linear", BASE_TWEEN*1.2,true) - HeaderName:TweenPosition(UDim2.new( - .1, - HeaderScore.TextBounds.x,HeaderName.Position.Y.Scale,0), "Out", "Linear", BASE_TWEEN*1.2,true) - HeaderFrame.Background.Image = 'http://www.roblox.com/asset/?id='..Images['LargeHeader'] - BottomFrame.Background.Image = 'http://www.roblox.com/asset/?id='..Images['LargeBottom'] + MainFrame:TweenSizeAndPosition(MaximizedBounds, MaximizedPosition, "Out", "Linear", BASE_TWEEN * 1.2, true) + HeaderScore:TweenPosition( + UDim2.new(0, 0, HeaderName.Position.Y.Scale, 0), + "Out", + "Linear", + BASE_TWEEN * 1.2, + true + ) + HeaderName:TweenPosition( + UDim2.new(-0.1, -HeaderScore.TextBounds.x, HeaderName.Position.Y.Scale, 0), + "Out", + "Linear", + BASE_TWEEN * 1.2, + true + ) + HeaderFrame.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["LargeHeader"] + BottomFrame.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["LargeBottom"] for index, i in ipairs(MiddleFrameBackgrounds) do - if (index%2) ~= 1 then - i.Background.Image = 'http://www.roblox.com/asset/?id='..Images['LargeDark'] + if (index % 2) ~= 1 then + i.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["LargeDark"] else - i.Background.Image = 'http://www.roblox.com/asset/?id='..Images['LargeLight'] + i.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["LargeLight"] end end - for index, i in ipairs(MiddleFrames) do - if i:FindFirstChild('ClickListener') then - i.ClickListener.Size = UDim2.new(.974,0,i.ClickListener.Size.Y.Scale,0) + for _, i in ipairs(MiddleFrames) do + if i:FindFirstChild "ClickListener" then + i.ClickListener.Size = UDim2.new(0.974, 0, i.ClickListener.Size.Y.Scale, 0) end - for j=1, #ScoreNames,1 do + for j = 1, #ScoreNames, 1 do local scoreval = ScoreNames[j] - if i:FindFirstChild(scoreval['Name']) then - i[scoreval['Name']]:TweenPosition(UDim2.new(.4+((.6/#ScoreNames)*(j-1))-1,0,0,0), "Out", "Linear", BASE_TWEEN,true) + if i:FindFirstChild(scoreval["Name"]) then + i[scoreval["Name"]]:TweenPosition( + UDim2.new(0.4 + ((0.6 / #ScoreNames) * (j - 1)) - 1, 0, 0, 0), + "Out", + "Linear", + BASE_TWEEN, + true + ) end end end - for i,entry in ipairs(PlayerFrames) do - WaitForChild(entry['Frame'],'TitleFrame').Size=UDim2.new(.38,0,entry['Frame'].TitleFrame.Size.Y.Scale,0) + for _, entry in ipairs(PlayerFrames) do + WaitForChild(entry["Frame"], "TitleFrame").Size = + UDim2.new(0.38, 0, entry["Frame"].TitleFrame.Size.Y.Scale, 0) end - - for i,entry in ipairs(TeamFrames) do - WaitForChild(entry['Frame'],'TitleFrame').Size=UDim2.new(.38,0,entry['Frame'].TitleFrame.Size.Y.Scale,0) + + for _, entry in ipairs(TeamFrames) do + WaitForChild(entry["Frame"], "TitleFrame").Size = + UDim2.new(0.38, 0, entry["Frame"].TitleFrame.Size.Y.Scale, 0) end - else if not IsMinimized.Value then - MainFrame:TweenSizeAndPosition(NormalBounds,NormalPosition,'Out','Linear',BASE_TWEEN*1.2,true) + MainFrame:TweenSizeAndPosition(NormalBounds, NormalPosition, "Out", "Linear", BASE_TWEEN * 1.2, true) end - HeaderScore:TweenPosition(UDim2.new(0,0,.4,0), "Out", "Linear", BASE_TWEEN*1.2,true) - HeaderName:TweenPosition(UDim2.new(0,0,HeaderName.Position.Y.Scale,0), "Out", "Linear", BASE_TWEEN*1.2,true) - HeaderFrame.Background.Image = 'http://www.roblox.com/asset/?id='..Images['NormalHeader'] - BottomFrame.Background.Image = 'http://www.roblox.com/asset/?id='..Images['NormalBottom'] + HeaderScore:TweenPosition(UDim2.new(0, 0, 0.4, 0), "Out", "Linear", BASE_TWEEN * 1.2, true) + HeaderName:TweenPosition( + UDim2.new(0, 0, HeaderName.Position.Y.Scale, 0), + "Out", + "Linear", + BASE_TWEEN * 1.2, + true + ) + HeaderFrame.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["NormalHeader"] + BottomFrame.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["NormalBottom"] for index, i in ipairs(MiddleFrameBackgrounds) do - if index%2 ~= 1 then - i.Background.Image = 'http://www.roblox.com/asset/?id='..Images['midDark'] + if index % 2 ~= 1 then + i.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["midDark"] else - i.Background.Image = 'http://www.roblox.com/asset/?id='..Images['midLight'] + i.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["midLight"] end end for index, i in ipairs(MiddleFrames) do - if i:FindFirstChild('ClickListener') then - i.ClickListener.Size = UDim2.new(.96,0,i.ClickListener.Size.Y.Scale,0) - for j=1, #ScoreNames,1 do + if i:FindFirstChild "ClickListener" then + i.ClickListener.Size = 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), "Out", "Linear", BASE_TWEEN,true) + i[scoreval["Name"]]:TweenPosition( + UDim2.new(RightEdgeSpace, -scoreval["XOffset"], 0, 0), + "Out", + "Linear", + BASE_TWEEN, + true + ) end end end end - - for i,entry in ipairs(TeamFrames) do - WaitForChild(entry['Frame'],'TitleFrame').Size=UDim2.new(0,BaseScreenXSize*.9,entry['Frame'].TitleFrame.Size.Y.Scale,0) - + + for i, entry in ipairs(TeamFrames) do + WaitForChild(entry["Frame"], "TitleFrame").Size = + UDim2.new(0, BaseScreenXSize * 0.9, entry["Frame"].TitleFrame.Size.Y.Scale, 0) end - for i,entry in ipairs(PlayerFrames) do - WaitForChild(entry['Frame'],'TitleFrame').Size=UDim2.new(0,BaseScreenXSize*.9,entry['Frame'].TitleFrame.Size.Y.Scale,0) + for i, entry in ipairs(PlayerFrames) do + WaitForChild(entry["Frame"], "TitleFrame").Size = + UDim2.new(0, BaseScreenXSize * 0.9, entry["Frame"].TitleFrame.Size.Y.Scale, 0) end end end @@ -1814,79 +1829,113 @@ end function ExpandNames() if #ScoreNames ~= 0 then - for _,i in pairs(StatTitles:GetChildren()) do - Spawn(function()TweenProperty(i,'TextTransparency',i.TextTransparency,0,BASE_TWEEN) end) + for _, i in pairs(StatTitles:GetChildren()) do + Spawn(function() + TweenProperty(i, "TextTransparency", i.TextTransparency, 0, BASE_TWEEN) + end) end - HeaderFrameHeight=.09 + HeaderFrameHeight = 0.09 --as of writing, this and 'CloseNames' are the only places headerframe is resized - HeaderFrame:TweenSizeAndPosition(UDim2.new(HeaderFrame.Size.X.Scale, HeaderFrame.Size.X.Offset, HeaderFrameHeight,0), - HeaderFrame.Position,'Out','Linear',BASE_TWEEN*1.2,true) - TopClipFrame:TweenPosition(UDim2.new(TopClipFrame.Position.X.Scale,0,HeaderFrameHeight,0),'Out','Linear',BASE_TWEEN*1.2,true) - BottomShiftFrame:TweenPosition(UDim2.new(0,0,HeaderFrameHeight,0), "Out", 'Linear', BASE_TWEEN*1.2,true) - + HeaderFrame:TweenSizeAndPosition( + UDim2.new(HeaderFrame.Size.X.Scale, HeaderFrame.Size.X.Offset, HeaderFrameHeight, 0), + HeaderFrame.Position, + "Out", + "Linear", + BASE_TWEEN * 1.2, + true + ) + TopClipFrame:TweenPosition( + UDim2.new(TopClipFrame.Position.X.Scale, 0, HeaderFrameHeight, 0), + "Out", + "Linear", + BASE_TWEEN * 1.2, + true + ) + BottomShiftFrame:TweenPosition(UDim2.new(0, 0, HeaderFrameHeight, 0), "Out", "Linear", BASE_TWEEN * 1.2, true) end - end function CloseNames() if #ScoreNames ~= 0 then - HeaderFrameHeight=.07 - if not (IsMaximized.Value) then - for _,i in pairs(StatTitles:GetChildren()) do - Spawn(function()TweenProperty(i,'TextTransparency',i.TextTransparency,1,BASE_TWEEN) end) + HeaderFrameHeight = 0.07 + if not IsMaximized.Value then + for _, i in pairs(StatTitles:GetChildren()) do + Spawn(function() + TweenProperty(i, "TextTransparency", i.TextTransparency, 1, BASE_TWEEN) + end) end end - BottomShiftFrame:TweenPosition(UDim2.new(0,0,HeaderFrameHeight,0), "Out", 'Linear', BASE_TWEEN*1.2,true) - HeaderFrame:TweenSizeAndPosition(UDim2.new(HeaderFrame.Size.X.Scale, HeaderFrame.Size.X.Offset, HeaderFrameHeight,0), - HeaderFrame.Position,'Out','Linear',BASE_TWEEN*1.2,true) - TopClipFrame:TweenPosition(UDim2.new(TopClipFrame.Position.X.Scale,0,HeaderFrameHeight,0),'Out','Linear',BASE_TWEEN*1.2,true) + BottomShiftFrame:TweenPosition(UDim2.new(0, 0, HeaderFrameHeight, 0), "Out", "Linear", BASE_TWEEN * 1.2, true) + HeaderFrame:TweenSizeAndPosition( + UDim2.new(HeaderFrame.Size.X.Scale, HeaderFrame.Size.X.Offset, HeaderFrameHeight, 0), + HeaderFrame.Position, + "Out", + "Linear", + BASE_TWEEN * 1.2, + true + ) + TopClipFrame:TweenPosition( + UDim2.new(TopClipFrame.Position.X.Scale, 0, HeaderFrameHeight, 0), + "Out", + "Linear", + BASE_TWEEN * 1.2, + true + ) end end function OnScrollWheelMove(direction) if not (IsTabified.Value or IsMinimized.Value or InPopupWaitForClick) then local StartFrame = ListFrame.Position - local newFrameY = math.max(math.min(StartFrame.Y.Scale + (direction),GetMaxScroll()),GetMinScroll()) + local newFrameY = math.max(math.min(StartFrame.Y.Scale + direction, GetMaxScroll()), GetMinScroll()) - ListFrame.Position = UDim2.new(StartFrame.X.Scale,StartFrame.X.Offset,newFrameY,StartFrame.Y.Offset) + ListFrame.Position = UDim2.new(StartFrame.X.Scale, StartFrame.X.Offset, newFrameY, StartFrame.Y.Offset) UpdateScrollPosition() end end function AttachScrollWheel() - if ScrollWheelConnections then return end + if ScrollWheelConnections then + return + end ScrollWheelConnections = {} - table.insert(ScrollWheelConnections,Mouse.WheelForward:connect(function() - OnScrollWheelMove(.05) - end)) - table.insert(ScrollWheelConnections,Mouse.WheelBackward:connect(function() - OnScrollWheelMove(-.05) - end)) + table.insert( + ScrollWheelConnections, + Mouse.WheelForward:connect(function() + OnScrollWheelMove(0.05) + end) + ) + table.insert( + ScrollWheelConnections, + Mouse.WheelBackward:connect(function() + OnScrollWheelMove(-0.05) + end) + ) end function DetachScrollWheel() if ScrollWheelConnections then - for _,i in pairs(ScrollWheelConnections) do + for _, i in pairs(ScrollWheelConnections) do i:disconnect() end end - ScrollWheelConnections=nil + ScrollWheelConnections = nil end -FocusFrame.MouseEnter:connect(function() - if not (IsMinimized.Value or IsTabified.Value) then +FocusFrame.MouseEnter:connect(function() + if not (IsMinimized.Value or IsTabified.Value) then AttachScrollWheel() - end + end end) -FocusFrame.MouseLeave:connect(function() - --if not (IsMaximized.Value or IsMinimized.Value) then - DetachScrollWheel() - --end +FocusFrame.MouseLeave:connect(function() + --if not (IsMaximized.Value or IsMinimized.Value) then + DetachScrollWheel() + --end end) - ------------------------ - -- Scroll Bar functions - ------------------------ +------------------------ +-- Scroll Bar functions +------------------------ --[[ updates whether the scroll bar should be showing, if it is showing, updates the size of it @@ -1898,16 +1947,15 @@ function UpdateScrollBarVisibility() ScrollBar.BackgroundTransparency = 0 UpdateScrollBarSize() end -end +end --[[ updates size of scrollbar depending on how many entries exist --]] function UpdateScrollBarSize() local entryListSize = #MiddleFrameBackgrounds * MiddleTemplate.Size.Y.Scale - local shownAreaSize = ((BottomClipFrame.Position.Y.Scale) + 1) - ScrollBar.Size = UDim2.new(1,0,shownAreaSize/entryListSize,0) - -end + local shownAreaSize = (BottomClipFrame.Position.Y.Scale + 1) + ScrollBar.Size = UDim2.new(1, 0, shownAreaSize / entryListSize, 0) +end --[[ updates position of listframe so that no gaps at the bottom or top of the list are visible updates position of scrollbar to match what parts of the list are visible @@ -1916,12 +1964,14 @@ function UpdateScrollPosition() local minPos = GetMinScroll() local maxPos = GetMaxScroll() local scrollLength = maxPos - minPos - - local yscrollpos=math.max(math.min(ListFrame.Position.Y.Scale,maxPos),minPos) - ListFrame.Position=UDim2.new(ListFrame.Position.X.Scale,ListFrame.Position.X.Offset,yscrollpos,ListFrame.Position.Y.Offset) - + + local yscrollpos = math.max(math.min(ListFrame.Position.Y.Scale, maxPos), minPos) + ListFrame.Position = + UDim2.new(ListFrame.Position.X.Scale, ListFrame.Position.X.Offset, yscrollpos, ListFrame.Position.Y.Offset) + local adjustedLength = 1 - ScrollBar.Size.Y.Scale - ScrollBar.Position = UDim2.new(0,0,adjustedLength - (adjustedLength * ((ListFrame.Position.Y.Scale - minPos)/scrollLength)),0) + ScrollBar.Position = + UDim2.new(0, 0, adjustedLength - (adjustedLength * ((ListFrame.Position.Y.Scale - minPos) / scrollLength)), 0) end --[[ @@ -1929,47 +1979,52 @@ end revize when global input is available Manages scrolling of the playerlist on mouse drag --]] -function StartDrag(entry,startx,starty) +function StartDrag(entry, startx, starty) local startDragTime = tick() - local stopDrag = false - local openPanel = true - local draggedFrame = WaitForChild(entry['Frame'],'ClickListener') - local function dragExit() - stopDrag = true + local stopDrag = false + local openPanel = true + local draggedFrame = WaitForChild(entry["Frame"], "ClickListener") + local function dragExit() + stopDrag = true - if entry['Player'] and SelectedPlayer and openPanel - and entry['Player']~=LocalPlayer and SelectedPlayer.userId>1 and LocalPlayer.userId>1 then - ActivatePlayerEntryPanel(entry) - end + if + entry["Player"] + and SelectedPlayer + and openPanel + and entry["Player"] ~= LocalPlayer + and SelectedPlayer.userId > 1 + and LocalPlayer.userId > 1 + then + ActivatePlayerEntryPanel(entry) end - local startY = nil - local StartFrame = ListFrame.Position - local function dragpoll(nx,ny) - if not startY then - startY = AbsoluteToPercent(nx,ny).Y - end - local nowY = AbsoluteToPercent(nx,ny).Y - debugprint('drag dist:'..Vector2.new(startx-nx,starty-ny).magnitude) - if Vector2.new(startx-nx,starty-ny).magnitude>MOUSE_DRAG_DISTANCE then - openPanel=false - end - - local newFrameY = math.max(math.min(StartFrame.Y.Scale + (nowY - startY),GetMaxScroll()),GetMinScroll()) - ListFrame.Position = UDim2.new(StartFrame.X.Scale,StartFrame.X.Offset,newFrameY,StartFrame.Y.Offset) - UpdateScrollPosition() + end + local startY = nil + local StartFrame = ListFrame.Position + local function dragpoll(nx, ny) + if not startY then + startY = AbsoluteToPercent(nx, ny).Y end - WaitForClick(ScreenGui,dragpoll,dragExit) + local nowY = AbsoluteToPercent(nx, ny).Y + debugprint("drag dist:" .. Vector2.new(startx - nx, starty - ny).magnitude) + if Vector2.new(startx - nx, starty - ny).magnitude > MOUSE_DRAG_DISTANCE then + openPanel = false + end + + local newFrameY = math.max(math.min(StartFrame.Y.Scale + (nowY - startY), GetMaxScroll()), GetMinScroll()) + ListFrame.Position = UDim2.new(StartFrame.X.Scale, StartFrame.X.Offset, newFrameY, StartFrame.Y.Offset) + UpdateScrollPosition() + end + WaitForClick(ScreenGui, dragpoll, dragExit) end - function StartMinimizeDrag() - Delay(0,function() - local startTime=tick() - debugprint('Got Click2') + Delay(0, function() + local startTime = tick() + debugprint "Got Click2" local stopDrag = false - local function dragExit() - --debugprint('undone click2') - if tick()-startTime<.25 then --was click + local function dragExit() + --debugprint('undone click2') + if tick() - startTime < 0.25 then --was click ToggleMinimize() else --was drag DidMinimizeDrag = true @@ -1977,44 +2032,50 @@ function StartMinimizeDrag() ToggleMinimize() end end - stopDrag = true + stopDrag = true end - local startY = nil + local startY = nil local StartFrame = DefaultBottomClipPos - local function dragpoll(nx,ny) + local function dragpoll(nx, ny) if not IsMinimized.Value then - if not startY then - startY = AbsoluteToPercent(nx,ny).Y + startY = AbsoluteToPercent(nx, ny).Y end - local nowY = AbsoluteToPercent(nx,ny).Y - local newFrameY - newFrameY = math.min(math.max(StartFrame + (nowY - startY),-1),-1+(#MiddleFrameBackgrounds*MiddleBGTemplate.Size.Y.Scale)) + local nowY = AbsoluteToPercent(nx, ny).Y + local newFrameY + newFrameY = math.min( + math.max(StartFrame + (nowY - startY), -1), + -1 + (#MiddleFrameBackgrounds * MiddleBGTemplate.Size.Y.Scale) + ) DefaultBottomClipPos = newFrameY UpdateMinimize() - ScrollBarFrame.Size= UDim2.new(ScrollBarFrame.Size.X.Scale,0,(DefaultBottomClipPos+BottomClipFrame.Size.Y.Scale),0) - ScrollBarFrame.Position= UDim2.new(ScrollBarFrame.Position.X.Scale,0,1-ScrollBarFrame.Size.Y.Scale,0) + ScrollBarFrame.Size = + UDim2.new(ScrollBarFrame.Size.X.Scale, 0, (DefaultBottomClipPos + BottomClipFrame.Size.Y.Scale), 0) + ScrollBarFrame.Position = + UDim2.new(ScrollBarFrame.Position.X.Scale, 0, 1 - ScrollBarFrame.Size.Y.Scale, 0) UpdateScrollBarSize() UpdateScrollPosition() UpdateScrollBarVisibility() - end end - Spawn(function() WaitForClick(ScreenGui,dragpoll,dragExit) end) + Spawn(function() + WaitForClick(ScreenGui, dragpoll, dragExit) + end) end) - end - ------------------------------- - -- Input Callback functions - ------------------------------- -IsMaximized.Value=false -IsMinimized.Value=false +------------------------------- +-- Input Callback functions +------------------------------- +IsMaximized.Value = false +IsMinimized.Value = false IsMaximized.Changed:connect(UpdateMaximize) IsMinimized.Changed:connect(UpdateMinimize) -ExtendButton.MouseButton1Down:connect(function() - if(time() - LastClick < ButtonCooldown) or InPopupWaitForClick then return end +ExtendButton.MouseButton1Down:connect(function() + if (time() - LastClick < ButtonCooldown) or InPopupWaitForClick then + return + end LastClick = time() if IsTabified.Value then UnTabify() @@ -2024,7 +2085,9 @@ ExtendButton.MouseButton1Down:connect(function() end) MaximizeButton.MouseButton1Click:connect(function() - if(time() - LastClick < ButtonCooldown) or InPopupWaitForClick then return end + if (time() - LastClick < ButtonCooldown) or InPopupWaitForClick then + return + end LastClick = time() if IsTabified.Value then UnTabify() @@ -2037,7 +2100,9 @@ MaximizeButton.MouseButton1Click:connect(function() end) MaximizeButton.MouseButton2Click:connect(function() - if(time() - LastClick < ButtonCooldown) or InPopupWaitForClick then return end + if (time() - LastClick < ButtonCooldown) or InPopupWaitForClick then + return + end LastClick = time() if IsTabified.Value then UnTabify() @@ -2051,38 +2116,37 @@ MaximizeButton.MouseButton2Click:connect(function() end end) - -------------------------------- +------------------------------- -- MiddleFrames management -------------------------------- +------------------------------- --[[ adds a background frame to the listframe --]] function AddMiddleBGFrame() local nBGFrame = MiddleBGTemplate:Clone() - nBGFrame.Position = UDim2.new(.5,0,((#MiddleFrameBackgrounds) * nBGFrame.Size.Y.Scale),0) - if (#MiddleFrameBackgrounds+1)%2 ~= 1 then + nBGFrame.Position = UDim2.new(0.5, 0, (#MiddleFrameBackgrounds * nBGFrame.Size.Y.Scale), 0) + if (#MiddleFrameBackgrounds + 1) % 2 ~= 1 then if IsMaximized.Value then - nBGFrame.Background.Image = 'http://www.roblox.com/asset/?id='..Images['LargeDark'] + nBGFrame.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["LargeDark"] else - nBGFrame.Background.Image = 'http://www.roblox.com/asset/?id='..Images['midDark'] + nBGFrame.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["midDark"] end else if IsMaximized.Value then - nBGFrame.Background.Image = 'http://www.roblox.com/asset/?id='..Images['LargeLight'] + nBGFrame.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["LargeLight"] else - nBGFrame.Background.Image = 'http://www.roblox.com/asset/?id='..Images['midLight'] + nBGFrame.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["midLight"] end end nBGFrame.Parent = ListFrame - table.insert(MiddleFrameBackgrounds,nBGFrame) - - if #MiddleFrameBackgrounds 1 do - fSize=fSize-1 - tHeader.FontSize=FONT_SIZES[fSize] - wait(.2) + local tHeader = HeaderName:Clone() + tHeader.Position = UDim2.new(2, 0, 2, 0) + tHeader.Parent = ScreenGui + local fSize = 7 --Size24 in table + tHeader.FontSize = FONT_SIZES[fSize] + Delay(0.2, function() + while tHeader.TextBounds.x == 0 do + wait(1 / 30) end - HeaderName.FontSize=tHeader.FontSize + while tHeader.TextBounds.x - NormalBounds.X.Offset > 1 do + fSize = fSize - 1 + tHeader.FontSize = FONT_SIZES[fSize] + wait(0.2) + end + HeaderName.FontSize = tHeader.FontSize tHeader:Destroy() end) end @@ -2142,12 +2207,16 @@ ScreenGui.Changed:connect(UpdateHeaderNameSize) --]] function LeaderstatsAdded(playerEntry) --RemoveAllStats(playerEntry) - local nplayer = playerEntry['Player'] - for _,i in pairs(nplayer.leaderstats:GetChildren()) do - StatAdded(i,playerEntry) + local nplayer = playerEntry["Player"] + for _, i in pairs(nplayer.leaderstats:GetChildren()) do + StatAdded(i, playerEntry) end - nplayer.leaderstats.ChildAdded:connect(function(nchild) StatAdded(nchild,playerEntry) end) - nplayer.leaderstats.ChildRemoved:connect(function(nchild) StatRemoved(nchild,playerEntry) end) + nplayer.leaderstats.ChildAdded:connect(function(nchild) + StatAdded(nchild, playerEntry) + end) + nplayer.leaderstats.ChildRemoved:connect(function(nchild) + StatRemoved(nchild, playerEntry) + end) end --[[ called when leaderstats object is removed from play in player entry @@ -2156,8 +2225,11 @@ end oldLeaderstats leaderstats object to be removed playerEntry A reference to the ENTRY(table) of the player --]] -function LeaderstatsRemoved(oldLeaderstats,playerEntry) - while AddingFrameLock do debugprint('waiting to insert '..playerEntry['Player'].Name) wait(1/30) end +function LeaderstatsRemoved(oldLeaderstats, playerEntry) + while AddingFrameLock do + debugprint("waiting to insert " .. playerEntry["Player"].Name) + wait(1 / 30) + end AddingFrameLock = true RemoveAllStats(playerEntry) AddingFrameLock = false @@ -2165,12 +2237,14 @@ end function ClosePopUpPanel() if SelectedPlayerEntry then - local tframe = SelectedPlayerEntry['Frame'] - Spawn(function() TweenProperty(tframe,'BackgroundTransparency',.5,1,BASE_TWEEN) end) + local tframe = SelectedPlayerEntry["Frame"] + Spawn(function() + TweenProperty(tframe, "BackgroundTransparency", 0.5, 1, BASE_TWEEN) + end) end - PopUpPanel:TweenPosition(UDim2.new(1,0,0,0), "Out", "Linear", BASE_TWEEN,true) - wait(.1) - InPopupWaitForClick= false + PopUpPanel:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Linear", BASE_TWEEN, true) + wait(0.1) + InPopupWaitForClick = false SelectedPlayerEntry = nil end @@ -2178,63 +2252,98 @@ end prepares the needed popup to be tweened on screen, and updates the position of the popup clip frame to match the selected player frame's position --]] -function InitMovingPanel( entry, player) - PopUpClipFrame.Parent= ScreenGui - +function InitMovingPanel(entry, player) + PopUpClipFrame.Parent = ScreenGui + if PopUpPanel then PopUpPanel:Destroy() end - PopUpPanel= PopUpPanelTemplate:Clone() - PopUpPanel.Parent= PopUpClipFrame - + PopUpPanel = PopUpPanelTemplate:Clone() + PopUpPanel.Parent = PopUpClipFrame + local nextIndex = 2 local friendStatus = GetFriendStatus(player) - debugprint (tostring(friendStatus)) - local showRankMenu = IsPersonalServer and LocalPlayer.PersonalServerRank >= PrivilegeLevel['Admin'] and LocalPlayer.PersonalServerRank > SelectedPlayer.PersonalServerRank - - - local ReportPlayerButton = MakePopupButton(PopUpPanel,'Report Player',0) - ReportPlayerButton.MouseButton1Click:connect(function() OpenAbuseDialog() end) - local FriendPlayerButton = MakePopupButton(PopUpPanel,'Friend',1, not showRankMenu and friendStatus~=Enum.FriendStatus.FriendRequestReceived) - FriendPlayerButton.MouseButton1Click:connect(OnFriendButtonSelect) - + debugprint(tostring(friendStatus)) + local showRankMenu = IsPersonalServer + and LocalPlayer.PersonalServerRank >= PrivilegeLevel["Admin"] + and LocalPlayer.PersonalServerRank > SelectedPlayer.PersonalServerRank - if friendStatus==Enum.FriendStatus.Friend then - FriendPlayerButton:FindFirstChild('ButtonText').Text='UnFriend Player' - elseif friendStatus==Enum.FriendStatus.Unknown or friendStatus==Enum.FriendStatus.NotFriend then - FriendPlayerButton:FindFirstChild('ButtonText').Text='Send Request' - elseif friendStatus==Enum.FriendStatus.FriendRequestSent then - FriendPlayerButton:FindFirstChild('ButtonText').Text='Revoke Request' - elseif friendStatus==Enum.FriendStatus.FriendRequestReceived then - FriendPlayerButton:FindFirstChild('ButtonText').Text='Accept Friend' - local FriendRefuseButton = MakePopupButton(PopUpPanel,'Decline Friend',2,not showRankMenu) + local ReportPlayerButton = MakePopupButton(PopUpPanel, "Report Player", 0) + ReportPlayerButton.MouseButton1Click:connect(function() + OpenAbuseDialog() + end) + local FriendPlayerButton = MakePopupButton( + PopUpPanel, + "Friend", + 1, + not showRankMenu and friendStatus ~= Enum.FriendStatus.FriendRequestReceived + ) + FriendPlayerButton.MouseButton1Click:connect(OnFriendButtonSelect) + + if friendStatus == Enum.FriendStatus.Friend then + FriendPlayerButton:FindFirstChild("ButtonText").Text = "UnFriend Player" + elseif friendStatus == Enum.FriendStatus.Unknown or friendStatus == Enum.FriendStatus.NotFriend then + FriendPlayerButton:FindFirstChild("ButtonText").Text = "Send Request" + elseif friendStatus == Enum.FriendStatus.FriendRequestSent then + FriendPlayerButton:FindFirstChild("ButtonText").Text = "Revoke Request" + elseif friendStatus == Enum.FriendStatus.FriendRequestReceived then + FriendPlayerButton:FindFirstChild("ButtonText").Text = "Accept Friend" + local FriendRefuseButton = MakePopupButton(PopUpPanel, "Decline Friend", 2, not showRankMenu) FriendRefuseButton.MouseButton1Click:connect(OnFriendRefuseButtonSelect) - nextIndex=nextIndex+1 + nextIndex = nextIndex + 1 end if showRankMenu then - local BanPlayerButton = MakePopupButton(PopUpPanel,'Ban',nextIndex) - local VisitorButton = MakePopupButton(PopUpPanel,'Visitor',nextIndex+1) - local MemberButton = MakePopupButton(PopUpPanel,'Member',nextIndex+2) - local AdminButton = MakePopupButton(PopUpPanel,'Admin',nextIndex+3,true) - + local BanPlayerButton = MakePopupButton(PopUpPanel, "Ban", nextIndex) + local VisitorButton = MakePopupButton(PopUpPanel, "Visitor", nextIndex + 1) + local MemberButton = MakePopupButton(PopUpPanel, "Member", nextIndex + 2) + local AdminButton = MakePopupButton(PopUpPanel, "Admin", nextIndex + 3, true) + BanPlayerButton.MouseButton1Click:connect(function() - OnPrivilegeLevelSelect(player,PrivilegeLevel['Banned'],BanPlayerButton,VisitorButton,MemberButton,AdminButton) + OnPrivilegeLevelSelect( + player, + PrivilegeLevel["Banned"], + BanPlayerButton, + VisitorButton, + MemberButton, + AdminButton + ) end) VisitorButton.MouseButton1Click:connect(function() - OnPrivilegeLevelSelect(player,PrivilegeLevel['Visitor'],BanPlayerButton,VisitorButton,MemberButton,AdminButton) + OnPrivilegeLevelSelect( + player, + PrivilegeLevel["Visitor"], + BanPlayerButton, + VisitorButton, + MemberButton, + AdminButton + ) end) MemberButton.MouseButton1Click:connect(function() - OnPrivilegeLevelSelect(player,PrivilegeLevel['Member'],BanPlayerButton,VisitorButton,MemberButton,AdminButton) + OnPrivilegeLevelSelect( + player, + PrivilegeLevel["Member"], + BanPlayerButton, + VisitorButton, + MemberButton, + AdminButton + ) end) AdminButton.MouseButton1Click:connect(function() - OnPrivilegeLevelSelect(player,PrivilegeLevel['Admin'],BanPlayerButton,VisitorButton,MemberButton,AdminButton) + OnPrivilegeLevelSelect( + player, + PrivilegeLevel["Admin"], + BanPlayerButton, + VisitorButton, + MemberButton, + AdminButton + ) end) - - HighlightMyRank(SelectedPlayer,BanPlayerButton,VisitorButton,MemberButton,AdminButton) + + HighlightMyRank(SelectedPlayer, BanPlayerButton, VisitorButton, MemberButton, AdminButton) end - PopUpPanel:TweenPosition(UDim2.new(0,0,0,0), "Out", "Linear", BASE_TWEEN,true) + PopUpPanel:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Linear", BASE_TWEEN, true) Delay(0, function() local tconnection tconnection = Mouse.Button1Down:connect(function() @@ -2242,18 +2351,18 @@ function InitMovingPanel( entry, player) ClosePopUpPanel() 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. Spawn(function() while InPopupWaitForClick do - PopUpClipFrame.Position=UDim2.new( 0,myFrame.AbsolutePosition.X-PopUpClipFrame.Size.X.Offset,0,myFrame.AbsolutePosition.Y) + PopUpClipFrame.Position = + UDim2.new(0, myFrame.AbsolutePosition.X - PopUpClipFrame.Size.X.Offset, 0, myFrame.AbsolutePosition.Y) wait() end end) - end --[[ @@ -2262,24 +2371,22 @@ end @Args: entry the player entry clicked --]] -function OnPlayerEntrySelect(entry,startx,starty) - +function OnPlayerEntrySelect(entry, startx, starty) if not InPopupWaitForClick then - SelectedPlayerEntry = entry - SelectedPlayer = entry['Player'] - - StartDrag(entry,startx,starty) - end + SelectedPlayer = entry["Player"] - + StartDrag(entry, startx, starty) + end end function ActivatePlayerEntryPanel(entry) - entry['Frame'].BackgroundColor3 = Color3.new(0,1,1) - Spawn(function() TweenProperty(entry['Frame'],'BackgroundTransparency',1,.5,.5) end) - InPopupWaitForClick=true - InitMovingPanel(entry,entry['Player']) + entry["Frame"].BackgroundColor3 = Color3.new(0, 1, 1) + Spawn(function() + TweenProperty(entry["Frame"], "BackgroundTransparency", 1, 0.5, 0.5) + end) + InPopupWaitForClick = true + InitMovingPanel(entry, entry["Player"]) end --[[ @@ -2288,11 +2395,11 @@ end --]] function PlayerListModeUpdate() RecreateScoreColumns(PlayerFrames) - table.sort(PlayerFrames,PlayerSortFunction) - for i,val in ipairs(PlayerFrames) do - MiddleFrames[i] = val['Frame'] + table.sort(PlayerFrames, PlayerSortFunction) + for i, val in ipairs(PlayerFrames) do + MiddleFrames[i] = val["Frame"] end - for i = #PlayerFrames + 1,#MiddleFrames,1 do + for i = #PlayerFrames + 1, #MiddleFrames, 1 do MiddleFrames[i] = nil end UpdateMinimize() @@ -2305,111 +2412,117 @@ end nplayer new player object to insert --]] function InsertPlayerFrame(nplayer) - while AddingFrameLock do debugprint('waiting to insert '..nplayer.Name) wait(1/30) end - AddingFrameLock = true - - local nFrame = MiddleTemplate:Clone() - WaitForChild(WaitForChild(nFrame,'TitleFrame'),'Title').Text = nplayer.Name - - nFrame.Position = UDim2.new(1,0,((#MiddleFrames) * nFrame.Size.Y.Scale),0) - - local nfriendstatus = GetFriendStatus(nplayer) - - nFrame:FindFirstChild('BCLabel').Image = getMembershipTypeIcon(nplayer.MembershipType,nplayer.Name) - nFrame:FindFirstChild('FriendLabel').Image = getFriendStatusIcon(nfriendstatus) - nFrame.Name = nplayer.Name - WaitForChild(WaitForChild(nFrame,'TitleFrame'),'Title').Text = nplayer.Name - - --move for bc label - nFrame.FriendLabel.Position=nFrame.FriendLabel.Position+UDim2.new(0,17,0,0) - nFrame.TitleFrame.Title.Position=nFrame.TitleFrame.Title.Position+UDim2.new(0,17,0,0) - - if(nFrame:FindFirstChild('FriendLabel').Image ~= '') then - nFrame.TitleFrame.Title.Position=nFrame.TitleFrame.Title.Position+UDim2.new(0,17,0,0) + while AddingFrameLock do + debugprint("waiting to insert " .. nplayer.Name) + wait(1 / 30) end - + AddingFrameLock = true + + local nFrame = MiddleTemplate:Clone() + WaitForChild(WaitForChild(nFrame, "TitleFrame"), "Title").Text = nplayer.Name + + nFrame.Position = UDim2.new(1, 0, (#MiddleFrames * nFrame.Size.Y.Scale), 0) + + local nfriendstatus = GetFriendStatus(nplayer) + + nFrame:FindFirstChild("BCLabel").Image = getMembershipTypeIcon(nplayer.MembershipType, nplayer.Name) + nFrame:FindFirstChild("FriendLabel").Image = getFriendStatusIcon(nfriendstatus) + nFrame.Name = nplayer.Name + WaitForChild(WaitForChild(nFrame, "TitleFrame"), "Title").Text = nplayer.Name + + --move for bc label + nFrame.FriendLabel.Position = nFrame.FriendLabel.Position + UDim2.new(0, 17, 0, 0) + nFrame.TitleFrame.Title.Position = nFrame.TitleFrame.Title.Position + UDim2.new(0, 17, 0, 0) + + if nFrame:FindFirstChild("FriendLabel").Image ~= "" then + nFrame.TitleFrame.Title.Position = nFrame.TitleFrame.Title.Position + UDim2.new(0, 17, 0, 0) + end + if nplayer.Name == LocalPlayer.Name then - nFrame.TitleFrame.Title.Font = 'ArialBold' - nFrame.PlayerScore.Font = 'ArialBold' + nFrame.TitleFrame.Title.Font = "ArialBold" + nFrame.PlayerScore.Font = "ArialBold" ChangeHeaderName(nplayer.Name) local dropShadow = nFrame.TitleFrame.Title:Clone() - dropShadow.TextColor3 = Color3.new(0,0,0) - dropShadow.TextTransparency=0 - dropShadow.ZIndex=2 - dropShadow.Position=nFrame.TitleFrame.Title.Position+UDim2.new(0,1,0,1) - dropShadow.Name='DropShadow' - dropShadow.Parent= nFrame.TitleFrame + dropShadow.TextColor3 = Color3.new(0, 0, 0) + dropShadow.TextTransparency = 0 + dropShadow.ZIndex = 2 + dropShadow.Position = nFrame.TitleFrame.Title.Position + UDim2.new(0, 1, 0, 1) + dropShadow.Name = "DropShadow" + dropShadow.Parent = nFrame.TitleFrame else --Delay(2, function () OnFriendshipChanged(nplayer,LocalPlayer:GetFriendStatus(nplayer)) end) end - nFrame.TitleFrame.Title.Font = 'ArialBold' + nFrame.TitleFrame.Title.Font = "ArialBold" - nFrame.Parent = ListFrame - nFrame:TweenPosition(UDim2.new(.5,0,((#MiddleFrames) * nFrame.Size.Y.Scale),0), "Out", "Linear", BASE_TWEEN,true) + nFrame:TweenPosition(UDim2.new(0.5, 0, (#MiddleFrames * nFrame.Size.Y.Scale), 0), "Out", "Linear", BASE_TWEEN, true) UpdateMinimize() local nentry = {} - nentry['Frame'] = nFrame - nentry['Player'] = nplayer - nentry['ID'] = AddId + nentry["Frame"] = nFrame + nentry["Player"] = nplayer + nentry["ID"] = AddId AddId = AddId + 1 - table.insert(PlayerFrames,nentry) - if #TeamFrames~=0 then - + table.insert(PlayerFrames, nentry) + if #TeamFrames ~= 0 then if nplayer.Neutral then - nentry['MyTeam'] = nil - if not NeutralTeam then - AddNeutralTeam() + nentry["MyTeam"] = nil + if not NeutralTeam then + AddNeutralTeam() else - AddPlayerToTeam(NeutralTeam,nentry) + AddPlayerToTeam(NeutralTeam, nentry) end - else - local addedToTeam=false - for i,tval in ipairs(TeamFrames) do - if tval['MyTeam'].TeamColor == nplayer.TeamColor then - AddPlayerToTeam(tval,nentry) - nentry['MyTeam'] = tval - addedToTeam=true + local addedToTeam = false + for i, tval in ipairs(TeamFrames) do + if tval["MyTeam"].TeamColor == nplayer.TeamColor then + AddPlayerToTeam(tval, nentry) + nentry["MyTeam"] = tval + addedToTeam = true end end if not addedToTeam then - nentry['MyTeam']=nil - if not NeutralTeam then - AddNeutralTeam() + nentry["MyTeam"] = nil + if not NeutralTeam then + AddNeutralTeam() else - AddPlayerToTeam(NeutralTeam,nentry) + AddPlayerToTeam(NeutralTeam, nentry) end - nentry['MyTeam'] = NeutralTeam + nentry["MyTeam"] = NeutralTeam end end - end - - if nplayer:FindFirstChild('leaderstats') then + + if nplayer:FindFirstChild "leaderstats" then LeaderstatsAdded(nentry) end - - nplayer.ChildAdded:connect(function(nchild) - if nchild.Name == 'leaderstats' then - while AddingFrameLock do debugprint('in adding leaderstats lock') wait(1/30) end + + nplayer.ChildAdded:connect(function(nchild) + if nchild.Name == "leaderstats" then + while AddingFrameLock do + debugprint "in adding leaderstats lock" + wait(1 / 30) + end AddingFrameLock = true LeaderstatsAdded(nentry) AddingFrameLock = false end end) - nplayer.ChildRemoved:connect(function (nchild) - if nplayer==LocalPlayer and nchild.Name == 'leaderstats' then - LeaderstatsRemoved(nchild,nentry) + nplayer.ChildRemoved:connect(function(nchild) + if nplayer == LocalPlayer and nchild.Name == "leaderstats" then + LeaderstatsRemoved(nchild, nentry) end end) - nplayer.Changed:connect(function(prop)PlayerChanged(nentry,prop) end) - - local listener = WaitForChild(nFrame,'ClickListener') + nplayer.Changed:connect(function(prop) + PlayerChanged(nentry, prop) + end) + + local listener = WaitForChild(nFrame, "ClickListener") listener.Active = true - listener.MouseButton1Down:connect(function(nx,ny) OnPlayerEntrySelect(nentry, nx,ny) end) - + listener.MouseButton1Down:connect(function(nx, ny) + OnPlayerEntrySelect(nentry, nx, ny) + end) + AddMiddleBGFrame() BaseUpdate() AddingFrameLock = false @@ -2420,24 +2533,27 @@ end removes this player's frame if it exists, calls base update --]] function RemovePlayerFrame(tplayer) - while AddingFrameLock do debugprint('in removing player frame lock') wait(1/30) end + while AddingFrameLock do + debugprint "in removing player frame lock" + wait(1 / 30) + end AddingFrameLock = true - + local tteam - for i,key in ipairs(PlayerFrames) do - if tplayer == key['Player'] then - if PopUpClipFrame.Parent == key['Frame'] then + for i, key in ipairs(PlayerFrames) do + if tplayer == key["Player"] then + if PopUpClipFrame.Parent == key["Frame"] then PopUpClipFrame.Parent = nil end - key['Frame']:Destroy() - tteam=key['MyTeam'] - table.remove(PlayerFrames,i) + 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 - RemovePlayerFromTeam(tteam,j) + for j, tentry in ipairs(tteam["MyPlayers"]) do + if tentry["Player"] == tplayer then + RemovePlayerFromTeam(tteam, j) end end end @@ -2450,9 +2566,9 @@ end Players.ChildRemoved:connect(RemovePlayerFrame) ----------------------------- +---------------------------- -- Team Callback Functions ----------------------------- +---------------------------- --[[ turns a list of team entries with sub lists of players into a single ordered list, in the correct order,and of the correct length @@ -2460,42 +2576,45 @@ Players.ChildRemoved:connect(RemovePlayerFrame) tframes the team entries to unroll outframes the list to unroll these entries into --]] -function UnrollTeams(tframes,outframes) +function UnrollTeams(tframes, outframes) local numEntries = 0 - if NeutralTeam and not NeutralTeam['IsHidden'] then - for i,val in ipairs(NeutralTeam['MyPlayers']) do + if NeutralTeam and not NeutralTeam["IsHidden"] then + for _, val in ipairs(NeutralTeam["MyPlayers"]) do numEntries = numEntries + 1 - outframes[numEntries] = val['Frame'] + outframes[numEntries] = val["Frame"] end numEntries = numEntries + 1 - outframes[numEntries] = NeutralTeam['Frame'] + outframes[numEntries] = NeutralTeam["Frame"] end - for i,val in ipairs(tframes) do - if not val['IsHidden'] then - for j,pval in ipairs(val.MyPlayers) do + for _, val in ipairs(tframes) do + if not val["IsHidden"] then + for _, pval in ipairs(val.MyPlayers) do numEntries = numEntries + 1 - outframes[numEntries] = pval['Frame'] + outframes[numEntries] = pval["Frame"] end numEntries = numEntries + 1 - outframes[numEntries] = val['Frame'] + outframes[numEntries] = val["Frame"] end end - -- clear any additional entries from outframes - for i = numEntries + 1,#outframes,1 do + -- clear any additional entries from outframes + for i = numEntries + 1, #outframes, 1 do outframes[i] = nil end 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'] +function TeamSortFunc(a, b) + if a["TeamScore"] == b["TeamScore"] then + return a["ID"] < b["ID"] end - if not a['TeamScore'] then return false end - if not b['TeamScore'] then return true end - return a['TeamScore'] < b['TeamScore'] - + if not a["TeamScore"] then + return false + end + if not b["TeamScore"] then + return true + end + return a["TeamScore"] < b["TeamScore"] end --[[ consider adding lock with wait for performance @@ -2504,13 +2623,11 @@ end tentries table of team entries --]] function SortTeams(tentries) - - for i,val in ipairs(tentries) do - - table.sort(val['MyPlayers'],PlayerSortFunction) + for i, val in ipairs(tentries) do + table.sort(val["MyPlayers"], PlayerSortFunction) AddTeamScores(val) end - table.sort(tentries,TeamSortFunc) + table.sort(tentries, TeamSortFunc) end --[[ base update for team mode, adds up the scores of all teams, sorts them, @@ -2523,7 +2640,7 @@ function TeamListModeUpdate() AddTeamScores(NeutralTeam) --RecreateScoreColumns(NeutralTeam['MyPlayers']) end - UnrollTeams(TeamFrames,MiddleFrames) + UnrollTeams(TeamFrames, MiddleFrames) end --[[ adds up all the score of this team's players to form the team score @@ -2531,23 +2648,21 @@ end team team entry to sum the scores of --]] function AddTeamScores(team) - - for j = 1, #ScoreNames,1 do + 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']) - if tval and not tval:IsA('StringValue') then - tscore = tscore + GetScoreValue((j['Player'].leaderstats)[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"]]) end end - if team['Frame']:FindFirstChild(i['Name']) then + 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) + team["Frame"][i["Name"]].Text = tostring(tscore) end end UpdateMinimize() - end --[[ @@ -2556,17 +2671,17 @@ 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 - RemovePlayerFromTeam(NeutralTeam,j) + for j, oldEntry in ipairs(NeutralTeam["MyPlayers"]) do + if oldEntry["Player"] == entry["Player"] then + RemovePlayerFromTeam(NeutralTeam, j) return end end @@ -2578,10 +2693,10 @@ end teamEntry team entry to remove player from index index of player in 'MyPlayers' list to remove --]] -function RemovePlayerFromTeam(teamEntry,index) - table.remove(teamEntry['MyPlayers'],index) +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 + if teamEntry == NeutralTeam and #teamEntry["MyPlayers"] == 0 then RemoveNeutralTeam() end end @@ -2592,36 +2707,37 @@ end teamEntry entry of team to add player to entry player entry to add to this team --]] -function AddPlayerToTeam(teamEntry,entry) +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) FindRemovePlayerFromTeam(entry) -- check to see if team exists, if it does add to that team local setToTeam = false - for i,tframe in ipairs(TeamFrames) do - -- add my entry on the new team - if tframe['MyTeam'].TeamColor == entry['Player'].TeamColor then - AddPlayerToTeam(tframe,entry) + for _, tframe in ipairs(TeamFrames) do + -- add my entry on the new team + 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 - if not NeutralTeam then + if not setToTeam and #(game.Teams:GetTeams()) > 0 then + debugprint(entry["Player"].Name .. "could not find team") + entry["MyTeam"] = nil + if not NeutralTeam then AddNeutralTeam() - else AddPlayerToTeam(NeutralTeam,entry) end + else + AddPlayerToTeam(NeutralTeam, entry) + end end end @@ -2634,63 +2750,72 @@ end property name of property changed --]] function PlayerChanged(entry, property) - while PlayerChangedLock do - debugprint('in playerchanged lock') - wait(1/30) + while PlayerChangedLock do + debugprint "in playerchanged lock" + wait(1 / 30) end - PlayerChangedLock=true - if property == 'Neutral' then + 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') - AddPlayerToTeam(NeutralTeam,entry) + 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') + 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") SetPlayerToTeam(entry) end BaseUpdate() - elseif property == 'TeamColor' and not entry['Player'].Neutral and entry['Player'] ~= entry['MyTeam'] then - debugprint(entry['Player'].Name..'setting to new team') + elseif property == "TeamColor" and not entry["Player"].Neutral and entry["Player"] ~= entry["MyTeam"] then + 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'].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(.01, 30, .1, 0) + elseif property == "Name" or property == "MembershipType" then + 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) 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 - PlayerChangedLock=false + PlayerChangedLock = false end -function OnFriendshipChanged(player,friendStatus) - - Delay(.5,function() - debugprint('friend status changed for:'..player.Name .." ".. tostring(friendStatus) .. " vs " .. tostring(GetFriendStatus(player)) ) +function OnFriendshipChanged(player, friendStatus) + Delay(0.5, function() + debugprint( + "friend status changed for:" + .. player.Name + .. " " + .. tostring(friendStatus) + .. " vs " + .. 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-UDim2.new(0,17,0,0) - 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) + 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 + + 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 @@ -2704,45 +2829,55 @@ LocalPlayer.FriendStatusChanged:connect(OnFriendshipChanged) Note: a lot of redundant code here, might want to refactor to share a function with insertteamframe --]] function AddNeutralTeam() - while NeutralTeamLock do debugprint('in neutral team 2 lock') wait() end + while NeutralTeamLock do + debugprint "in neutral team 2 lock" + wait() + end NeutralTeamLock = true - - local defaultTeam = Instance.new('Team') - defaultTeam.TeamColor = BrickColor.new('White') - defaultTeam.Name = 'Neutral' + + local defaultTeam = Instance.new "Team" + 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 = defaultTeam.Name - nentry['Frame'].TitleFrame.Position=UDim2.new(nentry['Frame'].TitleFrame.Position.X.Scale,nentry['Frame'].TitleFrame.Position.X.Offset,.1,0) - nentry['Frame'].TitleFrame.Size=UDim2.new(nentry['Frame'].TitleFrame.Size.X.Scale,nentry['Frame'].TitleFrame.Size.X.Offset,.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(function(nx,ny) StartDrag(nentry,nx,ny) end) - nentry['Frame'].ClickListener.BackgroundColor3 = Color3.new(1,1,1) - nentry['Frame'].ClickListener.BackgroundTransparency = .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 - AddPlayerToTeam(nentry,i) + 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, 0.1, 0) + 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(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 + for _, i in pairs(PlayerFrames) do + 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() end - NeutralTeamLock = false + NeutralTeamLock = false end function RemoveNeutralTeam() - while NeutralTeamLock do debugprint('in neutral team lock') wait() end + while NeutralTeamLock do + debugprint "in neutral team lock" + wait() + end NeutralTeamLock = true - NeutralTeam['Frame']:Destroy() - NeutralTeam=nil + NeutralTeam["Frame"]:Destroy() + NeutralTeam = nil RemoveMiddleBGFrame() NeutralTeamLock = false end @@ -2750,53 +2885,54 @@ end --[[ --]] -function TeamScoreChanged(entry,nscore) - WaitForChild(entry['Frame'],'PlayerScore').Text = tostring(nscore) - entry['TeamScore'] = nscore +function TeamScoreChanged(entry, nscore) + WaitForChild(entry["Frame"], "PlayerScore").Text = tostring(nscore) + entry["TeamScore"] = nscore end --[[ called when child added to a team, used for autohide functionality Note: still has teamscore, consiter removing --]] -function TeamChildAdded(entry,nchild) - if nchild.Name == 'AutoHide' then - entry['AutoHide'] = true - elseif nchild.Name == 'TeamScore' then - WaitForChild(entry['Frame'],'PlayerScore').Text = tostring(nchild.Value) - entry['TeamScore'] = nchild.Value - nchild.Changed:connect(function() TeamScoreChanged(entry,nchild.Value) end) +function TeamChildAdded(entry, nchild) + if nchild.Name == "AutoHide" then + entry["AutoHide"] = true + elseif nchild.Name == "TeamScore" then + WaitForChild(entry["Frame"], "PlayerScore").Text = tostring(nchild.Value) + entry["TeamScore"] = nchild.Value + nchild.Changed:connect(function() + TeamScoreChanged(entry, nchild.Value) + end) end end --[[ called when child added to a team, used for autohide functionality Note: still has teamscore, consiter removing --]] -function TeamChildRemoved(entry,nchild) - if nchild.Name == 'AutoHide' then - entry['AutoHide'] = false - elseif nchild.Name == 'TeamScore' then - WaitForChild(entry['Frame'],'PlayerScore').Text = "" - entry['TeamScore'] = nil +function TeamChildRemoved(entry, nchild) + if nchild.Name == "AutoHide" then + entry["AutoHide"] = false + elseif nchild.Name == "TeamScore" then + 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 - - elseif property=='TeamColor' then - 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 property == "Name" then + WaitForChild(WaitForChild(entry["Frame"], "TitleFrame"), "Title").Text = entry["MyTeam"].Name + elseif property == "TeamColor" then + 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! end end - - entry['MyPlayers']={} - - for _,i in pairs(PlayerFrames) do - SetPlayerToTeam(i) + + entry["MyPlayers"] = {} + + for _, i in pairs(PlayerFrames) do + SetPlayerToTeam(i) end BaseUpdate() end @@ -2809,56 +2945,73 @@ end @Args: nteam new team object added --]] -function InsertTeamFrame(nteam) - while AddingFrameLock do debugprint('in adding team frame lock') wait(1/30) end +function InsertTeamFrame(nteam) + while AddingFrameLock do + debugprint "in adding team frame lock" + wait(1 / 30) + end 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 = 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,.1,0) - nentry['Frame'].TitleFrame.Size=UDim2.new(nentry['Frame'].TitleFrame.Size.X.Scale,nentry['Frame'].TitleFrame.Size.X.Offset,.8,0) - 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 = .7 - nentry['Frame'].ClickListener.AutoButtonColor=false + 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, 0.1, 0) + 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(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 - if nteam:FindFirstChild('AutoHide') then - nentry['AutoHide'] = true + nentry["ID"] = AddId + nentry["AutoHide"] = false + if nteam:FindFirstChild "AutoHide" then + nentry["AutoHide"] = true end - if nteam:FindFirstChild('TeamScore') then - TeamChildAdded(nentry,nteam.TeamScore) - - end - - nteam.ChildAdded:connect(function(nchild) TeamChildAdded(nentry,nchild) end) - nteam.ChildRemoved:connect(function(nchild) TeamChildRemoved(nentry,nchild) end) - nteam.Changed:connect(function(prop) TeamChanged(nentry,prop) end) - - for _,i in pairs(PlayerFrames) do - 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(.5,0,((#MiddleFrames) * nentry['Frame'].Size.Y.Scale),0), "Out", "Linear", BASE_TWEEN,true) - AddMiddleBGFrame() - else - nentry['IsHidden'] = true - nentry['Frame'].Parent = nil + if nteam:FindFirstChild "TeamScore" then + TeamChildAdded(nentry, nteam.TeamScore) end - table.insert(TeamFrames,nentry) + nteam.ChildAdded:connect(function(nchild) + TeamChildAdded(nentry, nchild) + end) + nteam.ChildRemoved:connect(function(nchild) + TeamChildRemoved(nentry, nchild) + end) + nteam.Changed:connect(function(prop) + TeamChanged(nentry, prop) + end) + + for _, i in pairs(PlayerFrames) do + 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), + "Out", + "Linear", + BASE_TWEEN, + true + ) + AddMiddleBGFrame() + else + nentry["IsHidden"] = true + nentry["Frame"].Parent = nil + end + + table.insert(TeamFrames, nentry) UpdateMinimize() BaseUpdate() if #TeamFrames == 1 and not NeutralTeam then @@ -2872,27 +3025,30 @@ end nteam Teamobject to remove --]] function RemoveTeamFrame(nteam) - while AddingFrameLock do debugprint('in removing team frame lock') wait(1/30) end + while AddingFrameLock do + debugprint "in removing team frame lock" + wait(1 / 30) + end AddingFrameLock = true if IsMinimized.Value then end local myEntry - for i,key in ipairs(TeamFrames) do - if nteam == key['MyTeam'] then + for i, key in ipairs(TeamFrames) do + if nteam == key["MyTeam"] then myEntry = key - key['Frame']:Destroy() - table.remove(TeamFrames,i) + key["Frame"]:Destroy() + table.remove(TeamFrames, i) end end - if #TeamFrames==0 then - debugprint('removeteamframe, remove neutral') - if NeutralTeam then + if #TeamFrames == 0 then + debugprint "removeteamframe, remove neutral" + if NeutralTeam then RemoveNeutralTeam() end end - for i,key in ipairs(myEntry['MyPlayers']) do - RemovePlayerFromTeam(myEntry,i) - PlayerChanged(key, 'TeamColor') + for i, key in ipairs(myEntry["MyPlayers"]) do + RemovePlayerFromTeam(myEntry, i) + PlayerChanged(key, "TeamColor") end RemoveMiddleBGFrame() BaseUpdate() @@ -2906,31 +3062,40 @@ end function TeamRemoved(nteam) RemoveTeamFrame(nteam) end - --------------------------------- +--------------------------------- --[[ called when ANYTHING changes the state of the playerlist re-sorts everything,assures correct positions of all elements --]] function BaseUpdate() - while BaseUpdateLock do debugprint('in baseupdate lock') wait(1/30) end + while BaseUpdateLock do + debugprint "in baseupdate lock" + wait(1 / 30) + end BaseUpdateLock = true --print ('baseupdate') UpdateStatNames() - + if #TeamFrames == 0 and not NeutralTeam then PlayerListModeUpdate() else TeamListModeUpdate() end - for i,key in ipairs(MiddleFrames) do + for i, key in ipairs(MiddleFrames) do if key.Parent ~= nil then - key:TweenPosition(UDim2.new(.5,0,((#MiddleFrames - (i)) * key.Size.Y.Scale),0), "Out", "Linear", BASE_TWEEN,true) + key:TweenPosition( + UDim2.new(0.5, 0, ((#MiddleFrames - i) * key.Size.Y.Scale), 0), + "Out", + "Linear", + BASE_TWEEN, + true + ) end end - if not IsMinimized.Value and #MiddleFrames>DefaultEntriesOnScreen then + if not IsMinimized.Value and #MiddleFrames > DefaultEntriesOnScreen then UpdateScrollPosition() end - + UpdateMinimize() UpdateScrollBarSize() @@ -2944,38 +3109,45 @@ end --[[ code for attaching tab key to maximizing player list --]] -game.GuiService:AddKey("\t") +game.GuiService:AddKey "\t" local LastTabTime = time() -game.GuiService.KeyPressed:connect( -function(key) +game.GuiService.KeyPressed:connect(function(key) if key == "\t" then - debugprint('caught tab key') - local modalCheck, isModal = pcall(function() return game.GuiService.IsModalDialog end) + debugprint "caught tab key" + local modalCheck, isModal = pcall(function() + return game.GuiService.IsModalDialog + end) if modalCheck == false or (modalCheck and isModal == false) then if time() - LastTabTime > 0.4 then LastTabTime = time() if IsTabified.Value then if not IsMaximized.Value then - ScreenGui:TweenPosition(UDim2.new(0, 0, 0,0),'Out','Linear',BASE_TWEEN*1.2,true) + ScreenGui:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Linear", BASE_TWEEN * 1.2, true) IsMaximized.Value = true else - ScreenGui:TweenPosition(UDim2.new(NormalBounds.X.Scale, NormalBounds.X.Offset-10, 0,0),'Out','Linear',BASE_TWEEN*1.2,true) + ScreenGui:TweenPosition( + UDim2.new(NormalBounds.X.Scale, NormalBounds.X.Offset - 10, 0, 0), + "Out", + "Linear", + BASE_TWEEN * 1.2, + true + ) IsMaximized.Value = false - IsMinimized.Value=true + IsMinimized.Value = true end else ToggleMaximize() end - end end end end) - function PlayersChildAdded(tplayer) - if tplayer:IsA('Player') then - Spawn(function() debugPlayerAdd(tplayer) end) + if tplayer:IsA "Player" then + Spawn(function() + debugPlayerAdd(tplayer) + end) else BlowThisPopsicleStand() end @@ -2988,24 +3160,24 @@ function coreGuiChanged(coreGuiType, enabled) end function TeamsChildAdded(nteam) - if nteam:IsA('Team') then + if nteam:IsA "Team" then TeamAdded(nteam) else - BlowThisPopsicleStand() + BlowThisPopsicleStand() end end function TeamsChildRemoved(nteam) - if nteam:IsA('Team') then - TeamRemoved(nteam) + if nteam:IsA "Team" then + TeamRemoved(nteam) else - BlowThisPopsicleStand() + BlowThisPopsicleStand() end end - ---------------------------- - -- Hookups and initialization - ---------------------------- +---------------------------- +-- Hookups and initialization +---------------------------- function debugPlayerAdd(p) InsertPlayerFrame(p) end @@ -3014,10 +3186,19 @@ pcall(function() coreGuiChanged(Enum.CoreGuiType.PlayerList, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList)) Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) end) - -while not game:GetService('Teams') do wait(1/30) debugprint('Waiting For Teams') end -for _,i in pairs(game.Teams:GetTeams()) do TeamAdded(i) end -for _,i in pairs(Players:GetPlayers()) do Spawn(function() debugPlayerAdd(i) end) end + +while not game:GetService "Teams" do + wait(1 / 30) + debugprint "Waiting For Teams" +end +for _, i in pairs(game.Teams:GetTeams()) do + TeamAdded(i) +end +for _, i in pairs(Players:GetPlayers()) do + Spawn(function() + debugPlayerAdd(i) + end) +end game.Teams.ChildAdded:connect(TeamsChildAdded) game.Teams.ChildRemoved:connect(TeamsChildRemoved) @@ -3027,29 +3208,25 @@ InitReportAbuse() AreNamesExpanded.Value = true BaseUpdate() - - --UGGGLY,find a better way later wait(2) -IsPersonalServer= not not game.Workspace:FindFirstChild("PSVariable") +IsPersonalServer = not not game.Workspace:FindFirstChild "PSVariable" - ---------------------------- - -- Running Logic - ---------------------------- +---------------------------- +-- Running Logic +---------------------------- - --debug stuffs, will only run for 'newplayerlistisbad' - if LocalPlayer.Name == 'newplayerlistisbad' or LocalPlayer.Name == 'imtotallyadmin' then +--debug stuffs, will only run for 'newplayerlistisbad' +if LocalPlayer.Name == "newplayerlistisbad" or LocalPlayer.Name == "imtotallyadmin" then debugFrame.Parent = ScreenGui Spawn(function() while true do - local str_players='' - for _,i in pairs(game.Players:GetPlayers()) do - str_players= str_players .." " .. i.Name + local str_players = "" + for _, i in pairs(game.Players:GetPlayers()) do + str_players = str_players .. " " .. i.Name end - debugplayers.Text=str_players - wait(.5) + debugplayers.Text = str_players + wait(0.5) end end) - end - - +end diff --git a/48488398.lua b/48488398.lua index 668ef2b..7ca69bd 100644 --- a/48488398.lua +++ b/48488398.lua @@ -9,101 +9,134 @@ function waitForChild(instance, name) end end -waitForProperty(game.Players,"LocalPlayer") -waitForChild(script.Parent,"Popup") -waitForChild(script.Parent.Popup,"AcceptButton") +waitForProperty(game.Players, "LocalPlayer") +waitForChild(script.Parent, "Popup") +waitForChild(script.Parent.Popup, "AcceptButton") script.Parent.Popup.AcceptButton.Modal = true local localPlayer = game.Players.LocalPlayer local teleportUI = nil -local acceptedTeleport = Instance.new("IntValue") - local friendRequestBlacklist = {} local teleportEnabled = true local makePopupInvisible = function() - if script.Parent.Popup then script.Parent.Popup.Visible = false end + if script.Parent.Popup then + script.Parent.Popup.Visible = false + end end -function makeFriend(fromPlayer,toPlayer) - - local popup = script.Parent:FindFirstChild("Popup") - if popup == nil then return end -- there is no popup! - if popup.Visible then return end -- currently popping something, abort! - if friendRequestBlacklist[fromPlayer] then return end -- previously cancelled friend request, we don't want it! +function makeFriend(fromPlayer, toPlayer) + local popup = script.Parent:FindFirstChild "Popup" + if popup == nil then + return + end -- there is no popup! + if popup.Visible then + return + end -- currently popping something, abort! + if friendRequestBlacklist[fromPlayer] then + return + end -- previously cancelled friend request, we don't want it! popup.PopupText.Text = "Accept Friend Request from " .. tostring(fromPlayer.Name) .. "?" - popup.PopupImage.Image = "http://www.roblox.com/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=352&y=352" - + popup.PopupImage.Image = "http://www.roblox.com/thumbs/avatar.ashx?userId=" + .. tostring(fromPlayer.userId) + .. "&x=352&y=352" + showTwoButtons() popup.Visible = true popup.AcceptButton.Text = "Accept" popup.DeclineButton.Text = "Decline" - popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true) - + popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true) + local yesCon, noCon yesCon = popup.AcceptButton.MouseButton1Click:connect(function() popup.Visible = false toPlayer:RequestFriendship(fromPlayer) - if yesCon then yesCon:disconnect() end - if noCon then noCon:disconnect() end - popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible()) + if yesCon then + yesCon:disconnect() + end + if noCon then + noCon:disconnect() + end + popup:TweenSize( + UDim2.new(0, 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quart, + 1, + true, + makePopupInvisible() + ) end) noCon = popup.DeclineButton.MouseButton1Click:connect(function() popup.Visible = false toPlayer:RevokeFriendship(fromPlayer) - friendRequestBlacklist[fromPlayer] = true - print("pop up blacklist") - if yesCon then yesCon:disconnect() end - if noCon then noCon:disconnect() end - popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible()) + friendRequestBlacklist[fromPlayer] = true + print "pop up blacklist" + if yesCon then + yesCon:disconnect() + end + if noCon then + noCon:disconnect() + end + popup:TweenSize( + UDim2.new(0, 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quart, + 1, + true, + makePopupInvisible() + ) end) end - -game.Players.FriendRequestEvent:connect(function(fromPlayer,toPlayer,event) - +game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event) -- if this doesn't involve me, then do nothing - if fromPlayer ~= localPlayer and toPlayer ~= localPlayer then return end + if fromPlayer ~= localPlayer and toPlayer ~= localPlayer then + return + end if fromPlayer == localPlayer then if event == Enum.FriendRequestEvent.Accept then - game:GetService("GuiService"):SendNotification("You are Friends", - "With " .. toPlayer.Name .. "!", - "http://www.roblox.com/thumbs/avatar.ashx?userId="..tostring(toPlayer.userId).."&x=48&y=48", - 5, - function() - - end) + game:GetService("GuiService"):SendNotification( + "You are Friends", + "With " .. toPlayer.Name .. "!", + "http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(toPlayer.userId) .. "&x=48&y=48", + 5, + function() end + ) end elseif toPlayer == localPlayer then if event == Enum.FriendRequestEvent.Issue then - if friendRequestBlacklist[fromPlayer] then return end -- previously cancelled friend request, we don't want it! - game:GetService("GuiService"):SendNotification("Friend Request", + if friendRequestBlacklist[fromPlayer] then + return + end -- previously cancelled friend request, we don't want it! + game:GetService("GuiService"):SendNotification( + "Friend Request", "From " .. fromPlayer.Name, - "http://www.roblox.com/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=48&y=48", + "http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=48&y=48", 8, function() - makeFriend(fromPlayer,toPlayer) - end) + makeFriend(fromPlayer, toPlayer) + end + ) elseif event == Enum.FriendRequestEvent.Accept then - game:GetService("GuiService"):SendNotification("You are Friends", - "With " .. fromPlayer.Name .. "!", - "http://www.roblox.com/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=48&y=48", - 5, - function() - - end) + game:GetService("GuiService"):SendNotification( + "You are Friends", + "With " .. fromPlayer.Name .. "!", + "http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=48&y=48", + 5, + function() end + ) end end end) function showOneButton() - local popup = script.Parent:FindFirstChild("Popup") + local popup = script.Parent:FindFirstChild "Popup" if popup then popup.OKButton.Visible = true popup.DeclineButton.Visible = false @@ -112,15 +145,15 @@ function showOneButton() end function showTwoButtons() - local popup = script.Parent:FindFirstChild("Popup") + local popup = script.Parent:FindFirstChild "Popup" if popup then popup.OKButton.Visible = false popup.DeclineButton.Visible = true popup.AcceptButton.Visible = true - end + end end -function onTeleport(teleportState, placeId, spawnName) +function onTeleport(teleportState, _, _) if game:GetService("TeleportService").CustomizedTeleportUI == false then if teleportState == Enum.TeleportState.Started then showTeleportUI("Teleport started...", 0) @@ -139,8 +172,9 @@ function showTeleportUI(message, timer) teleportUI:Remove() end waitForChild(localPlayer, "PlayerGui") - teleportUI = Instance.new("Message", localPlayer.PlayerGui) + teleportUI = Instance.new "Message" teleportUI.Text = message + teleportUI.Parent = localPlayer.PlayerGui if timer > 0 then wait(timer) teleportUI:Remove() @@ -148,100 +182,173 @@ function showTeleportUI(message, timer) end if teleportEnabled then - localPlayer.OnTeleport:connect(onTeleport) game:GetService("TeleportService").ErrorCallback = function(message) - local popup = script.Parent:FindFirstChild("Popup") + local popup = script.Parent:FindFirstChild "Popup" showOneButton() popup.PopupText.Text = message local clickCon clickCon = popup.OKButton.MouseButton1Click:connect(function() game:GetService("TeleportService"):TeleportCancel() - if clickCon then clickCon:disconnect() end - game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild("Popup")) - popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible()) + if clickCon then + clickCon:disconnect() + end + game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild "Popup") + popup:TweenSize( + UDim2.new(0, 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quart, + 1, + true, + makePopupInvisible() + ) end) - game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup"), Enum.CenterDialogType.QuitDialog, + game.GuiService:AddCenterDialog( + script.Parent:FindFirstChild "Popup", + Enum.CenterDialogType.QuitDialog, --ShowFunction function() showOneButton() - script.Parent:FindFirstChild("Popup").Visible = true - popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true) + script.Parent:FindFirstChild("Popup").Visible = true + popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true) end, --HideFunction function() - popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible()) - end) - + popup:TweenSize( + UDim2.new(0, 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quart, + 1, + true, + makePopupInvisible() + ) + end + ) end game:GetService("TeleportService").ConfirmationCallback = function(message, placeId, spawnName) - local popup = script.Parent:FindFirstChild("Popup") + local popup = script.Parent:FindFirstChild "Popup" popup.PopupText.Text = message popup.PopupImage.Image = "" - + local yesCon, noCon - + local function killCons() - if yesCon then yesCon:disconnect() end - if noCon then noCon:disconnect() end - game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild("Popup")) - popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible()) + if yesCon then + yesCon:disconnect() + end + if noCon then + noCon:disconnect() + end + game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild "Popup") + popup:TweenSize( + UDim2.new(0, 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quart, + 1, + true, + makePopupInvisible() + ) end yesCon = popup.AcceptButton.MouseButton1Click:connect(function() killCons() - local success, err = pcall(function() game:GetService("TeleportService"):TeleportImpl(placeId,spawnName) end) + local success, err = pcall(function() + game:GetService("TeleportService"):TeleportImpl(placeId, spawnName) + end) if not success then showOneButton() popup.PopupText.Text = err local clickCon clickCon = popup.OKButton.MouseButton1Click:connect(function() - if clickCon then clickCon:disconnect() end - game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild("Popup")) - popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible()) + if clickCon then + clickCon:disconnect() + end + game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild "Popup") + popup:TweenSize( + UDim2.new(0, 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quart, + 1, + true, + makePopupInvisible() + ) end) - game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup"), Enum.CenterDialogType.QuitDialog, - --ShowFunction - function() - showOneButton() - script.Parent:FindFirstChild("Popup").Visible = true - popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true) - end, - --HideFunction - function() - popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible()) - end) + game.GuiService:AddCenterDialog( + script.Parent:FindFirstChild "Popup", + Enum.CenterDialogType.QuitDialog, + --ShowFunction + function() + showOneButton() + script.Parent:FindFirstChild("Popup").Visible = true + popup:TweenSize( + UDim2.new(0, 330, 0, 350), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quart, + 1, + true + ) + end, + --HideFunction + function() + popup:TweenSize( + UDim2.new(0, 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quart, + 1, + true, + makePopupInvisible() + ) + end + ) end end) noCon = popup.DeclineButton.MouseButton1Click:connect(function() killCons() - local success = pcall(function() game:GetService("TeleportService"):TeleportCancel() end) + pcall(function() + game:GetService("TeleportService"):TeleportCancel() + end) + end) + + local centerDialogSuccess = pcall(function() + game.GuiService:AddCenterDialog( + script.Parent:FindFirstChild "Popup", + Enum.CenterDialogType.QuitDialog, + --ShowFunction + function() + showTwoButtons() + popup.AcceptButton.Text = "Leave" + popup.DeclineButton.Text = "Stay" + script.Parent:FindFirstChild("Popup").Visible = true + popup:TweenSize( + UDim2.new(0, 330, 0, 350), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quart, + 1, + true + ) + end, + --HideFunction + function() + popup:TweenSize( + UDim2.new(0, 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quart, + 1, + true, + makePopupInvisible() + ) + end + ) end) - local centerDialogSuccess = pcall(function() game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup"), Enum.CenterDialogType.QuitDialog, - --ShowFunction - function() - showTwoButtons() - popup.AcceptButton.Text = "Leave" - popup.DeclineButton.Text = "Stay" - script.Parent:FindFirstChild("Popup").Visible = true - popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true) - end, - --HideFunction - function() - popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible()) - end) - end) - if centerDialogSuccess == false then - script.Parent:FindFirstChild("Popup").Visible = true + script.Parent:FindFirstChild("Popup").Visible = true popup.AcceptButton.Text = "Leave" popup.DeclineButton.Text = "Stay" - popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true) + popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true) end return true - end -end \ No newline at end of file +end diff --git a/48488451.lua b/48488451.lua index 1b2b602..f93b7c3 100644 --- a/48488451.lua +++ b/48488451.lua @@ -1,8 +1,8 @@ --build our gui -local popupFrame = Instance.new("Frame") -popupFrame.Position = UDim2.new(0.5,-165,0.5,-175) -popupFrame.Size = UDim2.new(0,330,0,350) +local popupFrame = Instance.new "Frame" +popupFrame.Position = UDim2.new(0.5, -165, 0.5, -175) +popupFrame.Size = UDim2.new(0, 330, 0, 350) popupFrame.Style = Enum.FrameStyle.RobloxRound popupFrame.ZIndex = 4 popupFrame.Name = "Popup" @@ -10,26 +10,26 @@ popupFrame.Visible = false popupFrame.Parent = script.Parent local darken = popupFrame:clone() -darken.Size = UDim2.new(1,16,1,16) -darken.Position = UDim2.new(0,-8,0,-8) +darken.Size = UDim2.new(1, 16, 1, 16) +darken.Position = UDim2.new(0, -8, 0, -8) darken.Name = "Darken" darken.ZIndex = 1 darken.Parent = popupFrame -local acceptButton = Instance.new("TextButton") -acceptButton.Position = UDim2.new(0,20,0,270) -acceptButton.Size = UDim2.new(0,100,0,50) +local acceptButton = Instance.new "TextButton" +acceptButton.Position = UDim2.new(0, 20, 0, 270) +acceptButton.Size = UDim2.new(0, 100, 0, 50) acceptButton.Font = Enum.Font.ArialBold acceptButton.FontSize = Enum.FontSize.Size24 acceptButton.Style = Enum.ButtonStyle.RobloxButton -acceptButton.TextColor3 = Color3.new(248/255,248/255,248/255) +acceptButton.TextColor3 = Color3.new(248 / 255, 248 / 255, 248 / 255) acceptButton.Text = "Yes" acceptButton.ZIndex = 5 acceptButton.Name = "AcceptButton" acceptButton.Parent = popupFrame local declineButton = acceptButton:clone() -declineButton.Position = UDim2.new(1,-120,0,270) +declineButton.Position = UDim2.new(1, -120, 0, 270) declineButton.Text = "No" declineButton.Name = "DeclineButton" declineButton.Parent = popupFrame @@ -37,36 +37,36 @@ declineButton.Parent = popupFrame local okButton = acceptButton:clone() okButton.Name = "OKButton" okButton.Text = "OK" -okButton.Position = UDim2.new(0.5,-50,0,270) +okButton.Position = UDim2.new(0.5, -50, 0, 270) okButton.Visible = false okButton.Parent = popupFrame -local popupImage = Instance.new("ImageLabel") +local popupImage = Instance.new "ImageLabel" popupImage.BackgroundTransparency = 1 -popupImage.Position = UDim2.new(0.5,-140,0,0) -popupImage.Size = UDim2.new(0,280,0,280) +popupImage.Position = UDim2.new(0.5, -140, 0, 0) +popupImage.Size = UDim2.new(0, 280, 0, 280) popupImage.ZIndex = 3 popupImage.Name = "PopupImage" popupImage.Parent = popupFrame -local backing = Instance.new("ImageLabel") +local backing = Instance.new "ImageLabel" backing.BackgroundTransparency = 1 -backing.Size = UDim2.new(1,0,1,0) +backing.Size = UDim2.new(1, 0, 1, 0) backing.Image = "http://www.roblox.com/asset/?id=47574181" backing.Name = "Backing" backing.ZIndex = 2 backing.Parent = popupImage -local popupText = Instance.new("TextLabel") +local popupText = Instance.new "TextLabel" popupText.Name = "PopupText" -popupText.Size = UDim2.new(1,0,0.8,0) +popupText.Size = UDim2.new(1, 0, 0.8, 0) popupText.Font = Enum.Font.ArialBold popupText.FontSize = Enum.FontSize.Size36 popupText.BackgroundTransparency = 1 popupText.Text = "Hello I'm a popup" -popupText.TextColor3 = Color3.new(248/255,248/255,248/255) +popupText.TextColor3 = Color3.new(248 / 255, 248 / 255, 248 / 255) popupText.TextWrap = true popupText.ZIndex = 5 popupText.Parent = popupFrame -script:remove() \ No newline at end of file +script:remove() diff --git a/53878047.lua b/53878047.lua index 85d443a..eb5b87d 100644 --- a/53878047.lua +++ b/53878047.lua @@ -1,7 +1,9 @@ -- This script creates almost all gui elements found in the backpack (warning: there are a lot!) -- TODO: automate this process -if game.CoreGui.Version < 3 then return end -- peace out if we aren't using the right client +if game.CoreGui.Version < 3 then + return +end -- peace out if we aren't using the right client local gui = script.Parent @@ -17,25 +19,26 @@ local function waitForProperty(instance, property) end end -local function IsTouchDevice() +local function IsTouchDevice() local touchEnabled = false - pcall(function() touchEnabled = Game:GetService('UserInputService').TouchEnabled end) - return touchEnabled -end - -local function IsPhone() - if gui.AbsoluteSize.Y <= 320 then - return true - end - return false + pcall(function() + touchEnabled = Game:GetService("UserInputService").TouchEnabled + end) + return touchEnabled end -waitForChild(game,"Players") -waitForProperty(game.Players,"LocalPlayer") -local player = game.Players.LocalPlayer +local function IsPhone() + if gui.AbsoluteSize.Y <= 320 then + return true + end + return false +end + +waitForChild(game, "Players") +waitForProperty(game.Players, "LocalPlayer") -- First up is the current loadout -local CurrentLoadout = Instance.new("Frame") +local CurrentLoadout = Instance.new "Frame" CurrentLoadout.Name = "CurrentLoadout" CurrentLoadout.Position = UDim2.new(0.5, -300, 1, -85) CurrentLoadout.Size = UDim2.new(0, 600, 0, 54) @@ -43,29 +46,29 @@ CurrentLoadout.BackgroundTransparency = 1 CurrentLoadout.RobloxLocked = true CurrentLoadout.Parent = gui -local CLBackground = Instance.new('ImageLabel') -CLBackground.Name = 'Background'; -CLBackground.Size = UDim2.new(1.2, 0, 1.2, 0); +local CLBackground = Instance.new "ImageLabel" +CLBackground.Name = "Background" +CLBackground.Size = UDim2.new(1.2, 0, 1.2, 0) CLBackground.Image = "http://www.roblox.com/asset/?id=96536002" -CLBackground.BackgroundTransparency = 1.0; -CLBackground.Position = UDim2.new(-0.1, 0, -0.1, 0); -CLBackground.ZIndex = 0.0; +CLBackground.BackgroundTransparency = 1 +CLBackground.Position = UDim2.new(-0.1, 0, -0.1, 0) +CLBackground.ZIndex = 0.0 CLBackground.Parent = CurrentLoadout -CLBackground.Visible = false +CLBackground.Visible = false -local BackgroundUp = Instance.new('ImageLabel') +local BackgroundUp = Instance.new "ImageLabel" BackgroundUp.Size = UDim2.new(1, 0, 0.025, 1) BackgroundUp.Position = UDim2.new(0, 0, 0, 0) -BackgroundUp.Image = 'http://www.roblox.com/asset/?id=97662207' -BackgroundUp.BackgroundTransparency = 1.0 +BackgroundUp.Image = "http://www.roblox.com/asset/?id=97662207" +BackgroundUp.BackgroundTransparency = 1 BackgroundUp.Parent = CLBackground -local Debounce = Instance.new("BoolValue") +local Debounce = Instance.new "BoolValue" Debounce.Name = "Debounce" Debounce.RobloxLocked = true Debounce.Parent = CurrentLoadout -local BackpackButton = Instance.new("ImageButton") +local BackpackButton = Instance.new "ImageButton" BackpackButton.RobloxLocked = true BackpackButton.Visible = false BackpackButton.Name = "BackpackButton" @@ -73,21 +76,21 @@ BackpackButton.BackgroundTransparency = 1 BackpackButton.Image = "http://www.roblox.com/asset/?id=97617958" BackpackButton.Position = UDim2.new(0.5, -60, 1, -108) BackpackButton.Size = UDim2.new(0, 120, 0, 18) -waitForChild(gui,"ControlFrame") +waitForChild(gui, "ControlFrame") BackpackButton.Parent = gui.ControlFrame local NumSlots = 9 if IsPhone() then NumSlots = 3 - CurrentLoadout.Size = UDim2.new(0,180,0,54) - CurrentLoadout.Position = UDim2.new(0.5,-90,1,-85) + CurrentLoadout.Size = UDim2.new(0, 180, 0, 54) + CurrentLoadout.Position = UDim2.new(0.5, -90, 1, -85) end -for i = 0, NumSlots do - local slotFrame = Instance.new("Frame") +for i = 0, NumSlots do + local slotFrame = Instance.new "Frame" slotFrame.RobloxLocked = true - slotFrame.BackgroundColor3 = Color3.new(0,0,0) + slotFrame.BackgroundColor3 = Color3.new(0, 0, 0) slotFrame.BackgroundTransparency = 1 slotFrame.BorderColor3 = Color3.new(1, 1, 1) slotFrame.Name = "Slot" .. tostring(i) @@ -95,780 +98,862 @@ for i = 0, NumSlots do if i == 0 then slotFrame.Position = UDim2.new(0.9, 0, 0, 0) else - slotFrame.Position = UDim2.new((i - 1) * 0.1, (i-1)* 6,0,0) - end - + slotFrame.Position = UDim2.new((i - 1) * 0.1, (i - 1) * 6, 0, 0) + end slotFrame.Size = UDim2.new(0, 54, 1, 0) - slotFrame.Parent = CurrentLoadout + slotFrame.Parent = CurrentLoadout - if gui.AbsoluteSize.Y <= 320 then - slotFrame.Position = UDim2.new(0, (i-1)* 60, 0, -50) - print('Well got here', slotFrame, slotFrame.Position.X.Scale, slotFrame.Position.X.Offset) - end - if gui.AbsoluteSize.Y <= 320 and i == 0 then - slotFrame:Destroy() - end + if gui.AbsoluteSize.Y <= 320 then + slotFrame.Position = UDim2.new(0, (i - 1) * 60, 0, -50) + print("Well got here", slotFrame, slotFrame.Position.X.Scale, slotFrame.Position.X.Offset) + end + if gui.AbsoluteSize.Y <= 320 and i == 0 then + slotFrame:Destroy() + end end -local TempSlot = Instance.new("ImageButton") +local TempSlot = Instance.new "ImageButton" TempSlot.Name = "TempSlot" TempSlot.Active = true -TempSlot.Size = UDim2.new(1,0,1,0) -TempSlot.BackgroundTransparency = 1.0 -TempSlot.Style = 'Custom' +TempSlot.Size = UDim2.new(1, 0, 1, 0) +TempSlot.BackgroundTransparency = 1 +TempSlot.Style = "Custom" TempSlot.Visible = false TempSlot.RobloxLocked = true TempSlot.Parent = CurrentLoadout TempSlot.ZIndex = 3.0 - local slotBackground = Instance.new('ImageLabel') - slotBackground.Name = 'Background' - slotBackground.BackgroundTransparency = 1.0 - slotBackground.Image = 'http://www.roblox.com/asset/?id=97613075' - slotBackground.Size = UDim2.new(1, 0, 1, 0) - slotBackground.Parent = TempSlot +local slotBackground = Instance.new "ImageLabel" +slotBackground.Name = "Background" +slotBackground.BackgroundTransparency = 1 +slotBackground.Image = "http://www.roblox.com/asset/?id=97613075" +slotBackground.Size = UDim2.new(1, 0, 1, 0) +slotBackground.Parent = TempSlot - local HighLight = Instance.new('ImageLabel') - HighLight.Name = 'Highlight' - HighLight.BackgroundTransparency = 1.0 - HighLight.Image = 'http://www.roblox.com/asset/?id=97643886' - HighLight.Size = UDim2.new(1, 0, 1, 0) - --HighLight.Parent = TempSlot - HighLight.Visible = false +local HighLight = Instance.new "ImageLabel" +HighLight.Name = "Highlight" +HighLight.BackgroundTransparency = 1 +HighLight.Image = "http://www.roblox.com/asset/?id=97643886" +HighLight.Size = UDim2.new(1, 0, 1, 0) +--HighLight.Parent = TempSlot +HighLight.Visible = false - -- TempSlot Children - local GearReference = Instance.new("ObjectValue") - GearReference.Name = "GearReference" - GearReference.RobloxLocked = true - GearReference.Parent = TempSlot - +-- TempSlot Children +local GearReference = Instance.new "ObjectValue" +GearReference.Name = "GearReference" +GearReference.RobloxLocked = true +GearReference.Parent = TempSlot - local ToolTipLabel = Instance.new("TextLabel") - ToolTipLabel.Name = "ToolTipLabel" - ToolTipLabel.RobloxLocked = true - ToolTipLabel.Text = "" - ToolTipLabel.BackgroundTransparency = 0.5 - ToolTipLabel.BorderSizePixel = 0 - ToolTipLabel.Visible = false - ToolTipLabel.TextColor3 = Color3.new(1,1,1) - ToolTipLabel.BackgroundColor3 = Color3.new(0,0,0) - ToolTipLabel.TextStrokeTransparency = 0 - ToolTipLabel.Font = Enum.Font.ArialBold - ToolTipLabel.FontSize = Enum.FontSize.Size14 - --ToolTipLabel.TextWrap = true - ToolTipLabel.Size = UDim2.new(1,60,0,20) - ToolTipLabel.Position = UDim2.new(0,-30,0,-30) - ToolTipLabel.Parent = TempSlot - +local ToolTipLabel = Instance.new "TextLabel" +ToolTipLabel.Name = "ToolTipLabel" +ToolTipLabel.RobloxLocked = true +ToolTipLabel.Text = "" +ToolTipLabel.BackgroundTransparency = 0.5 +ToolTipLabel.BorderSizePixel = 0 +ToolTipLabel.Visible = false +ToolTipLabel.TextColor3 = Color3.new(1, 1, 1) +ToolTipLabel.BackgroundColor3 = Color3.new(0, 0, 0) +ToolTipLabel.TextStrokeTransparency = 0 +ToolTipLabel.Font = Enum.Font.ArialBold +ToolTipLabel.FontSize = Enum.FontSize.Size14 +--ToolTipLabel.TextWrap = true +ToolTipLabel.Size = UDim2.new(1, 60, 0, 20) +ToolTipLabel.Position = UDim2.new(0, -30, 0, -30) +ToolTipLabel.Parent = TempSlot - local Kill = Instance.new("BoolValue") - Kill.Name = "Kill" - Kill.RobloxLocked = true - Kill.Parent = TempSlot +local Kill = Instance.new "BoolValue" +Kill.Name = "Kill" +Kill.RobloxLocked = true +Kill.Parent = TempSlot - local GearImage = Instance.new("ImageLabel") - GearImage.Name = "GearImage" - GearImage.BackgroundTransparency = 1 - GearImage.Position = UDim2.new(0, 0, 0, 0) - GearImage.Size = UDim2.new(1, 0, 1, 0) - GearImage.ZIndex = 5.0 - GearImage.RobloxLocked = true - GearImage.Parent = TempSlot +local GearImage = Instance.new "ImageLabel" +GearImage.Name = "GearImage" +GearImage.BackgroundTransparency = 1 +GearImage.Position = UDim2.new(0, 0, 0, 0) +GearImage.Size = UDim2.new(1, 0, 1, 0) +GearImage.ZIndex = 5.0 +GearImage.RobloxLocked = true +GearImage.Parent = TempSlot - local SlotNumber = Instance.new("TextLabel") - SlotNumber.Name = "SlotNumber" - SlotNumber.BackgroundTransparency = 1 - SlotNumber.BorderSizePixel = 0 - SlotNumber.Font = Enum.Font.ArialBold - SlotNumber.FontSize = Enum.FontSize.Size18 - SlotNumber.Position = UDim2.new(0, 0, 0, 0) - SlotNumber.Size = UDim2.new(0,10,0,15) - SlotNumber.TextColor3 = Color3.new(1,1,1) - SlotNumber.TextTransparency = 0 - SlotNumber.TextXAlignment = Enum.TextXAlignment.Left - SlotNumber.TextYAlignment = Enum.TextYAlignment.Bottom - SlotNumber.RobloxLocked = true - SlotNumber.Parent = TempSlot - SlotNumber.ZIndex = 5 +local SlotNumber = Instance.new "TextLabel" +SlotNumber.Name = "SlotNumber" +SlotNumber.BackgroundTransparency = 1 +SlotNumber.BorderSizePixel = 0 +SlotNumber.Font = Enum.Font.ArialBold +SlotNumber.FontSize = Enum.FontSize.Size18 +SlotNumber.Position = UDim2.new(0, 0, 0, 0) +SlotNumber.Size = UDim2.new(0, 10, 0, 15) +SlotNumber.TextColor3 = Color3.new(1, 1, 1) +SlotNumber.TextTransparency = 0 +SlotNumber.TextXAlignment = Enum.TextXAlignment.Left +SlotNumber.TextYAlignment = Enum.TextYAlignment.Bottom +SlotNumber.RobloxLocked = true +SlotNumber.Parent = TempSlot +SlotNumber.ZIndex = 5 - if IsTouchDevice() then - SlotNumber.Visible = false - end - - local SlotNumberDownShadow = SlotNumber:Clone() - SlotNumberDownShadow.Name = "SlotNumberDownShadow" - SlotNumberDownShadow.TextColor3 = Color3.new(0,0,0) - SlotNumberDownShadow.Position = UDim2.new(0, 1, 0, -1) - SlotNumberDownShadow.Parent = TempSlot - SlotNumberDownShadow.ZIndex = 2 - - local SlotNumberUpShadow = SlotNumberDownShadow:Clone() - SlotNumberUpShadow.Name = "SlotNumberUpShadow" - SlotNumberUpShadow.Position = UDim2.new(0, -1, 0, -1) - SlotNumberUpShadow.Parent = TempSlot +if IsTouchDevice() then + SlotNumber.Visible = false +end - local GearText = Instance.new("TextLabel") - GearText.RobloxLocked = true - GearText.Name = "GearText" - GearText.BackgroundTransparency = 1 - GearText.Font = Enum.Font.Arial - GearText.FontSize = Enum.FontSize.Size14 - GearText.Position = UDim2.new(0,-8,0,-8) - GearText.Size = UDim2.new(1,16,1,16) - GearText.Text = "" - GearText.TextColor3 = Color3.new(1,1,1) - GearText.TextWrap = true - GearText.Parent = TempSlot - GearText.ZIndex = 5.0 +local SlotNumberDownShadow = SlotNumber:Clone() +SlotNumberDownShadow.Name = "SlotNumberDownShadow" +SlotNumberDownShadow.TextColor3 = Color3.new(0, 0, 0) +SlotNumberDownShadow.Position = UDim2.new(0, 1, 0, -1) +SlotNumberDownShadow.Parent = TempSlot +SlotNumberDownShadow.ZIndex = 2 + +local SlotNumberUpShadow = SlotNumberDownShadow:Clone() +SlotNumberUpShadow.Name = "SlotNumberUpShadow" +SlotNumberUpShadow.Position = UDim2.new(0, -1, 0, -1) +SlotNumberUpShadow.Parent = TempSlot + +local GearText = Instance.new "TextLabel" +GearText.RobloxLocked = true +GearText.Name = "GearText" +GearText.BackgroundTransparency = 1 +GearText.Font = Enum.Font.Arial +GearText.FontSize = Enum.FontSize.Size14 +GearText.Position = UDim2.new(0, -8, 0, -8) +GearText.Size = UDim2.new(1, 16, 1, 16) +GearText.Text = "" +GearText.TextColor3 = Color3.new(1, 1, 1) +GearText.TextWrap = true +GearText.Parent = TempSlot +GearText.ZIndex = 5.0 --- Great, now lets make the inventory! -local Backpack = Instance.new("Frame") +local Backpack = Instance.new "Frame" Backpack.RobloxLocked = true Backpack.Visible = false Backpack.Name = "Backpack" Backpack.Position = UDim2.new(0.5, 0, 0.5, 0) -Backpack.BackgroundColor3 = Color3.new(32/255, 32/255, 32/255) +Backpack.BackgroundColor3 = Color3.new(32 / 255, 32 / 255, 32 / 255) Backpack.BackgroundTransparency = 0.0 Backpack.BorderSizePixel = 0 Backpack.Parent = gui Backpack.Active = true - -- Backpack Children - local SwapSlot = Instance.new("BoolValue") - SwapSlot.RobloxLocked = true - SwapSlot.Name = "SwapSlot" - SwapSlot.Parent = Backpack - - -- SwapSlot Children - local Slot = Instance.new("IntValue") - Slot.RobloxLocked = true - Slot.Name = "Slot" - Slot.Parent = SwapSlot - - local GearButton = Instance.new("ObjectValue") - GearButton.RobloxLocked = true - GearButton.Name = "GearButton" - GearButton.Parent = SwapSlot - - local Tabs = Instance.new("Frame") - Tabs.Name = "Tabs" - Tabs.Visible = false - Tabs.Active = false - Tabs.RobloxLocked = true - Tabs.BackgroundColor3 = Color3.new(0,0,0) - Tabs.BackgroundTransparency = 0.08 - Tabs.BorderSizePixel = 0 - Tabs.Position = UDim2.new(0,0,-0.1,-4) - Tabs.Size = UDim2.new(1,0,0.1,4) - Tabs.Parent = Backpack - - -- Tabs Children - - local tabLine = Instance.new("Frame") - tabLine.RobloxLocked = true - tabLine.Name = "TabLine" - tabLine.BackgroundColor3 = Color3.new(53/255, 53/255, 53/255) - tabLine.BorderSizePixel = 0 - tabLine.Position = UDim2.new(0,5,1,-4) - tabLine.Size = UDim2.new(1,-10,0,4) - tabLine.ZIndex = 2 - tabLine.Parent = Tabs - - local InventoryButton = Instance.new("TextButton") - InventoryButton.RobloxLocked = true - InventoryButton.Name = "InventoryButton" - InventoryButton.Size = UDim2.new(0,60,0,30) - InventoryButton.Position = UDim2.new(0,7,1,-31) - InventoryButton.BackgroundColor3 = Color3.new(1,1,1) - InventoryButton.BorderColor3 = Color3.new(1,1,1) - InventoryButton.Font = Enum.Font.ArialBold - InventoryButton.FontSize = Enum.FontSize.Size18 - InventoryButton.Text = "Gear" - InventoryButton.AutoButtonColor = false - InventoryButton.TextColor3 = Color3.new(0,0,0) - InventoryButton.Selected = true - InventoryButton.Active = true - InventoryButton.ZIndex = 3 - InventoryButton.Parent = Tabs - - if game.CoreGui.Version >= 8 then - local WardrobeButton = Instance.new("TextButton") - WardrobeButton.RobloxLocked = true - WardrobeButton.Name = "WardrobeButton" - WardrobeButton.Size = UDim2.new(0,90,0,30) - WardrobeButton.Position = UDim2.new(0,77,1,-31) - WardrobeButton.BackgroundColor3 = Color3.new(0,0,0) - WardrobeButton.BorderColor3 = Color3.new(1,1,1) - WardrobeButton.Font = Enum.Font.ArialBold - WardrobeButton.FontSize = Enum.FontSize.Size18 - WardrobeButton.Text = "Wardrobe" - WardrobeButton.AutoButtonColor = false - WardrobeButton.TextColor3 = Color3.new(1,1,1) - WardrobeButton.Selected = false - WardrobeButton.Active = true - WardrobeButton.Parent = Tabs - end - - local closeButton = Instance.new("TextButton") - closeButton.RobloxLocked = true - closeButton.Name = "CloseButton" - closeButton.Font = Enum.Font.ArialBold - closeButton.FontSize = Enum.FontSize.Size24 - closeButton.Position = UDim2.new(1,-33,0,4) - closeButton.Size = UDim2.new(0,30,0,30) - closeButton.Style = Enum.ButtonStyle.RobloxButton - closeButton.Text = "" - closeButton.TextColor3 = Color3.new(1,1,1) - closeButton.Parent = Tabs - closeButton.Modal = true - - --closeButton child - local XImage = Instance.new("ImageLabel") - XImage.RobloxLocked = true - XImage.Name = "XImage" - game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=75547445") - XImage.Image = "http://www.roblox.com/asset/?id=75547445" --TODO: move to rbxasset - XImage.BackgroundTransparency = 1 - XImage.Position = UDim2.new(-.25,-1,-.25,-1) - XImage.Size = UDim2.new(1.5,2,1.5,2) - XImage.ZIndex = 2 - XImage.Parent = closeButton - - -- Generic Search gui used across backpack - local SearchFrame = Instance.new("Frame") - SearchFrame.RobloxLocked = true - SearchFrame.Name = "SearchFrame" - SearchFrame.BackgroundTransparency = 1 - SearchFrame.Position = UDim2.new(1,-220,0,2) - SearchFrame.Size = UDim2.new(0,220,0,24) - SearchFrame.Parent = Backpack - - -- SearchFrame Children - local SearchButton = Instance.new("ImageButton") - SearchButton.RobloxLocked = true - SearchButton.Name = "SearchButton" - SearchButton.Size = UDim2.new(0,25,0,25) - SearchButton.BackgroundTransparency = 1 - SearchButton.Image = "rbxasset://textures/ui/SearchIcon.png" - SearchButton.Parent = SearchFrame - - local SearchBoxFrame = Instance.new("TextButton") - SearchBoxFrame.RobloxLocked = true - SearchBoxFrame.Position = UDim2.new(0,25,0,0) - SearchBoxFrame.Size = UDim2.new(1,-28,0,26) - SearchBoxFrame.Name = "SearchBoxFrame" - SearchBoxFrame.Text = "" - SearchBoxFrame.Style = Enum.ButtonStyle.RobloxButton - SearchBoxFrame.Parent = SearchFrame - - -- SearchBoxFrame Children - local SearchBox = Instance.new("TextBox") - SearchBox.RobloxLocked = true - SearchBox.Name = "SearchBox" - SearchBox.BackgroundTransparency = 1 - SearchBox.Font = Enum.Font.ArialBold - SearchBox.FontSize = Enum.FontSize.Size12 - SearchBox.Position = UDim2.new(0,-5,0,-5) - SearchBox.Size = UDim2.new(1,10,1,10) - SearchBox.TextColor3 = Color3.new(1,1,1) - SearchBox.TextXAlignment = Enum.TextXAlignment.Left - SearchBox.ZIndex = 2 - SearchBox.TextWrap = true - SearchBox.Text = "Search..." - SearchBox.Parent = SearchBoxFrame - - - local ResetButton = Instance.new("TextButton") - ResetButton.RobloxLocked = true - ResetButton.Visible = false - ResetButton.Name = "ResetButton" - ResetButton.Position = UDim2.new(1,-26,0,3) - ResetButton.Size = UDim2.new(0,20,0,20) - ResetButton.Style = Enum.ButtonStyle.RobloxButtonDefault - ResetButton.Text = "X" - ResetButton.TextColor3 = Color3.new(1,1,1) - ResetButton.Font = Enum.Font.ArialBold - ResetButton.FontSize = Enum.FontSize.Size18 - ResetButton.ZIndex = 3 - ResetButton.Parent = SearchFrame - +-- Backpack Children +local SwapSlot = Instance.new "BoolValue" +SwapSlot.RobloxLocked = true +SwapSlot.Name = "SwapSlot" +SwapSlot.Parent = Backpack + +-- SwapSlot Children +local Slot = Instance.new "IntValue" +Slot.RobloxLocked = true +Slot.Name = "Slot" +Slot.Parent = SwapSlot + +local GearButton = Instance.new "ObjectValue" +GearButton.RobloxLocked = true +GearButton.Name = "GearButton" +GearButton.Parent = SwapSlot + +local Tabs = Instance.new "Frame" +Tabs.Name = "Tabs" +Tabs.Visible = false +Tabs.Active = false +Tabs.RobloxLocked = true +Tabs.BackgroundColor3 = Color3.new(0, 0, 0) +Tabs.BackgroundTransparency = 0.08 +Tabs.BorderSizePixel = 0 +Tabs.Position = UDim2.new(0, 0, -0.1, -4) +Tabs.Size = UDim2.new(1, 0, 0.1, 4) +Tabs.Parent = Backpack + +-- Tabs Children + +local tabLine = Instance.new "Frame" +tabLine.RobloxLocked = true +tabLine.Name = "TabLine" +tabLine.BackgroundColor3 = Color3.new(53 / 255, 53 / 255, 53 / 255) +tabLine.BorderSizePixel = 0 +tabLine.Position = UDim2.new(0, 5, 1, -4) +tabLine.Size = UDim2.new(1, -10, 0, 4) +tabLine.ZIndex = 2 +tabLine.Parent = Tabs + +local InventoryButton = Instance.new "TextButton" +InventoryButton.RobloxLocked = true +InventoryButton.Name = "InventoryButton" +InventoryButton.Size = UDim2.new(0, 60, 0, 30) +InventoryButton.Position = UDim2.new(0, 7, 1, -31) +InventoryButton.BackgroundColor3 = Color3.new(1, 1, 1) +InventoryButton.BorderColor3 = Color3.new(1, 1, 1) +InventoryButton.Font = Enum.Font.ArialBold +InventoryButton.FontSize = Enum.FontSize.Size18 +InventoryButton.Text = "Gear" +InventoryButton.AutoButtonColor = false +InventoryButton.TextColor3 = Color3.new(0, 0, 0) +InventoryButton.Selected = true +InventoryButton.Active = true +InventoryButton.ZIndex = 3 +InventoryButton.Parent = Tabs + +if game.CoreGui.Version >= 8 then + local WardrobeButton = Instance.new "TextButton" + WardrobeButton.RobloxLocked = true + WardrobeButton.Name = "WardrobeButton" + WardrobeButton.Size = UDim2.new(0, 90, 0, 30) + WardrobeButton.Position = UDim2.new(0, 77, 1, -31) + WardrobeButton.BackgroundColor3 = Color3.new(0, 0, 0) + WardrobeButton.BorderColor3 = Color3.new(1, 1, 1) + WardrobeButton.Font = Enum.Font.ArialBold + WardrobeButton.FontSize = Enum.FontSize.Size18 + WardrobeButton.Text = "Wardrobe" + WardrobeButton.AutoButtonColor = false + WardrobeButton.TextColor3 = Color3.new(1, 1, 1) + WardrobeButton.Selected = false + WardrobeButton.Active = true + WardrobeButton.Parent = Tabs +end + +local closeButton = Instance.new "TextButton" +closeButton.RobloxLocked = true +closeButton.Name = "CloseButton" +closeButton.Font = Enum.Font.ArialBold +closeButton.FontSize = Enum.FontSize.Size24 +closeButton.Position = UDim2.new(1, -33, 0, 4) +closeButton.Size = UDim2.new(0, 30, 0, 30) +closeButton.Style = Enum.ButtonStyle.RobloxButton +closeButton.Text = "" +closeButton.TextColor3 = Color3.new(1, 1, 1) +closeButton.Parent = Tabs +closeButton.Modal = true + +--closeButton child +local XImage = Instance.new "ImageLabel" +XImage.RobloxLocked = true +XImage.Name = "XImage" +game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75547445" +XImage.Image = "http://www.roblox.com/asset/?id=75547445" --TODO: move to rbxasset +XImage.BackgroundTransparency = 1 +XImage.Position = UDim2.new(-0.25, -1, -0.25, -1) +XImage.Size = UDim2.new(1.5, 2, 1.5, 2) +XImage.ZIndex = 2 +XImage.Parent = closeButton + +-- Generic Search gui used across backpack +local SearchFrame = Instance.new "Frame" +SearchFrame.RobloxLocked = true +SearchFrame.Name = "SearchFrame" +SearchFrame.BackgroundTransparency = 1 +SearchFrame.Position = UDim2.new(1, -220, 0, 2) +SearchFrame.Size = UDim2.new(0, 220, 0, 24) +SearchFrame.Parent = Backpack + +-- SearchFrame Children +local SearchButton = Instance.new "ImageButton" +SearchButton.RobloxLocked = true +SearchButton.Name = "SearchButton" +SearchButton.Size = UDim2.new(0, 25, 0, 25) +SearchButton.BackgroundTransparency = 1 +SearchButton.Image = "rbxasset://textures/ui/SearchIcon.png" +SearchButton.Parent = SearchFrame + +local SearchBoxFrame = Instance.new "TextButton" +SearchBoxFrame.RobloxLocked = true +SearchBoxFrame.Position = UDim2.new(0, 25, 0, 0) +SearchBoxFrame.Size = UDim2.new(1, -28, 0, 26) +SearchBoxFrame.Name = "SearchBoxFrame" +SearchBoxFrame.Text = "" +SearchBoxFrame.Style = Enum.ButtonStyle.RobloxButton +SearchBoxFrame.Parent = SearchFrame + +-- SearchBoxFrame Children +local SearchBox = Instance.new "TextBox" +SearchBox.RobloxLocked = true +SearchBox.Name = "SearchBox" +SearchBox.BackgroundTransparency = 1 +SearchBox.Font = Enum.Font.ArialBold +SearchBox.FontSize = Enum.FontSize.Size12 +SearchBox.Position = UDim2.new(0, -5, 0, -5) +SearchBox.Size = UDim2.new(1, 10, 1, 10) +SearchBox.TextColor3 = Color3.new(1, 1, 1) +SearchBox.TextXAlignment = Enum.TextXAlignment.Left +SearchBox.ZIndex = 2 +SearchBox.TextWrap = true +SearchBox.Text = "Search..." +SearchBox.Parent = SearchBoxFrame + +local ResetButton = Instance.new "TextButton" +ResetButton.RobloxLocked = true +ResetButton.Visible = false +ResetButton.Name = "ResetButton" +ResetButton.Position = UDim2.new(1, -26, 0, 3) +ResetButton.Size = UDim2.new(0, 20, 0, 20) +ResetButton.Style = Enum.ButtonStyle.RobloxButtonDefault +ResetButton.Text = "X" +ResetButton.TextColor3 = Color3.new(1, 1, 1) +ResetButton.Font = Enum.Font.ArialBold +ResetButton.FontSize = Enum.FontSize.Size18 +ResetButton.ZIndex = 3 +ResetButton.Parent = SearchFrame + ------------------------------- GEAR ------------------------------------------------------- - local Gear = Instance.new("Frame") - Gear.Name = "Gear" - Gear.RobloxLocked = true - Gear.BackgroundTransparency = 1 - Gear.Size = UDim2.new(1,0,1,0) - Gear.ClipsDescendants = true - Gear.Parent = Backpack +local Gear = Instance.new "Frame" +Gear.Name = "Gear" +Gear.RobloxLocked = true +Gear.BackgroundTransparency = 1 +Gear.Size = UDim2.new(1, 0, 1, 0) +Gear.ClipsDescendants = true +Gear.Parent = Backpack - -- Gear Children - local AssetsList = Instance.new("Frame") - AssetsList.RobloxLocked = true - AssetsList.Name = "AssetsList" - AssetsList.BackgroundTransparency = 1 - AssetsList.Size = UDim2.new(0.2,0,1,0) - AssetsList.Style = Enum.FrameStyle.RobloxSquare - AssetsList.Visible = false - AssetsList.Parent = Gear - - local GearGrid = Instance.new("Frame") - GearGrid.RobloxLocked = true - GearGrid.Name = "GearGrid" - GearGrid.Size = UDim2.new(0.95, 0, 1, 0) - GearGrid.BackgroundTransparency = 1 - GearGrid.Parent = Gear - - - local GearButton = Instance.new("ImageButton") - GearButton.RobloxLocked = true - GearButton.Visible = false - GearButton.Name = "GearButton" - GearButton.Size = UDim2.new(0, 54, 0, 54) - GearButton.Style = 'Custom' - GearButton.Parent = GearGrid - GearButton.BackgroundTransparency = 1.0 +-- Gear Children +local AssetsList = Instance.new "Frame" +AssetsList.RobloxLocked = true +AssetsList.Name = "AssetsList" +AssetsList.BackgroundTransparency = 1 +AssetsList.Size = UDim2.new(0.2, 0, 1, 0) +AssetsList.Style = Enum.FrameStyle.RobloxSquare +AssetsList.Visible = false +AssetsList.Parent = Gear - local slotBackground = Instance.new('ImageLabel') - slotBackground.Name = 'Background' - slotBackground.BackgroundTransparency = 1.0 - slotBackground.Image = 'http://www.roblox.com/asset/?id=97613075' - slotBackground.Size = UDim2.new(1, 0, 1, 0) - slotBackground.Parent = GearButton +local GearGrid = Instance.new "Frame" +GearGrid.RobloxLocked = true +GearGrid.Name = "GearGrid" +GearGrid.Size = UDim2.new(0.95, 0, 1, 0) +GearGrid.BackgroundTransparency = 1 +GearGrid.Parent = Gear +local GearButton = Instance.new "ImageButton" +GearButton.RobloxLocked = true +GearButton.Visible = false +GearButton.Name = "GearButton" +GearButton.Size = UDim2.new(0, 54, 0, 54) +GearButton.Style = "Custom" +GearButton.BackgroundTransparency = 1 +GearButton.Parent = GearGrid - -- GearButton Children - local GearReference = Instance.new("ObjectValue") - GearReference.RobloxLocked = true - GearReference.Name = "GearReference" - GearReference.Parent = GearButton - - local GreyOutButton = Instance.new("Frame") - GreyOutButton.RobloxLocked = true - GreyOutButton.Name = "GreyOutButton" - GreyOutButton.BackgroundTransparency = 0.5 - GreyOutButton.Size = UDim2.new(1,0,1,0) - GreyOutButton.Active = true - GreyOutButton.Visible = false - GreyOutButton.ZIndex = 3 - GreyOutButton.Parent = GearButton - - local GearText = Instance.new("TextLabel") - GearText.RobloxLocked = true - GearText.Name = "GearText" - GearText.BackgroundTransparency = 1 - GearText.Font = Enum.Font.Arial - GearText.FontSize = Enum.FontSize.Size14 - GearText.Position = UDim2.new(0,-8,0,-8) - GearText.Size = UDim2.new(1,16,1,16) - GearText.Text = "" - GearText.ZIndex = 2 - GearText.TextColor3 = Color3.new(1,1,1) - GearText.TextWrap = true - GearText.Parent = GearButton +local slotBackground = Instance.new "ImageLabel" +slotBackground.Name = "Background" +slotBackground.BackgroundTransparency = 1 +slotBackground.Image = "http://www.roblox.com/asset/?id=97613075" +slotBackground.Size = UDim2.new(1, 0, 1, 0) +slotBackground.Parent = GearButton - local GearGridScrollingArea = Instance.new("Frame") - GearGridScrollingArea.RobloxLocked = true - GearGridScrollingArea.Name = "GearGridScrollingArea" - GearGridScrollingArea.Position = UDim2.new(1, -19, 0, 35) - GearGridScrollingArea.Size = UDim2.new(0, 17, 1, -45) - GearGridScrollingArea.BackgroundTransparency = 1 - GearGridScrollingArea.Parent = Gear +-- GearButton Children +local GearReference = Instance.new "ObjectValue" +GearReference.RobloxLocked = true +GearReference.Name = "GearReference" +GearReference.Parent = GearButton - local GearLoadouts = Instance.new("Frame") - GearLoadouts.RobloxLocked = true - GearLoadouts.Name = "GearLoadouts" - GearLoadouts.BackgroundTransparency = 1 - GearLoadouts.Position = UDim2.new(0.7,23,0.5,1) - GearLoadouts.Size = UDim2.new(0.3,-23,0.5,-1) - GearLoadouts.Parent = Gear - GearLoadouts.Visible = false - - -- GearLoadouts Children - local GearLoadoutsHeader = Instance.new("Frame") - GearLoadoutsHeader.RobloxLocked = true - GearLoadoutsHeader.Name = "GearLoadoutsHeader" - GearLoadoutsHeader.BackgroundColor3 = Color3.new(0,0,0) - GearLoadoutsHeader.BackgroundTransparency = 0.2 - GearLoadoutsHeader.BorderColor3 = Color3.new(1,0,0) - GearLoadoutsHeader.Size = UDim2.new(1,2,0.15,-1) - GearLoadoutsHeader.Parent = GearLoadouts +local GreyOutButton = Instance.new "Frame" +GreyOutButton.RobloxLocked = true +GreyOutButton.Name = "GreyOutButton" +GreyOutButton.BackgroundTransparency = 0.5 +GreyOutButton.Size = UDim2.new(1, 0, 1, 0) +GreyOutButton.Active = true +GreyOutButton.Visible = false +GreyOutButton.ZIndex = 3 +GreyOutButton.Parent = GearButton - -- GearLoadoutsHeader Children - local LoadoutsHeaderText = Instance.new("TextLabel") - LoadoutsHeaderText.RobloxLocked = true - LoadoutsHeaderText.Name = "LoadoutsHeaderText" - LoadoutsHeaderText.BackgroundTransparency = 1 - LoadoutsHeaderText.Font = Enum.Font.ArialBold - LoadoutsHeaderText.FontSize = Enum.FontSize.Size18 - LoadoutsHeaderText.Size = UDim2.new(1,0,1,0) - LoadoutsHeaderText.Text = "Loadouts" - LoadoutsHeaderText.TextColor3 = Color3.new(1,1,1) - LoadoutsHeaderText.Parent = GearLoadoutsHeader - - local GearLoadoutsScrollingArea = GearGridScrollingArea:clone() - GearLoadoutsScrollingArea.RobloxLocked = true - GearLoadoutsScrollingArea.Name = "GearLoadoutsScrollingArea" - GearLoadoutsScrollingArea.Position = UDim2.new(1,-15,0.15,2) - GearLoadoutsScrollingArea.Size = UDim2.new(0,17,0.85,-2) - GearLoadoutsScrollingArea.Parent = GearLoadouts +local GearText = Instance.new "TextLabel" +GearText.RobloxLocked = true +GearText.Name = "GearText" +GearText.BackgroundTransparency = 1 +GearText.Font = Enum.Font.Arial +GearText.FontSize = Enum.FontSize.Size14 +GearText.Position = UDim2.new(0, -8, 0, -8) +GearText.Size = UDim2.new(1, 16, 1, 16) +GearText.Text = "" +GearText.ZIndex = 2 +GearText.TextColor3 = Color3.new(1, 1, 1) +GearText.TextWrap = true +GearText.Parent = GearButton + +local GearGridScrollingArea = Instance.new "Frame" +GearGridScrollingArea.RobloxLocked = true +GearGridScrollingArea.Name = "GearGridScrollingArea" +GearGridScrollingArea.Position = UDim2.new(1, -19, 0, 35) +GearGridScrollingArea.Size = UDim2.new(0, 17, 1, -45) +GearGridScrollingArea.BackgroundTransparency = 1 +GearGridScrollingArea.Parent = Gear + +local GearLoadouts = Instance.new "Frame" +GearLoadouts.RobloxLocked = true +GearLoadouts.Name = "GearLoadouts" +GearLoadouts.BackgroundTransparency = 1 +GearLoadouts.Position = UDim2.new(0.7, 23, 0.5, 1) +GearLoadouts.Size = UDim2.new(0.3, -23, 0.5, -1) +GearLoadouts.Parent = Gear +GearLoadouts.Visible = false + +-- GearLoadouts Children +local GearLoadoutsHeader = Instance.new "Frame" +GearLoadoutsHeader.RobloxLocked = true +GearLoadoutsHeader.Name = "GearLoadoutsHeader" +GearLoadoutsHeader.BackgroundColor3 = Color3.new(0, 0, 0) +GearLoadoutsHeader.BackgroundTransparency = 0.2 +GearLoadoutsHeader.BorderColor3 = Color3.new(1, 0, 0) +GearLoadoutsHeader.Size = UDim2.new(1, 2, 0.15, -1) +GearLoadoutsHeader.Parent = GearLoadouts + +-- GearLoadoutsHeader Children +local LoadoutsHeaderText = Instance.new "TextLabel" +LoadoutsHeaderText.RobloxLocked = true +LoadoutsHeaderText.Name = "LoadoutsHeaderText" +LoadoutsHeaderText.BackgroundTransparency = 1 +LoadoutsHeaderText.Font = Enum.Font.ArialBold +LoadoutsHeaderText.FontSize = Enum.FontSize.Size18 +LoadoutsHeaderText.Size = UDim2.new(1, 0, 1, 0) +LoadoutsHeaderText.Text = "Loadouts" +LoadoutsHeaderText.TextColor3 = Color3.new(1, 1, 1) +LoadoutsHeaderText.Parent = GearLoadoutsHeader + +local GearLoadoutsScrollingArea = GearGridScrollingArea:clone() +GearLoadoutsScrollingArea.RobloxLocked = true +GearLoadoutsScrollingArea.Name = "GearLoadoutsScrollingArea" +GearLoadoutsScrollingArea.Position = UDim2.new(1, -15, 0.15, 2) +GearLoadoutsScrollingArea.Size = UDim2.new(0, 17, 0.85, -2) +GearLoadoutsScrollingArea.Parent = GearLoadouts + +local LoadoutsList = Instance.new "Frame" +LoadoutsList.RobloxLocked = true +LoadoutsList.Name = "LoadoutsList" +LoadoutsList.Position = UDim2.new(0, 0, 0.15, 2) +LoadoutsList.Size = UDim2.new(1, -17, 0.85, -2) +LoadoutsList.Style = Enum.FrameStyle.RobloxSquare +LoadoutsList.Parent = GearLoadouts + +local GearPreview = Instance.new "Frame" +GearPreview.RobloxLocked = true +GearPreview.Name = "GearPreview" +GearPreview.Position = UDim2.new(0.7, 23, 0, 0) +GearPreview.Size = UDim2.new(0.3, -28, 0.5, -1) +GearPreview.BackgroundTransparency = 1 +GearPreview.ZIndex = 7 +GearPreview.Parent = Gear + +-- GearPreview Children +local GearStats = Instance.new "Frame" +GearStats.RobloxLocked = true +GearStats.Name = "GearStats" +GearStats.BackgroundTransparency = 1 +GearStats.Position = UDim2.new(0, 0, 0.75, 0) +GearStats.Size = UDim2.new(1, 0, 0.25, 0) +GearStats.ZIndex = 8 +GearStats.Parent = GearPreview + +-- GearStats Children +local GearName = Instance.new "TextLabel" +GearName.RobloxLocked = true +GearName.Name = "GearName" +GearName.BackgroundTransparency = 1 +GearName.Font = Enum.Font.ArialBold +GearName.FontSize = Enum.FontSize.Size18 +GearName.Position = UDim2.new(0, -3, 0, 0) +GearName.Size = UDim2.new(1, 6, 1, 5) +GearName.Text = "" +GearName.TextColor3 = Color3.new(1, 1, 1) +GearName.TextWrap = true +GearName.ZIndex = 9 +GearName.Parent = GearStats + +local GearImage = Instance.new "ImageLabel" +GearImage.RobloxLocked = true +GearImage.Name = "GearImage" +GearImage.Image = "" +GearImage.BackgroundTransparency = 1 +GearImage.Position = UDim2.new(0.125, 0, 0, 0) +GearImage.Size = UDim2.new(0.75, 0, 0.75, 0) +GearImage.ZIndex = 8 +GearImage.Parent = GearPreview + +--GearImage Children +local GearIcons = Instance.new "Frame" +GearIcons.BackgroundColor3 = Color3.new(0, 0, 0) +GearIcons.BackgroundTransparency = 0.5 +GearIcons.BorderSizePixel = 0 +GearIcons.RobloxLocked = true +GearIcons.Name = "GearIcons" +GearIcons.Position = UDim2.new(0.4, 2, 0.85, -2) +GearIcons.Size = UDim2.new(0.6, 0, 0.15, 0) +GearIcons.Visible = false +GearIcons.ZIndex = 9 +GearIcons.Parent = GearImage + +-- GearIcons Children +local GenreImage = Instance.new "ImageLabel" +GenreImage.RobloxLocked = true +GenreImage.Name = "GenreImage" +GenreImage.BackgroundColor3 = Color3.new(102 / 255, 153 / 255, 1) +GenreImage.BackgroundTransparency = 0.5 +GenreImage.BorderSizePixel = 0 +GenreImage.Size = UDim2.new(0.25, 0, 1, 0) +GenreImage.Parent = GearIcons + +local AttributeOneImage = GenreImage:clone() +AttributeOneImage.RobloxLocked = true +AttributeOneImage.Name = "AttributeOneImage" +AttributeOneImage.BackgroundColor3 = Color3.new(1, 51 / 255, 0) +AttributeOneImage.Position = UDim2.new(0.25, 0, 0, 0) +AttributeOneImage.Parent = GearIcons + +local AttributeTwoImage = GenreImage:clone() +AttributeTwoImage.RobloxLocked = true +AttributeTwoImage.Name = "AttributeTwoImage" +AttributeTwoImage.BackgroundColor3 = Color3.new(153 / 255, 1, 153 / 255) +AttributeTwoImage.Position = UDim2.new(0.5, 0, 0, 0) +AttributeTwoImage.Parent = GearIcons + +local AttributeThreeImage = GenreImage:clone() +AttributeThreeImage.RobloxLocked = true +AttributeThreeImage.Name = "AttributeThreeImage" +AttributeThreeImage.BackgroundColor3 = Color3.new(0, 0.5, 0.5) +AttributeThreeImage.Position = UDim2.new(0.75, 0, 0, 0) +AttributeThreeImage.Parent = GearIcons - local LoadoutsList = Instance.new("Frame") - LoadoutsList.RobloxLocked = true - LoadoutsList.Name = "LoadoutsList" - LoadoutsList.Position = UDim2.new(0,0,0.15,2) - LoadoutsList.Size = UDim2.new(1,-17,0.85,-2) - LoadoutsList.Style = Enum.FrameStyle.RobloxSquare - LoadoutsList.Parent = GearLoadouts - - local GearPreview = Instance.new("Frame") - GearPreview.RobloxLocked = true - GearPreview.Name = "GearPreview" - GearPreview.Position = UDim2.new(0.7,23,0,0) - GearPreview.Size = UDim2.new(0.3,-28,0.5,-1) - GearPreview.BackgroundTransparency = 1 - GearPreview.ZIndex = 7 - GearPreview.Parent = Gear - - -- GearPreview Children - local GearStats = Instance.new("Frame") - GearStats.RobloxLocked = true - GearStats.Name = "GearStats" - GearStats.BackgroundTransparency = 1 - GearStats.Position = UDim2.new(0,0,0.75,0) - GearStats.Size = UDim2.new(1,0,0.25,0) - GearStats.ZIndex = 8 - GearStats.Parent = GearPreview - - -- GearStats Children - local GearName = Instance.new("TextLabel") - GearName.RobloxLocked = true - GearName.Name = "GearName" - GearName.BackgroundTransparency = 1 - GearName.Font = Enum.Font.ArialBold - GearName.FontSize = Enum.FontSize.Size18 - GearName.Position = UDim2.new(0,-3,0,0) - GearName.Size = UDim2.new(1,6,1,5) - GearName.Text = "" - GearName.TextColor3 = Color3.new(1,1,1) - GearName.TextWrap = true - GearName.ZIndex = 9 - GearName.Parent = GearStats - - local GearImage = Instance.new("ImageLabel") - GearImage.RobloxLocked = true - GearImage.Name = "GearImage" - GearImage.Image = "" - GearImage.BackgroundTransparency = 1 - GearImage.Position = UDim2.new(0.125,0,0,0) - GearImage.Size = UDim2.new(0.75,0,0.75,0) - GearImage.ZIndex = 8 - GearImage.Parent = GearPreview - - --GearImage Children - local GearIcons = Instance.new("Frame") - GearIcons.BackgroundColor3 = Color3.new(0,0,0) - GearIcons.BackgroundTransparency = 0.5 - GearIcons.BorderSizePixel = 0 - GearIcons.RobloxLocked = true - GearIcons.Name = "GearIcons" - GearIcons.Position = UDim2.new(0.4,2,0.85,-2) - GearIcons.Size = UDim2.new(0.6,0,0.15,0) - GearIcons.Visible = false - GearIcons.ZIndex = 9 - GearIcons.Parent = GearImage - - -- GearIcons Children - local GenreImage = Instance.new("ImageLabel") - GenreImage.RobloxLocked = true - GenreImage.Name = "GenreImage" - GenreImage.BackgroundColor3 = Color3.new(102/255,153/255,1) - GenreImage.BackgroundTransparency = 0.5 - GenreImage.BorderSizePixel = 0 - GenreImage.Size = UDim2.new(0.25,0,1,0) - GenreImage.Parent = GearIcons - - local AttributeOneImage = GenreImage:clone() - AttributeOneImage.RobloxLocked = true - AttributeOneImage.Name = "AttributeOneImage" - AttributeOneImage.BackgroundColor3 = Color3.new(1,51/255,0) - AttributeOneImage.Position = UDim2.new(0.25,0,0,0) - AttributeOneImage.Parent = GearIcons - - local AttributeTwoImage = GenreImage:clone() - AttributeTwoImage.RobloxLocked = true - AttributeTwoImage.Name = "AttributeTwoImage" - AttributeTwoImage.BackgroundColor3 = Color3.new(153/255,1,153/255) - AttributeTwoImage.Position = UDim2.new(0.5,0,0,0) - AttributeTwoImage.Parent = GearIcons - - local AttributeThreeImage = GenreImage:clone() - AttributeThreeImage.RobloxLocked = true - AttributeThreeImage.Name = "AttributeThreeImage" - AttributeThreeImage.BackgroundColor3 = Color3.new(0,0.5,0.5) - AttributeThreeImage.Position = UDim2.new(0.75,0,0,0) - AttributeThreeImage.Parent = GearIcons - ------------------------------- WARDROBE ------------------------------------------------------- - if game.CoreGui.Version < 8 then - -- no need for this to stick around, we aren't ready for wardrobe - script:remove() - return +if game.CoreGui.Version < 8 then + -- no need for this to stick around, we aren't ready for wardrobe + script:remove() + return +end + +local function makeCharFrame(frameName, parent) + local frame = Instance.new "Frame" + frame.RobloxLocked = true + frame.Size = UDim2.new(1, 0, 1, -70) + frame.Position = UDim2.new(0, 0, 0, 20) + frame.Name = frameName + frame.BackgroundTransparency = 1 + frame.Parent = parent + frame.Visible = false + return frame +end +local function makeZone(zoneName, image, size, position, parent) + local zone = Instance.new "ImageLabel" + zone.RobloxLocked = true + zone.Name = zoneName + zone.Image = image + zone.Size = size + zone.BackgroundTransparency = 1 + zone.Position = position + zone.Parent = parent + return zone +end +local function makeStyledButton(buttonName, size, position, parent, buttonStyle) + local button = Instance.new "ImageButton" + button.RobloxLocked = true + button.Name = buttonName + button.Size = size + button.Position = position + if buttonStyle then + button.Style = buttonStyle + else + button.BackgroundColor3 = Color3.new(0, 0, 0) + button.BorderColor3 = Color3.new(1, 1, 1) end + button.Parent = parent + return button +end +local function makeTextLabel(TextLabelName, text, position, parent) + local label = Instance.new "TextLabel" + label.RobloxLocked = true + label.BackgroundTransparency = 1 + label.Size = UDim2.new(0, 32, 0, 14) + label.Name = TextLabelName + label.Font = Enum.Font.Arial + label.TextColor3 = Color3.new(1, 1, 1) + label.FontSize = Enum.FontSize.Size14 + label.Text = text + label.Position = position + label.Parent = parent +end - local function makeCharFrame(frameName, parent) - local frame = Instance.new("Frame") - frame.RobloxLocked = true - frame.Size = UDim2.new(1,0,1,-70) - frame.Position = UDim2.new(0,0,0,20) - frame.Name = frameName - frame.BackgroundTransparency = 1 - frame.Parent = parent - frame.Visible = false - return frame - end - local function makeZone( zoneName, image, size, position, parent ) - local zone = Instance.new("ImageLabel") - zone.RobloxLocked = true - zone.Name = zoneName - zone.Image = image - zone.Size = size - zone.BackgroundTransparency = 1 - zone.Position = position - zone.Parent = parent - return zone - end - local function makeStyledButton( buttonName, size, position, parent, buttonStyle ) - local button = Instance.new("ImageButton") - button.RobloxLocked = true - button.Name = buttonName - button.Size = size - button.Position = position - if buttonStyle then - button.Style = buttonStyle - else - button.BackgroundColor3 = Color3.new(0,0,0) - button.BorderColor3 = Color3.new(1,1,1) - end - button.Parent = parent - return button - end - local function makeTextLabel( TextLabelName,text,position,parent ) - local label = Instance.new("TextLabel") - label.RobloxLocked = true - label.BackgroundTransparency = 1 - label.Size = UDim2.new(0,32,0,14) - label.Name = TextLabelName - label.Font = Enum.Font.Arial - label.TextColor3 = Color3.new(1,1,1) - label.FontSize = Enum.FontSize.Size14 - label.Text = text - label.Position = position - label.Parent = parent - end +local Wardrobe = Instance.new "Frame" +Wardrobe.Name = "Wardrobe" +Wardrobe.RobloxLocked = true +Wardrobe.BackgroundTransparency = 1 +Wardrobe.Visible = false +Wardrobe.Size = UDim2.new(1, 0, 1, 0) +Wardrobe.Parent = Backpack +local AssetList = Instance.new "Frame" +AssetList.RobloxLocked = true +AssetList.Name = "AssetList" +AssetList.Position = UDim2.new(0, 4, 0, 5) +AssetList.Size = UDim2.new(0, 85, 1, -5) +AssetList.BackgroundTransparency = 1 +AssetList.Visible = true +AssetList.Parent = Wardrobe - local Wardrobe = Instance.new("Frame") - Wardrobe.Name = "Wardrobe" - Wardrobe.RobloxLocked = true - Wardrobe.BackgroundTransparency = 1 - Wardrobe.Visible = false - Wardrobe.Size = UDim2.new(1,0,1,0) - Wardrobe.Parent = Backpack +local PreviewAssetFrame = Instance.new "Frame" +PreviewAssetFrame.RobloxLocked = true +PreviewAssetFrame.Name = "PreviewAssetFrame" +PreviewAssetFrame.BackgroundTransparency = 1 +PreviewAssetFrame.Position = UDim2.new(1, -240, 0, 30) +PreviewAssetFrame.Size = UDim2.new(0, 250, 0, 250) +PreviewAssetFrame.Parent = Wardrobe - local AssetList = Instance.new("Frame") - AssetList.RobloxLocked = true - AssetList.Name = "AssetList" - AssetList.Position = UDim2.new(0,4,0,5) - AssetList.Size = UDim2.new(0,85,1,-5) - AssetList.BackgroundTransparency = 1 - AssetList.Visible = true - AssetList.Parent = Wardrobe +local PreviewAssetBacking = Instance.new "TextButton" +PreviewAssetBacking.RobloxLocked = true +PreviewAssetBacking.Name = "PreviewAssetBacking" +PreviewAssetBacking.Active = false +PreviewAssetBacking.Text = "" +PreviewAssetBacking.AutoButtonColor = false +PreviewAssetBacking.Size = UDim2.new(1, 0, 1, 0) +PreviewAssetBacking.Style = Enum.ButtonStyle.RobloxButton +PreviewAssetBacking.Visible = false +PreviewAssetBacking.ZIndex = 9 +PreviewAssetBacking.Parent = PreviewAssetFrame - local PreviewAssetFrame = Instance.new("Frame") - PreviewAssetFrame.RobloxLocked = true - PreviewAssetFrame.Name = "PreviewAssetFrame" - PreviewAssetFrame.BackgroundTransparency = 1 - PreviewAssetFrame.Position = UDim2.new(1,-240,0,30) - PreviewAssetFrame.Size = UDim2.new(0,250,0,250) - PreviewAssetFrame.Parent = Wardrobe +local PreviewAssetImage = Instance.new "ImageLabel" +PreviewAssetImage.RobloxLocked = true +PreviewAssetImage.Name = "PreviewAssetImage" +PreviewAssetImage.BackgroundTransparency = 0.8 +PreviewAssetImage.Position = UDim2.new(0.5, -100, 0, 0) +PreviewAssetImage.Size = UDim2.new(0, 200, 0, 200) +PreviewAssetImage.BorderSizePixel = 0 +PreviewAssetImage.ZIndex = 10 +PreviewAssetImage.Parent = PreviewAssetBacking - local PreviewAssetBacking = Instance.new("TextButton") - PreviewAssetBacking.RobloxLocked = true - PreviewAssetBacking.Name = "PreviewAssetBacking" - PreviewAssetBacking.Active = false - PreviewAssetBacking.Text = "" - PreviewAssetBacking.AutoButtonColor = false - PreviewAssetBacking.Size = UDim2.new(1,0,1,0) - PreviewAssetBacking.Style = Enum.ButtonStyle.RobloxButton - PreviewAssetBacking.Visible = false - PreviewAssetBacking.ZIndex = 9 - PreviewAssetBacking.Parent = PreviewAssetFrame +local AssetNameLabel = Instance.new "TextLabel" +AssetNameLabel.Name = "AssetNameLabel" +AssetNameLabel.RobloxLocked = true +AssetNameLabel.BackgroundTransparency = 1 +AssetNameLabel.Position = UDim2.new(0, 0, 1, -20) +AssetNameLabel.Size = UDim2.new(0.5, 0, 0, 24) +AssetNameLabel.ZIndex = 10 +AssetNameLabel.Font = Enum.Font.Arial +AssetNameLabel.Text = "" +AssetNameLabel.TextColor3 = Color3.new(1, 1, 1) +AssetNameLabel.TextScaled = true +AssetNameLabel.Parent = PreviewAssetBacking - local PreviewAssetImage = Instance.new("ImageLabel") - PreviewAssetImage.RobloxLocked = true - PreviewAssetImage.Name = "PreviewAssetImage" - PreviewAssetImage.BackgroundTransparency = 0.8 - PreviewAssetImage.Position = UDim2.new(0.5,-100,0,0) - PreviewAssetImage.Size = UDim2.new(0,200,0,200) - PreviewAssetImage.BorderSizePixel = 0 - PreviewAssetImage.ZIndex = 10 - PreviewAssetImage.Parent = PreviewAssetBacking +local AssetTypeLabel = AssetNameLabel:clone() +AssetTypeLabel.RobloxLocked = true +AssetTypeLabel.Name = "AssetTypeLabel" +AssetTypeLabel.TextScaled = false +AssetTypeLabel.FontSize = Enum.FontSize.Size18 +AssetTypeLabel.Position = UDim2.new(0.5, 3, 1, -20) +AssetTypeLabel.Parent = PreviewAssetBacking - local AssetNameLabel = Instance.new("TextLabel") - AssetNameLabel.Name = "AssetNameLabel" - AssetNameLabel.RobloxLocked = true - AssetNameLabel.BackgroundTransparency = 1 - AssetNameLabel.Position = UDim2.new(0,0,1,-20) - AssetNameLabel.Size = UDim2.new(0.5,0,0,24) - AssetNameLabel.ZIndex = 10 - AssetNameLabel.Font = Enum.Font.Arial - AssetNameLabel.Text = "" - AssetNameLabel.TextColor3 = Color3.new(1,1,1) - AssetNameLabel.TextScaled = true - AssetNameLabel.Parent = PreviewAssetBacking +local PreviewButton = Instance.new "TextButton" +PreviewButton.RobloxLocked = true +PreviewButton.Name = "PreviewButton" +PreviewButton.Text = "Rotate" +PreviewButton.BackgroundColor3 = Color3.new(0, 0, 0) +PreviewButton.BackgroundTransparency = 0.5 +PreviewButton.BorderColor3 = Color3.new(1, 1, 1) +PreviewButton.Position = UDim2.new(1.2, -62, 1, -50) +PreviewButton.Size = UDim2.new(0, 125, 0, 50) +PreviewButton.Font = Enum.Font.ArialBold +PreviewButton.FontSize = Enum.FontSize.Size24 +PreviewButton.TextColor3 = Color3.new(1, 1, 1) +PreviewButton.TextWrapped = true +PreviewButton.TextStrokeTransparency = 0 +PreviewButton.Parent = Wardrobe - local AssetTypeLabel = AssetNameLabel:clone() - AssetTypeLabel.RobloxLocked = true - AssetTypeLabel.Name = "AssetTypeLabel" - AssetTypeLabel.TextScaled = false - AssetTypeLabel.FontSize = Enum.FontSize.Size18 - AssetTypeLabel.Position = UDim2.new(0.5,3,1,-20) - AssetTypeLabel.Parent = PreviewAssetBacking +local CharacterPane = Instance.new "Frame" +CharacterPane.RobloxLocked = true +CharacterPane.Name = "CharacterPane" +CharacterPane.Position = UDim2.new(1, -220, 0, 32) +CharacterPane.Size = UDim2.new(0, 220, 1, -40) +CharacterPane.BackgroundTransparency = 1 +CharacterPane.Visible = true +CharacterPane.Parent = Wardrobe +--CharacterPane Children +local FaceFrame = makeCharFrame("FacesFrame", CharacterPane) +game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75460621" +makeZone( + "FaceZone", + "http://www.roblox.com/asset/?id=75460621", + UDim2.new(0, 157, 0, 137), + UDim2.new(0.5, -78, 0.5, -68), + FaceFrame +) +makeStyledButton("Face", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -135), FaceFrame) +local HeadFrame = makeCharFrame("HeadsFrame", CharacterPane) +makeZone( + "FaceZone", + "http://www.roblox.com/asset/?id=75460621", + UDim2.new(0, 157, 0, 137), + UDim2.new(0.5, -78, 0.5, -68), + HeadFrame +) +makeStyledButton("Head", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -135), HeadFrame) - local PreviewButton = Instance.new("TextButton") - PreviewButton.RobloxLocked = true - PreviewButton.Name = "PreviewButton" - PreviewButton.Text = "Rotate" - PreviewButton.BackgroundColor3 = Color3.new(0,0,0) - PreviewButton.BackgroundTransparency = 0.5 - PreviewButton.BorderColor3 = Color3.new(1,1,1) - PreviewButton.Position = UDim2.new(1.2,-62,1,-50) - PreviewButton.Size = UDim2.new(0,125,0,50) - PreviewButton.Font = Enum.Font.ArialBold - PreviewButton.FontSize = Enum.FontSize.Size24 - PreviewButton.TextColor3 = Color3.new(1,1,1) - PreviewButton.TextWrapped = true - PreviewButton.TextStrokeTransparency = 0 - PreviewButton.Parent = Wardrobe +local HatsFrame = makeCharFrame("HatsFrame", CharacterPane) +game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75457888" +local HatsZone = makeZone( + "HatsZone", + "http://www.roblox.com/asset/?id=75457888", + UDim2.new(0, 186, 0, 184), + UDim2.new(0.5, -93, 0.5, -100), + HatsFrame +) +makeStyledButton( + "Hat1Button", + UDim2.new(0, 64, 0, 64), + UDim2.new(0, -1, 0, -1), + HatsZone, + Enum.ButtonStyle.RobloxButton +) +makeStyledButton( + "Hat2Button", + UDim2.new(0, 64, 0, 64), + UDim2.new(0, 63, 0, -1), + HatsZone, + Enum.ButtonStyle.RobloxButton +) +makeStyledButton( + "Hat3Button", + UDim2.new(0, 64, 0, 64), + UDim2.new(0, 127, 0, -1), + HatsZone, + Enum.ButtonStyle.RobloxButton +) - local CharacterPane = Instance.new("Frame") - CharacterPane.RobloxLocked = true - CharacterPane.Name = "CharacterPane" - CharacterPane.Position = UDim2.new(1,-220,0,32) - CharacterPane.Size = UDim2.new(0,220,1,-40) - CharacterPane.BackgroundTransparency = 1 - CharacterPane.Visible = true - CharacterPane.Parent = Wardrobe +local PantsFrame = makeCharFrame("PantsFrame", CharacterPane) +game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75457920" +makeZone( + "PantsZone", + "http://www.roblox.com/asset/?id=75457920", + UDim2.new(0, 121, 0, 99), + UDim2.new(0.5, -60, 0.5, -100), + PantsFrame +) - --CharacterPane Children - local FaceFrame = makeCharFrame("FacesFrame", CharacterPane) - game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=75460621") - makeZone("FaceZone","http://www.roblox.com/asset/?id=75460621",UDim2.new(0,157,0,137),UDim2.new(0.5,-78,0.5,-68),FaceFrame) - makeStyledButton("Face",UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-135),FaceFrame) +local pantFrame = Instance.new "Frame" +pantFrame.RobloxLocked = true +pantFrame.Size = UDim2.new(0, 25, 0, 56) +pantFrame.Position = UDim2.new(0.5, -26, 0.5, 0) +pantFrame.BackgroundColor3 = Color3.new(0, 0, 0) +pantFrame.BorderColor3 = Color3.new(1, 1, 1) +pantFrame.Name = "PantFrame" +pantFrame.Parent = PantsFrame - local HeadFrame = makeCharFrame("HeadsFrame", CharacterPane) - makeZone("FaceZone","http://www.roblox.com/asset/?id=75460621",UDim2.new(0,157,0,137),UDim2.new(0.5,-78,0.5,-68),HeadFrame) - makeStyledButton("Head",UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-135),HeadFrame) +local otherPantFrame = pantFrame:clone() +otherPantFrame.Position = UDim2.new(0.5, 3, 0.5, 0) +otherPantFrame.RobloxLocked = true +otherPantFrame.Parent = PantsFrame - local HatsFrame = makeCharFrame("HatsFrame", CharacterPane) - game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=75457888") - local HatsZone = makeZone("HatsZone","http://www.roblox.com/asset/?id=75457888",UDim2.new(0,186,0,184),UDim2.new(0.5,-93,0.5,-100), HatsFrame) - makeStyledButton("Hat1Button",UDim2.new(0,64,0,64),UDim2.new(0,-1,0,-1),HatsZone,Enum.ButtonStyle.RobloxButton) - makeStyledButton("Hat2Button",UDim2.new(0,64,0,64),UDim2.new(0,63,0,-1),HatsZone,Enum.ButtonStyle.RobloxButton) - makeStyledButton("Hat3Button",UDim2.new(0,64,0,64),UDim2.new(0,127,0,-1),HatsZone,Enum.ButtonStyle.RobloxButton) +local CurrentPants = Instance.new "ImageButton" +CurrentPants.RobloxLocked = true +CurrentPants.BackgroundTransparency = 1 +CurrentPants.ZIndex = 2 +CurrentPants.Name = "CurrentPants" +CurrentPants.Position = UDim2.new(0.5, -31, 0.5, -4) +CurrentPants.Size = UDim2.new(0, 54, 0, 59) +CurrentPants.Parent = PantsFrame - local PantsFrame = makeCharFrame("PantsFrame", CharacterPane) - game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=75457920") - makeZone("PantsZone","http://www.roblox.com/asset/?id=75457920",UDim2.new(0,121,0,99),UDim2.new(0.5,-60,0.5,-100),PantsFrame) +local MeshFrame = makeCharFrame("PackagesFrame", CharacterPane) +local torsoButton = makeStyledButton( + "TorsoMeshButton", + UDim2.new(0, 64, 0, 64), + UDim2.new(0.5, -32, 0.5, -110), + MeshFrame, + Enum.ButtonStyle.RobloxButton +) +makeTextLabel("TorsoLabel", "Torso", UDim2.new(0.5, -16, 0, -25), torsoButton) +local leftLegButton = makeStyledButton( + "LeftLegMeshButton", + UDim2.new(0, 64, 0, 64), + UDim2.new(0.5, 0, 0.5, -25), + MeshFrame, + Enum.ButtonStyle.RobloxButton +) +makeTextLabel("LeftLegLabel", "Left Leg", UDim2.new(0.5, -16, 0, -25), leftLegButton) +local rightLegButton = makeStyledButton( + "RightLegMeshButton", + UDim2.new(0, 64, 0, 64), + UDim2.new(0.5, -64, 0.5, -25), + MeshFrame, + Enum.ButtonStyle.RobloxButton +) +makeTextLabel("RightLegLabel", "Right Leg", UDim2.new(0.5, -16, 0, -25), rightLegButton) +local rightArmButton = makeStyledButton( + "RightArmMeshButton", + UDim2.new(0, 64, 0, 64), + UDim2.new(0.5, -96, 0.5, -110), + MeshFrame, + Enum.ButtonStyle.RobloxButton +) +makeTextLabel("RightArmLabel", "Right Arm", UDim2.new(0.5, -16, 0, -25), rightArmButton) +local leftArmButton = makeStyledButton( + "LeftArmMeshButton", + UDim2.new(0, 64, 0, 64), + UDim2.new(0.5, 32, 0.5, -110), + MeshFrame, + Enum.ButtonStyle.RobloxButton +) +makeTextLabel("LeftArmLabel", "Left Arm", UDim2.new(0.5, -16, 0, -25), leftArmButton) - local pantFrame = Instance.new("Frame") - pantFrame.RobloxLocked = true - pantFrame.Size = UDim2.new(0,25,0,56) - pantFrame.Position = UDim2.new(0.5,-26,0.5,0) - pantFrame.BackgroundColor3 = Color3.new(0,0,0) - pantFrame.BorderColor3 = Color3.new(1,1,1) - pantFrame.Name = "PantFrame" - pantFrame.Parent = PantsFrame +local TShirtFrame = makeCharFrame("T-ShirtsFrame", CharacterPane) +game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75460642" +makeZone( + "TShirtZone", + "http://www.roblox.com/asset/?id=75460642", + UDim2.new(0, 121, 0, 154), + UDim2.new(0.5, -60, 0.5, -100), + TShirtFrame +) +makeStyledButton("TShirtButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -64), TShirtFrame) - local otherPantFrame = pantFrame:clone() - otherPantFrame.Position = UDim2.new(0.5,3,0.5,0) - otherPantFrame.RobloxLocked = true - otherPantFrame.Parent = PantsFrame +local ShirtFrame = makeCharFrame("ShirtsFrame", CharacterPane) +makeZone( + "ShirtZone", + "http://www.roblox.com/asset/?id=75460642", + UDim2.new(0, 121, 0, 154), + UDim2.new(0.5, -60, 0.5, -100), + ShirtFrame +) +makeStyledButton("ShirtButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -64), ShirtFrame) - local CurrentPants = Instance.new("ImageButton") - CurrentPants.RobloxLocked = true - CurrentPants.BackgroundTransparency = 1 - CurrentPants.ZIndex = 2 - CurrentPants.Name = "CurrentPants" - CurrentPants.Position = UDim2.new(0.5,-31,0.5,-4) - CurrentPants.Size = UDim2.new(0,54,0,59) - CurrentPants.Parent = PantsFrame +local ColorFrame = makeCharFrame("ColorFrame", CharacterPane) +game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=76049888" +local ColorZone = makeZone( + "ColorZone", + "http://www.roblox.com/asset/?id=76049888", + UDim2.new(0, 120, 0, 150), + UDim2.new(0.5, -60, 0.5, -100), + ColorFrame +) +makeStyledButton("Head", UDim2.new(0.26, 0, 0.19, 0), UDim2.new(0.37, 0, 0.02, 0), ColorZone).AutoButtonColor = false +makeStyledButton("LeftArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.78, 0, 0.26, 0), ColorZone).AutoButtonColor = false +makeStyledButton("RightArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.025, 0, 0.26, 0), ColorZone).AutoButtonColor = + false +makeStyledButton("Torso", UDim2.new(0.43, 0, 0.36, 0), UDim2.new(0.28, 0, 0.26, 0), ColorZone).AutoButtonColor = false +makeStyledButton("RightLeg", UDim2.new(0.19, 0, 0.31, 0), UDim2.new(0.275, 0, 0.67, 0), ColorZone).AutoButtonColor = + false +makeStyledButton("LeftLeg", UDim2.new(0.19, 0, 0.31, 0), UDim2.new(0.525, 0, 0.67, 0), ColorZone).AutoButtonColor = + false - local MeshFrame = makeCharFrame("PackagesFrame", CharacterPane) - local torsoButton = makeStyledButton("TorsoMeshButton", UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-110),MeshFrame,Enum.ButtonStyle.RobloxButton) - makeTextLabel("TorsoLabel","Torso",UDim2.new(0.5,-16,0,-25),torsoButton) - local leftLegButton = makeStyledButton("LeftLegMeshButton", UDim2.new(0,64,0,64),UDim2.new(0.5,0,0.5,-25),MeshFrame,Enum.ButtonStyle.RobloxButton) - makeTextLabel("LeftLegLabel","Left Leg",UDim2.new(0.5,-16,0,-25),leftLegButton) - local rightLegButton = makeStyledButton("RightLegMeshButton", UDim2.new(0,64,0,64),UDim2.new(0.5,-64,0.5,-25),MeshFrame,Enum.ButtonStyle.RobloxButton) - makeTextLabel("RightLegLabel","Right Leg",UDim2.new(0.5,-16,0,-25),rightLegButton) - local rightArmButton = makeStyledButton("RightArmMeshButton", UDim2.new(0,64,0,64),UDim2.new(0.5,-96,0.5,-110),MeshFrame,Enum.ButtonStyle.RobloxButton) - makeTextLabel("RightArmLabel","Right Arm",UDim2.new(0.5,-16,0,-25),rightArmButton) - local leftArmButton = makeStyledButton("LeftArmMeshButton", UDim2.new(0,64,0,64),UDim2.new(0.5,32,0.5,-110),MeshFrame,Enum.ButtonStyle.RobloxButton) - makeTextLabel("LeftArmLabel","Left Arm",UDim2.new(0.5,-16,0,-25),leftArmButton) +-- Character Panel label (shows what category we are currently browsing) +local CategoryLabel = Instance.new "TextLabel" +CategoryLabel.RobloxLocked = true +CategoryLabel.Name = "CategoryLabel" +CategoryLabel.BackgroundTransparency = 1 +CategoryLabel.Font = Enum.Font.ArialBold +CategoryLabel.FontSize = Enum.FontSize.Size18 +CategoryLabel.Position = UDim2.new(0, 0, 0, -7) +CategoryLabel.Size = UDim2.new(1, 0, 0, 20) +CategoryLabel.TextXAlignment = Enum.TextXAlignment.Center +CategoryLabel.Text = "All" +CategoryLabel.TextColor3 = Color3.new(1, 1, 1) +CategoryLabel.Parent = CharacterPane - local TShirtFrame = makeCharFrame("T-ShirtsFrame",CharacterPane) - game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=75460642") - makeZone("TShirtZone","http://www.roblox.com/asset/?id=75460642",UDim2.new(0,121,0,154),UDim2.new(0.5,-60,0.5,-100),TShirtFrame) - makeStyledButton("TShirtButton", UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64),TShirtFrame) - - - local ShirtFrame = makeCharFrame("ShirtsFrame", CharacterPane) - makeZone("ShirtZone","http://www.roblox.com/asset/?id=75460642",UDim2.new(0,121,0,154),UDim2.new(0.5,-60,0.5,-100),ShirtFrame) - makeStyledButton("ShirtButton", UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64),ShirtFrame) - - - local ColorFrame = makeCharFrame("ColorFrame", CharacterPane) - game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=76049888") - local ColorZone = makeZone("ColorZone","http://www.roblox.com/asset/?id=76049888", UDim2.new(0,120,0,150),UDim2.new(0.5,-60,0.5,-100),ColorFrame) - makeStyledButton("Head",UDim2.new(0.26,0,0.19,0),UDim2.new(0.37,0,0.02,0),ColorZone).AutoButtonColor = false - makeStyledButton("LeftArm",UDim2.new(0.19,0,0.36,0),UDim2.new(0.78,0,0.26,0),ColorZone).AutoButtonColor = false - makeStyledButton("RightArm",UDim2.new(0.19,0,0.36,0),UDim2.new(0.025,0,0.26,0),ColorZone).AutoButtonColor = false - makeStyledButton("Torso",UDim2.new(0.43,0,0.36,0),UDim2.new(0.28,0,0.26,0),ColorZone).AutoButtonColor = false - makeStyledButton("RightLeg",UDim2.new(0.19,0,0.31,0),UDim2.new(0.275,0,0.67,0),ColorZone).AutoButtonColor = false - makeStyledButton("LeftLeg",UDim2.new(0.19,0,0.31,0),UDim2.new(0.525,0,0.67,0),ColorZone).AutoButtonColor = false - - -- Character Panel label (shows what category we are currently browsing) - local CategoryLabel = Instance.new("TextLabel") - CategoryLabel.RobloxLocked = true - CategoryLabel.Name = "CategoryLabel" - CategoryLabel.BackgroundTransparency = 1 - CategoryLabel.Font = Enum.Font.ArialBold - CategoryLabel.FontSize = Enum.FontSize.Size18 - CategoryLabel.Position = UDim2.new(0,0,0,-7) - CategoryLabel.Size = UDim2.new(1,0,0,20) - CategoryLabel.TextXAlignment = Enum.TextXAlignment.Center - CategoryLabel.Text = "All" - CategoryLabel.TextColor3 = Color3.new(1,1,1) - CategoryLabel.Parent = CharacterPane - - --Save Button - local SaveButton = Instance.new("TextButton") - SaveButton.RobloxLocked = true - SaveButton.Name = "SaveButton" - SaveButton.Size = UDim2.new(0.6,0,0,50) - SaveButton.Position = UDim2.new(0.2,0,1,-50) - SaveButton.Style = Enum.ButtonStyle.RobloxButton - SaveButton.Selected = false - SaveButton.Font = Enum.Font.ArialBold - SaveButton.FontSize = Enum.FontSize.Size18 - SaveButton.Text = "Save" - SaveButton.TextColor3 = Color3.new(1,1,1) - SaveButton.Parent = CharacterPane +--Save Button +local SaveButton = Instance.new "TextButton" +SaveButton.RobloxLocked = true +SaveButton.Name = "SaveButton" +SaveButton.Size = UDim2.new(0.6, 0, 0, 50) +SaveButton.Position = UDim2.new(0.2, 0, 1, -50) +SaveButton.Style = Enum.ButtonStyle.RobloxButton +SaveButton.Selected = false +SaveButton.Font = Enum.Font.ArialBold +SaveButton.FontSize = Enum.FontSize.Size18 +SaveButton.Text = "Save" +SaveButton.TextColor3 = Color3.new(1, 1, 1) +SaveButton.Parent = CharacterPane -- no need for this to stick around -script:Destroy() \ No newline at end of file +script:Destroy() diff --git a/53878057.lua b/53878057.lua index 639f97c..6e12e7d 100644 --- a/53878057.lua +++ b/53878057.lua @@ -1,4 +1,6 @@ -if game.CoreGui.Version < 3 then return end -- peace out if we aren't using the right client +if game.CoreGui.Version < 3 then + return +end -- peace out if we aren't using the right client -- A couple of necessary functions local function waitForChild(instance, name) @@ -17,74 +19,76 @@ local currentLoadout = script.Parent local StaticTabName = "gear" local backpackEnabled = true -local robloxGui = game:GetService("CoreGui"):FindFirstChild("RobloxGui") +local robloxGui = game:GetService("CoreGui"):FindFirstChild "RobloxGui" assert(robloxGui) -local controlFrame = waitForChild(robloxGui, 'ControlFrame') -local backpackButton = waitForChild(controlFrame, 'BackpackButton') -local backpack = waitForChild(robloxGui, 'Backpack') -waitForChild(robloxGui,"CurrentLoadout") -waitForChild(robloxGui.CurrentLoadout,"TempSlot") -waitForChild(robloxGui.CurrentLoadout.TempSlot,"SlotNumber") +local controlFrame = waitForChild(robloxGui, "ControlFrame") +local backpackButton = waitForChild(controlFrame, "BackpackButton") +local backpack = waitForChild(robloxGui, "Backpack") +waitForChild(robloxGui, "CurrentLoadout") +waitForChild(robloxGui.CurrentLoadout, "TempSlot") +waitForChild(robloxGui.CurrentLoadout.TempSlot, "SlotNumber") -waitForChild(currentLoadout, 'Background') +waitForChild(currentLoadout, "Background") local clBackground = currentLoadout.Background local function IsTouchDevice() local touchEnabled = false - pcall(function() touchEnabled = Game:GetService('UserInputService').TouchEnabled end) - return touchEnabled -end + pcall(function() + touchEnabled = Game:GetService("UserInputService").TouchEnabled + end) + return touchEnabled +end local function moveHealthBar(pGui) - waitForChild(pGui, 'HealthGUI') - waitForChild(pGui['HealthGUI'], 'tray') - local tray = pGui['HealthGUI']['tray'] + waitForChild(pGui, "HealthGUI") + 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'] +local function setHealthBarVisible(pGui, visible) + waitForChild(pGui, "HealthGUI") + waitForChild(pGui["HealthGUI"], "tray") + local tray = pGui["HealthGUI"]["tray"] tray.Visible = visible end - --- Begin Locals -waitForChild(game,"Players") -waitForProperty(game.Players,"LocalPlayer") +waitForChild(game, "Players") +waitForProperty(game.Players, "LocalPlayer") local player = game.Players.LocalPlayer -waitForChild(player, 'PlayerGui') +waitForChild(player, "PlayerGui") Spawn(function() moveHealthBar(player.PlayerGui) end) -while player.Character == nil do wait(0.03) end -local humanoid = waitForChild(player.Character, 'Humanoid') -humanoid.Died:connect(function() - backpackButton.Visible = false +while player.Character == nil do + wait(0.03) +end +local humanoid = waitForChild(player.Character, "Humanoid") +humanoid.Died:connect(function() + backpackButton.Visible = false end) waitForChild(game, "LocalBackpack") game.LocalBackpack:SetOldSchoolBackpack(false) -waitForChild(currentLoadout.Parent,"Backpack") +waitForChild(currentLoadout.Parent, "Backpack") local guiBackpack = currentLoadout.Parent.Backpack -local backpackManager = waitForChild(guiBackpack,"CoreScripts/BackpackScripts/BackpackManager") -local backpackOpenEvent = waitForChild(backpackManager,"BackpackOpenEvent") -local backpackCloseEvent = waitForChild(backpackManager,"BackpackCloseEvent") -local tabClickedEvent = waitForChild(backpackManager,"TabClickedEvent") -local resizeEvent = waitForChild(backpackManager,"ResizeEvent") +local backpackManager = waitForChild(guiBackpack, "CoreScripts/BackpackScripts/BackpackManager") +local backpackOpenEvent = waitForChild(backpackManager, "BackpackOpenEvent") +local backpackCloseEvent = waitForChild(backpackManager, "BackpackCloseEvent") +local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent") +local resizeEvent = waitForChild(backpackManager, "ResizeEvent") local inGearTab = true local maxNumLoadoutItems = 10 -if robloxGui.AbsoluteSize.Y <= 320 then - maxNumLoadoutItems = 4 -end - +if robloxGui.AbsoluteSize.Y <= 320 then + maxNumLoadoutItems = 4 +end local characterChildAddedCon = nil local backpackChildCon = nil @@ -92,12 +96,12 @@ local backpackChildCon = nil local debounce = false local enlargeFactor = 1.18 -local buttonSizeEnlarge = UDim2.new(1 * enlargeFactor,0,1 * enlargeFactor,0) -local buttonSizeNormal = UDim2.new(1,0,1,0) +local buttonSizeEnlarge = UDim2.new(1 * enlargeFactor, 0, 1 * enlargeFactor, 0) +local buttonSizeNormal = UDim2.new(1, 0, 1, 0) local enlargeOverride = true local guiTweenSpeed = 0.5 -local firstInstanceOfLoadout = false +local firstInstanceOfLoadout = false local inventory = {} @@ -106,27 +110,23 @@ for i = 1, maxNumLoadoutItems do gearSlots[i] = "empty" end -local backpackWasOpened = false +local backpackWasOpened = false --- End Locals - - - - - -- Begin Functions local function backpackIsOpen() - if guiBackpack then - return guiBackpack.Visible - end - return false -end + if guiBackpack then + return guiBackpack.Visible + end + return false +end - -local function kill(prop,con,gear) - if con then con:disconnect() end +local function kill(prop, con, gear) + if con then + con:disconnect() + end if prop == true and gear then - reorganizeLoadout(gear,false) + reorganizeLoadout(gear, false) end end @@ -154,7 +154,7 @@ function characterInWorkspace() end end end - + return false end @@ -172,7 +172,10 @@ function removeGear(gear) gearSlots[emptySlot].GearReference.Value.Parent = game.Players.LocalPlayer.Backpack end - if gearSlots[emptySlot].GearReference.Value:IsA("HopperBin") and gearSlots[emptySlot].GearReference.Value.Active then -- this is an active hopperbin + if + gearSlots[emptySlot].GearReference.Value:IsA "HopperBin" + and gearSlots[emptySlot].GearReference.Value.Active + then -- this is an active hopperbin gearSlots[emptySlot].GearReference.Value:Disable() gearSlots[emptySlot].GearReference.Value.Active = false end @@ -180,36 +183,37 @@ function removeGear(gear) gearSlots[emptySlot] = "empty" - local centerizeX = gear.Size.X.Scale/2 - local centerizeY = gear.Size.Y.Scale/2 + local centerizeX = gear.Size.X.Scale / 2 + local centerizeY = gear.Size.Y.Scale / 2 --[[gear:TweenSizeAndPosition(UDim2.new(0,0,0,0), UDim2.new(gear.Position.X.Scale + centerizeX,gear.Position.X.Offset,gear.Position.Y.Scale + centerizeY,gear.Position.Y.Offset), Enum.EasingDirection.Out, Enum.EasingStyle.Quad,guiTweenSpeed/4,true)]] - delay(0, - function() - gear:remove() - end) + delay(0, function() + gear:remove() + end) Spawn(function() - while backpackIsOpen() do wait(0.03) end - waitForChild(player, 'Backpack') - local allEmpty = true - for i = 1, #gearSlots do - if gearSlots[i] ~= 'empty' then - allEmpty = false - end - end + while backpackIsOpen() do + wait(0.03) + end + waitForChild(player, "Backpack") + local allEmpty = true + for i = 1, #gearSlots do + if gearSlots[i] ~= "empty" then + allEmpty = false + end + end - if allEmpty then - if #player.Backpack:GetChildren() < 1 then - backpackButton.Visible = false - else + if allEmpty then + if #player.Backpack:GetChildren() < 1 then + backpackButton.Visible = false + else backpackButton.Position = UDim2.new(0.5, -60, 1, -44) - end + end clBackground.Visible = false - end + end end) - end + end end function insertGear(gear, addToSlot) @@ -222,7 +226,10 @@ function insertGear(gear, addToSlot) end end - if pos == 1 and gearSlots[1] ~= "empty" then gear:remove() return end -- we are currently full, can't add in + if pos == 1 and gearSlots[1] ~= "empty" then + gear:remove() + return + end -- we are currently full, can't add in else pos = addToSlot -- push all gear down one slot @@ -249,7 +256,7 @@ function insertGear(gear, addToSlot) gearSlots[pos] = gear if pos ~= maxNumLoadoutItems then - if(type(tostring(pos)) == "string") then + if type(tostring(pos)) == "string" then local posString = tostring(pos) gear.SlotNumber.Text = posString gear.SlotNumberDownShadow.Text = posString @@ -263,22 +270,27 @@ function insertGear(gear, addToSlot) gear.Visible = true local con = nil - con = gear.Kill.Changed:connect(function(prop) kill(prop,con,gear) end) + con = gear.Kill.Changed:connect(function(prop) + kill(prop, con, gear) + end) end - function reorganizeLoadout(gear, inserting, equipped, addToSlot) if inserting then -- add in gear insertGear(gear, addToSlot) else removeGear(gear) end - if gear ~= "empty" then gear.ZIndex = 1 end + if gear ~= "empty" then + gear.ZIndex = 1 + end end -function checkToolAncestry(child,parent) - if child:FindFirstChild("RobloxBuildTool") then return end -- don't show roblox build tools - if child:IsA("Tool") or child:IsA("HopperBin") then +function checkToolAncestry(child, parent) + if child:FindFirstChild "RobloxBuildTool" then + return + end -- don't show roblox build tools + if child:IsA "Tool" or child:IsA "HopperBin" then for i = 1, #gearSlots do if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then if parent == nil then @@ -288,7 +300,9 @@ function checkToolAncestry(child,parent) gearSlots[i].Selected = true return true elseif child.Parent == player.Backpack then - if child:IsA("Tool") or child:IsA("HopperBin") then gearSlots[i].Selected = false end + if child:IsA "Tool" or child:IsA "HopperBin" then + gearSlots[i].Selected = false + end return true else gearSlots[i].Kill.Value = true @@ -303,9 +317,11 @@ end function removeAllEquippedGear(physGear) local stuff = player.Character:GetChildren() for i = 1, #stuff do - if ( stuff[i]:IsA("Tool") or stuff[i]:IsA("HopperBin") ) and stuff[i] ~= physGear then - if stuff[i]:IsA("Tool") then stuff[i].Parent = player.Backpack end - if stuff[i]:IsA("HopperBin") then + if (stuff[i]:IsA "Tool" or stuff[i]:IsA "HopperBin") and stuff[i] ~= physGear then + if stuff[i]:IsA "Tool" then + stuff[i].Parent = player.Backpack + end + if stuff[i]:IsA "HopperBin" then stuff[i]:Disable() end end @@ -313,11 +329,15 @@ function removeAllEquippedGear(physGear) end function hopperBinSwitcher(numKey, physGear) - if not physGear then return end + if not physGear then + return + end physGear:ToggleSelect() - if gearSlots[numKey] == "empty" then return end + if gearSlots[numKey] == "empty" then + return + end if not physGear.Active then gearSlots[numKey].Selected = false @@ -329,39 +349,49 @@ function hopperBinSwitcher(numKey, physGear) end function toolSwitcher(numKey) - - if not gearSlots[numKey] then return end + if not gearSlots[numKey] then + return + end local physGear = gearSlots[numKey].GearReference.Value - if physGear == nil then return end + if physGear == nil then + return + end removeAllEquippedGear(physGear) -- we don't remove this gear, as then we get a double switcheroo local key = numKey - if numKey == 0 then key = 10 end + if numKey == 0 then + key = 10 + end for i = 1, #gearSlots do if gearSlots[i] and gearSlots[i] ~= "empty" and i ~= key then normalizeButton(gearSlots[i]) gearSlots[i].Selected = false - if gearSlots[i].GearReference and gearSlots[i].GearReference.Value and gearSlots[i].GearReference.Value:IsA("HopperBin") and gearSlots[i].GearReference.Value.Active then + if + gearSlots[i].GearReference + and gearSlots[i].GearReference.Value + and gearSlots[i].GearReference.Value:IsA "HopperBin" + and gearSlots[i].GearReference.Value.Active + then gearSlots[i].GearReference.Value:ToggleSelect() end end end - if physGear:IsA("HopperBin") then - hopperBinSwitcher(numKey,physGear) + if physGear:IsA "HopperBin" then + hopperBinSwitcher(numKey, physGear) else if physGear.Parent == player.Character then physGear.Parent = player.Backpack - + if gearSlots[numKey] ~= "empty" then gearSlots[numKey].Selected = false normalizeButton(gearSlots[numKey]) end else --player.Character.Humanoid:EquipTool(physGear) - + physGear.Parent = player.Character gearSlots[numKey].Selected = true @@ -370,7 +400,6 @@ function toolSwitcher(numKey) end end - function activateGear(num) local numKey = nil if num == "0" then @@ -379,21 +408,30 @@ function activateGear(num) numKey = tonumber(num) end - if(numKey == nil) then return end + if numKey == nil then + return + end if gearSlots[numKey] ~= "empty" then toolSwitcher(numKey) end end - enlargeButton = function(button) - if button.Size.Y.Scale > 1 then return end - if not button.Parent then return end - if not button.Selected then return end + if button.Size.Y.Scale > 1 then + return + end + if not button.Parent then + return + end + if not button.Selected then + return + end for i = 1, #gearSlots do - if gearSlots[i] == "empty" then break end + if gearSlots[i] == "empty" then + break + end if gearSlots[i] ~= button then normalizeButton(gearSlots[i]) end @@ -403,51 +441,82 @@ enlargeButton = function(button) return end - if button:FindFirstChild('Highlight') then + if button:FindFirstChild "Highlight" then button.Highlight.Visible = true - end + end - if button:IsA("ImageButton") or button:IsA("TextButton") then + if button:IsA "ImageButton" or button:IsA "TextButton" then button.ZIndex = 5 - local centerizeX = -(buttonSizeEnlarge.X.Scale - button.Size.X.Scale)/2 - local centerizeY = -(buttonSizeEnlarge.Y.Scale - button.Size.Y.Scale)/2 - button:TweenSizeAndPosition(buttonSizeEnlarge, - UDim2.new(button.Position.X.Scale + centerizeX,button.Position.X.Offset,button.Position.Y.Scale + centerizeY,button.Position.Y.Offset), - Enum.EasingDirection.Out, Enum.EasingStyle.Quad,guiTweenSpeed/5,enlargeOverride) + local centerizeX = -(buttonSizeEnlarge.X.Scale - button.Size.X.Scale) / 2 + local centerizeY = -(buttonSizeEnlarge.Y.Scale - button.Size.Y.Scale) / 2 + button:TweenSizeAndPosition( + buttonSizeEnlarge, + UDim2.new( + button.Position.X.Scale + centerizeX, + button.Position.X.Offset, + button.Position.Y.Scale + centerizeY, + button.Position.Y.Offset + ), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + guiTweenSpeed / 5, + enlargeOverride + ) end end normalizeAllButtons = function() for i = 1, #gearSlots do - if gearSlots[i] == "empty" then break end + if gearSlots[i] == "empty" then + break + end if gearSlots[i] ~= button then - normalizeButton(gearSlots[i],0.1) + normalizeButton(gearSlots[i], 0.1) end end end - normalizeButton = function(button, speed) - if not button then return end - if button.Size.Y.Scale <= 1 then return end - if button.Selected then return end - if not button.Parent then return end + if not button then + return + end + if button.Size.Y.Scale <= 1 then + return + end + if button.Selected then + return + end + if not button.Parent then + return + end local moveSpeed = speed - if moveSpeed == nil or type(moveSpeed) ~= "number" then moveSpeed = guiTweenSpeed/5 end + if moveSpeed == nil or type(moveSpeed) ~= "number" then + moveSpeed = guiTweenSpeed / 5 + end - if button:FindFirstChild('Highlight') then - button.Highlight.Visible = false - end + if button:FindFirstChild "Highlight" then + button.Highlight.Visible = false + end - if button:IsA("ImageButton") or button:IsA("TextButton") then + if button:IsA "ImageButton" or button:IsA "TextButton" then button.ZIndex = 1 - local inverseEnlarge = 1/enlargeFactor - local centerizeX = -(buttonSizeNormal.X.Scale - button.Size.X.Scale)/2 - local centerizeY = -(buttonSizeNormal.Y.Scale - button.Size.Y.Scale)/2 - button:TweenSizeAndPosition(buttonSizeNormal, - UDim2.new(button.Position.X.Scale + centerizeX,button.Position.X.Offset,button.Position.Y.Scale + centerizeY,button.Position.Y.Offset), - Enum.EasingDirection.Out, Enum.EasingStyle.Quad,moveSpeed,enlargeOverride) + local inverseEnlarge = 1 / enlargeFactor + local centerizeX = -(buttonSizeNormal.X.Scale - button.Size.X.Scale) / 2 + local centerizeY = -(buttonSizeNormal.Y.Scale - button.Size.Y.Scale) / 2 + button:TweenSizeAndPosition( + buttonSizeNormal, + UDim2.new( + button.Position.X.Scale + centerizeX, + button.Position.X.Offset, + button.Position.Y.Scale + centerizeY, + button.Position.Y.Offset + ), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + moveSpeed, + enlargeOverride + ) end end @@ -457,7 +526,7 @@ local waitForDebounce = function() end end -function pointInRectangle(point,rectTopLeft,rectSize) +function pointInRectangle(point, rectTopLeft, rectSize) if point.x > rectTopLeft.x and point.x < (rectTopLeft.x + rectSize.x) then if point.y > rectTopLeft.y and point.y < (rectTopLeft.y + rectSize.y) then return true @@ -466,15 +535,18 @@ function pointInRectangle(point,rectTopLeft,rectSize) return false end -function swapGear(gearClone,toFrame) +function swapGear(gearClone, toFrame) local toFrameChildren = toFrame:GetChildren() if #toFrameChildren == 1 then - if toFrameChildren[1]:FindFirstChild("SlotNumber") then - + if toFrameChildren[1]:FindFirstChild "SlotNumber" then local toSlot = tonumber(toFrameChildren[1].SlotNumber.Text) local gearCloneSlot = tonumber(gearClone.SlotNumber.Text) - if toSlot == 0 then toSlot = 10 end - if gearCloneSlot == 0 then gearCloneSlot = 10 end + if toSlot == 0 then + toSlot = 10 + end + if gearCloneSlot == 0 then + gearCloneSlot = 10 + end gearSlots[toSlot] = gearClone gearSlots[gearCloneSlot] = toFrameChildren[1] @@ -483,69 +555,78 @@ function swapGear(gearClone,toFrame) toFrameChildren[1].SlotNumberDownShadow.Text = gearClone.SlotNumber.Text toFrameChildren[1].SlotNumberUpShadow.Text = gearClone.SlotNumber.Text - local subString = string.sub(toFrame.Name,5) + local subString = string.sub(toFrame.Name, 5) gearClone.SlotNumber.Text = subString gearClone.SlotNumberDownShadow.Text = subString gearClone.SlotNumberUpShadow.Text = subString - gearClone.Position = UDim2.new(gearClone.Position.X.Scale,0,gearClone.Position.Y.Scale,0) - toFrameChildren[1].Position = UDim2.new(toFrameChildren[1].Position.X.Scale,0,toFrameChildren[1].Position.Y.Scale,0) + gearClone.Position = UDim2.new(gearClone.Position.X.Scale, 0, gearClone.Position.Y.Scale, 0) + toFrameChildren[1].Position = + UDim2.new(toFrameChildren[1].Position.X.Scale, 0, toFrameChildren[1].Position.Y.Scale, 0) toFrameChildren[1].Parent = gearClone.Parent gearClone.Parent = toFrame end else local slotNum = tonumber(gearClone.SlotNumber.Text) - if slotNum == 0 then slotNum = 10 end + if slotNum == 0 then + slotNum = 10 + end gearSlots[slotNum] = "empty" -- reset this gear slot - local subString = string.sub(toFrame.Name,5) + local subString = string.sub(toFrame.Name, 5) gearClone.SlotNumber.Text = subString gearClone.SlotNumberDownShadow.Text = subString gearClone.SlotNumberUpShadow.Text = subString local toSlotNum = tonumber(gearClone.SlotNumber.Text) - if toSlotNum == 0 then toSlotNum = 10 end + if toSlotNum == 0 then + toSlotNum = 10 + end gearSlots[toSlotNum] = gearClone - gearClone.Position = UDim2.new(gearClone.Position.X.Scale,0,gearClone.Position.Y.Scale,0) + gearClone.Position = UDim2.new(gearClone.Position.X.Scale, 0, gearClone.Position.Y.Scale, 0) gearClone.Parent = toFrame end end -function resolveDrag(gearClone,x,y) - local mousePoint = Vector2.new(x,y) +function resolveDrag(gearClone, x, y) + local mousePoint = Vector2.new(x, y) local frame = gearClone.Parent local frames = frame.Parent:GetChildren() for i = 1, #frames do - if frames[i]:IsA("Frame") then - if pointInRectangle(mousePoint, frames[i].AbsolutePosition,frames[i].AbsoluteSize) then - swapGear(gearClone,frames[i]) + if frames[i]:IsA "Frame" then + if pointInRectangle(mousePoint, frames[i].AbsolutePosition, frames[i].AbsoluteSize) then + swapGear(gearClone, frames[i]) return true end end end - if x < frame.AbsolutePosition.x or x > ( frame.AbsolutePosition.x + frame.AbsoluteSize.x ) then - reorganizeLoadout(gearClone,false) + if x < frame.AbsolutePosition.x or x > (frame.AbsolutePosition.x + frame.AbsoluteSize.x) then + reorganizeLoadout(gearClone, false) return false - elseif y < frame.AbsolutePosition.y or y > ( frame.AbsolutePosition.y + frame.AbsoluteSize.y ) then - reorganizeLoadout(gearClone,false) + elseif y < frame.AbsolutePosition.y or y > (frame.AbsolutePosition.y + frame.AbsoluteSize.y) then + reorganizeLoadout(gearClone, false) return false else - if dragBeginPos then gearClone.Position = dragBeginPos end + if dragBeginPos then + gearClone.Position = dragBeginPos + end return -1 end end function unequipAllItems(dontEquipThis) for i = 1, #gearSlots do - if gearSlots[i] == "empty" then break end + if gearSlots[i] == "empty" then + break + end if gearSlots[i].GearReference.Value and gearSlots[i].GearReference.Value ~= dontEquipThis then - if gearSlots[i].GearReference.Value:IsA("HopperBin") then + if gearSlots[i].GearReference.Value:IsA "HopperBin" then gearSlots[i].GearReference.Value:Disable() - elseif gearSlots[i].GearReference.Value:IsA("Tool") then + elseif gearSlots[i].GearReference.Value:IsA "Tool" then gearSlots[i].GearReference.Value.Parent = game.Players.LocalPlayer.Backpack end gearSlots[i].Selected = false @@ -554,30 +635,38 @@ function unequipAllItems(dontEquipThis) end function showToolTip(button, tip) - if button and button:FindFirstChild("ToolTipLabel") and button.ToolTipLabel:IsA("TextLabel") and not IsTouchDevice() then + if + button + and button:FindFirstChild "ToolTipLabel" + and button.ToolTipLabel:IsA "TextLabel" + and not IsTouchDevice() + then button.ToolTipLabel.Text = tostring(tip) local xSize = button.ToolTipLabel.TextBounds.X + 6 - button.ToolTipLabel.Size = UDim2.new(0,xSize,0,20) - button.ToolTipLabel.Position = UDim2.new(0.5,-xSize/2,0,-30) + button.ToolTipLabel.Size = UDim2.new(0, xSize, 0, 20) + button.ToolTipLabel.Position = UDim2.new(0.5, -xSize / 2, 0, -30) button.ToolTipLabel.Visible = true end end function hideToolTip(button, tip) - if button and button:FindFirstChild("ToolTipLabel") and button.ToolTipLabel:IsA("TextLabel") then + if button and button:FindFirstChild "ToolTipLabel" and button.ToolTipLabel:IsA "TextLabel" then button.ToolTipLabel.Visible = false end end -local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButton) +local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButton) waitForDebounce() debounce = true - - if child:FindFirstChild("RobloxBuildTool") then debounce = false return end -- don't show roblox build tools - if not child:IsA("Tool") then - if not child:IsA("HopperBin") then + + if child:FindFirstChild "RobloxBuildTool" then + debounce = false + return + end -- don't show roblox build tools + if not child:IsA "Tool" then + if not child:IsA "HopperBin" then debounce = false - return -- we don't care about anything besides tools (sigh...) + return -- we don't care about anything besides tools (sigh...) end end @@ -586,7 +675,7 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then -- we already have gear, do nothing debounce = false return - end + end end end @@ -597,15 +686,23 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt gearClone.GearText.Text = child.Name end gearClone.GearReference.Value = child - + gearClone.MouseEnter:connect(function() - if gearClone.GearReference and gearClone.GearReference.Value["ToolTip"] and gearClone.GearReference.Value.ToolTip ~= "" then + if + gearClone.GearReference + and gearClone.GearReference.Value["ToolTip"] + and gearClone.GearReference.Value.ToolTip ~= "" + then showToolTip(gearClone, gearClone.GearReference.Value.ToolTip) end end) - + gearClone.MouseLeave:connect(function() - if gearClone.GearReference and gearClone.GearReference.Value["ToolTip"] and gearClone.GearReference.Value.ToolTip ~= "" then + if + gearClone.GearReference + and gearClone.GearReference.Value["ToolTip"] + and gearClone.GearReference.Value.ToolTip ~= "" + then hideToolTip(gearClone, gearClone.GearReference.Value.ToolTip) end end) @@ -625,20 +722,20 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt slotToMod = addToSlot end - if slotToMod == - 1 then -- No available slot to add in! + if slotToMod == -1 then -- No available slot to add in! debounce = false - return - end + return + end local slotNum = slotToMod % 10 - local parent = currentLoadout:FindFirstChild("Slot"..tostring(slotNum)) + local parent = currentLoadout:FindFirstChild("Slot" .. tostring(slotNum)) gearClone.Parent = parent if inventoryGearButton then local absolutePositionFinal = inventoryGearButton.AbsolutePosition local currentAbsolutePosition = gearClone.AbsolutePosition local diff = absolutePositionFinal - currentAbsolutePosition - gearClone.Position = UDim2.new(gearClone.Position.X.Scale,diff.x,gearClone.Position.Y.Scale,diff.y) + gearClone.Position = UDim2.new(gearClone.Position.X.Scale, diff.x, gearClone.Position.Y.Scale, diff.y) gearClone.ZIndex = 4 end @@ -648,22 +745,33 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt reorganizeLoadout(gearClone, true) end - if gearClone.Parent == nil then debounce = false return end -- couldn't fit in (hopper is full!) + if gearClone.Parent == nil then + debounce = false + return + end -- couldn't fit in (hopper is full!) if equipped then gearClone.Selected = true unequipAllItems(child) - delay(guiTweenSpeed + 0.01,function() -- if our gear is equipped, we will want to enlarge it when done moving - if gearClone:FindFirstChild("GearReference") and ( (gearClone.GearReference.Value:IsA("Tool") and gearClone.GearReference.Value.Parent == player.Character) or - (gearClone.GearReference.Value:IsA("HopperBin") and gearClone.GearReference.Value.Active == true) ) then - enlargeButton(gearClone) + delay(guiTweenSpeed + 0.01, function() -- if our gear is equipped, we will want to enlarge it when done moving + if + gearClone:FindFirstChild "GearReference" + and ( + ( + gearClone.GearReference.Value:IsA "Tool" + and gearClone.GearReference.Value.Parent == player.Character + ) + or (gearClone.GearReference.Value:IsA "HopperBin" and gearClone.GearReference.Value.Active == true) + ) + then + enlargeButton(gearClone) end end) end local dragBeginPos = nil local clickCon, buttonDeleteCon, mouseEnterCon, mouseLeaveCon, dragStop, dragBegin = nil - clickCon = gearClone.MouseButton1Click:connect(function() + clickCon = gearClone.MouseButton1Click:connect(function() if characterInWorkspace() then if not gearClone.Draggable then activateGear(gearClone.SlotNumber.Text) @@ -676,22 +784,22 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt end end) dragBegin = gearClone.DragBegin:connect(function(pos) - dragBeginPos = pos - gearClone.ZIndex = 7 + dragBeginPos = pos + gearClone.ZIndex = 7 local children = gearClone:GetChildren() for i = 1, #children do - if children[i]:IsA("TextLabel") then - if string.find(children[i].Name,"Shadow") then + if children[i]:IsA "TextLabel" then + if string.find(children[i].Name, "Shadow") then children[i].ZIndex = 8 else children[i].ZIndex = 9 end - elseif children[i]:IsA("Frame") or children[i]:IsA("ImageLabel") then - children[i].ZIndex = 7 + elseif children[i]:IsA "Frame" or children[i]:IsA "ImageLabel" then + children[i].ZIndex = 7 end end end) - dragStop = gearClone.DragStopped:connect(function(x,y) + dragStop = gearClone.DragStopped:connect(function(x, y) if gearClone.Selected then gearClone.ZIndex = 4 else @@ -699,37 +807,55 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt end local children = gearClone:GetChildren() for i = 1, #children do - if children[i]:IsA("TextLabel") then - if string.find(children[i].Name,"Shadow") then + if children[i]:IsA "TextLabel" then + if string.find(children[i].Name, "Shadow") then children[i].ZIndex = 3 else children[i].ZIndex = 4 end - elseif children[i]:IsA("Frame") or children[i]:IsA("ImageLabel") then - children[i].ZIndex = 2 + elseif children[i]:IsA "Frame" or children[i]:IsA "ImageLabel" then + children[i].ZIndex = 2 end end - resolveDrag(gearClone,x,y) + resolveDrag(gearClone, x, y) end) mouseLeaveCon = gearClone.MouseLeave:connect(function() gearClone.Draggable = false end) buttonDeleteCon = gearClone.AncestryChanged:connect(function() - if gearClone.Parent and gearClone.Parent.Parent == currentLoadout then return end - if clickCon then clickCon:disconnect() end - if buttonDeleteCon then buttonDeleteCon:disconnect() end - if mouseEnterCon then mouseEnterCon:disconnect() end - if mouseLeaveCon then mouseLeaveCon:disconnect() end - if dragStop then dragStop:disconnect() end - if dragBegin then dragBegin:disconnect() end + if gearClone.Parent and gearClone.Parent.Parent == currentLoadout then + return + end + if clickCon then + clickCon:disconnect() + end + if buttonDeleteCon then + buttonDeleteCon:disconnect() + end + if mouseEnterCon then + mouseEnterCon:disconnect() + end + if mouseLeaveCon then + mouseLeaveCon:disconnect() + end + if dragStop then + dragStop:disconnect() + end + if dragBegin then + dragBegin:disconnect() + end end) -- this probably isn't necessary since objects are being deleted (probably), but this might still leak just in case local childCon = nil local childChangeCon = nil - childCon = child.AncestryChanged:connect(function(newChild,parent) - if not checkToolAncestry(newChild,parent) then - if childCon then childCon:disconnect() end - if childChangeCon then childChangeCon:disconnect() end + childCon = child.AncestryChanged:connect(function(newChild, parent) + if not checkToolAncestry(newChild, parent) then + if childCon then + childCon:disconnect() + end + if childChangeCon then + childChangeCon:disconnect() + end removeFromInventory(child) elseif parent == game.Players.LocalPlayer.Backpack then normalizeButton(gearClone) @@ -742,7 +868,7 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt gearClone.GearText.Text = child.Name end elseif prop == "Active" then - if child and child:IsA("HopperBin") then + if child and child:IsA "HopperBin" then if not child.Active then gearClone.Selected = false normalizeButton(gearClone) @@ -756,26 +882,34 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt debounce = false Spawn(function() - while backpackIsOpen() do wait(0.03) end - for i = 1, #gearSlots do - if gearSlots[i] ~= 'empty' then + while backpackIsOpen() do + wait(0.03) + end + for i = 1, #gearSlots do + if gearSlots[i] ~= "empty" then backpackButton.Position = UDim2.new(0.5, -60, 1, -108) if backpackEnabled then - backpackButton.Visible = true - clBackground.Visible = true + backpackButton.Visible = true + clBackground.Visible = true end - end - end + end + end end) end function addToInventory(child) - if not child:IsA("Tool") or not child:IsA("HopperBin") then return end + if not child:IsA "Tool" or not child:IsA "HopperBin" then + return + end local slot = nil for i = 1, #inventory do - if inventory[i] and inventory[i] == child then return end - if not inventory[i] then slot = i end + if inventory[i] and inventory[i] == child then + return + end + if not inventory[i] then + slot = i + end end if slot then inventory[slot] = child @@ -789,7 +923,7 @@ end function removeFromInventory(child) for i = 1, #inventory do if inventory[i] == child then - table.remove(inventory,i) + table.remove(inventory, i) inventory[i] = nil end end @@ -797,17 +931,31 @@ end local spreadOutGear = function() loadoutChildren = currentLoadout:GetChildren() - + for i = 1, #loadoutChildren do - if loadoutChildren[i]:IsA("Frame") then + if loadoutChildren[i]:IsA "Frame" then loadoutChildren[i].BackgroundTransparency = 0.5 - local slot = tonumber(string.sub(loadoutChildren[i].Name,5)) - if slot == 0 then slot = 10 end - if robloxGui.AbsoluteSize.Y <= 320 then - loadoutChildren[i]:TweenPosition(UDim2.new(0,(slot-1) * 60,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true) - else - loadoutChildren[i]:TweenPosition(UDim2.new((slot - 1)/10,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true) - end + local slot = tonumber(string.sub(loadoutChildren[i].Name, 5)) + if slot == 0 then + slot = 10 + end + if robloxGui.AbsoluteSize.Y <= 320 then + loadoutChildren[i]:TweenPosition( + UDim2.new(0, (slot - 1) * 60, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + 0.25, + true + ) + else + loadoutChildren[i]:TweenPosition( + UDim2.new((slot - 1) / 10, 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + 0.25, + true + ) + end end end end @@ -816,11 +964,11 @@ local centerGear = function() loadoutChildren = currentLoadout:GetChildren() local gearButtons = {} local lastSlotAdd = nil - + for i = 1, #loadoutChildren do - if loadoutChildren[i]:IsA("Frame") then + if loadoutChildren[i]:IsA "Frame" then if #loadoutChildren[i]:GetChildren() > 0 then - if loadoutChildren[i].Name == "Slot0" then + if loadoutChildren[i].Name == "Slot0" then lastSlotAdd = loadoutChildren[i] else table.insert(gearButtons, loadoutChildren[i]) @@ -829,21 +977,35 @@ local centerGear = function() loadoutChildren[i].BackgroundTransparency = 1 end end - if lastSlotAdd then table.insert(gearButtons,lastSlotAdd) end - - local startPos = ( 1 - (#gearButtons * 0.1) ) / 2 - for i = 1, #gearButtons do - if robloxGui.AbsoluteSize.Y <= 320 then - startPos = ( 0.5 - (#gearButtons * 0.333)/2 ) - gearButtons[i]:TweenPosition(UDim2.new(startPos + (i-1) * 0.33, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true) - else - gearButtons[i]:TweenPosition(UDim2.new(startPos + ((i - 1) * 0.1),0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true) - end + if lastSlotAdd then + table.insert(gearButtons, lastSlotAdd) + end + + local startPos = (1 - (#gearButtons * 0.1)) / 2 + for i = 1, #gearButtons do + if robloxGui.AbsoluteSize.Y <= 320 then + startPos = (0.5 - (#gearButtons * 0.333) / 2) + gearButtons[i]:TweenPosition( + UDim2.new(startPos + (i - 1) * 0.33, 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + 0.25, + true + ) + else + gearButtons[i]:TweenPosition( + UDim2.new(startPos + ((i - 1) * 0.1), 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + 0.25, + true + ) + end end end function editLoadout() - backpackWasOpened = true + backpackWasOpened = true if inGearTab then spreadOutGear() end @@ -855,23 +1017,26 @@ function readonlyLoadout() end end -function setupBackpackListener() - if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end - backpackChildCon = player.Backpack.ChildAdded:connect(function(child) - if not firstInstanceOfLoadout then - firstInstanceOfLoadout = true +function setupBackpackListener() + if backpackChildCon then + backpackChildCon:disconnect() + backpackChildCon = nil + end + backpackChildCon = player.Backpack.ChildAdded:connect(function(child) + if not firstInstanceOfLoadout then + firstInstanceOfLoadout = true if backpackEnabled then - backpackButton.Visible = true - clBackground.Visible = true + backpackButton.Visible = true + clBackground.Visible = true end - end + end addingPlayerChild(child) addToInventory(child) - end) + end) end function playerCharacterChildAdded(child) - addingPlayerChild(child,true) + addingPlayerChild(child, true) addToInventory(child) end @@ -892,9 +1057,9 @@ function tabHandler(inFocus) end end -function coreGuiChanged(coreGuiType,enabled) +function coreGuiChanged(coreGuiType, enabled) if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then - backpackButton.Visible = enabled + backpackButton.Visible = enabled clBackground.Visible = enabled backpackEnabled = enabled @@ -911,15 +1076,10 @@ function coreGuiChanged(coreGuiType,enabled) end -- End Functions - - - - - -- Begin Script registerNumberKeys() -pcall(function () +pcall(function() coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)) coreGuiChanged(Enum.CoreGuiType.Health, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health)) Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) @@ -927,58 +1087,66 @@ end) wait() -- let stuff initialize incase this is first heartbeat... -waitForChild(player,"Backpack") -waitForProperty(player,"Character") +waitForChild(player, "Backpack") +waitForProperty(player, "Character") -- not sure why this had no delay but the player.CharacterAdded one had one... this type of error would be easier to avoid with function reusage -delay(1,function() +delay(1, function() local backpackChildren = player.Backpack:GetChildren() - local size = math.min(10,#backpackChildren) + local size = math.min(10, #backpackChildren) for i = 1, size do if backpackEnabled then - backpackButton.Visible = true + backpackButton.Visible = true clBackground.Visible = true end - addingPlayerChild(backpackChildren[i],false) + addingPlayerChild(backpackChildren[i], false) end setupBackpackListener() end) -delay(2, function() - --while true do - if not backpackWasOpened then - if robloxGui.AbsoluteSize.Y <= 320 then - local cChildren = currentLoadout:GetChildren() - for i = 1, #cChildren do - local slotNum = tonumber(string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name))) - if type(slotNum) == 'number' then - cChildren[i].Position = UDim2.new(0, (slotNum-1) * 60, 0, 0) - end - end - end - end - wait(0.25) +delay(2, function() + --while true do + if not backpackWasOpened then + if robloxGui.AbsoluteSize.Y <= 320 then + local cChildren = currentLoadout:GetChildren() + for i = 1, #cChildren do + local slotNum = tonumber(string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name))) + if type(slotNum) == "number" then + cChildren[i].Position = UDim2.new(0, (slotNum - 1) * 60, 0, 0) + end + end + end + end + wait(0.25) --end -end) - -player.ChildAdded:connect(function(child) - if child:IsA('PlayerGui') then - moveHealthBar(child) - end end) -waitForProperty(player,"Character") -for i,v in ipairs(player.Character:GetChildren()) do +player.ChildAdded:connect(function(child) + if child:IsA "PlayerGui" then + moveHealthBar(child) + end +end) + +waitForProperty(player, "Character") +for i, v in ipairs(player.Character:GetChildren()) do playerCharacterChildAdded(v) end -characterChildAddedCon = player.Character.ChildAdded:connect(function(child) playerCharacterChildAdded(child) end) +characterChildAddedCon = player.Character.ChildAdded:connect(function(child) + playerCharacterChildAdded(child) +end) -waitForChild(player.Character,"Humanoid") +waitForChild(player.Character, "Humanoid") humanoidDiedCon = player.Character.Humanoid.Died:connect(function() - if humanoidDiedCon then humanoidDiedCon:disconnect() humanoidDiedCon = nil end + if humanoidDiedCon then + humanoidDiedCon:disconnect() + humanoidDiedCon = nil + end deactivateLoadout() - if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end - backpackWasOpened = false + if backpackChildCon then + backpackChildCon:disconnect() + backpackChildCon = nil + end + backpackWasOpened = false end) player.CharacterRemoving:connect(function() @@ -990,84 +1158,89 @@ player.CharacterRemoving:connect(function() end end) -player.CharacterAdded:connect(function() - waitForProperty(game.Players,"LocalPlayer") +player.CharacterAdded:connect(function() + waitForProperty(game.Players, "LocalPlayer") player = game.Players.LocalPlayer -- make sure we are still looking at the correct character - waitForChild(player,"Backpack") + waitForChild(player, "Backpack") - - delay(1,function() + delay(1, function() local backpackChildren = player.Backpack:GetChildren() - local size = math.min(10,#backpackChildren) + local size = math.min(10, #backpackChildren) for i = 1, size do if backpackEnabled then - backpackButton.Visible = true - clBackground.Visible = true + backpackButton.Visible = true + clBackground.Visible = true end - addingPlayerChild(backpackChildren[i],false) + addingPlayerChild(backpackChildren[i], false) end setupBackpackListener() end) - activateLoadout() - - if characterChildAddedCon then + activateLoadout() + + if characterChildAddedCon then characterChildAddedCon:disconnect() characterChildAddedCon = nil end - characterChildAddedCon = - player.Character.ChildAdded:connect(function(child) - addingPlayerChild(child,true) - end) + characterChildAddedCon = player.Character.ChildAdded:connect(function(child) + addingPlayerChild(child, true) + end) - waitForChild(player.Character,"Humanoid") - if backpack.Visible then + waitForChild(player.Character, "Humanoid") + if backpack.Visible then backpackOpenEvent:Fire() - end - humanoidDiedCon = - player.Character.Humanoid.Died:connect(function() - if backpackEnabled then - backpackButton.Visible = false - clBackground.Visible = false - end - firstInstanceOfLoadout = false - deactivateLoadout() - - if humanoidDiedCon then humanoidDiedCon:disconnect() humanoidDiedCon = nil end - if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end - end) - waitForChild(player, 'PlayerGui') + end + humanoidDiedCon = player.Character.Humanoid.Died:connect(function() + if backpackEnabled then + backpackButton.Visible = false + clBackground.Visible = false + end + firstInstanceOfLoadout = false + deactivateLoadout() + + if humanoidDiedCon then + humanoidDiedCon:disconnect() + humanoidDiedCon = nil + end + if backpackChildCon then + backpackChildCon:disconnect() + backpackChildCon = nil + end + end) + waitForChild(player, "PlayerGui") moveHealthBar(player.PlayerGui) - delay(2, function() - --while true do - if not backpackWasOpened then - if robloxGui.AbsoluteSize.Y <= 320 then + delay(2, function() + --while true do + if not backpackWasOpened then + if robloxGui.AbsoluteSize.Y <= 320 then local cChildren = currentLoadout:GetChildren() - for i = 1, #cChildren do - local slotNum = tonumber(string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name))) - if type(slotNum) == 'number' then - cChildren[i].Position = UDim2.new(0, (slotNum-1) * 60, 0, 0) - end - end - end - end + for i = 1, #cChildren do + local slotNum = tonumber(string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name))) + if type(slotNum) == "number" then + cChildren[i].Position = UDim2.new(0, (slotNum - 1) * 60, 0, 0) + end + end + end + end wait(0.25) - --end - end) + --end + end) end) -waitForChild(guiBackpack,"SwapSlot") +waitForChild(guiBackpack, "SwapSlot") guiBackpack.SwapSlot.Changed:connect(function() if guiBackpack.SwapSlot.Value then local swapSlot = guiBackpack.SwapSlot local pos = swapSlot.Slot.Value - if pos == 0 then pos = 10 end + if pos == 0 then + pos = 10 + end if gearSlots[pos] then - reorganizeLoadout(gearSlots[pos],false) + reorganizeLoadout(gearSlots[pos], false) end if swapSlot.GearButton.Value then - addingPlayerChild(swapSlot.GearButton.Value.GearReference.Value,false,pos) + addingPlayerChild(swapSlot.GearButton.Value.GearReference.Value, false, pos) end guiBackpack.SwapSlot.Value = false end @@ -1081,6 +1254,6 @@ end) backpackOpenEvent.Event:connect(editLoadout) backpackCloseEvent.Event:connect(centerGear) -tabClickedEvent.Event:connect(function ( tabName ) +tabClickedEvent.Event:connect(function(tabName) tabHandler(tabName == StaticTabName) -end) \ No newline at end of file +end) diff --git a/59002209.lua b/59002209.lua index 8b13789..e69de29 100644 --- a/59002209.lua +++ b/59002209.lua @@ -1 +0,0 @@ - diff --git a/60595411.lua b/60595411.lua index f8318ee..8391f7f 100644 --- a/60595411.lua +++ b/60595411.lua @@ -1,7 +1,5 @@ local t = {} - - ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ @@ -10,30 +8,30 @@ local t = {} ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ - --JSON Encoder and Parser for Lua 5.1 - -- - --Copyright 2007 Shaun Brown (http://www.chipmunkav.com) - --All Rights Reserved. - - --Permission is hereby granted, free of charge, to any person - --obtaining a copy of this software to deal in the Software without - --restriction, including without limitation the rights to use, - --copy, modify, merge, publish, distribute, sublicense, and/or - --sell copies of the Software, and to permit persons to whom the - --Software is furnished to do so, subject to the following conditions: - - --The above copyright notice and this permission notice shall be - --included in all copies or substantial portions of the Software. - --If you find this software useful please give www.chipmunkav.com a mention. +--JSON Encoder and Parser for Lua 5.1 +-- +--Copyright 2007 Shaun Brown (http://www.chipmunkav.com) +--All Rights Reserved. + +--Permission is hereby granted, free of charge, to any person +--obtaining a copy of this software to deal in the Software without +--restriction, including without limitation the rights to use, +--copy, modify, merge, publish, distribute, sublicense, and/or +--sell copies of the Software, and to permit persons to whom the +--Software is furnished to do so, subject to the following conditions: + +--The above copyright notice and this permission notice shall be +--included in all copies or substantial portions of the Software. +--If you find this software useful please give www.chipmunkav.com a mention. + +--THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +--EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +--OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +--IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +--ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +--CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +--CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - --EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - --OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - --IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - --ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - --CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - --CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - local string = string local math = math local table = table @@ -47,9 +45,8 @@ local ipairs = ipairs local assert = assert local Chipmunk = Chipmunk - local StringBuilder = { - buffer = {} + buffer = {}, } function StringBuilder:New() @@ -61,7 +58,7 @@ function StringBuilder:New() end function StringBuilder:Append(s) - self.buffer[#self.buffer+1] = s + self.buffer[#self.buffer + 1] = s end function StringBuilder:ToString() @@ -70,15 +67,15 @@ end local JsonWriter = { backslashes = { - ['\b'] = "\\b", - ['\t'] = "\\t", - ['\n'] = "\\n", - ['\f'] = "\\f", - ['\r'] = "\\r", - ['"'] = "\\\"", - ['\\'] = "\\\\", - ['/'] = "\\/" - } + ["\b"] = "\\b", + ["\t"] = "\\t", + ["\n"] = "\\n", + ["\f"] = "\\f", + ["\r"] = "\\r", + ['"'] = '\\"', + ["\\"] = "\\\\", + ["/"] = "\\/", + }, } function JsonWriter:New() @@ -119,7 +116,7 @@ function JsonWriter:Write(o) end function JsonWriter:WriteNil() - self:Append("null") + self:Append "null" end function JsonWriter:WriteString(o) @@ -127,18 +124,20 @@ function JsonWriter:WriteString(o) end function JsonWriter:ParseString(s) - self:Append('"') - self:Append(string.gsub(s, "[%z%c\\\"/]", function(n) + self:Append '"' + self:Append(string.gsub(s, '[%z%c\\"/]', function(n) local c = self.backslashes[n] - if c then return c end + if c then + return c + end return string.format("\\u%.4X", string.byte(n)) end)) - self:Append('"') + self:Append '"' end function JsonWriter:IsArray(t) local count = 0 - local isindex = function(k) + local isindex = function(k) if type(k) == "number" and k > 0 then if math.floor(k) == k then return true @@ -146,49 +145,47 @@ function JsonWriter:IsArray(t) end return false end - for k,v in pairs(t) do + for k, v in pairs(t) do if not isindex(k) then - return false, '{', '}' + return false, "{", "}" else count = math.max(count, k) end end - return true, '[', ']', count + return true, "[", "]", count end function JsonWriter:WriteTable(t) local ba, st, et, n = self:IsArray(t) - self:Append(st) - if ba then + self:Append(st) + if ba then for i = 1, n do self:Write(t[i]) if i < n then - self:Append(',') + self:Append "," end end else - local first = true; + local first = true for k, v in pairs(t) do if not first then - self:Append(',') + self:Append "," end - first = false; + first = false self:ParseString(k) - self:Append(':') - self:Write(v) + self:Append ":" + self:Write(v) end end self:Append(et) end function JsonWriter:WriteError(o) - error(string.format( - "Encoding of %s unsupported", - tostring(o))) + error(string.format("Encoding of %s unsupported", tostring(o))) end function JsonWriter:WriteFunction(o) - if o == Null then + if o == Null then self:WriteNil() else self:WriteError(o) @@ -197,7 +194,7 @@ end local StringReader = { s = "", - i = 0 + i = 0, } function StringReader:New(s) @@ -205,7 +202,7 @@ function StringReader:New(s) setmetatable(o, self) self.__index = self o.s = s or o.s - return o + return o end function StringReader:Peek() @@ -217,7 +214,7 @@ function StringReader:Peek() end function StringReader:Next() - self.i = self.i+1 + self.i = self.i + 1 if self.i <= #self.s then return string.sub(self.s, self.i, self.i) end @@ -230,12 +227,12 @@ end local JsonReader = { escapes = { - ['t'] = '\t', - ['n'] = '\n', - ['f'] = '\f', - ['r'] = '\r', - ['b'] = '\b', - } + ["t"] = "\t", + ["n"] = "\n", + ["f"] = "\f", + ["r"] = "\r", + ["b"] = "\b", + }, } function JsonReader:New(s) @@ -243,78 +240,69 @@ function JsonReader:New(s) o.reader = StringReader:New(s) setmetatable(o, self) self.__index = self - return o; + return o end function JsonReader:Read() self:SkipWhiteSpace() local peek = self:Peek() if peek == nil then - error(string.format( - "Nil string: '%s'", - self:All())) - elseif peek == '{' then + error(string.format("Nil string: '%s'", self:All())) + elseif peek == "{" then return self:ReadObject() - elseif peek == '[' then + elseif peek == "[" then return self:ReadArray() elseif peek == '"' then return self:ReadString() elseif string.find(peek, "[%+%-%d]") then return self:ReadNumber() - elseif peek == 't' then + elseif peek == "t" then return self:ReadTrue() - elseif peek == 'f' then + elseif peek == "f" then return self:ReadFalse() - elseif peek == 'n' then + elseif peek == "n" then return self:ReadNull() - elseif peek == '/' then + elseif peek == "/" then self:ReadComment() return self:Read() else return nil end end - + function JsonReader:ReadTrue() - self:TestReservedWord{'t','r','u','e'} + self:TestReservedWord { "t", "r", "u", "e" } return true end function JsonReader:ReadFalse() - self:TestReservedWord{'f','a','l','s','e'} + self:TestReservedWord { "f", "a", "l", "s", "e" } return false end function JsonReader:ReadNull() - self:TestReservedWord{'n','u','l','l'} + self:TestReservedWord { "n", "u", "l", "l" } return nil end function JsonReader:TestReservedWord(t) for i, v in ipairs(t) do if self:Next() ~= v then - error(string.format( - "Error reading '%s': %s", - table.concat(t), - self:All())) + error(string.format("Error reading '%s': %s", table.concat(t), self:All())) end end end function JsonReader:ReadNumber() - local result = self:Next() - local peek = self:Peek() - while peek ~= nil and string.find( - peek, - "[%+%-%d%.eE]") do - result = result .. self:Next() - peek = self:Peek() + local result = self:Next() + local peek = self:Peek() + while peek ~= nil and string.find(peek, "[%+%-%d%.eE]") do + result = result .. self:Next() + peek = self:Peek() end result = tonumber(result) if result == nil then - error(string.format( - "Invalid number: '%s'", - result)) + error(string.format("Invalid number: '%s'", result)) else return result end @@ -323,53 +311,44 @@ end function JsonReader:ReadString() local result = "" assert(self:Next() == '"') - while self:Peek() ~= '"' do + while self:Peek() ~= '"' do local ch = self:Next() - if ch == '\\' then + if ch == "\\" then ch = self:Next() if self.escapes[ch] then ch = self.escapes[ch] end end - result = result .. ch + result = result .. ch end - assert(self:Next() == '"') + assert(self:Next() == '"') local fromunicode = function(m) return string.char(tonumber(m, 16)) end - return string.gsub( - result, - "u%x%x(%x%x)", - fromunicode) + return string.gsub(result, "u%x%x(%x%x)", fromunicode) end function JsonReader:ReadComment() - assert(self:Next() == '/') - local second = self:Next() - if second == '/' then - self:ReadSingleLineComment() - elseif second == '*' then - self:ReadBlockComment() - else - error(string.format( - "Invalid comment: %s", - self:All())) + assert(self:Next() == "/") + local second = self:Next() + if second == "/" then + self:ReadSingleLineComment() + elseif second == "*" then + self:ReadBlockComment() + else + error(string.format("Invalid comment: %s", self:All())) end end function JsonReader:ReadBlockComment() local done = false while not done do - local ch = self:Next() - if ch == '*' and self:Peek() == '/' then + local ch = self:Next() + if ch == "*" and self:Peek() == "/" then done = true - end - if not done and - ch == '/' and - self:Peek() == "*" then - error(string.format( - "Invalid comment: %s, '/*' illegal.", - self:All())) + end + if not done and ch == "/" and self:Peek() == "*" then + error(string.format("Invalid comment: %s, '/*' illegal.", self:All())) end end self:Next() @@ -377,74 +356,64 @@ end function JsonReader:ReadSingleLineComment() local ch = self:Next() - while ch ~= '\r' and ch ~= '\n' do + while ch ~= "\r" and ch ~= "\n" do ch = self:Next() end end function JsonReader:ReadArray() local result = {} - assert(self:Next() == '[') + assert(self:Next() == "[") local done = false - if self:Peek() == ']' then - done = true; + if self:Peek() == "]" then + done = true end while not done do local item = self:Read() - result[#result+1] = item + result[#result + 1] = item self:SkipWhiteSpace() - if self:Peek() == ']' then + if self:Peek() == "]" then done = true end if not done then local ch = self:Next() - if ch ~= ',' then - error(string.format( - "Invalid array: '%s' due to: '%s'", - self:All(), ch)) + if ch ~= "," then + error(string.format("Invalid array: '%s' due to: '%s'", self:All(), ch)) end end end - assert(']' == self:Next()) + assert("]" == self:Next()) return result end function JsonReader:ReadObject() local result = {} - assert(self:Next() == '{') + assert(self:Next() == "{") local done = false - if self:Peek() == '}' then + if self:Peek() == "}" then done = true end while not done do local key = self:Read() if type(key) ~= "string" then - error(string.format( - "Invalid non-string object key: %s", - key)) + error(string.format("Invalid non-string object key: %s", key)) end self:SkipWhiteSpace() local ch = self:Next() - if ch ~= ':' then - error(string.format( - "Invalid object: '%s' due to: '%s'", - self:All(), - ch)) + if ch ~= ":" then + error(string.format("Invalid object: '%s' due to: '%s'", self:All(), ch)) end self:SkipWhiteSpace() local val = self:Read() result[key] = val self:SkipWhiteSpace() - if self:Peek() == '}' then + if self:Peek() == "}" then done = true end if not done then ch = self:Next() - if ch ~= ',' then - error(string.format( - "Invalid array: '%s' near: '%s'", - self:All(), - ch)) + if ch ~= "," then + error(string.format("Invalid array: '%s' near: '%s'", self:All(), ch)) end end end @@ -455,7 +424,7 @@ end function JsonReader:SkipWhiteSpace() local p = self:Peek() while p ~= nil and string.find(p, "[%s/]") do - if p == '/' then + if p == "/" then self:ReadComment() else self:Next() @@ -492,12 +461,11 @@ function Null() end -------------------- End JSON Parser ------------------------ - t.DecodeJSON = function(jsonString) if type(jsonString) == "string" then return Decode(jsonString) end - print("RbxUtil.DecodeJSON expects string argument!") + print "RbxUtil.DecodeJSON expects string argument!" return nil end @@ -505,13 +473,6 @@ t.EncodeJSON = function(jsonTable) return Encode(jsonTable) end - - - - - - - ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ @@ -523,21 +484,23 @@ end --sets cell x, y, z to default material if parameter is provided, if not sets cell x, y, z to be whatever material it previously w --returns true if made a wedge, false if the cell remains a block t.MakeWedge = function(x, y, z, defaultmaterial) - return game:GetService("Terrain"):AutoWedgeCell(x,y,z) + return game:GetService("Terrain"):AutoWedgeCell(x, y, z) end t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, selectionParent) - local terrain = game.Workspace:FindFirstChild("Terrain") - if not terrain then return end + local terrain = game.Workspace:FindFirstChild "Terrain" + if not terrain then + return + end assert(regionToSelect) assert(color) if not type(regionToSelect) == "Region3" then - error("regionToSelect (first arg), should be of type Region3, but is type",type(regionToSelect)) + error("regionToSelect (first arg), should be of type Region3, but is type", type(regionToSelect)) end if not type(color) == "BrickColor" then - error("color (second arg), should be of type BrickColor, but is type",type(color)) + error("color (second arg), should be of type BrickColor, but is type", type(color)) end -- frequently used terrain calls (speeds up call, no lookup necessary) @@ -547,7 +510,7 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select local emptyMaterial = Enum.CellMaterial.Empty -- container for all adornments, passed back to user - local selectionContainer = Instance.new("Model") + local selectionContainer = Instance.new "Model" selectionContainer.Name = "SelectionContainer" selectionContainer.Archivable = false if selectionParent then @@ -563,29 +526,29 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select local adornments = {} -- contains all adornments local reusableAdorns = {} - local selectionPart = Instance.new("Part") + local selectionPart = Instance.new "Part" selectionPart.Name = "SelectionPart" selectionPart.Transparency = 1 selectionPart.Anchored = true selectionPart.Locked = true selectionPart.CanCollide = false selectionPart.FormFactor = Enum.FormFactor.Custom - selectionPart.Size = Vector3.new(4.2,4.2,4.2) + selectionPart.Size = Vector3.new(4.2, 4.2, 4.2) - local selectionBox = Instance.new("SelectionBox") + local selectionBox = Instance.new "SelectionBox" -- srs translation from region3 to region3int16 function Region3ToRegion3int16(region3) - local theLowVec = region3.CFrame.p - (region3.Size/2) + Vector3.new(2,2,2) - local lowCell = WorldToCellPreferSolid(terrain,theLowVec) + local theLowVec = region3.CFrame.p - (region3.Size / 2) + Vector3.new(2, 2, 2) + local lowCell = WorldToCellPreferSolid(terrain, theLowVec) - local theHighVec = region3.CFrame.p + (region3.Size/2) - Vector3.new(2,2,2) + local theHighVec = region3.CFrame.p + (region3.Size / 2) - Vector3.new(2, 2, 2) local highCell = WorldToCellPreferSolid(terrain, theHighVec) - local highIntVec = Vector3int16.new(highCell.x,highCell.y,highCell.z) - local lowIntVec = Vector3int16.new(lowCell.x,lowCell.y,lowCell.z) + local highIntVec = Vector3int16.new(highCell.x, highCell.y, highCell.z) + local lowIntVec = Vector3int16.new(lowCell.x, lowCell.y, lowCell.z) - return Region3int16.new(lowIntVec,highIntVec) + return Region3int16.new(lowIntVec, highIntVec) end -- helper function that creates the basis for a selection box @@ -596,7 +559,7 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select if #reusableAdorns > 0 then selectionPartClone = reusableAdorns[1]["part"] selectionBoxClone = reusableAdorns[1]["box"] - table.remove(reusableAdorns,1) + table.remove(reusableAdorns, 1) selectionBoxClone.Visible = true else @@ -613,7 +576,7 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select selectionBoxClone.Parent = selectionContainer end - + if theColor then selectionBoxClone.Color = theColor end @@ -624,10 +587,9 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select -- iterates through all current adornments and deletes any that don't have latest tag function cleanUpAdornments() for cellPos, adornTable in pairs(adornments) do - if adornTable.KeepAlive ~= currentKeepAliveTag then -- old news, we should get rid of this adornTable.SelectionBox.Visible = false - table.insert(reusableAdorns,{part = adornTable.SelectionPart, box = adornTable.SelectionBox}) + table.insert(reusableAdorns, { part = adornTable.SelectionPart, box = adornTable.SelectionBox }) adornments[cellPos] = nil end end @@ -644,8 +606,8 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select -- finds full cells in region and adorns each cell with a box, with the argument color function adornFullCellsInRegion(region, color) - local regionBegin = region.CFrame.p - (region.Size/2) + Vector3.new(2,2,2) - local regionEnd = region.CFrame.p + (region.Size/2) - Vector3.new(2,2,2) + local regionBegin = region.CFrame.p - (region.Size / 2) + Vector3.new(2, 2, 2) + local regionEnd = region.CFrame.p + (region.Size / 2) - Vector3.new(2, 2, 2) local cellPosBegin = WorldToCellPreferSolid(terrain, regionBegin) local cellPosEnd = WorldToCellPreferSolid(terrain, regionEnd) @@ -655,10 +617,10 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select for z = cellPosBegin.z, cellPosEnd.z do for x = cellPosBegin.x, cellPosEnd.x do local cellMaterial = GetCell(terrain, x, y, z) - + if cellMaterial ~= emptyMaterial then local cframePos = CellCenterToWorld(terrain, x, y, z) - local cellPos = Vector3int16.new(x,y,z) + local cellPos = Vector3int16.new(x, y, z) local updated = false for cellPosAdorn, adornTable in pairs(adornments) do @@ -669,14 +631,18 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select end updated = true break - end + end end if not updated then local selectionPart, selectionBox = createAdornment(color) - selectionPart.Size = Vector3.new(4,4,4) + selectionPart.Size = Vector3.new(4, 4, 4) selectionPart.CFrame = CFrame.new(cframePos) - local adornTable = {SelectionPart = selectionPart, SelectionBox = selectionBox, KeepAlive = currentKeepAliveTag} + local adornTable = { + SelectionPart = selectionPart, + SelectionBox = selectionBox, + KeepAlive = currentKeepAliveTag, + } adornments[cellPos] = adornTable end end @@ -686,7 +652,6 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select cleanUpAdornments() end - ------------------------------------- setup code ------------------------------ lastRegion = regionToSelect @@ -699,32 +664,31 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select adornments.SelectionPart = selectionPart adornments.SelectionBox = selectionBox - updateSelection = - function (newRegion, color) - if newRegion and newRegion ~= lastRegion then - lastRegion = newRegion - selectionPart.Size = newRegion.Size - selectionPart.CFrame = newRegion.CFrame - end - if color then - selectionBox.Color = color - end + updateSelection = function(newRegion, color) + if newRegion and newRegion ~= lastRegion then + lastRegion = newRegion + selectionPart.Size = newRegion.Size + selectionPart.CFrame = newRegion.CFrame end + if color then + selectionBox.Color = color + end + end else -- use individual cell adorns to represent the area selected adornFullCellsInRegion(regionToSelect, color) - updateSelection = - function (newRegion, color) - if newRegion and newRegion ~= lastRegion then - lastRegion = newRegion - adornFullCellsInRegion(newRegion, color) - end + updateSelection = function(newRegion, color) + if newRegion and newRegion ~= lastRegion then + lastRegion = newRegion + adornFullCellsInRegion(newRegion, color) end - + end end local destroyFunc = function() updateSelection = nil - if selectionContainer then selectionContainer:Destroy() end + if selectionContainer then + selectionContainer:Destroy() + end adornments = nil end @@ -733,12 +697,6 @@ end -----------------------------Terrain Utilities End----------------------------- - - - - - - ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ @@ -777,14 +735,16 @@ Method :wait() function t.CreateSignal() local this = {} - local mBindableEvent = Instance.new('BindableEvent') + local mBindableEvent = Instance.new "BindableEvent" local mAllCns = {} --all connection objects returned by mBindableEvent::connect --main functions function this:connect(func) - if self ~= this then error("connect must be called with `:`, not `.`", 2) end - if type(func) ~= 'function' then - error("Argument #1 of connect must be a function, got a "..type(func), 2) + if self ~= this then + error("connect must be called with `:`, not `.`", 2) + end + if type(func) ~= "function" then + error("Argument #1 of connect must be a function, got a " .. type(func), 2) end local cn = mBindableEvent.Event:connect(func) mAllCns[cn] = true @@ -796,18 +756,24 @@ function t.CreateSignal() return pubCn end function this:disconnect() - if self ~= this then error("disconnect must be called with `:`, not `.`", 2) end + if self ~= this then + error("disconnect must be called with `:`, not `.`", 2) + end for cn, _ in pairs(mAllCns) do cn:disconnect() mAllCns[cn] = nil end end function this:wait() - if self ~= this then error("wait must be called with `:`, not `.`", 2) end + if self ~= this then + error("wait must be called with `:`, not `.`", 2) + end return mBindableEvent.Event:wait() end function this:fire(...) - if self ~= this then error("fire must be called with `:`, not `.`", 2) end + if self ~= this then + error("fire must be called with `:`, not `.`", 2) + end mBindableEvent:Fire(...) end @@ -816,9 +782,6 @@ end ------------------------------------------------- Sigal class End ------------------------------------------------------ - - - ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ @@ -913,7 +876,7 @@ Note: It is also perfectly legal to save a reference to the function returned by --the Create function need to be created as a functor, not a function, in order to support the Create.E syntax, so it --will be created in several steps rather than as a single function declaration. local function Create_PrivImpl(objectType) - if type(objectType) ~= 'string' then + if type(objectType) ~= "string" then error("Argument of Create must be a string", 2) end --return the proxy function that gives us the nice Create'string'{data} syntax @@ -932,41 +895,44 @@ local function Create_PrivImpl(objectType) for k, v in pairs(dat) do --add property - if type(k) == 'string' then + if type(k) == "string" then obj[k] = v - --add child - elseif type(k) == 'number' then - if type(v) ~= 'userdata' then - error("Bad entry in Create body: Numeric keys must be paired with children, got a: "..type(v), 2) + elseif type(k) == "number" then + if type(v) ~= "userdata" then + error("Bad entry in Create body: Numeric keys must be paired with children, got a: " .. type(v), 2) end v.Parent = obj - --event connect - elseif type(k) == 'table' and k.__eventname then - if type(v) ~= 'function' then - error("Bad entry in Create body: Key `[Create.E\'"..k.__eventname.."\']` must have a function value\ - got: "..tostring(v), 2) + elseif type(k) == "table" and k.__eventname then + if type(v) ~= "function" then + error( + "Bad entry in Create body: Key `[Create.E'" + .. k.__eventname + .. "']` must have a function value, got: " + .. tostring(v), + 2 + ) end obj[k.__eventname]:connect(v) - --define constructor function elseif k == t.Create then - if type(v) ~= 'function' then - error("Bad entry in Create body: Key `[Create]` should be paired with a constructor function, \ - got: "..tostring(v), 2) + if type(v) ~= "function" then + error( + "Bad entry in Create body: Key `[Create]` should be paired with a constructor function, got: " + .. tostring(v), + 2 + ) elseif ctor then --ctor already exists, only one allowed error("Bad entry in Create body: Only one constructor function is allowed", 2) end ctor = v - - else - error("Bad entry ("..tostring(k).." => "..tostring(v)..") in Create body", 2) + error("Bad entry (" .. tostring(k) .. " => " .. tostring(v) .. ") in Create body", 2) end end @@ -981,19 +947,20 @@ local function Create_PrivImpl(objectType) end --now, create the functor: -t.Create = setmetatable({}, {__call = function(tb, ...) return Create_PrivImpl(...) end}) +t.Create = setmetatable({}, { + __call = function(_, ...) + return Create_PrivImpl(...) + end, +}) --and create the "Event.E" syntax stub. Really it's just a stub to construct a table which our Create --function can recognize as special. t.Create.E = function(eventName) - return {__eventname = eventName} + return { __eventname = eventName } end -------------------------------------------------Create function End---------------------------------------------------- - - - ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ @@ -1002,114 +969,87 @@ end ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ -t.Help = - function(funcNameOrFunc) - --input argument can be a string or a function. Should return a description (of arguments and expected side effects) - if funcNameOrFunc == "DecodeJSON" or funcNameOrFunc == t.DecodeJSON then - return "Function DecodeJSON. " .. - "Arguments: (string). " .. - "Side effect: returns a table with all parsed JSON values" - end - if funcNameOrFunc == "EncodeJSON" or funcNameOrFunc == t.EncodeJSON then - return "Function EncodeJSON. " .. - "Arguments: (table). " .. - "Side effect: returns a string composed of argument table in JSON data format" - end - if funcNameOrFunc == "MakeWedge" or funcNameOrFunc == t.MakeWedge then - return "Function MakeWedge. " .. - "Arguments: (x, y, z, [default material]). " .. - "Description: Makes a wedge at location x, y, z. Sets cell x, y, z to default material if ".. - "parameter is provided, if not sets cell x, y, z to be whatever material it previously was. ".. - "Returns true if made a wedge, false if the cell remains a block " - end - if funcNameOrFunc == "SelectTerrainRegion" or funcNameOrFunc == t.SelectTerrainRegion then - return "Function SelectTerrainRegion. " .. - "Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). " .. - "Description: Selects all terrain via a series of selection boxes within the regionToSelect " .. - "(this should be a region3 value). The selection box color is detemined by the color argument " .. - "(should be a brickcolor value). SelectionParent is the parent that the selection model gets placed to (optional)." .. - "SelectEmptyCells is bool, when true will select all cells in the " .. - "region, otherwise we only select non-empty cells. Returns a function that can update the selection," .. - "arguments to said function are a new region3 to select, and the adornment color (color arg is optional). " .. - "Also returns a second function that takes no arguments and destroys the selection" - end - if funcNameOrFunc == "CreateSignal" or funcNameOrFunc == t.CreateSignal then - return "Function CreateSignal. ".. - "Arguments: None. ".. - "Returns: The newly created Signal object. This object is identical to the RBXScriptSignal class ".. - "used for events in Objects, but is a Lua-side object so it can be used to create custom events in".. - "Lua code. ".. - "Methods of the Signal object: :connect, :wait, :fire, :disconnect. ".. - "For more info you can pass the method name to the Help function, or view the wiki page ".. - "for this library. EG: Help('Signal:connect')." - end - if funcNameOrFunc == "Signal:connect" then - return "Method Signal:connect. ".. - "Arguments: (function handler). ".. - "Return: A connection object which can be used to disconnect the connection to this handler. ".. - "Description: Connectes a handler function to this Signal, so that when |fire| is called the ".. - "handler function will be called with the arguments passed to |fire|." - end - if funcNameOrFunc == "Signal:wait" then - return "Method Signal:wait. ".. - "Arguments: None. ".. - "Returns: The arguments passed to the next call to |fire|. ".. - "Description: This call does not return until the next call to |fire| is made, at which point it ".. - "will return the values which were passed as arguments to that |fire| call." - end - if funcNameOrFunc == "Signal:fire" then - return "Method Signal:fire. ".. - "Arguments: Any number of arguments of any type. ".. - "Returns: None. ".. - "Description: This call will invoke any connected handler functions, and notify any waiting code ".. - "attached to this Signal to continue, with the arguments passed to this function. Note: The calls ".. - "to handlers are made asynchronously, so this call will return immediately regardless of how long ".. - "it takes the connected handler functions to complete." - end - if funcNameOrFunc == "Signal:disconnect" then - return "Method Signal:disconnect. ".. - "Arguments: None. ".. - "Returns: None. ".. - "Description: This call disconnects all handlers attacched to this function, note however, it ".. - "does NOT make waiting code continue, as is the behavior of normal Roblox events. This method ".. - "can also be called on the connection object which is returned from Signal:connect to only ".. - "disconnect a single handler, as opposed to this method, which will disconnect all handlers." - end - if funcNameOrFunc == "Create" then - return "Function Create. ".. - "Arguments: A table containing information about how to construct a collection of objects. ".. - "Returns: The constructed objects. ".. - "Descrition: Create is a very powerfull function, whose description is too long to fit here, and ".. - "is best described via example, please see the wiki page for a description of how to use it." - end +t.Help = function(funcNameOrFunc) + --input argument can be a string or a function. Should return a description (of arguments and expected side effects) + if funcNameOrFunc == "DecodeJSON" or funcNameOrFunc == t.DecodeJSON then + return "Function DecodeJSON. " + .. "Arguments: (string). " + .. "Side effect: returns a table with all parsed JSON values" end - + if funcNameOrFunc == "EncodeJSON" or funcNameOrFunc == t.EncodeJSON then + return "Function EncodeJSON. " + .. "Arguments: (table). " + .. "Side effect: returns a string composed of argument table in JSON data format" + end + if funcNameOrFunc == "MakeWedge" or funcNameOrFunc == t.MakeWedge then + return "Function MakeWedge. " + .. "Arguments: (x, y, z, [default material]). " + .. "Description: Makes a wedge at location x, y, z. Sets cell x, y, z to default material if " + .. "parameter is provided, if not sets cell x, y, z to be whatever material it previously was. " + .. "Returns true if made a wedge, false if the cell remains a block " + end + if funcNameOrFunc == "SelectTerrainRegion" or funcNameOrFunc == t.SelectTerrainRegion then + return "Function SelectTerrainRegion. " + .. "Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). " + .. "Description: Selects all terrain via a series of selection boxes within the regionToSelect " + .. "(this should be a region3 value). The selection box color is detemined by the color argument " + .. "(should be a brickcolor value). SelectionParent is the parent that the selection model gets placed to (optional)." + .. "SelectEmptyCells is bool, when true will select all cells in the " + .. "region, otherwise we only select non-empty cells. Returns a function that can update the selection," + .. "arguments to said function are a new region3 to select, and the adornment color (color arg is optional). " + .. "Also returns a second function that takes no arguments and destroys the selection" + end + if funcNameOrFunc == "CreateSignal" or funcNameOrFunc == t.CreateSignal then + return "Function CreateSignal. " + .. "Arguments: None. " + .. "Returns: The newly created Signal object. This object is identical to the RBXScriptSignal class " + .. "used for events in Objects, but is a Lua-side object so it can be used to create custom events in" + .. "Lua code. " + .. "Methods of the Signal object: :connect, :wait, :fire, :disconnect. " + .. "For more info you can pass the method name to the Help function, or view the wiki page " + .. "for this library. EG: Help('Signal:connect')." + end + if funcNameOrFunc == "Signal:connect" then + return "Method Signal:connect. " + .. "Arguments: (function handler). " + .. "Return: A connection object which can be used to disconnect the connection to this handler. " + .. "Description: Connectes a handler function to this Signal, so that when |fire| is called the " + .. "handler function will be called with the arguments passed to |fire|." + end + if funcNameOrFunc == "Signal:wait" then + return "Method Signal:wait. " + .. "Arguments: None. " + .. "Returns: The arguments passed to the next call to |fire|. " + .. "Description: This call does not return until the next call to |fire| is made, at which point it " + .. "will return the values which were passed as arguments to that |fire| call." + end + if funcNameOrFunc == "Signal:fire" then + return "Method Signal:fire. " + .. "Arguments: Any number of arguments of any type. " + .. "Returns: None. " + .. "Description: This call will invoke any connected handler functions, and notify any waiting code " + .. "attached to this Signal to continue, with the arguments passed to this function. Note: The calls " + .. "to handlers are made asynchronously, so this call will return immediately regardless of how long " + .. "it takes the connected handler functions to complete." + end + if funcNameOrFunc == "Signal:disconnect" then + return "Method Signal:disconnect. " + .. "Arguments: None. " + .. "Returns: None. " + .. "Description: This call disconnects all handlers attacched to this function, note however, it " + .. "does NOT make waiting code continue, as is the behavior of normal Roblox events. This method " + .. "can also be called on the connection object which is returned from Signal:connect to only " + .. "disconnect a single handler, as opposed to this method, which will disconnect all handlers." + end + if funcNameOrFunc == "Create" then + return "Function Create. " + .. "Arguments: A table containing information about how to construct a collection of objects. " + .. "Returns: The constructed objects. " + .. "Descrition: Create is a very powerfull function, whose description is too long to fit here, and " + .. "is best described via example, please see the wiki page for a description of how to use it." + end +end + --------------------------------------------Documentation Ends---------------------------------------------------------- return t - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/60595695.lua b/60595695.lua index dbec354..a151712 100644 --- a/60595695.lua +++ b/60595695.lua @@ -3,15 +3,15 @@ -- access to all of the libraries (otherwise only local scripts do) local deepakTestingPlace = 3569749 -local sc = game:GetService("ScriptContext") +local sc = game:GetService "ScriptContext" local tries = 0 - + while not sc and tries < 3 do tries = tries + 1 - sc = game:GetService("ScriptContext") + sc = game:GetService "ScriptContext" wait(0.2) end - + if sc then sc:RegisterLibrary("Libraries/RbxGui", "45284430") sc:RegisterLibrary("Libraries/RbxGear", "45374389") @@ -22,5 +22,5 @@ if sc then sc:RegisterLibrary("Libraries/RbxStamper", "73157242") sc:LibraryRegistrationComplete() else - print("failed to find script context, libraries did not load") + print "failed to find script context, libraries did not load" end diff --git a/73157242.lua b/73157242.lua index 6f614d3..201256e 100644 --- a/73157242.lua +++ b/73157242.lua @@ -9,22 +9,23 @@ end -- Do a line/plane intersection. The line starts at the camera. The plane is at y == 0, normal(0, 1, 0) -- -- vectorPos - End point of the line. --- +-- -- Return: -- cellPos - The terrain cell intersection point if there is one, vectorPos if there isn't. -- hit - Whether there was a plane intersection. Value is true if there was, false if not. function PlaneIntersection(vectorPos) local hit = false local currCamera = game.Workspace.CurrentCamera - local startPos = Vector3.new(currCamera.CoordinateFrame.p.X, currCamera.CoordinateFrame.p.Y, currCamera.CoordinateFrame.p.Z) + local startPos = + Vector3.new(currCamera.CoordinateFrame.p.X, currCamera.CoordinateFrame.p.Y, currCamera.CoordinateFrame.p.Z) local endPos = Vector3.new(vectorPos.X, vectorPos.Y, vectorPos.Z) local normal = Vector3.new(0, 1, 0) local p3 = Vector3.new(0, 0, 0) local startEndDot = normal:Dot(endPos - startPos) local cellPos = vectorPos - if startEndDot ~= 0 then + if startEndDot ~= 0 then local t = normal:Dot(p3 - startPos) / startEndDot - if(t >=0 and t <=1) then + if t >= 0 and t <= 1 then local intersection = ((endPos - startPos) * t) + startPos cellPos = game.Workspace.Terrain:WorldToCell(intersection) hit = true @@ -34,7 +35,6 @@ function PlaneIntersection(vectorPos) return cellPos, hit end - -- Purpose: -- Checks for terrain touched by the mouse hit. -- Will do a plane intersection if no terrain is touched. @@ -60,18 +60,20 @@ function GetTerrainForMouse(mouse) end -- setup helper functions -local insertBoundingBoxOverlapVector = Vector3.new(.3, .3, .3) -- we can still stamp if our character extrudes into the target stamping space by .3 or fewer units +local insertBoundingBoxOverlapVector = Vector3.new(0.3, 0.3, 0.3) -- we can still stamp if our character extrudes into the target stamping space by .3 or fewer units -- rotates a model by yAngle radians about the global y-axis local function rotatePartAndChildren(part, rotCF, offsetFromOrigin) -- rotate this thing, if it's a part - if part:IsA("BasePart") then + if part:IsA "BasePart" then part.CFrame = (rotCF * (part.CFrame - offsetFromOrigin)) + offsetFromOrigin end -- recursively do the same to all children local partChildren = part:GetChildren() - for c = 1, #partChildren do rotatePartAndChildren(partChildren[c], rotCF, offsetFromOrigin) end + for c = 1, #partChildren do + rotatePartAndChildren(partChildren[c], rotCF, offsetFromOrigin) + end end local function modelRotate(model, yAngle) @@ -81,23 +83,22 @@ local function modelRotate(model, yAngle) rotatePartAndChildren(model, rotCF, offsetFromOrigin) end - local function collectParts(object, baseParts, scripts, decals) - if object:IsA("BasePart") then - baseParts[#baseParts+1] = object - elseif object:IsA("Script") then - scripts[#scripts+1] = object - elseif object:IsA("Decal") then - decals[#decals+1] = object + if object:IsA "BasePart" then + baseParts[#baseParts + 1] = object + elseif object:IsA "Script" then + scripts[#scripts + 1] = object + elseif object:IsA "Decal" then + decals[#decals + 1] = object end - for index,child in pairs(object:GetChildren()) do + for index, child in pairs(object:GetChildren()) do collectParts(child, baseParts, scripts, decals) end end local function clusterPartsInRegion(startVector, endVector) - local cluster = game.Workspace:FindFirstChild("Terrain") + local cluster = game.Workspace:FindFirstChild "Terrain" local startCell = cluster:WorldToCell(startVector) local endCell = cluster:WorldToCell(endVector) @@ -110,18 +111,32 @@ local function clusterPartsInRegion(startVector, endVector) local endY = endCell.Y local endZ = endCell.Z - if startX < cluster.MaxExtents.Min.X then startX = cluster.MaxExtents.Min.X end - if startY < cluster.MaxExtents.Min.Y then startY = cluster.MaxExtents.Min.Y end - if startZ < cluster.MaxExtents.Min.Z then startZ = cluster.MaxExtents.Min.Z end + if startX < cluster.MaxExtents.Min.X then + startX = cluster.MaxExtents.Min.X + end + if startY < cluster.MaxExtents.Min.Y then + startY = cluster.MaxExtents.Min.Y + end + if startZ < cluster.MaxExtents.Min.Z then + startZ = cluster.MaxExtents.Min.Z + end - if endX > cluster.MaxExtents.Max.X then endX = cluster.MaxExtents.Max.X end - if endY > cluster.MaxExtents.Max.Y then endY = cluster.MaxExtents.Max.Y end - if endZ > cluster.MaxExtents.Max.Z then endZ = cluster.MaxExtents.Max.Z end + if endX > cluster.MaxExtents.Max.X then + endX = cluster.MaxExtents.Max.X + end + if endY > cluster.MaxExtents.Max.Y then + endY = cluster.MaxExtents.Max.Y + end + if endZ > cluster.MaxExtents.Max.Z then + endZ = cluster.MaxExtents.Max.Z + end for x = startX, endX do for y = startY, endY do for z = startZ, endZ do - if (cluster:GetCell(x, y, z).Value) > 0 then return true end + if cluster:GetCell(x, y, z).Value > 0 then + return true + end end end end @@ -130,7 +145,9 @@ local function clusterPartsInRegion(startVector, endVector) end local function findSeatsInModel(parent, seatTable) - if not parent then return end + if not parent then + return + end if parent.className == "Seat" or parent.className == "VehicleSeat" then table.insert(seatTable, parent) @@ -148,14 +165,17 @@ local function setSeatEnabledStatus(model, isEnabled) if isEnabled then -- remove any welds called "SeatWeld" in seats for i = 1, #seatList do - local nextSeat = seatList[i]:FindFirstChild("SeatWeld") - while nextSeat do nextSeat:Remove() nextSeat = seatList[i]:FindFirstChild("SeatWeld") end + local nextSeat = seatList[i]:FindFirstChild "SeatWeld" + while nextSeat do + nextSeat:Remove() + nextSeat = seatList[i]:FindFirstChild "SeatWeld" + end end else -- put a weld called "SeatWeld" in every seat -- this tricks it into thinking there's already someone sitting there, and it won't make you sit XD for i = 1, #seatList do - local fakeWeld = Instance.new("Weld") + local fakeWeld = Instance.new "Weld" fakeWeld.Name = "SeatWeld" fakeWeld.Parent = seatList[i] end @@ -163,14 +183,18 @@ local function setSeatEnabledStatus(model, isEnabled) end local function autoAlignToFace(parts) - local aatf = parts:FindFirstChild("AutoAlignToFace") - if aatf then return aatf.Value else return false end + local aatf = parts:FindFirstChild "AutoAlignToFace" + if aatf then + return aatf.Value + else + return false + end end local function getClosestAlignedWorldDirection(aVector3InWorld) - local xDir = Vector3.new(1,0,0) - local yDir = Vector3.new(0,1,0) - local zDir = Vector3.new(0,0,1) + local xDir = Vector3.new(1, 0, 0) + local yDir = Vector3.new(0, 1, 0) + local zDir = Vector3.new(0, 0, 1) local xDot = aVector3InWorld.x * xDir.x + aVector3InWorld.y * xDir.y + aVector3InWorld.z * xDir.z local yDot = aVector3InWorld.x * yDir.x + aVector3InWorld.y * yDir.y + aVector3InWorld.z * yDir.z local zDot = aVector3InWorld.x * zDir.x + aVector3InWorld.y * zDir.y + aVector3InWorld.z * zDir.z @@ -193,13 +217,15 @@ local function getClosestAlignedWorldDirection(aVector3InWorld) else return 5 end - end + end end local function positionPartsAtCFrame3(aCFrame, currentParts) local insertCFrame = nil - if not currentParts then return currentParts end - if currentParts and (currentParts:IsA("Model") or currentParts:IsA("Tool")) then + if not currentParts then + return currentParts + end + if currentParts and (currentParts:IsA "Model" or currentParts:IsA "Tool") then insertCFrame = currentParts:GetModelCFrame() currentParts:TranslateBy(aCFrame.p - insertCFrame.p) else @@ -209,7 +235,9 @@ local function positionPartsAtCFrame3(aCFrame, currentParts) end local function calcRayHitTime(rayStart, raySlope, intersectionPlane) - if math.abs(raySlope) < .01 then return 0 end -- 0 slope --> we just say intersection time is 0, and sidestep this dimension + if math.abs(raySlope) < 0.01 then + return 0 + end -- 0 slope --> we just say intersection time is 0, and sidestep this dimension return (intersectionPlane - rayStart) / raySlope end @@ -220,7 +248,7 @@ local function modelTargetSurface(partOrModel, rayStart, rayEnd) local modelCFrame = nil local modelSize = nil - if partOrModel:IsA("Model") then + if partOrModel:IsA "Model" then modelCFrame = partOrModel:GetModelCFrame() modelSize = partOrModel:GetModelSize() else @@ -235,14 +263,20 @@ local function modelTargetSurface(partOrModel, rayStart, rayEnd) local xPositive = 1 local yPositive = 1 local zPositive = 1 - if mouseSlope.X > 0 then xPositive = -1 end - if mouseSlope.Y > 0 then yPositive = -1 end - if mouseSlope.Z > 0 then zPositive = -1 end + if mouseSlope.X > 0 then + xPositive = -1 + end + if mouseSlope.Y > 0 then + yPositive = -1 + end + if mouseSlope.Z > 0 then + zPositive = -1 + end -- find which surface the transformed mouse ray hits (using modelSize): - local xHitTime = calcRayHitTime(mouseRayStart.X, mouseSlope.X, modelSize.X/2 * xPositive) - local yHitTime = calcRayHitTime(mouseRayStart.Y, mouseSlope.Y, modelSize.Y/2 * yPositive) - local zHitTime = calcRayHitTime(mouseRayStart.Z, mouseSlope.Z, modelSize.Z/2 * zPositive) + local xHitTime = calcRayHitTime(mouseRayStart.X, mouseSlope.X, modelSize.X / 2 * xPositive) + local yHitTime = calcRayHitTime(mouseRayStart.Y, mouseSlope.Y, modelSize.Y / 2 * yPositive) + local zHitTime = calcRayHitTime(mouseRayStart.Z, mouseSlope.Z, modelSize.Z / 2 * zPositive) local hitFace = 0 @@ -250,18 +284,18 @@ local function modelTargetSurface(partOrModel, rayStart, rayEnd) if xHitTime > yHitTime then if xHitTime > zHitTime then -- xFace is hit - hitFace = 1*xPositive + hitFace = 1 * xPositive else -- zFace is hit - hitFace = 3*zPositive + hitFace = 3 * zPositive end else if yHitTime > zHitTime then -- yFace is hit - hitFace = 2*yPositive + hitFace = 2 * yPositive else -- zFace is hit - hitFace = 3*zPositive + hitFace = 3 * zPositive end end @@ -269,31 +303,31 @@ local function modelTargetSurface(partOrModel, rayStart, rayEnd) end local function getBoundingBox2(partOrModel) - -- for models, the bounding box is defined as the minimum and maximum individual part bounding boxes -- relative to the first part's coordinate frame. local minVec = Vector3.new(math.huge, math.huge, math.huge) local maxVec = Vector3.new(-math.huge, -math.huge, -math.huge) - if partOrModel:IsA("Terrain") then + if partOrModel:IsA "Terrain" then minVec = Vector3.new(-2, -2, -2) maxVec = Vector3.new(2, 2, 2) - elseif partOrModel:IsA("BasePart") then + elseif partOrModel:IsA "BasePart" then minVec = -0.5 * partOrModel.Size maxVec = -minVec else - maxVec = partOrModel:GetModelSize()*0.5 + maxVec = partOrModel:GetModelSize() * 0.5 minVec = -maxVec end -- Adjust bounding box to reflect what the model or part author wants in terms of justification - local justifyValue = partOrModel:FindFirstChild("Justification") + local justifyValue = partOrModel:FindFirstChild "Justification" if justifyValue ~= nil then -- find the multiple of 4 that contains the model justify = justifyValue.Value two = Vector3.new(2, 2, 2) actualBox = maxVec - minVec - Vector3.new(0.01, 0.01, 0.01) - containingGridBox = Vector3.new(4 * math.ceil(actualBox.x/4), 4 * math.ceil(actualBox.y/4), 4 * math.ceil(actualBox.z/4)) + containingGridBox = + Vector3.new(4 * math.ceil(actualBox.x / 4), 4 * math.ceil(actualBox.y / 4), 4 * math.ceil(actualBox.z / 4)) adjustment = containingGridBox - actualBox minVec = minVec - 0.5 * adjustment * justify maxVec = maxVec + 0.5 * adjustment * (two - justify) @@ -306,12 +340,12 @@ local function getBoundingBoxInWorldCoordinates(partOrModel) local minVec = Vector3.new(math.huge, math.huge, math.huge) local maxVec = Vector3.new(-math.huge, -math.huge, -math.huge) - if partOrModel:IsA("BasePart") and not partOrModel:IsA("Terrain") then + if partOrModel:IsA "BasePart" and not partOrModel:IsA "Terrain" then vec1 = partOrModel.CFrame:pointToWorldSpace(-0.5 * partOrModel.Size) vec2 = partOrModel.CFrame:pointToWorldSpace(0.5 * partOrModel.Size) minVec = Vector3.new(math.min(vec1.X, vec2.X), math.min(vec1.Y, vec2.Y), math.min(vec1.Z, vec2.Z)) maxVec = Vector3.new(math.max(vec1.X, vec2.X), math.max(vec1.Y, vec2.Y), math.max(vec1.Z, vec2.Z)) - elseif partOrModel:IsA("Terrain") then + elseif partOrModel:IsA "Terrain" then -- we shouldn't have to deal with this case --minVec = Vector3.new(-2, -2, -2) --maxVec = Vector3.new(2, 2, 2) @@ -326,7 +360,7 @@ local function getBoundingBoxInWorldCoordinates(partOrModel) end local function getTargetPartBoundingBox(targetPart) - if targetPart.Parent:FindFirstChild("RobloxModel") ~= nil then + if targetPart.Parent:FindFirstChild "RobloxModel" ~= nil then return getBoundingBox2(targetPart.Parent) else return getBoundingBox2(targetPart) @@ -334,21 +368,36 @@ local function getTargetPartBoundingBox(targetPart) end local function getMouseTargetCFrame(targetPart) - if targetPart.Parent:FindFirstChild("RobloxModel") ~= nil then - if targetPart.Parent:IsA("Tool") then return targetPart.Parent.Handle.CFrame - else return targetPart.Parent:GetModelCFrame() end + if targetPart.Parent:FindFirstChild "RobloxModel" ~= nil then + if targetPart.Parent:IsA "Tool" then + return targetPart.Parent.Handle.CFrame + else + return targetPart.Parent:GetModelCFrame() + end else return targetPart.CFrame end end local function isBlocker(part) -- returns whether or not we want to cancel the stamp because we're blocked by this part - if not part then return false end - if not part.Parent then return false end - if part:FindFirstChild("Humanoid") then return false end - if part:FindFirstChild("RobloxStamper") or part:FindFirstChild("RobloxModel") then return true end - if part:IsA("Part") and not part.CanCollide then return false end - if part == game.Lighting then return false end + if not part then + return false + end + if not part.Parent then + return false + end + if part:FindFirstChild "Humanoid" then + return false + end + if part:FindFirstChild "RobloxStamper" or part:FindFirstChild "RobloxModel" then + return true + end + if part:IsA "Part" and not part.CanCollide then + return false + end + if part == game.Lighting then + return false + end return isBlocker(part.Parent) end @@ -356,24 +405,32 @@ end -- character is 5 studs tall, we'll check a 1.5 x 1.5 x 4.5 box around char, with center .5 studs below torsocenter local function spaceAboveCharacter(charTorso, newTorsoY, stampData) local partsAboveChar = game.Workspace:FindPartsInRegion3( - Region3.new(Vector3.new(charTorso.Position.X, newTorsoY, charTorso.Position.Z) - Vector3.new(.75, 2.75, .75), - Vector3.new(charTorso.Position.X, newTorsoY, charTorso.Position.Z) + Vector3.new(.75, 1.75, .75)), - charTorso.Parent, - 100) - + Region3.new( + Vector3.new(charTorso.Position.X, newTorsoY, charTorso.Position.Z) - Vector3.new(0.75, 2.75, 0.75), + Vector3.new(charTorso.Position.X, newTorsoY, charTorso.Position.Z) + Vector3.new(0.75, 1.75, 0.75) + ), + charTorso.Parent, + 100 + ) + for j = 1, #partsAboveChar do - if partsAboveChar[j].CanCollide and not partsAboveChar[j]:IsDescendantOf(stampData.CurrentParts) then return false end + if partsAboveChar[j].CanCollide and not partsAboveChar[j]:IsDescendantOf(stampData.CurrentParts) then + return false + end end - if clusterPartsInRegion(Vector3.new(charTorso.Position.X, newTorsoY, charTorso.Position.Z) - Vector3.new(.75, 2.75, .75), - Vector3.new(charTorso.Position.X, newTorsoY, charTorso.Position.Z) + Vector3.new(.75, 1.75, .75)) then - return false + if + clusterPartsInRegion( + Vector3.new(charTorso.Position.X, newTorsoY, charTorso.Position.Z) - Vector3.new(0.75, 2.75, 0.75), + Vector3.new(charTorso.Position.X, newTorsoY, charTorso.Position.Z) + Vector3.new(0.75, 1.75, 0.75) + ) + then + return false end return true end - local function findConfigAtMouseTarget(Mouse, stampData) -- *Critical Assumption* : -- This function assumes the target CF axes are orthogonal with the target bounding box faces @@ -381,26 +438,33 @@ local function findConfigAtMouseTarget(Mouse, stampData) -- Therefore, insertion will not work with angled faces on wedges or other "non-block" parts, nor -- will it work for parts in a model that are not orthogonally aligned with the model's CF. - if not Mouse then return nil end -- This can happen sometimes, return if so - if not stampData then error("findConfigAtMouseTarget: stampData is nil") return nil end - if not stampData["CurrentParts"] then return nil end + if not Mouse then + return nil + end -- This can happen sometimes, return if so + if not stampData then + error "findConfigAtMouseTarget: stampData is nil" + return nil + end + if not stampData["CurrentParts"] then + return nil + end local grid = 4.0 local admissibleConfig = false - local targetConfig = CFrame.new(0,0,0) + local targetConfig = CFrame.new(0, 0, 0) local minBB, maxBB = getBoundingBox2(stampData.CurrentParts) local diagBB = maxBB - minBB local insertCFrame - if stampData.CurrentParts:IsA("Model") or stampData.CurrentParts:IsA("Tool") then + if stampData.CurrentParts:IsA "Model" or stampData.CurrentParts:IsA "Tool" then insertCFrame = stampData.CurrentParts:GetModelCFrame() else insertCFrame = stampData.CurrentParts.CFrame end if Mouse then - if stampData.CurrentParts:IsA("Tool") then + if stampData.CurrentParts:IsA "Tool" then Mouse.TargetFilter = stampData.CurrentParts.Handle else Mouse.TargetFilter = stampData.CurrentParts @@ -409,19 +473,21 @@ local function findConfigAtMouseTarget(Mouse, stampData) local hitPlane = false local targetPart = nil - local success = pcall(function() targetPart = Mouse.Target end) + local success = pcall(function() + targetPart = Mouse.Target + end) - if not success then-- or targetPart == nil then + if not success then -- or targetPart == nil then return admissibleConfig, targetConfig end - + local mouseHitInWorld = Vector3.new(0, 0, 0) if Mouse then mouseHitInWorld = Vector3.new(Mouse.Hit.x, Mouse.Hit.y, Mouse.Hit.z) end - + local cellPos = nil - + -- Nothing was hit, so check for the default plane. if nil == targetPart then cellPos = GetTerrainForMouse(Mouse) @@ -442,23 +508,25 @@ local function findConfigAtMouseTarget(Mouse, stampData) local diagBBTarget = maxBBTarget - minBBTarget local targetCFrame = getMouseTargetCFrame(targetPart) - if targetPart:IsA("Terrain") then - if not cluster then cluster = game.Workspace:FindFirstChild("Terrain") end + if targetPart:IsA "Terrain" then + if not cluster then + cluster = game.Workspace:FindFirstChild "Terrain" + end local cellID = cluster:WorldToCellPreferSolid(mouseHitInWorld) if hitPlane then cellID = cellPos end - + targetCFrame = CFrame.new(game.Workspace.Terrain:CellCenterToWorld(cellID.x, cellID.y, cellID.z)) end - + local mouseHitInTarget = targetCFrame:pointToObjectSpace(mouseHitInWorld) - local targetVectorInWorld = Vector3.new(0,0,0) + local targetVectorInWorld = Vector3.new(0, 0, 0) if Mouse then -- DON'T WANT THIS IN TERMS OF THE MODEL CFRAME! (.TargetSurface is in terms of the part CFrame, so this would break, right? [HotThoth]) -- (ideally, we would want to make the Mouse.TargetSurface a model-targetsurface instead, but for testing will be using the converse) --targetVectorInWorld = targetCFrame:vectorToWorldSpace(Vector3.FromNormalId(Mouse.TargetSurface)) - targetVectorInWorld = targetPart.CFrame:vectorToWorldSpace(Vector3.FromNormalId(Mouse.TargetSurface)) -- better, but model cframe would be best + targetVectorInWorld = targetPart.CFrame:vectorToWorldSpace(Vector3.FromNormalId(Mouse.TargetSurface)) -- better, but model cframe would be best --[[if targetPart.Parent:IsA("Model") then local hitFace = modelTargetSurface(targetPart.Parent, Mouse.Hit.p, game.Workspace.CurrentCamera.CoordinateFrame.p) -- best, if you get it right local WORLD_AXES = {Vector3.new(1, 0, 0), Vector3.new(0, 1, 0), Vector3.new(0, 0, 1)} @@ -476,38 +544,42 @@ local function findConfigAtMouseTarget(Mouse, stampData) if getClosestAlignedWorldDirection(targetVectorInWorld) == 0 then targetRefPointInTarget = targetCFrame:vectorToObjectSpace(Vector3.new(1, -1, 1)) insertRefPointInInsert = insertCFrame:vectorToObjectSpace(Vector3.new(-1, -1, 1)) - clampToSurface = Vector3.new(0,1,1) + clampToSurface = Vector3.new(0, 1, 1) elseif getClosestAlignedWorldDirection(targetVectorInWorld) == 3 then targetRefPointInTarget = targetCFrame:vectorToObjectSpace(Vector3.new(-1, -1, -1)) insertRefPointInInsert = insertCFrame:vectorToObjectSpace(Vector3.new(1, -1, -1)) - clampToSurface = Vector3.new(0,1,1) + clampToSurface = Vector3.new(0, 1, 1) elseif getClosestAlignedWorldDirection(targetVectorInWorld) == 1 then targetRefPointInTarget = targetCFrame:vectorToObjectSpace(Vector3.new(-1, 1, 1)) insertRefPointInInsert = insertCFrame:vectorToObjectSpace(Vector3.new(-1, -1, 1)) - clampToSurface = Vector3.new(1,0,1) + clampToSurface = Vector3.new(1, 0, 1) elseif getClosestAlignedWorldDirection(targetVectorInWorld) == 4 then targetRefPointInTarget = targetCFrame:vectorToObjectSpace(Vector3.new(-1, -1, 1)) insertRefPointInInsert = insertCFrame:vectorToObjectSpace(Vector3.new(-1, 1, 1)) - clampToSurface = Vector3.new(1,0,1) + clampToSurface = Vector3.new(1, 0, 1) elseif getClosestAlignedWorldDirection(targetVectorInWorld) == 2 then targetRefPointInTarget = targetCFrame:vectorToObjectSpace(Vector3.new(-1, -1, 1)) insertRefPointInInsert = insertCFrame:vectorToObjectSpace(Vector3.new(-1, -1, -1)) - clampToSurface = Vector3.new(1,1,0) + clampToSurface = Vector3.new(1, 1, 0) else targetRefPointInTarget = targetCFrame:vectorToObjectSpace(Vector3.new(1, -1, -1)) insertRefPointInInsert = insertCFrame:vectorToObjectSpace(Vector3.new(1, -1, 1)) - clampToSurface = Vector3.new(1,1,0) + 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) - + -- 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 -- Apply the rotation here local delta = mouseHitInTarget - targetRefPointInTarget - local deltaClamped = Vector3.new(grid * math.modf(delta.x/grid), grid * math.modf(delta.y/grid), grid * math.modf(delta.z/grid)) + local deltaClamped = Vector3.new( + grid * math.modf(delta.x / grid), + grid * math.modf(delta.y / grid), + grid * math.modf(delta.z / grid) + ) deltaClamped = deltaClamped * clampToSurface local targetTouchInTarget = deltaClamped + targetRefPointInTarget @@ -516,7 +588,20 @@ local function findConfigAtMouseTarget(Mouse, stampData) local posInsertOriginInWorld = TargetTouchRelToWorld - InsertTouchInWorld local x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22 = insertCFrame:components() - targetConfig = CFrame.new(posInsertOriginInWorld.x, posInsertOriginInWorld.y, posInsertOriginInWorld.z, R00, R01, R02, R10, R11, R12, R20, R21, R22) + targetConfig = CFrame.new( + posInsertOriginInWorld.x, + posInsertOriginInWorld.y, + posInsertOriginInWorld.z, + R00, + R01, + R02, + R10, + R11, + R12, + R20, + R21, + R22 + ) admissibleConfig = true return admissibleConfig, targetConfig, getClosestAlignedWorldDirection(targetVectorInWorld) @@ -525,26 +610,29 @@ end local function truncateToCircleEighth(bigValue, littleValue) local big = math.abs(bigValue) local little = math.abs(littleValue) - local hypotenuse = math.sqrt(big*big + little*little) + local hypotenuse = math.sqrt(big * big + little * little) local frac = little / hypotenuse local bigSign = 1 local littleSign = 1 - if bigValue < 0 then bigSign = -1 end - if littleValue < 0 then littleSign = -1 end + if bigValue < 0 then + bigSign = -1 + end + if littleValue < 0 then + littleSign = -1 + end - if frac > .382683432 then + if frac > 0.382683432 then -- between 22.5 and 45 degrees, so truncate to 45-degree tilt - return .707106781 * hypotenuse * bigSign, .707106781 * hypotenuse * littleSign - else + return 0.707106781 * hypotenuse * bigSign, 0.707106781 * hypotenuse * littleSign + else -- between 0 and 22.5 degrees, so truncate to 0-degree tilt return hypotenuse * bigSign, 0 end end - local function saveTheWelds(object, manualWeldTable, manualWeldParentTable) - if object:IsA("ManualWeld") or object:IsA("Rotate") then + if object:IsA "ManualWeld" or object:IsA "Rotate" then table.insert(manualWeldTable, object) table.insert(manualWeldParentTable, object.Parent) else @@ -562,22 +650,28 @@ local function restoreTheWelds(manualWeldTable, manualWeldParentTable) end t.CanEditRegion = function(partOrModel, EditRegion) -- todo: use model and stamper metadata - if not EditRegion then return true, false end + if not EditRegion then + return true, false + end local minBB, maxBB = getBoundingBoxInWorldCoordinates(partOrModel) - - if minBB.X < EditRegion.CFrame.p.X - EditRegion.Size.X/2 or - minBB.Y < EditRegion.CFrame.p.Y - EditRegion.Size.Y/2 or - minBB.Z < EditRegion.CFrame.p.Z - EditRegion.Size.Z/2 then - return false, false + + if + minBB.X < EditRegion.CFrame.p.X - EditRegion.Size.X / 2 + or minBB.Y < EditRegion.CFrame.p.Y - EditRegion.Size.Y / 2 + or minBB.Z < EditRegion.CFrame.p.Z - EditRegion.Size.Z / 2 + then + return false, false end - - if maxBB.X > EditRegion.CFrame.p.X + EditRegion.Size.X/2 or - maxBB.Y > EditRegion.CFrame.p.Y + EditRegion.Size.Y/2 or - maxBB.Z > EditRegion.CFrame.p.Z + EditRegion.Size.Z/2 then - return false, false + + if + maxBB.X > EditRegion.CFrame.p.X + EditRegion.Size.X / 2 + or maxBB.Y > EditRegion.CFrame.p.Y + EditRegion.Size.Y / 2 + or maxBB.Z > EditRegion.CFrame.p.Z + EditRegion.Size.Z / 2 + then + return false, false end - + return true, false end @@ -590,59 +684,65 @@ t.GetStampModel = function(assetId, terrainShape, useAssetVersionId) end local function UnlockInstances(object) - if object:IsA("BasePart") then + if object:IsA "BasePart" then object.Locked = false end - for index,child in pairs(object:GetChildren()) do + for index, child in pairs(object:GetChildren()) do UnlockInstances(child) end end - + local function getClosestColorToTerrainMaterial(terrainValue) if terrainValue == 1 then - return BrickColor.new("Bright green") + return BrickColor.new "Bright green" elseif terrainValue == 2 then - return BrickColor.new("Bright yellow") + return BrickColor.new "Bright yellow" elseif terrainValue == 3 then - return BrickColor.new("Bright red") + return BrickColor.new "Bright red" elseif terrainValue == 4 then - return BrickColor.new("Sand red") + return BrickColor.new "Sand red" elseif terrainValue == 5 then - return BrickColor.new("Black") + return BrickColor.new "Black" elseif terrainValue == 6 then - return BrickColor.new("Dark stone grey") + return BrickColor.new "Dark stone grey" elseif terrainValue == 7 then - return BrickColor.new("Sand blue") + return BrickColor.new "Sand blue" elseif terrainValue == 8 then - return BrickColor.new("Deep orange") + return BrickColor.new "Deep orange" elseif terrainValue == 9 then - return BrickColor.new("Dark orange") + return BrickColor.new "Dark orange" elseif terrainValue == 10 then - return BrickColor.new("Reddish brown") + return BrickColor.new "Reddish brown" elseif terrainValue == 11 then - return BrickColor.new("Light orange") + return BrickColor.new "Light orange" elseif terrainValue == 12 then - return BrickColor.new("Light stone grey") + return BrickColor.new "Light stone grey" elseif terrainValue == 13 then - return BrickColor.new("Sand green") + return BrickColor.new "Sand green" elseif terrainValue == 14 then - return BrickColor.new("Medium stone grey") + return BrickColor.new "Medium stone grey" elseif terrainValue == 15 then - return BrickColor.new("Really red") + return BrickColor.new "Really red" elseif terrainValue == 16 then - return BrickColor.new("Really blue") + return BrickColor.new "Really blue" elseif terrainValue == 17 then - return BrickColor.new("Bright blue") + return BrickColor.new "Bright blue" else - return BrickColor.new("Bright green") + return BrickColor.new "Bright green" end end - + local function setupFakeTerrainPart(cellMat, cellType, cellOrient) local newTerrainPiece = nil - if (cellType == 1 or cellType == 4) then newTerrainPiece = Instance.new("WedgePart") newTerrainPiece.formFactor = "Custom" - elseif (cellType == 2) then newTerrainPiece = Instance.new("CornerWedgePart") - else newTerrainPiece = Instance.new("Part") newTerrainPiece.formFactor = "Custom" end + if cellType == 1 or cellType == 4 then + newTerrainPiece = Instance.new "WedgePart" + newTerrainPiece.formFactor = "Custom" + elseif cellType == 2 then + newTerrainPiece = Instance.new "CornerWedgePart" + else + newTerrainPiece = Instance.new "Part" + newTerrainPiece.formFactor = "Custom" + end newTerrainPiece.Name = "MegaClusterCube" newTerrainPiece.Size = Vector3.new(4, 4, 4) newTerrainPiece.BottomSurface = "Smooth" @@ -653,39 +753,43 @@ t.GetStampModel = function(assetId, terrainShape, useAssetVersionId) local sideways = 0 local flipped = math.pi - if cellType == 4 then sideways = -math.pi/2 end - if cellType == 2 or cellType == 3 then flipped = 0 end - newTerrainPiece.CFrame = CFrame.Angles(0, math.pi/2*cellOrient + flipped, sideways) + if cellType == 4 then + sideways = -math.pi / 2 + end + if cellType == 2 or cellType == 3 then + flipped = 0 + end + newTerrainPiece.CFrame = CFrame.Angles(0, math.pi / 2 * cellOrient + flipped, sideways) if cellType == 3 then - local inverseCornerWedgeMesh = Instance.new("SpecialMesh") + local inverseCornerWedgeMesh = Instance.new "SpecialMesh" inverseCornerWedgeMesh.MeshType = "FileMesh" inverseCornerWedgeMesh.MeshId = "http://www.roblox.com/asset?id=66832495" inverseCornerWedgeMesh.Scale = Vector3.new(2, 2, 2) inverseCornerWedgeMesh.Parent = newTerrainPiece end - local materialTag = Instance.new("Vector3Value") + local materialTag = Instance.new "Vector3Value" materialTag.Value = Vector3.new(cellMat, cellType, cellOrient) materialTag.Name = "ClusterMaterial" materialTag.Parent = newTerrainPiece return newTerrainPiece end - + -- This call will cause a "wait" until the data comes back -- below we wait a max of 8 seconds before deciding to bail out on loading local root local loader loading = true if useAssetVersionId then - loader = coroutine.create(function() + loader = coroutine.create(function() root = game:GetService("InsertService"):LoadAssetVersion(assetId) loading = false end) coroutine.resume(loader) else - loader = coroutine.create(function() + loader = coroutine.create(function() root = game:GetService("InsertService"):LoadAsset(assetId) loading = false end) @@ -706,12 +810,11 @@ t.GetStampModel = function(assetId, terrainShape, useAssetVersionId) return nil, "Load Time Fail" end - if root == nil then return nil, "Load Asset Fail" end - if not root:IsA("Model") then + if not root:IsA "Model" then return nil, "Load Type Fail" end @@ -728,42 +831,44 @@ t.GetStampModel = function(assetId, terrainShape, useAssetVersionId) --Examine the contents and decide what it looks like for pos, instance in pairs(instances) do - if instance:IsA("Team") then - instance.Parent = game:GetService("Teams") - elseif instance:IsA("Sky") then - local lightingService = game:GetService("Lighting") - for index,child in pairs(lightingService:GetChildren()) do - if child:IsA("Sky") then - child:Remove(); + if instance:IsA "Team" then + instance.Parent = game:GetService "Teams" + elseif instance:IsA "Sky" then + local lightingService = game:GetService "Lighting" + for index, child in pairs(lightingService:GetChildren()) do + if child:IsA "Sky" then + child:Remove() end end instance.Parent = lightingService return end end - + -- ...and tag all inserted models for subsequent origin identification -- if no RobloxModel tag already exists, then add it. - if root:FindFirstChild("RobloxModel") == nil then - local stringTag = Instance.new("BoolValue", root) + if root:FindFirstChild "RobloxModel" == nil then + local stringTag = Instance.new("BoolValue") stringTag.Name = "RobloxModel" + stringTag.Parent = root - if root:FindFirstChild("RobloxStamper") == nil then - local stringTag2 = Instance.new("BoolValue", root) + if root:FindFirstChild "RobloxStamper" == nil then + local stringTag2 = Instance.new("BoolValue") stringTag2.Name = "RobloxStamper" + stringTag2.Parent = root end end - + if terrainShape then if root.Name == "MegaClusterCube" then - if (terrainShape == 6) then -- insert an autowedging tag - local autowedgeTag = Instance.new("BoolValue") + if terrainShape == 6 then -- insert an autowedging tag + local autowedgeTag = Instance.new "BoolValue" autowedgeTag.Name = "AutoWedge" autowedgeTag.Parent = root else - local clusterTag = root:FindFirstChild("ClusterMaterial") + local clusterTag = root:FindFirstChild "ClusterMaterial" if clusterTag then - if clusterTag:IsA("Vector3Value") then + if clusterTag:IsA "Vector3Value" then root = setupFakeTerrainPart(clusterTag.Value.X, terrainShape, clusterTag.Value.Z) else root = setupFakeTerrainPart(clusterTag.Value, terrainShape, 0) @@ -778,63 +883,61 @@ t.GetStampModel = function(assetId, terrainShape, useAssetVersionId) return root end - - t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStampRegion, StampFailedFunc) if not modelToStamp then - error("SetupStamperDragger: modelToStamp (first arg) is nil! Should be a stamper model") - return nil + error "SetupStamperDragger: modelToStamp (first arg) is nil! Should be a stamper model" + return nil end - if not modelToStamp:IsA("Model") and not modelToStamp:IsA("BasePart") then - error("SetupStamperDragger: modelToStamp (first arg) is neither a Model or Part!") - return nil + if not modelToStamp:IsA "Model" and not modelToStamp:IsA "BasePart" then + error "SetupStamperDragger: modelToStamp (first arg) is neither a Model or Part!" + return nil end if not Mouse then - error("SetupStamperDragger: Mouse (second arg) is nil! Should be a mouse object") - return nil + error "SetupStamperDragger: Mouse (second arg) is nil! Should be a mouse object" + return nil end - if not Mouse:IsA("Mouse") then - error("SetupStamperDragger: Mouse (second arg) is not of type Mouse!") - return nil + if not Mouse:IsA "Mouse" then + error "SetupStamperDragger: Mouse (second arg) is not of type Mouse!" + return nil end - + local stampInModel = nil local allowedStampRegion = nil local stampFailedFunc = nil if StampInModel then - if not StampInModel:IsA("Model") then - error("SetupStamperDragger: StampInModel (optional third arg) is not of type 'Model'") + if not StampInModel:IsA "Model" then + error "SetupStamperDragger: StampInModel (optional third arg) is not of type 'Model'" return nil end if not AllowedStampRegion then - error("SetupStamperDragger: AllowedStampRegion (optional fourth arg) is nil when StampInModel (optional third arg) is defined") + error "SetupStamperDragger: AllowedStampRegion (optional fourth arg) is nil when StampInModel (optional third arg) is defined" return nil end stampFailedFunc = StampFailedFunc stampInModel = StampInModel allowedStampRegion = AllowedStampRegion end - + -- Init all state variables local gInitial90DegreeRotations = 0 local stampData = nil local mouseTarget = nil - - local errorBox = Instance.new("SelectionBox") - errorBox.Color = BrickColor.new("Bright red") + + local errorBox = Instance.new "SelectionBox" + errorBox.Color = BrickColor.new "Bright red" errorBox.Transparency = 0 errorBox.Archivable = false - + -- for megacluster MEGA STAMPING - local adornPart = Instance.new("Part") + local adornPart = Instance.new "Part" adornPart.Parent = nil adornPart.formFactor = "Custom" adornPart.Size = Vector3.new(4, 4, 4) adornPart.CFrame = CFrame.new() adornPart.Archivable = false - local adorn = Instance.new("SelectionBox") - adorn.Color = BrickColor.new("Toothpaste") + local adorn = Instance.new "SelectionBox" + adorn.Color = BrickColor.new "Toothpaste" adorn.Adornee = adornPart adorn.Visible = true adorn.Transparency = 0 @@ -849,52 +952,59 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp HighScalabilityLine.InternalLine = nil HighScalabilityLine.NewHint = true - HighScalabilityLine.MorePoints = {nil, nil} - HighScalabilityLine.MoreLines = {nil, nil} + HighScalabilityLine.MorePoints = { nil, nil } + HighScalabilityLine.MoreLines = { nil, nil } HighScalabilityLine.Dimensions = 1 - + local control = {} local movingLock = false local stampUpLock = false local unstampableSurface = false local mouseCons = {} local keyCon = nil - - local stamped = Instance.new("BoolValue") + + local stamped = Instance.new "BoolValue" stamped.Archivable = false stamped.Value = false - + local lastTarget = {} lastTarget.TerrainOrientation = 0 lastTarget.CFrame = 0 - + local cellInfo = {} cellInfo.Material = 1 cellInfo.clusterType = 0 cellInfo.clusterOrientation = 0 - + local function isMegaClusterPart() - if not stampData then return false end - if not stampData.CurrentParts then return false end - - return ( stampData.CurrentParts:FindFirstChild("ClusterMaterial",true) or (stampData.CurrentParts.Name == "MegaClusterCube") ) + if not stampData then + return false + end + if not stampData.CurrentParts then + return false + end + + return ( + stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) + or (stampData.CurrentParts.Name == "MegaClusterCube") + ) end - + local function DoHighScalabilityRegionSelect() - local megaCube = stampData.CurrentParts:FindFirstChild("MegaClusterCube") - if not megaCube then + local megaCube = stampData.CurrentParts:FindFirstChild "MegaClusterCube" + if not megaCube then if not stampData.CurrentParts.Name == "MegaClusterCube" then return else megaCube = stampData.CurrentParts end end - + HighScalabilityLine.End = megaCube.CFrame.p local line = nil local line2 = Vector3.new(0, 0, 0) local line3 = Vector3.new(0, 0, 0) - + if HighScalabilityLine.Dimensions == 1 then -- extract the line from these positions and limit to a 2D plane made from 2 of the world axes -- then use dominating axis to limit line to be at 45-degree intervals @@ -905,9 +1015,9 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp if math.abs(line.X) < math.abs(line.Z) then -- limit to Y/Z plane, domination unknown local newY, newZ - if (math.abs(line.Y) > math.abs(line.Z)) then + if math.abs(line.Y) > math.abs(line.Z) then newY, newZ = truncateToCircleEighth(line.Y, line.Z) - else + else newZ, newY = truncateToCircleEighth(line.Z, line.Y) end line = Vector3.new(0, newY, newZ) @@ -926,27 +1036,26 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp newZ, newX = truncateToCircleEighth(line.Z, line.X) end line = Vector3.new(newX, 0, newZ) - else + else -- limit to X/Y plane, with X dominating local newX, newY = truncateToCircleEighth(line.X, line.Y) line = Vector3.new(newX, newY, 0) end end HighScalabilityLine.InternalLine = line - elseif HighScalabilityLine.Dimensions == 2 then line = HighScalabilityLine.MoreLines[1] 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 = line2 - line.unit * line.unit:Dot(line2) tempCFrame = CFrame.new(HighScalabilityLine.Start, HighScalabilityLine.Start + line) -- then zero out whichever is the smaller component local yAxis = tempCFrame:vectorToWorldSpace(Vector3.new(0, 1, 0)) local xAxis = tempCFrame:vectorToWorldSpace(Vector3.new(1, 0, 0)) - + local xComp = xAxis:Dot(line2) local yComp = yAxis:Dot(line2) @@ -957,9 +1066,8 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp end HighScalabilityLine.InternalLine = line2 - elseif HighScalabilityLine.Dimensions == 3 then - line = HighScalabilityLine.MoreLines[1] + line = HighScalabilityLine.MoreLines[1] line2 = HighScalabilityLine.MoreLines[2] line3 = HighScalabilityLine.End - HighScalabilityLine.MorePoints[2] @@ -972,22 +1080,24 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp -- resize the "line" graphic to be the correct size and orientation tempCFrame = CFrame.new(HighScalabilityLine.Start, HighScalabilityLine.Start + line) - - if HighScalabilityLine.Dimensions == 1 then -- faster calculation for line + + if HighScalabilityLine.Dimensions == 1 then -- faster calculation for line HighScalabilityLine.AdornPart.Size = Vector3.new(4, 4, line.magnitude + 4) - HighScalabilityLine.AdornPart.CFrame = tempCFrame + tempCFrame:vectorToWorldSpace(Vector3.new(2, 2, 2) - HighScalabilityLine.AdornPart.Size/2) + HighScalabilityLine.AdornPart.CFrame = tempCFrame + + tempCFrame:vectorToWorldSpace(Vector3.new(2, 2, 2) - HighScalabilityLine.AdornPart.Size / 2) else local boxSize = tempCFrame:vectorToObjectSpace(line + line2 + line3) - HighScalabilityLine.AdornPart.Size = Vector3.new(4, 4, 4) + Vector3.new(math.abs(boxSize.X), math.abs(boxSize.Y), math.abs(boxSize.Z)) - HighScalabilityLine.AdornPart.CFrame = tempCFrame + tempCFrame:vectorToWorldSpace(boxSize/2) + HighScalabilityLine.AdornPart.Size = Vector3.new(4, 4, 4) + + Vector3.new(math.abs(boxSize.X), math.abs(boxSize.Y), math.abs(boxSize.Z)) + HighScalabilityLine.AdornPart.CFrame = tempCFrame + tempCFrame:vectorToWorldSpace(boxSize / 2) end - + -- make player able to see this ish local gui = nil - if game.Players["LocalPlayer"] then - gui = game.Players.LocalPlayer:FindFirstChild("PlayerGui") - if gui and gui:IsA("PlayerGui") then + if game.Players["LocalPlayer"] then + gui = game.Players.LocalPlayer:FindFirstChild "PlayerGui" + if gui and gui:IsA "PlayerGui" then if HighScalabilityLine.Dimensions == 1 and line.magnitude > 3 then -- don't show if mouse hasn't moved enough HighScalabilityLine.Adorn.Parent = gui elseif HighScalabilityLine.Dimensions > 1 then @@ -995,9 +1105,9 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp end end end - + if gui == nil then -- we are in studio - gui = game:GetService("CoreGui") + gui = game:GetService "CoreGui" if HighScalabilityLine.Dimensions == 1 and line.magnitude > 3 then -- don't show if mouse hasn't moved enough HighScalabilityLine.Adorn.Parent = gui elseif HighScalabilityLine.Dimensions > 1 then @@ -1005,26 +1115,25 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp end end end - - + local function DoStamperMouseMove(Mouse) if not Mouse then - error("Error: RbxStamper.DoStamperMouseMove: Mouse is nil") + error "Error: RbxStamper.DoStamperMouseMove: Mouse is nil" return end - if not Mouse:IsA("Mouse") then - error("Error: RbxStamper.DoStamperMouseMove: Mouse is of type", Mouse.className,"should be of type Mouse") + if not Mouse:IsA "Mouse" then + error("Error: RbxStamper.DoStamperMouseMove: Mouse is of type", Mouse.className, "should be of type Mouse") return end - + -- There wasn't a target (no part or terrain), so check for plane intersection. - if not Mouse.Target then + if not Mouse.Target then local cellPos = GetTerrainForMouse(Mouse) if nil == cellPos then return end end - + if not stampData then return end @@ -1033,26 +1142,31 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp -- draw ghost at acceptable positions configFound, targetCFrame, targetSurface = findConfigAtMouseTarget(Mouse, stampData) if not configFound then - error("RbxStamper.DoStamperMouseMove No configFound, returning") + error "RbxStamper.DoStamperMouseMove No configFound, returning" return - end + end local numRotations = 0 -- update this according to how many rotations you need to get it to target surface if autoAlignToFace(stampData.CurrentParts) and targetSurface ~= 1 and targetSurface ~= 4 then -- pre-rotate the flag or portrait so it's aligned correctly - if targetSurface == 3 then numRotations = 0 - gInitial90DegreeRotations + autoAlignToFace(stampData.CurrentParts) - elseif targetSurface == 0 then numRotations = 2 - gInitial90DegreeRotations + autoAlignToFace(stampData.CurrentParts) - elseif targetSurface == 5 then numRotations = 3 - gInitial90DegreeRotations + autoAlignToFace(stampData.CurrentParts) - elseif targetSurface == 2 then numRotations = 1 - gInitial90DegreeRotations + autoAlignToFace(stampData.CurrentParts) + if targetSurface == 3 then + numRotations = 0 - gInitial90DegreeRotations + autoAlignToFace(stampData.CurrentParts) + elseif targetSurface == 0 then + numRotations = 2 - gInitial90DegreeRotations + autoAlignToFace(stampData.CurrentParts) + elseif targetSurface == 5 then + numRotations = 3 - gInitial90DegreeRotations + autoAlignToFace(stampData.CurrentParts) + elseif targetSurface == 2 then + numRotations = 1 - gInitial90DegreeRotations + autoAlignToFace(stampData.CurrentParts) end - end + end - local ry = math.pi/2 + local ry = math.pi / 2 gInitial90DegreeRotations = gInitial90DegreeRotations + numRotations - if stampData.CurrentParts:IsA("Model") or stampData.CurrentParts:IsA("Tool") then + if stampData.CurrentParts:IsA "Model" or stampData.CurrentParts:IsA "Tool" then --stampData.CurrentParts:Rotate(0, ry*numRotations, 0) - modelRotate(stampData.CurrentParts, ry*numRotations) + modelRotate(stampData.CurrentParts, ry * numRotations) else - stampData.CurrentParts.CFrame = CFrame.fromEulerAnglesXYZ(0, ry*numRotations, 0) * stampData.CurrentParts.CFrame + stampData.CurrentParts.CFrame = CFrame.fromEulerAnglesXYZ(0, ry * numRotations, 0) + * stampData.CurrentParts.CFrame end -- CODE TO CHECK FOR DRAGGING GHOST PART INTO A COLLIDING STATE @@ -1060,21 +1174,21 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp -- need to offset by distance to be dragged local currModelCFrame = nil - if stampData.CurrentParts:IsA("Model") then + if stampData.CurrentParts:IsA "Model" then currModelCFrame = stampData.CurrentParts:GetModelCFrame() - else + else currModelCFrame = stampData.CurrentParts.CFrame end - + minBB = minBB + targetCFrame.p - currModelCFrame.p maxBB = maxBB + targetCFrame.p - currModelCFrame.p -- don't drag into terrain if clusterPartsInRegion(minBB + insertBoundingBoxOverlapVector, maxBB - insertBoundingBoxOverlapVector) then if lastTarget.CFrame then - if (stampData.CurrentParts:FindFirstChild("ClusterMaterial", true)) then + if stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) then local theClusterMaterial = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) - if theClusterMaterial:IsA("Vector3Value") then + if theClusterMaterial:IsA "Vector3Value" then local stampClusterMaterial = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) if stampClusterMaterial then stampClusterMaterial = clusterMat @@ -1088,37 +1202,62 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp -- if we are stamping a terrain part, make sure it goes on the grid! Otherwise preview block could be placed off grid, but stamped on grid if isMegaClusterPart() then local cellToStamp = game.Workspace.Terrain:WorldToCell(targetCFrame.p) - local newCFramePosition = game.Workspace.Terrain:CellCenterToWorld(cellToStamp.X, cellToStamp.Y, cellToStamp.Z) + local newCFramePosition = + game.Workspace.Terrain:CellCenterToWorld(cellToStamp.X, cellToStamp.Y, cellToStamp.Z) local x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22 = targetCFrame:components() - targetCFrame = CFrame.new(newCFramePosition.X,newCFramePosition.Y,newCFramePosition.Z,R00, R01, R02, R10, R11, R12, R20, R21, R22) + targetCFrame = CFrame.new( + newCFramePosition.X, + newCFramePosition.Y, + newCFramePosition.Z, + R00, + R01, + R02, + R10, + R11, + R12, + R20, + R21, + R22 + ) end positionPartsAtCFrame3(targetCFrame, stampData.CurrentParts) - lastTarget.CFrame = targetCFrame -- successful positioning, so update 'dat cframe + lastTarget.CFrame = targetCFrame -- successful positioning, so update 'dat cframe if stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) then local clusterMat = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) - if clusterMat:IsA("Vector3Value") then + if clusterMat:IsA "Vector3Value" then lastTarget.TerrainOrientation = clusterMat.Value.Z end end - -- auto break joints code if Mouse and Mouse.Target and Mouse.Target.Parent then - local modelInfo = Mouse.Target:FindFirstChild("RobloxModel") - if not modelInfo then modelInfo = Mouse.Target.Parent:FindFirstChild("RobloxModel") end - - local myModelInfo = stampData.CurrentParts:FindFirstChild("UnstampableFaces") + local modelInfo = Mouse.Target:FindFirstChild "RobloxModel" + if not modelInfo then + modelInfo = Mouse.Target.Parent:FindFirstChild "RobloxModel" + end + + local myModelInfo = stampData.CurrentParts:FindFirstChild "UnstampableFaces" --if (modelInfo and modelInfo.Parent:FindFirstChild("UnstampableFaces")) or (modelInfo and myModelInfo) then -- need better targetSurface calcs - if (true) then + if true then local breakingFaces = "" local myBreakingFaces = "" - if modelInfo and modelInfo.Parent:FindFirstChild("UnstampableFaces") then breakingFaces = modelInfo.Parent.UnstampableFaces.Value end - if myModelInfo then myBreakingFaces = myModelInfo.Value end + if modelInfo and modelInfo.Parent:FindFirstChild "UnstampableFaces" then + breakingFaces = modelInfo.Parent.UnstampableFaces.Value + end + if myModelInfo then + myBreakingFaces = myModelInfo.Value + end local hitFace = 0 - if modelInfo then hitFace = modelTargetSurface(modelInfo.Parent, game.Workspace.CurrentCamera.CoordinateFrame.p, Mouse.Hit.p) end + if modelInfo then + hitFace = modelTargetSurface( + modelInfo.Parent, + game.Workspace.CurrentCamera.CoordinateFrame.p, + Mouse.Hit.p + ) + end -- are we stamping TO an unstampable surface? for bf in string.gmatch(breakingFaces, "[^,]+") do @@ -1131,7 +1270,11 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp end -- now we have to cast the ray back in the other direction to find the surface we're stamping FROM - hitFace = modelTargetSurface(stampData.CurrentParts, Mouse.Hit.p, game.Workspace.CurrentCamera.CoordinateFrame.p) + hitFace = modelTargetSurface( + stampData.CurrentParts, + Mouse.Hit.p, + game.Workspace.CurrentCamera.CoordinateFrame.p + ) -- are we stamping WITH an unstampable surface? for bf in string.gmatch(myBreakingFaces, "[^,]+") do @@ -1143,7 +1286,7 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp end -- just need to match breakingFace against targetSurface using rotation supplied by modelCFrame - -- targetSurface: 1 is top, 4 is bottom, + -- targetSurface: 1 is top, 4 is bottom, end end @@ -1152,21 +1295,22 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp game.JointsService:SetJoinAfterMoveInstance(stampData.CurrentParts) -- most common mouse inactive error occurs here, so check mouse active one more time in a pcall - if not pcall(function() - if Mouse and Mouse.Target and Mouse.Target.Parent:FindFirstChild("RobloxModel") == nil then + if + not pcall(function() + if Mouse and Mouse.Target and Mouse.Target.Parent:FindFirstChild "RobloxModel" == nil then return else return end - end) + end) then - error("Error: RbxStamper.DoStamperMouseMove Mouse is nil on second check") + error "Error: RbxStamper.DoStamperMouseMove Mouse is nil on second check" game.JointsService:ClearJoinAfterMoveJoints() Mouse = nil return end - if Mouse and Mouse.Target and Mouse.Target.Parent:FindFirstChild("RobloxModel") == nil then + if Mouse and Mouse.Target and Mouse.Target.Parent:FindFirstChild "RobloxModel" == nil then game.JointsService:SetJoinAfterMoveTarget(Mouse.Target) else game.JointsService:SetJoinAfterMoveTarget(nil) @@ -1175,26 +1319,29 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp -- here we allow for a line of high-scalability parts if isMegaClusterPart() and HighScalabilityLine and HighScalabilityLine.Start then - DoHighScalabilityRegionSelect() + DoHighScalabilityRegionSelect() end end - + local function setupKeyListener(key, Mouse) - if control and control["Paused"] then return end -- don't do this if we have no stamp - + 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 + if key == "r" and not autoAlignToFace(stampData.CurrentParts) then -- rotate the model gInitial90DegreeRotations = gInitial90DegreeRotations + 1 - + -- Update orientation value if this is a fake terrain part local clusterValues = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) - if clusterValues and clusterValues:IsA("Vector3Value") then - clusterValues.Value = Vector3.new(clusterValues.Value.X, clusterValues.Value.Y, (clusterValues.Value.Z + 1) % 4) + if clusterValues and clusterValues:IsA "Vector3Value" then + clusterValues.Value = + Vector3.new(clusterValues.Value.X, clusterValues.Value.Y, (clusterValues.Value.Z + 1) % 4) end - + -- Rotate the parts or all the parts in the model - local ry = math.pi/2 - if stampData.CurrentParts:IsA("Model") or stampData.CurrentParts:IsA("Tool") then + local ry = math.pi / 2 + if stampData.CurrentParts:IsA "Model" or stampData.CurrentParts:IsA "Tool" then --stampData.CurrentParts:Rotate(0, ry, 0) modelRotate(stampData.CurrentParts, ry) else @@ -1205,12 +1352,16 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp configFound, targetCFrame = findConfigAtMouseTarget(Mouse, stampData) if configFound then positionPartsAtCFrame3(targetCFrame, stampData.CurrentParts) - + -- update everything else in MouseMove DoStamperMouseMove(Mouse) end - elseif key == 'c' then -- try to expand our high scalability dragger dimension - if HighScalabilityLine.InternalLine and HighScalabilityLine.InternalLine.magnitude > 0 and HighScalabilityLine.Dimensions < 3 then + elseif key == "c" then -- try to expand our high scalability dragger dimension + if + HighScalabilityLine.InternalLine + and HighScalabilityLine.InternalLine.magnitude > 0 + and HighScalabilityLine.Dimensions < 3 + then HighScalabilityLine.MorePoints[HighScalabilityLine.Dimensions] = HighScalabilityLine.End HighScalabilityLine.MoreLines[HighScalabilityLine.Dimensions] = HighScalabilityLine.InternalLine HighScalabilityLine.Dimensions = HighScalabilityLine.Dimensions + 1 @@ -1218,11 +1369,11 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp end end end - + keyCon = Mouse.KeyDown:connect(function(key) -- init key connection (keeping code close to func) setupKeyListener(key, Mouse) end) - + local function resetHighScalabilityLine() if HighScalabilityLine then HighScalabilityLine.Start = nil @@ -1234,27 +1385,33 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp local function flashRedBox() local gui = game.CoreGui - if game:FindFirstChild("Players") then + if game:FindFirstChild "Players" then if game.Players["LocalPlayer"] then - if game.Players.LocalPlayer:FindFirstChild("PlayerGui") then + if game.Players.LocalPlayer:FindFirstChild "PlayerGui" then gui = game.Players.LocalPlayer.PlayerGui end end end - if not stampData["ErrorBox"] then return end - + if not stampData["ErrorBox"] then + return + end + stampData.ErrorBox.Parent = gui - if stampData.CurrentParts:IsA("Tool") then + if stampData.CurrentParts:IsA "Tool" then stampData.ErrorBox.Adornee = stampData.CurrentParts.Handle - else + else stampData.ErrorBox.Adornee = stampData.CurrentParts end - delay(0,function() + delay(0, function() for i = 1, 3 do - if stampData["ErrorBox"] then stampData.ErrorBox.Visible = true end + if stampData["ErrorBox"] then + stampData.ErrorBox.Visible = true + end wait(0.13) - if stampData["ErrorBox"] then stampData.ErrorBox.Visible = false end + if stampData["ErrorBox"] then + stampData.ErrorBox.Visible = false + end wait(0.13) end if stampData["ErrorBox"] then @@ -1263,17 +1420,17 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp end end) end - + local function DoStamperMouseDown(Mouse) if not Mouse then - error("Error: RbxStamper.DoStamperMouseDown: Mouse is nil") + error "Error: RbxStamper.DoStamperMouseDown: Mouse is nil" return end - if not Mouse:IsA("Mouse") then - error("Error: RbxStamper.DoStamperMouseDown: Mouse is of type", Mouse.className,"should be of type Mouse") + if not Mouse:IsA "Mouse" then + error("Error: RbxStamper.DoStamperMouseDown: Mouse is of type", Mouse.className, "should be of type Mouse") return end - if not stampData then + if not stampData then return end @@ -1295,7 +1452,7 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp end end end - + local function loadSurfaceTypes(part, surfaces) part.TopSurface = surfaces[1] part.BottomSurface = surfaces[2] @@ -1313,7 +1470,7 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp tempTable[4] = part.RightSurface tempTable[5] = part.FrontSurface tempTable[6] = part.BackSurface - + myTable[part] = tempTable end @@ -1322,8 +1479,10 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp end local function prepareModel(model) - if not model then return nil end - + if not model then + return nil + end + local gDesiredTrans = 0.7 local gStaticTrans = 1 @@ -1331,7 +1490,7 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp local scripts = {} local parts = {} local decals = {} - + stampData = {} stampData.DisabledScripts = {} stampData.TransparencyTable = {} @@ -1341,13 +1500,15 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp stampData.ArchivableTable = {} stampData.DecalTransparencyTable = {} stampData.SurfaceTypeTable = {} - + collectParts(clone, parts, scripts, decals) - if #parts <= 0 then return nil, "no parts found in modelToStamp" end + if #parts <= 0 then + return nil, "no parts found in modelToStamp" + end - for index,script in pairs(scripts) do - if not(script.Disabled) then + for index, script in pairs(scripts) do + if not script.Disabled then script.Disabled = true stampData.DisabledScripts[#stampData.DisabledScripts + 1] = script end @@ -1365,23 +1526,28 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp part.Archivable = false saveSurfaceTypes(part, stampData.SurfaceTypeTable) - + local fadeInDelayTime = 0.5 local transFadeInTime = 0.5 - delay(0,function() + delay(0, function() wait(fadeInDelayTime) -- give it some time to be completely transparent - + local begTime = tick() local currTime = begTime - while (currTime - begTime) < transFadeInTime and part and part:IsA("BasePart") and part.Transparency > gDesiredTrans do - local newTrans = 1 - (((currTime - begTime)/transFadeInTime) * (gStaticTrans - gDesiredTrans)) + while + (currTime - begTime) < transFadeInTime + and part + and part:IsA "BasePart" + and part.Transparency > gDesiredTrans + do + local newTrans = 1 - (((currTime - begTime) / transFadeInTime) * (gStaticTrans - gDesiredTrans)) if stampData["TransparencyTable"] and stampData.TransparencyTable[part] then part.Transparency = newTrans + (1 - newTrans) * stampData.TransparencyTable[part] end wait(0.03) currTime = tick() end - if part and part:IsA("BasePart") then + if part and part:IsA "BasePart" then if stampData["TransparencyTable"] and stampData.TransparencyTable[part] then part.Transparency = gDesiredTrans + (1 - gDesiredTrans) * stampData.TransparencyTable[part] end @@ -1393,7 +1559,7 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp stampData.DecalTransparencyTable[decal] = decal.Transparency decal.Transparency = gDesiredTrans + (1 - gDesiredTrans) * decal.Transparency end - + -- disable all seats setSeatEnabledStatus(clone, true) setSeatEnabledStatus(clone, false) @@ -1405,8 +1571,8 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp stampData.CurrentParts:ResetOrientationToIdentity() gInitial90DegreeRotations = 0 else -- pre-rotate if necessary - local ry = gInitial90DegreeRotations * math.pi/2 - if stampData.CurrentParts:IsA("Model") or stampData.CurrentParts:IsA("Tool") then + local ry = gInitial90DegreeRotations * math.pi / 2 + if stampData.CurrentParts:IsA "Model" or stampData.CurrentParts:IsA "Tool" then --stampData.CurrentParts:Rotate(0, ry, 0) modelRotate(stampData.CurrentParts, ry) else @@ -1419,8 +1585,12 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp -- issue (fingers crossed) [HotThoth] local clusterMaterial = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) - if clusterMaterial and clusterMaterial:IsA("Vector3Value") then - clusterMaterial.Value = Vector3.new(clusterMaterial.Value.X, clusterMaterial.Value.Y, (clusterMaterial.Value.Z + gInitial90DegreeRotations) % 4) + if clusterMaterial and clusterMaterial:IsA "Vector3Value" then + clusterMaterial.Value = Vector3.new( + clusterMaterial.Value.X, + clusterMaterial.Value.Y, + (clusterMaterial.Value.Z + gInitial90DegreeRotations) % 4 + ) end -- After rotating, update the position @@ -1428,86 +1598,98 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp if configFound then stampData.CurrentParts = positionPartsAtCFrame3(targetCFrame, stampData.CurrentParts) end - + -- to show joints during the mouse move game.JointsService:SetJoinAfterMoveInstance(stampData.CurrentParts) - + return clone, parts end - + local function checkTerrainBlockCollisions(cellPos, checkHighScalabilityStamp) local cellCenterToWorld = game.Workspace.Terrain.CellCenterToWorld local cellCenter = cellCenterToWorld(game.Workspace.Terrain, cellPos.X, cellPos.Y, cellPos.Z) - local cellBlockingParts = game.Workspace:FindPartsInRegion3(Region3.new(cellCenter - Vector3.new(2, 2, 2) + insertBoundingBoxOverlapVector, cellCenter + Vector3.new(2, 2, 2) - insertBoundingBoxOverlapVector), stampData.CurrentParts, 100) + local cellBlockingParts = game.Workspace:FindPartsInRegion3( + Region3.new( + cellCenter - Vector3.new(2, 2, 2) + insertBoundingBoxOverlapVector, + cellCenter + Vector3.new(2, 2, 2) - insertBoundingBoxOverlapVector + ), + stampData.CurrentParts, + 100 + ) local skipThisCell = false - + for b = 1, #cellBlockingParts do - if isBlocker(cellBlockingParts[b]) then skipThisCell = true break end + if isBlocker(cellBlockingParts[b]) then + skipThisCell = true + break + end end - + if not skipThisCell then -- pop players up above any set cells local alreadyPushedUp = {} -- if no blocking model below, then see if stamping on top of a character for b = 1, #cellBlockingParts do - if cellBlockingParts[b].Parent and - not alreadyPushedUp[cellBlockingParts[b].Parent] and - cellBlockingParts[b].Parent:FindFirstChild("Humanoid") and - cellBlockingParts[b].Parent:FindFirstChild("Humanoid"):IsA("Humanoid") then - ----------------------------------------------------------------------------------- - local blockingPersonTorso = cellBlockingParts[b].Parent:FindFirstChild("Torso") - alreadyPushedUp[cellBlockingParts[b].Parent] = true + if + cellBlockingParts[b].Parent + and not alreadyPushedUp[cellBlockingParts[b].Parent] + and cellBlockingParts[b].Parent:FindFirstChild "Humanoid" + and cellBlockingParts[b].Parent:FindFirstChild("Humanoid"):IsA "Humanoid" + then + ----------------------------------------------------------------------------------- + local blockingPersonTorso = cellBlockingParts[b].Parent:FindFirstChild "Torso" + alreadyPushedUp[cellBlockingParts[b].Parent] = true - if blockingPersonTorso then - -- if so, let's push the person upwards so they pop on top of the stamped model/part (but only if there's space above them) - local newY = cellCenter.Y + 5 - if spaceAboveCharacter(blockingPersonTorso, newY, stampData) then - blockingPersonTorso.CFrame = blockingPersonTorso.CFrame + Vector3.new(0, newY - blockingPersonTorso.CFrame.p.Y, 0) - else - -- if no space, we just skip this one - skipThisCell = true - break - end + if blockingPersonTorso then + -- if so, let's push the person upwards so they pop on top of the stamped model/part (but only if there's space above them) + local newY = cellCenter.Y + 5 + if spaceAboveCharacter(blockingPersonTorso, newY, stampData) then + blockingPersonTorso.CFrame = blockingPersonTorso.CFrame + + Vector3.new(0, newY - blockingPersonTorso.CFrame.p.Y, 0) + else + -- if no space, we just skip this one + skipThisCell = true + break end - ----------------------------------------------------------------------------------- + end + ----------------------------------------------------------------------------------- end end end - - if not skipThisCell then -- if we STILL aren't skipping... then we're good to go! + + if not skipThisCell then -- if we STILL aren't skipping... then we're good to go! local canSetCell = true - + if checkHighScalabilityStamp then -- check to see if cell is in region, if not we'll skip set if allowedStampRegion then local cellPos = cellCenterToWorld(game.Workspace.Terrain, cellPos.X, cellPos.Y, cellPos.Z) - if cellPos.X + 2 > allowedStampRegion.CFrame.p.X + allowedStampRegion.Size.X/2 then + if cellPos.X + 2 > allowedStampRegion.CFrame.p.X + allowedStampRegion.Size.X / 2 then canSetCell = false - elseif cellPos.X - 2 < allowedStampRegion.CFrame.p.X - allowedStampRegion.Size.X/2 then + elseif cellPos.X - 2 < allowedStampRegion.CFrame.p.X - allowedStampRegion.Size.X / 2 then canSetCell = false - elseif cellPos.Y + 2 > allowedStampRegion.CFrame.p.Y + allowedStampRegion.Size.Y/2 then + elseif cellPos.Y + 2 > allowedStampRegion.CFrame.p.Y + allowedStampRegion.Size.Y / 2 then canSetCell = false - elseif cellPos.Y - 2 < allowedStampRegion.CFrame.p.Y - allowedStampRegion.Size.Y/2 then + elseif cellPos.Y - 2 < allowedStampRegion.CFrame.p.Y - allowedStampRegion.Size.Y / 2 then canSetCell = false - elseif cellPos.Z + 2 > allowedStampRegion.CFrame.p.Z + allowedStampRegion.Size.Z/2 then + elseif cellPos.Z + 2 > allowedStampRegion.CFrame.p.Z + allowedStampRegion.Size.Z / 2 then canSetCell = false - elseif cellPos.Z - 2 < allowedStampRegion.CFrame.p.Z - allowedStampRegion.Size.Z/2 then + elseif cellPos.Z - 2 < allowedStampRegion.CFrame.p.Z - allowedStampRegion.Size.Z / 2 then canSetCell = false end end end - + return canSetCell end return false end - local function ResolveMegaClusterStamp(checkHighScalabilityStamp) local cellSet = false local cluser = game.Workspace.Terrain - + local line = HighScalabilityLine.InternalLine local cMax = game.Workspace.Terrain.MaxExtents.Max local cMin = game.Workspace.Terrain.MaxExtents.Min @@ -1517,114 +1699,188 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp local clusterOrientation = 0 -- default is 0 rotation local autoWedgeClusterParts = false - if stampData.CurrentParts:FindFirstChild("AutoWedge") then autoWedgeClusterParts = true end + if stampData.CurrentParts:FindFirstChild "AutoWedge" then + autoWedgeClusterParts = true + end if stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) then - clusterMaterial = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) - if clusterMaterial:IsA("Vector3Value") then + clusterMaterial = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) + if clusterMaterial:IsA "Vector3Value" then clusterType = clusterMaterial.Value.Y clusterOrientation = clusterMaterial.Value.Z clusterMaterial = clusterMaterial.Value.X - elseif clusterMaterial:IsA("IntValue") then + elseif clusterMaterial:IsA "IntValue" then clusterMaterial = clusterMaterial.Value end end - - if HighScalabilityLine.Adorn.Parent and HighScalabilityLine.Start and ((HighScalabilityLine.Dimensions > 1) or (line and line.magnitude > 0)) then - local startCell = game.Workspace.Terrain:WorldToCell(HighScalabilityLine.Start) - local xInc = {0,0,0} - local yInc = {0,0,0} - local zInc = {0,0,0} - - local cluster = game.Workspace.Terrain - - local incrementVect = {nil, nil, nil} - local stepVect = {Vector3.new(0, 0, 0), Vector3.new(0, 0, 0), Vector3.new(0, 0, 0)} - local worldAxes = {Vector3.new(1, 0, 0), Vector3.new(0, 1, 0), Vector3.new(0, 0, 1)} + if + HighScalabilityLine.Adorn.Parent + and HighScalabilityLine.Start + and ((HighScalabilityLine.Dimensions > 1) or (line and line.magnitude > 0)) + then + local startCell = game.Workspace.Terrain:WorldToCell(HighScalabilityLine.Start) + local xInc = { 0, 0, 0 } + local yInc = { 0, 0, 0 } + local zInc = { 0, 0, 0 } + + local cluster = game.Workspace.Terrain + + local incrementVect = { nil, nil, nil } + local stepVect = { Vector3.new(0, 0, 0), Vector3.new(0, 0, 0), Vector3.new(0, 0, 0) } + + local worldAxes = { Vector3.new(1, 0, 0), Vector3.new(0, 1, 0), Vector3.new(0, 0, 1) } local lines = {} - if HighScalabilityLine.Dimensions > 1 then table.insert(lines, HighScalabilityLine.MoreLines[1]) end - if line and line.magnitude > 0 then table.insert(lines, line) end - if HighScalabilityLine.Dimensions > 2 then table.insert(lines, HighScalabilityLine.MoreLines[2]) end - - for i = 1, #lines do - lines[i] = Vector3.new(math.floor(lines[i].X+.5), math.floor(lines[i].Y+.5), math.floor(lines[i].Z+.5)) -- round to integers - - if lines[i].X > 0 then xInc[i] = 1 elseif lines[i].X < 0 then xInc[i] = -1 end - if lines[i].Y > 0 then yInc[i] = 1 elseif lines[i].Y < 0 then yInc[i] = -1 end - if lines[i].Z > 0 then zInc[i] = 1 elseif lines[i].Z < 0 then zInc[i] = -1 end - - incrementVect[i] = Vector3.new(xInc[i], yInc[i], zInc[i]) - if incrementVect[i].magnitude < .9 then incrementVect[i] = nil end + if HighScalabilityLine.Dimensions > 1 then + table.insert(lines, HighScalabilityLine.MoreLines[1]) + end + if line and line.magnitude > 0 then + table.insert(lines, line) + end + if HighScalabilityLine.Dimensions > 2 then + table.insert(lines, HighScalabilityLine.MoreLines[2]) end + for i = 1, #lines do + lines[i] = Vector3.new( + math.floor(lines[i].X + 0.5), + math.floor(lines[i].Y + 0.5), + math.floor(lines[i].Z + 0.5) + ) -- round to integers - if not lines[2] then lines[2] = Vector3.new(0, 0, 0) end - if not lines[3] then lines[3] = Vector3.new(0, 0, 0) end + if lines[i].X > 0 then + xInc[i] = 1 + elseif lines[i].X < 0 then + xInc[i] = -1 + end + if lines[i].Y > 0 then + yInc[i] = 1 + elseif lines[i].Y < 0 then + yInc[i] = -1 + end + if lines[i].Z > 0 then + zInc[i] = 1 + elseif lines[i].Z < 0 then + zInc[i] = -1 + end + + incrementVect[i] = Vector3.new(xInc[i], yInc[i], zInc[i]) + if incrementVect[i].magnitude < 0.9 then + incrementVect[i] = nil + end + end + + if not lines[2] then + lines[2] = Vector3.new(0, 0, 0) + end + if not lines[3] then + lines[3] = Vector3.new(0, 0, 0) + end local waterForceTag = stampData.CurrentParts:FindFirstChild("WaterForceTag", true) local waterForceDirectionTag = stampData.CurrentParts:FindFirstChild("WaterForceDirectionTag", true) - - while (stepVect[3].magnitude*4 <= lines[3].magnitude) do + + while stepVect[3].magnitude * 4 <= lines[3].magnitude do local outerStepVectIndex = 1 while outerStepVectIndex < 4 do stepVect[2] = Vector3.new(0, 0, 0) - while (stepVect[2].magnitude*4 <= lines[2].magnitude) do + while stepVect[2].magnitude * 4 <= lines[2].magnitude do local innerStepVectIndex = 1 while innerStepVectIndex < 4 do stepVect[1] = Vector3.new(0, 0, 0) - while (stepVect[1].magnitude*4 <= lines[1].magnitude) do + while stepVect[1].magnitude * 4 <= lines[1].magnitude do local stepVectSum = stepVect[1] + stepVect[2] + stepVect[3] - local cellPos = Vector3int16.new(startCell.X + stepVectSum.X, startCell.Y + stepVectSum.Y, startCell.Z + stepVectSum.Z) - if cellPos.X >= cMin.X and cellPos.Y >= cMin.Y and cellPos.Z >= cMin.Z and cellPos.X < cMax.X and cellPos.Y < cMax.Y and cellPos.Z < cMax.Z then + local cellPos = Vector3int16.new( + startCell.X + stepVectSum.X, + startCell.Y + stepVectSum.Y, + startCell.Z + stepVectSum.Z + ) + if + cellPos.X >= cMin.X + and cellPos.Y >= cMin.Y + and cellPos.Z >= cMin.Z + and cellPos.X < cMax.X + and cellPos.Y < cMax.Y + and cellPos.Z < cMax.Z + then -- check if overlaps player or part - local okToStampTerrainBlock = checkTerrainBlockCollisions(cellPos, checkHighScalabilityStamp) - + local okToStampTerrainBlock = + checkTerrainBlockCollisions(cellPos, checkHighScalabilityStamp) + if okToStampTerrainBlock then if waterForceTag then - cluster:SetWaterCell(cellPos.X, cellPos.Y, cellPos.Z, Enum.WaterForce[waterForceTag.Value], Enum.WaterDirection[waterForceDirectionTag.Value]) + cluster:SetWaterCell( + cellPos.X, + cellPos.Y, + cellPos.Z, + Enum.WaterForce[waterForceTag.Value], + Enum.WaterDirection[waterForceDirectionTag.Value] + ) else - cluster:SetCell(cellPos.X, cellPos.Y, cellPos.Z, clusterMaterial, clusterType, clusterOrientation) + cluster:SetCell( + cellPos.X, + cellPos.Y, + cellPos.Z, + clusterMaterial, + clusterType, + clusterOrientation + ) end - cellSet = true - + cellSet = true + -- auto-wedge it? - if (autoWedgeClusterParts) then - game.Workspace.Terrain:AutowedgeCells(Region3int16.new(Vector3int16.new(cellPos.x - 1, cellPos.y - 1, cellPos.z - 1), - Vector3int16.new(cellPos.x + 1, cellPos.y + 1, cellPos.z + 1))) + if autoWedgeClusterParts then + game.Workspace.Terrain:AutowedgeCells( + Region3int16.new( + Vector3int16.new(cellPos.x - 1, cellPos.y - 1, cellPos.z - 1), + Vector3int16.new(cellPos.x + 1, cellPos.y + 1, cellPos.z + 1) + ) + ) end end end stepVect[1] = stepVect[1] + incrementVect[1] end if incrementVect[2] then - while innerStepVectIndex < 4 and worldAxes[innerStepVectIndex]:Dot(incrementVect[2]) == 0 do + while + innerStepVectIndex < 4 + and worldAxes[innerStepVectIndex]:Dot(incrementVect[2]) == 0 + do innerStepVectIndex = innerStepVectIndex + 1 end - if innerStepVectIndex < 4 then - stepVect[2] = stepVect[2] + worldAxes[innerStepVectIndex] * worldAxes[innerStepVectIndex]:Dot(incrementVect[2]) + if innerStepVectIndex < 4 then + stepVect[2] = stepVect[2] + + worldAxes[innerStepVectIndex] + * worldAxes[innerStepVectIndex]:Dot(incrementVect[2]) end innerStepVectIndex = innerStepVectIndex + 1 else stepVect[2] = Vector3.new(1, 0, 0) innerStepVectIndex = 4 -- skip all remaining loops - end - if (stepVect[2].magnitude*4 > lines[2].magnitude) then innerStepVectIndex = 4 end + end + if stepVect[2].magnitude * 4 > lines[2].magnitude then + innerStepVectIndex = 4 + end end end - if incrementVect[3] then + if incrementVect[3] then while outerStepVectIndex < 4 and worldAxes[outerStepVectIndex]:Dot(incrementVect[3]) == 0 do outerStepVectIndex = outerStepVectIndex + 1 end if outerStepVectIndex < 4 then - stepVect[3] = stepVect[3] + worldAxes[outerStepVectIndex] * worldAxes[outerStepVectIndex]:Dot(incrementVect[3]) + stepVect[3] = stepVect[3] + + worldAxes[outerStepVectIndex] + * worldAxes[outerStepVectIndex]:Dot(incrementVect[3]) end outerStepVectIndex = outerStepVectIndex + 1 else -- skip all remaining loops - stepVect[3] = Vector3.new(1, 0, 0) outerStepVectIndex = 4 - end - if (stepVect[3].magnitude*4 > lines[3].magnitude) then outerStepVectIndex = 4 end + stepVect[3] = Vector3.new(1, 0, 0) + outerStepVectIndex = 4 + end + if stepVect[3].magnitude * 4 > lines[3].magnitude then + outerStepVectIndex = 4 + end end end end @@ -1632,51 +1888,55 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp -- and also get rid of any HighScalabilityLine stuff if it's there HighScalabilityLine.Start = nil HighScalabilityLine.Adorn.Parent = nil - + -- Mark for undo. if cellSet then stampData.CurrentParts.Parent = nil - pcall(function() game:GetService("ChangeHistoryService"): SetWaypoint("StamperMulti") end) + pcall(function() + game:GetService("ChangeHistoryService"):SetWaypoint "StamperMulti" + end) end - + return cellSet end - + local function DoStamperMouseUp(Mouse) if not Mouse then - error("Error: RbxStamper.DoStamperMouseUp: Mouse is nil") + error "Error: RbxStamper.DoStamperMouseUp: Mouse is nil" return false end - if not Mouse:IsA("Mouse") then - error("Error: RbxStamper.DoStamperMouseUp: Mouse is of type", Mouse.className,"should be of type Mouse") + if not Mouse:IsA "Mouse" then + error("Error: RbxStamper.DoStamperMouseUp: Mouse is of type", Mouse.className, "should be of type Mouse") return false end if not stampData.Dragger then - error("Error: RbxStamper.DoStamperMouseUp: stampData.Dragger is nil") + error "Error: RbxStamper.DoStamperMouseUp: stampData.Dragger is nil" return false end - + if not HighScalabilityLine then return false end - + local checkHighScalabilityStamp = nil if stampInModel then local canStamp = nil local isHSLPart = isMegaClusterPart() - - if isHSLPart and - HighScalabilityLine and - HighScalabilityLine.Start and - HighScalabilityLine.InternalLine and - HighScalabilityLine.InternalLine.magnitude > 0 then -- we have an HSL line, test later - canStamp = true - checkHighScalabilityStamp = true + + if + isHSLPart + and HighScalabilityLine + and HighScalabilityLine.Start + and HighScalabilityLine.InternalLine + and HighScalabilityLine.InternalLine.magnitude > 0 + then -- we have an HSL line, test later + canStamp = true + checkHighScalabilityStamp = true else canStamp, checkHighScalabilityStamp = t.CanEditRegion(stampData.CurrentParts, allowedStampRegion) end - + if not canStamp then if stampFailedFunc then stampFailedFunc() @@ -1690,7 +1950,7 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp flashRedBox() return false end - + -- recheck if we can stamp, as we just moved part canStamp, checkHighScalabilityStamp = t.CanEditRegion(stampData.CurrentParts, allowedStampRegion) if not canStamp then @@ -1698,29 +1958,29 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp stampFailedFunc() end return false - end + end -- Prevent part from being stamped on top of a player local minBB, maxBB = getBoundingBoxInWorldCoordinates(stampData.CurrentParts) - -- HotThoth's note: Now that above CurrentParts positioning has been commented out, to be truly correct, we would need to use the + -- HotThoth's note: Now that above CurrentParts positioning has been commented out, to be truly correct, we would need to use the -- value of configFound from the previous onStamperMouseMove call which moved the CurrentParts -- Shouldn't this be true when lastTargetCFrame has been set and false otherwise? configFound, targetCFrame = findConfigAtMouseTarget(Mouse, stampData) if configFound and not HighScalabilityLine.Adorn.Parent then - if clusterPartsInRegion(minBB + insertBoundingBoxOverlapVector, maxBB - insertBoundingBoxOverlapVector) then + if clusterPartsInRegion(minBB + insertBoundingBoxOverlapVector, maxBB - insertBoundingBoxOverlapVector) then flashRedBox() return false end - local blockingParts = game.Workspace:FindPartsInRegion3(Region3.new(minBB + insertBoundingBoxOverlapVector, - maxBB - insertBoundingBoxOverlapVector), - stampData.CurrentParts, - 100) - - + local blockingParts = game.Workspace:FindPartsInRegion3( + Region3.new(minBB + insertBoundingBoxOverlapVector, maxBB - insertBoundingBoxOverlapVector), + stampData.CurrentParts, + 100 + ) + for b = 1, #blockingParts do if isBlocker(blockingParts[b]) then flashRedBox() @@ -1729,43 +1989,45 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp end local alreadyPushedUp = {} - -- if no blocking model below, then see if stamping on top of a character - for b = 1, #blockingParts do - if blockingParts[b].Parent and - not alreadyPushedUp[blockingParts[b].Parent] and - blockingParts[b].Parent:FindFirstChild("Humanoid") and - blockingParts[b].Parent:FindFirstChild("Humanoid"):IsA("Humanoid") then + -- if no blocking model below, then see if stamping on top of a character + for b = 1, #blockingParts do + if + blockingParts[b].Parent + and not alreadyPushedUp[blockingParts[b].Parent] + and blockingParts[b].Parent:FindFirstChild "Humanoid" + and blockingParts[b].Parent:FindFirstChild("Humanoid"):IsA "Humanoid" + then --------------------------------------------------------------------------- - local blockingPersonTorso = blockingParts[b].Parent:FindFirstChild("Torso") - alreadyPushedUp[blockingParts[b].Parent] = true + local blockingPersonTorso = blockingParts[b].Parent:FindFirstChild "Torso" + alreadyPushedUp[blockingParts[b].Parent] = true - if blockingPersonTorso then - -- if so, let's push the person upwards so they pop on top of the stamped model/part (but only if there's space above them) - local newY = maxBB.Y + 3 - if spaceAboveCharacter(blockingPersonTorso, newY, stampData) then - blockingPersonTorso.CFrame = blockingPersonTorso.CFrame + Vector3.new(0, newY - blockingPersonTorso.CFrame.p.Y, 0) - else - -- if no space, we just error - flashRedBox() - return false - end - end - --------------------------------------------------------------------------- + if blockingPersonTorso then + -- if so, let's push the person upwards so they pop on top of the stamped model/part (but only if there's space above them) + local newY = maxBB.Y + 3 + if spaceAboveCharacter(blockingPersonTorso, newY, stampData) then + blockingPersonTorso.CFrame = blockingPersonTorso.CFrame + + Vector3.new(0, newY - blockingPersonTorso.CFrame.p.Y, 0) + else + -- if no space, we just error + flashRedBox() + return false + end end + --------------------------------------------------------------------------- end - + end elseif (not configFound) and not (HighScalabilityLine.Start and HighScalabilityLine.Adorn.Parent) then -- if no config then only stamp if it's a real HSL! resetHighScalabilityLine() return false end -- something will be stamped! so set the "StampedSomething" toggle to true - if game:FindFirstChild("Players") then + if game:FindFirstChild "Players" 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 + local stampTracker = localChar:FindFirstChild "StampTracker" + if stampTracker and not stampTracker.Value then stampTracker.Value = true end end @@ -1784,7 +2046,7 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp -- not High-Scalability-Line-Based, so behave normally [and get rid of any HSL stuff] HighScalabilityLine.Start = nil HighScalabilityLine.Adorn.Parent = nil - + local cluster = game.Workspace.Terrain -- if target point is in cluster, just use cluster:SetCell @@ -1793,35 +2055,65 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp --local cellPos = cluster:WorldToCell(targetCFrame.p) local cellPos - if stampData.CurrentParts:IsA("Model") then cellPos = cluster:WorldToCell(stampData.CurrentParts:GetModelCFrame().p) - else cellPos = cluster:WorldToCell(stampData.CurrentParts.CFrame.p) end + if stampData.CurrentParts:IsA "Model" then + cellPos = cluster:WorldToCell(stampData.CurrentParts:GetModelCFrame().p) + else + cellPos = cluster:WorldToCell(stampData.CurrentParts.CFrame.p) + end local cMax = game.Workspace.Terrain.MaxExtents.Max local cMin = game.Workspace.Terrain.MaxExtents.Min - - if checkTerrainBlockCollisions(cellPos, false) then + if checkTerrainBlockCollisions(cellPos, false) then local clusterValues = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) local waterForceTag = stampData.CurrentParts:FindFirstChild("WaterForceTag", true) local waterForceDirectionTag = stampData.CurrentParts:FindFirstChild("WaterForceDirectionTag", true) - if cellPos.X >= cMin.X and cellPos.Y >= cMin.Y and cellPos.Z >= cMin.Z and cellPos.X < cMax.X and cellPos.Y < cMax.Y and cellPos.Z < cMax.Z then - + if + cellPos.X >= cMin.X + and cellPos.Y >= cMin.Y + and cellPos.Z >= cMin.Z + and cellPos.X < cMax.X + and cellPos.Y < cMax.Y + and cellPos.Z < cMax.Z + then if waterForceTag then - cluster:SetWaterCell(cellPos.X, cellPos.Y, cellPos.Z, Enum.WaterForce[waterForceTag.Value], Enum.WaterDirection[waterForceDirectionTag.Value]) + cluster:SetWaterCell( + cellPos.X, + cellPos.Y, + cellPos.Z, + Enum.WaterForce[waterForceTag.Value], + Enum.WaterDirection[waterForceDirectionTag.Value] + ) elseif not clusterValues then - cluster:SetCell(cellPos.X, cellPos.Y, cellPos.Z, cellInfo.Material, cellInfo.clusterType, gInitial90DegreeRotations % 4) - elseif clusterValues:IsA("Vector3Value") then - cluster:SetCell(cellPos.X, cellPos.Y, cellPos.Z, clusterValues.Value.X, clusterValues.Value.Y, clusterValues.Value.Z) + cluster:SetCell( + cellPos.X, + cellPos.Y, + cellPos.Z, + cellInfo.Material, + cellInfo.clusterType, + gInitial90DegreeRotations % 4 + ) + elseif clusterValues:IsA "Vector3Value" then + cluster:SetCell( + cellPos.X, + cellPos.Y, + cellPos.Z, + clusterValues.Value.X, + clusterValues.Value.Y, + clusterValues.Value.Z + ) else cluster:SetCell(cellPos.X, cellPos.Y, cellPos.Z, clusterValues.Value, 0, 0) end - + local autoWedgeClusterParts = false - if stampData.CurrentParts:FindFirstChild("AutoWedge") then autoWedgeClusterParts = true end - + if stampData.CurrentParts:FindFirstChild "AutoWedge" then + autoWedgeClusterParts = true + end + -- auto-wedge it - if (autoWedgeClusterParts) then + if autoWedgeClusterParts then game.Workspace.Terrain:AutowedgeCells( Region3int16.new( Vector3int16.new(cellPos.x - 1, cellPos.y - 1, cellPos.z - 1), @@ -1832,31 +2124,32 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp -- kill the ghost part stampData.CurrentParts.Parent = nil - + -- Mark for undo. It has to happen here or the selection display will come back also. - pcall(function() game:GetService("ChangeHistoryService"):SetWaypoint("StamperSingle") end) + pcall(function() + game:GetService("ChangeHistoryService"):SetWaypoint "StamperSingle" + end) return true end - else + else -- you tried to stamp a HSL-single part where one does not belong! flashRedBox() return false end end - + local function getPlayer() - if game:FindFirstChild("Players") then + if game:FindFirstChild "Players" then if game.Players["LocalPlayer"] then return game.Players.LocalPlayer end end return nil end - -- Post process: after positioning the part or model, restore transparency, material, anchored and collide states and create joints - if stampData.CurrentParts:IsA("Model") or stampData.CurrentParts:IsA("Tool") then - if stampData.CurrentParts:IsA("Model") then + if stampData.CurrentParts:IsA "Model" or stampData.CurrentParts:IsA "Tool" then + if stampData.CurrentParts:IsA "Model" then -- Tyler's magical hack-code for allowing/preserving clones of both Surface and Manual Welds... just don't ask X< local manualWeldTable = {} local manualWeldParentTable = {} @@ -1865,42 +2158,50 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp stampData.CurrentParts:MakeJoints() restoreTheWelds(manualWeldTable, manualWeldParentTable) end - + -- if it's a model, we also want to fill in the playerID and playerName tags, if it has those (e.g. for the friend-only door) - playerIdTag = stampData.CurrentParts:FindFirstChild("PlayerIdTag") - playerNameTag = stampData.CurrentParts:FindFirstChild("PlayerNameTag") + playerIdTag = stampData.CurrentParts:FindFirstChild "PlayerIdTag" + playerNameTag = stampData.CurrentParts:FindFirstChild "PlayerNameTag" if playerIdTag ~= nil then tempPlayerValue = getPlayer() - if tempPlayerValue ~= nil then playerIdTag.Value = tempPlayerValue.userId end + if tempPlayerValue ~= nil then + playerIdTag.Value = tempPlayerValue.userId + end end if playerNameTag ~= nil then - if game:FindFirstChild("Players") and game.Players["LocalPlayer"] then + if game:FindFirstChild "Players" and game.Players["LocalPlayer"] then tempPlayerValue = game.Players.LocalPlayer - if tempPlayerValue ~= nil then playerNameTag.Value = tempPlayerValue.Name end + if tempPlayerValue ~= nil then + playerNameTag.Value = tempPlayerValue.Name + end end end -- ...and tag all inserted models for subsequent origin identification -- if no RobloxModel tag already exists, then add it. - if stampData.CurrentParts:FindFirstChild("RobloxModel") == nil then - local stringTag = Instance.new("BoolValue", stampData.CurrentParts) + if stampData.CurrentParts:FindFirstChild "RobloxModel" == nil then + local stringTag = Instance.new("BoolValue") stringTag.Name = "RobloxModel" + stringTag.Parent = stampData.CurrentParts - if stampData.CurrentParts:FindFirstChild("RobloxStamper") == nil then - local stringTag2 = Instance.new("BoolValue", stampData.CurrentParts) + if stampData.CurrentParts:FindFirstChild "RobloxStamper" == nil then + local stringTag2 = Instance.new("BoolValue") stringTag2.Name = "RobloxStamper" + stringTag2.Parent = stampData.CurrentParts end end - else stampData.CurrentParts:BreakJoints() - if stampData.CurrentParts:FindFirstChild("RobloxStamper") == nil then - local stringTag2 = Instance.new("BoolValue", stampData.CurrentParts) + if stampData.CurrentParts:FindFirstChild "RobloxStamper" == nil then + local stringTag2 = Instance.new("BoolValue") stringTag2.Name = "RobloxStamper" + stringTag2.Parent = stampData.CurrentParts end end - + -- make sure all the joints are activated before restoring anchor states - if not createJoints then game.JointsService:CreateJoinAfterMoveJoints() end + if not createJoints then + game.JointsService:CreateJoinAfterMoveJoints() + end -- Restore the original properties for all parts being stamped for part, transparency in pairs(stampData.TransparencyTable) do @@ -1942,57 +2243,64 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp -- ...and tag all inserted models for subsequent origin identification -- if no RobloxModel tag already exists, then add it. - if stampData.CurrentParts:FindFirstChild("RobloxModel") == nil then - local stringTag = Instance.new("BoolValue", stampData.CurrentParts) + if stampData.CurrentParts:FindFirstChild "RobloxModel" == nil then + local stringTag = Instance.new("BoolValue") stringTag.Name = "RobloxModel" + stringTag.Parent = stampData.CurrentParts end -- and make sure we don't delete it, now that it's not a ghost part - if ghostRemovalScript then ghostRemovalScript.Parent = nil end + if ghostRemovalScript then + ghostRemovalScript.Parent = nil + end --Re-enable the scripts - for index,script in pairs(stampData.DisabledScripts) do + for index, script in pairs(stampData.DisabledScripts) do script.Disabled = false end - + --Now that they are all marked enabled, reinsert them into the world so they start running - for index,script in pairs(stampData.DisabledScripts) do + for index, script in pairs(stampData.DisabledScripts) do local oldParent = script.Parent script.Parent = nil script:Clone().Parent = oldParent end - + -- clear out more data stampData.DisabledScripts = nil stampData.Dragger = nil stampData.CurrentParts = nil - - pcall(function() game:GetService("ChangeHistoryService"): SetWaypoint("StampedObject") end) + + pcall(function() + game:GetService("ChangeHistoryService"):SetWaypoint "StampedObject" + end) return true end - + local function pauseStamper() for i = 1, #mouseCons do -- stop the mouse from doing anything mouseCons[i]:disconnect() mouseCons[i] = nil end mouseCons = {} - + if stampData and stampData.CurrentParts then -- remove our ghost part stampData.CurrentParts.Parent = nil stampData.CurrentParts:Remove() end - + resetHighScalabilityLine() - + game.JointsService:ClearJoinAfterMoveJoints() end - local function prepareUnjoinableSurfaces(modelCFrame, parts, whichSurface) - local AXIS_VECTORS = {Vector3.new(1, 0, 0), Vector3.new(0, 1, 0), Vector3.new(0, 0, 1)} -- maybe last one is negative? TODO: check this! + local AXIS_VECTORS = { 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 end + if whichSurface < 0 then + isPositive = isPositive * -1 + whichSurface = whichSurface * -1 + end local surfaceNormal = isPositive * modelCFrame:vectorToWorldSpace(AXIS_VECTORS[whichSurface]) for i = 1, #parts do @@ -2002,15 +2310,31 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp local surfaceNormalInLocalCoords = currPart.CFrame:vectorToObjectSpace(surfaceNormal) if math.abs(surfaceNormalInLocalCoords.X) > math.abs(surfaceNormalInLocalCoords.Y) then if math.abs(surfaceNormalInLocalCoords.X) > math.abs(surfaceNormalInLocalCoords.Z) then - if surfaceNormalInLocalCoords.X > 0 then currPart.RightSurface = "Unjoinable" else currPart.LeftSurface = "Unjoinable" end + if surfaceNormalInLocalCoords.X > 0 then + currPart.RightSurface = "Unjoinable" + else + currPart.LeftSurface = "Unjoinable" + end else - if surfaceNormalInLocalCoords.Z > 0 then currPart.BackSurface = "Unjoinable" else currPart.FrontSurface = "Unjoinable" end + if surfaceNormalInLocalCoords.Z > 0 then + currPart.BackSurface = "Unjoinable" + else + currPart.FrontSurface = "Unjoinable" + end end else if math.abs(surfaceNormalInLocalCoords.Y) > math.abs(surfaceNormalInLocalCoords.Z) then - if surfaceNormalInLocalCoords.Y > 0 then currPart.TopSurface = "Unjoinable" else currPart.BottomSurface = "Unjoinable" end + if surfaceNormalInLocalCoords.Y > 0 then + currPart.TopSurface = "Unjoinable" + else + currPart.BottomSurface = "Unjoinable" + end else - if surfaceNormalInLocalCoords.Z > 0 then currPart.BackSurface = "Unjoinable" else currPart.FrontSurface = "Unjoinable" end + if surfaceNormalInLocalCoords.Z > 0 then + currPart.BackSurface = "Unjoinable" + else + currPart.FrontSurface = "Unjoinable" + end end end end @@ -2028,7 +2352,7 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp if unjoinableTag then for unjoinableSurface in string.gmatch(unjoinableTag.Value, "[^,]*") do if tonumber(unjoinableSurface) then - if clone:IsA("Model") then + if clone:IsA "Model" then prepareUnjoinableSurfaces(clone:GetModelCFrame(), parts, tonumber(unjoinableSurface)) else prepareUnjoinableSurfaces(clone.CFrame, parts, tonumber(unjoinableSurface)) @@ -2043,139 +2367,157 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp else clone.Parent = game.Workspace end - + if clone:FindFirstChild("ClusterMaterial", true) then -- extract all info from vector clusterMaterial = clone:FindFirstChild("ClusterMaterial", true) - if (clusterMaterial:IsA("Vector3Value")) then + if clusterMaterial:IsA "Vector3Value" then cellInfo.Material = clusterMaterial.Value.X cellInfo.clusterType = clusterMaterial.Value.Y cellInfo.clusterOrientation = clusterMaterial.Value.Z - elseif clusterMaterial:IsA("IntValue") then + elseif clusterMaterial:IsA "IntValue" then cellInfo.Material = clusterMaterial.Value end end - - pcall(function() mouseTarget = Mouse.Target end) - if mouseTarget and mouseTarget.Parent:FindFirstChild("RobloxModel") == nil then + pcall(function() + mouseTarget = Mouse.Target + end) + + if mouseTarget and mouseTarget.Parent:FindFirstChild "RobloxModel" == nil then game.JointsService:SetJoinAfterMoveTarget(mouseTarget) else game.JointsService:SetJoinAfterMoveTarget(nil) end game.JointsService:ShowPermissibleJoints() - + for index, object in pairs(stampData.DisabledScripts) do if object.Name == "GhostRemovalScript" then object.Parent = stampData.CurrentParts end end - - stampData.Dragger = Instance.new("Dragger") - + + stampData.Dragger = Instance.new "Dragger" + --Begin a movement by faking a MouseDown signal - stampData.Dragger:MouseDown(parts[1], Vector3.new(0,0,0), parts) + stampData.Dragger:MouseDown(parts[1], Vector3.new(0, 0, 0), parts) stampData.Dragger:MouseUp() - + DoStamperMouseMove(Mouse) - - table.insert(mouseCons,Mouse.Move:connect(function() - if movingLock or stampUpLock then return end - movingLock = true + + table.insert( + mouseCons, + Mouse.Move:connect(function() + if movingLock or stampUpLock then + return + end + movingLock = true DoStamperMouseMove(Mouse) - movingLock = false - end)) - - table.insert(mouseCons,Mouse.Button1Down:connect(function() - DoStamperMouseDown(Mouse) - end)) - - table.insert(mouseCons,Mouse.Button1Up:connect(function() - stampUpLock = true - while movingLock do wait() end + movingLock = false + end) + ) + + table.insert( + mouseCons, + Mouse.Button1Down:connect(function() + DoStamperMouseDown(Mouse) + end) + ) + + table.insert( + mouseCons, + Mouse.Button1Up:connect(function() + stampUpLock = true + while movingLock do + wait() + end stamped.Value = DoStamperMouseUp(Mouse) resetHighScalabilityLine() - stampUpLock = false - end)) - + stampUpLock = false + end) + ) + stamped.Value = false end - + local function resetStamperState(newModelToStamp) - -- if we have a new model, swap it out if newModelToStamp then - if not newModelToStamp:IsA("Model") and not newModelToStamp:IsA("BasePart") then - error("resetStamperState: newModelToStamp (first arg) is not nil, but not a model or part!") + if not newModelToStamp:IsA "Model" and not newModelToStamp:IsA "BasePart" then + error "resetStamperState: newModelToStamp (first arg) is not nil, but not a model or part!" end modelToStamp = newModelToStamp end - + -- first clear our state pauseStamper() -- now lets load in the new model resumeStamper() - end - + -- load the model initially resetStamperState() - - + -- setup the control table we pass back to the user control.Stamped = stamped -- BoolValue that fires when user stamps control.Paused = false - + control.LoadNewModel = function(newStampModel) -- allows us to specify a new stamper model to be used with this stamper - if newStampModel and not newStampModel:IsA("Model") and not newStampModel:IsA("BasePart") then - error("Control.LoadNewModel: newStampModel (first arg) is not a Model or Part!") + if newStampModel and not newStampModel:IsA "Model" and not newStampModel:IsA "BasePart" then + error "Control.LoadNewModel: newStampModel (first arg) is not a Model or Part!" return nil end resetStamperState(newStampModel) end - + control.ReloadModel = function() -- will automatically set stamper to get a new model of current model and start stamping with new model resetStamperState() end - + control.Pause = function() -- temporarily stops stamping, use resume to start up again if not control.Paused then pauseStamper() control.Paused = true else - print("RbxStamper Warning: Tried to call Control.Pause() when already paused") + print "RbxStamper Warning: Tried to call Control.Pause() when already paused" end end - + control.Resume = function() -- resumes stamping, if currently paused if control.Paused then resumeStamper() control.Paused = false else - print("RbxStamper Warning: Tried to call Control.Resume() without Pausing First") + print "RbxStamper Warning: Tried to call Control.Resume() without Pausing First" end end - + control.ResetRotation = function() -- resets the model rotation so new models are at default orientation -- gInitial90DegreeRotations = 0 -- Note: This function will not always work quite the way we want it to; we will have to build this out further so it works with -- High-Scalability and with the new model orientation setting methods (model:ResetOrientationToIdentity()) [HotThoth] end - + control.Destroy = function() -- Stops current Stamp operation and destroys control construct for i = 1, #mouseCons do mouseCons[i]:disconnect() mouseCons[i] = nil end - + if keyCon then keyCon:disconnect() end - + game.JointsService:ClearJoinAfterMoveJoints() - - if adorn then adorn:Destroy() end - if adornPart then adornPart:Destroy() end - if errorBox then errorBox:Destroy() end + + if adorn then + adorn:Destroy() + end + if adornPart then + adornPart:Destroy() + end + if errorBox then + errorBox:Destroy() + end if stampData then if stampData["Dragger"] then stampData.Dragger:Destroy() @@ -2193,15 +2535,14 @@ t.SetupStamperDragger = function(modelToStamp, Mouse, StampInModel, AllowedStamp return control end -t.Help = - function(funcNameOrFunc) - --input argument can be a string or a function. Should return a description (of arguments and expected side effects) - if funcNameOrFunc == "GetStampModel" or funcNameOrFunc == t.GetStampModel then - return "Function GetStampModel. Arguments: assetId, useAssetVersionId. assetId is the asset to load in, define useAssetVersionId as true if assetId is a version id instead of a relative assetId. Side effect: returns a model of the assetId, or a string with error message if something fails" - end - if funcNameOrFunc == "SetupStamperDragger" or funcNameOrFunc == t.SetupStamperDragger then - return "Function SetupStamperDragger. Side Effect: Creates 4x4 stamping mechanism for building out parts quickly. Arguments: ModelToStamp, Mouse, LegalStampCheckFunction. ModelToStamp should be a Model or Part, preferrably loaded from RbxStamper.GetStampModel and should have extents that are multiples of 4. Mouse should be a mouse object (obtained from things such as Tool.OnEquipped), used to drag parts around 'stamp' them out. LegalStampCheckFunction is optional, used as a callback with a table argument (table is full of instances about to be stamped). Function should return either true or false, false stopping the stamp action." - end +t.Help = function(funcNameOrFunc) + --input argument can be a string or a function. Should return a description (of arguments and expected side effects) + if funcNameOrFunc == "GetStampModel" or funcNameOrFunc == t.GetStampModel then + return "Function GetStampModel. Arguments: assetId, useAssetVersionId. assetId is the asset to load in, define useAssetVersionId as true if assetId is a version id instead of a relative assetId. Side effect: returns a model of the assetId, or a string with error message if something fails" end + if funcNameOrFunc == "SetupStamperDragger" or funcNameOrFunc == t.SetupStamperDragger then + return "Function SetupStamperDragger. Side Effect: Creates 4x4 stamping mechanism for building out parts quickly. Arguments: ModelToStamp, Mouse, LegalStampCheckFunction. ModelToStamp should be a Model or Part, preferrably loaded from RbxStamper.GetStampModel and should have extents that are multiples of 4. Mouse should be a mouse object (obtained from things such as Tool.OnEquipped), used to drag parts around 'stamp' them out. LegalStampCheckFunction is optional, used as a callback with a table argument (table is full of instances about to be stamped). Function should return either true or false, false stopping the stamp action." + end +end return t diff --git a/89449008.lua b/89449008.lua index 1ecbd88..e27464b 100644 --- a/89449008.lua +++ b/89449008.lua @@ -3,7 +3,7 @@ local function waitForChild(instance, name) assert(instance) assert(name) while not instance:FindFirstChild(name) do - print('Waiting for ...', instance, name) + print("Waiting for ...", instance, name) instance.ChildAdded:wait() end return instance:FindFirstChild(name) @@ -18,23 +18,26 @@ end local function IsTouchDevice() local touchEnabled = false - pcall(function() touchEnabled = Game:GetService('UserInputService').TouchEnabled end) - return touchEnabled -end + pcall(function() + touchEnabled = Game:GetService("UserInputService").TouchEnabled + end) + return touchEnabled +end - -waitForChild(game,"Players") -waitForProperty(game.Players,"LocalPlayer") +waitForChild(game, "Players") +waitForProperty(game.Players, "LocalPlayer") local player = game.Players.LocalPlayer -local RbxGui, msg = LoadLibrary("RbxGui") -if not RbxGui then print("could not find RbxGui!") return end +local RbxGui, _ = LoadLibrary "RbxGui" +if not RbxGui then + print "could not find RbxGui!" + return +end --- Begin Locals local StaticTabName = "gear" local backpack = script.Parent -local screen = script.Parent.Parent local backpackItems = {} local buttons = {} @@ -49,67 +52,67 @@ local characterChildAddedCon = nil local characterChildRemovedCon = nil local backpackAddCon = nil -local playerBackpack = waitForChild(player,"Backpack") +local playerBackpack = waitForChild(player, "Backpack") -waitForChild(backpack,"Tabs") +waitForChild(backpack, "Tabs") -waitForChild(backpack,"Gear") -local gearPreview = waitForChild(backpack.Gear,"GearPreview") +waitForChild(backpack, "Gear") +local gearPreview = waitForChild(backpack.Gear, "GearPreview") -local scroller = waitForChild(backpack.Gear,"GearGridScrollingArea") +local scroller = waitForChild(backpack.Gear, "GearGridScrollingArea") -local currentLoadout = waitForChild(backpack.Parent,"CurrentLoadout") +local currentLoadout = waitForChild(backpack.Parent, "CurrentLoadout") -local grid = waitForChild(backpack.Gear,"GearGrid") -local gearButton = waitForChild(grid,"GearButton") +local grid = waitForChild(backpack.Gear, "GearGrid") +local gearButton = waitForChild(grid, "GearButton") -local swapSlot = waitForChild(script.Parent,"SwapSlot") +local swapSlot = waitForChild(script.Parent, "SwapSlot") -local backpackManager = waitForChild(script.Parent,"CoreScripts/BackpackScripts/BackpackManager") -local backpackOpenEvent = waitForChild(backpackManager,"BackpackOpenEvent") -local backpackCloseEvent = waitForChild(backpackManager,"BackpackCloseEvent") -local tabClickedEvent = waitForChild(backpackManager,"TabClickedEvent") -local resizeEvent = waitForChild(backpackManager,"ResizeEvent") -local searchRequestedEvent = waitForChild(backpackManager,"SearchRequestedEvent") -local tellBackpackReadyFunc = waitForChild(backpackManager,"BackpackReady") +local backpackManager = waitForChild(script.Parent, "CoreScripts/BackpackScripts/BackpackManager") +local backpackOpenEvent = waitForChild(backpackManager, "BackpackOpenEvent") +local backpackCloseEvent = waitForChild(backpackManager, "BackpackCloseEvent") +local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent") +local resizeEvent = waitForChild(backpackManager, "ResizeEvent") +local searchRequestedEvent = waitForChild(backpackManager, "SearchRequestedEvent") +local tellBackpackReadyFunc = waitForChild(backpackManager, "BackpackReady") -- creating scroll bar early as to make sure items get placed correctly local scrollFrame, scrollUp, scrollDown, recalculateScroll = RbxGui.CreateScrollingFrame(nil, "grid", Vector2.new(6, 6)) -scrollFrame.Position = UDim2.new(0,0,0,30) -scrollFrame.Size = UDim2.new(1,0,1,-30) +scrollFrame.Position = UDim2.new(0, 0, 0, 30) +scrollFrame.Size = UDim2.new(1, 0, 1, -30) scrollFrame.Parent = backpack.Gear.GearGrid -local scrollBar = Instance.new("Frame") +local scrollBar = Instance.new "Frame" scrollBar.Name = "ScrollBar" scrollBar.BackgroundTransparency = 0.9 -scrollBar.BackgroundColor3 = Color3.new(1,1,1) +scrollBar.BackgroundColor3 = Color3.new(1, 1, 1) scrollBar.BorderSizePixel = 0 scrollBar.Size = UDim2.new(0, 17, 1, -36) -scrollBar.Position = UDim2.new(0,0,0,18) +scrollBar.Position = UDim2.new(0, 0, 0, 18) scrollBar.Parent = scroller -scrollDown.Position = UDim2.new(0,0,1,-17) +scrollDown.Position = UDim2.new(0, 0, 1, -17) scrollUp.Parent = scroller scrollDown.Parent = scroller local scrollFrameLoadout, scrollUpLoadout, scrollDownLoadout, recalculateScrollLoadout = RbxGui.CreateScrollingFrame() -scrollFrameLoadout.Position = UDim2.new(0,0,0,0) -scrollFrameLoadout.Size = UDim2.new(1,0,1,0) +scrollFrameLoadout.Position = UDim2.new(0, 0, 0, 0) +scrollFrameLoadout.Size = UDim2.new(1, 0, 1, 0) scrollFrameLoadout.Parent = backpack.Gear.GearLoadouts.LoadoutsList -local LoadoutButton = Instance.new("TextButton") +local LoadoutButton = Instance.new "TextButton" LoadoutButton.RobloxLocked = true LoadoutButton.Name = "LoadoutButton" LoadoutButton.Font = Enum.Font.ArialBold LoadoutButton.FontSize = Enum.FontSize.Size14 -LoadoutButton.Position = UDim2.new(0,0,0,0) -LoadoutButton.Size = UDim2.new(1,0,0,32) +LoadoutButton.Position = UDim2.new(0, 0, 0, 0) +LoadoutButton.Size = UDim2.new(1, 0, 0, 32) LoadoutButton.Style = Enum.ButtonStyle.RobloxButton LoadoutButton.Text = "Loadout #1" -LoadoutButton.TextColor3 = Color3.new(1,1,1) +LoadoutButton.TextColor3 = Color3.new(1, 1, 1) LoadoutButton.Parent = scrollFrameLoadout local LoadoutButtonTwo = LoadoutButton:clone() @@ -124,39 +127,38 @@ local LoadoutButtonFour = LoadoutButton:clone() LoadoutButtonFour.Text = "Loadout #4" LoadoutButtonFour.Parent = scrollFrameLoadout -local scrollBarLoadout = Instance.new("Frame") +local scrollBarLoadout = Instance.new "Frame" scrollBarLoadout.Name = "ScrollBarLoadout" scrollBarLoadout.BackgroundTransparency = 0.9 -scrollBarLoadout.BackgroundColor3 = Color3.new(1,1,1) +scrollBarLoadout.BackgroundColor3 = Color3.new(1, 1, 1) scrollBarLoadout.BorderSizePixel = 0 scrollBarLoadout.Size = UDim2.new(0, 17, 1, -36) -scrollBarLoadout.Position = UDim2.new(0,0,0,18) +scrollBarLoadout.Position = UDim2.new(0, 0, 0, 18) scrollBarLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea -scrollDownLoadout.Position = UDim2.new(0,0,1,-17) +scrollDownLoadout.Position = UDim2.new(0, 0, 1, -17) scrollUpLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea scrollDownLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea - -- Begin Functions -function removeFromMap(map,object) +function removeFromMap(map, object) for i = 1, #map do if map[i] == object then - table.remove(map,i) + table.remove(map, i) break end end end function robloxLock(instance) - instance.RobloxLocked = true - children = instance:GetChildren() - if children then - for i, child in ipairs(children) do - robloxLock(child) - end - end + instance.RobloxLocked = true + children = instance:GetChildren() + if children then + for _, child in ipairs(children) do + robloxLock(child) + end + end end function resize() @@ -167,27 +169,31 @@ function resize() size = gearPreview.AbsoluteSize.Y * 0.75 end - waitForChild(gearPreview,"GearImage") - gearPreview.GearImage.Size = UDim2.new(0,size,0,size) - gearPreview.GearImage.Position = UDim2.new(0,gearPreview.AbsoluteSize.X/2 - size/2,0.75,-size) - + waitForChild(gearPreview, "GearImage") + gearPreview.GearImage.Size = UDim2.new(0, size, 0, size) + gearPreview.GearImage.Position = UDim2.new(0, gearPreview.AbsoluteSize.X / 2 - size / 2, 0.75, -size) + resizeGrid() end function addToGrid(child) - if not child:IsA("Tool") then - if not child:IsA("HopperBin") then + if not child:IsA "Tool" then + if not child:IsA "HopperBin" then return end end - if child:FindFirstChild("RobloxBuildTool") then return end - - for i,v in pairs(backpackItems) do -- check to see if we already have this gear registered - if v == child then return end + if child:FindFirstChild "RobloxBuildTool" then + return end - table.insert(backpackItems,child) - + for i, v in pairs(backpackItems) do -- check to see if we already have this gear registered + if v == child then + return + end + end + + table.insert(backpackItems, child) + local changeCon = child.Changed:connect(function(prop) if prop == "Name" then if buttons[child] then @@ -198,33 +204,41 @@ function addToGrid(child) end end) local ancestryCon = nil - ancestryCon = child.AncestryChanged:connect(function(theChild,theParent) + ancestryCon = child.AncestryChanged:connect(function(theChild, theParent) local thisObject = nil - for k,v in pairs(backpackItems) do + for k, v in pairs(backpackItems) do if v == child then thisObject = v break end end - - waitForProperty(player,"Character") - waitForChild(player,"Backpack") - if (child.Parent ~= player.Backpack and child.Parent ~= player.Character) then - if ancestryCon then ancestryCon:disconnect() end - if changeCon then changeCon:disconnect() end - - for k,v in pairs(backpackItems) do + + waitForProperty(player, "Character") + waitForChild(player, "Backpack") + if child.Parent ~= player.Backpack and child.Parent ~= player.Character then + if ancestryCon then + ancestryCon:disconnect() + end + if changeCon then + changeCon:disconnect() + end + + for k, v in pairs(backpackItems) do if v == thisObject then - if mouseEnterCons[buttons[v]] then mouseEnterCons[buttons[v]]:disconnect() end - if mouseClickCons[buttons[v]] then mouseClickCons[buttons[v]]:disconnect() end + if mouseEnterCons[buttons[v]] then + mouseEnterCons[buttons[v]]:disconnect() + end + if mouseClickCons[buttons[v]] then + mouseClickCons[buttons[v]]:disconnect() + end buttons[v].Parent = nil buttons[v] = nil break end end - removeFromMap(backpackItems,thisObject) - + removeFromMap(backpackItems, thisObject) + resizeGrid() else resizeGrid() @@ -235,7 +249,7 @@ function addToGrid(child) end function buttonClick(button) - if button:FindFirstChild("UnequipContextMenu") and not button.Active then + if button:FindFirstChild "UnequipContextMenu" and not button.Active then button.UnequipContextMenu.Visible = true browsingMenu = true end @@ -253,26 +267,36 @@ function findEmptySlot() local smallestNum = nil local loadout = currentLoadout:GetChildren() for i = 1, #loadout do - if loadout[i]:IsA("Frame") and #loadout[i]:GetChildren() <= 0 then - local frameNum = tonumber(string.sub(loadout[i].Name,5)) - if frameNum == 0 then frameNum = 10 end + if loadout[i]:IsA "Frame" and #loadout[i]:GetChildren() <= 0 then + local frameNum = tonumber(string.sub(loadout[i].Name, 5)) + if frameNum == 0 then + frameNum = 10 + end if not smallestNum or (smallestNum > frameNum) then smallestNum = frameNum end end end - if smallestNum == 10 then smallestNum = 0 end + if smallestNum == 10 then + smallestNum = 0 + end return smallestNum end -function checkForSwap(button,x,y) +function checkForSwap(button, x, y) local loadoutChildren = currentLoadout:GetChildren() for i = 1, #loadoutChildren do - if loadoutChildren[i]:IsA("Frame") and string.find(loadoutChildren[i].Name,"Slot") then - if x >= loadoutChildren[i].AbsolutePosition.x and x <= (loadoutChildren[i].AbsolutePosition.x + loadoutChildren[i].AbsoluteSize.x) then - if y >= loadoutChildren[i].AbsolutePosition.y and y <= (loadoutChildren[i].AbsolutePosition.y + loadoutChildren[i].AbsoluteSize.y) then - local slot = tonumber(string.sub(loadoutChildren[i].Name,5)) - swapGearSlot(slot,button) + if loadoutChildren[i]:IsA "Frame" and string.find(loadoutChildren[i].Name, "Slot") then + if + x >= loadoutChildren[i].AbsolutePosition.x + and x <= (loadoutChildren[i].AbsolutePosition.x + loadoutChildren[i].AbsoluteSize.x) + then + if + y >= loadoutChildren[i].AbsolutePosition.y + and y <= (loadoutChildren[i].AbsolutePosition.y + loadoutChildren[i].AbsoluteSize.y) + then + local slot = tonumber(string.sub(loadoutChildren[i].Name, 5)) + swapGearSlot(slot, button) return true end end @@ -282,9 +306,9 @@ function checkForSwap(button,x,y) end function resizeGrid() - for k,v in pairs(backpackItems) do - if not v:FindFirstChild("RobloxBuildTool") then - if not buttons[v] then + for k, v in pairs(backpackItems) do + if not v:FindFirstChild "RobloxBuildTool" then + if not buttons[v] then local buttonClone = gearButton:clone() buttonClone.Parent = grid.ScrollingFrame buttonClone.Visible = true @@ -294,50 +318,56 @@ function resizeGrid() end buttonClone.GearReference.Value = v - buttonClone.Draggable = true + buttonClone.Draggable = true buttons[v] = buttonClone - - if not IsTouchDevice() then + if not IsTouchDevice() then local unequipMenu = getGearContextMenu() - unequipMenu.Visible = false unequipMenu.Parent = buttonClone - end - + end + local beginPos = nil buttonClone.DragBegin:connect(function(value) - waitForChild(buttonClone, 'Background') - buttonClone['Background'].ZIndex = 10 - buttonClone.ZIndex = 10 + waitForChild(buttonClone, "Background") + buttonClone["Background"].ZIndex = 10 + buttonClone.ZIndex = 10 beginPos = value end) - buttonClone.DragStopped:connect(function(x,y) - waitForChild(buttonClone, 'Background') - buttonClone['Background'].ZIndex = 1.0 - buttonClone.ZIndex = 2 + buttonClone.DragStopped:connect(function(x, y) + waitForChild(buttonClone, "Background") + buttonClone["Background"].ZIndex = 1 + buttonClone.ZIndex = 2 if beginPos ~= buttonClone.Position then - if not checkForSwap(buttonClone,x,y) then - buttonClone:TweenPosition(beginPos,Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true) + if not checkForSwap(buttonClone, x, y) then + buttonClone:TweenPosition( + beginPos, + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + 0.5, + true + ) buttonClone.Draggable = false - delay(0.5,function() + delay(0.5, function() buttonClone.Draggable = true end) else buttonClone.Position = beginPos end - end + end end) local clickTime = tick() - mouseEnterCons[buttonClone] = buttonClone.MouseEnter:connect(function() previewGear(buttonClone) end) + mouseEnterCons[buttonClone] = buttonClone.MouseEnter:connect(function() + previewGear(buttonClone) + end) mouseClickCons[buttonClone] = buttonClone.MouseButton1Click:connect(function() local newClickTime = tick() if buttonClone.Active and (newClickTime - clickTime) < 0.5 then local slot = findEmptySlot() if slot then buttonClone.ZIndex = 1 - swapGearSlot(slot,buttonClone) + swapGearSlot(slot, buttonClone) end else buttonClick(buttonClone) @@ -351,19 +381,19 @@ function resizeGrid() end function showPartialGrid(subset) - for k,v in pairs(buttons) do + for _, v in pairs(buttons) do v.Parent = nil end if subset then - for k,v in pairs(subset) do - v.Parent = grid.ScrollingFrame + for _, v in pairs(subset) do + v.Parent = grid.ScrollingFrame end end recalculateScroll() end function showEntireGrid() - for k,v in pairs(buttons) do + for _, v in pairs(buttons) do v.Parent = grid.ScrollingFrame end recalculateScroll() @@ -372,7 +402,7 @@ end function inLoadout(gear) local children = currentLoadout:GetChildren() for i = 1, #children do - if children[i]:IsA("Frame") then + if children[i]:IsA "Frame" then local button = children[i]:GetChildren() if #button > 0 then if button[1].GearReference.Value and button[1].GearReference.Value == gear then @@ -382,19 +412,19 @@ function inLoadout(gear) end end return false -end +end function updateGridActive() - for k,v in pairs(backpackItems) do + for _, v in pairs(backpackItems) do if buttons[v] then local gear = nil - local gearRef = buttons[v]:FindFirstChild("GearReference") - - if gearRef then gear = gearRef.Value end - - if not gear then - buttons[v].Active = false - elseif inLoadout(gear) then + local gearRef = buttons[v]:FindFirstChild "GearReference" + + if gearRef then + gear = gearRef.Value + end + + if (not gear) or inLoadout(gear) then buttons[v].Active = false else buttons[v].Active = true @@ -407,19 +437,27 @@ function centerGear(loadoutChildren) local gearButtons = {} local lastSlotAdd = nil for i = 1, #loadoutChildren do - if loadoutChildren[i]:IsA("Frame") and #loadoutChildren[i]:GetChildren() > 0 then - if loadoutChildren[i].Name == "Slot0" then + if loadoutChildren[i]:IsA "Frame" and #loadoutChildren[i]:GetChildren() > 0 then + if loadoutChildren[i].Name == "Slot0" then lastSlotAdd = loadoutChildren[i] else table.insert(gearButtons, loadoutChildren[i]) end end end - if lastSlotAdd then table.insert(gearButtons,lastSlotAdd) end - - local startPos = ( 1 - (#gearButtons * 0.1) ) / 2 - for i = 1, #gearButtons do - gearButtons[i]:TweenPosition(UDim2.new(startPos + ((i - 1) * 0.1),0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true) + if lastSlotAdd then + table.insert(gearButtons, lastSlotAdd) + end + + local startPos = (1 - (#gearButtons * 0.1)) / 2 + for i = 1, #gearButtons do + gearButtons[i]:TweenPosition( + UDim2.new(startPos + ((i - 1) * 0.1), 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + 0.25, + true + ) end end @@ -432,11 +470,11 @@ function tabClickHandler(tabName) end function backpackOpenHandler(currentTab) - if currentTab and currentTab ~= StaticTabName then + if currentTab and currentTab ~= StaticTabName then backpack.Gear.Visible = false return end - + backpack.Gear.Visible = true updateGridActive() @@ -450,7 +488,7 @@ function backpackCloseHandler(currentTab) backpack.Gear.Visible = false return end - + backpack.Gear.Visible = false resizeGrid() @@ -459,10 +497,12 @@ function backpackCloseHandler(currentTab) end function loadoutCheck(child, selectState) - if not child:IsA("ImageButton") then return end - for k,v in pairs(backpackItems) do + if not child:IsA "ImageButton" then + return + end + for k, v in pairs(backpackItems) do if buttons[v] then - if child:FindFirstChild("GearReference") and buttons[v]:FindFirstChild("GearReference") then + if child:FindFirstChild "GearReference" and buttons[v]:FindFirstChild "GearReference" then if buttons[v].GearReference.Value == child.GearReference.Value then buttons[v].Active = selectState break @@ -480,7 +520,7 @@ end function removeAllEquippedGear(physGear) local stuff = player.Character:GetChildren() for i = 1, #stuff do - if ( stuff[i]:IsA("Tool") or stuff[i]:IsA("HopperBin") ) and stuff[i] ~= physGear then + if (stuff[i]:IsA "Tool" or stuff[i]:IsA "HopperBin") and stuff[i] ~= physGear then stuff[i].Parent = playerBackpack end end @@ -498,15 +538,15 @@ function unequipGear(physGear) end function highlight(button) - button.TextColor3 = Color3.new(0,0,0) - button.BackgroundColor3 = Color3.new(0.8,0.8,0.8) + button.TextColor3 = Color3.new(0, 0, 0) + button.BackgroundColor3 = Color3.new(0.8, 0.8, 0.8) end function clearHighlight(button) - button.TextColor3 = Color3.new(1,1,1) - button.BackgroundColor3 = Color3.new(0,0,0) + button.TextColor3 = Color3.new(1, 1, 1) + button.BackgroundColor3 = Color3.new(0, 0, 0) end -function swapGearSlot(slot,gearButton) +function swapGearSlot(slot, gearButton) if not swapSlot.Value then -- signal loadout to swap a gear out swapSlot.Slot.Value = slot swapSlot.GearButton.Value = gearButton @@ -515,9 +555,10 @@ function swapGearSlot(slot,gearButton) end end - local UnequipGearMenuClick = function(element, menu) - if type(element.Action) ~= "number" then return end + if type(element.Action) ~= "number" then + return + end local num = element.Action if num == 1 then -- remove from loadout unequipGear(menu.Parent.GearReference.Value) @@ -526,7 +567,7 @@ local UnequipGearMenuClick = function(element, menu) local loadoutChildren = currentLoadout:GetChildren() local slot = -1 for i = 1, #loadoutChildren do - if loadoutChildren[i]:IsA("Frame") then + if loadoutChildren[i]:IsA "Frame" then local button = loadoutChildren[i]:GetChildren() if button[1] and button[1].GearReference.Value == gearToUnequip then slot = button[1].SlotNumber.Text @@ -534,78 +575,93 @@ local UnequipGearMenuClick = function(element, menu) end end end - swapGearSlot(slot,nil) + swapGearSlot(slot, nil) end end function setupCharacterConnections() + if backpackAddCon then + backpackAddCon:disconnect() + end + backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) + addToGrid(child) + end) - if backpackAddCon then backpackAddCon:disconnect() end - backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) addToGrid(child) end) - -- make sure we get all the children local backpackChildren = game.Players.LocalPlayer.Backpack:GetChildren() for i = 1, #backpackChildren do addToGrid(backpackChildren[i]) end - if characterChildAddedCon then characterChildAddedCon:disconnect() end - characterChildAddedCon = - game.Players.LocalPlayer.Character.ChildAdded:connect(function(child) - addToGrid(child) - updateGridActive() - end) - - if characterChildRemovedCon then characterChildRemovedCon:disconnect() end - characterChildRemovedCon = - game.Players.LocalPlayer.Character.ChildRemoved:connect(function(child) - updateGridActive() - end) + if characterChildAddedCon then + characterChildAddedCon:disconnect() + end + characterChildAddedCon = game.Players.LocalPlayer.Character.ChildAdded:connect(function(child) + addToGrid(child) + updateGridActive() + end) + + if characterChildRemovedCon then + characterChildRemovedCon:disconnect() + end + characterChildRemovedCon = game.Players.LocalPlayer.Character.ChildRemoved:connect(function(_) + updateGridActive() + end) wait() centerGear(currentLoadout:GetChildren()) end function removeCharacterConnections() - if characterChildAddedCon then characterChildAddedCon:disconnect() end - if characterChildRemovedCon then characterChildRemovedCon:disconnect() end - if backpackAddCon then backpackAddCon:disconnect() end + if characterChildAddedCon then + characterChildAddedCon:disconnect() + end + if characterChildRemovedCon then + characterChildRemovedCon:disconnect() + end + if backpackAddCon then + backpackAddCon:disconnect() + end end function trim(s) - return (s:gsub("^%s*(.-)%s*$", "%1")) + return (s:gsub("^%s*(.-)%s*$", "%1")) end function filterGear(terms) local filteredGear = {} - for k,v in pairs(backpackItems) do + for k, v in pairs(backpackItems) do if buttons[v] then local gearString = string.lower(buttons[v].GearReference.Value.Name) gearString = trim(gearString) for i = 1, #terms do - if string.match(gearString,terms[i]) then - table.insert(filteredGear,buttons[v]) + if string.match(gearString, terms[i]) then + table.insert(filteredGear, buttons[v]) break end end end end - + return filteredGear end function splitByWhitespace(text) - if type(text) ~= "string" then return nil end - + if type(text) ~= "string" then + return nil + end + local terms = {} for token in string.gmatch(text, "[^%s]+") do - if string.len(token) > 0 then - table.insert(terms,token) - end + if string.len(token) > 0 then + table.insert(terms, token) + end end return terms end function showSearchGear(searchTerms) - if not backpack.Gear.Visible then return end -- currently not active tab + if not backpack.Gear.Visible then + return + end -- currently not active tab local searchTermTable = splitByWhitespace(searchTerms) if searchTermTable and (#searchTermTable > 0) then @@ -638,16 +694,16 @@ function nukeBackpack() end end -function getGearContextMenu() - local gearContextMenu = Instance.new("Frame") +function getGearContextMenu() + local gearContextMenu = Instance.new "Frame" gearContextMenu.Active = true gearContextMenu.Name = "UnequipContextMenu" - gearContextMenu.Size = UDim2.new(0,115,0,70) - gearContextMenu.Position = UDim2.new(0,-16,0,-16) + gearContextMenu.Size = UDim2.new(0, 115, 0, 70) + gearContextMenu.Position = UDim2.new(0, -16, 0, -16) gearContextMenu.BackgroundTransparency = 1 gearContextMenu.Visible = false - local gearContextMenuButton = Instance.new("TextButton") + local gearContextMenuButton = Instance.new "TextButton" gearContextMenuButton.Name = "UnequipContextMenuButton" gearContextMenuButton.Text = "" gearContextMenuButton.Style = Enum.ButtonStyle.RobloxButtonDefault @@ -655,11 +711,11 @@ function getGearContextMenu() gearContextMenuButton.Size = UDim2.new(1, 0, 1, -20) gearContextMenuButton.Visible = true gearContextMenuButton.Parent = gearContextMenu - + local elementHeight = 12 - - local contextMenuElements = {} - local contextMenuElementsName = {"Remove Hotkey"} + + local contextMenuElements = {} + local contextMenuElementsName = { "Remove Hotkey" } for i = 1, #contextMenuElementsName do local element = {} @@ -667,38 +723,39 @@ function getGearContextMenu() element.Text = contextMenuElementsName[i] element.Action = i element.DoIt = UnequipGearMenuClick - table.insert(contextMenuElements,element) + table.insert(contextMenuElements, element) end for i, contextElement in ipairs(contextMenuElements) do local element = contextElement if element.Type == "Button" then - local button = Instance.new("TextButton") + local button = Instance.new "TextButton" button.Name = "UnequipContextButton" .. i - button.BackgroundColor3 = Color3.new(0,0,0) + button.BackgroundColor3 = Color3.new(0, 0, 0) button.BorderSizePixel = 0 button.TextXAlignment = Enum.TextXAlignment.Left button.Text = " " .. contextElement.Text button.Font = Enum.Font.Arial button.FontSize = Enum.FontSize.Size14 button.Size = UDim2.new(1, 8, 0, elementHeight) - button.Position = UDim2.new(0,0,0,elementHeight * i) - button.TextColor3 = Color3.new(1,1,1) + button.Position = UDim2.new(0, 0, 0, elementHeight * i) + button.TextColor3 = Color3.new(1, 1, 1) button.ZIndex = 9 button.Parent = gearContextMenuButton - if not IsTouchDevice() then - + if not IsTouchDevice() then button.MouseButton1Click:connect(function() if button.Active and not gearContextMenu.Parent.Active then - local success, result = pcall(function() element.DoIt(element, gearContextMenu) end) + pcall(function() + element.DoIt(element, gearContextMenu) + end) browsingMenu = false gearContextMenu.Visible = false clearHighlight(button) clearPreview() end end) - + button.MouseEnter:connect(function() if button.Active and gearContextMenu.Parent.Active then highlight(button) @@ -709,50 +766,50 @@ function getGearContextMenu() clearHighlight(button) end end) - end + end contextElement.Button = button contextElement.Element = button elseif element.Type == "Label" then - local frame = Instance.new("Frame") + local frame = Instance.new "Frame" frame.Name = "ContextLabel" .. i frame.BackgroundTransparency = 1 frame.Size = UDim2.new(1, 8, 0, elementHeight) - local label = Instance.new("TextLabel") + local label = Instance.new "TextLabel" label.Name = "Text1" label.BackgroundTransparency = 1 - label.BackgroundColor3 = Color3.new(1,1,1) + label.BackgroundColor3 = Color3.new(1, 1, 1) label.BorderSizePixel = 0 label.TextXAlignment = Enum.TextXAlignment.Left label.Font = Enum.Font.ArialBold label.FontSize = Enum.FontSize.Size14 - label.Position = UDim2.new(0.0, 0, 0, 0) + label.Position = UDim2.new(0, 0, 0, 0) label.Size = UDim2.new(0.5, 0, 1, 0) - label.TextColor3 = Color3.new(1,1,1) + label.TextColor3 = Color3.new(1, 1, 1) label.ZIndex = 9 label.Parent = frame element.Label1 = label - + if element.GetText2 then - label = Instance.new("TextLabel") + label = Instance.new "TextLabel" label.Name = "Text2" label.BackgroundTransparency = 1 - label.BackgroundColor3 = Color3.new(1,1,1) + label.BackgroundColor3 = Color3.new(1, 1, 1) label.BorderSizePixel = 0 label.TextXAlignment = Enum.TextXAlignment.Right label.Font = Enum.Font.Arial label.FontSize = Enum.FontSize.Size14 label.Position = UDim2.new(0.5, 0, 0, 0) label.Size = UDim2.new(0.5, 0, 1, 0) - label.TextColor3 = Color3.new(1,1,1) + label.TextColor3 = Color3.new(1, 1, 1) label.ZIndex = 9 label.Parent = frame element.Label2 = label end frame.Parent = gearContextMenuButton element.Label = frame - element.Element = frame + element.Element = frame end end @@ -763,11 +820,11 @@ function getGearContextMenu() clearPreview() end) robloxLock(gearContextMenu) - + return gearContextMenu end -function coreGuiChanged(coreGuiType,enabled) +function coreGuiChanged(coreGuiType, enabled) if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then if not enabled then backpack.Gear.Visible = false @@ -775,7 +832,6 @@ function coreGuiChanged(coreGuiType,enabled) end end - local backpackChildren = player.Backpack:GetChildren() for i = 1, #backpackChildren do addToGrid(backpackChildren[i]) @@ -783,10 +839,11 @@ end ------------------------- Start Lifelong Connections ----------------------- +resizeEvent.Event:connect(function(_) + if debounce then + return + end -resizeEvent.Event:connect(function(absSize) - if debounce then return end - debounce = true wait() resize() @@ -794,35 +851,49 @@ resizeEvent.Event:connect(function(absSize) debounce = false end) -currentLoadout.ChildAdded:connect(function(child) loadoutCheck(child, false) end) -currentLoadout.ChildRemoved:connect(function(child) loadoutCheck(child, true) end) +currentLoadout.ChildAdded:connect(function(child) + loadoutCheck(child, false) +end) +currentLoadout.ChildRemoved:connect(function(child) + loadoutCheck(child, true) +end) currentLoadout.DescendantAdded:connect(function(descendant) - if not backpack.Visible and ( descendant:IsA("ImageButton") or descendant:IsA("TextButton") ) then + if not backpack.Visible and (descendant:IsA "ImageButton" or descendant:IsA "TextButton") then centerGear(currentLoadout:GetChildren()) end end) currentLoadout.DescendantRemoving:connect(function(descendant) - if not backpack.Visible and ( descendant:IsA("ImageButton") or descendant:IsA("TextButton") ) then + if not backpack.Visible and (descendant:IsA "ImageButton" or descendant:IsA "TextButton") then wait() centerGear(currentLoadout:GetChildren()) end end) - -grid.MouseEnter:connect(function() clearPreview() end) -grid.MouseLeave:connect(function() clearPreview() end) + +grid.MouseEnter:connect(function() + clearPreview() +end) +grid.MouseLeave:connect(function() + clearPreview() +end) player.CharacterRemoving:connect(function() removeCharacterConnections() nukeBackpack() end) -player.CharacterAdded:connect(function() setupCharacterConnections() end) +player.CharacterAdded:connect(function() + setupCharacterConnections() +end) player.ChildAdded:connect(function(child) - if child:IsA("Backpack") then + if child:IsA "Backpack" then playerBackpack = child - if backpackAddCon then backpackAddCon:disconnect() end - backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) addToGrid(child) end) + if backpackAddCon then + backpackAddCon:disconnect() + end + backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) + addToGrid(child) + end) end end) @@ -834,7 +905,7 @@ end) local loadoutChildren = currentLoadout:GetChildren() for i = 1, #loadoutChildren do - if loadoutChildren[i]:IsA("Frame") and string.find(loadoutChildren[i].Name,"Slot") then + if loadoutChildren[i]:IsA "Frame" and string.find(loadoutChildren[i].Name, "Slot") then loadoutChildren[i].ChildRemoved:connect(function() updateGridActive() end) @@ -858,14 +929,18 @@ local loadoutChildren = currentLoadout:GetChildren() for i = 1, #loadoutChildren do loadoutCheck(loadoutChildren[i], false) end -if not backpack.Visible then centerGear(currentLoadout:GetChildren()) end +if not backpack.Visible then + centerGear(currentLoadout:GetChildren()) +end -- make sure that inventory is listening to gear reparenting if characterChildAddedCon == nil and game.Players.LocalPlayer["Character"] then setupCharacterConnections() end if not backpackAddCon then - backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) addToGrid(child) end) + backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) + addToGrid(child) + end) end backpackOpenEvent.Event:connect(backpackOpenHandler) @@ -873,4 +948,4 @@ backpackCloseEvent.Event:connect(backpackCloseHandler) tabClickedEvent.Event:connect(tabClickHandler) searchRequestedEvent.Event:connect(showSearchGear) -recalculateScrollLoadout() \ No newline at end of file +recalculateScrollLoadout() diff --git a/89449093.lua b/89449093.lua index 2e00898..340cdfc 100644 --- a/89449093.lua +++ b/89449093.lua @@ -1,5 +1,7 @@ -- This script manages context switches in the backpack (Gear to Wardrobe, etc.) and player state changes. Also manages global functions across different tabs (currently only search) -if game.CoreGui.Version < 7 then return end -- peace out if we aren't using the right client +if game.CoreGui.Version < 7 then + return +end -- peace out if we aren't using the right client -- basic functions local function waitForChild(instance, name) @@ -15,23 +17,21 @@ local function waitForProperty(instance, property) end -- don't do anything if we are in an empty game -waitForChild(game,"Players") +waitForChild(game, "Players") if #game.Players:GetChildren() < 1 then game.Players.ChildAdded:wait() end -- make sure everything is loaded in before we do anything -- get our local player -waitForProperty(game.Players,"LocalPlayer") +waitForProperty(game.Players, "LocalPlayer") local player = game.Players.LocalPlayer - - ------------------------ Locals ------------------------------ local backpack = script.Parent -waitForChild(backpack,"Gear") +waitForChild(backpack, "Gear") local screen = script.Parent.Parent -assert(screen:IsA("ScreenGui")) +assert(screen:IsA "ScreenGui") waitForChild(backpack, "Tabs") waitForChild(backpack.Tabs, "CloseButton") @@ -43,19 +43,19 @@ if game.CoreGui.Version >= 8 then waitForChild(backpack.Tabs, "WardrobeButton") local wardrobeButton = backpack.Tabs.WardrobeButton end -waitForChild(backpack.Parent,"ControlFrame") -local backpackButton = waitForChild(backpack.Parent.ControlFrame,"BackpackButton") +waitForChild(backpack.Parent, "ControlFrame") +local backpackButton = waitForChild(backpack.Parent.ControlFrame, "BackpackButton") local currentTab = "gear" -local searchFrame = waitForChild(backpack,"SearchFrame") -waitForChild(backpack.SearchFrame,"SearchBoxFrame") -local searchBox = waitForChild(backpack.SearchFrame.SearchBoxFrame,"SearchBox") -local searchButton = waitForChild(backpack.SearchFrame,"SearchButton") -local resetButton = waitForChild(backpack.SearchFrame,"ResetButton") +local searchFrame = waitForChild(backpack, "SearchFrame") +waitForChild(backpack.SearchFrame, "SearchBoxFrame") +local searchBox = waitForChild(backpack.SearchFrame.SearchBoxFrame, "SearchBox") +local searchButton = waitForChild(backpack.SearchFrame, "SearchButton") +local resetButton = waitForChild(backpack.SearchFrame, "ResetButton") -local robloxGui = waitForChild(Game.CoreGui, 'RobloxGui') -local currentLoadout = waitForChild(robloxGui, 'CurrentLoadout') -local loadoutBackground = waitForChild(currentLoadout, 'Background') +local robloxGui = waitForChild(Game.CoreGui, "RobloxGui") +local currentLoadout = waitForChild(robloxGui, "CurrentLoadout") +local loadoutBackground = waitForChild(currentLoadout, "Background") local canToggle = true local readyForNextEvent = true @@ -65,7 +65,7 @@ local disabledByDeveloper = false local humanoidDiedCon = nil -local backpackButtonPos +local backpackButtonPos local guiTweenSpeed = 0.25 -- how quickly we open/close the backpack @@ -75,21 +75,19 @@ local backquote = "`" local backpackSize = UDim2.new(0, 600, 0, 400) -if robloxGui.AbsoluteSize.Y <= 320 then +if robloxGui.AbsoluteSize.Y <= 320 then backpackSize = UDim2.new(0, 200, 0, 140) -end - +end ------------------------ End Locals --------------------------- - ---------------------------------------- Public Event Setup ---------------------------------------- function createPublicEvent(eventName) assert(eventName, "eventName is nil") - assert(tostring(eventName),"eventName is not a string") - - local newEvent = Instance.new("BindableEvent") + assert(tostring(eventName), "eventName is not a string") + + local newEvent = Instance.new "BindableEvent" newEvent.Name = tostring(eventName) newEvent.Parent = script @@ -101,8 +99,8 @@ function createPublicFunction(funcName, invokeFunc) assert(tostring(funcName), "funcName is not a string") assert(invokeFunc, "invokeFunc is nil") assert(type(invokeFunc) == "function", "invokeFunc should be of type 'function'") - - local newFunction = Instance.new("BindableFunction") + + local newFunction = Instance.new "BindableFunction" newFunction.Name = tostring(funcName) newFunction.OnInvoke = invokeFunc newFunction.Parent = script @@ -110,16 +108,14 @@ function createPublicFunction(funcName, invokeFunc) return newFunction end --- Events -local resizeEvent = createPublicEvent("ResizeEvent") -local backpackOpenEvent = createPublicEvent("BackpackOpenEvent") -local backpackCloseEvent = createPublicEvent("BackpackCloseEvent") -local tabClickedEvent = createPublicEvent("TabClickedEvent") -local searchRequestedEvent = createPublicEvent("SearchRequestedEvent") +-- Events +local resizeEvent = createPublicEvent "ResizeEvent" +local backpackOpenEvent = createPublicEvent "BackpackOpenEvent" +local backpackCloseEvent = createPublicEvent "BackpackCloseEvent" +local tabClickedEvent = createPublicEvent "TabClickedEvent" +local searchRequestedEvent = createPublicEvent "SearchRequestedEvent" ---------------------------------------- End Public Event Setup ---------------------------------------- - - --------------------------- Internal Functions ---------------------------------------- function deactivateBackpack() @@ -128,20 +124,20 @@ function deactivateBackpack() end function activateBackpack() - initHumanoidDiedConnections() + initHumanoidDiedConnections() active = true backpack.Visible = backpackIsOpen - if backpackIsOpen then - toggleBackpack() - end + if backpackIsOpen then + toggleBackpack() + end end -function initHumanoidDiedConnections() - if humanoidDiedCon then +function initHumanoidDiedConnections() + if humanoidDiedCon then humanoidDiedCon:disconnect() end - waitForProperty(game.Players.LocalPlayer,"Character") - waitForChild(game.Players.LocalPlayer.Character,"Humanoid") + waitForProperty(game.Players.LocalPlayer, "Character") + waitForChild(game.Players.LocalPlayer.Character, "Humanoid") humanoidDiedCon = game.Players.LocalPlayer.Character.Humanoid.Died:connect(deactivateBackpack) end @@ -153,90 +149,108 @@ local hideBackpack = function() backpackCloseEvent:Fire(currentTab) backpack.Tabs.Visible = false searchFrame.Visible = false - backpack:TweenSizeAndPosition(UDim2.new(0, backpackSize.X.Offset,0, 0), UDim2.new(0.5, -backpackSize.X.Offset/2, 1, -85), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, guiTweenSpeed, true, + backpack:TweenSizeAndPosition( + UDim2.new(0, backpackSize.X.Offset, 0, 0), + UDim2.new(0.5, -backpackSize.X.Offset / 2, 1, -85), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + guiTweenSpeed, + true, function() game.GuiService:RemoveCenterDialog(backpack) backpack.Visible = false backpackButton.Selected = false - end) - delay(guiTweenSpeed,function() + end + ) + delay(guiTweenSpeed, function() game.GuiService:RemoveCenterDialog(backpack) backpack.Visible = false backpackButton.Selected = false - readyForNextEvent = true + readyForNextEvent = true canToggle = true end) end function showBackpack() - game.GuiService:AddCenterDialog(backpack, Enum.CenterDialogType.PlayerInitiatedDialog, - function() - backpack.Visible = true - backpackButton.Selected = true - end, - function() - backpack.Visible = false - backpackButton.Selected = false + game.GuiService:AddCenterDialog(backpack, Enum.CenterDialogType.PlayerInitiatedDialog, function() + backpack.Visible = true + backpackButton.Selected = true + end, function() + backpack.Visible = false + backpackButton.Selected = false end) backpack.Visible = true - backpackButton.Selected = true - backpack:TweenSizeAndPosition(backpackSize, UDim2.new(0.5, -backpackSize.X.Offset/2, 1, -backpackSize.Y.Offset - 88), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, guiTweenSpeed, true) - delay(guiTweenSpeed,function() + backpackButton.Selected = true + backpack:TweenSizeAndPosition( + backpackSize, + UDim2.new(0.5, -backpackSize.X.Offset / 2, 1, -backpackSize.Y.Offset - 88), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + guiTweenSpeed, + true + ) + delay(guiTweenSpeed, function() backpack.Tabs.Visible = false searchFrame.Visible = true backpackOpenEvent:Fire(currentTab) canToggle = true readyForNextEvent = true - backpackButton.Image = 'http://www.roblox.com/asset/?id=97644093' + backpackButton.Image = "http://www.roblox.com/asset/?id=97644093" backpackButton.Position = UDim2.new(0.5, -60, 1, -backpackSize.Y.Offset - 103) end) end -function toggleBackpack() - if not game.Players.LocalPlayer then return end - if not game.Players.LocalPlayer["Character"] then return end - if not canToggle then return end - if not readyForNextEvent then return end +function toggleBackpack() + if not game.Players.LocalPlayer then + return + end + if not game.Players.LocalPlayer["Character"] then + return + end + if not canToggle then + return + end + if not readyForNextEvent then + return + end readyForNextEvent = false canToggle = false - + backpackIsOpen = not backpackIsOpen - if backpackIsOpen then - loadoutBackground.Image = 'http://www.roblox.com/asset/?id=97623721' + if backpackIsOpen then + loadoutBackground.Image = "http://www.roblox.com/asset/?id=97623721" loadoutBackground.Position = UDim2.new(-0.03, 0, -0.17, 0) loadoutBackground.Size = UDim2.new(1.05, 0, 1.25, 0) loadoutBackground.ZIndex = 2.0 loadoutBackground.Visible = true showBackpack() - else + else backpackButton.Position = UDim2.new(0.5, -60, 1, -44) loadoutBackground.Visible = false - backpackButton.Selected = false + backpackButton.Selected = false backpackButton.Image = "http://www.roblox.com/asset/?id=97617958" - loadoutBackground.Image = 'http://www.roblox.com/asset/?id=96536002' + loadoutBackground.Image = "http://www.roblox.com/asset/?id=96536002" loadoutBackground.Position = UDim2.new(-0.1, 0, -0.1, 0) - loadoutBackground.Size = UDim2.new(1.2, 0, 1.2, 0) + loadoutBackground.Size = UDim2.new(1.2, 0, 1.2, 0) hideBackpack() - local clChildren = currentLoadout:GetChildren() - for i = 1, #clChildren do - if clChildren[i] and clChildren[i]:IsA('Frame') then - local frame = clChildren[i] - if #frame:GetChildren() > 0 then + for i = 1, #clChildren do + if clChildren[i] and clChildren[i]:IsA "Frame" then + local frame = clChildren[i] + if #frame:GetChildren() > 0 then backpackButton.Position = UDim2.new(0.5, -60, 1, -108) backpackButton.Visible = true loadoutBackground.Visible = true - if frame:GetChildren()[1]:IsA('ImageButton') then + if frame:GetChildren()[1]:IsA "ImageButton" then local imgButton = frame:GetChildren()[1] - imgButton.Active = true - imgButton.Draggable = false - end - end - end - end - + imgButton.Active = true + imgButton.Draggable = false + end + end + end + end end end @@ -248,27 +262,27 @@ end function setSelected(tab) assert(tab) - assert(tab:IsA("TextButton")) - - tab.BackgroundColor3 = Color3.new(1,1,1) - tab.TextColor3 = Color3.new(0,0,0) + assert(tab:IsA "TextButton") + + tab.BackgroundColor3 = Color3.new(1, 1, 1) + tab.TextColor3 = Color3.new(0, 0, 0) tab.Selected = true tab.ZIndex = 3 end function setUnselected(tab) assert(tab) - assert(tab:IsA("TextButton")) - - tab.BackgroundColor3 = Color3.new(0,0,0) - tab.TextColor3 = Color3.new(1,1,1) + assert(tab:IsA "TextButton") + + tab.BackgroundColor3 = Color3.new(0, 0, 0) + tab.TextColor3 = Color3.new(1, 1, 1) tab.Selected = false tab.ZIndex = 1 end function updateTabGui(selectedTab) assert(selectedTab) - + if selectedTab == "gear" then setSelected(inventoryButton) setUnselected(wardrobeButton) @@ -280,44 +294,50 @@ end function mouseLeaveTab(button) assert(button) - assert(button:IsA("TextButton")) - - if button.Selected then return end - - button.BackgroundColor3 = Color3.new(0,0,0) + assert(button:IsA "TextButton") + + if button.Selected then + return + end + + button.BackgroundColor3 = Color3.new(0, 0, 0) end function mouseOverTab(button) assert(button) - assert(button:IsA("TextButton")) - - if button.Selected then return end - - button.BackgroundColor3 = Color3.new(39/255,39/255,39/255) + assert(button:IsA "TextButton") + + if button.Selected then + return + end + + button.BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255) end function newTabClicked(tabName) assert(tabName) tabName = string.lower(tabName) currentTab = tabName - + updateTabGui(tabName) tabClickedEvent:Fire(tabName) resetSearch() end function trim(s) - return (s:gsub("^%s*(.-)%s*$", "%1")) + return (s:gsub("^%s*(.-)%s*$", "%1")) end function splitByWhitespace(text) - if type(text) ~= "string" then return nil end - + if type(text) ~= "string" then + return nil + end + local terms = {} for token in string.gmatch(text, "[^%s]+") do - if string.len(token) > 0 then - table.insert(terms,token) - end + if string.len(token) > 0 then + table.insert(terms, token) + end end return terms end @@ -348,13 +368,13 @@ local backpackReady = function() readyForNextEvent = true end -function coreGuiChanged(coreGuiType,enabled) +function coreGuiChanged(coreGuiType, enabled) if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then active = enabled disabledByDeveloper = not enabled if disabledByDeveloper then - pcall(function() + pcall(function() game:GetService("GuiService"):RemoveKey(tilde) game:GetService("GuiService"):RemoveKey(backquote) end) @@ -374,13 +394,11 @@ end --------------------------- End Internal Functions ------------------------------------- - ------------------------------ Public Functions Setup ------------------------------------- createPublicFunction("CloseBackpack", hideBackpack) createPublicFunction("BackpackReady", backpackReady) ------------------------------ End Public Functions Setup --------------------------------- - ------------------------ Connections/Script Main ------------------------------------------- pcall(function() @@ -388,14 +406,26 @@ pcall(function() Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) end) -inventoryButton.MouseButton1Click:connect(function() newTabClicked("gear") end) -inventoryButton.MouseEnter:connect(function() mouseOverTab(inventoryButton) end) -inventoryButton.MouseLeave:connect(function() mouseLeaveTab(inventoryButton) end) +inventoryButton.MouseButton1Click:connect(function() + newTabClicked "gear" +end) +inventoryButton.MouseEnter:connect(function() + mouseOverTab(inventoryButton) +end) +inventoryButton.MouseLeave:connect(function() + mouseLeaveTab(inventoryButton) +end) if game.CoreGui.Version >= 8 then - wardrobeButton.MouseButton1Click:connect(function() newTabClicked("wardrobe") end) - wardrobeButton.MouseEnter:connect(function() mouseOverTab(wardrobeButton) end) - wardrobeButton.MouseLeave:connect(function() mouseLeaveTab(wardrobeButton) end) + wardrobeButton.MouseButton1Click:connect(function() + newTabClicked "wardrobe" + end) + wardrobeButton.MouseEnter:connect(function() + mouseOverTab(wardrobeButton) + end) + wardrobeButton.MouseLeave:connect(function() + mouseLeaveTab(wardrobeButton) + end) end closeButton.MouseButton1Click:connect(closeBackpack) @@ -410,13 +440,17 @@ end) game:GetService("GuiService"):AddKey(tilde) game:GetService("GuiService"):AddKey(backquote) game:GetService("GuiService").KeyPressed:connect(function(key) - if not active or disabledByDeveloper then return end + if not active or disabledByDeveloper then + return + end if key == tilde or key == backquote then toggleBackpack() end end) -backpackButton.MouseButton1Click:connect(function() - if not active or disabledByDeveloper then return end +backpackButton.MouseButton1Click:connect(function() + if not active or disabledByDeveloper then + return + end toggleBackpack() end) @@ -437,7 +471,7 @@ end) searchButton.MouseButton1Click:connect(doSearch) resetButton.MouseButton1Click:connect(resetSearch) -if searchFrame and robloxGui.AbsoluteSize.Y <= 320 then - searchFrame.RobloxLocked = false - searchFrame:Destroy() -end \ No newline at end of file +if searchFrame and robloxGui.AbsoluteSize.Y <= 320 then + searchFrame.RobloxLocked = false + searchFrame:Destroy() +end diff --git a/97188756.lua b/97188756.lua index 49f39dd..0ea82a3 100644 --- a/97188756.lua +++ b/97188756.lua @@ -8,88 +8,95 @@ local forceChatGUI = false -- Utility functions + Globals -local function WaitForChild(parent, childName) - while parent:FindFirstChild(childName) == nil do +local function WaitForChild(parent, childName) + while parent:FindFirstChild(childName) == nil do parent.ChildAdded:wait(0.03) - end + end return parent[childName] -end +end local function typedef(obj) - return obj -end + return obj +end local function IsPhone() - local cGui = Game:GetService('CoreGui') - local rGui = WaitForChild(cGui, 'RobloxGui') - if rGui.AbsoluteSize.Y < 600 then - return true - end - return false + local cGui = Game:GetService "CoreGui" + local rGui = WaitForChild(cGui, "RobloxGui") + if rGui.AbsoluteSize.Y < 600 then + return true + end + return false end -- Users can use enough white spaces to spoof chatting as other players -- This function removes trailing and leading white spaces --- AFAIK, there is no reason for spam white spaces +-- AFAIK, there is no reason for spam white spaces local function StringTrim(str) -- %S is whitespaces - -- When we find the first non space character defined by ^%s - -- we yank out anything in between that and the end of the string - -- Everything else is replaced with %1 which is essentially nothing + -- When we find the first non space character defined by ^%s + -- we yank out anything in between that and the end of the string + -- Everything else is replaced with %1 which is essentially nothing return (str:gsub("^%s*(.-)%s*$", "%1")) -end +end -while Game.Players.LocalPlayer == nil do wait(0.03) end +while Game.Players.LocalPlayer == nil do + wait(0.03) +end -local Player = Game.Players.LocalPlayer -while Player.Character == nil do wait(0.03) end -local RbxUtility = LoadLibrary('RbxUtility') -local Gui = typedef(RbxUtility) -local Camera = Game.Workspace.CurrentCamera +local Player = Game.Players.LocalPlayer +while Player.Character == nil do + wait(0.03) +end +local RbxUtility = LoadLibrary "RbxUtility" +local Gui = typedef(RbxUtility) +local Camera = Game.Workspace.CurrentCamera --- Services -local CoreGuiService = Game:GetService('CoreGui') -local PlayersService = Game:GetService('Players') -local DebrisService= Game:GetService('Debris') -local GuiService = Game:GetService('GuiService') +-- Services +local CoreGuiService = Game:GetService "CoreGui" +local PlayersService = Game:GetService "Players" +local DebrisService = Game:GetService "Debris" +local GuiService = Game:GetService "GuiService" -- Lua Enums -local Enums do +local Enums +do Enums = {} local EnumName = {} -- used as unique key for enum name local enum_mt = { - __call = function(self,value) + __call = function(self, value) return self[value] or self[tonumber(value)] - end; + end, __index = { GetEnumItems = function(self) local t = {} - for i,item in pairs(self) do - if type(i) == 'number' then - t[#t+1] = item + for i, item in pairs(self) do + if type(i) == "number" then + t[#t + 1] = item end end - table.sort(t,function(a,b) return a.Value < b.Value end) + table.sort(t, function(a, b) + return a.Value < b.Value + end) return t - end; - }; + end, + }, __tostring = function(self) return "Enum." .. self[EnumName] - end; + end, } local item_mt = { - __call = function(self,value) + __call = function(self, value) return value == self or value == self.Name or value == self.Value - end; + end, __tostring = function(self) return "Enum." .. self[EnumName] .. "." .. self.Name - end; + end, } function CreateEnum(enumName) return function(t) - local e = {[EnumName] = enumName} - for i,name in pairs(t) do - local item = setmetatable({Name=name,Value=i,Enum=e,[EnumName]=enumName},item_mt) + local e = { [EnumName] = enumName } + for i, name in pairs(t) do + local item = setmetatable({ Name = name, Value = i, Enum = e, [EnumName] = enumName }, item_mt) e[i] = item e[name] = item e[item] = item @@ -100,555 +107,989 @@ local Enums do end end --------------------------------------------------- ------------------- Input class -------------------- +------------------ Input class -------------------- local Input = { - Mouse = Player:GetMouse(), - Speed = 0, - Simulating = false, + Mouse = Player:GetMouse(), + Speed = 0, + Simulating = false, - Configuration = { - DefaultSpeed = 1 - }, - UserIsScrolling = false - } + Configuration = { + DefaultSpeed = 1, + }, + UserIsScrolling = false, +} --------------------------------------------------- ------------------ Chat class -------------------- -local Chat = { +local Chat = { - ChatColors = { - BrickColor.new("Bright red"), - BrickColor.new("Bright blue"), - BrickColor.new("Earth green"), - BrickColor.new("Bright violet"), - BrickColor.new("Bright orange"), - BrickColor.new("Bright yellow"), - BrickColor.new("Light reddish violet"), - BrickColor.new("Brick yellow"), - }, + ChatColors = { + BrickColor.new "Bright red", + BrickColor.new "Bright blue", + BrickColor.new "Earth green", + BrickColor.new "Bright violet", + BrickColor.new "Bright orange", + BrickColor.new "Bright yellow", + BrickColor.new "Light reddish violet", + BrickColor.new "Brick yellow", + }, - Gui = nil, - Frame = nil, - RenderFrame = nil, - TapToChatLabel = nil, - ClickToChatButton = nil, + Gui = nil, + Frame = nil, + RenderFrame = nil, + TapToChatLabel = nil, + ClickToChatButton = nil, - ScrollingLock = false, - EventListener = nil, + ScrollingLock = false, + EventListener = nil, - -- This is actually a ring buffer - -- Meaning at hitting the historyLength it wraps around - -- Reuses the text objects, so chat atmost uses 100 text objects - MessageQueue = {}, + -- This is actually a ring buffer + -- Meaning at hitting the historyLength it wraps around + -- Reuses the text objects, so chat atmost uses 100 text objects + MessageQueue = {}, - -- Stores all the values for configuring chat - Configuration = { - FontSize = Enum.FontSize.Size12, -- 10 is good - -- Also change this when you are changing the above, this is suboptimal but so is our interface to find FontSize - NumFontSize = 12, - HistoryLength = 20, -- stores up to 50 of the last chat messages for you to scroll through, - Size = UDim2.new(0.38, 0, 0.20, 0), - MessageColor = Color3.new(1, 1, 1), - AdminMessageColor = Color3.new(1, 215/255, 0), - XScale = 0.025, - LifeTime = 45, - Position = UDim2.new(0, 2, 0.05, 0), - DefaultTweenSpeed = 0.15, - }, + -- Stores all the values for configuring chat + Configuration = { + FontSize = Enum.FontSize.Size12, -- 10 is good + -- Also change this when you are changing the above, this is suboptimal but so is our interface to find FontSize + NumFontSize = 12, + HistoryLength = 20, -- stores up to 50 of the last chat messages for you to scroll through, + Size = UDim2.new(0.38, 0, 0.20, 0), + MessageColor = Color3.new(1, 1, 1), + AdminMessageColor = Color3.new(1, 215 / 255, 0), + XScale = 0.025, + LifeTime = 45, + Position = UDim2.new(0, 2, 0.05, 0), + DefaultTweenSpeed = 0.15, + }, - -- This could be redone by just using the previous and next fields of the Queue - -- But the iterators cause issues, will be optimized later - SlotPositions_List = {}, - -- To precompute and store all player null strings since its an expensive process - CachedSpaceStrings_List = {}, - MouseOnFrame = false, - GotFocus = false, + -- This could be redone by just using the previous and next fields of the Queue + -- But the iterators cause issues, will be optimized later + SlotPositions_List = {}, + -- To precompute and store all player null strings since its an expensive process + CachedSpaceStrings_List = {}, + MouseOnFrame = false, + GotFocus = false, - Messages_List = {}, - MessageThread = nil, + Messages_List = {}, + MessageThread = nil, - --[[ Admins_List = {'Sorcus', 'Shedletsky', 'Telamon', 'Tarabyte', 'StickMasterLuke', 'OnlyTwentyCharacters', 'FusRoblox', 'SolarCrane', + --[[ Admins_List = {'Sorcus', 'Shedletsky', 'Telamon', 'Tarabyte', 'StickMasterLuke', 'OnlyTwentyCharacters', 'FusRoblox', 'SolarCrane', 'HotThoth', 'JediTkacheff', 'Builderman', 'Brighteyes', 'ReeseMcblox', 'GemLocker', 'GongfuTiger', 'Erik.Cassel', 'Matt Dusek', 'Keith', 'Totbl', 'LordRugDump', 'David.Baszucki', 'Dbapostle', 'DaveYorkRBX', 'nJay', 'OstrichSized', 'TobotRobot', 'twberg', 'ROBLOX', 'RBAdam', 'Doughtless', 'Anaminus', 'Stravant', 'Cr3470r', 'CodeWriter', 'Games', 'AcesWayUpHigh', 'Phil' }, --]] - Admins_List = {'taskmanager', 'Heliodex', 'tako'}, + Admins_List = { "taskmanager", "Heliodex", "tako" }, - SafeChat_List = { - ['Use the Chat menu to talk to me.'] = {'/sc 0', true}, - ['I can only see menu chats.'] = {'/sc 1', true}, - ['Hello'] = { - ['Hi'] = {'/sc 2_0', true, ['Hi there!'] = true, ['Hi everyone'] = true}, - ['Howdy'] = {'/sc 2_1', true, ['Howdy partner!'] = true}, - ['Greetings'] = {'/sc 2_2', true, ['Greetings everyone'] = true, ['Greetings Robloxians!'] = true, ['Seasons greetings!'] = true}, - ['Welcome'] = {'/sc 2_3', true, ['Welcome to my place'] = true, ['Welcome to my barbeque'] = true, ['Welcome to our base'] = true}, - ['Hey there!'] = {'/sc 2_4', true}, - ['What\'s up?'] = {'/sc 2_5', true, ['How are you doing?'] = true, ['How\'s it going?'] = true, ['What\'s new?'] = true}, - ['Good day'] = {'/sc 2_6', true, ['Good morning'] = true, ['Good evening'] = true, ['Good afternoon'] = true, ['Good night'] = true}, - ['Silly'] = {'/sc 2_7', true, ['Waaaaaaaz up?!'] = true, ['Hullo!'] = true, ['Behold greatness, mortals!'] = true, ['Pardon me, is this Sparta?'] = true, ['THIS IS SPARTAAAA!'] = true}, - ['Happy Holidays!'] = {'/sc 2_8', true, ['Happy New Year!'] = true, - ['Happy Valentine\'s Day!'] = true, - ['Beware the Ides of March!'] = true, - ['Happy St. Patrick\'s Day!'] = true, - ['Happy Easter!'] = true, - ['Happy Earth Day!'] = true, - ['Happy 4th of July!'] = true, - ['Happy Thanksgiving!'] = true, - ['Happy Halloween!'] = true, - ['Happy Hanukkah!'] = true, - ['Merry Christmas!'] = true, - ['Happy Halloween!'] = true, - ['Happy Earth Day!'] = true, - ['Happy May Day!'] = true, - ['Happy Towel Day!'] = true, - ['Happy ROBLOX Day!'] = true, - ['Happy LOL Day!'] = true }, + SafeChat_List = { + ["Use the Chat menu to talk to me."] = { "/sc 0", true }, + ["I can only see menu chats."] = { "/sc 1", true }, + ["Hello"] = { + ["Hi"] = { "/sc 2_0", true, ["Hi there!"] = true, ["Hi everyone"] = true }, + ["Howdy"] = { "/sc 2_1", true, ["Howdy partner!"] = true }, + ["Greetings"] = { + "/sc 2_2", + true, + ["Greetings everyone"] = true, + ["Greetings Robloxians!"] = true, + ["Seasons greetings!"] = true, + }, + ["Welcome"] = { + "/sc 2_3", + true, + ["Welcome to my place"] = true, + ["Welcome to my barbeque"] = true, + ["Welcome to our base"] = true, + }, + ["Hey there!"] = { "/sc 2_4", true }, + ["What's up?"] = { + "/sc 2_5", + true, + ["How are you doing?"] = true, + ["How's it going?"] = true, + ["What's new?"] = true, + }, + ["Good day"] = { + "/sc 2_6", + true, + ["Good morning"] = true, + ["Good evening"] = true, + ["Good afternoon"] = true, + ["Good night"] = true, + }, + ["Silly"] = { + "/sc 2_7", + true, + ["Waaaaaaaz up?!"] = true, + ["Hullo!"] = true, + ["Behold greatness, mortals!"] = true, + ["Pardon me, is this Sparta?"] = true, + ["THIS IS SPARTAAAA!"] = true, + }, + ["Happy Holidays!"] = { + "/sc 2_8", + true, + ["Happy New Year!"] = true, + ["Happy Valentine's Day!"] = true, + ["Beware the Ides of March!"] = true, + ["Happy St. Patrick's Day!"] = true, + ["Happy Easter!"] = true, + ["Happy Earth Day!"] = true, + ["Happy 4th of July!"] = true, + ["Happy Thanksgiving!"] = true, + ["Happy Halloween!"] = true, + ["Happy Hanukkah!"] = true, + ["Merry Christmas!"] = true, + ["Happy May Day!"] = true, + ["Happy Towel Day!"] = true, + ["Happy ROBLOX Day!"] = true, + ["Happy LOL Day!"] = true, + }, - [1] = '/sc 2' - }, - ['Goodbye'] = { - ['Good Night']= {'/sc 3_0', true, - ['Sweet dreams'] = true, - ['Go to sleep!'] = true, - ['Lights out!'] = true, - ['Bedtime'] = true, - ['Going to bed now'] = true}, + [1] = "/sc 2", + }, + ["Goodbye"] = { + ["Good Night"] = { + "/sc 3_0", + true, + ["Sweet dreams"] = true, + ["Go to sleep!"] = true, + ["Lights out!"] = true, + ["Bedtime"] = true, + ["Going to bed now"] = true, + }, - ['Later']= {'/sc 3_1', true, - ['See ya later'] = true, - ['Later gator!'] = true, - ['See you tomorrow'] = true}, + ["Later"] = { + "/sc 3_1", + true, + ["See ya later"] = true, + ["Later gator!"] = true, + ["See you tomorrow"] = true, + }, - ['Bye'] = {'/sc 3_2', true, ['Hasta la bye bye!'] = true}, - ['I\'ll be right back'] = {'/sc 3_3', true}, - ['I have to go'] = {'/sc 3_4', true}, - ['Farewell'] = {'/sc 3_5', true, ['Take care'] = true, ['Have a nice day'] = true, ['Goodluck!'] = true, ['Ta-ta for now!'] = true}, - ['Peace'] = {'/sc 3_6', true, ['Peace out!'] = true, ['Peace dudes!'] = true, ['Rest in pieces!'] = true}, - ['Silly'] = {'/sc 3_7', true, - ['To the batcave!'] = true, - ['Over and out!'] = true, - ['Happy trails!'] = true, - ['I\'ve got to book it!'] = true, - ['Tootles!'] = true, - ['Smell you later!'] = true, - ['GG!'] = true, - ['My house is on fire! gtg.'] = true}, - [1] = '/sc 3' - }, - ['Friend'] ={ - ['Wanna be friends?'] = {'/sc 4_0', true}, - ['Follow me'] = {'/sc 4_1', true, ['Come to my place!'] = true, ['Come to my base!'] = true, ['Follow me, team!'] = true, ['Follow me'] = true}, - ['Your place is cool'] = {'/sc 4_2', true, ['Your place is fun'] = true, ['Your place is awesome'] = true, ['Your place looks good'] = true, ['This place is awesome!'] = true}, - ['Thank you'] = {'/sc 4_3', true, ['Thanks for playing'] = true, ['Thanks for visiting'] = true, ['Thanks for everything'] = true, ['No, thank you'] = true, ['Thanx'] = true}, - ['No problem'] = {'/sc 4_4', true, ['Don\'t worry'] = true, ['That\'s ok'] = true, ['np'] = true}, - ['You are ...'] = {'/sc 4_5', true, - ['You are great!'] = true, - ['You are good!'] = true, - ['You are cool!'] = true, - ['You are funny!'] = true, - ['You are silly!'] = true, - ['You are awesome!'] = true, - ['You are doing something I don\'t like, please stop'] = true - }, - ['I like ...'] = {'/sc 4_6', true, ['I like your name'] = true, ['I like your shirt'] = true, ['I like your place'] = true, ['I like your style'] = true, - ['I like you'] = true, ['I like items'] = true, ['I like money'] = true}, - ['Sorry'] = {'/sc 4_7', true, ['My bad!'] = true, ['I\'m sorry'] = true, ['Whoops!'] = true, ['Please forgive me.'] = true, ['I forgive you.'] = true, - ['I didn\'t mean to do that.'] = true, ['Sorry, I\'ll stop now.'] = true}, - [1] = '/sc 4' - }, - ['Questions'] = { - ['Who?'] = {'/sc 5_0', true, ['Who wants to be my friend?'] = true, ['Who wants to be on my team?'] = true, ['Who made this brilliant game?'] = true}, - ['What?'] = {'/sc 5_1', true, ['What is your favorite animal?'] = true, ['What is your favorite game?'] = true, ['What is your favorite movie?'] = true, - ['What is your favorite TV show?'] = true, ['What is your favorite music?'] = true, ['What are your hobbies?'] = true, ['LOLWUT?'] = true}, - ['When?'] = {'/sc 5_2', true, ['When are you online?'] = true, ['When is the new version coming out?'] = true, ['When can we play again?'] = true, ['When will your place be done?'] = true}, - ['Where?'] = {'/sc 5_3', true, ['Where do you want to go?'] = true, ['Where are you going?'] = true, ['Where am I?!'] = true, ['Where did you go?'] = true}, - ['How?'] = {'/sc 5_4', true, ['How are you today?'] = true, ['How did you make this cool place?'] = true, ['LOLHOW?'] = true}, - ['Can I...'] = {'/sc 5_5', true, ['Can I have a tour?'] = true, ['Can I be on your team?'] = true, ['Can I be your friend?'] = true, ['Can I try something?'] = true, - ['Can I have that please?'] = true, ['Can I have that back please?'] = true, ['Can I have borrow your hat?'] = true, ['Can I have borrow your gear?'] = true}, - [1] = '/sc 5' - }, - ['Answers'] = { - ['You need help?'] = {'/sc 6_0', true, ['Check out the news section'] = true, ['Check out the help section'] = true, ['Read the wiki!'] = true, - ['All the answers are in the wiki!'] = true, ['I will help you with this.'] = true}, - ['Some people ...'] = {'/sc 6_1', true, ['Me'] = true, ['Not me'] = true, ['You'] = true, ['All of us'] = true, ['Everyone but you'] = true, ['Builderman!'] = true, - ['Telamon!'] = true, ['My team'] = true, ['My group'] = true, ['Mom'] = true, ['Dad'] = true, ['Sister'] = true, ['Brother'] = true, ['Cousin'] = true, - ['Grandparent'] = true, ['Friend'] = true}, - ['Time ...'] = {'/sc 6_2', true, ['In the morning'] = true, ['In the afternoon'] = true, ['At night'] = true, ['Tomorrow'] = true, ['This week'] = true, ['This month'] = true, - ['Sometime'] = true, ['Sometimes'] = true, ['Whenever you want'] = true, ['Never'] = true, ['After this'] = true, ['In 10 minutes'] = true, ['In a couple hours'] = true, - ['In a couple days'] = true}, - ['Animals'] = {'/sc 6_3', true, - ['Cats'] = {['Lion'] = true, ['Tiger'] = true, ['Leopard'] = true, ['Cheetah'] = true}, - ['Dogs'] = {['Wolves'] = true, ['Beagle'] = true, ['Collie'] = true, ['Dalmatian'] = true, ['Poodle'] = true, ['Spaniel'] = true, - ['Shepherd'] = true, ['Terrier'] = true, ['Retriever'] = true}, - ['Horses'] = {['Ponies'] = true, ['Stallions'] = true, ['Pwnyz'] = true}, - ['Reptiles'] = {['Dinosaurs'] = true, ['Lizards'] = true, ['Snakes'] = true, ['Turtles!'] = true}, - ['Hamster'] = true, - ['Monkey'] = true, - ['Bears'] = true, - ['Fish'] = {['Goldfish'] = true, ['Sharks'] = true, ['Sea Bass'] = true, ['Halibut'] = true, ['Tropical Fish'] = true}, - ['Birds'] = {['Eagles'] = true, ['Penguins'] = true, ['Parakeets'] = true, ['Owls'] = true, ['Hawks'] = true, ['Pidgeons'] = true}, - ['Elephants'] = true, - ['Mythical Beasts'] = {['Dragons'] = true, ['Unicorns'] = true, ['Sea Serpents'] = true, ['Sphinx'] = true, ['Cyclops'] = true, - ['Minotaurs'] = true, ['Goblins'] = true, ['Honest Politicians'] = true, ['Ghosts'] = true, ['Scylla and Charybdis'] = true} - }, - ['Games'] = {'/sc 6_4', true, - ['Action'] = true, ['Puzzle'] = true, ['Strategy'] = true, ['Racing'] = true, ['RPG'] = true, ['Obstacle Course'] = true, ['Tycoon'] = true, - ['Roblox'] = { ['BrickBattle'] = true, ['Community Building'] = true, ['Roblox Minigames'] = true, ['Contest Place'] = true}, - ['Board games'] = { ['Chess'] = true, ['Checkers'] = true, ['Settlers of Catan'] = true, ['Tigris and Euphrates'] = true, ['El Grande'] = true, - ['Stratego'] = true, ['Carcassonne'] = true} - }, - ['Sports'] = {'/sc 6_5', true, ['Hockey'] = true, ['Soccer'] = true, ['Football'] = true, ['Baseball'] = true, ['Basketball'] = true, - ['Volleyball'] = true, ['Tennis'] = true, ['Sports team practice'] = true, - ['Watersports'] = { ['Surfing'] = true,['Swimming'] = true, ['Water Polo'] = true}, - ['Winter sports'] = { ['Skiing'] = true, ['Snowboarding'] = true, ['Sledding'] = true, ['Skating'] = true}, - ['Adventure'] = {['Rock climbing'] = true, ['Hiking'] = true, ['Fishing'] = true, ['Horseback riding'] = true}, - ['Wacky'] = {['Foosball'] = true, ['Calvinball'] = true, ['Croquet'] = true, ['Cricket'] = true, ['Dodgeball'] = true, - ['Squash'] = true, ['Trampoline'] = true} - }, - ['Movies/TV'] = {'/sc 6_6', true, ['Science Fiction'] = true, ['Animated'] = {['Anime'] = true}, ['Comedy'] = true, ['Romantic'] = true, - ['Action'] = true, ['Fantasy'] = true}, - ['Music'] = {'/sc 6_7', true, ['Country'] = true, ['Jazz'] = true, ['Rap'] = true, ['Hip-hop'] = true, ['Techno'] = true, ['Classical'] = true, - ['Pop'] = true, ['Rock'] = true}, - ['Hobbies'] = {'/sc 6_8', true, - ['Computers'] = { ['Building computers'] = true, ['Videogames'] = true, ['Coding'] = true, ['Hacking'] = true}, - ['The Internet'] = { ['lol. teh internets!'] = true, ['Watching vids'] = true}, - ['Dance'] = true, ['Gymnastics'] = true, ['Listening to music'] = true, ['Arts and crafts'] = true, - ['Martial Arts'] = {['Karate'] = true, ['Judo'] = true, ['Taikwon Do'] = true, ['Wushu'] = true, ['Street fighting'] = true}, - ['Music lessons'] = {['Playing in my band'] = true, ['Playing piano'] = true, ['Playing guitar'] = true, - ['Playing violin'] = true, ['Playing drums'] = true, ['Playing a weird instrument'] = true} - }, - ['Location'] = {'/sc 6_9', true, - ['USA'] = { - ['West'] = { ['Alaska'] = true, ['Arizona'] = true, ['California'] = true, ['Colorado'] = true, ['Hawaii'] = true, - ['Idaho'] = true, ['Montana'] = true, ['Nevada'] = true, ['New Mexico'] = true, ['Oregon'] = true, - ['Utah'] = true, ['Washington'] = true, ['Wyoming'] = true - }, - ['South'] = { ['Alabama'] = true, ['Arkansas'] = true, ['Florida'] = true, ['Georgia'] = true, ['Kentucky'] = true, - ['Louisiana'] = true, ['Mississippi'] = true, ['North Carolina'] = true, ['Oklahoma'] = true, - ['South Carolina'] = true, ['Tennessee'] = true, ['Texas'] = true, ['Virginia'] = true, ['West Virginia'] = true - }, - ['Northeast'] = {['Connecticut'] = true, ['Delaware'] = true, ['Maine'] = true, ['Maryland'] = true, ['Massachusetts'] = true, - ['New Hampshire'] = true, ['New Jersey'] = true, ['New York'] = true, ['Pennsylvania'] = true, ['Rhode Island'] = true, - ['Vermont'] = true - }, - ['Midwest'] = {['Illinois'] = true, ['Indiana'] = true, ['Iowa'] = true, ['Kansas'] = true, ['Michigan'] = true, ['Minnesota'] = true, - ['Missouri'] = true, ['Nebraska'] = true, ['North Dakota'] = true, ['Ohio'] = true, ['South Dakota'] = true, ['Wisconsin'] = true} - }, - ['Canada'] = {['Alberta'] = true, ['British Columbia'] = true, ['Manitoba'] = true, ['New Brunswick'] = true, ['Newfoundland'] = true, - ['Northwest Territories'] = true, ['Nova Scotia'] = true, ['Nunavut'] = true, ['Ontario'] = true, ['Prince Edward Island'] = true, - ['Quebec'] = true, ['Saskatchewan'] = true, ['Yukon'] = true}, - ['Mexico'] = true, - ['Central America'] = true, - ['Europe'] = {['France'] = true, ['Germany'] = true, ['Spain'] = true, ['Italy'] = true, ['Poland'] = true, ['Switzerland'] = true, - ['Greece'] = true, ['Romania'] = true, ['Netherlands'] = true, - ['Great Britain'] = {['England'] = true, ['Scotland'] = true, ['Wales'] = true, ['Northern Ireland'] = true} - }, - ['Asia'] = { ['China'] = true, ['India'] = true, ['Japan'] = true, ['Korea'] = true, ['Russia'] = true, ['Vietnam'] = true}, - ['South America'] = { ['Argentina'] = true, ['Brazil'] = true}, - ['Africa'] = { ['Eygpt'] = true, ['Swaziland'] = true}, - ['Australia'] = true, ['Middle East'] = true, ['Antarctica'] = true, ['New Zealand'] = true - }, - ['Age'] = {'/sc 6_10', true, ['Rugrat'] = true, ['Kid'] = true, ['Tween'] = true, ['Teen'] = true, ['Twenties'] = true, - ['Old'] = true, ['Ancient'] = true, ['Mesozoic'] = true, ['I don\'t want to say my age. Don\'t ask.'] = true}, - ['Mood'] = {'/sc 6_11', true, ['Good'] = true, ['Great!'] = true, ['Not bad'] = true, ['Sad'] = true, ['Hyper'] = true, - ['Chill'] = true, ['Happy'] = true, ['Kind of mad'] = true}, - ['Boy'] = {'/sc 6_12', true}, - ['Girl'] = {'/sc 6_13', true}, - ['I don\'t want to say boy or girl. Don\'t ask.'] = {'/sc 6_14', true}, - [1] = '/sc 6' - }, - ['Game'] = { - ['Let\'s build'] = {'/sc 7_0', true}, - ['Let\'s battle'] = {'/sc 7_1', true}, - ['Nice one!'] = {'/sc 7_2', true}, - ['So far so good'] = {'/sc 7_3', true}, - ['Lucky shot!'] = {'/sc 7_4', true}, - ['Oh man!'] = {'/sc 7_5', true}, - ['I challenge you to a fight!'] = {'/sc 7_6', true}, - ['Help me with this'] = {'/sc 7_7', true}, - ['Let\'s go to your game'] = {'/sc 7_8', true}, - ['Can you show me how do to that?'] = {'/sc 7_9', true}, - ['Backflip!'] = {'/sc 7_10', true}, - ['Frontflip!'] = {'/sc 7_11', true}, - ['Dance!'] = {'/sc 7_12', true}, - ['I\'m on your side!'] = {'/sc 7_13', true}, - ['Game Commands'] = {'/sc 7_14', true, ['regen'] = true, ['reset'] = true, ['go'] = true, ['fix'] = true, ['respawn'] = true}, - [1] = '/sc 7' - }; - ['Silly'] = { - ['Muahahahaha!'] = true, - ['all your base are belong to me!'] = true, - ['GET OFF MAH LAWN'] = true, - ['TEH EPIK DUCK IS COMING!!!'] = true, - ['ROFL'] = true, - ['1337'] = {true, ['i r teh pwnz0r!'] = true, ['w00t!'] = true, ['z0mg h4x!'] = true, ['ub3rR0xXorzage!'] = true} - }, - ['Yes'] = { - ['Absolutely!'] = true, - ['Rock on!'] = true, - ['Totally!'] = true, - ['Juice!'] = true, - ['Yay!'] = true, - ['Yesh'] = true - }, - ['No'] = { - ['Ummm. No.'] = true, - ['...'] = true, - ['Stop!'] = true, - ['Go away!'] = true, - ['Don\'t do that'] = true, - ['Stop breaking the rules'] = true, - ['I don\'t want to'] = true - }, - ['Ok'] = { - ['Well... ok'] = true, - ['Sure'] = true - }, - ['Uncertain'] = { - ['Maybe'] = true, - ['I don\'t know'] = true, - ['idk'] = true, - ['I can\'t decide'] = true, - ['Hmm...'] = true - }, - [':-)'] = { - [':-('] = true, - [':D'] = true, - [':-O'] = true, - ['lol'] = true, - ['=D'] = true, - ['D='] = true, - ['XD'] = true, - [';D'] = true, - [';)'] = true, - ['O_O'] = true, - ['=)'] = true, - ['@_@'] = true, - ['>_<'] = true, - ['T_T'] = true, - ['^_^'] = true, - ['<(0_0<) <(0_0)> (>0_0)> KIRBY DANCE'] = true, - [')\';'] = true, - [':3'] = true - }, - ['Ratings'] = { - ['Rate it!'] = true, - ['I give it a 1 out of 10'] = true, - ['I give it a 2 out of 10'] = true, - ['I give it a 3 out of 10'] = true, - ['I give it a 4 out of 10'] = true, - ['I give it a 5 out of 10'] = true, - ['I give it a 6 out of 10'] = true, - ['I give it a 7 out of 10'] = true, - ['I give it a 8 out of 10'] = true, - ['I give it a 9 out of 10'] = true, - ['I give it a 10 out of 10!'] = true, - } - }, - CreateEnum('SafeChat'){'Level1', 'Level2', 'Level3'}, - SafeChatTree = {}, - TempSpaceLabel = nil - } + ["Bye"] = { "/sc 3_2", true, ["Hasta la bye bye!"] = true }, + ["I'll be right back"] = { "/sc 3_3", true }, + ["I have to go"] = { "/sc 3_4", true }, + ["Farewell"] = { + "/sc 3_5", + true, + ["Take care"] = true, + ["Have a nice day"] = true, + ["Goodluck!"] = true, + ["Ta-ta for now!"] = true, + }, + ["Peace"] = { "/sc 3_6", true, ["Peace out!"] = true, ["Peace dudes!"] = true, ["Rest in pieces!"] = true }, + ["Silly"] = { + "/sc 3_7", + true, + ["To the batcave!"] = true, + ["Over and out!"] = true, + ["Happy trails!"] = true, + ["I've got to book it!"] = true, + ["Tootles!"] = true, + ["Smell you later!"] = true, + ["GG!"] = true, + ["My house is on fire! gtg."] = true, + }, + [1] = "/sc 3", + }, + ["Friend"] = { + ["Wanna be friends?"] = { "/sc 4_0", true }, + ["Follow me"] = { + "/sc 4_1", + true, + ["Come to my place!"] = true, + ["Come to my base!"] = true, + ["Follow me, team!"] = true, + ["Follow me"] = true, + }, + ["Your place is cool"] = { + "/sc 4_2", + true, + ["Your place is fun"] = true, + ["Your place is awesome"] = true, + ["Your place looks good"] = true, + ["This place is awesome!"] = true, + }, + ["Thank you"] = { + "/sc 4_3", + true, + ["Thanks for playing"] = true, + ["Thanks for visiting"] = true, + ["Thanks for everything"] = true, + ["No, thank you"] = true, + ["Thanx"] = true, + }, + ["No problem"] = { "/sc 4_4", true, ["Don't worry"] = true, ["That's ok"] = true, ["np"] = true }, + ["You are ..."] = { + "/sc 4_5", + true, + ["You are great!"] = true, + ["You are good!"] = true, + ["You are cool!"] = true, + ["You are funny!"] = true, + ["You are silly!"] = true, + ["You are awesome!"] = true, + ["You are doing something I don't like, please stop"] = true, + }, + ["I like ..."] = { + "/sc 4_6", + true, + ["I like your name"] = true, + ["I like your shirt"] = true, + ["I like your place"] = true, + ["I like your style"] = true, + ["I like you"] = true, + ["I like items"] = true, + ["I like money"] = true, + }, + ["Sorry"] = { + "/sc 4_7", + true, + ["My bad!"] = true, + ["I'm sorry"] = true, + ["Whoops!"] = true, + ["Please forgive me."] = true, + ["I forgive you."] = true, + ["I didn't mean to do that."] = true, + ["Sorry, I'll stop now."] = true, + }, + [1] = "/sc 4", + }, + ["Questions"] = { + ["Who?"] = { + "/sc 5_0", + true, + ["Who wants to be my friend?"] = true, + ["Who wants to be on my team?"] = true, + ["Who made this brilliant game?"] = true, + }, + ["What?"] = { + "/sc 5_1", + true, + ["What is your favorite animal?"] = true, + ["What is your favorite game?"] = true, + ["What is your favorite movie?"] = true, + ["What is your favorite TV show?"] = true, + ["What is your favorite music?"] = true, + ["What are your hobbies?"] = true, + ["LOLWUT?"] = true, + }, + ["When?"] = { + "/sc 5_2", + true, + ["When are you online?"] = true, + ["When is the new version coming out?"] = true, + ["When can we play again?"] = true, + ["When will your place be done?"] = true, + }, + ["Where?"] = { + "/sc 5_3", + true, + ["Where do you want to go?"] = true, + ["Where are you going?"] = true, + ["Where am I?!"] = true, + ["Where did you go?"] = true, + }, + ["How?"] = { + "/sc 5_4", + true, + ["How are you today?"] = true, + ["How did you make this cool place?"] = true, + ["LOLHOW?"] = true, + }, + ["Can I..."] = { + "/sc 5_5", + true, + ["Can I have a tour?"] = true, + ["Can I be on your team?"] = true, + ["Can I be your friend?"] = true, + ["Can I try something?"] = true, + ["Can I have that please?"] = true, + ["Can I have that back please?"] = true, + ["Can I have borrow your hat?"] = true, + ["Can I have borrow your gear?"] = true, + }, + [1] = "/sc 5", + }, + ["Answers"] = { + ["You need help?"] = { + "/sc 6_0", + true, + ["Check out the news section"] = true, + ["Check out the help section"] = true, + ["Read the wiki!"] = true, + ["All the answers are in the wiki!"] = true, + ["I will help you with this."] = true, + }, + ["Some people ..."] = { + "/sc 6_1", + true, + ["Me"] = true, + ["Not me"] = true, + ["You"] = true, + ["All of us"] = true, + ["Everyone but you"] = true, + ["Builderman!"] = true, + ["Telamon!"] = true, + ["My team"] = true, + ["My group"] = true, + ["Mom"] = true, + ["Dad"] = true, + ["Sister"] = true, + ["Brother"] = true, + ["Cousin"] = true, + ["Grandparent"] = true, + ["Friend"] = true, + }, + ["Time ..."] = { + "/sc 6_2", + true, + ["In the morning"] = true, + ["In the afternoon"] = true, + ["At night"] = true, + ["Tomorrow"] = true, + ["This week"] = true, + ["This month"] = true, + ["Sometime"] = true, + ["Sometimes"] = true, + ["Whenever you want"] = true, + ["Never"] = true, + ["After this"] = true, + ["In 10 minutes"] = true, + ["In a couple hours"] = true, + ["In a couple days"] = true, + }, + ["Animals"] = { + "/sc 6_3", + true, + ["Cats"] = { ["Lion"] = true, ["Tiger"] = true, ["Leopard"] = true, ["Cheetah"] = true }, + ["Dogs"] = { + ["Wolves"] = true, + ["Beagle"] = true, + ["Collie"] = true, + ["Dalmatian"] = true, + ["Poodle"] = true, + ["Spaniel"] = true, + ["Shepherd"] = true, + ["Terrier"] = true, + ["Retriever"] = true, + }, + ["Horses"] = { ["Ponies"] = true, ["Stallions"] = true, ["Pwnyz"] = true }, + ["Reptiles"] = { ["Dinosaurs"] = true, ["Lizards"] = true, ["Snakes"] = true, ["Turtles!"] = true }, + ["Hamster"] = true, + ["Monkey"] = true, + ["Bears"] = true, + ["Fish"] = { + ["Goldfish"] = true, + ["Sharks"] = true, + ["Sea Bass"] = true, + ["Halibut"] = true, + ["Tropical Fish"] = true, + }, + ["Birds"] = { + ["Eagles"] = true, + ["Penguins"] = true, + ["Parakeets"] = true, + ["Owls"] = true, + ["Hawks"] = true, + ["Pidgeons"] = true, + }, + ["Elephants"] = true, + ["Mythical Beasts"] = { + ["Dragons"] = true, + ["Unicorns"] = true, + ["Sea Serpents"] = true, + ["Sphinx"] = true, + ["Cyclops"] = true, + ["Minotaurs"] = true, + ["Goblins"] = true, + ["Honest Politicians"] = true, + ["Ghosts"] = true, + ["Scylla and Charybdis"] = true, + }, + }, + ["Games"] = { + "/sc 6_4", + true, + ["Action"] = true, + ["Puzzle"] = true, + ["Strategy"] = true, + ["Racing"] = true, + ["RPG"] = true, + ["Obstacle Course"] = true, + ["Tycoon"] = true, + ["Roblox"] = { + ["BrickBattle"] = true, + ["Community Building"] = true, + ["Roblox Minigames"] = true, + ["Contest Place"] = true, + }, + ["Board games"] = { + ["Chess"] = true, + ["Checkers"] = true, + ["Settlers of Catan"] = true, + ["Tigris and Euphrates"] = true, + ["El Grande"] = true, + ["Stratego"] = true, + ["Carcassonne"] = true, + }, + }, + ["Sports"] = { + "/sc 6_5", + true, + ["Hockey"] = true, + ["Soccer"] = true, + ["Football"] = true, + ["Baseball"] = true, + ["Basketball"] = true, + ["Volleyball"] = true, + ["Tennis"] = true, + ["Sports team practice"] = true, + ["Watersports"] = { ["Surfing"] = true, ["Swimming"] = true, ["Water Polo"] = true }, + ["Winter sports"] = { + ["Skiing"] = true, + ["Snowboarding"] = true, + ["Sledding"] = true, + ["Skating"] = true, + }, + ["Adventure"] = { + ["Rock climbing"] = true, + ["Hiking"] = true, + ["Fishing"] = true, + ["Horseback riding"] = true, + }, + ["Wacky"] = { + ["Foosball"] = true, + ["Calvinball"] = true, + ["Croquet"] = true, + ["Cricket"] = true, + ["Dodgeball"] = true, + ["Squash"] = true, + ["Trampoline"] = true, + }, + }, + ["Movies/TV"] = { + "/sc 6_6", + true, + ["Science Fiction"] = true, + ["Animated"] = { ["Anime"] = true }, + ["Comedy"] = true, + ["Romantic"] = true, + ["Action"] = true, + ["Fantasy"] = true, + }, + ["Music"] = { + "/sc 6_7", + true, + ["Country"] = true, + ["Jazz"] = true, + ["Rap"] = true, + ["Hip-hop"] = true, + ["Techno"] = true, + ["Classical"] = true, + ["Pop"] = true, + ["Rock"] = true, + }, + ["Hobbies"] = { + "/sc 6_8", + true, + ["Computers"] = { + ["Building computers"] = true, + ["Videogames"] = true, + ["Coding"] = true, + ["Hacking"] = true, + }, + ["The Internet"] = { ["lol. teh internets!"] = true, ["Watching vids"] = true }, + ["Dance"] = true, + ["Gymnastics"] = true, + ["Listening to music"] = true, + ["Arts and crafts"] = true, + ["Martial Arts"] = { + ["Karate"] = true, + ["Judo"] = true, + ["Taikwon Do"] = true, + ["Wushu"] = true, + ["Street fighting"] = true, + }, + ["Music lessons"] = { + ["Playing in my band"] = true, + ["Playing piano"] = true, + ["Playing guitar"] = true, + ["Playing violin"] = true, + ["Playing drums"] = true, + ["Playing a weird instrument"] = true, + }, + }, + ["Location"] = { + "/sc 6_9", + true, + ["USA"] = { + ["West"] = { + ["Alaska"] = true, + ["Arizona"] = true, + ["California"] = true, + ["Colorado"] = true, + ["Hawaii"] = true, + ["Idaho"] = true, + ["Montana"] = true, + ["Nevada"] = true, + ["New Mexico"] = true, + ["Oregon"] = true, + ["Utah"] = true, + ["Washington"] = true, + ["Wyoming"] = true, + }, + ["South"] = { + ["Alabama"] = true, + ["Arkansas"] = true, + ["Florida"] = true, + ["Georgia"] = true, + ["Kentucky"] = true, + ["Louisiana"] = true, + ["Mississippi"] = true, + ["North Carolina"] = true, + ["Oklahoma"] = true, + ["South Carolina"] = true, + ["Tennessee"] = true, + ["Texas"] = true, + ["Virginia"] = true, + ["West Virginia"] = true, + }, + ["Northeast"] = { + ["Connecticut"] = true, + ["Delaware"] = true, + ["Maine"] = true, + ["Maryland"] = true, + ["Massachusetts"] = true, + ["New Hampshire"] = true, + ["New Jersey"] = true, + ["New York"] = true, + ["Pennsylvania"] = true, + ["Rhode Island"] = true, + ["Vermont"] = true, + }, + ["Midwest"] = { + ["Illinois"] = true, + ["Indiana"] = true, + ["Iowa"] = true, + ["Kansas"] = true, + ["Michigan"] = true, + ["Minnesota"] = true, + ["Missouri"] = true, + ["Nebraska"] = true, + ["North Dakota"] = true, + ["Ohio"] = true, + ["South Dakota"] = true, + ["Wisconsin"] = true, + }, + }, + ["Canada"] = { + ["Alberta"] = true, + ["British Columbia"] = true, + ["Manitoba"] = true, + ["New Brunswick"] = true, + ["Newfoundland"] = true, + ["Northwest Territories"] = true, + ["Nova Scotia"] = true, + ["Nunavut"] = true, + ["Ontario"] = true, + ["Prince Edward Island"] = true, + ["Quebec"] = true, + ["Saskatchewan"] = true, + ["Yukon"] = true, + }, + ["Mexico"] = true, + ["Central America"] = true, + ["Europe"] = { + ["France"] = true, + ["Germany"] = true, + ["Spain"] = true, + ["Italy"] = true, + ["Poland"] = true, + ["Switzerland"] = true, + ["Greece"] = true, + ["Romania"] = true, + ["Netherlands"] = true, + ["Great Britain"] = { + ["England"] = true, + ["Scotland"] = true, + ["Wales"] = true, + ["Northern Ireland"] = true, + }, + }, + ["Asia"] = { + ["China"] = true, + ["India"] = true, + ["Japan"] = true, + ["Korea"] = true, + ["Russia"] = true, + ["Vietnam"] = true, + }, + ["South America"] = { ["Argentina"] = true, ["Brazil"] = true }, + ["Africa"] = { ["Eygpt"] = true, ["Swaziland"] = true }, + ["Australia"] = true, + ["Middle East"] = true, + ["Antarctica"] = true, + ["New Zealand"] = true, + }, + ["Age"] = { + "/sc 6_10", + true, + ["Rugrat"] = true, + ["Kid"] = true, + ["Tween"] = true, + ["Teen"] = true, + ["Twenties"] = true, + ["Old"] = true, + ["Ancient"] = true, + ["Mesozoic"] = true, + ["I don't want to say my age. Don't ask."] = true, + }, + ["Mood"] = { + "/sc 6_11", + true, + ["Good"] = true, + ["Great!"] = true, + ["Not bad"] = true, + ["Sad"] = true, + ["Hyper"] = true, + ["Chill"] = true, + ["Happy"] = true, + ["Kind of mad"] = true, + }, + ["Boy"] = { "/sc 6_12", true }, + ["Girl"] = { "/sc 6_13", true }, + ["I don't want to say boy or girl. Don't ask."] = { "/sc 6_14", true }, + [1] = "/sc 6", + }, + ["Game"] = { + ["Let's build"] = { "/sc 7_0", true }, + ["Let's battle"] = { "/sc 7_1", true }, + ["Nice one!"] = { "/sc 7_2", true }, + ["So far so good"] = { "/sc 7_3", true }, + ["Lucky shot!"] = { "/sc 7_4", true }, + ["Oh man!"] = { "/sc 7_5", true }, + ["I challenge you to a fight!"] = { "/sc 7_6", true }, + ["Help me with this"] = { "/sc 7_7", true }, + ["Let's go to your game"] = { "/sc 7_8", true }, + ["Can you show me how do to that?"] = { "/sc 7_9", true }, + ["Backflip!"] = { "/sc 7_10", true }, + ["Frontflip!"] = { "/sc 7_11", true }, + ["Dance!"] = { "/sc 7_12", true }, + ["I'm on your side!"] = { "/sc 7_13", true }, + ["Game Commands"] = { + "/sc 7_14", + true, + ["regen"] = true, + ["reset"] = true, + ["go"] = true, + ["fix"] = true, + ["respawn"] = true, + }, + [1] = "/sc 7", + }, + ["Silly"] = { + ["Muahahahaha!"] = true, + ["all your base are belong to me!"] = true, + ["GET OFF MAH LAWN"] = true, + ["TEH EPIK DUCK IS COMING!!!"] = true, + ["ROFL"] = true, + ["1337"] = { + true, + ["i r teh pwnz0r!"] = true, + ["w00t!"] = true, + ["z0mg h4x!"] = true, + ["ub3rR0xXorzage!"] = true, + }, + }, + ["Yes"] = { + ["Absolutely!"] = true, + ["Rock on!"] = true, + ["Totally!"] = true, + ["Juice!"] = true, + ["Yay!"] = true, + ["Yesh"] = true, + }, + ["No"] = { + ["Ummm. No."] = true, + ["..."] = true, + ["Stop!"] = true, + ["Go away!"] = true, + ["Don't do that"] = true, + ["Stop breaking the rules"] = true, + ["I don't want to"] = true, + }, + ["Ok"] = { + ["Well... ok"] = true, + ["Sure"] = true, + }, + ["Uncertain"] = { + ["Maybe"] = true, + ["I don't know"] = true, + ["idk"] = true, + ["I can't decide"] = true, + ["Hmm..."] = true, + }, + [":-)"] = { + [":-("] = true, + [":D"] = true, + [":-O"] = true, + ["lol"] = true, + ["=D"] = true, + ["D="] = true, + ["XD"] = true, + [";D"] = true, + [";)"] = true, + ["O_O"] = true, + ["=)"] = true, + ["@_@"] = true, + [">_<"] = true, + ["T_T"] = true, + ["^_^"] = true, + ["<(0_0<) <(0_0)> (>0_0)> KIRBY DANCE"] = true, + [")';"] = true, + [":3"] = true, + }, + ["Ratings"] = { + ["Rate it!"] = true, + ["I give it a 1 out of 10"] = true, + ["I give it a 2 out of 10"] = true, + ["I give it a 3 out of 10"] = true, + ["I give it a 4 out of 10"] = true, + ["I give it a 5 out of 10"] = true, + ["I give it a 6 out of 10"] = true, + ["I give it a 7 out of 10"] = true, + ["I give it a 8 out of 10"] = true, + ["I give it a 9 out of 10"] = true, + ["I give it a 10 out of 10!"] = true, + }, + }, + CreateEnum "SafeChat" { "Level1", "Level2", "Level3" }, + SafeChatTree = {}, + TempSpaceLabel = nil, +} --------------------------------------------------- local function GetNameValue(pName) local value = 0 - for index = 1, #pName do + for index = 1, #pName do local cValue = string.byte(string.sub(pName, index, index)) local reverseIndex = #pName - index + 1 - if #pName%2 == 1 then - reverseIndex = reverseIndex - 1 + if #pName % 2 == 1 then + reverseIndex = reverseIndex - 1 end - if reverseIndex%4 >= 2 then - cValue = -cValue - end - value = value + cValue - end - return value%8 -end + if reverseIndex % 4 >= 2 then + cValue = -cValue + end + value = value + cValue + end + return value % 8 +end function Chat:ComputeChatColor(pName) return self.ChatColors[GetNameValue(pName) + 1].Color -end +end --- This is context based scrolling +-- This is context based scrolling function Chat:EnableScrolling(toggle) - -- Genius idea gone to fail, if we switch the camera type we can effectively lock the - -- camera and do no click scrolling - self.MouseOnFrame = false - if self.RenderFrame then - self.RenderFrame.MouseEnter:connect(function() - local character = Player.Character - local torso = WaitForChild(character, 'Torso') - local humanoid = WaitForChild(character, 'Humanoid') - local head = WaitForChild(character, 'Head') - if toggle then - self.MouseOnFrame = true - Camera.CameraType = 'Scriptable' - -- Get relative position of camera and keep to it - Spawn(function() + -- Genius idea gone to fail, if we switch the camera type we can effectively lock the + -- camera and do no click scrolling + self.MouseOnFrame = false + if self.RenderFrame then + self.RenderFrame.MouseEnter:connect(function() + local character = Player.Character + local torso = WaitForChild(character, "Torso") + local humanoid = WaitForChild(character, "Humanoid") + local head = WaitForChild(character, "Head") + if toggle then + self.MouseOnFrame = true + Camera.CameraType = "Scriptable" + -- Get relative position of camera and keep to it + Spawn(function() local currentRelativePos = Camera.CoordinateFrame.p - torso.Position while Chat.MouseOnFrame do Camera.CoordinateFrame = CFrame.new(torso.Position + currentRelativePos, head.Position) - wait(0.015) - end + wait(0.015) + end end) - end + end end) self.RenderFrame.MouseLeave:connect(function() - Camera.CameraType = 'Custom' - self.MouseOnFrame = false + Camera.CameraType = "Custom" + self.MouseOnFrame = false end) - end -end + end +end --- TODO: Scrolling using Mouse wheel -function Chat:OnScroll(speed) - if self.MouseOnFrame then - -- - end -end +-- TODO: Scrolling using Mouse wheel +-- function Chat:OnScroll(speed) +-- if self.MouseOnFrame then +-- -- +-- end +-- end --- Check if we are running on a touch device +-- Check if we are running on a touch device function Chat:IsTouchDevice() - local touchEnabled = false - pcall(function() touchEnabled = Game:GetService('UserInputService').TouchEnabled end) - return touchEnabled + local touchEnabled = false + pcall(function() + touchEnabled = Game:GetService("UserInputService").TouchEnabled + end) + return touchEnabled end -- Scrolling -function Chat:ScrollQueue(value) - --[[for i = 1, #self.MessageQueue do - if self.MessageQueue[i] then - for _, label in pairs(self.MessageQueue[i]) do - 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 - label.Position = previous['Message'].Position - elseif value < 1 and next['Message'] then - label.Position = previous['Message'].Position - end - end - end - end - end ]] -end +-- function Chat:ScrollQueue(value) +-- --[[for i = 1, #self.MessageQueue do +-- if self.MessageQueue[i] then +-- for _, label in pairs(self.MessageQueue[i]) do +-- 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 +-- label.Position = previous['Message'].Position +-- elseif value < 1 and next['Message'] then +-- label.Position = previous['Message'].Position +-- end +-- end +-- end +-- end +-- end ]] +-- end -- Handles the rendering of the text objects in their appropriate places -function Chat:UpdateQueue(field, diff) - -- Have to do some sort of correction here - for i = #self.MessageQueue, 1, -1 do - if self.MessageQueue[i] then - for _, label in pairs(self.MessageQueue[i]) do - if label and type(label) ~= 'table' and type(label) ~= 'number' then - if label:IsA('TextLabel') or label:IsA('TextButton') then - if diff then - label.Position = label.Position - UDim2.new(0, 0, diff, 0) - else - if field == self.MessageQueue[i] then - label.Position = UDim2.new(self.Configuration.XScale, 0, label.Position.Y.Scale - field['Message'].Size.Y.Scale , 0) - -- Just to show up popping effect for the latest message in chat +function Chat:UpdateQueue(field, diff) + -- Have to do some sort of correction here + for i = #self.MessageQueue, 1, -1 do + if self.MessageQueue[i] then + for _, label in pairs(self.MessageQueue[i]) do + if label and type(label) ~= "table" and type(label) ~= "number" then + if label:IsA "TextLabel" or label:IsA "TextButton" then + if diff then + label.Position = label.Position - UDim2.new(0, 0, diff, 0) + else + if field == self.MessageQueue[i] then + label.Position = UDim2.new( + self.Configuration.XScale, + 0, + label.Position.Y.Scale - field["Message"].Size.Y.Scale, + 0 + ) + -- Just to show up popping effect for the latest message in chat Spawn(function() - wait(0.05) - while label.TextTransparency >= 0 do + wait(0.05) + while label.TextTransparency >= 0 do label.TextTransparency = label.TextTransparency - 0.2 - wait(0.03) - end - if label == field['Message'] then + wait(0.03) + end + if label == field["Message"] then label.TextStrokeTransparency = 0.8 - else - label.TextStrokeTransparency = 1.0 - end + else + label.TextStrokeTransparency = 1 + end end) - else - label.Position = UDim2.new(self.Configuration.XScale, 0, label.Position.Y.Scale - field['Message'].Size.Y.Scale, 0) - end - if label.Position.Y.Scale < -0.01 then + else + label.Position = UDim2.new( + self.Configuration.XScale, + 0, + label.Position.Y.Scale - field["Message"].Size.Y.Scale, + 0 + ) + end + if label.Position.Y.Scale < -0.01 then -- NOTE: Remove this fix when Textbounds is fixed - label.Visible = false - label:Destroy() - end - end - end - end - end - end - end -end - -function Chat:CreateScrollBar() - -- Code for scrolling is in here, partially, but scroll bar drawing isn't drawn - -- TODO: Implement + label.Visible = false + label:Destroy() + end + end + end + end + end + end + end end --- For scrolling, to see if we hit the bounds so that we can stop it from scrolling anymore -function Chat:CheckIfInBounds(value) - if #Chat.MessageQueue < 3 then - return true - end +function Chat:CreateScrollBar() + -- Code for scrolling is in here, partially, but scroll bar drawing isn't drawn + -- TODO: Implement +end - if value > 0 and Chat.MessageQueue[1] and Chat.MessageQueue[1]['Player'] and Chat.MessageQueue[1]['Player'].Position.Y.Scale == 0 then - return true - elseif value < 0 and Chat.MessageQueue[1] and Chat.MessageQueue[1]['Player'] and Chat.MessageQueue[1]['Player'].Position.Y.Scale < 0 then - return true - else - return false - end +-- For scrolling, to see if we hit the bounds so that we can stop it from scrolling anymore +function Chat:CheckIfInBounds(value) + if #Chat.MessageQueue < 3 then + return true + end + + if + value > 0 + and Chat.MessageQueue[1] + and Chat.MessageQueue[1]["Player"] + and Chat.MessageQueue[1]["Player"].Position.Y.Scale == 0 + then + return true + elseif + value < 0 + and Chat.MessageQueue[1] + and Chat.MessageQueue[1]["Player"] + and Chat.MessageQueue[1]["Player"].Position.Y.Scale < 0 + then + return true + else + return false + end return false -end +end -- This is to precompute all playerName space strings -- This is used to offset the message by exactly this + 2 spacestrings function Chat:ComputeSpaceString(pLabel) local nString = " " - if not self.TempSpaceLabel then - self.TempSpaceLabel = Gui.Create'TextButton' - { - Size = UDim2.new(0, pLabel.AbsoluteSize.X, 0, pLabel.AbsoluteSize.Y); - FontSize = self.Configuration.FontSize; - Parent = self.RenderFrame; - BackgroundTransparency = 1.0; - Text = nString; - Name = 'SpaceButton' - }; + if not self.TempSpaceLabel then + self.TempSpaceLabel = Gui.Create "TextButton" { + Size = UDim2.new(0, pLabel.AbsoluteSize.X, 0, pLabel.AbsoluteSize.Y), + FontSize = self.Configuration.FontSize, + Parent = self.RenderFrame, + BackgroundTransparency = 1, + Text = nString, + Name = "SpaceButton", + } else self.TempSpaceLabel.Text = nString - end - - while self.TempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do + end + + while self.TempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do nString = nString .. " " - self.TempSpaceLabel.Text = nString - end + self.TempSpaceLabel.Text = nString + end nString = nString .. " " - self.CachedSpaceStrings_List[pLabel.Text] = nString + self.CachedSpaceStrings_List[pLabel.Text] = nString self.TempSpaceLabel.Text = "" - return nString + return nString end --- When the playerChatted event fires --- The message is what the player chatted +-- When the playerChatted event fires +-- The message is what the player chatted function Chat:UpdateChat(cPlayer, message) local messageField = { - ['Player'] = cPlayer, - ['Message'] = message - } - if coroutine.status(Chat.MessageThread) == 'dead' then - --Chat.Messages_List = {} - table.insert(Chat.Messages_List, messageField) - Chat.MessageThread = coroutine.create(function() - for i = 1, #Chat.Messages_List do - local field = Chat.Messages_List[i] - Chat:CreateMessage(field['Player'], field['Message']) - end - Chat.Messages_List = {} - end) - coroutine.resume(Chat.MessageThread) - else + ["Player"] = cPlayer, + ["Message"] = message, + } + if coroutine.status(Chat.MessageThread) == "dead" then + --Chat.Messages_List = {} table.insert(Chat.Messages_List, messageField) - end -end + Chat.MessageThread = coroutine.create(function() + for i = 1, #Chat.Messages_List do + local field = Chat.Messages_List[i] + Chat:CreateMessage(field["Player"], field["Message"]) + end + Chat.Messages_List = {} + end) + coroutine.resume(Chat.MessageThread) + else + table.insert(Chat.Messages_List, messageField) + end +end function Chat:RecalculateSpacing() --[[for i = 1, #self.MessageQueue do @@ -668,31 +1109,31 @@ function Chat:RecalculateSpacing() Chat:UpdateQueue(self.MessageQueue[i], diff) end ]] -end +end function Chat:ApplyFilter(str) --[[for _, word in pair(self.Filter_List) do if string.find(str, word) then str:gsub(word, '@#$^') end - end ]] + end ]] end --- NOTE: Temporarily disabled ring buffer to allow for chat to always wrap around -function Chat:CreateMessage(cPlayer, message) +-- NOTE: Temporarily disabled ring buffer to allow for chat to always wrap around +function Chat:CreateMessage(cPlayer, message) local pName - if not cPlayer then - pName = '' - else - pName = cPlayer.Name - end - message = StringTrim(message) + if not cPlayer then + pName = "" + else + pName = cPlayer.Name + end + message = StringTrim(message) local pLabel - local mLabel - -- Our history stores upto 50 messages that is 100 textlabels - -- If we ever hit the mark, which would be in every popular game btw - -- we wrap around and reuse the labels - if #self.MessageQueue > self.Configuration.HistoryLength then + local mLabel + -- Our history stores upto 50 messages that is 100 textlabels + -- If we ever hit the mark, which would be in every popular game btw + -- we wrap around and reuse the labels + if #self.MessageQueue > self.Configuration.HistoryLength then --[[pLabel = self.MessageQueue[#self.MessageQueue]['Player'] mLabel = self.MessageQueue[#self.MessageQueue]['Message'] @@ -724,133 +1165,130 @@ function Chat:CreateMessage(cPlayer, message) mLabel.Position = UDim2.new(0, 0, 1, 0); pLabel.Position = UDim2.new(0, 0, 1, 0);]] - -- Reinserted at the beginning, ring buffer - self.MessageQueue[#self.MessageQueue] = nil + -- Reinserted at the beginning, ring buffer + self.MessageQueue[#self.MessageQueue] = nil + end + --else + -- Haven't hit the mark yet, so keep creating + pLabel = Gui.Create "TextLabel" { + Name = pName, + Text = pName .. ":", + TextColor3 = pColor, + FontSize = Chat.Configuration.FontSize, + TextXAlignment = Enum.TextXAlignment.Left, + TextYAlignment = Enum.TextYAlignment.Top, + Parent = self.RenderFrame, + TextWrapped = false, + Size = UDim2.new(1, 0, 0.1, 0), + BackgroundTransparency = 1, + TextTransparency = 1, + Position = UDim2.new(0, 0, 1, 0), + BorderSizePixel = 0, + TextStrokeColor3 = Color3.new(0.5, 0.5, 0.5), + TextStrokeTransparency = 0.75, + --Active = false; + } + local pColor + if cPlayer.Neutral then + pLabel.TextColor3 = Chat:ComputeChatColor(pName) + else + pLabel.TextColor3 = cPlayer.TeamColor.Color end - --else - -- Haven't hit the mark yet, so keep creating - pLabel = Gui.Create'TextLabel' - { - Name = pName; - Text = pName .. ":"; - TextColor3 = pColor; - FontSize = Chat.Configuration.FontSize; - TextXAlignment = Enum.TextXAlignment.Left; - TextYAlignment = Enum.TextYAlignment.Top; - Parent = self.RenderFrame; - TextWrapped = false; - Size = UDim2.new(1, 0, 0.1, 0); - BackgroundTransparency = 1.0; - TextTransparency = 1.0; - Position = UDim2.new(0, 0, 1, 0); - BorderSizePixel = 0.0; - TextStrokeColor3 = Color3.new(0.5, 0.5, 0.5); - TextStrokeTransparency = 0.75; - --Active = false; - }; - local pColor - if cPlayer.Neutral then - pLabel.TextColor3 = Chat:ComputeChatColor(pName) - else - pLabel.TextColor3 = cPlayer.TeamColor.Color - end - local nString + local nString - if not self.CachedSpaceStrings_List[pName] then - nString = Chat:ComputeSpaceString(pLabel) - else - nString = self.CachedSpaceStrings_List[pName] - end + if not self.CachedSpaceStrings_List[pName] then + nString = Chat:ComputeSpaceString(pLabel) + else + nString = self.CachedSpaceStrings_List[pName] + end - mLabel = Gui.Create'TextLabel' - { - Name = pName .. ' - message'; - -- Max is 3 lines - Size = UDim2.new(1, 0, 0.5, 0); - TextColor3 = Chat.Configuration.MessageColor; - FontSize = Chat.Configuration.FontSize; - TextXAlignment = Enum.TextXAlignment.Left; - TextYAlignment = Enum.TextYAlignment.Top; - Text = ""; -- this is to stop when the engine reverts the swear words to default, which is button, ugh - Parent = self.RenderFrame; - TextWrapped = true; - BackgroundTransparency = 1.0; - TextTransparency = 1.0; - Position = UDim2.new(0, 0, 1, 0); - BorderSizePixel = 0.0; - TextStrokeColor3 = Color3.new(0, 0, 0); - --TextStrokeTransparency = 0.8; - --Active = false; - }; - mLabel.Text = nString .. message; + mLabel = Gui.Create "TextLabel" { + Name = pName .. " - message", + -- Max is 3 lines + Size = UDim2.new(1, 0, 0.5, 0), + TextColor3 = Chat.Configuration.MessageColor, + FontSize = Chat.Configuration.FontSize, + TextXAlignment = Enum.TextXAlignment.Left, + TextYAlignment = Enum.TextYAlignment.Top, + Text = "", -- this is to stop when the engine reverts the swear words to default, which is button, ugh + Parent = self.RenderFrame, + TextWrapped = true, + BackgroundTransparency = 1, + TextTransparency = 1, + Position = UDim2.new(0, 0, 1, 0), + BorderSizePixel = 0, + TextStrokeColor3 = Color3.new(0, 0, 0), + --TextStrokeTransparency = 0.8; + --Active = false; + } + mLabel.Text = nString .. message - if not pName then - pLabel.Text = '' - mLabel.TextColor3 = Color3.new(0, 0.4, 1.0) - end - --end + if not pName then + pLabel.Text = "" + mLabel.TextColor3 = Color3.new(0, 0.4, 1.0) + end + --end - for _, adminName in pairs(self.Admins_List) do - if string.lower(adminName) == string.lower(pName) then + for _, adminName in pairs(self.Admins_List) do + if string.lower(adminName) == string.lower(pName) then mLabel.TextColor3 = self.Configuration.AdminMessageColor - end - end + end + end pLabel.Visible = true - mLabel.Visible = true - - -- This will give beautiful multilines as well - local heightField = mLabel.TextBounds.Y + mLabel.Visible = true - mLabel.Size = UDim2.new(1, 0, heightField/self.RenderFrame.AbsoluteSize.Y, 0) + -- This will give beautiful multilines as well + local heightField = mLabel.TextBounds.Y + + mLabel.Size = UDim2.new(1, 0, heightField / self.RenderFrame.AbsoluteSize.Y, 0) pLabel.Size = mLabel.Size local yPixels = self.RenderFrame.AbsoluteSize.Y local yFieldSize = mLabel.TextBounds.Y - local queueField = {} - queueField['Player'] = pLabel - queueField['Message'] = mLabel - queueField['SpawnTime'] = tick() -- Used for identifying when to make the message invisible + local queueField = {} + queueField["Player"] = pLabel + queueField["Message"] = mLabel + queueField["SpawnTime"] = tick() -- Used for identifying when to make the message invisible - table.insert(self.MessageQueue, 1, queueField) + table.insert(self.MessageQueue, 1, queueField) Chat:UpdateQueue(queueField) end -function Chat:ScreenSizeChanged() +function Chat:ScreenSizeChanged() wait() - while self.Frame.AbsoluteSize.Y > 120 do + while self.Frame.AbsoluteSize.Y > 120 do self.Frame.Size = self.Frame.Size - UDim2.new(0, 0, 0.005, 0) - end + end Chat:RecalculateSpacing() -end +end - -function Chat:FindButtonTree(scButton, rootList) +function Chat:FindButtonTree(scButton, rootList) local list = {} - rootList = rootList or self.SafeChatTree - for button, _ in pairs(rootList) do - if button == scButton then + rootList = rootList or self.SafeChatTree + for button, _ in pairs(rootList) do + if button == scButton then list = rootList[button] - elseif type(rootList[button]) == 'table' then + elseif type(rootList[button]) == "table" then list = Chat:FindButtonTree(scButton, rootList[button]) - end - end - return list -end + end + end + return list +end function Chat:ToggleSafeChatMenu(scButton) - local list = Chat:FindButtonTree(scButton, self.SafeChatTree) - if list then - for button, _ in pairs(list) do - if button:IsA('TextButton') or button:IsA('ImageButton') then - button.Visible = not button.Visible - end - end + local list = Chat:FindButtonTree(scButton, self.SafeChatTree) + if list then + for button, _ in pairs(list) do + if button:IsA "TextButton" or button:IsA "ImageButton" then + button.Visible = not button.Visible + end + end return true - end - return false + end + return false end function Chat:CreateSafeChatOptions(list, rootButton) @@ -859,30 +1297,34 @@ function Chat:CreateSafeChatOptions(list, rootButton) local count = 0 text_List[rootButton] = {} text_List[rootButton][1] = list[1] - rootButton = rootButton or self.SafeChatButton - for msg, _ in pairs(list) do - if type(msg) == 'string' then - local chatText = Gui.Create'TextButton' - { - Name = msg; - Text = msg; - Size = UDim2.new(0, 100, 0, 20); - TextXAlignment = Enum.TextXAlignment.Center; - TextColor3 = Color3.new(0.2, 0.1, 0.1); - BackgroundTransparency = 0.5; - BackgroundColor3 = Color3.new(1, 1, 1); - Parent = self.SafeChatFrame; - Visible = false; - Position = UDim2.new(0, rootButton.Position.X.Scale + 105, 0, rootButton.Position.Y.Scale - ((count - 3) * 100)); - }; + rootButton = rootButton or self.SafeChatButton + for msg, _ in pairs(list) do + if type(msg) == "string" then + local chatText = Gui.Create "TextButton" { + Name = msg, + Text = msg, + Size = UDim2.new(0, 100, 0, 20), + TextXAlignment = Enum.TextXAlignment.Center, + TextColor3 = Color3.new(0.2, 0.1, 0.1), + BackgroundTransparency = 0.5, + BackgroundColor3 = Color3.new(1, 1, 1), + Parent = self.SafeChatFrame, + Visible = false, + Position = UDim2.new( + 0, + rootButton.Position.X.Scale + 105, + 0, + rootButton.Position.Y.Scale - ((count - 3) * 100) + ), + } count = count + 1 - if type(list[msg]) == 'table' then - text_List[rootButton][chatText] = Chat:CreateSafeChatOptions(list[msg], chatText) - else + if type(list[msg]) == "table" then + text_List[rootButton][chatText] = Chat:CreateSafeChatOptions(list[msg], chatText) + else --table.insert(text_List[chatText], true) - end + end chatText.MouseEnter:connect(function() Chat:ToggleSafeChatMenu(chatText) end) @@ -891,318 +1333,312 @@ function Chat:CreateSafeChatOptions(list, rootButton) Chat:ToggleSafeChatMenu(chatText) end) - chatText.MouseButton1Click:connect(function() + chatText.MouseButton1Click:connect(function() local lList = Chat:FindButtonTree(chatText) - if lList then - for i, v in pairs(lList) do - end - else - end - pcall(function() PlayersService:Chat(lList[1]) end) + if lList then + for i, v in pairs(lList) do + end + else + end + pcall(function() + PlayersService:Chat(lList[1]) + end) end) - end - end + end + end return text_List end function Chat:CreateSafeChatGui() - self.SafeChatFrame = Gui.Create'Frame' - { - Name = 'SafeChatFrame'; - Size = UDim2.new(1, 0, 1, 0); - Parent = self.Gui; - BackgroundTransparency = 1.0; + self.SafeChatFrame = Gui.Create "Frame" { + Name = "SafeChatFrame", + Size = UDim2.new(1, 0, 1, 0), + Parent = self.Gui, + BackgroundTransparency = 1, - Gui.Create'ImageButton' - { - Name = 'SafeChatButton'; - Size = UDim2.new(0, 44, 0, 31); - Position = UDim2.new(0, 1, 0.35, 0); - BackgroundTransparency = 1.0; - Image = 'http://www.roblox.com/asset/?id=97080365'; - }; - } + Gui.Create "ImageButton" { + Name = "SafeChatButton", + Size = UDim2.new(0, 44, 0, 31), + Position = UDim2.new(0, 1, 0.35, 0), + BackgroundTransparency = 1, + Image = "http://www.roblox.com/asset/?id=97080365", + }, + } self.SafeChatButton = self.SafeChatFrame.SafeChatButton - -- safe chat button is the root of this tree + -- safe chat button is the root of this tree self.SafeChatTree[self.SafeChatButton] = Chat:CreateSafeChatOptions(self.SafeChat_List, self.SafeChatButton) - self.SafeChatButton.MouseButton1Click:connect(function() + self.SafeChatButton.MouseButton1Click:connect(function() Chat:ToggleSafeChatMenu(self.SafeChatButton) end) end - function Chat:FocusOnChatBar() - if self.ClickToChatButton then - self.ClickToChatButton.Visible = false - end + if self.ClickToChatButton then + self.ClickToChatButton.Visible = false + end self.GotFocus = true - if self.Frame['Background'] then - self.Frame.Background.Visible = false + if self.Frame["Background"] then + self.Frame.Background.Visible = false end self.ChatBar:CaptureFocus() end --- For touch devices we create a button instead -function Chat:CreateTouchButton() - self.ChatTouchFrame = Gui.Create'Frame' - { - Name = 'ChatTouchFrame'; - Size = UDim2.new(0, 128, 0, 32); - Position = UDim2.new(0, 88, 0, 0); - BackgroundTransparency = 1.0; - Parent = self.Gui; +-- For touch devices we create a button instead +function Chat:CreateTouchButton() + self.ChatTouchFrame = Gui.Create "Frame" { + Name = "ChatTouchFrame", + Size = UDim2.new(0, 128, 0, 32), + Position = UDim2.new(0, 88, 0, 0), + BackgroundTransparency = 1, + Parent = self.Gui, - Gui.Create'ImageButton' - { - Name = 'ChatLabel'; - Size = UDim2.new(0, 74, 0, 28); - Position = UDim2.new(0, 0, 0, 0); - BackgroundTransparency = 1.0; - ZIndex = 2.0; - }; - Gui.Create'ImageLabel' - { - Name = 'Background'; - Size = UDim2.new(1, 0, 1, 0); - Position = UDim2.new(0, 0, 0, 0); - BackgroundTransparency = 1.0; - Image = 'http://www.roblox.com/asset/?id=97078724' - }; - - } - self.TapToChatLabel = self.ChatTouchFrame.ChatLabel + Gui.Create "ImageButton" { + Name = "ChatLabel", + Size = UDim2.new(0, 74, 0, 28), + Position = UDim2.new(0, 0, 0, 0), + BackgroundTransparency = 1, + ZIndex = 2.0, + }, + Gui.Create "ImageLabel" { + Name = "Background", + Size = UDim2.new(1, 0, 1, 0), + Position = UDim2.new(0, 0, 0, 0), + BackgroundTransparency = 1, + Image = "http://www.roblox.com/asset/?id=97078724", + }, + } + self.TapToChatLabel = self.ChatTouchFrame.ChatLabel self.TouchLabelBackground = self.ChatTouchFrame.Background - self.ChatBar = Gui.Create'TextBox' - { - Name = 'ChatBar'; - Size = UDim2.new(1, 0, 0.2, 0); - Position = UDim2.new(0, 0, 0.8, 800); - Text = ""; - ZIndex = 1.0; - BackgroundTransparency = 1.0; - Parent = self.Frame; - TextXAlignment = Enum.TextXAlignment.Left; - TextColor3 = Color3.new(1, 1, 1); - ClearTextOnFocus = false; - }; + self.ChatBar = Gui.Create "TextBox" { + Name = "ChatBar", + Size = UDim2.new(1, 0, 0.2, 0), + Position = UDim2.new(0, 0, 0.8, 800), + Text = "", + ZIndex = 1, + BackgroundTransparency = 1, + Parent = self.Frame, + TextXAlignment = Enum.TextXAlignment.Left, + TextColor3 = Color3.new(1, 1, 1), + ClearTextOnFocus = false, + } self.TapToChatLabel.MouseButton1Click:connect(function() self.TapToChatLabel.Visible = false - --self.ChatBar.Visible = true - --self.Frame.Background.Visible = true - self.ChatBar:CaptureFocus() - self.GotFocus = true - if self.TouchLabelBackground then - self.TouchLabelBackground.Visible = false - end + --self.ChatBar.Visible = true + --self.Frame.Background.Visible = true + self.ChatBar:CaptureFocus() + self.GotFocus = true + if self.TouchLabelBackground then + self.TouchLabelBackground.Visible = false + end end) end --- Non touch devices, create the bottom chat bar +-- Non touch devices, create the bottom chat bar function Chat:CreateChatBar() - -- okay now we do - local status, result = pcall(function() return GuiService.UseLuaChat end) - if forceChatGUI or (status and result) then - self.ClickToChatButton = Gui.Create'TextButton' - { - Name = 'ClickToChat'; - Size = UDim2.new(1, 0, 0, 20); - BackgroundTransparency = 1.0; - ZIndex = 2.0; - Parent = self.Gui; - Text = "To chat click here or press \"/\" key"; - TextColor3 = Color3.new(1, 1, 0.9); - Position = UDim2.new(0, 0, 1, 0); - TextXAlignment = Enum.TextXAlignment.Left; - FontSize = Enum.FontSize.Size12; - } + -- okay now we do + local status, result = pcall(function() + return GuiService.UseLuaChat + end) + if forceChatGUI or (status and result) then + self.ClickToChatButton = Gui.Create "TextButton" { + Name = "ClickToChat", + Size = UDim2.new(1, 0, 0, 20), + BackgroundTransparency = 1, + ZIndex = 2.0, + Parent = self.Gui, + Text = 'To chat click here or press "/" key', + TextColor3 = Color3.new(1, 1, 0.9), + Position = UDim2.new(0, 0, 1, 0), + TextXAlignment = Enum.TextXAlignment.Left, + FontSize = Enum.FontSize.Size12, + } - self.ChatBar = Gui.Create'TextBox' - { - Name = 'ChatBar'; - Size = UDim2.new(1, 0, 0, 20); - Position = UDim2.new(0, 0, 1, 0); - Text = ""; - ZIndex = 1.0; - BackgroundColor3 = Color3.new(0, 0, 0); - BackgroundTransparency = 0.25; - Parent = self.Gui; - TextXAlignment = Enum.TextXAlignment.Left; - TextColor3 = Color3.new(1, 1, 1); - FontSize = Enum.FontSize.Size12; - ClearTextOnFocus = false; - Text = ''; - }; + self.ChatBar = Gui.Create "TextBox" { + Name = "ChatBar", + Size = UDim2.new(1, 0, 0, 20), + Position = UDim2.new(0, 0, 1, 0), + Text = "", + ZIndex = 1, + BackgroundColor3 = Color3.new(0, 0, 0), + BackgroundTransparency = 0.25, + Parent = self.Gui, + TextXAlignment = Enum.TextXAlignment.Left, + TextColor3 = Color3.new(1, 1, 1), + FontSize = Enum.FontSize.Size12, + ClearTextOnFocus = false, + Text = "", + } -- Engine has code to offset the entire world, so if we do it by -20 pixels nothing gets in our chat's way --GuiService:SetGlobalSizeOffsetPixel(0, -20) - local success, error = pcall(function() GuiService:SetGlobalGuiInset(0, 0, 0, 20) end) - if not success then + local success, error = pcall(function() + GuiService:SetGlobalGuiInset(0, 0, 0, 20) + end) + if not success then GuiService:SetGlobalSizeOffsetPixel(0, -20) end -- CHatHotKey is '/' GuiService:AddSpecialKey(Enum.SpecialKey.ChatHotkey) - GuiService.SpecialKeyPressed:connect(function(key) - if key == Enum.SpecialKey.ChatHotkey then + GuiService.SpecialKeyPressed:connect(function(key) + if key == Enum.SpecialKey.ChatHotkey then Chat:FocusOnChatBar() - end - end) + end + end) self.ClickToChatButton.MouseButton1Click:connect(function() Chat:FocusOnChatBar() - end) + end) end end --- Create the initial Chat stuff --- Done only once +-- Create the initial Chat stuff +-- Done only once function Chat:CreateGui() - self.Gui = WaitForChild(CoreGuiService, 'RobloxGui') - self.Frame = Gui.Create'Frame' - { - Name = 'ChatFrame'; - --Size = self.Configuration.Size; - Size = UDim2.new(0, 500, 0, 120); - Position = UDim2.new(0, 0, 0, 5); - BackgroundTransparency = 1.0; - --ClipsDescendants = true; - ZIndex = 0.0; - Parent = self.Gui; - Active = false; + self.Gui = WaitForChild(CoreGuiService, "RobloxGui") + self.Frame = Gui.Create "Frame" { + Name = "ChatFrame", + --Size = self.Configuration.Size; + Size = UDim2.new(0, 500, 0, 120), + Position = UDim2.new(0, 0, 0, 5), + BackgroundTransparency = 1, + --ClipsDescendants = true; + ZIndex = 0, + Parent = self.Gui, + Active = false, - Gui.Create'ImageLabel' - { - Name = 'Background'; - Image = 'http://www.roblox.com/asset/?id=97120937'; --96551212'; - Size = UDim2.new(1.3, 0, 1.64, 0); - Position = UDim2.new(0, 0, 0, 0); - BackgroundTransparency = 1.0; - ZIndex = 0.0; - Visible = false - }; + Gui.Create "ImageLabel" { + Name = "Background", + Image = "http://www.roblox.com/asset/?id=97120937", --96551212'; + Size = UDim2.new(1.3, 0, 1.64, 0), + Position = UDim2.new(0, 0, 0, 0), + BackgroundTransparency = 1, + ZIndex = 0, + Visible = false, + }, - Gui.Create'Frame' - { - Name = 'Border'; - Size = UDim2.new(1, 0, 0, 1); - Position = UDim2.new(0, 0, 0.8, 0); - BackgroundTransparency = 0.0; - BackgroundColor3 = Color3.new(236/255, 236/255, 236/255); - BorderSizePixel = 0.0; - Visible = false; - }; + Gui.Create "Frame" { + Name = "Border", + Size = UDim2.new(1, 0, 0, 1), + Position = UDim2.new(0, 0, 0.8, 0), + BackgroundTransparency = 0, + BackgroundColor3 = Color3.new(236 / 255, 236 / 255, 236 / 255), + BorderSizePixel = 0, + Visible = false, + }, - Gui.Create'Frame' - { - Name = 'ChatRenderFrame'; - Size = UDim2.new(1.02, 0, 1.01, 0); - Position = UDim2.new(0, 0, 0, 0); - BackgroundTransparency = 1.0; - --ClipsDescendants = true; - ZIndex = 0.0; - Active = false; - - }; - }; + Gui.Create "Frame" { + Name = "ChatRenderFrame", + Size = UDim2.new(1.02, 0, 1.01, 0), + Position = UDim2.new(0, 0, 0, 0), + BackgroundTransparency = 1, + --ClipsDescendants = true; + ZIndex = 0, + Active = false, + }, + } Spawn(function() wait(0.5) - if IsPhone() then + if IsPhone() then self.Frame.Size = UDim2.new(0, 280, 0, 120) - end - end) - - self.RenderFrame = self.Frame.ChatRenderFrame - if Chat:IsTouchDevice() then - self.Frame.Position = self.Configuration.Position; - self.RenderFrame.Size = UDim2.new(1, 0, 1, 0) - elseif self.Frame.AbsoluteSize.Y > 120 then - Chat:ScreenSizeChanged() - self.Gui.Changed:connect(function(property) - if property == 'AbsoluteSize' then - Chat:ScreenSizeChanged() - end - end) - end + end + end) - if forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu then - if Chat:IsTouchDevice() then - Chat:CreateTouchButton() - else + self.RenderFrame = self.Frame.ChatRenderFrame + if Chat:IsTouchDevice() then + self.Frame.Position = self.Configuration.Position + self.RenderFrame.Size = UDim2.new(1, 0, 1, 0) + elseif self.Frame.AbsoluteSize.Y > 120 then + Chat:ScreenSizeChanged() + self.Gui.Changed:connect(function(property) + if property == "AbsoluteSize" then + Chat:ScreenSizeChanged() + end + end) + end + + if forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu then + if Chat:IsTouchDevice() then + Chat:CreateTouchButton() + else Chat:CreateChatBar() --Chat:CreateSafeChatGui() - end + end - if self.ChatBar then + if self.ChatBar then self.ChatBar.FocusLost:connect(function(enterPressed) - Chat.GotFocus = false - if Chat:IsTouchDevice() then - self.ChatBar.Visible = false - self.TapToChatLabel.Visible = true + Chat.GotFocus = false + if Chat:IsTouchDevice() then + self.ChatBar.Visible = false + self.TapToChatLabel.Visible = true - if self.TouchLabelBackground then - self.TouchLabelBackground.Visible = true - end - end - if enterPressed and self.ChatBar.Text ~= "" then - + if self.TouchLabelBackground then + self.TouchLabelBackground.Visible = true + end + end + if enterPressed and self.ChatBar.Text ~= "" then local cText = self.ChatBar.Text - if string.sub(self.ChatBar.Text, 1, 1) == '%' then - cText = '(TEAM) ' .. string.sub(cText, 2, #cText) - pcall(function() PlayersService:TeamChat(cText) end) - else - pcall(function() PlayersService:Chat(cText) end) - end - - if self.ClickToChatButton then - self.ClickToChatButton.Visible = true - end - self.ChatBar.Text = "" - end + if string.sub(self.ChatBar.Text, 1, 1) == "%" then + cText = "(TEAM) " .. string.sub(cText, 2, #cText) + pcall(function() + PlayersService:TeamChat(cText) + end) + else + pcall(function() + PlayersService:Chat(cText) + end) + end + + if self.ClickToChatButton then + self.ClickToChatButton.Visible = true + end + self.ChatBar.Text = "" + end Spawn(function() wait(5.0) - if not Chat.GotFocus then - Chat.Frame.Background.Visible = false - end - end) - end) - end - end + if not Chat.GotFocus then + Chat.Frame.Background.Visible = false + end + end) + end) + end + end end -- Scrolling function -- Applies a speed(velocity) to have nice scrolling effect function Input:OnMouseScroll() Spawn(function() - -- How long should the speed last? - while Input.Speed ~=0 do - if Input.Speed > 1 then - while Input.Speed > 0 do - Input.Speed = Input.Speed - 1 + -- How long should the speed last? + while Input.Speed ~= 0 do + if Input.Speed > 1 then + while Input.Speed > 0 do + Input.Speed = Input.Speed - 1 wait(0.25) - end - elseif Input.Speed < 0 then - while Input.Speed < 0 do + end + elseif Input.Speed < 0 then + while Input.Speed < 0 do Input.Speed = Input.Speed + 1 wait(0.25) - end - end + end + end wait(0.03) - end + end end) - if Chat:CheckIfInBounds(Input.Speed) then - return - end + if Chat:CheckIfInBounds(Input.Speed) then + return + end Chat:ScrollQueue() end function Input:ApplySpeed(value) Input.Speed = Input.Speed + value - if not self.Simulating then + if not self.Simulating then Input:OnMouseScroll() end end @@ -1218,87 +1654,94 @@ function Input:Initialize() end function Chat:FindMessageInSafeChat(message, list) - local foundMessage = false - for msg, _ in pairs(list) do - if msg == message then + local foundMessage = false + for msg, _ in pairs(list) do + if msg == message then return true - end - if type(list[msg]) == 'table' then + end + if type(list[msg]) == "table" then foundMessage = Chat:FindMessageInSafeChat(message, list[msg]) - if foundMessage then - return true - end - end - end + if foundMessage then + return true + end + end + end return foundMessage end --- Just a wrapper around our PlayerChatted event -function Chat:PlayerChatted(...) - local args = {...} - local argCount = select('#', ...) +-- Just a wrapper around our PlayerChatted event +function Chat:PlayerChatted(...) + local args = { ... } + local argCount = select("#", ...) local player - local message + local message -- This doesn't look very good, but what else to do? - if args[2] then + if args[2] then player = args[2] end - if args[3] then + if args[3] then message = args[3] - if string.sub(message, 1, 1) == '%' then - message = '(TEAM) ' .. string.sub(message, 2, #message) - end - end + if string.sub(message, 1, 1) == "%" then + message = "(TEAM) " .. string.sub(message, 2, #message) + end + end - if PlayersService.ClassicChat then - if string.sub(message, 1, 3) == '/e ' or string.sub(message, 1, 7) == '/emote ' then + if PlayersService.ClassicChat then + if string.sub(message, 1, 3) == "/e " or string.sub(message, 1, 7) == "/emote " then -- don't do anything right now - elseif forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu then - Chat:UpdateChat(player, message) - elseif Player.ChatMode == Enum.ChatMode.Menu and string.sub(message, 1, 3) == '/sc' then - Chat:UpdateChat(player, message) - else - if Chat:FindMessageInSafeChat(message, self.SafeChat_List) then + elseif forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu then + Chat:UpdateChat(player, message) + elseif Player.ChatMode == Enum.ChatMode.Menu and string.sub(message, 1, 3) == "/sc" then + Chat:UpdateChat(player, message) + else + if Chat:FindMessageInSafeChat(message, self.SafeChat_List) then Chat:UpdateChat(player, message) - end - end - end + end + end + end end --- After Chat.Configuration.Lifetime seconds of existence, the labels become invisible +-- After Chat.Configuration.Lifetime seconds of existence, the labels become invisible -- Runs only every 5 seconds and has to loop through 50 values --- Shouldn't be too expensive +-- Shouldn't be too expensive function Chat:CullThread() - while true do - 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'] > self.Configuration.LifeTime then - field['Player'].Visible = false - field['Message'].Visible = false - end - end - end + while true do + 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"] > self.Configuration.LifeTime + then + field["Player"].Visible = false + field["Message"].Visible = false + end + end + end wait(5.0) end end --- RobloxLock everything so users can't delete them(?) +-- RobloxLock everything so users can't delete them(?) function Chat:LockAllFields(gui) local children = gui:GetChildren() - for i = 1, #children do - children[i].RobloxLocked = true - if #children[i]:GetChildren() > 0 then + for i = 1, #children do + children[i].RobloxLocked = true + if #children[i]:GetChildren() > 0 then Chat:LockAllFields(children[i]) - end - end + end + end end -function Chat:CoreGuiChanged(coreGuiType,enabled) +function Chat:CoreGuiChanged(coreGuiType, enabled) if coreGuiType == Enum.CoreGuiType.Chat or coreGuiType == Enum.CoreGuiType.All then - if self.Frame then self.Frame.Visible = enabled end + if self.Frame then + self.Frame.Visible = enabled + end - if not Chat:IsTouchDevice() and self.ChatBar then - self.ChatBar.Visible = enabled + if not Chat:IsTouchDevice() and self.ChatBar then + self.ChatBar.Visible = enabled if enabled then GuiService:SetGlobalGuiInset(0, 0, 0, 20) else @@ -1308,50 +1751,50 @@ function Chat:CoreGuiChanged(coreGuiType,enabled) end end --- Constructor --- This function initializes everything -function Chat:Initialize() - - Chat:CreateGui() +-- Constructor +-- This function initializes everything +function Chat:Initialize() + Chat:CreateGui() pcall(function() Chat:CoreGuiChanged(Enum.CoreGuiType.Chat, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Chat)) - Game.StarterGui.CoreGuiChangedSignal:connect(function(coreGuiType,enabled) Chat:CoreGuiChanged(coreGuiType,enabled) end) + Game.StarterGui.CoreGuiChangedSignal:connect(function(coreGuiType, enabled) + Chat:CoreGuiChanged(coreGuiType, enabled) + end) end) - self.EventListener = PlayersService.PlayerChatted:connect(function(...) - -- This event has 4 callback arguments - -- Enum.PlayerChatType.All, chatPlayer, message, targetPlayer + self.EventListener = PlayersService.PlayerChatted:connect(function(...) + -- This event has 4 callback arguments + -- Enum.PlayerChatType.All, chatPlayer, message, targetPlayer Chat:PlayerChatted(...) - end) self.MessageThread = coroutine.create(function() end) coroutine.resume(self.MessageThread) - -- Initialize input for us - Input:Initialize() + -- Initialize input for us + Input:Initialize() -- Eww, everytime a player is added, you have to redo the connection -- Seems this is not automatic - -- NOTE: PlayerAdded only fires on the server, hence ChildAdded is used here + -- NOTE: PlayerAdded only fires on the server, hence ChildAdded is used here PlayersService.ChildAdded:connect(function() - Chat.EventListener:disconnect() - self.EventListener = PlayersService.PlayerChatted:connect(function(...) - -- This event has 4 callback arguments - -- Enum.PlayerChatType.All, chatPlayer, message, targetPlayer + Chat.EventListener:disconnect() + self.EventListener = PlayersService.PlayerChatted:connect(function(...) + -- This event has 4 callback arguments + -- Enum.PlayerChatType.All, chatPlayer, message, targetPlayer Chat:PlayerChatted(...) end) end) Spawn(function() - Chat:CullThread() + Chat:CullThread() end) - self.Frame.RobloxLocked = true + self.Frame.RobloxLocked = true Chat:LockAllFields(self.Frame) self.Frame.DescendantAdded:connect(function(descendant) Chat:LockAllFields(descendant) - end) + end) end Chat:Initialize() diff --git a/mercury.yml b/mercury.yml new file mode 100644 index 0000000..fe98579 --- /dev/null +++ b/mercury.yml @@ -0,0 +1,9505 @@ +# This file was @generated by generate-roblox-std at 2022-06-17 03:38:33.243546500 +01:00 +--- +base: lua51 +name: mercury +globals: + ypcall: + args: + - type: function + - required: false + type: "..." + Axes.new: + args: + - type: "..." + BrickColor.Black: + args: [] + BrickColor.Blue: + args: [] + BrickColor.DarkGray: + args: [] + BrickColor.Gray: + args: [] + BrickColor.Green: + args: [] + BrickColor.Red: + args: [] + BrickColor.White: + args: [] + BrickColor.Yellow: + args: [] + BrickColor.new: + args: + - type: any + - required: false + type: number + - required: false + type: number + BrickColor.palette: + args: + - type: number + BrickColor.random: + args: [] + CFrame.Angles: + args: + - required: false + type: number + - required: false + type: number + - required: false + type: number + CFrame.fromAxisAngle: + args: + - type: + display: Vector3 + - type: number + CFrame.fromEulerAnglesXYZ: + args: + - type: number + - type: number + - type: number + CFrame.fromEulerAnglesYXZ: + args: + - type: number + - type: number + - type: number + CFrame.fromMatrix: + args: + - type: + display: Vector3 + - type: + display: Vector3 + - type: + display: Vector3 + - required: false + type: + display: Vector3 + CFrame.fromOrientation: + args: + - type: number + - type: number + - type: number + CFrame.identity: + property: read-only + CFrame.lookAt: + args: + - type: + display: Vector3 + - type: + display: Vector3 + - required: false + type: + display: Vector3 + CFrame.new: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + Color3.fromHSV: + args: + - type: number + - type: number + - type: number + Color3.fromHex: + args: + - type: string + Color3.fromRGB: + args: + - type: number + - type: number + - type: number + Color3.new: + args: + - required: false + type: number + - required: false + type: number + - required: false + type: number + Color3.toHSV: + args: + - type: + display: Color3 + ColorSequence.new: + args: + - type: any + - required: false + type: + display: Color3 + ColorSequenceKeypoint.new: + args: + - type: number + - type: + display: Color3 + DateTime.fromIsoDate: + args: + - type: string + DateTime.fromLocalTime: + args: + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + DateTime.fromUniversalTime: + args: + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + DateTime.fromUnixTimestamp: + args: + - type: number + DateTime.fromUnixTimestampMillis: + args: + - type: number + DateTime.now: + args: [] + DebuggerManager: + args: [] + DockWidgetPluginGuiInfo.new: + args: + - required: false + type: + display: InitialDockState + - required: false + type: bool + - required: false + type: bool + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + Enum.ABTestLoadingStatus.Error: + struct: EnumItem + Enum.ABTestLoadingStatus.GetEnumItems: + args: [] + method: true + Enum.ABTestLoadingStatus.Initialized: + struct: EnumItem + Enum.ABTestLoadingStatus.None: + struct: EnumItem + Enum.ABTestLoadingStatus.Pending: + struct: EnumItem + Enum.ABTestLoadingStatus.ShutOff: + struct: EnumItem + Enum.ABTestLoadingStatus.TimedOut: + struct: EnumItem + Enum.AccessoryType.Back: + struct: EnumItem + Enum.AccessoryType.DressSkirt: + struct: EnumItem + Enum.AccessoryType.Eyebrow: + struct: EnumItem + Enum.AccessoryType.Eyelash: + struct: EnumItem + Enum.AccessoryType.Face: + struct: EnumItem + Enum.AccessoryType.Front: + struct: EnumItem + Enum.AccessoryType.GetEnumItems: + args: [] + method: true + Enum.AccessoryType.Hair: + struct: EnumItem + Enum.AccessoryType.Hat: + struct: EnumItem + Enum.AccessoryType.Jacket: + struct: EnumItem + Enum.AccessoryType.LeftShoe: + struct: EnumItem + Enum.AccessoryType.Neck: + struct: EnumItem + Enum.AccessoryType.Pants: + struct: EnumItem + Enum.AccessoryType.RightShoe: + struct: EnumItem + Enum.AccessoryType.Shirt: + struct: EnumItem + Enum.AccessoryType.Shorts: + struct: EnumItem + Enum.AccessoryType.Shoulder: + struct: EnumItem + Enum.AccessoryType.Sweater: + struct: EnumItem + Enum.AccessoryType.TShirt: + struct: EnumItem + Enum.AccessoryType.Unknown: + struct: EnumItem + Enum.AccessoryType.Waist: + struct: EnumItem + Enum.ActionType.Draw: + struct: EnumItem + Enum.ActionType.GetEnumItems: + args: [] + method: true + Enum.ActionType.Lose: + struct: EnumItem + Enum.ActionType.Nothing: + struct: EnumItem + Enum.ActionType.Pause: + struct: EnumItem + Enum.ActionType.Win: + struct: EnumItem + Enum.ActuatorRelativeTo.Attachment0: + struct: EnumItem + Enum.ActuatorRelativeTo.Attachment1: + struct: EnumItem + Enum.ActuatorRelativeTo.GetEnumItems: + args: [] + method: true + Enum.ActuatorRelativeTo.World: + struct: EnumItem + Enum.ActuatorType.GetEnumItems: + args: [] + method: true + Enum.ActuatorType.Motor: + struct: EnumItem + Enum.ActuatorType.None: + struct: EnumItem + Enum.ActuatorType.Servo: + struct: EnumItem + Enum.AdornCullingMode.Automatic: + struct: EnumItem + Enum.AdornCullingMode.GetEnumItems: + args: [] + method: true + Enum.AdornCullingMode.Never: + struct: EnumItem + Enum.AlignType.GetEnumItems: + args: [] + method: true + Enum.AlignType.Parallel: + struct: EnumItem + Enum.AlignType.Perpendicular: + struct: EnumItem + Enum.AlphaMode.GetEnumItems: + args: [] + method: true + Enum.AlphaMode.Overlay: + struct: EnumItem + Enum.AlphaMode.Transparency: + struct: EnumItem + Enum.AnalyticsEconomyAction.Acquire: + struct: EnumItem + Enum.AnalyticsEconomyAction.Default: + struct: EnumItem + Enum.AnalyticsEconomyAction.GetEnumItems: + args: [] + method: true + Enum.AnalyticsEconomyAction.Spend: + struct: EnumItem + Enum.AnalyticsLogLevel.Debug: + struct: EnumItem + Enum.AnalyticsLogLevel.Error: + struct: EnumItem + Enum.AnalyticsLogLevel.Fatal: + struct: EnumItem + Enum.AnalyticsLogLevel.GetEnumItems: + args: [] + method: true + Enum.AnalyticsLogLevel.Information: + struct: EnumItem + Enum.AnalyticsLogLevel.Trace: + struct: EnumItem + Enum.AnalyticsLogLevel.Warning: + struct: EnumItem + Enum.AnalyticsProgressionStatus.Abandon: + struct: EnumItem + Enum.AnalyticsProgressionStatus.Begin: + struct: EnumItem + Enum.AnalyticsProgressionStatus.Complete: + struct: EnumItem + Enum.AnalyticsProgressionStatus.Default: + struct: EnumItem + Enum.AnalyticsProgressionStatus.Fail: + struct: EnumItem + Enum.AnalyticsProgressionStatus.GetEnumItems: + args: [] + method: true + Enum.AnimationPriority.Action: + struct: EnumItem + Enum.AnimationPriority.Action2: + struct: EnumItem + Enum.AnimationPriority.Action3: + struct: EnumItem + Enum.AnimationPriority.Action4: + struct: EnumItem + Enum.AnimationPriority.Core: + struct: EnumItem + Enum.AnimationPriority.GetEnumItems: + args: [] + method: true + Enum.AnimationPriority.Idle: + struct: EnumItem + Enum.AnimationPriority.Movement: + struct: EnumItem + Enum.AnimatorRetargetingMode.Default: + struct: EnumItem + Enum.AnimatorRetargetingMode.Disabled: + struct: EnumItem + Enum.AnimatorRetargetingMode.Enabled: + struct: EnumItem + Enum.AnimatorRetargetingMode.GetEnumItems: + args: [] + method: true + Enum.AppShellActionType.AvatarEditorPageLoaded: + struct: EnumItem + Enum.AppShellActionType.GamePageLoaded: + struct: EnumItem + Enum.AppShellActionType.GetEnumItems: + args: [] + method: true + Enum.AppShellActionType.HomePageLoaded: + struct: EnumItem + Enum.AppShellActionType.None: + struct: EnumItem + Enum.AppShellActionType.OpenApp: + struct: EnumItem + Enum.AppShellActionType.ReadConversation: + struct: EnumItem + Enum.AppShellActionType.TapAvatarTab: + struct: EnumItem + Enum.AppShellActionType.TapChatTab: + struct: EnumItem + Enum.AppShellActionType.TapConversationEntry: + struct: EnumItem + Enum.AppShellActionType.TapGamePageTab: + struct: EnumItem + Enum.AppShellActionType.TapHomePageTab: + struct: EnumItem + Enum.AppShellFeature.AvatarEditor: + struct: EnumItem + Enum.AppShellFeature.Chat: + struct: EnumItem + Enum.AppShellFeature.GamePage: + struct: EnumItem + Enum.AppShellFeature.GetEnumItems: + args: [] + method: true + Enum.AppShellFeature.HomePage: + struct: EnumItem + Enum.AppShellFeature.Landing: + struct: EnumItem + Enum.AppShellFeature.More: + struct: EnumItem + Enum.AppShellFeature.None: + struct: EnumItem + Enum.AppUpdateStatus.Available: + struct: EnumItem + Enum.AppUpdateStatus.Failed: + struct: EnumItem + Enum.AppUpdateStatus.GetEnumItems: + args: [] + method: true + Enum.AppUpdateStatus.NotAvailable: + struct: EnumItem + Enum.AppUpdateStatus.NotSupported: + struct: EnumItem + Enum.AppUpdateStatus.Unknown: + struct: EnumItem + Enum.ApplyStrokeMode.Border: + struct: EnumItem + Enum.ApplyStrokeMode.Contextual: + struct: EnumItem + Enum.ApplyStrokeMode.GetEnumItems: + args: [] + method: true + Enum.AspectType.FitWithinMaxSize: + struct: EnumItem + Enum.AspectType.GetEnumItems: + args: [] + method: true + Enum.AspectType.ScaleWithParentSize: + struct: EnumItem + Enum.AssetFetchStatus.Failure: + struct: EnumItem + Enum.AssetFetchStatus.GetEnumItems: + args: [] + method: true + Enum.AssetFetchStatus.Success: + struct: EnumItem + Enum.AssetType.Animation: + struct: EnumItem + Enum.AssetType.Audio: + struct: EnumItem + Enum.AssetType.BackAccessory: + struct: EnumItem + Enum.AssetType.Badge: + struct: EnumItem + Enum.AssetType.ClimbAnimation: + struct: EnumItem + Enum.AssetType.DeathAnimation: + struct: EnumItem + Enum.AssetType.Decal: + struct: EnumItem + Enum.AssetType.DressSkirtAccessory: + struct: EnumItem + Enum.AssetType.EarAccessory: + struct: EnumItem + Enum.AssetType.EmoteAnimation: + struct: EnumItem + Enum.AssetType.EyeAccessory: + struct: EnumItem + Enum.AssetType.EyebrowAccessory: + struct: EnumItem + Enum.AssetType.EyelashAccessory: + struct: EnumItem + Enum.AssetType.Face: + struct: EnumItem + Enum.AssetType.FaceAccessory: + struct: EnumItem + Enum.AssetType.FallAnimation: + struct: EnumItem + Enum.AssetType.FrontAccessory: + struct: EnumItem + Enum.AssetType.GamePass: + struct: EnumItem + Enum.AssetType.Gear: + struct: EnumItem + Enum.AssetType.GetEnumItems: + args: [] + method: true + Enum.AssetType.HairAccessory: + struct: EnumItem + Enum.AssetType.Hat: + struct: EnumItem + Enum.AssetType.Head: + struct: EnumItem + Enum.AssetType.IdleAnimation: + struct: EnumItem + Enum.AssetType.Image: + struct: EnumItem + Enum.AssetType.JacketAccessory: + struct: EnumItem + Enum.AssetType.JumpAnimation: + struct: EnumItem + Enum.AssetType.LeftArm: + struct: EnumItem + Enum.AssetType.LeftLeg: + struct: EnumItem + Enum.AssetType.LeftShoeAccessory: + struct: EnumItem + Enum.AssetType.Lua: + struct: EnumItem + Enum.AssetType.Mesh: + struct: EnumItem + Enum.AssetType.MeshPart: + struct: EnumItem + Enum.AssetType.Model: + struct: EnumItem + Enum.AssetType.NeckAccessory: + struct: EnumItem + Enum.AssetType.Package: + struct: EnumItem + Enum.AssetType.Pants: + struct: EnumItem + Enum.AssetType.PantsAccessory: + struct: EnumItem + Enum.AssetType.Place: + struct: EnumItem + Enum.AssetType.Plugin: + struct: EnumItem + Enum.AssetType.PoseAnimation: + struct: EnumItem + Enum.AssetType.RightArm: + struct: EnumItem + Enum.AssetType.RightLeg: + struct: EnumItem + Enum.AssetType.RightShoeAccessory: + struct: EnumItem + Enum.AssetType.RunAnimation: + struct: EnumItem + Enum.AssetType.Shirt: + struct: EnumItem + Enum.AssetType.ShirtAccessory: + struct: EnumItem + Enum.AssetType.ShortsAccessory: + struct: EnumItem + Enum.AssetType.ShoulderAccessory: + struct: EnumItem + Enum.AssetType.SweaterAccessory: + struct: EnumItem + Enum.AssetType.SwimAnimation: + struct: EnumItem + Enum.AssetType.TShirt: + struct: EnumItem + Enum.AssetType.TShirtAccessory: + struct: EnumItem + Enum.AssetType.Torso: + struct: EnumItem + Enum.AssetType.Video: + struct: EnumItem + Enum.AssetType.WaistAccessory: + struct: EnumItem + Enum.AssetType.WalkAnimation: + struct: EnumItem + Enum.AssetTypeVerification.Always: + struct: EnumItem + Enum.AssetTypeVerification.ClientOnly: + struct: EnumItem + Enum.AssetTypeVerification.Default: + struct: EnumItem + Enum.AssetTypeVerification.GetEnumItems: + args: [] + method: true + Enum.AutoIndentRule.Absolute: + struct: EnumItem + Enum.AutoIndentRule.GetEnumItems: + args: [] + method: true + Enum.AutoIndentRule.Off: + struct: EnumItem + Enum.AutoIndentRule.Relative: + struct: EnumItem + Enum.AutomaticSize.GetEnumItems: + args: [] + method: true + Enum.AutomaticSize.None: + struct: EnumItem + Enum.AutomaticSize.X: + struct: EnumItem + Enum.AutomaticSize.XY: + struct: EnumItem + Enum.AutomaticSize.Y: + struct: EnumItem + Enum.AvatarAssetType.BackAccessory: + struct: EnumItem + Enum.AvatarAssetType.ClimbAnimation: + struct: EnumItem + Enum.AvatarAssetType.DressSkirtAccessory: + struct: EnumItem + Enum.AvatarAssetType.EmoteAnimation: + struct: EnumItem + Enum.AvatarAssetType.EyebrowAccessory: + struct: EnumItem + Enum.AvatarAssetType.EyelashAccessory: + struct: EnumItem + Enum.AvatarAssetType.Face: + struct: EnumItem + Enum.AvatarAssetType.FaceAccessory: + struct: EnumItem + Enum.AvatarAssetType.FallAnimation: + struct: EnumItem + Enum.AvatarAssetType.FrontAccessory: + struct: EnumItem + Enum.AvatarAssetType.Gear: + struct: EnumItem + Enum.AvatarAssetType.GetEnumItems: + args: [] + method: true + Enum.AvatarAssetType.HairAccessory: + struct: EnumItem + Enum.AvatarAssetType.Hat: + struct: EnumItem + Enum.AvatarAssetType.Head: + struct: EnumItem + Enum.AvatarAssetType.IdleAnimation: + struct: EnumItem + Enum.AvatarAssetType.JacketAccessory: + struct: EnumItem + Enum.AvatarAssetType.JumpAnimation: + struct: EnumItem + Enum.AvatarAssetType.LeftArm: + struct: EnumItem + Enum.AvatarAssetType.LeftLeg: + struct: EnumItem + Enum.AvatarAssetType.LeftShoeAccessory: + struct: EnumItem + Enum.AvatarAssetType.NeckAccessory: + struct: EnumItem + Enum.AvatarAssetType.Pants: + struct: EnumItem + Enum.AvatarAssetType.PantsAccessory: + struct: EnumItem + Enum.AvatarAssetType.RightArm: + struct: EnumItem + Enum.AvatarAssetType.RightLeg: + struct: EnumItem + Enum.AvatarAssetType.RightShoeAccessory: + struct: EnumItem + Enum.AvatarAssetType.RunAnimation: + struct: EnumItem + Enum.AvatarAssetType.Shirt: + struct: EnumItem + Enum.AvatarAssetType.ShirtAccessory: + struct: EnumItem + Enum.AvatarAssetType.ShortsAccessory: + struct: EnumItem + Enum.AvatarAssetType.ShoulderAccessory: + struct: EnumItem + Enum.AvatarAssetType.SweaterAccessory: + struct: EnumItem + Enum.AvatarAssetType.SwimAnimation: + struct: EnumItem + Enum.AvatarAssetType.TShirt: + struct: EnumItem + Enum.AvatarAssetType.TShirtAccessory: + struct: EnumItem + Enum.AvatarAssetType.Torso: + struct: EnumItem + Enum.AvatarAssetType.WaistAccessory: + struct: EnumItem + Enum.AvatarAssetType.WalkAnimation: + struct: EnumItem + Enum.AvatarContextMenuOption.Chat: + struct: EnumItem + Enum.AvatarContextMenuOption.Emote: + struct: EnumItem + Enum.AvatarContextMenuOption.Friend: + struct: EnumItem + Enum.AvatarContextMenuOption.GetEnumItems: + args: [] + method: true + Enum.AvatarContextMenuOption.InspectMenu: + struct: EnumItem + Enum.AvatarItemType.Asset: + struct: EnumItem + Enum.AvatarItemType.Bundle: + struct: EnumItem + Enum.AvatarItemType.GetEnumItems: + args: [] + method: true + Enum.AvatarPromptResult.Failed: + struct: EnumItem + Enum.AvatarPromptResult.GetEnumItems: + args: [] + method: true + Enum.AvatarPromptResult.PermissionDenied: + struct: EnumItem + Enum.AvatarPromptResult.Success: + struct: EnumItem + Enum.Axis.GetEnumItems: + args: [] + method: true + Enum.Axis.X: + struct: EnumItem + Enum.Axis.Y: + struct: EnumItem + Enum.Axis.Z: + struct: EnumItem + Enum.BinType.Clone: + struct: EnumItem + Enum.BinType.GameTool: + struct: EnumItem + Enum.BinType.GetEnumItems: + args: [] + method: true + Enum.BinType.Grab: + struct: EnumItem + Enum.BinType.Hammer: + struct: EnumItem + Enum.BinType.Script: + struct: EnumItem + Enum.BodyPart.GetEnumItems: + args: [] + method: true + Enum.BodyPart.Head: + struct: EnumItem + Enum.BodyPart.LeftArm: + struct: EnumItem + Enum.BodyPart.LeftLeg: + struct: EnumItem + Enum.BodyPart.RightArm: + struct: EnumItem + Enum.BodyPart.RightLeg: + struct: EnumItem + Enum.BodyPart.Torso: + struct: EnumItem + Enum.BodyPartR15.GetEnumItems: + args: [] + method: true + Enum.BodyPartR15.Head: + struct: EnumItem + Enum.BodyPartR15.LeftFoot: + struct: EnumItem + Enum.BodyPartR15.LeftHand: + struct: EnumItem + Enum.BodyPartR15.LeftLowerArm: + struct: EnumItem + Enum.BodyPartR15.LeftLowerLeg: + struct: EnumItem + Enum.BodyPartR15.LeftUpperArm: + struct: EnumItem + Enum.BodyPartR15.LeftUpperLeg: + struct: EnumItem + Enum.BodyPartR15.LowerTorso: + struct: EnumItem + Enum.BodyPartR15.RightFoot: + struct: EnumItem + Enum.BodyPartR15.RightHand: + struct: EnumItem + Enum.BodyPartR15.RightLowerArm: + struct: EnumItem + Enum.BodyPartR15.RightLowerLeg: + struct: EnumItem + Enum.BodyPartR15.RightUpperArm: + struct: EnumItem + Enum.BodyPartR15.RightUpperLeg: + struct: EnumItem + Enum.BodyPartR15.RootPart: + struct: EnumItem + Enum.BodyPartR15.Unknown: + struct: EnumItem + Enum.BodyPartR15.UpperTorso: + struct: EnumItem + Enum.BorderMode.GetEnumItems: + args: [] + method: true + Enum.BorderMode.Inset: + struct: EnumItem + Enum.BorderMode.Middle: + struct: EnumItem + Enum.BorderMode.Outline: + struct: EnumItem + Enum.BreakReason.Error: + struct: EnumItem + Enum.BreakReason.GetEnumItems: + args: [] + method: true + Enum.BreakReason.Other: + struct: EnumItem + Enum.BreakReason.SpecialBreakpoint: + struct: EnumItem + Enum.BreakReason.UserBreakpoint: + struct: EnumItem + Enum.BreakpointRemoveReason.GetEnumItems: + args: [] + method: true + Enum.BreakpointRemoveReason.Requested: + struct: EnumItem + Enum.BreakpointRemoveReason.ScriptChanged: + struct: EnumItem + Enum.BreakpointRemoveReason.ScriptRemoved: + struct: EnumItem + Enum.BulkMoveMode.FireAllEvents: + struct: EnumItem + Enum.BulkMoveMode.FireCFrameChanged: + struct: EnumItem + Enum.BulkMoveMode.GetEnumItems: + args: [] + method: true + Enum.BundleType.Animations: + struct: EnumItem + Enum.BundleType.BodyParts: + struct: EnumItem + Enum.BundleType.GetEnumItems: + args: [] + method: true + Enum.BundleType.Shoes: + struct: EnumItem + Enum.Button.Dismount: + struct: EnumItem + Enum.Button.GetEnumItems: + args: [] + method: true + Enum.Button.Jump: + struct: EnumItem + Enum.ButtonStyle.Custom: + struct: EnumItem + Enum.ButtonStyle.GetEnumItems: + args: [] + method: true + Enum.ButtonStyle.RobloxButton: + struct: EnumItem + Enum.ButtonStyle.RobloxButtonDefault: + struct: EnumItem + Enum.ButtonStyle.RobloxRoundButton: + struct: EnumItem + Enum.ButtonStyle.RobloxRoundDefaultButton: + struct: EnumItem + Enum.ButtonStyle.RobloxRoundDropdownButton: + struct: EnumItem + Enum.CageType.GetEnumItems: + args: [] + method: true + Enum.CageType.Inner: + struct: EnumItem + Enum.CageType.Outer: + struct: EnumItem + Enum.CameraMode.Classic: + struct: EnumItem + Enum.CameraMode.GetEnumItems: + args: [] + method: true + Enum.CameraMode.LockFirstPerson: + struct: EnumItem + Enum.CameraPanMode.Classic: + struct: EnumItem + Enum.CameraPanMode.EdgeBump: + struct: EnumItem + Enum.CameraPanMode.GetEnumItems: + args: [] + method: true + Enum.CameraType.Attach: + struct: EnumItem + Enum.CameraType.Custom: + struct: EnumItem + Enum.CameraType.Fixed: + struct: EnumItem + Enum.CameraType.Follow: + struct: EnumItem + Enum.CameraType.GetEnumItems: + args: [] + method: true + Enum.CameraType.Orbital: + struct: EnumItem + Enum.CameraType.Scriptable: + struct: EnumItem + Enum.CameraType.Track: + struct: EnumItem + Enum.CameraType.Watch: + struct: EnumItem + Enum.CatalogCategoryFilter.Collectibles: + struct: EnumItem + Enum.CatalogCategoryFilter.CommunityCreations: + struct: EnumItem + Enum.CatalogCategoryFilter.Featured: + struct: EnumItem + Enum.CatalogCategoryFilter.GetEnumItems: + args: [] + method: true + Enum.CatalogCategoryFilter.None: + struct: EnumItem + Enum.CatalogCategoryFilter.Premium: + struct: EnumItem + Enum.CatalogCategoryFilter.Recommended: + struct: EnumItem + Enum.CatalogSortType.GetEnumItems: + args: [] + method: true + Enum.CatalogSortType.MostFavorited: + struct: EnumItem + Enum.CatalogSortType.PriceHighToLow: + struct: EnumItem + Enum.CatalogSortType.PriceLowToHigh: + struct: EnumItem + Enum.CatalogSortType.RecentlyUpdated: + struct: EnumItem + Enum.CatalogSortType.Relevance: + struct: EnumItem + Enum.CellBlock.CornerWedge: + struct: EnumItem + Enum.CellBlock.GetEnumItems: + args: [] + method: true + Enum.CellBlock.HorizontalWedge: + struct: EnumItem + Enum.CellBlock.InverseCornerWedge: + struct: EnumItem + Enum.CellBlock.Solid: + struct: EnumItem + Enum.CellBlock.VerticalWedge: + struct: EnumItem + Enum.CellMaterial.Aluminum: + struct: EnumItem + Enum.CellMaterial.Asphalt: + struct: EnumItem + Enum.CellMaterial.BluePlastic: + struct: EnumItem + Enum.CellMaterial.Brick: + struct: EnumItem + Enum.CellMaterial.Cement: + struct: EnumItem + Enum.CellMaterial.CinderBlock: + struct: EnumItem + Enum.CellMaterial.Empty: + struct: EnumItem + Enum.CellMaterial.GetEnumItems: + args: [] + method: true + Enum.CellMaterial.Gold: + struct: EnumItem + Enum.CellMaterial.Granite: + struct: EnumItem + Enum.CellMaterial.Grass: + struct: EnumItem + Enum.CellMaterial.Gravel: + struct: EnumItem + Enum.CellMaterial.Iron: + struct: EnumItem + Enum.CellMaterial.MossyStone: + struct: EnumItem + Enum.CellMaterial.RedPlastic: + struct: EnumItem + Enum.CellMaterial.Sand: + struct: EnumItem + Enum.CellMaterial.Water: + struct: EnumItem + Enum.CellMaterial.WoodLog: + struct: EnumItem + Enum.CellMaterial.WoodPlank: + struct: EnumItem + Enum.CellOrientation.GetEnumItems: + args: [] + method: true + Enum.CellOrientation.NegX: + struct: EnumItem + Enum.CellOrientation.NegZ: + struct: EnumItem + Enum.CellOrientation.X: + struct: EnumItem + Enum.CellOrientation.Z: + struct: EnumItem + Enum.CenterDialogType.GetEnumItems: + args: [] + method: true + Enum.CenterDialogType.ModalDialog: + struct: EnumItem + Enum.CenterDialogType.PlayerInitiatedDialog: + struct: EnumItem + Enum.CenterDialogType.QuitDialog: + struct: EnumItem + Enum.CenterDialogType.UnsolicitedDialog: + struct: EnumItem + Enum.ChatCallbackType.GetEnumItems: + args: [] + method: true + Enum.ChatCallbackType.OnClientFormattingMessage: + struct: EnumItem + Enum.ChatCallbackType.OnClientSendingMessage: + struct: EnumItem + Enum.ChatCallbackType.OnCreatingChatWindow: + struct: EnumItem + Enum.ChatCallbackType.OnServerReceivingMessage: + struct: EnumItem + Enum.ChatColor.Blue: + struct: EnumItem + Enum.ChatColor.GetEnumItems: + args: [] + method: true + Enum.ChatColor.Green: + struct: EnumItem + Enum.ChatColor.Red: + struct: EnumItem + Enum.ChatColor.White: + struct: EnumItem + Enum.ChatMode.GetEnumItems: + args: [] + method: true + Enum.ChatMode.Menu: + struct: EnumItem + Enum.ChatMode.TextAndMenu: + struct: EnumItem + Enum.ChatPrivacyMode.AllUsers: + struct: EnumItem + Enum.ChatPrivacyMode.Friends: + struct: EnumItem + Enum.ChatPrivacyMode.GetEnumItems: + args: [] + method: true + Enum.ChatPrivacyMode.NoOne: + struct: EnumItem + Enum.ChatStyle.Bubble: + struct: EnumItem + Enum.ChatStyle.Classic: + struct: EnumItem + Enum.ChatStyle.ClassicAndBubble: + struct: EnumItem + Enum.ChatStyle.GetEnumItems: + args: [] + method: true + Enum.ChatVersion.GetEnumItems: + args: [] + method: true + Enum.ChatVersion.LegacyChatService: + struct: EnumItem + Enum.ChatVersion.TextChatService: + struct: EnumItem + Enum.ClientAnimatorThrottlingMode.Default: + struct: EnumItem + Enum.ClientAnimatorThrottlingMode.Disabled: + struct: EnumItem + Enum.ClientAnimatorThrottlingMode.Enabled: + struct: EnumItem + Enum.ClientAnimatorThrottlingMode.GetEnumItems: + args: [] + method: true + Enum.CollisionFidelity.Box: + struct: EnumItem + Enum.CollisionFidelity.Default: + struct: EnumItem + Enum.CollisionFidelity.GetEnumItems: + args: [] + method: true + Enum.CollisionFidelity.Hull: + struct: EnumItem + Enum.CollisionFidelity.PreciseConvexDecomposition: + struct: EnumItem + Enum.CommandPermission.GetEnumItems: + args: [] + method: true + Enum.CommandPermission.LocalUser: + struct: EnumItem + Enum.CommandPermission.Plugin: + struct: EnumItem + Enum.ComputerCameraMovementMode.CameraToggle: + struct: EnumItem + Enum.ComputerCameraMovementMode.Classic: + struct: EnumItem + Enum.ComputerCameraMovementMode.Default: + struct: EnumItem + Enum.ComputerCameraMovementMode.Follow: + struct: EnumItem + Enum.ComputerCameraMovementMode.GetEnumItems: + args: [] + method: true + Enum.ComputerCameraMovementMode.Orbital: + struct: EnumItem + Enum.ComputerMovementMode.ClickToMove: + struct: EnumItem + Enum.ComputerMovementMode.Default: + struct: EnumItem + Enum.ComputerMovementMode.GetEnumItems: + args: [] + method: true + Enum.ComputerMovementMode.KeyboardMouse: + struct: EnumItem + Enum.ConnectionError.DisconnectBadhash: + struct: EnumItem + Enum.ConnectionError.DisconnectBlockedIP: + struct: EnumItem + Enum.ConnectionError.DisconnectBySecurityPolicy: + struct: EnumItem + Enum.ConnectionError.DisconnectClientFailure: + struct: EnumItem + Enum.ConnectionError.DisconnectClientRequest: + struct: EnumItem + Enum.ConnectionError.DisconnectCloudEditKick: + struct: EnumItem + Enum.ConnectionError.DisconnectConnectionLost: + struct: EnumItem + Enum.ConnectionError.DisconnectDevMaintenance: + struct: EnumItem + Enum.ConnectionError.DisconnectDuplicatePlayer: + struct: EnumItem + Enum.ConnectionError.DisconnectDuplicateTicket: + struct: EnumItem + Enum.ConnectionError.DisconnectErrors: + struct: EnumItem + Enum.ConnectionError.DisconnectEvicted: + struct: EnumItem + Enum.ConnectionError.DisconnectHashTimeout: + struct: EnumItem + Enum.ConnectionError.DisconnectIdle: + struct: EnumItem + Enum.ConnectionError.DisconnectIllegalTeleport: + struct: EnumItem + Enum.ConnectionError.DisconnectLuaKick: + struct: EnumItem + Enum.ConnectionError.DisconnectModeratedGame: + struct: EnumItem + Enum.ConnectionError.DisconnectNewSecurityKeyMismatch: + struct: EnumItem + Enum.ConnectionError.DisconnectOnRemoteSysStats: + struct: EnumItem + Enum.ConnectionError.DisconnectOutOfMemory: + struct: EnumItem + Enum.ConnectionError.DisconnectOutOfMemoryExitContinue: + struct: EnumItem + Enum.ConnectionError.DisconnectPlayerless: + struct: EnumItem + Enum.ConnectionError.DisconnectProtocolMismatch: + struct: EnumItem + Enum.ConnectionError.DisconnectRaknetErrors: + struct: EnumItem + Enum.ConnectionError.DisconnectReceivePacketError: + struct: EnumItem + Enum.ConnectionError.DisconnectReceivePacketStreamError: + struct: EnumItem + Enum.ConnectionError.DisconnectRejoin: + struct: EnumItem + Enum.ConnectionError.DisconnectRobloxMaintenance: + struct: EnumItem + Enum.ConnectionError.DisconnectSecurityKeyMismatch: + struct: EnumItem + Enum.ConnectionError.DisconnectSendPacketError: + struct: EnumItem + Enum.ConnectionError.DisconnectTimeout: + struct: EnumItem + Enum.ConnectionError.DisconnectWrongVersion: + struct: EnumItem + Enum.ConnectionError.GetEnumItems: + args: [] + method: true + Enum.ConnectionError.OK: + struct: EnumItem + Enum.ConnectionError.PlacelaunchCustomMessage: + struct: EnumItem + Enum.ConnectionError.PlacelaunchDisabled: + struct: EnumItem + Enum.ConnectionError.PlacelaunchError: + struct: EnumItem + Enum.ConnectionError.PlacelaunchErrors: + struct: EnumItem + Enum.ConnectionError.PlacelaunchFlooded: + struct: EnumItem + Enum.ConnectionError.PlacelaunchGameEnded: + struct: EnumItem + Enum.ConnectionError.PlacelaunchGameFull: + struct: EnumItem + Enum.ConnectionError.PlacelaunchHashException: + struct: EnumItem + Enum.ConnectionError.PlacelaunchHashExpired: + struct: EnumItem + Enum.ConnectionError.PlacelaunchHttpError: + struct: EnumItem + Enum.ConnectionError.PlacelaunchOtherError: + struct: EnumItem + Enum.ConnectionError.PlacelaunchPartyCannotFit: + struct: EnumItem + Enum.ConnectionError.PlacelaunchRestricted: + struct: EnumItem + Enum.ConnectionError.PlacelaunchUnauthorized: + struct: EnumItem + Enum.ConnectionError.PlacelaunchUserLeft: + struct: EnumItem + Enum.ConnectionError.TeleportErrors: + struct: EnumItem + Enum.ConnectionError.TeleportFailure: + struct: EnumItem + Enum.ConnectionError.TeleportFlooded: + struct: EnumItem + Enum.ConnectionError.TeleportGameEnded: + struct: EnumItem + Enum.ConnectionError.TeleportGameFull: + struct: EnumItem + Enum.ConnectionError.TeleportGameNotFound: + struct: EnumItem + Enum.ConnectionError.TeleportIsTeleporting: + struct: EnumItem + Enum.ConnectionError.TeleportUnauthorized: + struct: EnumItem + Enum.ConnectionError.Unknown: + struct: EnumItem + Enum.ConnectionState.Connected: + struct: EnumItem + Enum.ConnectionState.Disconnected: + struct: EnumItem + Enum.ConnectionState.GetEnumItems: + args: [] + method: true + Enum.ContextActionPriority.Default: + struct: EnumItem + Enum.ContextActionPriority.GetEnumItems: + args: [] + method: true + Enum.ContextActionPriority.High: + struct: EnumItem + Enum.ContextActionPriority.Low: + struct: EnumItem + Enum.ContextActionPriority.Medium: + struct: EnumItem + Enum.ContextActionResult.GetEnumItems: + args: [] + method: true + Enum.ContextActionResult.Pass: + struct: EnumItem + Enum.ContextActionResult.Sink: + struct: EnumItem + Enum.ControlMode.Classic: + struct: EnumItem + Enum.ControlMode.GetEnumItems: + args: [] + method: true + Enum.ControlMode.MouseLockSwitch: + struct: EnumItem + Enum.CoreGuiType.All: + struct: EnumItem + Enum.CoreGuiType.Backpack: + struct: EnumItem + Enum.CoreGuiType.Chat: + struct: EnumItem + Enum.CoreGuiType.EmotesMenu: + struct: EnumItem + Enum.CoreGuiType.GetEnumItems: + args: [] + method: true + Enum.CoreGuiType.Health: + struct: EnumItem + Enum.CoreGuiType.PlayerList: + struct: EnumItem + Enum.CreateOutfitFailure.GetEnumItems: + args: [] + method: true + Enum.CreateOutfitFailure.InvalidName: + struct: EnumItem + Enum.CreateOutfitFailure.Other: + struct: EnumItem + Enum.CreateOutfitFailure.OutfitLimitReached: + struct: EnumItem + Enum.CreatorType.GetEnumItems: + args: [] + method: true + Enum.CreatorType.Group: + struct: EnumItem + Enum.CreatorType.User: + struct: EnumItem + Enum.CurrencyType.Default: + struct: EnumItem + Enum.CurrencyType.GetEnumItems: + args: [] + method: true + Enum.CurrencyType.Robux: + struct: EnumItem + Enum.CurrencyType.Tix: + struct: EnumItem + Enum.CustomCameraMode.Classic: + struct: EnumItem + Enum.CustomCameraMode.Default: + struct: EnumItem + Enum.CustomCameraMode.Follow: + struct: EnumItem + Enum.CustomCameraMode.GetEnumItems: + args: [] + method: true + Enum.DataStoreRequestType.GetAsync: + struct: EnumItem + Enum.DataStoreRequestType.GetEnumItems: + args: [] + method: true + Enum.DataStoreRequestType.GetSortedAsync: + struct: EnumItem + Enum.DataStoreRequestType.OnUpdate: + struct: EnumItem + Enum.DataStoreRequestType.SetIncrementAsync: + struct: EnumItem + Enum.DataStoreRequestType.SetIncrementSortedAsync: + struct: EnumItem + Enum.DataStoreRequestType.UpdateAsync: + struct: EnumItem + Enum.DebuggerEndReason.ClientRequest: + struct: EnumItem + Enum.DebuggerEndReason.ConfigurationFailed: + struct: EnumItem + Enum.DebuggerEndReason.Disconnected: + struct: EnumItem + Enum.DebuggerEndReason.GetEnumItems: + args: [] + method: true + Enum.DebuggerEndReason.InvalidHost: + struct: EnumItem + Enum.DebuggerEndReason.RpcError: + struct: EnumItem + Enum.DebuggerEndReason.ServerProtocolMismatch: + struct: EnumItem + Enum.DebuggerEndReason.ServerShutdown: + struct: EnumItem + Enum.DebuggerEndReason.Timeout: + struct: EnumItem + Enum.DebuggerExceptionBreakMode.Always: + struct: EnumItem + Enum.DebuggerExceptionBreakMode.GetEnumItems: + args: [] + method: true + Enum.DebuggerExceptionBreakMode.Never: + struct: EnumItem + Enum.DebuggerExceptionBreakMode.Unhandled: + struct: EnumItem + Enum.DebuggerFrameType.C: + struct: EnumItem + Enum.DebuggerFrameType.GetEnumItems: + args: [] + method: true + Enum.DebuggerFrameType.Lua: + struct: EnumItem + Enum.DebuggerPauseReason.Breakpoint: + struct: EnumItem + Enum.DebuggerPauseReason.Entrypoint: + struct: EnumItem + Enum.DebuggerPauseReason.Exception: + struct: EnumItem + Enum.DebuggerPauseReason.GetEnumItems: + args: [] + method: true + Enum.DebuggerPauseReason.Requested: + struct: EnumItem + Enum.DebuggerPauseReason.SingleStep: + struct: EnumItem + Enum.DebuggerPauseReason.Unknown: + struct: EnumItem + Enum.DebuggerStatus.ConnectionClosed: + struct: EnumItem + Enum.DebuggerStatus.ConnectionLost: + struct: EnumItem + Enum.DebuggerStatus.GetEnumItems: + args: [] + method: true + Enum.DebuggerStatus.InternalError: + struct: EnumItem + Enum.DebuggerStatus.InvalidArgument: + struct: EnumItem + Enum.DebuggerStatus.InvalidResponse: + struct: EnumItem + Enum.DebuggerStatus.InvalidState: + struct: EnumItem + Enum.DebuggerStatus.RpcError: + struct: EnumItem + Enum.DebuggerStatus.Success: + struct: EnumItem + Enum.DebuggerStatus.Timeout: + struct: EnumItem + Enum.DevCameraOcclusionMode.GetEnumItems: + args: [] + method: true + Enum.DevCameraOcclusionMode.Invisicam: + struct: EnumItem + Enum.DevCameraOcclusionMode.Zoom: + struct: EnumItem + Enum.DevComputerCameraMovementMode.CameraToggle: + struct: EnumItem + Enum.DevComputerCameraMovementMode.Classic: + struct: EnumItem + Enum.DevComputerCameraMovementMode.Follow: + struct: EnumItem + Enum.DevComputerCameraMovementMode.GetEnumItems: + args: [] + method: true + Enum.DevComputerCameraMovementMode.Orbital: + struct: EnumItem + Enum.DevComputerCameraMovementMode.UserChoice: + struct: EnumItem + Enum.DevComputerMovementMode.ClickToMove: + struct: EnumItem + Enum.DevComputerMovementMode.GetEnumItems: + args: [] + method: true + Enum.DevComputerMovementMode.KeyboardMouse: + struct: EnumItem + Enum.DevComputerMovementMode.Scriptable: + struct: EnumItem + Enum.DevComputerMovementMode.UserChoice: + struct: EnumItem + Enum.DevTouchCameraMovementMode.Classic: + struct: EnumItem + Enum.DevTouchCameraMovementMode.Follow: + struct: EnumItem + Enum.DevTouchCameraMovementMode.GetEnumItems: + args: [] + method: true + Enum.DevTouchCameraMovementMode.Orbital: + struct: EnumItem + Enum.DevTouchCameraMovementMode.UserChoice: + struct: EnumItem + Enum.DevTouchMovementMode.ClickToMove: + struct: EnumItem + Enum.DevTouchMovementMode.DPad: + struct: EnumItem + Enum.DevTouchMovementMode.DynamicThumbstick: + struct: EnumItem + Enum.DevTouchMovementMode.GetEnumItems: + args: [] + method: true + Enum.DevTouchMovementMode.Scriptable: + struct: EnumItem + Enum.DevTouchMovementMode.Thumbpad: + struct: EnumItem + Enum.DevTouchMovementMode.Thumbstick: + struct: EnumItem + Enum.DevTouchMovementMode.UserChoice: + struct: EnumItem + Enum.DeveloperMemoryTag.Animation: + struct: EnumItem + Enum.DeveloperMemoryTag.GeometryCSG: + struct: EnumItem + Enum.DeveloperMemoryTag.GetEnumItems: + args: [] + method: true + Enum.DeveloperMemoryTag.GraphicsMeshParts: + struct: EnumItem + Enum.DeveloperMemoryTag.GraphicsParticles: + struct: EnumItem + Enum.DeveloperMemoryTag.GraphicsParts: + struct: EnumItem + Enum.DeveloperMemoryTag.GraphicsSolidModels: + struct: EnumItem + Enum.DeveloperMemoryTag.GraphicsSpatialHash: + struct: EnumItem + Enum.DeveloperMemoryTag.GraphicsTerrain: + struct: EnumItem + Enum.DeveloperMemoryTag.GraphicsTexture: + struct: EnumItem + Enum.DeveloperMemoryTag.GraphicsTextureCharacter: + struct: EnumItem + Enum.DeveloperMemoryTag.Gui: + struct: EnumItem + Enum.DeveloperMemoryTag.HttpCache: + struct: EnumItem + Enum.DeveloperMemoryTag.Instances: + struct: EnumItem + Enum.DeveloperMemoryTag.Internal: + struct: EnumItem + Enum.DeveloperMemoryTag.LuaHeap: + struct: EnumItem + Enum.DeveloperMemoryTag.Navigation: + struct: EnumItem + Enum.DeveloperMemoryTag.PhysicsCollision: + struct: EnumItem + Enum.DeveloperMemoryTag.PhysicsParts: + struct: EnumItem + Enum.DeveloperMemoryTag.Script: + struct: EnumItem + Enum.DeveloperMemoryTag.Signals: + struct: EnumItem + Enum.DeveloperMemoryTag.Sounds: + struct: EnumItem + Enum.DeveloperMemoryTag.StreamingSounds: + struct: EnumItem + Enum.DeveloperMemoryTag.TerrainVoxels: + struct: EnumItem + Enum.DeviceType.Desktop: + struct: EnumItem + Enum.DeviceType.GetEnumItems: + args: [] + method: true + Enum.DeviceType.Phone: + struct: EnumItem + Enum.DeviceType.Tablet: + struct: EnumItem + Enum.DeviceType.Unknown: + struct: EnumItem + Enum.DialogBehaviorType.GetEnumItems: + args: [] + method: true + Enum.DialogBehaviorType.MultiplePlayers: + struct: EnumItem + Enum.DialogBehaviorType.SinglePlayer: + struct: EnumItem + Enum.DialogPurpose.GetEnumItems: + args: [] + method: true + Enum.DialogPurpose.Help: + struct: EnumItem + Enum.DialogPurpose.Quest: + struct: EnumItem + Enum.DialogPurpose.Shop: + struct: EnumItem + Enum.DialogTone.Enemy: + struct: EnumItem + Enum.DialogTone.Friendly: + struct: EnumItem + Enum.DialogTone.GetEnumItems: + args: [] + method: true + Enum.DialogTone.Neutral: + struct: EnumItem + Enum.DominantAxis.GetEnumItems: + args: [] + method: true + Enum.DominantAxis.Height: + struct: EnumItem + Enum.DominantAxis.Width: + struct: EnumItem + Enum.DraftStatusCode.DraftCommitted: + struct: EnumItem + Enum.DraftStatusCode.DraftOutdated: + struct: EnumItem + Enum.DraftStatusCode.GetEnumItems: + args: [] + method: true + Enum.DraftStatusCode.OK: + struct: EnumItem + Enum.DraftStatusCode.ScriptRemoved: + struct: EnumItem + Enum.DraggerCoordinateSpace.GetEnumItems: + args: [] + method: true + Enum.DraggerCoordinateSpace.Object: + struct: EnumItem + Enum.DraggerCoordinateSpace.World: + struct: EnumItem + Enum.DraggerMovementMode.Geometric: + struct: EnumItem + Enum.DraggerMovementMode.GetEnumItems: + args: [] + method: true + Enum.DraggerMovementMode.Physical: + struct: EnumItem + Enum.EasingDirection.GetEnumItems: + args: [] + method: true + Enum.EasingDirection.In: + struct: EnumItem + Enum.EasingDirection.InOut: + struct: EnumItem + Enum.EasingDirection.Out: + struct: EnumItem + Enum.EasingStyle.Back: + struct: EnumItem + Enum.EasingStyle.Bounce: + struct: EnumItem + Enum.EasingStyle.Circular: + struct: EnumItem + Enum.EasingStyle.Cubic: + struct: EnumItem + Enum.EasingStyle.Elastic: + struct: EnumItem + Enum.EasingStyle.Exponential: + struct: EnumItem + Enum.EasingStyle.GetEnumItems: + args: [] + method: true + Enum.EasingStyle.Linear: + struct: EnumItem + Enum.EasingStyle.Quad: + struct: EnumItem + Enum.EasingStyle.Quart: + struct: EnumItem + Enum.EasingStyle.Quint: + struct: EnumItem + Enum.EasingStyle.Sine: + struct: EnumItem + Enum.ElasticBehavior.Always: + struct: EnumItem + Enum.ElasticBehavior.GetEnumItems: + args: [] + method: true + Enum.ElasticBehavior.Never: + struct: EnumItem + Enum.ElasticBehavior.WhenScrollable: + struct: EnumItem + Enum.EnviromentalPhysicsThrottle.Always: + struct: EnumItem + Enum.EnviromentalPhysicsThrottle.DefaultAuto: + struct: EnumItem + Enum.EnviromentalPhysicsThrottle.Disabled: + struct: EnumItem + Enum.EnviromentalPhysicsThrottle.GetEnumItems: + args: [] + method: true + Enum.EnviromentalPhysicsThrottle.Skip16: + struct: EnumItem + Enum.EnviromentalPhysicsThrottle.Skip2: + struct: EnumItem + Enum.EnviromentalPhysicsThrottle.Skip4: + struct: EnumItem + Enum.EnviromentalPhysicsThrottle.Skip8: + struct: EnumItem + Enum.ExplosionType.Craters: + struct: EnumItem + Enum.ExplosionType.GetEnumItems: + args: [] + method: true + Enum.ExplosionType.NoCraters: + struct: EnumItem + Enum.FieldOfViewMode.Diagonal: + struct: EnumItem + Enum.FieldOfViewMode.GetEnumItems: + args: [] + method: true + Enum.FieldOfViewMode.MaxAxis: + struct: EnumItem + Enum.FieldOfViewMode.Vertical: + struct: EnumItem + Enum.FillDirection.GetEnumItems: + args: [] + method: true + Enum.FillDirection.Horizontal: + struct: EnumItem + Enum.FillDirection.Vertical: + struct: EnumItem + Enum.FilterResult.Accepted: + struct: EnumItem + Enum.FilterResult.GetEnumItems: + args: [] + method: true + Enum.FilterResult.Rejected: + struct: EnumItem + Enum.Font.AmaticSC: + struct: EnumItem + Enum.Font.Antique: + struct: EnumItem + Enum.Font.Arcade: + struct: EnumItem + Enum.Font.Arial: + struct: EnumItem + Enum.Font.ArialBold: + struct: EnumItem + Enum.Font.Bangers: + struct: EnumItem + Enum.Font.Bodoni: + struct: EnumItem + Enum.Font.Cartoon: + struct: EnumItem + Enum.Font.Code: + struct: EnumItem + Enum.Font.Creepster: + struct: EnumItem + Enum.Font.DenkOne: + struct: EnumItem + Enum.Font.Fantasy: + struct: EnumItem + Enum.Font.Fondamento: + struct: EnumItem + Enum.Font.FredokaOne: + struct: EnumItem + Enum.Font.Garamond: + struct: EnumItem + Enum.Font.GetEnumItems: + args: [] + method: true + Enum.Font.Gotham: + struct: EnumItem + Enum.Font.GothamBlack: + struct: EnumItem + Enum.Font.GothamBold: + struct: EnumItem + Enum.Font.GothamMedium: + struct: EnumItem + Enum.Font.GrenzeGotisch: + struct: EnumItem + Enum.Font.Highway: + struct: EnumItem + Enum.Font.IndieFlower: + struct: EnumItem + Enum.Font.JosefinSans: + struct: EnumItem + Enum.Font.Jura: + struct: EnumItem + Enum.Font.Kalam: + struct: EnumItem + Enum.Font.Legacy: + struct: EnumItem + Enum.Font.LuckiestGuy: + struct: EnumItem + Enum.Font.Merriweather: + struct: EnumItem + Enum.Font.Michroma: + struct: EnumItem + Enum.Font.Nunito: + struct: EnumItem + Enum.Font.Oswald: + struct: EnumItem + Enum.Font.PatrickHand: + struct: EnumItem + Enum.Font.PermanentMarker: + struct: EnumItem + Enum.Font.Roboto: + struct: EnumItem + Enum.Font.RobotoCondensed: + struct: EnumItem + Enum.Font.RobotoMono: + struct: EnumItem + Enum.Font.Sarpanch: + struct: EnumItem + Enum.Font.SciFi: + struct: EnumItem + Enum.Font.SourceSans: + struct: EnumItem + Enum.Font.SourceSansBold: + struct: EnumItem + Enum.Font.SourceSansItalic: + struct: EnumItem + Enum.Font.SourceSansLight: + struct: EnumItem + Enum.Font.SourceSansSemibold: + struct: EnumItem + Enum.Font.SpecialElite: + struct: EnumItem + Enum.Font.TitilliumWeb: + struct: EnumItem + Enum.Font.Ubuntu: + struct: EnumItem + Enum.Font.Unknown: + struct: EnumItem + Enum.FontSize.GetEnumItems: + args: [] + method: true + Enum.FontSize.Size10: + struct: EnumItem + Enum.FontSize.Size11: + struct: EnumItem + Enum.FontSize.Size12: + struct: EnumItem + Enum.FontSize.Size14: + struct: EnumItem + Enum.FontSize.Size18: + struct: EnumItem + Enum.FontSize.Size24: + struct: EnumItem + Enum.FontSize.Size28: + struct: EnumItem + Enum.FontSize.Size32: + struct: EnumItem + Enum.FontSize.Size36: + struct: EnumItem + Enum.FontSize.Size42: + struct: EnumItem + Enum.FontSize.Size48: + struct: EnumItem + Enum.FontSize.Size60: + struct: EnumItem + Enum.FontSize.Size8: + struct: EnumItem + Enum.FontSize.Size9: + struct: EnumItem + Enum.FontSize.Size96: + struct: EnumItem + Enum.FontStyle.GetEnumItems: + args: [] + method: true + Enum.FontStyle.Italic: + struct: EnumItem + Enum.FontStyle.Normal: + struct: EnumItem + Enum.FontWeight.Bold: + struct: EnumItem + Enum.FontWeight.ExtraBold: + struct: EnumItem + Enum.FontWeight.ExtraLight: + struct: EnumItem + Enum.FontWeight.GetEnumItems: + args: [] + method: true + Enum.FontWeight.Heavy: + struct: EnumItem + Enum.FontWeight.Light: + struct: EnumItem + Enum.FontWeight.Medium: + struct: EnumItem + Enum.FontWeight.Regular: + struct: EnumItem + Enum.FontWeight.SemiBold: + struct: EnumItem + Enum.FontWeight.Thin: + struct: EnumItem + Enum.FormFactor.Brick: + struct: EnumItem + Enum.FormFactor.Custom: + struct: EnumItem + Enum.FormFactor.GetEnumItems: + args: [] + method: true + Enum.FormFactor.Plate: + struct: EnumItem + Enum.FormFactor.Symmetric: + struct: EnumItem + Enum.FrameStyle.ChatBlue: + struct: EnumItem + Enum.FrameStyle.ChatGreen: + struct: EnumItem + Enum.FrameStyle.ChatRed: + struct: EnumItem + Enum.FrameStyle.Custom: + struct: EnumItem + Enum.FrameStyle.DropShadow: + struct: EnumItem + Enum.FrameStyle.GetEnumItems: + args: [] + method: true + Enum.FrameStyle.RobloxRound: + struct: EnumItem + Enum.FrameStyle.RobloxSquare: + struct: EnumItem + Enum.FramerateManagerMode.Automatic: + struct: EnumItem + Enum.FramerateManagerMode.GetEnumItems: + args: [] + method: true + Enum.FramerateManagerMode.Off: + struct: EnumItem + Enum.FramerateManagerMode.On: + struct: EnumItem + Enum.FriendRequestEvent.Accept: + struct: EnumItem + Enum.FriendRequestEvent.Deny: + struct: EnumItem + Enum.FriendRequestEvent.GetEnumItems: + args: [] + method: true + Enum.FriendRequestEvent.Issue: + struct: EnumItem + Enum.FriendRequestEvent.Revoke: + struct: EnumItem + Enum.FriendStatus.Friend: + struct: EnumItem + Enum.FriendStatus.FriendRequestReceived: + struct: EnumItem + Enum.FriendStatus.FriendRequestSent: + struct: EnumItem + Enum.FriendStatus.GetEnumItems: + args: [] + method: true + Enum.FriendStatus.NotFriend: + struct: EnumItem + Enum.FriendStatus.Unknown: + struct: EnumItem + Enum.FunctionalTestResult.Error: + struct: EnumItem + Enum.FunctionalTestResult.GetEnumItems: + args: [] + method: true + Enum.FunctionalTestResult.Passed: + struct: EnumItem + Enum.FunctionalTestResult.Warning: + struct: EnumItem + Enum.GameAvatarType.GetEnumItems: + args: [] + method: true + Enum.GameAvatarType.PlayerChoice: + struct: EnumItem + Enum.GameAvatarType.R15: + struct: EnumItem + Enum.GameAvatarType.R6: + struct: EnumItem + Enum.GearGenreSetting.AllGenres: + struct: EnumItem + Enum.GearGenreSetting.GetEnumItems: + args: [] + method: true + Enum.GearGenreSetting.MatchingGenreOnly: + struct: EnumItem + Enum.GearType.BuildingTools: + struct: EnumItem + Enum.GearType.Explosives: + struct: EnumItem + Enum.GearType.GetEnumItems: + args: [] + method: true + Enum.GearType.MeleeWeapons: + struct: EnumItem + Enum.GearType.MusicalInstruments: + struct: EnumItem + Enum.GearType.NavigationEnhancers: + struct: EnumItem + Enum.GearType.PowerUps: + struct: EnumItem + Enum.GearType.RangedWeapons: + struct: EnumItem + Enum.GearType.SocialItems: + struct: EnumItem + Enum.GearType.Transport: + struct: EnumItem + Enum.Genre.Adventure: + struct: EnumItem + Enum.Genre.All: + struct: EnumItem + Enum.Genre.Fantasy: + struct: EnumItem + Enum.Genre.Funny: + struct: EnumItem + Enum.Genre.GetEnumItems: + args: [] + method: true + Enum.Genre.Ninja: + struct: EnumItem + Enum.Genre.Pirate: + struct: EnumItem + Enum.Genre.Scary: + struct: EnumItem + Enum.Genre.SciFi: + struct: EnumItem + Enum.Genre.SkatePark: + struct: EnumItem + Enum.Genre.Sports: + struct: EnumItem + Enum.Genre.TownAndCity: + struct: EnumItem + Enum.Genre.Tutorial: + struct: EnumItem + Enum.Genre.War: + struct: EnumItem + Enum.Genre.WildWest: + struct: EnumItem + Enum.GetEnums: + args: [] + method: true + Enum.GraphicsMode.Automatic: + struct: EnumItem + Enum.GraphicsMode.Direct3D11: + struct: EnumItem + Enum.GraphicsMode.GetEnumItems: + args: [] + method: true + Enum.GraphicsMode.Metal: + struct: EnumItem + Enum.GraphicsMode.NoGraphics: + struct: EnumItem + Enum.GraphicsMode.OpenGL: + struct: EnumItem + Enum.GraphicsMode.Vulkan: + struct: EnumItem + Enum.HandlesStyle.GetEnumItems: + args: [] + method: true + Enum.HandlesStyle.Movement: + struct: EnumItem + Enum.HandlesStyle.Resize: + struct: EnumItem + Enum.HighlightDepthMode.AlwaysOnTop: + struct: EnumItem + Enum.HighlightDepthMode.GetEnumItems: + args: [] + method: true + Enum.HighlightDepthMode.Occluded: + struct: EnumItem + Enum.HorizontalAlignment.Center: + struct: EnumItem + Enum.HorizontalAlignment.GetEnumItems: + args: [] + method: true + Enum.HorizontalAlignment.Left: + struct: EnumItem + Enum.HorizontalAlignment.Right: + struct: EnumItem + Enum.HoverAnimateSpeed.Fast: + struct: EnumItem + Enum.HoverAnimateSpeed.GetEnumItems: + args: [] + method: true + Enum.HoverAnimateSpeed.Medium: + struct: EnumItem + Enum.HoverAnimateSpeed.Slow: + struct: EnumItem + Enum.HoverAnimateSpeed.VeryFast: + struct: EnumItem + Enum.HoverAnimateSpeed.VerySlow: + struct: EnumItem + Enum.HttpCachePolicy.DataOnly: + struct: EnumItem + Enum.HttpCachePolicy.Default: + struct: EnumItem + Enum.HttpCachePolicy.Full: + struct: EnumItem + Enum.HttpCachePolicy.GetEnumItems: + args: [] + method: true + Enum.HttpCachePolicy.InternalRedirectRefresh: + struct: EnumItem + Enum.HttpCachePolicy.None: + struct: EnumItem + Enum.HttpContentType.ApplicationJson: + struct: EnumItem + Enum.HttpContentType.ApplicationUrlEncoded: + struct: EnumItem + Enum.HttpContentType.ApplicationXml: + struct: EnumItem + Enum.HttpContentType.GetEnumItems: + args: [] + method: true + Enum.HttpContentType.TextPlain: + struct: EnumItem + Enum.HttpContentType.TextXml: + struct: EnumItem + Enum.HttpError.Aborted: + struct: EnumItem + Enum.HttpError.ConnectFail: + struct: EnumItem + Enum.HttpError.DnsResolve: + struct: EnumItem + Enum.HttpError.GetEnumItems: + args: [] + method: true + Enum.HttpError.InvalidRedirect: + struct: EnumItem + Enum.HttpError.InvalidUrl: + struct: EnumItem + Enum.HttpError.NetFail: + struct: EnumItem + Enum.HttpError.OK: + struct: EnumItem + Enum.HttpError.OutOfMemory: + struct: EnumItem + Enum.HttpError.SslConnectFail: + struct: EnumItem + Enum.HttpError.SslVerificationFail: + struct: EnumItem + Enum.HttpError.TimedOut: + struct: EnumItem + Enum.HttpError.TooManyRedirects: + struct: EnumItem + Enum.HttpError.Unknown: + struct: EnumItem + Enum.HttpRequestType.Analytics: + struct: EnumItem + Enum.HttpRequestType.Avatar: + struct: EnumItem + Enum.HttpRequestType.Chat: + struct: EnumItem + Enum.HttpRequestType.Default: + struct: EnumItem + Enum.HttpRequestType.GetEnumItems: + args: [] + method: true + Enum.HttpRequestType.Localization: + struct: EnumItem + Enum.HttpRequestType.MarketplaceService: + struct: EnumItem + Enum.HttpRequestType.Players: + struct: EnumItem + Enum.HumanoidCollisionType.GetEnumItems: + args: [] + method: true + Enum.HumanoidCollisionType.InnerBox: + struct: EnumItem + Enum.HumanoidCollisionType.OuterBox: + struct: EnumItem + Enum.HumanoidDisplayDistanceType.GetEnumItems: + args: [] + method: true + Enum.HumanoidDisplayDistanceType.None: + struct: EnumItem + Enum.HumanoidDisplayDistanceType.Subject: + struct: EnumItem + Enum.HumanoidDisplayDistanceType.Viewer: + struct: EnumItem + Enum.HumanoidHealthDisplayType.AlwaysOff: + struct: EnumItem + Enum.HumanoidHealthDisplayType.AlwaysOn: + struct: EnumItem + Enum.HumanoidHealthDisplayType.DisplayWhenDamaged: + struct: EnumItem + Enum.HumanoidHealthDisplayType.GetEnumItems: + args: [] + method: true + Enum.HumanoidOnlySetCollisionsOnStateChange.Default: + struct: EnumItem + Enum.HumanoidOnlySetCollisionsOnStateChange.Disabled: + struct: EnumItem + Enum.HumanoidOnlySetCollisionsOnStateChange.Enabled: + struct: EnumItem + Enum.HumanoidOnlySetCollisionsOnStateChange.GetEnumItems: + args: [] + method: true + Enum.HumanoidRigType.GetEnumItems: + args: [] + method: true + Enum.HumanoidRigType.R15: + struct: EnumItem + Enum.HumanoidRigType.R6: + struct: EnumItem + Enum.HumanoidStateType.Climbing: + struct: EnumItem + Enum.HumanoidStateType.Dead: + struct: EnumItem + Enum.HumanoidStateType.FallingDown: + struct: EnumItem + Enum.HumanoidStateType.Flying: + struct: EnumItem + Enum.HumanoidStateType.Freefall: + struct: EnumItem + Enum.HumanoidStateType.GetEnumItems: + args: [] + method: true + Enum.HumanoidStateType.GettingUp: + struct: EnumItem + Enum.HumanoidStateType.Jumping: + struct: EnumItem + Enum.HumanoidStateType.Landed: + struct: EnumItem + Enum.HumanoidStateType.None: + struct: EnumItem + Enum.HumanoidStateType.Physics: + struct: EnumItem + Enum.HumanoidStateType.PlatformStanding: + struct: EnumItem + Enum.HumanoidStateType.Ragdoll: + struct: EnumItem + Enum.HumanoidStateType.Running: + struct: EnumItem + Enum.HumanoidStateType.RunningNoPhysics: + struct: EnumItem + Enum.HumanoidStateType.Seated: + struct: EnumItem + Enum.HumanoidStateType.StrafingNoPhysics: + struct: EnumItem + Enum.HumanoidStateType.Swimming: + struct: EnumItem + Enum.IKCollisionsMode.GetEnumItems: + args: [] + method: true + Enum.IKCollisionsMode.IncludeContactedMechanisms: + struct: EnumItem + Enum.IKCollisionsMode.NoCollisions: + struct: EnumItem + Enum.IKCollisionsMode.OtherMechanismsAnchored: + struct: EnumItem + Enum.IXPLoadingStatus.ErrorConnection: + struct: EnumItem + Enum.IXPLoadingStatus.ErrorInvalidUser: + struct: EnumItem + Enum.IXPLoadingStatus.ErrorJsonParse: + struct: EnumItem + Enum.IXPLoadingStatus.ErrorTimedOut: + struct: EnumItem + Enum.IXPLoadingStatus.GetEnumItems: + args: [] + method: true + Enum.IXPLoadingStatus.Initialized: + struct: EnumItem + Enum.IXPLoadingStatus.None: + struct: EnumItem + Enum.IXPLoadingStatus.Pending: + struct: EnumItem + Enum.IXPLoadingStatus.ShutOff: + struct: EnumItem + Enum.InOut.Center: + struct: EnumItem + Enum.InOut.Edge: + struct: EnumItem + Enum.InOut.GetEnumItems: + args: [] + method: true + Enum.InOut.Inset: + struct: EnumItem + Enum.InfoType.Asset: + struct: EnumItem + Enum.InfoType.Bundle: + struct: EnumItem + Enum.InfoType.GamePass: + struct: EnumItem + Enum.InfoType.GetEnumItems: + args: [] + method: true + Enum.InfoType.Product: + struct: EnumItem + Enum.InfoType.Subscription: + struct: EnumItem + Enum.InitialDockState.Bottom: + struct: EnumItem + Enum.InitialDockState.Float: + struct: EnumItem + Enum.InitialDockState.GetEnumItems: + args: [] + method: true + Enum.InitialDockState.Left: + struct: EnumItem + Enum.InitialDockState.Right: + struct: EnumItem + Enum.InitialDockState.Top: + struct: EnumItem + Enum.InputType.Constant: + struct: EnumItem + Enum.InputType.GetEnumItems: + args: [] + method: true + Enum.InputType.NoInput: + struct: EnumItem + Enum.InputType.Sin: + struct: EnumItem + Enum.InterpolationThrottlingMode.Default: + struct: EnumItem + Enum.InterpolationThrottlingMode.Disabled: + struct: EnumItem + Enum.InterpolationThrottlingMode.Enabled: + struct: EnumItem + Enum.InterpolationThrottlingMode.GetEnumItems: + args: [] + method: true + Enum.JointCreationMode.All: + struct: EnumItem + Enum.JointCreationMode.GetEnumItems: + args: [] + method: true + Enum.JointCreationMode.None: + struct: EnumItem + Enum.JointCreationMode.Surface: + struct: EnumItem + Enum.KeyCode.A: + struct: EnumItem + Enum.KeyCode.Ampersand: + struct: EnumItem + Enum.KeyCode.Asterisk: + struct: EnumItem + Enum.KeyCode.At: + struct: EnumItem + Enum.KeyCode.B: + struct: EnumItem + Enum.KeyCode.BackSlash: + struct: EnumItem + Enum.KeyCode.Backquote: + struct: EnumItem + Enum.KeyCode.Backspace: + struct: EnumItem + Enum.KeyCode.Break: + struct: EnumItem + Enum.KeyCode.ButtonA: + struct: EnumItem + Enum.KeyCode.ButtonB: + struct: EnumItem + Enum.KeyCode.ButtonL1: + struct: EnumItem + Enum.KeyCode.ButtonL2: + struct: EnumItem + Enum.KeyCode.ButtonL3: + struct: EnumItem + Enum.KeyCode.ButtonR1: + struct: EnumItem + Enum.KeyCode.ButtonR2: + struct: EnumItem + Enum.KeyCode.ButtonR3: + struct: EnumItem + Enum.KeyCode.ButtonSelect: + struct: EnumItem + Enum.KeyCode.ButtonStart: + struct: EnumItem + Enum.KeyCode.ButtonX: + struct: EnumItem + Enum.KeyCode.ButtonY: + struct: EnumItem + Enum.KeyCode.C: + struct: EnumItem + Enum.KeyCode.CapsLock: + struct: EnumItem + Enum.KeyCode.Caret: + struct: EnumItem + Enum.KeyCode.Clear: + struct: EnumItem + Enum.KeyCode.Colon: + struct: EnumItem + Enum.KeyCode.Comma: + struct: EnumItem + Enum.KeyCode.Compose: + struct: EnumItem + Enum.KeyCode.D: + struct: EnumItem + Enum.KeyCode.DPadDown: + struct: EnumItem + Enum.KeyCode.DPadLeft: + struct: EnumItem + Enum.KeyCode.DPadRight: + struct: EnumItem + Enum.KeyCode.DPadUp: + struct: EnumItem + Enum.KeyCode.Delete: + struct: EnumItem + Enum.KeyCode.Dollar: + struct: EnumItem + Enum.KeyCode.Down: + struct: EnumItem + Enum.KeyCode.E: + struct: EnumItem + Enum.KeyCode.Eight: + struct: EnumItem + Enum.KeyCode.End: + struct: EnumItem + Enum.KeyCode.Equals: + struct: EnumItem + Enum.KeyCode.Escape: + struct: EnumItem + Enum.KeyCode.Euro: + struct: EnumItem + Enum.KeyCode.F: + struct: EnumItem + Enum.KeyCode.F1: + struct: EnumItem + Enum.KeyCode.F10: + struct: EnumItem + Enum.KeyCode.F11: + struct: EnumItem + Enum.KeyCode.F12: + struct: EnumItem + Enum.KeyCode.F13: + struct: EnumItem + Enum.KeyCode.F14: + struct: EnumItem + Enum.KeyCode.F15: + struct: EnumItem + Enum.KeyCode.F2: + struct: EnumItem + Enum.KeyCode.F3: + struct: EnumItem + Enum.KeyCode.F4: + struct: EnumItem + Enum.KeyCode.F5: + struct: EnumItem + Enum.KeyCode.F6: + struct: EnumItem + Enum.KeyCode.F7: + struct: EnumItem + Enum.KeyCode.F8: + struct: EnumItem + Enum.KeyCode.F9: + struct: EnumItem + Enum.KeyCode.Five: + struct: EnumItem + Enum.KeyCode.Four: + struct: EnumItem + Enum.KeyCode.G: + struct: EnumItem + Enum.KeyCode.GetEnumItems: + args: [] + method: true + Enum.KeyCode.GreaterThan: + struct: EnumItem + Enum.KeyCode.H: + struct: EnumItem + Enum.KeyCode.Hash: + struct: EnumItem + Enum.KeyCode.Help: + struct: EnumItem + Enum.KeyCode.Home: + struct: EnumItem + Enum.KeyCode.I: + struct: EnumItem + Enum.KeyCode.Insert: + struct: EnumItem + Enum.KeyCode.J: + struct: EnumItem + Enum.KeyCode.K: + struct: EnumItem + Enum.KeyCode.KeypadDivide: + struct: EnumItem + Enum.KeyCode.KeypadEight: + struct: EnumItem + Enum.KeyCode.KeypadEnter: + struct: EnumItem + Enum.KeyCode.KeypadEquals: + struct: EnumItem + Enum.KeyCode.KeypadFive: + struct: EnumItem + Enum.KeyCode.KeypadFour: + struct: EnumItem + Enum.KeyCode.KeypadMinus: + struct: EnumItem + Enum.KeyCode.KeypadMultiply: + struct: EnumItem + Enum.KeyCode.KeypadNine: + struct: EnumItem + Enum.KeyCode.KeypadOne: + struct: EnumItem + Enum.KeyCode.KeypadPeriod: + struct: EnumItem + Enum.KeyCode.KeypadPlus: + struct: EnumItem + Enum.KeyCode.KeypadSeven: + struct: EnumItem + Enum.KeyCode.KeypadSix: + struct: EnumItem + Enum.KeyCode.KeypadThree: + struct: EnumItem + Enum.KeyCode.KeypadTwo: + struct: EnumItem + Enum.KeyCode.KeypadZero: + struct: EnumItem + Enum.KeyCode.L: + struct: EnumItem + Enum.KeyCode.Left: + struct: EnumItem + Enum.KeyCode.LeftAlt: + struct: EnumItem + Enum.KeyCode.LeftBracket: + struct: EnumItem + Enum.KeyCode.LeftControl: + struct: EnumItem + Enum.KeyCode.LeftCurly: + struct: EnumItem + Enum.KeyCode.LeftMeta: + struct: EnumItem + Enum.KeyCode.LeftParenthesis: + struct: EnumItem + Enum.KeyCode.LeftShift: + struct: EnumItem + Enum.KeyCode.LeftSuper: + struct: EnumItem + Enum.KeyCode.LessThan: + struct: EnumItem + Enum.KeyCode.M: + struct: EnumItem + Enum.KeyCode.Menu: + struct: EnumItem + Enum.KeyCode.Minus: + struct: EnumItem + Enum.KeyCode.Mode: + struct: EnumItem + Enum.KeyCode.N: + struct: EnumItem + Enum.KeyCode.Nine: + struct: EnumItem + Enum.KeyCode.NumLock: + struct: EnumItem + Enum.KeyCode.O: + struct: EnumItem + Enum.KeyCode.One: + struct: EnumItem + Enum.KeyCode.P: + struct: EnumItem + Enum.KeyCode.PageDown: + struct: EnumItem + Enum.KeyCode.PageUp: + struct: EnumItem + Enum.KeyCode.Pause: + struct: EnumItem + Enum.KeyCode.Percent: + struct: EnumItem + Enum.KeyCode.Period: + struct: EnumItem + Enum.KeyCode.Pipe: + struct: EnumItem + Enum.KeyCode.Plus: + struct: EnumItem + Enum.KeyCode.Power: + struct: EnumItem + Enum.KeyCode.Print: + struct: EnumItem + Enum.KeyCode.Q: + struct: EnumItem + Enum.KeyCode.Question: + struct: EnumItem + Enum.KeyCode.Quote: + struct: EnumItem + Enum.KeyCode.QuotedDouble: + struct: EnumItem + Enum.KeyCode.R: + struct: EnumItem + Enum.KeyCode.Return: + struct: EnumItem + Enum.KeyCode.Right: + struct: EnumItem + Enum.KeyCode.RightAlt: + struct: EnumItem + Enum.KeyCode.RightBracket: + struct: EnumItem + Enum.KeyCode.RightControl: + struct: EnumItem + Enum.KeyCode.RightCurly: + struct: EnumItem + Enum.KeyCode.RightMeta: + struct: EnumItem + Enum.KeyCode.RightParenthesis: + struct: EnumItem + Enum.KeyCode.RightShift: + struct: EnumItem + Enum.KeyCode.RightSuper: + struct: EnumItem + Enum.KeyCode.S: + struct: EnumItem + Enum.KeyCode.ScrollLock: + struct: EnumItem + Enum.KeyCode.Semicolon: + struct: EnumItem + Enum.KeyCode.Seven: + struct: EnumItem + Enum.KeyCode.Six: + struct: EnumItem + Enum.KeyCode.Slash: + struct: EnumItem + Enum.KeyCode.Space: + struct: EnumItem + Enum.KeyCode.SysReq: + struct: EnumItem + Enum.KeyCode.T: + struct: EnumItem + Enum.KeyCode.Tab: + struct: EnumItem + Enum.KeyCode.Three: + struct: EnumItem + Enum.KeyCode.Thumbstick1: + struct: EnumItem + Enum.KeyCode.Thumbstick2: + struct: EnumItem + Enum.KeyCode.Tilde: + struct: EnumItem + Enum.KeyCode.Two: + struct: EnumItem + Enum.KeyCode.U: + struct: EnumItem + Enum.KeyCode.Underscore: + struct: EnumItem + Enum.KeyCode.Undo: + struct: EnumItem + Enum.KeyCode.Unknown: + struct: EnumItem + Enum.KeyCode.Up: + struct: EnumItem + Enum.KeyCode.V: + struct: EnumItem + Enum.KeyCode.W: + struct: EnumItem + Enum.KeyCode.World0: + struct: EnumItem + Enum.KeyCode.World1: + struct: EnumItem + Enum.KeyCode.World10: + struct: EnumItem + Enum.KeyCode.World11: + struct: EnumItem + Enum.KeyCode.World12: + struct: EnumItem + Enum.KeyCode.World13: + struct: EnumItem + Enum.KeyCode.World14: + struct: EnumItem + Enum.KeyCode.World15: + struct: EnumItem + Enum.KeyCode.World16: + struct: EnumItem + Enum.KeyCode.World17: + struct: EnumItem + Enum.KeyCode.World18: + struct: EnumItem + Enum.KeyCode.World19: + struct: EnumItem + Enum.KeyCode.World2: + struct: EnumItem + Enum.KeyCode.World20: + struct: EnumItem + Enum.KeyCode.World21: + struct: EnumItem + Enum.KeyCode.World22: + struct: EnumItem + Enum.KeyCode.World23: + struct: EnumItem + Enum.KeyCode.World24: + struct: EnumItem + Enum.KeyCode.World25: + struct: EnumItem + Enum.KeyCode.World26: + struct: EnumItem + Enum.KeyCode.World27: + struct: EnumItem + Enum.KeyCode.World28: + struct: EnumItem + Enum.KeyCode.World29: + struct: EnumItem + Enum.KeyCode.World3: + struct: EnumItem + Enum.KeyCode.World30: + struct: EnumItem + Enum.KeyCode.World31: + struct: EnumItem + Enum.KeyCode.World32: + struct: EnumItem + Enum.KeyCode.World33: + struct: EnumItem + Enum.KeyCode.World34: + struct: EnumItem + Enum.KeyCode.World35: + struct: EnumItem + Enum.KeyCode.World36: + struct: EnumItem + Enum.KeyCode.World37: + struct: EnumItem + Enum.KeyCode.World38: + struct: EnumItem + Enum.KeyCode.World39: + struct: EnumItem + Enum.KeyCode.World4: + struct: EnumItem + Enum.KeyCode.World40: + struct: EnumItem + Enum.KeyCode.World41: + struct: EnumItem + Enum.KeyCode.World42: + struct: EnumItem + Enum.KeyCode.World43: + struct: EnumItem + Enum.KeyCode.World44: + struct: EnumItem + Enum.KeyCode.World45: + struct: EnumItem + Enum.KeyCode.World46: + struct: EnumItem + Enum.KeyCode.World47: + struct: EnumItem + Enum.KeyCode.World48: + struct: EnumItem + Enum.KeyCode.World49: + struct: EnumItem + Enum.KeyCode.World5: + struct: EnumItem + Enum.KeyCode.World50: + struct: EnumItem + Enum.KeyCode.World51: + struct: EnumItem + Enum.KeyCode.World52: + struct: EnumItem + Enum.KeyCode.World53: + struct: EnumItem + Enum.KeyCode.World54: + struct: EnumItem + Enum.KeyCode.World55: + struct: EnumItem + Enum.KeyCode.World56: + struct: EnumItem + Enum.KeyCode.World57: + struct: EnumItem + Enum.KeyCode.World58: + struct: EnumItem + Enum.KeyCode.World59: + struct: EnumItem + Enum.KeyCode.World6: + struct: EnumItem + Enum.KeyCode.World60: + struct: EnumItem + Enum.KeyCode.World61: + struct: EnumItem + Enum.KeyCode.World62: + struct: EnumItem + Enum.KeyCode.World63: + struct: EnumItem + Enum.KeyCode.World64: + struct: EnumItem + Enum.KeyCode.World65: + struct: EnumItem + Enum.KeyCode.World66: + struct: EnumItem + Enum.KeyCode.World67: + struct: EnumItem + Enum.KeyCode.World68: + struct: EnumItem + Enum.KeyCode.World69: + struct: EnumItem + Enum.KeyCode.World7: + struct: EnumItem + Enum.KeyCode.World70: + struct: EnumItem + Enum.KeyCode.World71: + struct: EnumItem + Enum.KeyCode.World72: + struct: EnumItem + Enum.KeyCode.World73: + struct: EnumItem + Enum.KeyCode.World74: + struct: EnumItem + Enum.KeyCode.World75: + struct: EnumItem + Enum.KeyCode.World76: + struct: EnumItem + Enum.KeyCode.World77: + struct: EnumItem + Enum.KeyCode.World78: + struct: EnumItem + Enum.KeyCode.World79: + struct: EnumItem + Enum.KeyCode.World8: + struct: EnumItem + Enum.KeyCode.World80: + struct: EnumItem + Enum.KeyCode.World81: + struct: EnumItem + Enum.KeyCode.World82: + struct: EnumItem + Enum.KeyCode.World83: + struct: EnumItem + Enum.KeyCode.World84: + struct: EnumItem + Enum.KeyCode.World85: + struct: EnumItem + Enum.KeyCode.World86: + struct: EnumItem + Enum.KeyCode.World87: + struct: EnumItem + Enum.KeyCode.World88: + struct: EnumItem + Enum.KeyCode.World89: + struct: EnumItem + Enum.KeyCode.World9: + struct: EnumItem + Enum.KeyCode.World90: + struct: EnumItem + Enum.KeyCode.World91: + struct: EnumItem + Enum.KeyCode.World92: + struct: EnumItem + Enum.KeyCode.World93: + struct: EnumItem + Enum.KeyCode.World94: + struct: EnumItem + Enum.KeyCode.World95: + struct: EnumItem + Enum.KeyCode.X: + struct: EnumItem + Enum.KeyCode.Y: + struct: EnumItem + Enum.KeyCode.Z: + struct: EnumItem + Enum.KeyCode.Zero: + struct: EnumItem + Enum.KeyInterpolationMode.Constant: + struct: EnumItem + Enum.KeyInterpolationMode.Cubic: + struct: EnumItem + Enum.KeyInterpolationMode.GetEnumItems: + args: [] + method: true + Enum.KeyInterpolationMode.Linear: + struct: EnumItem + Enum.KeywordFilterType.Exclude: + struct: EnumItem + Enum.KeywordFilterType.GetEnumItems: + args: [] + method: true + Enum.KeywordFilterType.Include: + struct: EnumItem + Enum.LSPMethodType.CancelRequest: + struct: EnumItem + Enum.LSPMethodType.Completion: + struct: EnumItem + Enum.LSPMethodType.Declaration: + struct: EnumItem + Enum.LSPMethodType.DocumentSymbols: + struct: EnumItem + Enum.LSPMethodType.GetEnumItems: + args: [] + method: true + Enum.LSPMethodType.Initialize: + struct: EnumItem + Enum.LSPMethodType.Initialized: + struct: EnumItem + Enum.LSPMethodType.Roblox_findColor3: + struct: EnumItem + Enum.LSPMethodType.Roblox_findExecutablePosition: + struct: EnumItem + Enum.LSPMethodType.Roblox_patchSnippetData: + struct: EnumItem + Enum.LSPMethodType.Roblox_registerSyntaxCategories: + struct: EnumItem + Enum.LSPMethodType.Roblox_signalQuiescence: + struct: EnumItem + Enum.LSPMethodType.Roblox_suggestExtraSelections: + struct: EnumItem + Enum.LSPMethodType.Roblox_syntaxHighlight: + struct: EnumItem + Enum.LSPMethodType.ShutdownRequest: + struct: EnumItem + Enum.LSPMethodType.TextDocument_didChange: + struct: EnumItem + Enum.LSPMethodType.TextDocument_didClose: + struct: EnumItem + Enum.LSPMethodType.TextDocument_didOpen: + struct: EnumItem + Enum.LSPMethodType.TextDocument_foldingRange: + struct: EnumItem + Enum.LSPMethodType.TextDocument_formatting: + struct: EnumItem + Enum.LSPMethodType.TextDocument_hover: + struct: EnumItem + Enum.LSPMethodType.TextDocument_onTypeFormatting: + struct: EnumItem + Enum.LSPMethodType.TextDocument_publishDiagnostics: + struct: EnumItem + Enum.LSPMethodType.TextDocument_rangeFormatting: + struct: EnumItem + Enum.LSPMethodType.TextDocument_signatureHelp: + struct: EnumItem + Enum.LSPMethodType.Window_showMessage: + struct: EnumItem + Enum.LSPMethodType.Window_showMessageRequest: + struct: EnumItem + Enum.LSPMethodType.Workspace_DidChangeConfiguration: + struct: EnumItem + Enum.Language.Default: + struct: EnumItem + Enum.Language.GetEnumItems: + args: [] + method: true + Enum.LeftRight.Center: + struct: EnumItem + Enum.LeftRight.GetEnumItems: + args: [] + method: true + Enum.LeftRight.Left: + struct: EnumItem + Enum.LeftRight.Right: + struct: EnumItem + Enum.LevelOfDetailSetting.GetEnumItems: + args: [] + method: true + Enum.LevelOfDetailSetting.High: + struct: EnumItem + Enum.LevelOfDetailSetting.Low: + struct: EnumItem + Enum.LevelOfDetailSetting.Medium: + struct: EnumItem + Enum.Limb.GetEnumItems: + args: [] + method: true + Enum.Limb.Head: + struct: EnumItem + Enum.Limb.LeftArm: + struct: EnumItem + Enum.Limb.LeftLeg: + struct: EnumItem + Enum.Limb.RightArm: + struct: EnumItem + Enum.Limb.RightLeg: + struct: EnumItem + Enum.Limb.Torso: + struct: EnumItem + Enum.Limb.Unknown: + struct: EnumItem + Enum.LineJoinMode.Bevel: + struct: EnumItem + Enum.LineJoinMode.GetEnumItems: + args: [] + method: true + Enum.LineJoinMode.Miter: + struct: EnumItem + Enum.LineJoinMode.Round: + struct: EnumItem + Enum.ListDisplayMode.GetEnumItems: + args: [] + method: true + Enum.ListDisplayMode.Horizontal: + struct: EnumItem + Enum.ListDisplayMode.Vertical: + struct: EnumItem + Enum.ListenerType.CFrame: + struct: EnumItem + Enum.ListenerType.Camera: + struct: EnumItem + Enum.ListenerType.GetEnumItems: + args: [] + method: true + Enum.ListenerType.ObjectCFrame: + struct: EnumItem + Enum.ListenerType.ObjectPosition: + struct: EnumItem + Enum.LoadCharacterLayeredClothing.Default: + struct: EnumItem + Enum.LoadCharacterLayeredClothing.Disabled: + struct: EnumItem + Enum.LoadCharacterLayeredClothing.Enabled: + struct: EnumItem + Enum.LoadCharacterLayeredClothing.GetEnumItems: + args: [] + method: true + Enum.Material.Air: + struct: EnumItem + Enum.Material.Asphalt: + struct: EnumItem + Enum.Material.Basalt: + struct: EnumItem + Enum.Material.Brick: + struct: EnumItem + Enum.Material.Cobblestone: + struct: EnumItem + Enum.Material.Concrete: + struct: EnumItem + Enum.Material.CorrodedMetal: + struct: EnumItem + Enum.Material.CrackedLava: + struct: EnumItem + Enum.Material.DiamondPlate: + struct: EnumItem + Enum.Material.Fabric: + struct: EnumItem + Enum.Material.Foil: + struct: EnumItem + Enum.Material.ForceField: + struct: EnumItem + Enum.Material.GetEnumItems: + args: [] + method: true + Enum.Material.Glacier: + struct: EnumItem + Enum.Material.Glass: + struct: EnumItem + Enum.Material.Granite: + struct: EnumItem + Enum.Material.Grass: + struct: EnumItem + Enum.Material.Ground: + struct: EnumItem + Enum.Material.Ice: + struct: EnumItem + Enum.Material.LeafyGrass: + struct: EnumItem + Enum.Material.Limestone: + struct: EnumItem + Enum.Material.Marble: + struct: EnumItem + Enum.Material.Metal: + struct: EnumItem + Enum.Material.Mud: + struct: EnumItem + Enum.Material.Neon: + struct: EnumItem + Enum.Material.Pavement: + struct: EnumItem + Enum.Material.Pebble: + struct: EnumItem + Enum.Material.Plastic: + struct: EnumItem + Enum.Material.Rock: + struct: EnumItem + Enum.Material.Salt: + struct: EnumItem + Enum.Material.Sand: + struct: EnumItem + Enum.Material.Sandstone: + struct: EnumItem + Enum.Material.Slate: + struct: EnumItem + Enum.Material.SmoothPlastic: + struct: EnumItem + Enum.Material.Snow: + struct: EnumItem + Enum.Material.Water: + struct: EnumItem + Enum.Material.Wood: + struct: EnumItem + Enum.Material.WoodPlanks: + struct: EnumItem + Enum.MaterialPattern.GetEnumItems: + args: [] + method: true + Enum.MaterialPattern.Organic: + struct: EnumItem + Enum.MaterialPattern.Regular: + struct: EnumItem + Enum.MembershipType.BuildersClub: + struct: EnumItem + Enum.MembershipType.GetEnumItems: + args: [] + method: true + Enum.MembershipType.None: + struct: EnumItem + Enum.MembershipType.OutrageousBuildersClub: + struct: EnumItem + Enum.MembershipType.Premium: + struct: EnumItem + Enum.MembershipType.TurboBuildersClub: + struct: EnumItem + Enum.MeshPartDetailLevel.DistanceBased: + struct: EnumItem + Enum.MeshPartDetailLevel.GetEnumItems: + args: [] + method: true + Enum.MeshPartDetailLevel.Level01: + struct: EnumItem + Enum.MeshPartDetailLevel.Level02: + struct: EnumItem + Enum.MeshPartDetailLevel.Level03: + struct: EnumItem + Enum.MeshPartDetailLevel.Level04: + struct: EnumItem + Enum.MeshPartHeadsAndAccessories.Default: + struct: EnumItem + Enum.MeshPartHeadsAndAccessories.Disabled: + struct: EnumItem + Enum.MeshPartHeadsAndAccessories.Enabled: + struct: EnumItem + Enum.MeshPartHeadsAndAccessories.GetEnumItems: + args: [] + method: true + Enum.MeshScaleUnit.CM: + struct: EnumItem + Enum.MeshScaleUnit.Foot: + struct: EnumItem + Enum.MeshScaleUnit.GetEnumItems: + args: [] + method: true + Enum.MeshScaleUnit.Inch: + struct: EnumItem + Enum.MeshScaleUnit.MM: + struct: EnumItem + Enum.MeshScaleUnit.Meter: + struct: EnumItem + Enum.MeshScaleUnit.Stud: + struct: EnumItem + Enum.MeshType.Brick: + struct: EnumItem + Enum.MeshType.CornerWedge: + struct: EnumItem + Enum.MeshType.Cylinder: + struct: EnumItem + Enum.MeshType.FileMesh: + struct: EnumItem + Enum.MeshType.GetEnumItems: + args: [] + method: true + Enum.MeshType.Head: + struct: EnumItem + Enum.MeshType.ParallelRamp: + struct: EnumItem + Enum.MeshType.Prism: + struct: EnumItem + Enum.MeshType.Pyramid: + struct: EnumItem + Enum.MeshType.RightAngleRamp: + struct: EnumItem + Enum.MeshType.Sphere: + struct: EnumItem + Enum.MeshType.Torso: + struct: EnumItem + Enum.MeshType.Wedge: + struct: EnumItem + Enum.MessageType.GetEnumItems: + args: [] + method: true + Enum.MessageType.MessageError: + struct: EnumItem + Enum.MessageType.MessageInfo: + struct: EnumItem + Enum.MessageType.MessageOutput: + struct: EnumItem + Enum.MessageType.MessageWarning: + struct: EnumItem + Enum.ModelLevelOfDetail.Automatic: + struct: EnumItem + Enum.ModelLevelOfDetail.Disabled: + struct: EnumItem + Enum.ModelLevelOfDetail.GetEnumItems: + args: [] + method: true + Enum.ModelLevelOfDetail.StreamingMesh: + struct: EnumItem + Enum.ModifierKey.Alt: + struct: EnumItem + Enum.ModifierKey.Ctrl: + struct: EnumItem + Enum.ModifierKey.GetEnumItems: + args: [] + method: true + Enum.ModifierKey.Meta: + struct: EnumItem + Enum.ModifierKey.Shift: + struct: EnumItem + Enum.MouseBehavior.Default: + struct: EnumItem + Enum.MouseBehavior.GetEnumItems: + args: [] + method: true + Enum.MouseBehavior.LockCenter: + struct: EnumItem + Enum.MouseBehavior.LockCurrentPosition: + struct: EnumItem + Enum.MoveState.AirFree: + struct: EnumItem + Enum.MoveState.Coasting: + struct: EnumItem + Enum.MoveState.GetEnumItems: + args: [] + method: true + Enum.MoveState.Pushing: + struct: EnumItem + Enum.MoveState.Stopped: + struct: EnumItem + Enum.MoveState.Stopping: + struct: EnumItem + Enum.NameOcclusion.EnemyOcclusion: + struct: EnumItem + Enum.NameOcclusion.GetEnumItems: + args: [] + method: true + Enum.NameOcclusion.NoOcclusion: + struct: EnumItem + Enum.NameOcclusion.OccludeAll: + struct: EnumItem + Enum.NetworkOwnership.Automatic: + struct: EnumItem + Enum.NetworkOwnership.GetEnumItems: + args: [] + method: true + Enum.NetworkOwnership.Manual: + struct: EnumItem + Enum.NetworkOwnership.OnContact: + struct: EnumItem + Enum.NewAnimationRuntimeSetting.Default: + struct: EnumItem + Enum.NewAnimationRuntimeSetting.Disabled: + struct: EnumItem + Enum.NewAnimationRuntimeSetting.Enabled: + struct: EnumItem + Enum.NewAnimationRuntimeSetting.GetEnumItems: + args: [] + method: true + Enum.NormalId.Back: + struct: EnumItem + Enum.NormalId.Bottom: + struct: EnumItem + Enum.NormalId.Front: + struct: EnumItem + Enum.NormalId.GetEnumItems: + args: [] + method: true + Enum.NormalId.Left: + struct: EnumItem + Enum.NormalId.Right: + struct: EnumItem + Enum.NormalId.Top: + struct: EnumItem + Enum.OrientationAlignmentMode.GetEnumItems: + args: [] + method: true + Enum.OrientationAlignmentMode.OneAttachment: + struct: EnumItem + Enum.OrientationAlignmentMode.TwoAttachment: + struct: EnumItem + Enum.OutfitSource.All: + struct: EnumItem + Enum.OutfitSource.Created: + struct: EnumItem + Enum.OutfitSource.GetEnumItems: + args: [] + method: true + Enum.OutfitSource.Purchased: + struct: EnumItem + Enum.OutputLayoutMode.GetEnumItems: + args: [] + method: true + Enum.OutputLayoutMode.Horizontal: + struct: EnumItem + Enum.OutputLayoutMode.Vertical: + struct: EnumItem + Enum.OverrideMouseIconBehavior.ForceHide: + struct: EnumItem + Enum.OverrideMouseIconBehavior.ForceShow: + struct: EnumItem + Enum.OverrideMouseIconBehavior.GetEnumItems: + args: [] + method: true + Enum.OverrideMouseIconBehavior.None: + struct: EnumItem + Enum.PackagePermission.Edit: + struct: EnumItem + Enum.PackagePermission.GetEnumItems: + args: [] + method: true + Enum.PackagePermission.NoAccess: + struct: EnumItem + Enum.PackagePermission.None: + struct: EnumItem + Enum.PackagePermission.Own: + struct: EnumItem + Enum.PackagePermission.Revoked: + struct: EnumItem + Enum.PackagePermission.UseView: + struct: EnumItem + Enum.PartType.Ball: + struct: EnumItem + Enum.PartType.Block: + struct: EnumItem + Enum.PartType.Cylinder: + struct: EnumItem + Enum.PartType.GetEnumItems: + args: [] + method: true + Enum.ParticleEmitterShape.Box: + struct: EnumItem + Enum.ParticleEmitterShape.Cylinder: + struct: EnumItem + Enum.ParticleEmitterShape.Disc: + struct: EnumItem + Enum.ParticleEmitterShape.GetEnumItems: + args: [] + method: true + Enum.ParticleEmitterShape.Sphere: + struct: EnumItem + Enum.ParticleEmitterShapeInOut.GetEnumItems: + args: [] + method: true + Enum.ParticleEmitterShapeInOut.InAndOut: + struct: EnumItem + Enum.ParticleEmitterShapeInOut.Inward: + struct: EnumItem + Enum.ParticleEmitterShapeInOut.Outward: + struct: EnumItem + Enum.ParticleEmitterShapeStyle.GetEnumItems: + args: [] + method: true + Enum.ParticleEmitterShapeStyle.Surface: + struct: EnumItem + Enum.ParticleEmitterShapeStyle.Volume: + struct: EnumItem + Enum.ParticleFlipbookLayout.EightByEight: + struct: EnumItem + Enum.ParticleFlipbookLayout.FourByFour: + struct: EnumItem + Enum.ParticleFlipbookLayout.GetEnumItems: + args: [] + method: true + Enum.ParticleFlipbookLayout.None: + struct: EnumItem + Enum.ParticleFlipbookLayout.TwoByTwo: + struct: EnumItem + Enum.ParticleFlipbookMode.GetEnumItems: + args: [] + method: true + Enum.ParticleFlipbookMode.Loop: + struct: EnumItem + Enum.ParticleFlipbookMode.OneShot: + struct: EnumItem + Enum.ParticleFlipbookMode.PingPong: + struct: EnumItem + Enum.ParticleFlipbookMode.Random: + struct: EnumItem + Enum.ParticleOrientation.FacingCamera: + struct: EnumItem + Enum.ParticleOrientation.FacingCameraWorldUp: + struct: EnumItem + Enum.ParticleOrientation.GetEnumItems: + args: [] + method: true + Enum.ParticleOrientation.VelocityParallel: + struct: EnumItem + Enum.ParticleOrientation.VelocityPerpendicular: + struct: EnumItem + Enum.PathStatus.ClosestNoPath: + struct: EnumItem + Enum.PathStatus.ClosestOutOfRange: + struct: EnumItem + Enum.PathStatus.FailFinishNotEmpty: + struct: EnumItem + Enum.PathStatus.FailStartNotEmpty: + struct: EnumItem + Enum.PathStatus.GetEnumItems: + args: [] + method: true + Enum.PathStatus.NoPath: + struct: EnumItem + Enum.PathStatus.Success: + struct: EnumItem + Enum.PathWaypointAction.Custom: + struct: EnumItem + Enum.PathWaypointAction.GetEnumItems: + args: [] + method: true + Enum.PathWaypointAction.Jump: + struct: EnumItem + Enum.PathWaypointAction.Walk: + struct: EnumItem + Enum.PermissionLevelShown.Game: + struct: EnumItem + Enum.PermissionLevelShown.GetEnumItems: + args: [] + method: true + Enum.PermissionLevelShown.Roblox: + struct: EnumItem + Enum.PermissionLevelShown.RobloxGame: + struct: EnumItem + Enum.PermissionLevelShown.RobloxScript: + struct: EnumItem + Enum.PermissionLevelShown.Studio: + struct: EnumItem + Enum.PhysicsInertiaAndVolumeFix.Default: + struct: EnumItem + Enum.PhysicsInertiaAndVolumeFix.Disabled: + struct: EnumItem + Enum.PhysicsInertiaAndVolumeFix.Enabled: + struct: EnumItem + Enum.PhysicsInertiaAndVolumeFix.GetEnumItems: + args: [] + method: true + Enum.PhysicsSimulationRate.Fixed120Hz: + struct: EnumItem + Enum.PhysicsSimulationRate.Fixed240Hz: + struct: EnumItem + Enum.PhysicsSimulationRate.Fixed60Hz: + struct: EnumItem + Enum.PhysicsSimulationRate.GetEnumItems: + args: [] + method: true + Enum.PhysicsSteppingMethod.Adaptive: + struct: EnumItem + Enum.PhysicsSteppingMethod.Default: + struct: EnumItem + Enum.PhysicsSteppingMethod.Fixed: + struct: EnumItem + Enum.PhysicsSteppingMethod.GetEnumItems: + args: [] + method: true + Enum.Platform.Android: + struct: EnumItem + Enum.Platform.AndroidTV: + struct: EnumItem + Enum.Platform.BeOS: + struct: EnumItem + Enum.Platform.Chromecast: + struct: EnumItem + Enum.Platform.DOS: + struct: EnumItem + Enum.Platform.GetEnumItems: + args: [] + method: true + Enum.Platform.IOS: + struct: EnumItem + Enum.Platform.Linux: + struct: EnumItem + Enum.Platform.NX: + struct: EnumItem + Enum.Platform.None: + struct: EnumItem + Enum.Platform.OSX: + struct: EnumItem + Enum.Platform.Ouya: + struct: EnumItem + Enum.Platform.PS3: + struct: EnumItem + Enum.Platform.PS4: + struct: EnumItem + Enum.Platform.SteamOS: + struct: EnumItem + Enum.Platform.UWP: + struct: EnumItem + Enum.Platform.WebOS: + struct: EnumItem + Enum.Platform.WiiU: + struct: EnumItem + Enum.Platform.Windows: + struct: EnumItem + Enum.Platform.XBox360: + struct: EnumItem + Enum.Platform.XBoxOne: + struct: EnumItem + Enum.PlaybackState.Begin: + struct: EnumItem + Enum.PlaybackState.Cancelled: + struct: EnumItem + Enum.PlaybackState.Completed: + struct: EnumItem + Enum.PlaybackState.Delayed: + struct: EnumItem + Enum.PlaybackState.GetEnumItems: + args: [] + method: true + Enum.PlaybackState.Paused: + struct: EnumItem + Enum.PlaybackState.Playing: + struct: EnumItem + Enum.PlayerActions.CharacterBackward: + struct: EnumItem + Enum.PlayerActions.CharacterForward: + struct: EnumItem + Enum.PlayerActions.CharacterJump: + struct: EnumItem + Enum.PlayerActions.CharacterLeft: + struct: EnumItem + Enum.PlayerActions.CharacterRight: + struct: EnumItem + Enum.PlayerActions.GetEnumItems: + args: [] + method: true + Enum.PlayerChatType.All: + struct: EnumItem + Enum.PlayerChatType.GetEnumItems: + args: [] + method: true + Enum.PlayerChatType.Team: + struct: EnumItem + Enum.PlayerChatType.Whisper: + struct: EnumItem + Enum.PoseEasingDirection.GetEnumItems: + args: [] + method: true + Enum.PoseEasingDirection.In: + struct: EnumItem + Enum.PoseEasingDirection.InOut: + struct: EnumItem + Enum.PoseEasingDirection.Out: + struct: EnumItem + Enum.PoseEasingStyle.Bounce: + struct: EnumItem + Enum.PoseEasingStyle.Constant: + struct: EnumItem + Enum.PoseEasingStyle.Cubic: + struct: EnumItem + Enum.PoseEasingStyle.Elastic: + struct: EnumItem + Enum.PoseEasingStyle.GetEnumItems: + args: [] + method: true + Enum.PoseEasingStyle.Linear: + struct: EnumItem + Enum.PositionAlignmentMode.GetEnumItems: + args: [] + method: true + Enum.PositionAlignmentMode.OneAttachment: + struct: EnumItem + Enum.PositionAlignmentMode.TwoAttachment: + struct: EnumItem + Enum.PrivilegeType.Admin: + struct: EnumItem + Enum.PrivilegeType.Banned: + struct: EnumItem + Enum.PrivilegeType.GetEnumItems: + args: [] + method: true + Enum.PrivilegeType.Member: + struct: EnumItem + Enum.PrivilegeType.Owner: + struct: EnumItem + Enum.PrivilegeType.Visitor: + struct: EnumItem + Enum.ProductLocationRestriction.AllGames: + struct: EnumItem + Enum.ProductLocationRestriction.AllowedGames: + struct: EnumItem + Enum.ProductLocationRestriction.AvatarShop: + struct: EnumItem + Enum.ProductLocationRestriction.GetEnumItems: + args: [] + method: true + Enum.ProductPurchaseDecision.GetEnumItems: + args: [] + method: true + Enum.ProductPurchaseDecision.NotProcessedYet: + struct: EnumItem + Enum.ProductPurchaseDecision.PurchaseGranted: + struct: EnumItem + Enum.PropertyStatus.Error: + struct: EnumItem + Enum.PropertyStatus.GetEnumItems: + args: [] + method: true + Enum.PropertyStatus.Ok: + struct: EnumItem + Enum.PropertyStatus.Warning: + struct: EnumItem + Enum.ProximityPromptExclusivity.AlwaysShow: + struct: EnumItem + Enum.ProximityPromptExclusivity.GetEnumItems: + args: [] + method: true + Enum.ProximityPromptExclusivity.OneGlobally: + struct: EnumItem + Enum.ProximityPromptExclusivity.OnePerButton: + struct: EnumItem + Enum.ProximityPromptInputType.Gamepad: + struct: EnumItem + Enum.ProximityPromptInputType.GetEnumItems: + args: [] + method: true + Enum.ProximityPromptInputType.Keyboard: + struct: EnumItem + Enum.ProximityPromptInputType.Touch: + struct: EnumItem + Enum.ProximityPromptStyle.Custom: + struct: EnumItem + Enum.ProximityPromptStyle.Default: + struct: EnumItem + Enum.ProximityPromptStyle.GetEnumItems: + args: [] + method: true + Enum.QualityLevel.Automatic: + struct: EnumItem + Enum.QualityLevel.GetEnumItems: + args: [] + method: true + Enum.QualityLevel.Level01: + struct: EnumItem + Enum.QualityLevel.Level02: + struct: EnumItem + Enum.QualityLevel.Level03: + struct: EnumItem + Enum.QualityLevel.Level04: + struct: EnumItem + Enum.QualityLevel.Level05: + struct: EnumItem + Enum.QualityLevel.Level06: + struct: EnumItem + Enum.QualityLevel.Level07: + struct: EnumItem + Enum.QualityLevel.Level08: + struct: EnumItem + Enum.QualityLevel.Level09: + struct: EnumItem + Enum.QualityLevel.Level10: + struct: EnumItem + Enum.QualityLevel.Level11: + struct: EnumItem + Enum.QualityLevel.Level12: + struct: EnumItem + Enum.QualityLevel.Level13: + struct: EnumItem + Enum.QualityLevel.Level14: + struct: EnumItem + Enum.QualityLevel.Level15: + struct: EnumItem + Enum.QualityLevel.Level16: + struct: EnumItem + Enum.QualityLevel.Level17: + struct: EnumItem + Enum.QualityLevel.Level18: + struct: EnumItem + Enum.QualityLevel.Level19: + struct: EnumItem + Enum.QualityLevel.Level20: + struct: EnumItem + Enum.QualityLevel.Level21: + struct: EnumItem + Enum.R15CollisionType.GetEnumItems: + args: [] + method: true + Enum.R15CollisionType.InnerBox: + struct: EnumItem + Enum.R15CollisionType.OuterBox: + struct: EnumItem + Enum.RaycastFilterType.Blacklist: + struct: EnumItem + Enum.RaycastFilterType.GetEnumItems: + args: [] + method: true + Enum.RaycastFilterType.Whitelist: + struct: EnumItem + Enum.RenderFidelity.Automatic: + struct: EnumItem + Enum.RenderFidelity.GetEnumItems: + args: [] + method: true + Enum.RenderFidelity.Performance: + struct: EnumItem + Enum.RenderFidelity.Precise: + struct: EnumItem + Enum.RenderPriority.Camera: + struct: EnumItem + Enum.RenderPriority.Character: + struct: EnumItem + Enum.RenderPriority.First: + struct: EnumItem + Enum.RenderPriority.GetEnumItems: + args: [] + method: true + Enum.RenderPriority.Input: + struct: EnumItem + Enum.RenderPriority.Last: + struct: EnumItem + Enum.RenderingTestComparisonMethod.GetEnumItems: + args: [] + method: true + Enum.RenderingTestComparisonMethod.diff: + struct: EnumItem + Enum.RenderingTestComparisonMethod.psnr: + struct: EnumItem + Enum.ReplicateInstanceDestroySetting.Default: + struct: EnumItem + Enum.ReplicateInstanceDestroySetting.Disabled: + struct: EnumItem + Enum.ReplicateInstanceDestroySetting.Enabled: + struct: EnumItem + Enum.ReplicateInstanceDestroySetting.GetEnumItems: + args: [] + method: true + Enum.ResamplerMode.Default: + struct: EnumItem + Enum.ResamplerMode.GetEnumItems: + args: [] + method: true + Enum.ResamplerMode.Pixelated: + struct: EnumItem + Enum.ReturnKeyType.Default: + struct: EnumItem + Enum.ReturnKeyType.Done: + struct: EnumItem + Enum.ReturnKeyType.GetEnumItems: + args: [] + method: true + Enum.ReturnKeyType.Go: + struct: EnumItem + Enum.ReturnKeyType.Next: + struct: EnumItem + Enum.ReturnKeyType.Search: + struct: EnumItem + Enum.ReturnKeyType.Send: + struct: EnumItem + Enum.ReverbType.Alley: + struct: EnumItem + Enum.ReverbType.Arena: + struct: EnumItem + Enum.ReverbType.Auditorium: + struct: EnumItem + Enum.ReverbType.Bathroom: + struct: EnumItem + Enum.ReverbType.CarpettedHallway: + struct: EnumItem + Enum.ReverbType.Cave: + struct: EnumItem + Enum.ReverbType.City: + struct: EnumItem + Enum.ReverbType.ConcertHall: + struct: EnumItem + Enum.ReverbType.Forest: + struct: EnumItem + Enum.ReverbType.GenericReverb: + struct: EnumItem + Enum.ReverbType.GetEnumItems: + args: [] + method: true + Enum.ReverbType.Hallway: + struct: EnumItem + Enum.ReverbType.Hangar: + struct: EnumItem + Enum.ReverbType.LivingRoom: + struct: EnumItem + Enum.ReverbType.Mountains: + struct: EnumItem + Enum.ReverbType.NoReverb: + struct: EnumItem + Enum.ReverbType.PaddedCell: + struct: EnumItem + Enum.ReverbType.ParkingLot: + struct: EnumItem + Enum.ReverbType.Plain: + struct: EnumItem + Enum.ReverbType.Quarry: + struct: EnumItem + Enum.ReverbType.Room: + struct: EnumItem + Enum.ReverbType.SewerPipe: + struct: EnumItem + Enum.ReverbType.StoneCorridor: + struct: EnumItem + Enum.ReverbType.StoneRoom: + struct: EnumItem + Enum.ReverbType.UnderWater: + struct: EnumItem + Enum.RibbonTool.ColorPicker: + struct: EnumItem + Enum.RibbonTool.GetEnumItems: + args: [] + method: true + Enum.RibbonTool.Group: + struct: EnumItem + Enum.RibbonTool.MaterialPicker: + struct: EnumItem + Enum.RibbonTool.Move: + struct: EnumItem + Enum.RibbonTool.None: + struct: EnumItem + Enum.RibbonTool.Rotate: + struct: EnumItem + Enum.RibbonTool.Scale: + struct: EnumItem + Enum.RibbonTool.Select: + struct: EnumItem + Enum.RibbonTool.Transform: + struct: EnumItem + Enum.RibbonTool.Ungroup: + struct: EnumItem + Enum.RigType.Custom: + struct: EnumItem + Enum.RigType.GetEnumItems: + args: [] + method: true + Enum.RigType.None: + struct: EnumItem + Enum.RigType.R15: + struct: EnumItem + Enum.RigType.Rthro: + struct: EnumItem + Enum.RigType.RthroNarrow: + struct: EnumItem + Enum.RollOffMode.GetEnumItems: + args: [] + method: true + Enum.RollOffMode.Inverse: + struct: EnumItem + Enum.RollOffMode.InverseTapered: + struct: EnumItem + Enum.RollOffMode.Linear: + struct: EnumItem + Enum.RollOffMode.LinearSquare: + struct: EnumItem + Enum.RotationOrder.GetEnumItems: + args: [] + method: true + Enum.RotationOrder.XYZ: + struct: EnumItem + Enum.RotationOrder.XZY: + struct: EnumItem + Enum.RotationOrder.YXZ: + struct: EnumItem + Enum.RotationOrder.YZX: + struct: EnumItem + Enum.RotationOrder.ZXY: + struct: EnumItem + Enum.RotationOrder.ZYX: + struct: EnumItem + Enum.RotationType.CameraRelative: + struct: EnumItem + Enum.RotationType.GetEnumItems: + args: [] + method: true + Enum.RotationType.MovementRelative: + struct: EnumItem + Enum.RuntimeUndoBehavior.Aggregate: + struct: EnumItem + Enum.RuntimeUndoBehavior.GetEnumItems: + args: [] + method: true + Enum.RuntimeUndoBehavior.Hybrid: + struct: EnumItem + Enum.RuntimeUndoBehavior.Snapshot: + struct: EnumItem + Enum.SaveFilter.GetEnumItems: + args: [] + method: true + Enum.SaveFilter.SaveAll: + struct: EnumItem + Enum.SaveFilter.SaveGame: + struct: EnumItem + Enum.SaveFilter.SaveWorld: + struct: EnumItem + Enum.SavedQualitySetting.Automatic: + struct: EnumItem + Enum.SavedQualitySetting.GetEnumItems: + args: [] + method: true + Enum.SavedQualitySetting.QualityLevel1: + struct: EnumItem + Enum.SavedQualitySetting.QualityLevel10: + struct: EnumItem + Enum.SavedQualitySetting.QualityLevel2: + struct: EnumItem + Enum.SavedQualitySetting.QualityLevel3: + struct: EnumItem + Enum.SavedQualitySetting.QualityLevel4: + struct: EnumItem + Enum.SavedQualitySetting.QualityLevel5: + struct: EnumItem + Enum.SavedQualitySetting.QualityLevel6: + struct: EnumItem + Enum.SavedQualitySetting.QualityLevel7: + struct: EnumItem + Enum.SavedQualitySetting.QualityLevel8: + struct: EnumItem + Enum.SavedQualitySetting.QualityLevel9: + struct: EnumItem + Enum.ScaleType.Crop: + struct: EnumItem + Enum.ScaleType.Fit: + struct: EnumItem + Enum.ScaleType.GetEnumItems: + args: [] + method: true + Enum.ScaleType.Slice: + struct: EnumItem + Enum.ScaleType.Stretch: + struct: EnumItem + Enum.ScaleType.Tile: + struct: EnumItem + Enum.ScreenOrientation.GetEnumItems: + args: [] + method: true + Enum.ScreenOrientation.LandscapeLeft: + struct: EnumItem + Enum.ScreenOrientation.LandscapeRight: + struct: EnumItem + Enum.ScreenOrientation.LandscapeSensor: + struct: EnumItem + Enum.ScreenOrientation.Portrait: + struct: EnumItem + Enum.ScreenOrientation.Sensor: + struct: EnumItem + Enum.ScrollBarInset.Always: + struct: EnumItem + Enum.ScrollBarInset.GetEnumItems: + args: [] + method: true + Enum.ScrollBarInset.None: + struct: EnumItem + Enum.ScrollBarInset.ScrollBar: + struct: EnumItem + Enum.ScrollingDirection.GetEnumItems: + args: [] + method: true + Enum.ScrollingDirection.X: + struct: EnumItem + Enum.ScrollingDirection.XY: + struct: EnumItem + Enum.ScrollingDirection.Y: + struct: EnumItem + Enum.SelectionBehavior.Escape: + struct: EnumItem + Enum.SelectionBehavior.GetEnumItems: + args: [] + method: true + Enum.SelectionBehavior.Stop: + struct: EnumItem + Enum.ServerAudioBehavior.Enabled: + struct: EnumItem + Enum.ServerAudioBehavior.GetEnumItems: + args: [] + method: true + Enum.ServerAudioBehavior.Muted: + struct: EnumItem + Enum.ServerAudioBehavior.OnlineGame: + struct: EnumItem + Enum.SignalBehavior.AncestryDeferred: + struct: EnumItem + Enum.SignalBehavior.Default: + struct: EnumItem + Enum.SignalBehavior.Deferred: + struct: EnumItem + Enum.SignalBehavior.GetEnumItems: + args: [] + method: true + Enum.SignalBehavior.Immediate: + struct: EnumItem + Enum.SizeConstraint.GetEnumItems: + args: [] + method: true + Enum.SizeConstraint.RelativeXX: + struct: EnumItem + Enum.SizeConstraint.RelativeXY: + struct: EnumItem + Enum.SizeConstraint.RelativeYY: + struct: EnumItem + Enum.SortDirection.Ascending: + struct: EnumItem + Enum.SortDirection.Descending: + struct: EnumItem + Enum.SortDirection.GetEnumItems: + args: [] + method: true + Enum.SortOrder.Custom: + struct: EnumItem + Enum.SortOrder.GetEnumItems: + args: [] + method: true + Enum.SortOrder.LayoutOrder: + struct: EnumItem + Enum.SortOrder.Name: + struct: EnumItem + Enum.SpecialKey.ChatHotkey: + struct: EnumItem + Enum.SpecialKey.End: + struct: EnumItem + Enum.SpecialKey.GetEnumItems: + args: [] + method: true + Enum.SpecialKey.Home: + struct: EnumItem + Enum.SpecialKey.Insert: + struct: EnumItem + Enum.SpecialKey.PageDown: + struct: EnumItem + Enum.SpecialKey.PageUp: + struct: EnumItem + Enum.StartCorner.BottomLeft: + struct: EnumItem + Enum.StartCorner.BottomRight: + struct: EnumItem + Enum.StartCorner.GetEnumItems: + args: [] + method: true + Enum.StartCorner.TopLeft: + struct: EnumItem + Enum.StartCorner.TopRight: + struct: EnumItem + Enum.Status.Confusion: + struct: EnumItem + Enum.Status.GetEnumItems: + args: [] + method: true + Enum.Status.Poison: + struct: EnumItem + Enum.StreamOutBehavior.Default: + struct: EnumItem + Enum.StreamOutBehavior.GetEnumItems: + args: [] + method: true + Enum.StreamOutBehavior.LowMemory: + struct: EnumItem + Enum.StreamOutBehavior.Opportunistic: + struct: EnumItem + Enum.StreamingPauseMode.ClientPhysicsPause: + struct: EnumItem + Enum.StreamingPauseMode.Default: + struct: EnumItem + Enum.StreamingPauseMode.Disabled: + struct: EnumItem + Enum.StreamingPauseMode.GetEnumItems: + args: [] + method: true + Enum.StudioCloseMode.CloseDoc: + struct: EnumItem + Enum.StudioCloseMode.CloseStudio: + struct: EnumItem + Enum.StudioCloseMode.GetEnumItems: + args: [] + method: true + Enum.StudioCloseMode.None: + struct: EnumItem + Enum.StudioDataModelType.Edit: + struct: EnumItem + Enum.StudioDataModelType.GetEnumItems: + args: [] + method: true + Enum.StudioDataModelType.None: + struct: EnumItem + Enum.StudioDataModelType.PlayClient: + struct: EnumItem + Enum.StudioDataModelType.PlayServer: + struct: EnumItem + Enum.StudioDataModelType.Standalone: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.ActiveLine: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Background: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Bool: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Bracket: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Builtin: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Comment: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.DebuggerCurrentLine: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.DebuggerErrorLine: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Default: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.DocViewCodeBackground: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Error: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.FindSelectionBackground: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Function: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.FunctionName: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.GetEnumItems: + args: [] + method: true + Enum.StudioScriptEditorColorCategories.Keyword: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Local: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.LuauKeyword: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.MatchingWordBackground: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.MenuBackground: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.MenuBorder: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.MenuPrimaryText: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.MenuScrollbarBackground: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.MenuScrollbarHandle: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.MenuSecondaryText: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.MenuSelectedBackground: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.MenuSelectedText: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Method: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Nil: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Number: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Operator: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Property: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Ruler: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.SelectionBackground: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.SelectionText: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Self: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.String: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.TODO: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Warning: + struct: EnumItem + Enum.StudioScriptEditorColorCategories.Whitespace: + struct: EnumItem + Enum.StudioScriptEditorColorPresets.Custom: + struct: EnumItem + Enum.StudioScriptEditorColorPresets.Extra1: + struct: EnumItem + Enum.StudioScriptEditorColorPresets.Extra2: + struct: EnumItem + Enum.StudioScriptEditorColorPresets.GetEnumItems: + args: [] + method: true + Enum.StudioScriptEditorColorPresets.RobloxDefault: + struct: EnumItem + Enum.StudioStyleGuideColor.AttributeCog: + struct: EnumItem + Enum.StudioStyleGuideColor.Border: + struct: EnumItem + Enum.StudioStyleGuideColor.BrightText: + struct: EnumItem + Enum.StudioStyleGuideColor.Button: + struct: EnumItem + Enum.StudioStyleGuideColor.ButtonBorder: + struct: EnumItem + Enum.StudioStyleGuideColor.ButtonText: + struct: EnumItem + Enum.StudioStyleGuideColor.CategoryItem: + struct: EnumItem + Enum.StudioStyleGuideColor.ChatIncomingBgColor: + struct: EnumItem + Enum.StudioStyleGuideColor.ChatIncomingTextColor: + struct: EnumItem + Enum.StudioStyleGuideColor.ChatModeratedMessageColor: + struct: EnumItem + Enum.StudioStyleGuideColor.ChatOutgoingBgColor: + struct: EnumItem + Enum.StudioStyleGuideColor.ChatOutgoingTextColor: + struct: EnumItem + Enum.StudioStyleGuideColor.CheckedFieldBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.CheckedFieldBorder: + struct: EnumItem + Enum.StudioStyleGuideColor.CheckedFieldIndicator: + struct: EnumItem + Enum.StudioStyleGuideColor.ColorPickerFrame: + struct: EnumItem + Enum.StudioStyleGuideColor.CurrentMarker: + struct: EnumItem + Enum.StudioStyleGuideColor.Dark: + struct: EnumItem + Enum.StudioStyleGuideColor.DebuggerCurrentLine: + struct: EnumItem + Enum.StudioStyleGuideColor.DebuggerErrorLine: + struct: EnumItem + Enum.StudioStyleGuideColor.DialogButton: + struct: EnumItem + Enum.StudioStyleGuideColor.DialogButtonBorder: + struct: EnumItem + Enum.StudioStyleGuideColor.DialogButtonText: + struct: EnumItem + Enum.StudioStyleGuideColor.DialogMainButton: + struct: EnumItem + Enum.StudioStyleGuideColor.DialogMainButtonText: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffFilePathBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffFilePathBorder: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffFilePathText: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffLineNum: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffLineNumAdditionBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffLineNumDeletionBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffLineNumNoChangeBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffLineNumSeparatorBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffTextAddition: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffTextAdditionBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffTextDeletion: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffTextDeletionBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffTextHunkInfo: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffTextNoChange: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffTextNoChangeBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.DiffTextSeparatorBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.DimmedText: + struct: EnumItem + Enum.StudioStyleGuideColor.DocViewCodeBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.DropShadow: + struct: EnumItem + Enum.StudioStyleGuideColor.Dropdown: + struct: EnumItem + Enum.StudioStyleGuideColor.EmulatorBar: + struct: EnumItem + Enum.StudioStyleGuideColor.EmulatorDropDown: + struct: EnumItem + Enum.StudioStyleGuideColor.ErrorText: + struct: EnumItem + Enum.StudioStyleGuideColor.FilterButtonAccent: + struct: EnumItem + Enum.StudioStyleGuideColor.FilterButtonBorder: + struct: EnumItem + Enum.StudioStyleGuideColor.FilterButtonBorderAlt: + struct: EnumItem + Enum.StudioStyleGuideColor.FilterButtonChecked: + struct: EnumItem + Enum.StudioStyleGuideColor.FilterButtonDefault: + struct: EnumItem + Enum.StudioStyleGuideColor.FilterButtonHover: + struct: EnumItem + Enum.StudioStyleGuideColor.GameSettingsTableItem: + struct: EnumItem + Enum.StudioStyleGuideColor.GameSettingsTooltip: + struct: EnumItem + Enum.StudioStyleGuideColor.GetEnumItems: + args: [] + method: true + Enum.StudioStyleGuideColor.HeaderSection: + struct: EnumItem + Enum.StudioStyleGuideColor.InfoBarWarningBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.InfoBarWarningText: + struct: EnumItem + Enum.StudioStyleGuideColor.InfoText: + struct: EnumItem + Enum.StudioStyleGuideColor.InputFieldBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.InputFieldBorder: + struct: EnumItem + Enum.StudioStyleGuideColor.Item: + struct: EnumItem + Enum.StudioStyleGuideColor.Light: + struct: EnumItem + Enum.StudioStyleGuideColor.LinkText: + struct: EnumItem + Enum.StudioStyleGuideColor.MainBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.MainButton: + struct: EnumItem + Enum.StudioStyleGuideColor.MainText: + struct: EnumItem + Enum.StudioStyleGuideColor.Mid: + struct: EnumItem + Enum.StudioStyleGuideColor.Midlight: + struct: EnumItem + Enum.StudioStyleGuideColor.Notification: + struct: EnumItem + Enum.StudioStyleGuideColor.RibbonButton: + struct: EnumItem + Enum.StudioStyleGuideColor.RibbonTab: + struct: EnumItem + Enum.StudioStyleGuideColor.RibbonTabTopBar: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptBool: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptBracket: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptBuiltInFunction: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptComment: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptEditorCurrentLine: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptError: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptFindSelectionBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptFunction: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptFunctionName: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptKeyword: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptLocal: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptLuauKeyword: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptMatchingWordSelectionBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptMethod: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptNil: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptNumber: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptOperator: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptProperty: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptRuler: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptSelectionBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptSelectionText: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptSelf: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptSideWidget: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptString: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptText: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptTodo: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptWarning: + struct: EnumItem + Enum.StudioStyleGuideColor.ScriptWhitespace: + struct: EnumItem + Enum.StudioStyleGuideColor.ScrollBar: + struct: EnumItem + Enum.StudioStyleGuideColor.ScrollBarBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.SensitiveText: + struct: EnumItem + Enum.StudioStyleGuideColor.Separator: + struct: EnumItem + Enum.StudioStyleGuideColor.Shadow: + struct: EnumItem + Enum.StudioStyleGuideColor.StatusBar: + struct: EnumItem + Enum.StudioStyleGuideColor.SubText: + struct: EnumItem + Enum.StudioStyleGuideColor.Tab: + struct: EnumItem + Enum.StudioStyleGuideColor.TabBar: + struct: EnumItem + Enum.StudioStyleGuideColor.TableItem: + struct: EnumItem + Enum.StudioStyleGuideColor.Titlebar: + struct: EnumItem + Enum.StudioStyleGuideColor.TitlebarText: + struct: EnumItem + Enum.StudioStyleGuideColor.Tooltip: + struct: EnumItem + Enum.StudioStyleGuideColor.ViewPortBackground: + struct: EnumItem + Enum.StudioStyleGuideColor.WarningText: + struct: EnumItem + Enum.StudioStyleGuideModifier.Default: + struct: EnumItem + Enum.StudioStyleGuideModifier.Disabled: + struct: EnumItem + Enum.StudioStyleGuideModifier.GetEnumItems: + args: [] + method: true + Enum.StudioStyleGuideModifier.Hover: + struct: EnumItem + Enum.StudioStyleGuideModifier.Pressed: + struct: EnumItem + Enum.StudioStyleGuideModifier.Selected: + struct: EnumItem + Enum.Style.AlternatingSupports: + struct: EnumItem + Enum.Style.BridgeStyleSupports: + struct: EnumItem + Enum.Style.GetEnumItems: + args: [] + method: true + Enum.Style.NoSupports: + struct: EnumItem + Enum.SurfaceConstraint.GetEnumItems: + args: [] + method: true + Enum.SurfaceConstraint.Hinge: + struct: EnumItem + Enum.SurfaceConstraint.Motor: + struct: EnumItem + Enum.SurfaceConstraint.None: + struct: EnumItem + Enum.SurfaceConstraint.SteppingMotor: + struct: EnumItem + Enum.SurfaceGuiSizingMode.FixedSize: + struct: EnumItem + Enum.SurfaceGuiSizingMode.GetEnumItems: + args: [] + method: true + Enum.SurfaceGuiSizingMode.PixelsPerStud: + struct: EnumItem + Enum.SurfaceType.GetEnumItems: + args: [] + method: true + Enum.SurfaceType.Glue: + struct: EnumItem + Enum.SurfaceType.Hinge: + struct: EnumItem + Enum.SurfaceType.Inlet: + struct: EnumItem + Enum.SurfaceType.Motor: + struct: EnumItem + Enum.SurfaceType.Smooth: + struct: EnumItem + Enum.SurfaceType.SmoothNoOutlines: + struct: EnumItem + Enum.SurfaceType.SteppingMotor: + struct: EnumItem + Enum.SurfaceType.Studs: + struct: EnumItem + Enum.SurfaceType.Universal: + struct: EnumItem + Enum.SurfaceType.Weld: + struct: EnumItem + Enum.SwipeDirection.Down: + struct: EnumItem + Enum.SwipeDirection.GetEnumItems: + args: [] + method: true + Enum.SwipeDirection.Left: + struct: EnumItem + Enum.SwipeDirection.None: + struct: EnumItem + Enum.SwipeDirection.Right: + struct: EnumItem + Enum.SwipeDirection.Up: + struct: EnumItem + Enum.TableMajorAxis.ColumnMajor: + struct: EnumItem + Enum.TableMajorAxis.GetEnumItems: + args: [] + method: true + Enum.TableMajorAxis.RowMajor: + struct: EnumItem + Enum.Technology.Compatibility: + struct: EnumItem + Enum.Technology.Future: + struct: EnumItem + Enum.Technology.GetEnumItems: + args: [] + method: true + Enum.Technology.Legacy: + struct: EnumItem + Enum.Technology.ShadowMap: + struct: EnumItem + Enum.Technology.Voxel: + struct: EnumItem + Enum.TeleportMethod.GetEnumItems: + args: [] + method: true + Enum.TeleportMethod.TeleportPartyAsync: + struct: EnumItem + Enum.TeleportMethod.TeleportToPlaceInstance: + struct: EnumItem + Enum.TeleportMethod.TeleportToPrivateServer: + struct: EnumItem + Enum.TeleportMethod.TeleportToSpawnByName: + struct: EnumItem + Enum.TeleportMethod.TeleportUnknown: + struct: EnumItem + Enum.TeleportResult.Failure: + struct: EnumItem + Enum.TeleportResult.Flooded: + struct: EnumItem + Enum.TeleportResult.GameEnded: + struct: EnumItem + Enum.TeleportResult.GameFull: + struct: EnumItem + Enum.TeleportResult.GameNotFound: + struct: EnumItem + Enum.TeleportResult.GetEnumItems: + args: [] + method: true + Enum.TeleportResult.IsTeleporting: + struct: EnumItem + Enum.TeleportResult.Success: + struct: EnumItem + Enum.TeleportResult.Unauthorized: + struct: EnumItem + Enum.TeleportState.Failed: + struct: EnumItem + Enum.TeleportState.GetEnumItems: + args: [] + method: true + Enum.TeleportState.InProgress: + struct: EnumItem + Enum.TeleportState.RequestedFromServer: + struct: EnumItem + Enum.TeleportState.Started: + struct: EnumItem + Enum.TeleportState.WaitingForServer: + struct: EnumItem + Enum.TeleportType.GetEnumItems: + args: [] + method: true + Enum.TeleportType.ToInstance: + struct: EnumItem + Enum.TeleportType.ToPlace: + struct: EnumItem + Enum.TeleportType.ToReservedServer: + struct: EnumItem + Enum.TerrainAcquisitionMethod.Convert: + struct: EnumItem + Enum.TerrainAcquisitionMethod.EditAddTool: + struct: EnumItem + Enum.TerrainAcquisitionMethod.EditReplaceTool: + struct: EnumItem + Enum.TerrainAcquisitionMethod.EditSeaLevelTool: + struct: EnumItem + Enum.TerrainAcquisitionMethod.Generate: + struct: EnumItem + Enum.TerrainAcquisitionMethod.GetEnumItems: + args: [] + method: true + Enum.TerrainAcquisitionMethod.Import: + struct: EnumItem + Enum.TerrainAcquisitionMethod.Legacy: + struct: EnumItem + Enum.TerrainAcquisitionMethod.None: + struct: EnumItem + Enum.TerrainAcquisitionMethod.Other: + struct: EnumItem + Enum.TerrainAcquisitionMethod.RegionFillTool: + struct: EnumItem + Enum.TerrainAcquisitionMethod.RegionPasteTool: + struct: EnumItem + Enum.TerrainAcquisitionMethod.Template: + struct: EnumItem + Enum.TerrainFace.Bottom: + struct: EnumItem + Enum.TerrainFace.GetEnumItems: + args: [] + method: true + Enum.TerrainFace.Side: + struct: EnumItem + Enum.TerrainFace.Top: + struct: EnumItem + Enum.TextChatMessageStatus.Floodchecked: + struct: EnumItem + Enum.TextChatMessageStatus.GetEnumItems: + args: [] + method: true + Enum.TextChatMessageStatus.InvalidPrivacySettings: + struct: EnumItem + Enum.TextChatMessageStatus.InvalidTextChannelPermissions: + struct: EnumItem + Enum.TextChatMessageStatus.MessageTooLong: + struct: EnumItem + Enum.TextChatMessageStatus.Sending: + struct: EnumItem + Enum.TextChatMessageStatus.Success: + struct: EnumItem + Enum.TextChatMessageStatus.TextFilterFailed: + struct: EnumItem + Enum.TextChatMessageStatus.Unknown: + struct: EnumItem + Enum.TextFilterContext.GetEnumItems: + args: [] + method: true + Enum.TextFilterContext.PrivateChat: + struct: EnumItem + Enum.TextFilterContext.PublicChat: + struct: EnumItem + Enum.TextInputType.Default: + struct: EnumItem + Enum.TextInputType.Email: + struct: EnumItem + Enum.TextInputType.GetEnumItems: + args: [] + method: true + Enum.TextInputType.NoSuggestions: + struct: EnumItem + Enum.TextInputType.Number: + struct: EnumItem + Enum.TextInputType.OneTimePassword: + struct: EnumItem + Enum.TextInputType.Password: + struct: EnumItem + Enum.TextInputType.PasswordShown: + struct: EnumItem + Enum.TextInputType.Phone: + struct: EnumItem + Enum.TextInputType.Username: + struct: EnumItem + Enum.TextTruncate.AtEnd: + struct: EnumItem + Enum.TextTruncate.GetEnumItems: + args: [] + method: true + Enum.TextTruncate.None: + struct: EnumItem + Enum.TextXAlignment.Center: + struct: EnumItem + Enum.TextXAlignment.GetEnumItems: + args: [] + method: true + Enum.TextXAlignment.Left: + struct: EnumItem + Enum.TextXAlignment.Right: + struct: EnumItem + Enum.TextYAlignment.Bottom: + struct: EnumItem + Enum.TextYAlignment.Center: + struct: EnumItem + Enum.TextYAlignment.GetEnumItems: + args: [] + method: true + Enum.TextYAlignment.Top: + struct: EnumItem + Enum.TextureMode.GetEnumItems: + args: [] + method: true + Enum.TextureMode.Static: + struct: EnumItem + Enum.TextureMode.Stretch: + struct: EnumItem + Enum.TextureMode.Wrap: + struct: EnumItem + Enum.TextureQueryType.GetEnumItems: + args: [] + method: true + Enum.TextureQueryType.Humanoid: + struct: EnumItem + Enum.TextureQueryType.HumanoidOrphaned: + struct: EnumItem + Enum.TextureQueryType.NonHumanoid: + struct: EnumItem + Enum.TextureQueryType.NonHumanoidOrphaned: + struct: EnumItem + Enum.ThreadPoolConfig.Auto: + struct: EnumItem + Enum.ThreadPoolConfig.GetEnumItems: + args: [] + method: true + Enum.ThreadPoolConfig.PerCore1: + struct: EnumItem + Enum.ThreadPoolConfig.PerCore2: + struct: EnumItem + Enum.ThreadPoolConfig.PerCore3: + struct: EnumItem + Enum.ThreadPoolConfig.PerCore4: + struct: EnumItem + Enum.ThreadPoolConfig.Threads1: + struct: EnumItem + Enum.ThreadPoolConfig.Threads16: + struct: EnumItem + Enum.ThreadPoolConfig.Threads2: + struct: EnumItem + Enum.ThreadPoolConfig.Threads3: + struct: EnumItem + Enum.ThreadPoolConfig.Threads4: + struct: EnumItem + Enum.ThreadPoolConfig.Threads8: + struct: EnumItem + Enum.ThrottlingPriority.Default: + struct: EnumItem + Enum.ThrottlingPriority.ElevatedOnServer: + struct: EnumItem + Enum.ThrottlingPriority.Extreme: + struct: EnumItem + Enum.ThrottlingPriority.GetEnumItems: + args: [] + method: true + Enum.ThumbnailSize.GetEnumItems: + args: [] + method: true + Enum.ThumbnailSize.Size100x100: + struct: EnumItem + Enum.ThumbnailSize.Size150x150: + struct: EnumItem + Enum.ThumbnailSize.Size180x180: + struct: EnumItem + Enum.ThumbnailSize.Size352x352: + struct: EnumItem + Enum.ThumbnailSize.Size420x420: + struct: EnumItem + Enum.ThumbnailSize.Size48x48: + struct: EnumItem + Enum.ThumbnailSize.Size60x60: + struct: EnumItem + Enum.ThumbnailType.AvatarBust: + struct: EnumItem + Enum.ThumbnailType.AvatarThumbnail: + struct: EnumItem + Enum.ThumbnailType.GetEnumItems: + args: [] + method: true + Enum.ThumbnailType.HeadShot: + struct: EnumItem + Enum.TickCountSampleMethod.Benchmark: + struct: EnumItem + Enum.TickCountSampleMethod.Fast: + struct: EnumItem + Enum.TickCountSampleMethod.GetEnumItems: + args: [] + method: true + Enum.TickCountSampleMethod.Precise: + struct: EnumItem + Enum.TopBottom.Bottom: + struct: EnumItem + Enum.TopBottom.Center: + struct: EnumItem + Enum.TopBottom.GetEnumItems: + args: [] + method: true + Enum.TopBottom.Top: + struct: EnumItem + Enum.TouchCameraMovementMode.Classic: + struct: EnumItem + Enum.TouchCameraMovementMode.Default: + struct: EnumItem + Enum.TouchCameraMovementMode.Follow: + struct: EnumItem + Enum.TouchCameraMovementMode.GetEnumItems: + args: [] + method: true + Enum.TouchCameraMovementMode.Orbital: + struct: EnumItem + Enum.TouchMovementMode.ClickToMove: + struct: EnumItem + Enum.TouchMovementMode.DPad: + struct: EnumItem + Enum.TouchMovementMode.Default: + struct: EnumItem + Enum.TouchMovementMode.DynamicThumbstick: + struct: EnumItem + Enum.TouchMovementMode.GetEnumItems: + args: [] + method: true + Enum.TouchMovementMode.Thumbpad: + struct: EnumItem + Enum.TouchMovementMode.Thumbstick: + struct: EnumItem + Enum.TriStateBoolean.False: + struct: EnumItem + Enum.TriStateBoolean.GetEnumItems: + args: [] + method: true + Enum.TriStateBoolean.True: + struct: EnumItem + Enum.TriStateBoolean.Unknown: + struct: EnumItem + Enum.TweenStatus.Canceled: + struct: EnumItem + Enum.TweenStatus.Completed: + struct: EnumItem + Enum.TweenStatus.GetEnumItems: + args: [] + method: true + Enum.UITheme.Dark: + struct: EnumItem + Enum.UITheme.GetEnumItems: + args: [] + method: true + Enum.UITheme.Light: + struct: EnumItem + Enum.UiMessageType.GetEnumItems: + args: [] + method: true + Enum.UiMessageType.UiMessageError: + struct: EnumItem + Enum.UiMessageType.UiMessageInfo: + struct: EnumItem + Enum.UsageContext.Default: + struct: EnumItem + Enum.UsageContext.GetEnumItems: + args: [] + method: true + Enum.UsageContext.Preview: + struct: EnumItem + Enum.UserCFrame.GetEnumItems: + args: [] + method: true + Enum.UserCFrame.Head: + struct: EnumItem + Enum.UserCFrame.LeftHand: + struct: EnumItem + Enum.UserCFrame.RightHand: + struct: EnumItem + Enum.UserInputState.Begin: + struct: EnumItem + Enum.UserInputState.Cancel: + struct: EnumItem + Enum.UserInputState.Change: + struct: EnumItem + Enum.UserInputState.End: + struct: EnumItem + Enum.UserInputState.GetEnumItems: + args: [] + method: true + Enum.UserInputState.None: + struct: EnumItem + Enum.UserInputType.Accelerometer: + struct: EnumItem + Enum.UserInputType.Focus: + struct: EnumItem + Enum.UserInputType.Gamepad1: + struct: EnumItem + Enum.UserInputType.Gamepad2: + struct: EnumItem + Enum.UserInputType.Gamepad3: + struct: EnumItem + Enum.UserInputType.Gamepad4: + struct: EnumItem + Enum.UserInputType.Gamepad5: + struct: EnumItem + Enum.UserInputType.Gamepad6: + struct: EnumItem + Enum.UserInputType.Gamepad7: + struct: EnumItem + Enum.UserInputType.Gamepad8: + struct: EnumItem + Enum.UserInputType.GetEnumItems: + args: [] + method: true + Enum.UserInputType.Gyro: + struct: EnumItem + Enum.UserInputType.InputMethod: + struct: EnumItem + Enum.UserInputType.Keyboard: + struct: EnumItem + Enum.UserInputType.MouseButton1: + struct: EnumItem + Enum.UserInputType.MouseButton2: + struct: EnumItem + Enum.UserInputType.MouseButton3: + struct: EnumItem + Enum.UserInputType.MouseMovement: + struct: EnumItem + Enum.UserInputType.MouseWheel: + struct: EnumItem + Enum.UserInputType.None: + struct: EnumItem + Enum.UserInputType.TextInput: + struct: EnumItem + Enum.UserInputType.Touch: + struct: EnumItem + Enum.VRTouchpad.GetEnumItems: + args: [] + method: true + Enum.VRTouchpad.Left: + struct: EnumItem + Enum.VRTouchpad.Right: + struct: EnumItem + Enum.VRTouchpadMode.ABXY: + struct: EnumItem + Enum.VRTouchpadMode.GetEnumItems: + args: [] + method: true + Enum.VRTouchpadMode.Touch: + struct: EnumItem + Enum.VRTouchpadMode.VirtualThumbstick: + struct: EnumItem + Enum.VelocityConstraintMode.GetEnumItems: + args: [] + method: true + Enum.VelocityConstraintMode.Line: + struct: EnumItem + Enum.VelocityConstraintMode.Plane: + struct: EnumItem + Enum.VelocityConstraintMode.Vector: + struct: EnumItem + Enum.VerticalAlignment.Bottom: + struct: EnumItem + Enum.VerticalAlignment.Center: + struct: EnumItem + Enum.VerticalAlignment.GetEnumItems: + args: [] + method: true + Enum.VerticalAlignment.Top: + struct: EnumItem + Enum.VerticalScrollBarPosition.GetEnumItems: + args: [] + method: true + Enum.VerticalScrollBarPosition.Left: + struct: EnumItem + Enum.VerticalScrollBarPosition.Right: + struct: EnumItem + Enum.VibrationMotor.GetEnumItems: + args: [] + method: true + Enum.VibrationMotor.Large: + struct: EnumItem + Enum.VibrationMotor.LeftHand: + struct: EnumItem + Enum.VibrationMotor.LeftTrigger: + struct: EnumItem + Enum.VibrationMotor.RightHand: + struct: EnumItem + Enum.VibrationMotor.RightTrigger: + struct: EnumItem + Enum.VibrationMotor.Small: + struct: EnumItem + Enum.VirtualCursorMode.Default: + struct: EnumItem + Enum.VirtualCursorMode.Disabled: + struct: EnumItem + Enum.VirtualCursorMode.Enabled: + struct: EnumItem + Enum.VirtualCursorMode.GetEnumItems: + args: [] + method: true + Enum.VirtualInputMode.GetEnumItems: + args: [] + method: true + Enum.VirtualInputMode.None: + struct: EnumItem + Enum.VirtualInputMode.Playing: + struct: EnumItem + Enum.VirtualInputMode.Recording: + struct: EnumItem + Enum.VoiceChatState.Ended: + struct: EnumItem + Enum.VoiceChatState.Failed: + struct: EnumItem + Enum.VoiceChatState.GetEnumItems: + args: [] + method: true + Enum.VoiceChatState.Idle: + struct: EnumItem + Enum.VoiceChatState.Joined: + struct: EnumItem + Enum.VoiceChatState.Joining: + struct: EnumItem + Enum.VoiceChatState.JoiningRetry: + struct: EnumItem + Enum.VoiceChatState.Leaving: + struct: EnumItem + Enum.WaterDirection.GetEnumItems: + args: [] + method: true + Enum.WaterDirection.NegX: + struct: EnumItem + Enum.WaterDirection.NegY: + struct: EnumItem + Enum.WaterDirection.NegZ: + struct: EnumItem + Enum.WaterDirection.X: + struct: EnumItem + Enum.WaterDirection.Y: + struct: EnumItem + Enum.WaterDirection.Z: + struct: EnumItem + Enum.WaterForce.GetEnumItems: + args: [] + method: true + Enum.WaterForce.Max: + struct: EnumItem + Enum.WaterForce.Medium: + struct: EnumItem + Enum.WaterForce.None: + struct: EnumItem + Enum.WaterForce.Small: + struct: EnumItem + Enum.WaterForce.Strong: + struct: EnumItem + Enum.WrapLayerAutoSkin.Disabled: + struct: EnumItem + Enum.WrapLayerAutoSkin.EnabledOverride: + struct: EnumItem + Enum.WrapLayerAutoSkin.EnabledPreserve: + struct: EnumItem + Enum.WrapLayerAutoSkin.GetEnumItems: + args: [] + method: true + Enum.WrapLayerDebugMode.BoundCage: + struct: EnumItem + Enum.WrapLayerDebugMode.BoundCageAndLinks: + struct: EnumItem + Enum.WrapLayerDebugMode.GetEnumItems: + args: [] + method: true + Enum.WrapLayerDebugMode.HSRInner: + struct: EnumItem + Enum.WrapLayerDebugMode.HSRInnerReverse: + struct: EnumItem + Enum.WrapLayerDebugMode.HSROuter: + struct: EnumItem + Enum.WrapLayerDebugMode.HSROuterDetail: + struct: EnumItem + Enum.WrapLayerDebugMode.LayerCage: + struct: EnumItem + Enum.WrapLayerDebugMode.None: + struct: EnumItem + Enum.WrapLayerDebugMode.OuterCage: + struct: EnumItem + Enum.WrapLayerDebugMode.Rbf: + struct: EnumItem + Enum.WrapLayerDebugMode.Reference: + struct: EnumItem + Enum.WrapLayerDebugMode.ReferenceMeshAfterMorph: + struct: EnumItem + Enum.WrapTargetDebugMode.GetEnumItems: + args: [] + method: true + Enum.WrapTargetDebugMode.None: + struct: EnumItem + Enum.WrapTargetDebugMode.OuterCageDetail: + struct: EnumItem + Enum.WrapTargetDebugMode.Rbf: + struct: EnumItem + Enum.WrapTargetDebugMode.TargetCageCompressed: + struct: EnumItem + Enum.WrapTargetDebugMode.TargetCageInterface: + struct: EnumItem + Enum.WrapTargetDebugMode.TargetCageOriginal: + struct: EnumItem + Enum.WrapTargetDebugMode.TargetLayerCageCompressed: + struct: EnumItem + Enum.WrapTargetDebugMode.TargetLayerCageOriginal: + struct: EnumItem + Enum.WrapTargetDebugMode.TargetLayerInterface: + struct: EnumItem + Enum.ZIndexBehavior.GetEnumItems: + args: [] + method: true + Enum.ZIndexBehavior.Global: + struct: EnumItem + Enum.ZIndexBehavior.Sibling: + struct: EnumItem + Faces.new: + args: + - type: "..." + Instance.Lock: + args: + - type: "..." + Instance.Unlock: + args: + - type: "..." + Instance.new: + args: + - type: + - Accoutrement + - Accessory + - Hat + - AdvancedDragger + - AnalyticsService + - Animation + - CurveAnimation + - KeyframeSequence + - AnimationController + - AnimationRigData + - Animator + - Atmosphere + - Attachment + - Bone + - Backpack + - HopperBin + - Tool + - Flag + - WrapLayer + - WrapTarget + - Beam + - BindableEvent + - BindableFunction + - BodyAngularVelocity + - BodyForce + - BodyGyro + - BodyPosition + - BodyThrust + - BodyVelocity + - RocketPropulsion + - Breakpoint + - Camera + - BodyColors + - CharacterMesh + - Pants + - Shirt + - ShirtGraphic + - Skin + - ClickDetector + - Clouds + - Configuration + - AlignOrientation + - AlignPosition + - AngularVelocity + - BallSocketConstraint + - HingeConstraint + - LineForce + - LinearVelocity + - PlaneConstraint + - Plane + - RigidConstraint + - RodConstraint + - RopeConstraint + - CylindricalConstraint + - PrismaticConstraint + - SpringConstraint + - Torque + - TorsionSpringConstraint + - UniversalConstraint + - VectorForce + - HumanoidController + - SkateboardController + - VehicleController + - CustomEvent + - CustomEventReceiver + - BlockMesh + - CylinderMesh + - FileMesh + - SpecialMesh + - DataStoreIncrementOptions + - DataStoreOptions + - DataStoreSetOptions + - DebuggerWatch + - Dialog + - DialogChoice + - Dragger + - EulerRotationCurve + - Explosion + - FaceControls + - Decal + - Texture + - Hole + - MotorFeature + - Fire + - FloatCurve + - FlyweightService + - CSGDictionaryService + - NonReplicatedCSGDictionaryService + - Folder + - ForceField + - FunctionalTest + - GetTextBoundsParams + - CanvasGroup + - Frame + - ImageButton + - TextButton + - ImageLabel + - TextLabel + - ScrollingFrame + - TextBox + - VideoFrame + - ViewportFrame + - BillboardGui + - ScreenGui + - GuiMain + - SurfaceGui + - FloorWire + - SelectionBox + - BoxHandleAdornment + - ConeHandleAdornment + - CylinderHandleAdornment + - ImageHandleAdornment + - LineHandleAdornment + - SphereHandleAdornment + - ParabolaAdornment + - SelectionSphere + - ArcHandles + - Handles + - SurfaceSelection + - SelectionPartLasso + - SelectionPointLasso + - HeightmapImporterService + - HiddenSurfaceRemovalAsset + - Highlight + - Humanoid + - HumanoidDescription + - RotateP + - RotateV + - Glue + - ManualGlue + - ManualWeld + - Motor + - Motor6D + - Rotate + - Snap + - VelocityMotor + - Weld + - Keyframe + - KeyframeMarker + - PointLight + - SpotLight + - SurfaceLight + - LocalizationTable + - Script + - LocalScript + - ModuleScript + - MarkerCurve + - MaterialVariant + - MemoryStoreService + - Message + - Hint + - NoCollisionConstraint + - CornerWedgePart + - Part + - FlagStand + - Seat + - SkateboardPlatform + - SpawnLocation + - WedgePart + - MeshPart + - PartOperation + - NegateOperation + - UnionOperation + - TrussPart + - VehicleSeat + - Model + - Actor + - WorldModel + - PartOperationAsset + - ParticleEmitter + - PathfindingLink + - PathfindingModifier + - Player + - PluginAction + - NumberPose + - Pose + - BloomEffect + - BlurEffect + - ColorCorrectionEffect + - DepthOfFieldEffect + - SunRaysEffect + - ProximityPrompt + - ProximityPromptService + - ReflectionMetadata + - ReflectionMetadataCallbacks + - ReflectionMetadataClasses + - ReflectionMetadataEnums + - ReflectionMetadataEvents + - ReflectionMetadataFunctions + - ReflectionMetadataClass + - ReflectionMetadataEnum + - ReflectionMetadataEnumItem + - ReflectionMetadataMember + - ReflectionMetadataProperties + - ReflectionMetadataYieldFunctions + - RemoteEvent + - RemoteFunction + - RenderingTest + - RotationCurve + - Sky + - Smoke + - Sound + - ChorusSoundEffect + - CompressorSoundEffect + - ChannelSelectorSoundEffect + - DistortionSoundEffect + - EchoSoundEffect + - EqualizerSoundEffect + - FlangeSoundEffect + - PitchShiftSoundEffect + - ReverbSoundEffect + - TremoloSoundEffect + - SoundGroup + - Sparkles + - Speaker + - StandalonePluginScripts + - StarterGear + - SurfaceAppearance + - Team + - TeleportOptions + - TerrainDetail + - TerrainRegion + - TestService + - TextChannel + - TextChatCommand + - TextChatMessageProperties + - TrackerStreamAnimation + - Trail + - Tween + - UIAspectRatioConstraint + - UISizeConstraint + - UITextSizeConstraint + - UICorner + - UIGradient + - UIGridLayout + - UIListLayout + - UIPageLayout + - UITableLayout + - UIPadding + - UIScale + - UIStroke + - BinaryStringValue + - BoolValue + - BrickColorValue + - CFrameValue + - Color3Value + - DoubleConstrainedValue + - IntConstrainedValue + - IntValue + - NumberValue + - ObjectValue + - RayValue + - StringValue + - Vector3Value + - Vector3Curve + - VirtualInputManager + - VoiceChannel + - WeldConstraint + NumberRange.new: + args: + - type: number + - required: false + type: number + NumberSequence.new: + args: + - type: any + - required: false + type: number + NumberSequenceKeypoint.new: + args: + - type: number + - type: number + - required: false + type: number + OverlapParams.new: + args: [] + PathWaypoint.new: + args: + - required: false + type: + display: Vector3 + - required: false + type: + display: PathWaypointAction + PhysicalProperties.new: + args: + - type: any + - required: false + type: number + - required: false + type: number + - required: false + type: number + - required: false + type: number + Random.new: + args: + - required: false + type: number + Ray.new: + args: + - type: + display: Vector3 + - type: + display: Vector3 + RaycastParams.new: + args: [] + Rect.new: + args: + - type: any + - type: any + - required: false + type: number + - required: false + type: number + Region3.new: + args: + - type: + display: Vector3 + - type: + display: Vector3 + Region3int16.new: + args: + - required: false + type: + display: Vector3 + - required: false + type: + display: Vector3 + TweenInfo.new: + args: + - required: false + type: number + - required: false + type: + display: EasingStyle + - required: false + type: + display: EasingDirection + - required: false + type: number + - required: false + type: bool + - required: false + type: number + UDim.new: + args: + - required: false + type: number + - required: false + type: number + UDim2.fromOffset: + args: + - required: use UDim2.new() if you want an empty UDim2 + type: number + - required: false + type: number + UDim2.fromScale: + args: + - required: use UDim2.new() if you want an empty UDim2 + type: number + - required: false + type: number + UDim2.new: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: number + - required: false + type: number + UserSettings: + args: [] + Vector2.new: + args: + - required: false + type: number + - required: false + type: number + Vector2.one: + property: read-only + Vector2.xAxis: + property: read-only + Vector2.yAxis: + property: read-only + Vector2.zero: + property: read-only + Vector2int16.new: + args: + - required: false + type: number + - required: false + type: number + Vector3.FromAxis: + args: + - type: + display: Axis + Vector3.FromNormalId: + args: + - type: + display: NormalId + Vector3.new: + args: + - required: false + type: number + - required: false + type: number + - required: false + type: number + Vector3.one: + property: read-only + Vector3.xAxis: + property: read-only + Vector3.yAxis: + property: read-only + Vector3.zAxis: + property: read-only + Vector3.zero: + property: read-only + Vector3int16.new: + args: + - required: false + type: number + - required: false + type: number + - required: false + type: number + bit32.arshift: + args: + - type: number + - type: number + bit32.band: + args: + - type: "..." + bit32.bnot: + args: + - type: number + bit32.bor: + args: + - type: "..." + bit32.btest: + args: + - type: "..." + bit32.bxor: + args: + - type: "..." + bit32.countlz: + args: + - type: number + bit32.countrz: + args: + - type: number + bit32.extract: + args: + - type: number + - type: number + - required: false + type: number + bit32.lrotate: + args: + - type: number + - type: number + bit32.lshift: + args: + - type: number + - type: number + bit32.replace: + args: + - type: number + - type: number + - type: number + - required: false + type: number + bit32.rrotate: + args: + - type: number + - type: number + bit32.rshift: + args: + - type: number + - type: number + collectgarbage: + args: + - type: + - count + coroutine.close: + args: + - type: + display: thread + coroutine.isyieldable: + args: [] + debug.debug: + removed: true + debug.getfenv: + removed: true + debug.gethook: + removed: true + debug.getinfo: + removed: true + debug.getlocal: + removed: true + debug.getmetatable: + removed: true + debug.getregistry: + removed: true + debug.getupvalue: + removed: true + debug.info: + args: + - type: any + - type: any + - required: false + type: string + debug.profilebegin: + args: + - type: string + debug.profileend: + args: [] + debug.resetmemorycategory: + args: [] + debug.setfenv: + removed: true + debug.sethook: + removed: true + debug.setlocal: + removed: true + debug.setmemorycategory: + args: + - type: string + debug.setmetatable: + removed: true + debug.setupvalue: + removed: true + delay: + args: + - type: number + - type: function + dofile: + removed: true + elapsedTime: + args: [] + error: + args: + - required: Erroring without an explanation is unhelpful to users. + type: any + - required: false + type: number + game: + struct: DataModel + Game: + struct: DataModel + gcinfo: + args: [] + io: + removed: true + load: + removed: true + loadfile: + removed: true + math.clamp: + args: + - type: number + - type: number + - type: number + math.log: + args: + - type: number + - required: false + type: number + math.noise: + args: + - type: number + - required: false + type: number + - required: false + type: number + math.round: + args: + - type: number + math.sign: + args: + - type: number + module: + removed: true + os.execute: + removed: true + os.exit: + removed: true + os.getenv: + removed: true + os.remove: + removed: true + os.rename: + removed: true + os.setlocale: + removed: true + os.tmpname: + removed: true + package: + removed: true + plugin: + struct: Plugin + require: + args: + - type: number + script: + struct: Script + settings: + args: [] + shared: + property: new-fields + spawn: + args: + - type: function + Spawn: + args: + - type: function + LoadLibrary: + args: + - type: string + string.dump: + removed: true + string.pack: + args: + - type: string + - type: "..." + string.packsize: + args: + - type: string + string.split: + args: + - type: string + - required: false + type: string + string.unpack: + args: + - type: string + - type: string + - required: false + type: number + table.clear: + args: + - type: table + table.clone: + args: + - type: table + table.create: + args: + - type: number + - required: false + type: any + table.find: + args: + - type: table + - type: any + - required: false + type: number + table.freeze: + args: + - type: table + table.isfrozen: + args: + - type: table + table.move: + args: + - type: table + - type: number + - type: number + - type: number + - required: false + type: table + table.pack: + args: + - type: "..." + table.unpack: + args: + - type: table + - required: false + type: number + - required: false + type: number + task.cancel: + args: + - type: + display: thread + task.defer: + args: + - type: function + - required: false + type: "..." + task.delay: + args: + - required: false + type: number + - type: function + - required: false + type: "..." + task.desynchronize: + args: [] + task.spawn: + args: + - type: function + - required: false + type: "..." + task.synchronize: + args: [] + task.wait: + args: + - required: false + type: number + tick: + args: [] + time: + args: [] + typeof: + args: + - type: any + utf8.char: + args: + - required: utf8.char should be used with an argument despite it not throwing + type: number + - required: false + type: "..." + utf8.charpattern: + property: read-only + utf8.codepoint: + args: + - type: string + - required: false + type: number + - required: false + type: number + utf8.codes: + args: + - type: string + utf8.graphemes: + args: + - type: string + - required: false + type: number + - required: false + type: number + utf8.len: + args: + - type: string + - required: false + type: number + - required: false + type: number + utf8.nfcnormalize: + args: + - type: string + utf8.nfdnormalize: + args: + - type: string + utf8.offset: + args: + - type: string + - required: false + type: number + - required: false + type: number + wait: + args: + - required: false + type: number + warn: + args: + - type: string + - required: false + type: "..." + workspace: + struct: Workspace +structs: + BasePart: + "*": + struct: Instance + AncestryChanged: + struct: Event + Anchored: + property: override-fields + ApplyAngularImpulse: + args: + - required: false + type: any + method: true + ApplyImpulse: + args: + - required: false + type: any + method: true + ApplyImpulseAtPosition: + args: + - required: false + type: any + - required: false + type: any + method: true + Archivable: + property: override-fields + AssemblyAngularVelocity: + any: true + AssemblyCenterOfMass: + any: true + AssemblyLinearVelocity: + any: true + AssemblyMass: + property: read-only + AssemblyRootPart: + struct: BasePart + AttributeChanged: + struct: Event + BackParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BackParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BackSurface: + property: override-fields + BackSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BottomParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BottomParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BottomSurface: + property: override-fields + BottomSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BreakJoints: + args: [] + method: true + BrickColor: + property: override-fields + CFrame: + any: true + CanCollide: + property: override-fields + CanCollideWith: + args: + - required: false + type: any + method: true + CanQuery: + property: override-fields + CanSetNetworkOwnership: + args: [] + method: true + CanTouch: + property: override-fields + CastShadow: + property: override-fields + CenterOfMass: + any: true + Changed: + struct: Event + ChildAdded: + struct: Event + ChildRemoved: + struct: Event + ClassName: + property: read-only + ClearAllChildren: + args: [] + method: true + Clone: + args: [] + method: true + CollisionGroupId: + property: override-fields + Color: + property: override-fields + CustomPhysicalProperties: + property: override-fields + DescendantAdded: + struct: Event + DescendantRemoving: + struct: Event + Destroy: + args: [] + method: true + Destroying: + struct: Event + Elasticity: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + FindFirstAncestor: + args: + - required: false + type: any + method: true + FindFirstAncestorOfClass: + args: + - required: false + type: any + method: true + FindFirstAncestorWhichIsA: + args: + - required: false + type: any + method: true + FindFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstChildOfClass: + args: + - required: false + type: any + method: true + FindFirstChildWhichIsA: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstDescendant: + args: + - required: false + type: any + method: true + Friction: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + FrontParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + FrontParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + FrontSurface: + property: override-fields + FrontSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + GetActor: + args: [] + method: true + GetAttribute: + args: + - required: false + type: any + method: true + GetAttributeChangedSignal: + args: + - required: false + type: any + method: true + GetAttributes: + args: [] + method: true + GetChildren: + args: [] + method: true + GetConnectedParts: + args: + - required: false + type: any + method: true + GetDebugId: + args: + - required: false + type: any + method: true + GetDescendants: + args: [] + method: true + GetFullName: + args: [] + method: true + GetJoints: + args: [] + method: true + GetMass: + args: [] + method: true + GetNetworkOwner: + args: [] + method: true + GetNetworkOwnershipAuto: + args: [] + method: true + GetPivot: + args: [] + method: true + GetPropertyChangedSignal: + args: + - required: false + type: any + method: true + GetRenderCFrame: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + GetRootPart: + args: [] + method: true + GetTouchingParts: + args: [] + method: true + GetVelocityAtPosition: + args: + - required: false + type: any + method: true + IsA: + args: + - required: false + type: any + method: true + IsAncestorOf: + args: + - required: false + type: any + method: true + IsDescendantOf: + args: + - required: false + type: any + method: true + IsGrounded: + args: [] + method: true + LeftParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + LeftParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + LeftSurface: + property: override-fields + LeftSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + LocalSimulationTouched: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + LocalTransparencyModifier: + property: override-fields + Locked: + property: override-fields + MakeJoints: + args: [] + method: true + Mass: + property: read-only + Massless: + property: override-fields + Material: + property: override-fields + MaterialVariant: + property: override-fields + Name: + property: override-fields + Orientation: + any: true + Origin Orientation: + any: true + Origin Position: + any: true + OutfitChanged: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + Parent: + struct: Instance + Pivot Offset Orientation: + any: true + Pivot Offset Position: + any: true + PivotOffset: + any: true + PivotTo: + args: + - required: false + type: any + method: true + Position: + any: true + ReceiveAge: + property: read-only + Reflectance: + property: override-fields + Remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + Resize: + args: + - required: false + type: any + - required: false + type: any + method: true + ResizeIncrement: + property: read-only + ResizeableFaces: + property: read-only + RightParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + RightParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + RightSurface: + property: override-fields + RightSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + RootPriority: + property: override-fields + RotVelocity: + any: true + deprecated: + message: this property is deprecated. + replace: [] + Rotation: + any: true + SetAttribute: + args: + - required: false + type: any + - required: false + type: any + method: true + SetNetworkOwner: + args: + - required: false + type: any + method: true + SetNetworkOwnershipAuto: + args: [] + method: true + Size: + any: true + SpecificGravity: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + StoppedTouching: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + SubtractAsync: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + TopParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + TopParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + TopSurface: + property: override-fields + TopSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + TouchEnded: + struct: Event + Touched: + struct: Event + Transparency: + property: override-fields + UnionAsync: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + Velocity: + any: true + deprecated: + message: this property is deprecated. + replace: [] + WaitForChild: + args: + - required: false + type: any + - required: false + type: any + method: true + archivable: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + breakJoints: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + brickColor: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + childAdded: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + children: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + className: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + clone: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + destroy: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + findFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + getChildren: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + getMass: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + isA: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + isDescendantOf: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + makeJoints: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + resize: + args: + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + Camera: + "*": + struct: Instance + AncestryChanged: + struct: Event + Archivable: + property: override-fields + AttributeChanged: + struct: Event + CFrame: + any: true + CameraSubject: + struct: Instance + CameraType: + property: override-fields + Changed: + struct: Event + ChildAdded: + struct: Event + ChildRemoved: + struct: Event + ClassName: + property: read-only + ClearAllChildren: + args: [] + method: true + Clone: + args: [] + method: true + CoordinateFrame: + any: true + deprecated: + message: this property is deprecated. + replace: [] + DescendantAdded: + struct: Event + DescendantRemoving: + struct: Event + Destroy: + args: [] + method: true + Destroying: + struct: Event + DiagonalFieldOfView: + property: override-fields + FieldOfView: + property: override-fields + FieldOfViewMode: + property: override-fields + FindFirstAncestor: + args: + - required: false + type: any + method: true + FindFirstAncestorOfClass: + args: + - required: false + type: any + method: true + FindFirstAncestorWhichIsA: + args: + - required: false + type: any + method: true + FindFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstChildOfClass: + args: + - required: false + type: any + method: true + FindFirstChildWhichIsA: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstDescendant: + args: + - required: false + type: any + method: true + FirstPersonTransition: + struct: Event + Focus: + any: true + GetActor: + args: [] + method: true + GetAttribute: + args: + - required: false + type: any + method: true + GetAttributeChangedSignal: + args: + - required: false + type: any + method: true + GetAttributes: + args: [] + method: true + GetChildren: + args: [] + method: true + GetDebugId: + args: + - required: false + type: any + method: true + GetDescendants: + args: [] + method: true + GetFullName: + args: [] + method: true + GetLargestCutoffDistance: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + GetPanSpeed: + args: [] + method: true + GetPartsObscuringTarget: + args: + - required: false + type: any + - required: false + type: any + method: true + GetPropertyChangedSignal: + args: + - required: false + type: any + method: true + GetRenderCFrame: + args: [] + method: true + GetRoll: + args: [] + method: true + GetTiltSpeed: + args: [] + method: true + HeadLocked: + property: override-fields + HeadScale: + property: override-fields + Interpolate: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + InterpolationFinished: + struct: Event + IsA: + args: + - required: false + type: any + method: true + IsAncestorOf: + args: + - required: false + type: any + method: true + IsDescendantOf: + args: + - required: false + type: any + method: true + MaxAxisFieldOfView: + property: override-fields + Name: + property: override-fields + NearPlaneZ: + property: read-only + PanUnits: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + Parent: + struct: Instance + Remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + ScreenPointToRay: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + SetAttribute: + args: + - required: false + type: any + - required: false + type: any + method: true + SetCameraPanMode: + args: + - required: false + type: any + method: true + SetImageServerView: + args: + - required: false + type: any + method: true + SetRoll: + args: + - required: false + type: any + method: true + TiltUnits: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + ViewportPointToRay: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + ViewportSize: + any: true + WaitForChild: + args: + - required: false + type: any + - required: false + type: any + method: true + WorldToScreenPoint: + args: + - required: false + type: any + method: true + WorldToViewportPoint: + args: + - required: false + type: any + method: true + Zoom: + args: + - required: false + type: any + method: true + archivable: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + childAdded: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + children: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + className: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + clone: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + destroy: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + findFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + focus: + any: true + deprecated: + message: this property is deprecated. + replace: [] + getChildren: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + isA: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + isDescendantOf: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + DataModel: + "*": + struct: Instance + AllowedGearTypeChanged: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + AncestryChanged: + struct: Event + Archivable: + property: override-fields + AttributeChanged: + struct: Event + BindToClose: + args: + - required: false + type: any + method: true + Changed: + struct: Event + ChildAdded: + struct: Event + ChildRemoved: + struct: Event + ClassName: + property: read-only + ClearAllChildren: + args: [] + method: true + Clone: + args: [] + method: true + Close: + struct: Event + CloseLate: + struct: Event + CreatorId: + property: read-only + CreatorType: + property: read-only + DefineFastFlag: + args: + - required: false + type: any + - required: false + type: any + method: true + DefineFastInt: + args: + - required: false + type: any + - required: false + type: any + method: true + DefineFastString: + args: + - required: false + type: any + - required: false + type: any + method: true + DescendantAdded: + struct: Event + DescendantRemoving: + struct: Event + Destroy: + args: [] + method: true + Destroying: + struct: Event + FindFirstAncestor: + args: + - required: false + type: any + method: true + FindFirstAncestorOfClass: + args: + - required: false + type: any + method: true + FindFirstAncestorWhichIsA: + args: + - required: false + type: any + method: true + FindFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstChildOfClass: + args: + - required: false + type: any + method: true + FindFirstChildWhichIsA: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstDescendant: + args: + - required: false + type: any + method: true + FindService: + args: + - required: false + type: any + method: true + GameId: + property: read-only + GearGenreSetting: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + Genre: + property: read-only + GetActor: + args: [] + method: true + GetAttribute: + args: + - required: false + type: any + method: true + GetAttributeChangedSignal: + args: + - required: false + type: any + method: true + GetAttributes: + args: [] + method: true + GetChildren: + args: [] + method: true + GetDebugId: + args: + - required: false + type: any + method: true + GetDescendants: + args: [] + method: true + GetEngineFeature: + args: + - required: false + type: any + method: true + GetFastFlag: + args: + - required: false + type: any + method: true + GetFastInt: + args: + - required: false + type: any + method: true + GetFastString: + args: + - required: false + type: any + method: true + GetFullName: + args: [] + method: true + GetJobsInfo: + args: [] + method: true + GetMessage: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + GetObjects: + args: + - required: false + type: any + method: true + GetObjectsAllOrNone: + args: + - required: false + type: any + method: true + GetObjectsAsync: + args: + - required: false + type: any + method: true + GetObjectsList: + args: + - required: false + type: any + method: true + GetPropertyChangedSignal: + args: + - required: false + type: any + method: true + GetRemoteBuildMode: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + GetService: + args: + - type: + - ABTestService + - AdService + - AnalyticsService + - AnimationClipProvider + - AnimationFromVideoCreatorService + - AnimationFromVideoCreatorStudioService + - AppUpdateService + - AssetCounterService + - AssetDeliveryProxy + - AssetImportService + - AssetManagerService + - AssetService + - AvatarEditorService + - AvatarImportService + - BadgeService + - CoreGui + - StarterGui + - BreakpointManager + - BrowserService + - BulkImportService + - CacheableContentProvider + - HSRDataContentProvider + - MeshContentProvider + - SolidModelContentProvider + - CalloutService + - ChangeHistoryService + - Chat + - ClusterPacketCache + - CollectionService + - CommandService + - ConfigureServerService + - ContentProvider + - ContextActionService + - ControllerService + - CookiesService + - CorePackages + - CoreScriptSyncService + - CrossDMScriptChangeListener + - DataModelPatchService + - DataStoreService + - Debris + - DebuggablePluginWatcher + - DebuggerConnectionManager + - DebuggerManager + - DebuggerUIService + - DraftsService + - DraggerService + - EventIngestService + - FaceAnimatorService + - FacialAnimationStreamingService + - FlagStandService + - FlyweightService + - CSGDictionaryService + - NonReplicatedCSGDictionaryService + - FriendService + - GamePassService + - GamepadService + - Geometry + - GoogleAnalyticsConfiguration + - GroupService + - GuiService + - GuidRegistryService + - HapticService + - HeightmapImporterService + - Hopper + - HttpRbxApiService + - HttpService + - ILegacyStudioBridge + - LegacyStudioBridge + - IXPService + - IncrementalPatchBuilder + - InsertService + - JointsService + - KeyboardService + - KeyframeSequenceProvider + - LSPFileSyncService + - LanguageService + - Lighting + - LocalStorageService + - AppStorageService + - UserStorageService + - LocalizationService + - LodDataService + - LogService + - LoginService + - LuaWebService + - LuauScriptAnalyzerService + - MarketplaceService + - MaterialService + - MemStorageService + - MemoryStoreService + - MessageBusService + - MessagingService + - MouseService + - NetworkClient + - NetworkServer + - NetworkSettings + - NotificationService + - Workspace + - PackageService + - PackageUIService + - PathfindingService + - PermissionsService + - PhysicsService + - PlayerEmulatorService + - Players + - PluginDebugService + - PluginGuiService + - PluginPolicyService + - PointsService + - PolicyService + - ProcessInstancePhysicsService + - ProximityPromptService + - PublishService + - RbxAnalyticsService + - RemoteDebuggerServer + - RenderSettings + - ReplicatedFirst + - ReplicatedStorage + - RobloxPluginGuiService + - RobloxReplicatedStorage + - RtMessagingService + - RunService + - RuntimeScriptService + - ScriptChangeService + - ScriptCloneWatcher + - ScriptCloneWatcherHelper + - ScriptContext + - ScriptEditorService + - ScriptRegistrationService + - ScriptService + - Selection + - ServerScriptService + - ServerStorage + - SessionService + - SnippetService + - SocialService + - SoundService + - SpawnerService + - StarterPack + - StarterPlayer + - Stats + - StopWatchReporter + - Studio + - StudioAssetService + - StudioData + - StudioDeviceEmulatorService + - StudioHighDpiService + - StudioPublishService + - StudioScriptDebugEventListener + - StudioService + - TaskScheduler + - Teams + - TeleportService + - TemporaryCageMeshProvider + - TemporaryScriptService + - TestService + - TextBoxService + - TextChatService + - TextService + - ThirdPartyUserService + - TimerService + - ToastNotificationService + - ToolboxService + - TouchInputService + - TracerService + - TweenService + - UGCValidationService + - UnvalidatedAssetService + - UserInputService + - UserService + - VRService + - VersionControlService + - VideoCaptureService + - VirtualInputManager + - VirtualUser + - VisibilityService + - Visit + - VoiceChatInternal + - VoiceChatService + method: true + GraphicsQualityChangeRequest: + struct: Event + HttpGetAsync: + args: + - required: false + type: any + - required: false + type: any + method: true + HttpPostAsync: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + InsertObjectsAndJoinIfLegacyAsync: + args: + - required: false + type: any + method: true + IsA: + args: + - required: false + type: any + method: true + IsAncestorOf: + args: + - required: false + type: any + method: true + IsDescendantOf: + args: + - required: false + type: any + method: true + IsGearTypeAllowed: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + IsLoaded: + args: [] + method: true + ItemChanged: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + JobId: + property: read-only + Load: + args: + - required: false + type: any + method: true + Loaded: + struct: Event + Name: + property: override-fields + OnClose: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + OpenScreenshotsFolder: + args: [] + method: true + OpenVideosFolder: + args: [] + method: true + Parent: + struct: Instance + PlaceId: + property: read-only + PlaceVersion: + property: read-only + PrivateServerId: + property: read-only + PrivateServerOwnerId: + property: read-only + Remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + ReportInGoogleAnalytics: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + SavePlace: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + ScreenshotReady: + struct: Event + ScreenshotSavedToAlbum: + struct: Event + ServiceAdded: + struct: Event + ServiceRemoving: + struct: Event + SetAttribute: + args: + - required: false + type: any + - required: false + type: any + method: true + SetFastFlagForTesting: + args: + - required: false + type: any + - required: false + type: any + method: true + SetFastIntForTesting: + args: + - required: false + type: any + - required: false + type: any + method: true + SetFastStringForTesting: + args: + - required: false + type: any + - required: false + type: any + method: true + SetPlaceId: + args: + - required: false + type: any + method: true + SetUniverseId: + args: + - required: false + type: any + method: true + Shutdown: + args: [] + method: true + VIPServerId: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + VIPServerOwnerId: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + WaitForChild: + args: + - required: false + type: any + - required: false + type: any + method: true + Workspace: + struct: Workspace + archivable: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + childAdded: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + children: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + className: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + clone: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + destroy: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + findFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + getChildren: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + getService: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + isA: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + isDescendantOf: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + lighting: + struct: Instance + deprecated: + message: this property is deprecated. + replace: [] + remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + service: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + workspace: + struct: Workspace + deprecated: + message: this property is deprecated. + replace: [] + EnumItem: + Name: + property: read-only + Value: + property: read-only + Event: + Connect: + args: + - type: function + method: true + Wait: + args: [] + method: true + connect: + args: + - type: function + method: true + wait: + args: + - type: function + method: true + Instance: + "*": + any: true + Plugin: + "*": + struct: Instance + Activate: + args: + - required: false + type: any + method: true + AncestryChanged: + struct: Event + Archivable: + property: override-fields + AttributeChanged: + struct: Event + Changed: + struct: Event + ChildAdded: + struct: Event + ChildRemoved: + struct: Event + ClassName: + property: read-only + ClearAllChildren: + args: [] + method: true + Clone: + args: [] + method: true + CollisionEnabled: + property: read-only + CreateDockWidgetPluginGui: + args: + - required: false + type: any + - required: false + type: any + method: true + CreatePluginAction: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + CreatePluginMenu: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + CreateQWidgetPluginGui: + args: + - required: false + type: any + - required: false + type: any + method: true + CreateToolbar: + args: + - required: false + type: any + method: true + Deactivate: + args: [] + method: true + Deactivation: + struct: Event + DescendantAdded: + struct: Event + DescendantRemoving: + struct: Event + Destroy: + args: [] + method: true + Destroying: + struct: Event + FindFirstAncestor: + args: + - required: false + type: any + method: true + FindFirstAncestorOfClass: + args: + - required: false + type: any + method: true + FindFirstAncestorWhichIsA: + args: + - required: false + type: any + method: true + FindFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstChildOfClass: + args: + - required: false + type: any + method: true + FindFirstChildWhichIsA: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstDescendant: + args: + - required: false + type: any + method: true + GetActor: + args: [] + method: true + GetAttribute: + args: + - required: false + type: any + method: true + GetAttributeChangedSignal: + args: + - required: false + type: any + method: true + GetAttributes: + args: [] + method: true + GetChildren: + args: [] + method: true + GetDebugId: + args: + - required: false + type: any + method: true + GetDescendants: + args: [] + method: true + GetFullName: + args: [] + method: true + GetItem: + args: + - required: false + type: any + - required: false + type: any + method: true + GetJoinMode: + args: [] + method: true + GetMouse: + args: [] + method: true + GetPropertyChangedSignal: + args: + - required: false + type: any + method: true + GetSelectedRibbonTool: + args: [] + method: true + GetSetting: + args: + - required: false + type: any + method: true + GetStudioUserId: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + GridSize: + property: read-only + ImportFbxAnimation: + args: + - required: false + type: any + - required: false + type: any + method: true + ImportFbxRig: + args: + - required: false + type: any + method: true + Invoke: + args: + - required: false + type: any + - required: false + type: any + method: true + IsA: + args: + - required: false + type: any + method: true + IsActivated: + args: [] + method: true + IsActivatedWithExclusiveMouse: + args: [] + method: true + IsAncestorOf: + args: + - required: false + type: any + method: true + IsDescendantOf: + args: + - required: false + type: any + method: true + Name: + property: override-fields + Negate: + args: + - required: false + type: any + method: true + OnInvoke: + args: + - required: false + type: any + - required: false + type: any + method: true + OnSetItem: + args: + - required: false + type: any + - required: false + type: any + method: true + OpenScript: + args: + - required: false + type: any + - required: false + type: any + method: true + OpenWikiPage: + args: + - required: false + type: any + method: true + Parent: + struct: Instance + PauseSound: + args: + - required: false + type: any + method: true + PlaySound: + args: + - required: false + type: any + - required: false + type: any + method: true + PromptForExistingAssetId: + args: + - required: false + type: any + method: true + PromptSaveSelection: + args: + - required: false + type: any + method: true + Ready: + struct: Event + Remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + ResumeSound: + args: + - required: false + type: any + method: true + SaveSelectedToRoblox: + args: [] + method: true + SelectRibbonTool: + args: + - required: false + type: any + - required: false + type: any + method: true + Separate: + args: + - required: false + type: any + method: true + SetAttribute: + args: + - required: false + type: any + - required: false + type: any + method: true + SetItem: + args: + - required: false + type: any + - required: false + type: any + method: true + SetReady: + args: [] + method: true + SetSetting: + args: + - required: false + type: any + - required: false + type: any + method: true + StartDecalDrag: + args: + - required: false + type: any + method: true + StartDrag: + args: + - required: false + type: any + method: true + StopAllSounds: + args: [] + method: true + Union: + args: + - required: false + type: any + method: true + Unloading: + struct: Event + WaitForChild: + args: + - required: false + type: any + - required: false + type: any + method: true + archivable: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + childAdded: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + children: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + className: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + clone: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + destroy: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + findFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + getChildren: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + isA: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + isDescendantOf: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + Script: + "*": + struct: Instance + AncestryChanged: + struct: Event + Archivable: + property: override-fields + AttributeChanged: + struct: Event + Changed: + struct: Event + ChildAdded: + struct: Event + ChildRemoved: + struct: Event + ClassName: + property: read-only + ClearAllChildren: + args: [] + method: true + Clone: + args: [] + method: true + CurrentEditor: + struct: Instance + DescendantAdded: + struct: Event + DescendantRemoving: + struct: Event + Destroy: + args: [] + method: true + Destroying: + struct: Event + Disabled: + property: override-fields + FindFirstAncestor: + args: + - required: false + type: any + method: true + FindFirstAncestorOfClass: + args: + - required: false + type: any + method: true + FindFirstAncestorWhichIsA: + args: + - required: false + type: any + method: true + FindFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstChildOfClass: + args: + - required: false + type: any + method: true + FindFirstChildWhichIsA: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstDescendant: + args: + - required: false + type: any + method: true + GetActor: + args: [] + method: true + GetAttribute: + args: + - required: false + type: any + method: true + GetAttributeChangedSignal: + args: + - required: false + type: any + method: true + GetAttributes: + args: [] + method: true + GetChildren: + args: [] + method: true + GetDebugId: + args: + - required: false + type: any + method: true + GetDescendants: + args: [] + method: true + GetFullName: + args: [] + method: true + GetHash: + args: [] + method: true + GetPropertyChangedSignal: + args: + - required: false + type: any + method: true + IsA: + args: + - required: false + type: any + method: true + IsAncestorOf: + args: + - required: false + type: any + method: true + IsDescendantOf: + args: + - required: false + type: any + method: true + LinkedSource: + property: override-fields + Name: + property: override-fields + Parent: + struct: Instance + Remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + SetAttribute: + args: + - required: false + type: any + - required: false + type: any + method: true + WaitForChild: + args: + - required: false + type: any + - required: false + type: any + method: true + archivable: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + childAdded: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + children: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + className: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + clone: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + destroy: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + findFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + getChildren: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + isA: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + isDescendantOf: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + Terrain: + "*": + struct: Instance + AncestryChanged: + struct: Event + Anchored: + property: override-fields + ApplyAngularImpulse: + args: + - required: false + type: any + method: true + ApplyImpulse: + args: + - required: false + type: any + method: true + ApplyImpulseAtPosition: + args: + - required: false + type: any + - required: false + type: any + method: true + Archivable: + property: override-fields + AssemblyAngularVelocity: + any: true + AssemblyCenterOfMass: + any: true + AssemblyLinearVelocity: + any: true + AssemblyMass: + property: read-only + AssemblyRootPart: + struct: BasePart + AttributeChanged: + struct: Event + AutowedgeCell: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + AutowedgeCells: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + BackParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BackParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BackSurface: + property: override-fields + BackSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BottomParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BottomParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BottomSurface: + property: override-fields + BottomSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + BreakJoints: + args: [] + method: true + BrickColor: + property: override-fields + CFrame: + any: true + CanCollide: + property: override-fields + CanCollideWith: + args: + - required: false + type: any + method: true + CanQuery: + property: override-fields + CanSetNetworkOwnership: + args: [] + method: true + CanTouch: + property: override-fields + CastShadow: + property: override-fields + CellCenterToWorld: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + CellCornerToWorld: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + CenterOfMass: + any: true + Changed: + struct: Event + ChildAdded: + struct: Event + ChildRemoved: + struct: Event + ClassName: + property: read-only + Clear: + args: [] + method: true + ClearAllChildren: + args: [] + method: true + Clone: + args: [] + method: true + CollisionGroupId: + property: override-fields + Color: + property: override-fields + ConvertToSmooth: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + CopyRegion: + args: + - required: false + type: any + method: true + CountCells: + args: [] + method: true + CustomPhysicalProperties: + property: override-fields + Decoration: + property: override-fields + DescendantAdded: + struct: Event + DescendantRemoving: + struct: Event + Destroy: + args: [] + method: true + Destroying: + struct: Event + Elasticity: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + FillBall: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + FillBlock: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + FillCylinder: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + FillRegion: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + FillWedge: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + FindFirstAncestor: + args: + - required: false + type: any + method: true + FindFirstAncestorOfClass: + args: + - required: false + type: any + method: true + FindFirstAncestorWhichIsA: + args: + - required: false + type: any + method: true + FindFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstChildOfClass: + args: + - required: false + type: any + method: true + FindFirstChildWhichIsA: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstDescendant: + args: + - required: false + type: any + method: true + Friction: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + FrontParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + FrontParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + FrontSurface: + property: override-fields + FrontSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + GetActor: + args: [] + method: true + GetAttribute: + args: + - required: false + type: any + method: true + GetAttributeChangedSignal: + args: + - required: false + type: any + method: true + GetAttributes: + args: [] + method: true + GetCell: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + GetChildren: + args: [] + method: true + GetConnectedParts: + args: + - required: false + type: any + method: true + GetDebugId: + args: + - required: false + type: any + method: true + GetDescendants: + args: [] + method: true + GetFullName: + args: [] + method: true + GetJoints: + args: [] + method: true + GetMass: + args: [] + method: true + GetMaterialColor: + args: + - required: false + type: any + method: true + GetNetworkOwner: + args: [] + method: true + GetNetworkOwnershipAuto: + args: [] + method: true + GetPivot: + args: [] + method: true + GetPropertyChangedSignal: + args: + - required: false + type: any + method: true + GetRenderCFrame: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + GetRootPart: + args: [] + method: true + GetTouchingParts: + args: [] + method: true + GetVelocityAtPosition: + args: + - required: false + type: any + method: true + GetWaterCell: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + IsA: + args: + - required: false + type: any + method: true + IsAncestorOf: + args: + - required: false + type: any + method: true + IsDescendantOf: + args: + - required: false + type: any + method: true + IsGrounded: + args: [] + method: true + IsSmooth: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + LeftParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + LeftParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + LeftSurface: + property: override-fields + LeftSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + LocalSimulationTouched: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + LocalTransparencyModifier: + property: override-fields + Locked: + property: override-fields + MakeJoints: + args: [] + method: true + Mass: + property: read-only + Massless: + property: override-fields + Material: + property: override-fields + MaterialColors: + property: override-fields + MaterialVariant: + property: override-fields + MaxExtents: + property: read-only + Name: + property: override-fields + Orientation: + any: true + Origin Orientation: + any: true + Origin Position: + any: true + OutfitChanged: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + Parent: + struct: Instance + PasteRegion: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + Pivot Offset Orientation: + any: true + Pivot Offset Position: + any: true + PivotOffset: + any: true + PivotTo: + args: + - required: false + type: any + method: true + Position: + any: true + ReadVoxels: + args: + - required: false + type: any + - required: false + type: any + method: true + ReceiveAge: + property: read-only + Reflectance: + property: override-fields + Remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + ReplaceMaterial: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + Resize: + args: + - required: false + type: any + - required: false + type: any + method: true + ResizeIncrement: + property: read-only + ResizeableFaces: + property: read-only + RightParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + RightParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + RightSurface: + property: override-fields + RightSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + RootPriority: + property: override-fields + RotVelocity: + any: true + deprecated: + message: this property is deprecated. + replace: [] + Rotation: + any: true + SetAttribute: + args: + - required: false + type: any + - required: false + type: any + method: true + SetCell: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + SetCells: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + SetMaterialColor: + args: + - required: false + type: any + - required: false + type: any + method: true + SetNetworkOwner: + args: + - required: false + type: any + method: true + SetNetworkOwnershipAuto: + args: [] + method: true + SetWaterCell: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + Size: + any: true + SpecificGravity: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + StoppedTouching: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + SubtractAsync: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + TopParamA: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + TopParamB: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + TopSurface: + property: override-fields + TopSurfaceInput: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + TouchEnded: + struct: Event + Touched: + struct: Event + Transparency: + property: override-fields + UnionAsync: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + Velocity: + any: true + deprecated: + message: this property is deprecated. + replace: [] + WaitForChild: + args: + - required: false + type: any + - required: false + type: any + method: true + WaterColor: + property: override-fields + WaterReflectance: + property: override-fields + WaterTransparency: + property: override-fields + WaterWaveSize: + property: override-fields + WaterWaveSpeed: + property: override-fields + WorldToCell: + args: + - required: false + type: any + method: true + WorldToCellPreferEmpty: + args: + - required: false + type: any + method: true + WorldToCellPreferSolid: + args: + - required: false + type: any + method: true + WriteVoxels: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + archivable: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + breakJoints: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + brickColor: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + childAdded: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + children: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + className: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + clone: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + destroy: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + findFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + getChildren: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + getMass: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + isA: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + isDescendantOf: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + makeJoints: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + resize: + args: + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + Workspace: + "*": + struct: Instance + AllowThirdPartySales: + property: override-fields + AncestryChanged: + struct: Event + AnimationWeightedBlendFix: + property: override-fields + Archivable: + property: override-fields + ArePartsTouchingOthers: + args: + - required: false + type: any + - required: false + type: any + method: true + AttributeChanged: + struct: Event + BreakJoints: + args: [] + method: true + BulkMoveTo: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + CalculateJumpDistance: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + CalculateJumpHeight: + args: + - required: false + type: any + - required: false + type: any + method: true + CalculateJumpPower: + args: + - required: false + type: any + - required: false + type: any + method: true + Changed: + struct: Event + ChildAdded: + struct: Event + ChildRemoved: + struct: Event + ClassName: + property: read-only + ClearAllChildren: + args: [] + method: true + ClientAnimatorThrottling: + property: override-fields + Clone: + args: [] + method: true + CurrentCamera: + struct: Camera + DescendantAdded: + struct: Event + DescendantRemoving: + struct: Event + Destroy: + args: [] + method: true + Destroying: + struct: Event + DistributedGameTime: + property: override-fields + ExperimentalSolverIsEnabled: + args: [] + method: true + FindFirstAncestor: + args: + - required: false + type: any + method: true + FindFirstAncestorOfClass: + args: + - required: false + type: any + method: true + FindFirstAncestorWhichIsA: + args: + - required: false + type: any + method: true + FindFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstChildOfClass: + args: + - required: false + type: any + method: true + FindFirstChildWhichIsA: + args: + - required: false + type: any + - required: false + type: any + method: true + FindFirstDescendant: + args: + - required: false + type: any + method: true + FindPartOnRay: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + FindPartOnRayWithIgnoreList: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + FindPartOnRayWithWhitelist: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + FindPartsInRegion3: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + FindPartsInRegion3WithIgnoreList: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + FindPartsInRegion3WithWhiteList: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + GetActor: + args: [] + method: true + GetAttribute: + args: + - required: false + type: any + method: true + GetAttributeChangedSignal: + args: + - required: false + type: any + method: true + GetAttributes: + args: [] + method: true + GetBoundingBox: + args: [] + method: true + GetChildren: + args: [] + method: true + GetDebugId: + args: + - required: false + type: any + method: true + GetDescendants: + args: [] + method: true + GetExtentsSize: + args: [] + method: true + GetFullName: + args: [] + method: true + GetModelCFrame: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + GetModelSize: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + GetNumAwakeParts: + args: [] + method: true + GetPartBoundsInBox: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + GetPartBoundsInRadius: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + GetPartsInPart: + args: + - required: false + type: any + - required: false + type: any + method: true + GetPhysicsThrottling: + args: [] + method: true + GetPivot: + args: [] + method: true + GetPrimaryPartCFrame: + args: [] + method: true + GetPropertyChangedSignal: + args: + - required: false + type: any + method: true + GetRealPhysicsFPS: + args: [] + method: true + GetServerTimeNow: + args: [] + method: true + GlobalWind: + any: true + Gravity: + property: override-fields + HumanoidOnlySetCollisionsOnStateChange: + property: override-fields + IKMoveTo: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + IsA: + args: + - required: false + type: any + method: true + IsAncestorOf: + args: + - required: false + type: any + method: true + IsDescendantOf: + args: + - required: false + type: any + method: true + IsRegion3Empty: + args: + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + IsRegion3EmptyWithIgnoreList: + args: + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + JoinToOutsiders: + args: + - required: false + type: any + - required: false + type: any + method: true + MakeJoints: + args: [] + method: true + MeshPartHeadsAndAccessories: + property: override-fields + MoveTo: + args: + - required: false + type: any + method: true + Name: + property: override-fields + Origin Orientation: + any: true + Origin Position: + any: true + PGSIsEnabled: + args: [] + method: true + Parent: + struct: Instance + PhysicsInertiaAndVolumeFix: + property: override-fields + PhysicsSimulationRate: + property: override-fields + PhysicsSteppingMethod: + property: override-fields + Pivot Offset Orientation: + any: true + Pivot Offset Position: + any: true + PivotTo: + args: + - required: false + type: any + method: true + PrimaryPart: + struct: BasePart + Raycast: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + Remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + ReplicateInstanceDestroySetting: + property: override-fields + ResetOrientationToIdentity: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + Retargeting: + property: override-fields + SetAttribute: + args: + - required: false + type: any + - required: false + type: any + method: true + SetIdentityOrientation: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + SetInsertPoint: + args: + - required: false + type: any + - required: false + type: any + method: true + SetMeshPartHeadsAndAccessories: + args: + - required: false + type: any + method: true + SetPhysicsThrottleEnabled: + args: + - required: false + type: any + method: true + SetPrimaryPartCFrame: + args: + - required: false + type: any + method: true + SignalBehavior: + property: override-fields + StreamOutBehavior: + property: override-fields + StreamingMinRadius: + property: override-fields + StreamingPauseMode: + property: override-fields + StreamingTargetRadius: + property: override-fields + Terrain: + struct: Terrain + TouchesUseCollisionGroups: + property: override-fields + TranslateBy: + args: + - required: false + type: any + method: true + UnjoinFromOutsiders: + args: + - required: false + type: any + method: true + WaitForChild: + args: + - required: false + type: any + - required: false + type: any + method: true + World Pivot Orientation: + any: true + World Pivot Position: + any: true + WorldPivot: + any: true + ZoomToExtents: + args: [] + method: true + archivable: + property: override-fields + deprecated: + message: this property is deprecated. + replace: [] + breakJoints: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + childAdded: + struct: Event + deprecated: + message: this property is deprecated. + replace: [] + children: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + className: + property: read-only + deprecated: + message: this property is deprecated. + replace: [] + clone: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + destroy: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + findFirstChild: + args: + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + findPartOnRay: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + findPartsInRegion3: + args: + - required: false + type: any + - required: false + type: any + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + getChildren: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + isA: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + isDescendantOf: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + makeJoints: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] + move: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + moveTo: + args: + - required: false + type: any + method: true + deprecated: + message: this property is deprecated. + replace: [] + remove: + args: [] + method: true + deprecated: + message: this property is deprecated. + replace: [] +last_updated: 1655433513 diff --git a/selene.toml b/selene.toml new file mode 100644 index 0000000..05673c5 --- /dev/null +++ b/selene.toml @@ -0,0 +1 @@ +std = "mercury" diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..6342351 --- /dev/null +++ b/stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Tabs" +indent_width = 4 +quote_style = "AutoPreferDouble" +call_parentheses = "None"