diff --git a/compile.sh b/compile.sh index d848b91..79e0ed1 100644 --- a/compile.sh +++ b/compile.sh @@ -1 +1 @@ -yue ./yue && darklua process ./yue ./processed \ No newline at end of file +yue ./yue && darklua process ./yue ./processed && rm -f ./yue/*.lua \ No newline at end of file diff --git a/lua/107893730.lua b/lua/107893730.lua deleted file mode 100644 index 94c3211..0000000 --- a/lua/107893730.lua +++ /dev/null @@ -1,1296 +0,0 @@ --- this script creates the gui and sends the web requests for in game purchase prompts - --- wait for important items to appear -while not Game do - wait(0.1) -end -while not game:GetService "MarketplaceService" do - wait(0.1) -end -while not game:FindFirstChild "CoreGui" do - wait(0.1) -end -while not game.CoreGui:FindFirstChild "RobloxGui" do - wait(0.1) -end - --------------------------------- Global Variables ---------------------------------------- --- utility variables -local RbxUtility = nil -local baseUrl = game:GetService("ContentProvider").BaseUrl:lower() - --- data variables -local currentProductInfo, currentAssetId, currentCurrencyType, currentCurrencyAmount, currentEquipOnPurchase, currentProductId, currentServerResponseTable -local checkingPlayerFunds = false -local openBCUpSellWindowConnection = nil -local purchasingConsumable = false -local enableBrowserWindowClosedEvent = true - --- gui variables -local openBuyCurrencyWindowConnection = nil -local currentlyPrompting = false -local purchaseDialog = 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 isSmallScreen = nil -local spinning = false -local spinnerIcons = nil -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) - --- user facing string -local buyHeaderText = "Buy" -local takeHeaderText = "Take" -local buyFailedHeaderText = "An Error Occurred" - -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 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." - --------------------------------- End Global Variables ---------------------------------------- - ------------------------------ Util Functions --------------------------------------------- -function getSecureApiBaseUrl() - local secureApiUrl = baseUrl - secureApiUrl = string.gsub(secureApiUrl, "http", "https") - secureApiUrl = string.gsub(secureApiUrl, "www", "api") - return secureApiUrl -end - -function getRbxUtility() - if not RbxUtility then - RbxUtility = LoadLibrary "RbxUtility" - end - return RbxUtility -end - -function preloadAssets() - for i = 1, #assetUrls do - game:GetService("ContentProvider"):Preload(assetUrls[i]) - end -end ------------------------------ End Util Functions --------------------------------------------- - --------------------------------- Accept/Decline Functions -------------------------------------- -function removeCurrentPurchaseInfo() - currentAssetId = nil - currentCurrencyType = nil - currentCurrencyAmount = nil - currentEquipOnPurchase = nil - currentProductId = nil - currentProductInfo = nil - currentServerResponseTable = nil - - checkingPlayerFunds = false -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 - ) -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"])) - purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText - setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton) - hidePurchasing() - else -- otherwise we didn't purchase, no need to show anything, just signal and close dialog - signalPromptEnded(isSuccess) - end -end - -function signalPromptEnded(isSuccess) - closePurchasePrompt() - if purchasingConsumable then - game:GetService("MarketplaceService") - :SignalPromptProductPurchaseFinished(game.Players.LocalPlayer.userId, currentProductId, isSuccess) - else - game:GetService("MarketplaceService") - :SignalPromptPurchaseFinished(game.Players.LocalPlayer, currentAssetId, isSuccess) - end - removeCurrentPurchaseInfo() -end - --- make sure our gui displays the proper purchase data, and set the productid we will try and buy if use specifies a buy action -function updatePurchasePromptData(_) - local newItemDescription = "" - - -- id to use when we request a purchase - if not currentProductId then - currentProductId = currentProductInfo["ProductId"] - end - - if isFreeItem() then - 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) - 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" - else - purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl - .. "thumbs/asset.ashx?assetid=" - .. tostring(currentAssetId) - .. "&x=100&y=100&format=png" - end -end - -function doPlayerFundsCheck(checkIndefinitely) - if checkingPlayerFunds then - local 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) - 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 - ) - end - end -end - -function showPurchasePrompt() - local canPurchase, insufficientFunds, notRightBC, override, descText = canPurchaseItem() - - if canPurchase then - updatePurchasePromptData() - - 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 - - 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 - ) - else -- we failed in prompting a purchase, do a decline - doDeclinePurchase() - end -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 newTool:IsA "Tool" then - return newTool - end - - local toolChildren = newTool:GetChildren() - for i = 1, #toolChildren do - if toolChildren[i]:IsA "Tool" then - return toolChildren[i] - end - end - return nil -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. -function purchaseFailed(inGamePurchasesDisabled) - local name = "Item" - if currentProductInfo then - name = currentProductInfo["Name"] - end - - local newPurchasedFailedText = string.gsub(purchaseFailedText, "itemName", tostring(name)) - if inGamePurchasesDisabled then - newPurchasedFailedText = - string.gsub(newPurchasedFailedText, "errorReason", tostring(errorPurchasesDisabledText)) - else - newPurchasedFailedText = string.gsub(newPurchasedFailedText, "errorReason", tostring(errorPurchasesUnknownText)) - end - - purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedFailedText - purchaseDialog.BodyFrame.ItemPreview.Image = errorImageUrl - - setButtonsVisible(purchaseDialog.BodyFrame.OkButton) - - setHeaderText(buyFailedHeaderText) - - hidePurchasing() -end - --- user has specified they want to buy an item, now try to attempt to buy it for them -function doAcceptPurchase(_) - showPurchasing() -- shows a purchasing ui (shows spinner) - - local startTime = tick() - - -- http call to do the purchase - local response = "none" - local url = nil - - -- 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) - else - 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") - end) - - -- debug output for us (found in the logs from local) - 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) - purchaseFailed() - return - end - - -- parse our response, decide how to react - response = getRbxUtility().DecodeJSON(response) - - 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")) - return - end - end - else - print("web return response of non parsable JSON on purchase of", currentAssetId) - purchaseFailed() - return - end - - -- check to see if this item was bought, and if we want to equip it (also need to make sure the asset type was gear) - if currentEquipOnPurchase and success and currentAssetId and tonumber(currentProductInfo["AssetTypeId"]) == 19 then - local tool = getToolAssetID(tonumber(currentAssetId)) - if tool then - tool.Parent = game.Players.LocalPlayer.Backpack - end - end - - if purchasingConsumable then - if not response["receipt"] then - 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 - ) - else - userPurchaseActionsEnded(success) - end -end - --- user pressed the cancel button, just remove all purchasing prompts -function doDeclinePurchase() - userPurchaseActionsEnded(false) -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) - if currencyEnum == Enum.CurrencyType.Robux or currencyEnum == Enum.CurrencyType.Default then - return 1 - elseif currencyEnum == Enum.CurrencyType.Tix then - return 2 - end -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" - end - - return "" -end - -function currencyTypeToString(currencyType) - if currencyType == Enum.CurrencyType.Tix then - return "Tix" - else - return "R$" - end -end - --- figure out what currency to use based on the currency you can actually sell the item in and what the script specified -function setCurrencyAmountAndType(priceInRobux, priceInTix) - if currentCurrencyType == Enum.CurrencyType.Default or currentCurrencyType == Enum.CurrencyType.Robux then -- sell for default (user doesn't care) or robux - if priceInRobux ~= nil and priceInRobux ~= 0 then -- we can sell for robux - currentCurrencyAmount = priceInRobux - currentCurrencyType = Enum.CurrencyType.Robux - else -- have to use tix - currentCurrencyAmount = priceInTix - currentCurrencyType = Enum.CurrencyType.Tix - end - elseif currentCurrencyType == Enum.CurrencyType.Tix then -- we want to sell for tix - if priceInTix ~= nil and priceInTix ~= 0 then -- we can sell for tix - currentCurrencyAmount = priceInTix - currentCurrencyType = Enum.CurrencyType.Tix - else -- have to use robux - currentCurrencyAmount = priceInRobux - currentCurrencyType = Enum.CurrencyType.Robux - end - else - return false - end - - if currentCurrencyAmount == nil then - return false - end - - return true -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) - if not success then - print("Get player balance failed because", errorCode) - return nil - end - - if playerBalance == "" then - return nil - end - - playerBalance = getRbxUtility().DecodeJSON(playerBalance) - - return playerBalance -end - --- should open an external default browser window to this url -function openBuyCurrencyWindow() - checkingPlayerFunds = true - game:GetService("GuiService"):OpenBrowserWindow(baseUrl .. "Upgrades/Robux.aspx") -end - -function openBCUpSellWindow() - 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) - if isFreeItem() then - purchaseDialog.BodyFrame.AfterBalanceButton.Text = freeItemBalanceText - return true, false - end - - local keyWord = nil - if currentCurrencyType == Enum.CurrencyType.Robux then - keyWord = "robux" - elseif currentCurrencyType == Enum.CurrencyType.Tix then - keyWord = "tickets" - end - - if not keyWord then - return false - end - - local playerBalanceNumber = tonumber(playerBalance[keyWord]) - if not playerBalanceNumber then - return false - end - - 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 afterBalanceNumber < 0 and keyWord == "robux" then - if openBuyCurrencyWindowConnection == nil then - 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." - 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." - 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 - - -- this ensures that we only have one connection to openBuyCurrencyWindow at a time (otherwise might open multiple browser windows) - if openBuyCurrencyWindowConnection then - openBuyCurrencyWindowConnection:disconnect() - openBuyCurrencyWindowConnection = nil - end - 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 -end ----------------------------------------------- End Currency Functions --------------------------------------------- - ----------------------------------------------- Data Functions ----------------------------------------------------- - --- more enum to int fun! -function membershipTypeToNumber(membership) - if membership == Enum.MembershipType.None then - return 0 - elseif membership == Enum.MembershipType.BuildersClub then - return 1 - elseif membership == Enum.MembershipType.TurboBuildersClub then - return 2 - elseif membership == Enum.MembershipType.OutrageousBuildersClub then - return 3 - end - - return -1 -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 descText = nil - local success = false - - if purchasingConsumable then - local currentProductInfoRaw = nil - 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) - 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 - end - - if not purchasingConsumable then - if not currentAssetId then - 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" - return false - end - - 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) - return false - end - - 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 - - -- next we parse through product info and see if we can purchase - - if type(currentProductInfo) ~= "table" then - currentProductInfo = getRbxUtility().DecodeJSON(currentProductInfo) - end - - if not currentProductInfo then - descText = "Could not get product info. Please try again later." - return true, nil, nil, true, descText - end - - if currentProductInfo["IsForSale"] == false and currentProductInfo["IsPublicDomain"] == false then - 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." - return true, nil, nil, true, descText - end - - local playerBalance = getPlayerBalance() - if not playerBalance then - descText = "Could not retrieve your balance. Please try again later." - return true, nil, nil, true, descText - end - - if - tonumber(currentProductInfo["MinimumMembershipLevel"]) - > membershipTypeToNumber(game.Players.LocalPlayer.MembershipType) - then - notRightBc = true - end - - local updatedBalance, insufficientFunds = updateAfterBalanceText(playerBalance, notRightBc) - - if notRightBc then - purchaseDialog.BodyFrame.AfterBalanceButton.Active = true - 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 - 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 not updatedBalance then - descText = "Could not update your balance. Please check back after some time." - return true, nil, nil, true, descText - end - - -- we use insufficient funds to display a prompt to buy more robux - purchaseDialog.BodyFrame.AfterBalanceButton.Active = true - return true, insufficientFunds -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 --- tempSpaceLabel.Text = nString --- tempSpaceLabel.Name = "SpaceButton" - --- while tempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do --- nString = nString .. " " --- tempSpaceLabel.Text = nString --- end --- nString = nString .. " " --- tempSpaceLabel.Text = "" --- return nString --- end - ----------------------------------------------- End Data Functions ----------------------------------------------------- - ----------------------------------------------- Gui Functions ---------------------------------------------- -function startSpinner() - spinning = true - 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" - else - spinnerIcons[pos + 1].Image = "http://www.roblox.com/Asset/?id=45880710" - end - - pos = pos + 1 - end - spinPos = (spinPos + 1) % 8 - wait(1 / 15) - end - end) -end - -function stopSpinner() - spinning = false -end - --- convenience method to say exactly what buttons should be visible (all others are not!) -function setButtonsVisible(...) - local args = { ... } - local argCount = select("#", ...) - - local bodyFrameChildren = purchaseDialog.BodyFrame:GetChildren() - for i = 1, #bodyFrameChildren do - if bodyFrameChildren[i]:IsA "GuiButton" then - bodyFrameChildren[i].Visible = false - for j = 1, argCount do - if bodyFrameChildren[i] == args[j] then - bodyFrameChildren[i].Visible = true - break - end - end - end - end -end - --- used for the "Purchasing..." frame -function createSpinner(size, position, parent) - local spinnerFrame = Instance.new "Frame" - spinnerFrame.Name = "Spinner" - spinnerFrame.Size = size - spinnerFrame.Position = position - spinnerFrame.BackgroundTransparency = 1 - spinnerFrame.ZIndex = 10 - spinnerFrame.Parent = parent - - 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.ZIndex = 10 - spinnerImage.Image = "http://www.roblox.com/Asset/?id=45880710" - spinnerImage.Parent = spinnerFrame - - 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.Name = "PurchaseFrame" - 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.Parent = game.CoreGui.RobloxGui - - 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.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) - local titleBackdrop = titleLabel:Clone() - titleBackdrop.Name = "TitleBackdrop" - 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.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) - cancelButton.BackgroundTransparency = 1 - cancelButton.BorderSizePixel = 0 - cancelButton.Parent = bodyFrame - cancelButton.Modal = true - cancelButton.ZIndex = 8 - cancelButton.Image = cancelButtonImageUrl - cancelButton.MouseButton1Down:connect(function() - cancelButton.Image = cancelButtonDownUrl - end) - cancelButton.MouseButton1Up:connect(function() - cancelButton.Image = cancelButtonImageUrl - end) - 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) - buyButton.BackgroundTransparency = 1 - buyButton.BorderSizePixel = 0 - buyButton.Image = buyImageUrl - buyButton.ZIndex = 8 - buyButton.MouseButton1Down:connect(function() - buyButton.Image = buyImageDownUrl - end) - buyButton.MouseButton1Up:connect(function() - buyButton.Image = buyImageUrl - end) - buyButton.MouseLeave:connect(function() - buyButton.Image = buyImageUrl - end) - buyButton.Parent = bodyFrame - - local buyDisabledButton = buyButton:Clone() - buyDisabledButton.Name = "BuyDisabledButton" - buyDisabledButton.AutoButtonColor = false - buyDisabledButton.Visible = false - buyDisabledButton.Active = false - buyDisabledButton.Image = buyImageDisabledUrl - buyDisabledButton.ZIndex = 8 - buyDisabledButton.Parent = bodyFrame - - local freeButton = buyButton:Clone() - freeButton.BackgroundTransparency = 1 - freeButton.Name = "FreeButton" - freeButton.Visible = false - freeButton.ZIndex = 8 - freeButton.Image = freeButtonImageUrl - freeButton.MouseButton1Down:connect(function() - freeButton.Image = freeButtonImageDownUrl - end) - freeButton.MouseButton1Up:connect(function() - freeButton.Image = freeButtonImageUrl - end) - freeButton.MouseLeave:connect(function() - freeButton.Image = freeButtonImageUrl - end) - freeButton.Parent = bodyFrame - - local okButton = buyButton:Clone() - okButton.Name = "OkButton" - okButton.BackgroundTransparency = 1 - okButton.Visible = false - 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.Image = okButtonUrl - end) - okButton.MouseLeave:connect(function() - okButton.Image = okButtonUrl - end) - okButton.Parent = bodyFrame - - local okPurchasedButton = okButton:Clone() - okPurchasedButton.ZIndex = 8 - okPurchasedButton.Name = "OkPurchasedButton" - okPurchasedButton.MouseButton1Down:connect(function() - okPurchasedButton.Image = okButtonPressedrl - end) - okPurchasedButton.MouseButton1Up:connect(function() - okPurchasedButton.Image = okButtonUrl - end) - okPurchasedButton.MouseLeave:connect(function() - okPurchasedButton.Image = okButtonUrl - end) - okPurchasedButton.Parent = bodyFrame - - okButton.MouseButton1Click:connect(function() - userPurchaseActionsEnded(false) - end) - okPurchasedButton.MouseButton1Click:connect(function() - if purchasingConsumable then - userPurchaseProductActionsEnded(true) - else - signalPromptEnded(true) - end - end) - buyButton.MouseButton1Click:connect(function() - doAcceptPurchase(Enum.CurrencyType.Robux) - end) - freeButton.MouseButton1Click:connect(function() - doAcceptPurchase(false) - end) - - 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.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) - itemDescription.ZIndex = 8 - itemDescription.Parent = itemPreview - - 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.ZIndex = 8 - afterBalanceButton.Parent = bodyFrame - - local purchasingFrame = Instance.new "Frame" - purchasingFrame.Name = "PurchasingFrame" - 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 - purchasingFrame.Visible = false - purchasingFrame.Active = true - purchasingFrame.Parent = purchaseDialog - - 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) -end - --- next two functions control the "Purchasing..." overlay -function showPurchasing() - startSpinner() - purchaseDialog.PurchasingFrame.Visible = true -end - -function hidePurchasing() - purchaseDialog.PurchasingFrame.Visible = false - stopSpinner() -end - --- next 2 functions are convenienvce creation functions for guis -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.TextWrapped = true - textLabel.Name = name - textLabel.Text = text - textLabel.BackgroundTransparency = 1 - textLabel.BorderSizePixel = 0 - textLabel.FontSize = size - - return textLabel -end - -function createImageButton(name) - local imageButton = Instance.new "ImageButton" - imageButton.Size = UDim2.new(0, 153, 0, 46) - imageButton.Name = name - return imageButton -end - -function setHeaderText(text) - purchaseDialog.TitleLabel.Text = text - purchaseDialog.TitleBackdrop.Text = text -end - -function cutSizeInHalfRecursive(_) - -- todo: change the gui size based on how much space we have - --[[changeSize(instance,0.5) - - local children = instance:GetChildren() - for i = 1, #children do - cutSizeInHalfRecursive(children[i]) - end]] -end - -function doubleSizeRecursive(_) - -- todo: change the gui size based on how much space we have - --[[changeSize(instance,2) - - local children = instance:GetChildren() - for i = 1, #children do - doubleSizeRecursive(children[i]) - end]] -end - -function modifyForSmallScreen() - cutSizeInHalfRecursive(purchaseDialog) -end - -function modifyForLargeScreen() - doubleSizeRecursive(purchaseDialog) -end - --- depending on screen size, we need to change the gui -function changeGuiToScreenSize(smallScreen) - if smallScreen then - modifyForSmallScreen() - else - modifyForLargeScreen() - end -end - -function doPurchasePrompt(player, assetId, equipIfPurchased, currencyType, productId) - if not purchaseDialog then - createPurchasePromptGui() - end - - if player == game.Players.LocalPlayer then - if currentlyPrompting then - return - end - - currentlyPrompting = true - - currentAssetId = assetId - currentProductId = productId - currentCurrencyType = currencyType - currentEquipOnPurchase = equipIfPurchased - - purchasingConsumable = (currentProductId ~= nil) - - showPurchasePrompt() - end -end - -function userPurchaseProductActionsEnded(userIsClosingDialog) - checkingPlayerFunds = false - - if userIsClosingDialog then - closePurchasePrompt() - if currentServerResponseTable then - local isPurchased = false - if tostring(currentServerResponseTable["isValid"]):lower() == "true" then - isPurchased = true - end - - Game:GetService("MarketplaceService"):SignalPromptProductPurchaseFinished( - tonumber(currentServerResponseTable["playerId"]), - tonumber(currentServerResponseTable["productId"]), - isPurchased - ) - else - print "Something went wrong, no currentServerResponseTable" - end - removeCurrentPurchaseInfo() - else - local newPurchasedSucceededText = - string.gsub(purchaseSucceededText, "itemName", tostring(currentProductInfo["Name"])) - purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText - setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton) - hidePurchasing() - end -end - -function doProcessServerPurchaseResponse(serverResponseTable) - if not serverResponseTable then - print "Server response table was nil, cancelling purchase" - purchaseFailed() - return - end - - if - serverResponseTable["playerId"] - and tonumber(serverResponseTable["playerId"]) == game.Players.LocalPlayer.userId - then - currentServerResponseTable = serverResponseTable - userPurchaseProductActionsEnded(false) - end -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").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) -end - -Game.CoreGui.RobloxGui.Changed:connect(function() - local nowIsSmallScreen = (game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold) - if nowIsSmallScreen and not isSmallScreen then - changeGuiToScreenSize(true) - elseif not nowIsSmallScreen and isSmallScreen then - changeGuiToScreenSize(false) - end - - isSmallScreen = nowIsSmallScreen -end) - -isSmallScreen = (game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold) -if isSmallScreen then - changeGuiToScreenSize(true) -end diff --git a/lua/152908679.lua b/lua/152908679.lua deleted file mode 100644 index ee0d5a7..0000000 --- a/lua/152908679.lua +++ /dev/null @@ -1,278 +0,0 @@ --- ContextActionTouch.lua --- 2014, created by Ben Tkacheff --- this script controls ui and firing of lua functions that are bound in ContextActionService for touch inputs --- 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 isTouchDevice = Game:GetService("UserInputService").TouchEnabled -local functionTable = {} -local buttonVector = {} -local buttonScreenGui = nil -local buttonFrame = nil - -local ContextDownImage = "http://www.banland.xyz/asset/?id=97166756" -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 maxButtons = #buttonPositionTable - --- Preload images -Game:GetService("ContentProvider"):Preload(ContextDownImage) -Game:GetService("ContentProvider"):Preload(ContextUpImage) - -while not Game.Players do - wait() -end - -while not Game.Players.LocalPlayer do - wait() -end - -function createContextActionGui() - if not buttonScreenGui and isTouchDevice then - buttonScreenGui = Instance.new "ScreenGui" - buttonScreenGui.Name = "ContextActionGui" - - 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.Name = "ContextButtonFrame" - buttonFrame.Parent = buttonScreenGui - end -end - --- functions --- function setButtonSizeAndPosition(object) --- local buttonSize = 55 --- local xOffset = 10 --- local yOffset = 95 - --- -- todo: better way to determine mobile sized screens --- local onSmallScreen = (game.CoreGui.RobloxGui.AbsoluteSize.X < 600) --- if not onSmallScreen then --- buttonSize = 85 --- xOffset = 40 --- end - --- object.Size = UDim2.new(0, buttonSize, 0, buttonSize) --- end - -function contextButtonDown(button, inputObject, actionName) - if inputObject.UserInputType == Enum.UserInputType.Touch then - button.Image = ContextDownImage - contextActionService:CallFunction(actionName, Enum.UserInputState.Begin, inputObject) - end -end - -function contextButtonMoved(button, inputObject, actionName) - if inputObject.UserInputType == Enum.UserInputType.Touch then - button.Image = ContextDownImage - contextActionService:CallFunction(actionName, Enum.UserInputState.Change, inputObject) - end -end - -function contextButtonUp(button, inputObject, actionName) - button.Image = ContextUpImage - if - inputObject.UserInputType == Enum.UserInputType.Touch - and inputObject.UserInputState == Enum.UserInputState.End - then - contextActionService:CallFunction(actionName, Enum.UserInputState.End, inputObject) - end -end - -function isSmallScreenDevice() - return Game:GetService("GuiService"):GetScreenResolution().y <= 320 -end - -function createNewButton(actionName, functionInfoTable) - local contextButton = Instance.new "ImageButton" - contextButton.Name = "ContextActionButton" - contextButton.BackgroundTransparency = 1 - contextButton.Size = UDim2.new(0, 90, 0, 90) - contextButton.Active = true - 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) - oldTouches[inputObject] = nil - end) - contextButton.InputBegan:connect(function(inputObject) - if oldTouches[inputObject] then - return - end - - if inputObject.UserInputState == Enum.UserInputState.Begin and currentButtonTouch == nil then - currentButtonTouch = inputObject - contextButtonDown(contextButton, inputObject, actionName) - end - end) - contextButton.InputChanged:connect(function(inputObject) - 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 - - currentButtonTouch = nil - oldTouches[inputObject] = true - contextButtonUp(contextButton, inputObject, actionName) - end) - - 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) - actionIcon.BackgroundTransparency = 1 - if functionInfoTable["image"] and type(functionInfoTable["image"]) == "string" then - actionIcon.Image = functionInfoTable["image"] - end - actionIcon.Parent = contextButton - - local actionTitle = Instance.new "TextLabel" - actionTitle.Name = "ActionTitle" - actionTitle.Size = UDim2.new(1, 0, 1, 0) - actionTitle.BackgroundTransparency = 1 - actionTitle.Font = Enum.Font.SourceSansBold - actionTitle.TextColor3 = Color3.new(1, 1, 1) - actionTitle.TextStrokeTransparency = 0 - actionTitle.FontSize = Enum.FontSize.Size18 - actionTitle.TextWrapped = true - actionTitle.Text = "" - if functionInfoTable["title"] and type(functionInfoTable["title"]) == "string" then - actionTitle.Text = functionInfoTable["title"] - end - actionTitle.Parent = contextButton - - return contextButton -end - -function createButton(actionName, functionInfoTable) - local button = createNewButton(actionName, functionInfoTable) - - local position = nil - for i = 1, #buttonVector do - if buttonVector[i] == "empty" then - position = i - break - end - end - - if not position then - position = #buttonVector + 1 - end - - if position > maxButtons then - return -- todo: let user know we have too many buttons already? - end - - buttonVector[position] = button - functionTable[actionName]["button"] = button - - button.Position = buttonPositionTable[position] - button.Parent = buttonFrame - - if buttonScreenGui and buttonScreenGui.Parent == nil then - buttonScreenGui.Parent = Game.Players.LocalPlayer.PlayerGui - end -end - -function removeAction(actionName) - if not functionTable[actionName] then - return - end - - local actionButton = functionTable[actionName]["button"] - - if actionButton then - actionButton.Parent = nil - - for i = 1, #buttonVector do - if buttonVector[i] == actionButton then - buttonVector[i] = "empty" - break - end - end - - actionButton:Destroy() - end - - functionTable[actionName] = nil -end - -function addAction(actionName, createTouchButton, functionInfoTable) - if functionTable[actionName] then - removeAction(actionName) - end - functionTable[actionName] = { functionInfoTable } - if createTouchButton and isTouchDevice then - createContextActionGui() - createButton(actionName, functionInfoTable) - end -end - --- Connections -contextActionService.BoundActionChanged:connect(function(actionName, changeName, changeTable) - if functionTable[actionName] and changeTable then - local button = functionTable[actionName]["button"] - if button then - if changeName == "image" then - button.ActionIcon.Image = changeTable[changeName] - elseif changeName == "title" then - button.ActionTitle.Text = changeTable[changeName] - -- elseif changeName == "description" then - -- -- todo: add description to menu - elseif changeName == "position" then - button.Position = changeTable[changeName] - end - end - end -end) - -contextActionService.BoundActionAdded:connect(function(actionName, createTouchButton, functionInfoTable) - addAction(actionName, createTouchButton, functionInfoTable) -end) - -contextActionService.BoundActionRemoved:connect(function(actionName, _) - removeAction(actionName) -end) - -contextActionService.GetActionButtonEvent:connect(function(actionName) - if functionTable[actionName] then - contextActionService:FireActionButtonFoundSignal(actionName, functionTable[actionName]["button"]) - end -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) -end diff --git a/lua/153556783.lua b/lua/153556783.lua deleted file mode 100644 index 61509bf..0000000 --- a/lua/153556783.lua +++ /dev/null @@ -1,647 +0,0 @@ --- This is responsible for all touch controls we show (as of this writing, only on iOS) --- this includes character move thumbsticks, and buttons for jump, use of items, camera, etc. --- Written by Ben Tkacheff, 2013 - --- obligatory stuff to make sure we don't access nil data -while not Game do - wait() -end -while not Game:FindFirstChild "Players" do - wait() -end -while not Game.Players.LocalPlayer do - wait() -end -while not Game:FindFirstChild "CoreGui" do - wait() -end -while not Game.CoreGui:FindFirstChild "RobloxGui" do - wait() -end - -local userInputService = Game:GetService "UserInputService" -local success = pcall(function() - userInputService:IsLuaTouchControls() -end) -if not success then - script:Destroy() -end - ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- --- Variables -local screenResolution = Game:GetService("GuiService"):GetScreenResolution() -function isSmallScreenDevice() - return screenResolution.y <= 320 -end - -local localPlayer = Game.Players.LocalPlayer -local thumbstickSize = 120 -if isSmallScreenDevice() then - thumbstickSize = 70 -end - -local touchControlsSheet = "rbxasset://textures/ui/TouchControlsSheet.png" -local ThumbstickDeadZone = 5 -local ThumbstickMaxPercentGive = 0.92 -local thumbstickTouches = {} - -local jumpButtonSize = 90 -if isSmallScreenDevice() then - jumpButtonSize = 70 -end -local oldJumpTouches = {} -local currentJumpTouch = nil - -local CameraRotateSensitivity = 0.007 -local CameraRotateDeadZone = CameraRotateSensitivity * 16 -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) - ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- --- Functions - -function DistanceBetweenTwoPoints(point1, point2) - 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 - ) -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) - - return transformedPoint -end - -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 - - 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 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 - - -- 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 - local thumbstickFramePosition = Vector2.new(thumbstickFrame.Position.X.Offset, thumbstickFrame.Position.Y.Offset) - local 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)) -end - -function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThumbstick) - local thumbstickFrame = Instance.new "Frame" - thumbstickFrame.Name = "ThumbstickFrame" - thumbstickFrame.Active = true - thumbstickFrame.Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize) - thumbstickFrame.Position = defaultThumbstickPos - thumbstickFrame.BackgroundTransparency = 1 - - local outerThumbstick = Instance.new "ImageLabel" - outerThumbstick.Name = "OuterThumbstick" - outerThumbstick.Image = touchControlsSheet - outerThumbstick.ImageRectOffset = Vector2.new(0, 0) - outerThumbstick.ImageRectSize = Vector2.new(220, 220) - outerThumbstick.BackgroundTransparency = 1 - outerThumbstick.Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize) - outerThumbstick.Position = defaultThumbstickPos - outerThumbstick.Parent = Game.CoreGui.RobloxGui - - local innerThumbstick = Instance.new "ImageLabel" - innerThumbstick.Name = "InnerThumbstick" - innerThumbstick.Image = touchControlsSheet - 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.Parent = thumbstickFrame - innerThumbstick.ZIndex = 2 - - local thumbstickTouch = nil - local userInputServiceTouchMovedCon = nil - 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 - - thumbstickTouch = inputObject - table.insert(thumbstickTouches, thumbstickTouch) - - 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) - ) - else - movementVector = followThumbstickTouchMove( - thumbstickFrame, - outerThumbstick, - Vector2.new(movedInput.Position.x, movedInput.Position.y) - ) - end - - if updateFunction then - 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) - end - - userInputSeviceTouchEndedCon:disconnect() - userInputServiceTouchMovedCon:disconnect() - - thumbstickFrame.Position = defaultThumbstickPos - outerThumbstick.Position = defaultThumbstickPos - - for i, object in pairs(thumbstickTouches) do - if object == thumbstickTouch then - table.remove(thumbstickTouches, i) - break - end - end - thumbstickTouch = nil - end - end) - end - - userInputService.Changed:connect(function(prop) - if prop == "ModalEnabled" then - thumbstickFrame.Visible = not userInputService.ModalEnabled - outerThumbstick.Visible = not userInputService.ModalEnabled - end - end) - - thumbstickFrame.InputBegan:connect(startInputTracking) - return thumbstickFrame -end - -function setupCharacterMovement(parentFrame) - local lastMovementVector, lastMaxMovement = nil - local moveCharacterFunc = localPlayer.MoveCharacter - 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 - maxMovement = movementVector.magnitude - 1 - end - moveCharacterFunc(localPlayer, movementVector, maxMovement) - else - 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) - if isSmallScreenDevice() then - thumbstickPos = UDim2.new(0, (thumbstickSize / 2) - 10, 1, -thumbstickSize - 20) - end - local characterThumbstick = constructThumbstick(thumbstickPos, moveCharacterFunction, false) - characterThumbstick.Name = "CharacterThumbstick" - characterThumbstick.Parent = parentFrame - - local refreshCharacterMovement = function() - if localPlayer and moveCharacterFunc and lastMovementVector and lastMaxMovement then - moveCharacterFunc(localPlayer, lastMovementVector, lastMaxMovement) - end - end - return refreshCharacterMovement -end - -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) - else - jumpButton.Position = UDim2.new(1, -(jumpButtonSize * 2.75), 1, -jumpButtonSize - 120) - end - - local playerJumpFunc = localPlayer.JumpCharacter - - local doJumpLoop = function() - while currentJumpTouch do - if localPlayer then - playerJumpFunc(localPlayer) - end - 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 - for _, touch in pairs(oldJumpTouches) do - if touch == inputObject then - return - end - end - - currentJumpTouch = inputObject - 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) - - if inputObject == currentJumpTouch then - table.insert(oldJumpTouches, currentJumpTouch) - currentJumpTouch = nil - end - end) - userInputService.InputEnded:connect(function(globalInputObject) - for i, touch in pairs(oldJumpTouches) do - if touch == globalInputObject then - table.remove(oldJumpTouches, i) - break - end - end - end) - - userInputService.Changed:connect(function(prop) - if prop == "ModalEnabled" then - jumpButton.Visible = not userInputService.ModalEnabled - end - end) - - jumpButton.Parent = parentFrame -end - -function isTouchUsedByJumpButton(touch) - if touch == currentJumpTouch then - return true - end - for _, touchToCompare in pairs(oldJumpTouches) do - if touch == touchToCompare then - return true - end - end - - return false -end - -function isTouchUsedByThumbstick(touch) - for _, touchToCompare in pairs(thumbstickTouches) do - if touch == touchToCompare then - return true - end - end - - return false -end - -function setupCameraControl(parentFrame, refreshCharacterMoveFunc) - local lastPos = nil - local hasRotatedCamera = false - local rotateCameraFunc = userInputService.RotateCamera - - local pinchTime = -1 - local shouldPinch = false - local lastPinchScale = nil - local zoomCameraFunc = userInputService.ZoomCamera - local pinchTouches = {} - local pinchFrame = nil - - local resetCameraRotateState = function() - cameraTouch = nil - hasRotatedCamera = false - lastPos = nil - end - - local resetPinchState = function() - pinchTouches = {} - lastPinchScale = nil - shouldPinch = false - 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) - - pinchFrame.InputChanged:connect(function(inputObject) - if not shouldPinch then - resetPinchState() - return - end - resetCameraRotateState() - - if lastPinchScale == nil then -- first pinch move, just set up scale - if inputObject == firstTouch then - lastPinchScale = (inputObject.Position - secondTouch.Position).magnitude - firstTouch = inputObject - elseif inputObject == secondTouch then - lastPinchScale = (inputObject.Position - firstTouch.Position).magnitude - secondTouch = inputObject - end - else -- we are now actually pinching, do comparison to last pinch size - local newPinchDistance = 0 - if inputObject == firstTouch then - newPinchDistance = (inputObject.Position - secondTouch.Position).magnitude - firstTouch = inputObject - elseif inputObject == secondTouch then - newPinchDistance = (inputObject.Position - firstTouch.Position).magnitude - secondTouch = inputObject - end - if newPinchDistance ~= 0 then - local pinchDiff = newPinchDistance - lastPinchScale - if pinchDiff ~= 0 then - zoomCameraFunc(userInputService, (pinchDiff * CameraZoomSensitivity)) - end - lastPinchScale = newPinchDistance - end - end - end) - pinchFrame.InputEnded:connect(function(inputObject) -- pinch is over, destroy all - if inputObject == firstTouch or inputObject == secondTouch then - resetPinchState() - 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 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 - - local usedByThumbstick = isTouchUsedByThumbstick(inputObject) - if not usedByThumbstick then - pinchGestureReceivedTouch(inputObject) - end - - if cameraTouch == nil and not usedByThumbstick then - cameraTouch = inputObject - 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 - - 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 - if not hasRotatedCamera and (touchDiff.magnitude > CameraRotateDeadZone) then - hasRotatedCamera = true - lastPos = newPos - end - - -- fire everytime after we have rotated out of deadzone - if hasRotatedCamera and (lastPos ~= newPos) then - rotateCameraFunc(userInputService, touchDiff) - refreshCharacterMoveFunc() - lastPos = newPos - end - end) - 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) - end - end - end) -end - -function setupTouchControls() - local touchControlFrame = Instance.new "Frame" - touchControlFrame.Name = "TouchControlFrame" - touchControlFrame.Size = UDim2.new(1, 0, 1, 0) - touchControlFrame.BackgroundTransparency = 1 - touchControlFrame.Parent = Game.CoreGui.RobloxGui - - local refreshCharacterMoveFunc = setupCharacterMovement(touchControlFrame) - setupJumpButton(touchControlFrame) - setupCameraControl(touchControlFrame, refreshCharacterMoveFunc) - - userInputService.ProcessedEvent:connect(function(inputObject, processed) - 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 - cameraTouch = nil - end - end) -end - ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- --- Start of Script - -if true then --userInputService:IsLuaTouchControls() then - setupTouchControls() -else - script:Destroy() -end diff --git a/lua/157877000.lua b/lua/157877000.lua deleted file mode 100644 index 0bc6726..0000000 --- a/lua/157877000.lua +++ /dev/null @@ -1,1025 +0,0 @@ ---Include -local Create = assert(LoadLibrary "RbxUtility").Create - --- A Few Script Globals -local gui -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, -} - -local ToggleConsole = Create "BindableFunction" { - Name = "ToggleDevConsole", - Parent = gui, -} - -local devConsoleInitialized = false -function initializeDeveloperConsole() - if devConsoleInitialized then - return - end - devConsoleInitialized = true - - ---Dev-Console Variables - local LOCAL_CONSOLE = 1 - local SERVER_CONSOLE = 2 - - local MAX_LIST_SIZE = 1000 - - local minimumSize = Vector2.new(245, 180) - local currentConsole = LOCAL_CONSOLE - - local localMessageList = {} - local serverMessageList = {} - - 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, - 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, - Position = UDim2.new(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), - 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), - } - - 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), - } - - 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, 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), - } - - 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_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), - } - - 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), - } - - 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, - 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_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, - } - - 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 - local previousMousePos = nil - local pPos = nil - - local previousMousePosResize = nil - local pSize = nil - - local previousMousePosScroll = nil - - local pScrollHandle = nil - - local pOffset = nil - - local scrollUpIsDown = false - local scrollDownIsDown = false - - function clean() - previousMousePos = nil - pPos = nil - previousMousePosResize = nil - pSize = nil - previousMousePosScroll = nil - pScrollHandle = nil - pOffset = nil - scrollUpIsDown = false - 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 - - Dev_TitleBar.TextButton.MouseButton1Down:connect(function(x, y) - previousMousePos = Vector2.new(x, y) - pPos = Dev_Container.AbsolutePosition - end) - - Dev_TitleBar.TextButton.MouseButton1Up:connect(function(_, _) - clean() - end) - - ---Handle Dev-Console Size - function refreshConsoleSize(x, y) - 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)) - 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(_, _) - clean() - end) - - ---Handle Dev-Console Close Button - 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 - 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(_, _) - optionsHidden = not optionsHidden - startAnimation() - end) - - --Scroll Position - - function changeOffset(value) - if currentConsole == LOCAL_CONSOLE then - localOffset = localOffset + value - 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 - messageList = localMessageList - 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, - } - 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 - 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.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 - 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 - message.TextColor3 = Color3.new(0.4, 0.5, 1) - elseif messageList[i].Type == Enum.MessageType.MessageWarning then - message.TextColor3 = Color3.new(1, 0.6, 0.4) - else - 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 - -- We don't want it to update 50x in a tick because there are 50 messages in that tick - -- (Whenever for one reason or another a lot of output comes in, it can lag - -- 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() - refreshQueued = false - refreshTextHolderForReal() - end) - refreshQueued = true - end - - --Handle Dev-Console Scrollbar - - local inside = 0 - function holdingUpButton() - if scrollUpIsDown then - return - end - scrollUpIsDown = true - wait(0.6) - inside = inside + 1 - while scrollUpIsDown and inside < 2 do - wait() - changeOffset(12) - end - inside = inside - 1 - end - - function holdingDownButton() - if scrollDownIsDown then - return - end - scrollDownIsDown = true - wait(0.6) - inside = inside + 1 - while scrollDownIsDown and inside < 2 do - wait() - changeOffset(-12) - end - inside = inside - 1 - end - - Dev_Container.Body.ScrollBar.Up.MouseButton1Click:connect(function() - changeOffset(10) - end) - - Dev_Container.Body.ScrollBar.Up.MouseButton1Down:connect(function() - changeOffset(10) - holdingUpButton() - end) - - Dev_Container.Body.ScrollBar.Up.MouseButton1Up:connect(function() - clean() - end) - - Dev_Container.Body.ScrollBar.Down.MouseButton1Down:connect(function() - changeOffset(-10) - holdingDownButton() - end) - - Dev_Container.Body.ScrollBar.Down.MouseButton1Up:connect(function() - clean() - end) - - function handleScroll(x, y) - 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 - localOffset = pOffset - offsetChange - elseif currentConsole == SERVER_CONSOLE then - serverOffset = pOffset - offsetChange - end - end - - Dev_ScrollArea.Handle.MouseButton1Down:connect(function(x, y) - previousMousePosScroll = Vector2.new(x, y) - pScrollHandle = Dev_ScrollArea.Handle.AbsolutePosition - if currentConsole == LOCAL_CONSOLE then - pOffset = localOffset - elseif currentConsole == SERVER_CONSOLE then - pOffset = serverOffset - end - end) - - Dev_ScrollArea.Handle.MouseButton1Up:connect(function(_, _) - clean() - end) - - local function existsInsideContainer(container, x, y) - local pos = container.AbsolutePosition - local size = container.AbsoluteSize - if x < pos.X or x > pos.X + size.X or y < pos.y or y > pos.y + size.y then - return false - end - return true - end - - --Refresh Dev-Console Message Positions - function repositionList() - 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) - 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 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 - offsetRatio = localOffset / Dev_TextHolder.AbsoluteSize.Y - 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 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 - ) - - 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 - Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize + localOffset) - 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 - 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) - - dayTime = dayTime - (hour * 3600) - local minute = math.floor(dayTime / 60) - - dayTime = dayTime - (minute * 60) - - local h = numberWithZero(hour) - local m = numberWithZero(minute) - local s = numberWithZero(dayTime) - - return str:format(h, m, s) - end - - --Filter - - Dev_OptionsBar.ErrorToggleButton.MouseButton1Down:connect(function(_, _) - errorToggleOn = not errorToggleOn - Dev_OptionsBar.ErrorToggleButton.CheckFrame.Visible = errorToggleOn - refreshTextHolder() - repositionList() - end) - - Dev_OptionsBar.WarningToggleButton.MouseButton1Down:connect(function(_, _) - warningToggleOn = not warningToggleOn - Dev_OptionsBar.WarningToggleButton.CheckFrame.Visible = warningToggleOn - refreshTextHolder() - repositionList() - end) - - Dev_OptionsBar.InfoToggleButton.MouseButton1Down:connect(function(_, _) - infoToggleOn = not infoToggleOn - Dev_OptionsBar.InfoToggleButton.CheckFrame.Visible = infoToggleOn - refreshTextHolder() - repositionList() - end) - - Dev_OptionsBar.OutputToggleButton.MouseButton1Down:connect(function(_, _) - outputToggleOn = not outputToggleOn - Dev_OptionsBar.OutputToggleButton.CheckFrame.Visible = outputToggleOn - refreshTextHolder() - repositionList() - end) - - Dev_OptionsBar.WordWrapToggleButton.MouseButton1Down:connect(function(_, _) - wordWrapToggleOn = not wordWrapToggleOn - Dev_OptionsBar.WordWrapToggleButton.CheckFrame.Visible = wordWrapToggleOn - refreshTextHolder() - repositionList() - end) - - ---Dev-Console Message Functionality - function AddLocalMessage(str, messageType, timeStamp) - 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 } - 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(_, _) - 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 - local mouse = game.Players.LocalPlayer:GetMouse() - 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 - - Dev_Container.Body.ServerConsole.MouseButton1Click:connect(function(_, _) - if not serverHistoryRequested then - serverHistoryRequested = true - game:GetService("LogService"):RequestServerOutput() - end - - 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 - local mouse = game.Players.LocalPlayer:GetMouse() - refreshConsolePosition(mouse.X, mouse.Y) - refreshConsoleSize(mouse.X, mouse.Y) - handleScroll(mouse.X, mouse.Y) - end - - refreshTextHolder() - repositionList() - end - end) - - ---Extra Mouse Handlers for Dev-Console - Dev_Container.Body.ServerConsole.MouseButton1Up:connect(function() - clean() - end) - - 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() - refreshConsolePosition(mouse.X, mouse.Y) - refreshConsoleSize(mouse.X, mouse.Y) - handleScroll(mouse.X, mouse.Y) - - refreshTextHolder() - repositionList() - end) - - LocalMouse.Button1Up:connect(function() - clean() - end) - - LocalMouse.WheelForward:connect(function() - if not Dev_Container.Visible then - return - end - if existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) then - changeOffset(10) - end - end) - - LocalMouse.WheelBackward:connect(function() - if not Dev_Container.Visible then - return - end - if existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) then - 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 -function ToggleConsole.OnInvoke() - if currentlyToggling then - return - end - - currentlyToggling = true - initializeDeveloperConsole() - Dev_Container.Visible = not Dev_Container.Visible - currentlyToggling = false -end diff --git a/lua/36868950.lua b/lua/36868950.lua deleted file mode 100644 index 455d653..0000000 --- a/lua/36868950.lua +++ /dev/null @@ -1,110 +0,0 @@ -local controlFrame = script.Parent:FindFirstChild "ControlFrame" - -if not controlFrame then - return -end - -local bottomLeftControl = controlFrame:FindFirstChild "BottomLeftControl" -local bottomRightControl = controlFrame:FindFirstChild "BottomRightControl" - -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.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.BackgroundTransparency = 1 -frameTip.TextTransparency = 1 -frameTip.TextWrap = true - -local inside = Instance.new "BoolValue" -inside.Name = "inside" -inside.Value = false -inside.Parent = frameTip - -function setUpListeners(frameToListen) - local fadeSpeed = 0.1 - frameToListen.Parent.MouseEnter:connect(function() - if frameToListen:FindFirstChild "inside" then - frameToListen.inside.Value = true - wait(1.2) - if frameToListen.inside.Value then - while frameToListen.inside.Value and frameToListen.BackgroundTransparency > 0 do - frameToListen.BackgroundTransparency = frameToListen.BackgroundTransparency - fadeSpeed - frameToListen.TextTransparency = frameToListen.TextTransparency - fadeSpeed - wait() - end - end - end - end) - function killTip(killFrame) - killFrame.inside.Value = false - killFrame.BackgroundTransparency = 1 - killFrame.TextTransparency = 1 - 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" - 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) -end - -wait(5) -- make sure we are loaded in, won't need tool tips for first 5 seconds anyway - ----------------- set up Bottom Left Tool Tips ------------------------- - -local bottomLeftChildren = bottomLeftControl:GetChildren() - -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) - elseif bottomLeftChildren[i].Name == "SettingsButton" then - createSettingsButtonTip(bottomLeftChildren[i]) - end -end - ----------------- set up Bottom Right Tool Tips ------------------------- - -local bottomRightChildren = bottomRightControl:GetChildren() - -for i = 1, #bottomRightChildren do - 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) - else - cameraTip.Position = UDim2.new(0, 0, -1.5, 0) - end - cameraTip.Size = UDim2.new(2, 0, 1.25, 0) - cameraTip.Parent = bottomRightChildren[i] - setUpListeners(cameraTip) - end -end diff --git a/lua/37801172.lua b/lua/37801172.lua deleted file mode 100644 index 79efa68..0000000 --- a/lua/37801172.lua +++ /dev/null @@ -1,108 +0,0 @@ --- 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 touchEnabled = false -pcall(function() - touchEnabled = game:GetService("UserInputService").TouchEnabled -end) - --- library registration -scriptContext:AddCoreScript(60595695, scriptContext, "/Libraries/LibraryRegistration/LibraryRegistration") - -local function waitForChild(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end -end --- local function waitForProperty(instance, property) --- while not instance[property] do --- instance.Changed:wait() --- end --- end - --- Responsible for tracking logging items -local scriptContext = game:GetService "ScriptContext" -scriptContext:AddCoreScript(59002209, scriptContext, "CoreScripts/Sections") - -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") -else - scriptContext:AddCoreScript(153556783, screenGui, "CoreScripts/TouchControls") -end - --- MainBotChatScript -scriptContext:AddCoreScript(39250920, screenGui, "CoreScripts/MainBotChatScript") - --- Popup Script -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") --- Chat script -scriptContext:AddCoreScript(97188756, screenGui, "CoreScripts/ChatScript") --- Purchase Prompt Script -scriptContext:AddCoreScript(107893730, screenGui, "CoreScripts/PurchasePromptScript") - -if not touchEnabled or screenGui.AbsoluteSize.Y > 600 then - -- New Player List - scriptContext:AddCoreScript(48488235, screenGui, "CoreScripts/PlayerListScript") -else - delay(5, function() - if screenGui.AbsoluteSize.Y >= 600 then - -- New Player List - 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") - - 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") - end - - -- Backpack Gear (handles all backpack gear tab stuff) - game:GetService("ScriptContext"):AddCoreScript(89449008, Backpack, "CoreScripts/BackpackScripts/BackpackGear") - -- Loadout Script, used for gear hotkeys - 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") - end -end - -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") - 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") - screenGui.ControlFrame.BottomLeftControl.Visible = false - - waitForChild(screenGui.ControlFrame, "TopLeftControl") - screenGui.ControlFrame.TopLeftControl.Visible = false -end diff --git a/lua/38037565.lua b/lua/38037565.lua deleted file mode 100644 index ea37dbe..0000000 --- a/lua/38037565.lua +++ /dev/null @@ -1,239 +0,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 -end - --- declarations -local Figure = script.Parent -local Humanoid = waitForChild(Figure, "Humanoid") -local Torso = waitForChild(Figure, "Torso") - -local config = Figure:FindFirstChild "PlayerStats" - -local inCharTag = Instance.new "BoolValue" -inCharTag.Name = "InCharTag" - -local hider = Instance.new "BoolValue" -hider.Name = "RobloxBuildTool" - -local currentChildren -local backpackTools - -if config == nil then - config = Instance.new "Configuration" - config.Parent = Figure - config.Name = "PlayerStats" -end - -local myHealth = config:FindFirstChild "MaxHealth" -if myHealth == nil then - myHealth = Instance.new "NumberValue" - myHealth.Parent = config - myHealth.Value = 100 - myHealth.Name = "MaxHealth" -end - -Humanoid.MaxHealth = myHealth.Value -Humanoid.Health = myHealth.Value - -function onMaxHealthChange() - Humanoid.MaxHealth = myHealth.Value - Humanoid.Health = myHealth.Value -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" -if dotGui == nil then - dotGui = Instance.new "BillboardGui" - dotGui.Name = "DamageOverTimeGui" - dotGui.Parent = vPlayer.PlayerGui - dotGui.Adornee = script.Parent:FindFirstChild "Head" - dotGui.Active = true - dotGui.size = UDim2.new(damageGuiWidth, 0, damageGuiHeight, 0.0) - dotGui.StudsOffset = Vector3.new(0, 2.0, 0.0) -end - -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, 1, 0.0) - textLabel.Active = true - textLabel.FontSize = 6 - textLabel.BackgroundTransparency = 1 - textLabel.Parent = dotGui - - 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() -end - -function setMaxHealth() - --print(Humanoid.Health) - if myHealth.Value >= 0 then - Humanoid.MaxHealth = myHealth.Value - print(Humanoid.MaxHealth) - if Humanoid.Health > Humanoid.MaxHealth then - Humanoid.Health = Humanoid.MaxHealth - end - end -end - -myHealth.Changed:connect(setMaxHealth) - --- Visual Effects -- - -local fireEffect = Instance.new "Fire" -fireEffect.Heat = 0.1 -fireEffect.Size = 3.0 -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 - local regen = config:FindFirstChild "Regen" - local poison = config:FindFirstChild "Poison" - local ice = config:FindFirstChild "Ice" - local fire = config:FindFirstChild "Fire" - local 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 - 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 - for i = 1, #backpackTools do - if backpackTools[i]:FindFirstChild "RobloxBuildTool" == nil then - hider:Clone().Parent = backpackTools[i] - backpackTools[i].Parent = game.Lighting - 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 - local 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 - local wasInChar = 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 - end - - if delta ~= 0 then - coroutine.resume(coroutine.create(billboardHealthChange), delta) - 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 - --myHealth.Value = math.floor(Humanoid.Health) - elseif delta > 0 then - Humanoid.Health = Humanoid.MaxHealth - --myHealth.Value = Humanoid.Health - end - end -end diff --git a/lua/39250920.lua b/lua/39250920.lua deleted file mode 100644 index 0f1f30a..0000000 --- a/lua/39250920.lua +++ /dev/null @@ -1,588 +0,0 @@ -function waitForProperty(instance, name) - while not instance[name] do - instance.Changed:wait() - end -end - -function waitForChild(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end -end - -local mainFrame -local choices = {} -local lastChoice -local choiceMap = {} -local currentConversationDialog -local currentConversationPartner -local currentAbortDialogScript - -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 conversationTimedOutSize = 350 - -local player -local chatNotificationGui -local messageDialog -local timeoutScript -local reenableDialogScript -local dialogMap = {} -local dialogConnections = {} - -local gui = nil -waitForChild(game, "CoreGui") -waitForChild(game.CoreGui, "RobloxGui") -if game.CoreGui.RobloxGui:FindFirstChild "ControlFrame" then - gui = game.CoreGui.RobloxGui.ControlFrame -else - gui = game.CoreGui.RobloxGui -end - -function currentTone() - if currentConversationDialog then - return currentConversationDialog.Tone - else - return Enum.DialogTone.Neutral - end -end - -function createChatNotificationGui() - chatNotificationGui = Instance.new "BillboardGui" - chatNotificationGui.Name = "ChatNotificationGui" - chatNotificationGui.ExtentsOffset = Vector3.new(0, 1, 0) - chatNotificationGui.Size = UDim2.new(4, 0, 5.42857122, 0) - chatNotificationGui.SizeOffset = Vector2.new(0, 0) - chatNotificationGui.StudsOffset = Vector3.new(0.4, 4.3, 0) - chatNotificationGui.Enabled = true - chatNotificationGui.RobloxLocked = true - chatNotificationGui.Active = true - - 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, 1, 0) - image.Image = "" - image.RobloxLocked = true - image.Parent = chatNotificationGui - - 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.Parent = image -end - -function getChatColor(tone) - if tone == Enum.DialogTone.Neutral then - return Enum.ChatColor.Blue - elseif tone == Enum.DialogTone.Friendly then - return Enum.ChatColor.Green - elseif tone == Enum.DialogTone.Enemy then - return Enum.ChatColor.Red - end -end - -function styleChoices(tone) - for _, obj in pairs(choices) do - resetColor(obj, tone) - end - resetColor(lastChoice, tone) -end - -function styleMainFrame(tone) - if tone == Enum.DialogTone.Neutral then - mainFrame.Style = Enum.FrameStyle.ChatBlue - mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png" - elseif tone == Enum.DialogTone.Friendly then - mainFrame.Style = Enum.FrameStyle.ChatGreen - mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botGreen_tailRight.png" - elseif tone == Enum.DialogTone.Enemy then - mainFrame.Style = Enum.FrameStyle.ChatRed - mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botRed_tailRight.png" - end - - styleChoices(tone) -end -function setChatNotificationTone(gui, purpose, tone) - if tone == Enum.DialogTone.Neutral then - gui.Image.Image = "rbxasset://textures/chatBubble_botBlue_notify_bkg.png" - elseif tone == Enum.DialogTone.Friendly then - gui.Image.Image = "rbxasset://textures/chatBubble_botGreen_notify_bkg.png" - elseif tone == Enum.DialogTone.Enemy then - gui.Image.Image = "rbxasset://textures/chatBubble_botRed_notify_bkg.png" - end - if purpose == Enum.DialogPurpose.Quest then - gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_bang.png" - elseif purpose == Enum.DialogPurpose.Help then - gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_question.png" - elseif purpose == Enum.DialogPurpose.Shop then - gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_money.png" - end -end - -function createMessageDialog() - messageDialog = Instance.new "Frame" - messageDialog.Name = "DialogScriptMessage" - messageDialog.Style = Enum.FrameStyle.RobloxRound - messageDialog.Visible = false - - 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.FontSize = Enum.FontSize.Size14 - text.BackgroundTransparency = 1 - 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.Visible = true - wait(2) - messageDialog.Visible = false -end - -function variableDelay(str) - local length = math.min(string.len(str), 100) - 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) - 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) - 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) - 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) - elseif tone == Enum.DialogTone.Friendly then - 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) - end -end - -function endDialog() - if currentAbortDialogScript then - currentAbortDialogScript:Remove() - currentAbortDialogScript = nil - end - - local dialog = currentConversationDialog - currentConversationDialog = nil - if dialog and dialog.InUse then - local reenableScript = reenableDialogScript:Clone() - reenableScript.archivable = false - reenableScript.Disabled = false - reenableScript.Parent = dialog - end - - for dialog, gui in pairs(dialogMap) do - if dialog and gui then - gui.Enabled = not dialog.InUse - end - end - - currentConversationPartner = nil -end - -function wanderDialog() - print "Wander" - mainFrame.Visible = false - endDialog() - showMessage(characterWanderedOffMessage, characterWanderedOffSize) -end - -function timeoutDialog() - print "Timeout" - mainFrame.Visible = false - endDialog() - showMessage(conversationTimedOut, conversationTimedOutSize) -end -function normalEndDialog() - print "Done" - endDialog() -end - -function sanitizeMessage(msg) - if string.len(msg) == 0 then - return "..." - else - return msg - end -end - -function selectChoice(choice) - renewKillswitch(currentConversationDialog) - - --First hide the Gui - mainFrame.Visible = false - if choice == lastChoice then - game.Chat:Chat(game.Players.LocalPlayer.Character, "Goodbye!", getChatColor(currentTone())) - - normalEndDialog() - else - local dialogChoice = choiceMap[choice] - - 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()) - ) - - variableDelay(dialogChoice.ResponseDialog) - presentDialogChoices(currentConversationPartner, dialogChoice:GetChildren()) - end -end - -function newChoice(numberText) - 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 - - local number = Instance.new "TextLabel" - number.Name = "Number" - 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.TextXAlignment = Enum.TextXAlignment.Left - number.TextYAlignment = Enum.TextYAlignment.Top - number.RobloxLocked = true - number.Parent = frame - - local prompt = Instance.new "TextLabel" - prompt.Name = "UserPrompt" - prompt.BackgroundTransparency = 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.TextXAlignment = Enum.TextXAlignment.Left - prompt.TextYAlignment = Enum.TextYAlignment.Top - prompt.TextWrap = 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)" - - lastChoice = newChoice "5)" - lastChoice.UserPrompt.Text = "Goodbye!" - lastChoice.Size = UDim2.new(1, 0, 0, 28) - - mainFrame = Instance.new "Frame" - mainFrame.Name = "UserDialogArea" - mainFrame.Size = UDim2.new(0, 350, 0, 200) - mainFrame.Style = Enum.FrameStyle.ChatBlue - mainFrame.Visible = false - - local imageLabel = Instance.new "ImageLabel" - imageLabel.Name = "Tail" - 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.Parent = mainFrame - - for _, obj in pairs(choices) do - obj.RobloxLocked = true - obj.Parent = mainFrame - end - lastChoice.RobloxLocked = true - lastChoice.Parent = mainFrame - - mainFrame.RobloxLocked = true - mainFrame.Parent = parent -end - -function presentDialogChoices(talkingPart, dialogChoices) - if not currentConversationDialog then - return - end - - currentConversationPartner = talkingPart - local sortedDialogChoices = {} - for _, obj in pairs(dialogChoices) do - if obj:IsA "DialogChoice" then - table.insert(sortedDialogChoices, obj) - end - end - table.sort(sortedDialogChoices, function(a, b) - return a.Name < b.Name - end) - - if #sortedDialogChoices == 0 then - normalEndDialog() - return - end - - local pos = 1 - local yPosition = 0 - choiceMap = {} - for _, obj in pairs(choices) do - obj.Visible = false - end - - for _, 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].UserPrompt.Text = obj.UserDialog - 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 - pos = pos + 1 - end - end - - 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, -mainFrame.Size.Y.Offset - 20) - styleMainFrame(currentTone()) - mainFrame.Visible = true -end - -function doDialog(dialog) - while not Instance.Lock(dialog, player) do - wait() - end - - if dialog.InUse then - Instance.Unlock(dialog) - return - else - dialog.InUse = true - Instance.Unlock(dialog) - end - - currentConversationDialog = dialog - game.Chat:Chat(dialog.Parent, dialog.InitialPrompt, getChatColor(dialog.Tone)) - variableDelay(dialog.InitialPrompt) - - presentDialogChoices(dialog.Parent, dialog:GetChildren()) -end - -function renewKillswitch(dialog) - if currentAbortDialogScript then - currentAbortDialogScript:Remove() - currentAbortDialogScript = nil - end - - currentAbortDialogScript = timeoutScript:Clone() - currentAbortDialogScript.archivable = false - currentAbortDialogScript.Disabled = false - currentAbortDialogScript.Parent = dialog -end - -function checkForLeaveArea() - while currentConversationDialog do - if - currentConversationDialog.Parent - and ( - player:DistanceFromCharacter(currentConversationDialog.Parent.Position) - >= currentConversationDialog.ConversationDistance - ) - then - wanderDialog() - end - wait(1) - end -end - -function startDialog(dialog) - if dialog.Parent and dialog.Parent:IsA "BasePart" then - if player:DistanceFromCharacter(dialog.Parent.Position) >= dialog.ConversationDistance then - showMessage(tooFarAwayMessage, tooFarAwaySize) - return - end - - for dialog, gui in pairs(dialogMap) do - if dialog and gui then - gui.Enabled = false - end - end - - renewKillswitch(dialog) - - delay(1, checkForLeaveArea) - doDialog(dialog) - end -end - -function removeDialog(dialog) - if dialogMap[dialog] then - dialogMap[dialog]:Remove() - dialogMap[dialog] = nil - end - if dialogConnections[dialog] then - dialogConnections[dialog]:disconnect() - dialogConnections[dialog] = nil - end -end - -function addDialog(dialog) - if dialog.Parent then - if dialog.Parent:IsA "BasePart" then - local chatGui = chatNotificationGui:clone() - 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) - setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone) - - dialogMap[dialog] = chatGui - - dialogConnections[dialog] = dialog.Changed:connect(function(prop) - if prop == "Parent" and dialog.Parent then - --This handles the reparenting case, seperate from removal case - removeDialog(dialog) - addDialog(dialog) - elseif prop == "InUse" then - chatGui.Enabled = not currentConversationDialog and not dialog.InUse - if dialog == currentConversationDialog then - timeoutDialog() - end - elseif prop == "Tone" or prop == "Purpose" then - setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone) - 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 - --This handles the reparenting case, seperate from removal case - removeDialog(dialog) - addDialog(dialog) - end - end) - end - end -end - -function fetchScripts() - local model = game:GetService("InsertService"):LoadAsset(39226062) - 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") - timeoutScript = model.TimeoutScript - waitForChild(model, "ReenableDialogScript") - reenableDialogScript = model.ReenableDialogScript -end - -function onLoad() - waitForProperty(game.Players, "LocalPlayer") - player = game.Players.LocalPlayer - waitForProperty(player, "Character") - - --print("Fetching Scripts") - fetchScripts() - - --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("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() diff --git a/lua/45284430.lua b/lua/45284430.lua deleted file mode 100644 index 5bf7042..0000000 --- a/lua/45284430.lua +++ /dev/null @@ -1,4120 +0,0 @@ -local t = {} - -local function ScopedConnect(parentInstance, instance, event, signalFunc, syncFunc, removeFunc) - local eventConnection = nil - - --Connection on parentInstance is scoped by parentInstance (when destroyed, it goes away) - local tryConnect = function() - if game:IsAncestorOf(parentInstance) then - --Entering the world, make sure we are connected/synced - if not eventConnection then - eventConnection = instance[event]:connect(signalFunc) - 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 - 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 - localInstance = localInstance.Parent - end - return localInstance -end - -local function CreateButtons(frame, buttons, yPos, ySize) - local buttonNum = 1 - local buttonObjs = {} - for _, 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.Modal = true - if obj["Style"] then - button.Style = obj.Style - else - button.Style = Enum.ButtonStyle.RobloxButton - end - button.Text = obj.Text - 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 - - if numButtons == 1 then - frame.Button1.Position = UDim2.new(0.35, 0, yPos.Scale, yPos.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(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(0.35, 0, ySize.Scale, ySize.Offset) - elseif numButtons >= 3 then - 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].Size = UDim2.new(buttonSize, 0, ySize.Scale, ySize.Offset) - buttonNum = buttonNum + 1 - end - end -end - -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 wholeNum, remainder = math.modf(relativePosX * newStep) - if remainder > 0.5 then - wholeNum = wholeNum + 1 - end - 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) - end -end - -local function cancelSlide(areaSoak) - areaSoak.Visible = false - if areaSoakMouseMoveCon then - areaSoakMouseMoveCon:disconnect() - end -end - -t.CreateStyledMessageDialog = function(title, message, style, buttons) - 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" - styleImage.Name = "StyleImage" - styleImage.BackgroundTransparency = 1 - 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" - elseif style == "notify" or style == "Notify" then - styleImage.Size = UDim2.new(0, 71, 0, 71) - styleImage.Image = "http://www.roblox.com/asset?id=42604978" - elseif style == "confirm" or style == "Confirm" then - styleImage.Size = UDim2.new(0, 74, 0, 76) - styleImage.Image = "http://www.roblox.com/asset?id=42557901" - else - return t.CreateMessageDialog(title, message, buttons) - end - styleImage.Parent = frame - - 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.Position = UDim2.new(0, 80, 0, 0) - titleLabel.Size = UDim2.new(1, -80, 0, 40) - titleLabel.Font = Enum.Font.ArialBold - titleLabel.FontSize = Enum.FontSize.Size36 - titleLabel.TextXAlignment = Enum.TextXAlignment.Center - titleLabel.TextYAlignment = Enum.TextYAlignment.Center - titleLabel.Parent = frame - - 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.Position = UDim2.new(0.025, 80, 0, 45) - messageLabel.Size = UDim2.new(0.95, -80, 0, 55) - messageLabel.BackgroundTransparency = 1 - messageLabel.Font = Enum.Font.Arial - messageLabel.FontSize = Enum.FontSize.Size18 - messageLabel.TextWrap = true - messageLabel.TextXAlignment = Enum.TextXAlignment.Left - messageLabel.TextYAlignment = Enum.TextYAlignment.Top - messageLabel.Parent = frame - - 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" - 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" - titleLabel.Name = "Title" - titleLabel.Text = title - titleLabel.BackgroundTransparency = 1 - 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 - titleLabel.FontSize = Enum.FontSize.Size36 - titleLabel.TextXAlignment = Enum.TextXAlignment.Center - titleLabel.TextYAlignment = Enum.TextYAlignment.Center - titleLabel.Parent = frame - - local messageLabel = Instance.new "TextLabel" - messageLabel.Name = "Message" - messageLabel.Text = message - 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, 0.55, 0) - messageLabel.BackgroundTransparency = 1 - messageLabel.Font = Enum.Font.Arial - messageLabel.FontSize = Enum.FontSize.Size18 - messageLabel.TextWrap = true - messageLabel.TextXAlignment = Enum.TextXAlignment.Left - messageLabel.TextYAlignment = Enum.TextYAlignment.Top - messageLabel.Parent = frame - - CreateButtons(frame, buttons, UDim.new(0.8, 0), UDim.new(0.15, 0)) - - return frame -end - -t.CreateDropDownMenu = function(items, onSelect, forRoblox) - local width = UDim.new(0, 100) - local height = UDim.new(0, 32) - - local frame = Instance.new "Frame" - frame.Name = "DropDownMenu" - frame.BackgroundTransparency = 1 - frame.Size = UDim2.new(width, height) - - local dropDownMenu = Instance.new "TextButton" - dropDownMenu.Name = "DropDownMenuButton" - dropDownMenu.TextWrap = true - dropDownMenu.TextColor3 = Color3.new(1, 1, 1) - dropDownMenu.Text = "Choose One" - dropDownMenu.Font = Enum.Font.ArialBold - dropDownMenu.FontSize = Enum.FontSize.Size18 - dropDownMenu.TextXAlignment = Enum.TextXAlignment.Left - dropDownMenu.TextYAlignment = Enum.TextYAlignment.Center - dropDownMenu.BackgroundTransparency = 1 - dropDownMenu.AutoButtonColor = true - dropDownMenu.Style = Enum.ButtonStyle.RobloxButton - dropDownMenu.Size = UDim2.new(1, 0, 1, 0) - dropDownMenu.Parent = frame - dropDownMenu.ZIndex = 2 - - 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.Parent = dropDownMenu - dropDownIcon.ZIndex = 2 - - local itemCount = #items - local dropDownItemCount = #items - local useScrollButtons = false - if dropDownItemCount > 6 then - useScrollButtons = true - dropDownItemCount = 6 - end - - 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) * 0.8, 0) - droppedDownMenu.Parent = frame - droppedDownMenu.ZIndex = 2 - - 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.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, 0.8 / ((dropDownItemCount + 1) * 0.8), 0) - else - 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" - areaSoak.Name = "AreaSoak" - areaSoak.Text = "" - areaSoak.BackgroundTransparency = 1 - areaSoak.Active = true - areaSoak.Size = UDim2.new(1, 0, 1, 0) - areaSoak.Visible = false - areaSoak.ZIndex = 3 - - local dropDownSelected = false - - local scrollUpButton - local scrollDownButton - local scrollMouseCount = 0 - - local setZIndex = function(baseZIndex) - 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 _, child in ipairs(children) do - if child.Name == "ChoiceButton" then - child.ZIndex = baseZIndex + 2 - elseif child.Name == "ClickCaptureButton" then - child.ZIndex = baseZIndex - end - end - end - end - - local scrollBarPosition = 1 - local updateScroll = function() - if scrollUpButton then - scrollUpButton.Active = scrollBarPosition > 1 - end - if scrollDownButton then - scrollDownButton.Active = scrollBarPosition + dropDownItemCount <= itemCount - end - - local children = droppedDownMenu:GetChildren() - if not children then - return - end - - local childNum = 1 - for _, 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) * 0.8) / ((dropDownItemCount + 1) * 0.8), 0) - obj.Visible = true - end - obj.TextColor3 = Color3.new(1, 1, 1) - obj.BackgroundTransparency = 1 - - childNum = childNum + 1 - end - end - end - local toggleVisibility = function() - dropDownSelected = not dropDownSelected - - areaSoak.Visible = not areaSoak.Visible - dropDownMenu.Visible = not dropDownSelected - droppedDownMenu.Visible = dropDownSelected - if dropDownSelected then - setZIndex(4) - else - setZIndex(2) - end - if useScrollButtons then - updateScroll() - end - end - droppedDownMenu.MouseButton1Click:connect(toggleVisibility) - - local updateSelection = function(text) - local foundItem = false - local children = droppedDownMenu:GetChildren() - local childNum = 1 - if children then - for _, obj in ipairs(children) do - if obj.Name == "ChoiceButton" then - if obj.Text == text then - obj.Font = Enum.Font.ArialBold - foundItem = true - scrollBarPosition = childNum - else - obj.Font = Enum.Font.Arial - end - childNum = childNum + 1 - end - end - end - if not text then - dropDownMenu.Text = "Choose One" - scrollBarPosition = 1 - else - if not foundItem then - error("Invalid Selection Update -- " .. text) - end - - if scrollBarPosition + dropDownItemCount > itemCount + 1 then - scrollBarPosition = itemCount - dropDownItemCount + 1 - end - - dropDownMenu.Text = text - end - end - - local function scrollDown() - if scrollBarPosition + dropDownItemCount <= itemCount then - scrollBarPosition = scrollBarPosition + 1 - updateScroll() - return true - end - return false - end - local function scrollUp() - if scrollBarPosition > 1 then - scrollBarPosition = scrollBarPosition - 1 - updateScroll() - return true - end - return false - end - - if useScrollButtons then - --Make some scroll buttons - 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 * 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.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.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 - - 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" - scrollbar.Name = "ScrollBar" - scrollbar.Image = "rbxasset://textures/ui/scrollbar.png" - scrollbar.BackgroundTransparency = 1 - 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 _, 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 - button.Text = item - button.Parent = droppedDownMenu - button.MouseButton1Click:connect(function() - --Remove Highlight - button.TextColor3 = Color3.new(1, 1, 1) - button.BackgroundTransparency = 1 - - updateSelection(item) - onSelect(item) - - toggleVisibility() - end) - button.MouseEnter:connect(function() - --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.BackgroundTransparency = 1 - end) - end - - --This does the initial layout of the buttons - updateScroll() - - frame.AncestryChanged:connect(function(_, parent) - if parent == nil then - areaSoak.Parent = nil - else - areaSoak.Parent = getScreenGuiAncestor(frame) - end - end) - - dropDownMenu.MouseButton1Click:connect(toggleVisibility) - areaSoak.MouseButton1Click:connect(toggleVisibility) - return frame, updateSelection -end - -t.CreatePropertyDropDownMenu = function(instance, property, enum) - local items = enum:GetEnumItems() - local names = {} - local nameToItem = {} - 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) - - ScopedConnect(frame, instance, "Changed", function(prop) - if prop == property then - updateSelection(instance[property].Name) - 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" - end - - if font == Enum.Font.Legacy then - if fontSize == Enum.FontSize.Size8 then - return 12 - elseif fontSize == Enum.FontSize.Size9 then - return 14 - elseif fontSize == Enum.FontSize.Size10 then - return 15 - elseif fontSize == Enum.FontSize.Size11 then - return 17 - elseif fontSize == Enum.FontSize.Size12 then - return 18 - elseif fontSize == Enum.FontSize.Size14 then - return 21 - elseif fontSize == Enum.FontSize.Size18 then - return 27 - elseif fontSize == Enum.FontSize.Size24 then - return 36 - elseif fontSize == Enum.FontSize.Size36 then - return 54 - elseif fontSize == Enum.FontSize.Size48 then - return 72 - else - error "Unknown FontSize" - end - elseif font == Enum.Font.Arial or font == Enum.Font.ArialBold then - if fontSize == Enum.FontSize.Size8 then - return 8 - elseif fontSize == Enum.FontSize.Size9 then - return 9 - elseif fontSize == Enum.FontSize.Size10 then - return 10 - elseif fontSize == Enum.FontSize.Size11 then - return 11 - elseif fontSize == Enum.FontSize.Size12 then - return 12 - elseif fontSize == Enum.FontSize.Size14 then - return 14 - elseif fontSize == Enum.FontSize.Size18 then - return 18 - elseif fontSize == Enum.FontSize.Size24 then - return 24 - elseif fontSize == Enum.FontSize.Size36 then - return 36 - elseif fontSize == Enum.FontSize.Size48 then - return 48 - else - error "Unknown FontSize" - end - else - error("Unknown Font " .. font) - end -end - -local function layoutGuiObjectsHelper(frame, guiObjects, settingsTable) - local totalPixels = frame.AbsoluteSize.Y - local pixelsRemaining = frame.AbsoluteSize.Y - for _, child in ipairs(guiObjects) do - 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.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"] - ) - 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 - - if isLabel then - pixelsRemaining = pixelsRemaining - settingsTable["TextLabelPositionPadY"] - else - pixelsRemaining = pixelsRemaining - settingsTable["TextButtonPositionPadY"] - end - else - child.Visible = false - pixelsRemaining = -1 - end - else - --GuiObject - 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 - end -end - -t.LayoutGuiObjects = function(frame, guiObjects, settingsTable) - if not frame:IsA "GuiObject" then - error "Frame must be a GuiObject" - end - for _, child in ipairs(guiObjects) do - if not child:IsA "GuiObject" then - error "All elements that are layed out must be of type GuiObject" - end - end - - if not settingsTable then - settingsTable = {} - end - - if not settingsTable["TextLabelSizePadY"] then - settingsTable["TextLabelSizePadY"] = 0 - end - if not settingsTable["TextLabelPositionPadY"] then - settingsTable["TextLabelPositionPadY"] = 0 - end - if not settingsTable["TextButtonSizePadY"] then - settingsTable["TextButtonSizePadY"] = 12 - end - if not settingsTable["TextButtonPositionPadY"] then - settingsTable["TextButtonPositionPadY"] = 2 - end - - --Wrapper frame takes care of styled objects - local wrapperFrame = Instance.new "Frame" - wrapperFrame.Name = "WrapperFrame" - wrapperFrame.BackgroundTransparency = 1 - wrapperFrame.Size = UDim2.new(1, 0, 1, 0) - wrapperFrame.Parent = frame - - for _, child in ipairs(guiObjects) do - child.Parent = wrapperFrame - end - - local recalculate = function() - 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.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) - sliderGui.BackgroundTransparency = 1 - sliderGui.Name = "SliderGui" - - local sliderSteps = Instance.new "IntValue" - sliderSteps.Name = "SliderSteps" - sliderSteps.Value = steps - sliderSteps.Parent = sliderGui - - 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.Visible = false - areaSoak.ZIndex = 4 - - sliderGui.AncestryChanged:connect(function(_, parent) - if parent == nil then - areaSoak.Parent = nil - else - areaSoak.Parent = getScreenGuiAncestor(sliderGui) - end - end) - - local sliderPosition = Instance.new "IntValue" - sliderPosition.Name = "SliderPosition" - sliderPosition.Value = 0 - sliderPosition.Parent = sliderGui - - local bar = Instance.new "TextButton" - bar.Text = "" - bar.AutoButtonColor = false - bar.Name = "Bar" - bar.BackgroundColor3 = Color3.new(0, 0, 0) - if type(width) == "number" then - bar.Size = UDim2.new(0, width, 0, 5) - else - bar.Size = UDim2.new(0, 200, 0, 5) - end - 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 - bar.Position = position - end - - 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.ZIndex = 3 - slider.Parent = bar - - local areaSoakMouseMoveCon = nil - - areaSoak.MouseLeave:connect(function() - if areaSoak.Visible then - cancelSlide(areaSoak) - end - end) - areaSoak.MouseButton1Up:connect(function() - if areaSoak.Visible then - cancelSlide(areaSoak) - end - end) - - slider.MouseButton1Down:connect(function() - areaSoak.Visible = true - if areaSoakMouseMoveCon then - areaSoakMouseMoveCon:disconnect() - end - areaSoakMouseMoveCon = areaSoak.MouseMoved:connect(function(x, _) - setSliderPos(x, slider, sliderPosition, bar, steps) - end) - end) - - slider.MouseButton1Up:connect(function() - cancelSlide(areaSoak) - end) - - sliderPosition.Changed:connect(function(_) - 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, _) - 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 - - local internalChange = false - - local descendantsChangeConMap = {} - - local scrollingFrame = Instance.new "Frame" - scrollingFrame.Name = "ScrollingFrame" - scrollingFrame.Active = true - scrollingFrame.Size = UDim2.new(1, 0, 1, 0) - scrollingFrame.ClipsDescendants = true - - 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.Parent = scrollingFrame - - local scrollBottom = Instance.new "BoolValue" - scrollBottom.Value = false - scrollBottom.Name = "ScrollBottom" - scrollBottom.Parent = controlFrame - - local scrollUp = Instance.new "BoolValue" - scrollUp.Value = false - scrollUp.Name = "scrollUp" - scrollUp.Parent = controlFrame - - 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.BackgroundTransparency = 0.5 - 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) - 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.Parent = scrollUpButton - end - scrollUpButton.MouseEnter:connect(function() - scrollUpButton.BackgroundTransparency = 0.1 - local upChildren = scrollUpButton:GetChildren() - for i = 1, #upChildren do - upChildren[i].BackgroundTransparency = 0.1 - end - end) - scrollUpButton.MouseLeave:connect(function() - scrollUpButton.BackgroundTransparency = 0.5 - local upChildren = scrollUpButton:GetChildren() - for i = 1, #upChildren do - upChildren[i].BackgroundTransparency = 0.5 - end - end) - - local scrollDownButton = scrollUpButton:clone() - scrollDownButton.Name = "ScrollDownButton" - 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)) - end - scrollDownButton.MouseEnter:connect(function() - scrollDownButton.BackgroundTransparency = 0.1 - local downChildren = scrollDownButton:GetChildren() - for i = 1, #downChildren do - downChildren[i].BackgroundTransparency = 0.1 - end - end) - scrollDownButton.MouseLeave:connect(function() - scrollDownButton.BackgroundTransparency = 0.5 - local downChildren = scrollDownButton:GetChildren() - for i = 1, #downChildren do - downChildren[i].BackgroundTransparency = 0.5 - end - end) - scrollDownButton.Parent = controlFrame - - 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.Parent = controlFrame - - 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 = "" - scrollbar.Active = true - scrollbar.Name = "ScrollBar" - 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.Parent = scrollTrack - - 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.ZIndex = 2 - scrollNub.BackgroundTransparency = 0.5 - scrollNub.Parent = scrollbar - - local newNub = scrollNub:clone() - 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.Parent = scrollbar - - scrollbar.MouseEnter:connect(function() - scrollbar.BackgroundTransparency = 0.1 - scrollNub.BackgroundTransparency = 0.1 - newNub.BackgroundTransparency = 0.1 - lastNub.BackgroundTransparency = 0.1 - end) - scrollbar.MouseLeave:connect(function() - scrollbar.BackgroundTransparency = 0.5 - scrollNub.BackgroundTransparency = 0.5 - newNub.BackgroundTransparency = 0.5 - lastNub.BackgroundTransparency = 0.5 - end) - - local mouseDrag = Instance.new "ImageButton" - mouseDrag.Active = false - mouseDrag.Size = UDim2.new(1.5, 0, 1.5, 0) - mouseDrag.AutoButtonColor = false - mouseDrag.BackgroundTransparency = 1 - mouseDrag.Name = "mouseDrag" - mouseDrag.Position = UDim2.new(-0.25, 0, -0.25, 0) - mouseDrag.ZIndex = 10 - - local function positionScrollBar(_, 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) - return (oldPos ~= scrollbar.Position) - end - - 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) - return (oldPos ~= scrollbar.Position) - end - local newScaleYPos = (y - scrollTrack.AbsolutePosition.y - offset) / scrollTrack.AbsoluteSize.y - if newScaleYPos + relativeSize > 1 then - newScaleYPos = 1 - relativeSize - scrollBottom.Value = true - scrollUp.Value = false - elseif newScaleYPos <= 0 then - newScaleYPos = 0 - scrollUp.Value = true - scrollBottom.Value = false - else - scrollUp.Value = false - scrollBottom.Value = false - end - 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 (lowY and lowY > instance.AbsolutePosition.Y) or not lowY then - lowY = instance.AbsolutePosition.Y - end - if (highY and highY < (instance.AbsolutePosition.Y + instance.AbsoluteSize.Y)) or not highY then - highY = instance.AbsolutePosition.Y + instance.AbsoluteSize.Y - end - local children = instance:GetChildren() - for i = 1, #children do - drillDownSetHighLow(children[i]) - end - end - - local function resetHighLow() - local firstChildren = scrollingFrame:GetChildren() - - for i = 1, #firstChildren do - drillDownSetHighLow(firstChildren[i]) - end - end - - local function recalculate() - internalChange = true - - 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) - else - percentFrame = 0 - end - 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 - ) - end - end - - lowY = nil - highY = nil - resetHighLow() - internalChange = false - end - - local function setSliderSizeAndPosition() - if not highY or not lowY then - return - end - - local totalYSpan = math.abs(highY - lowY) - if totalYSpan == 0 then - scrollbar.Visible = false - scrollDownButton.Visible = false - scrollUpButton.Visible = false - - if dragCon then - dragCon:disconnect() - dragCon = nil - end - if upCon then - upCon:disconnect() - upCon = nil - end - return - end - - local percentShown = scrollingFrame.AbsoluteSize.Y / totalYSpan - if percentShown >= 1 then - scrollbar.Visible = false - scrollDownButton.Visible = false - scrollUpButton.Visible = false - recalculate() - else - scrollbar.Visible = true - scrollDownButton.Visible = true - scrollUpButton.Visible = true - - 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 - ) - - if scrollbar.AbsolutePosition.y < scrollTrack.AbsolutePosition.y then - 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) - end - end - - local buttonScrollAmountPixels = 7 - local reentrancyGuardScrollUp = false - local function doScrollUp() - if reentrancyGuardScrollUp then - return - end - - reentrancyGuardScrollUp = true - 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 - - reentrancyGuardScrollDown = true - if positionScrollBar(0, scrollbar.AbsolutePosition.Y + buttonScrollAmountPixels, 0) then - recalculate() - end - reentrancyGuardScrollDown = false - end - - local function scrollUp(mouseYPos) - if scrollUpButton.Active then - local scrollStamp = tick() - local current = scrollStamp - local upCon - upCon = mouseDrag.MouseButton1Up:connect(function() - scrollStamp = tick() - mouseDrag.Parent = nil - upCon:disconnect() - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - doScrollUp() - wait(0.2) - local t = tick() - local w = 0.1 - while scrollStamp == current do - doScrollUp() - if mouseYPos and mouseYPos > scrollbar.AbsolutePosition.y then - break - end - if not scrollUpButton.Active then - break - end - if tick() - t > 5 then - w = 0 - elseif tick() - t > 2 then - w = 0.06 - end - wait(w) - end - end - end - - local function scrollDown(mouseYPos) - if scrollDownButton.Active then - local scrollStamp = tick() - local current = scrollStamp - local downCon - downCon = mouseDrag.MouseButton1Up:connect(function() - scrollStamp = tick() - mouseDrag.Parent = nil - downCon:disconnect() - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - doScrollDown() - wait(0.2) - local t = tick() - local w = 0.1 - while scrollStamp == current do - doScrollDown() - 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 - w = 0 - elseif tick() - t > 2 then - w = 0.06 - end - wait(w) - end - end - end - - scrollbar.MouseButton1Down:connect(function(_, y) - if scrollbar.Active then - local scrollStamp = tick() - local mouseOffset = y - scrollbar.AbsolutePosition.y - if dragCon then - dragCon:disconnect() - dragCon = nil - end - if upCon then - upCon:disconnect() - upCon = nil - end - local reentrancyGuardMouseScroll = false - dragCon = mouseDrag.MouseMoved:connect(function(x, y) - if reentrancyGuardMouseScroll then - return - end - - reentrancyGuardMouseScroll = true - 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 - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - end - end) - - local scrollMouseCount = 0 - - scrollUpButton.MouseButton1Down:connect(function() - scrollUp() - end) - scrollDownButton.MouseButton1Down:connect(function() - scrollDown() - end) - - local function scrollTick() - scrollStamp = tick() - end - - scrollUpButton.MouseButton1Up:connect(scrollTick) - scrollDownButton.MouseButton1Up:connect(scrollTick) - scrollbar.MouseButton1Up:connect(scrollTick) - - -- local function heightCheck(instance) - -- if (highY and (instance.AbsolutePosition.Y + instance.AbsoluteSize.Y) > highY) or not highY then - -- highY = instance.AbsolutePosition.Y + instance.AbsoluteSize.Y - -- end - -- setSliderSizeAndPosition() - -- end - - local function highLowRecheck() - local oldLowY = lowY - local oldHighY = highY - lowY = nil - highY = nil - resetHighLow() - - if (lowY ~= oldLowY) or (highY ~= oldHighY) then - setSliderSizeAndPosition() - end - end - - local function descendantChanged(this, prop) - if internalChange then - return - end - if not this.Visible then - return - end - - if prop == "Size" or prop == "Position" then - wait() - highLowRecheck() - end - end - - scrollingFrame.DescendantAdded:connect(function(instance) - 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) - end) - - scrollingFrame.DescendantRemoving:connect(function(instance) - if not instance:IsA "GuiObject" then - return - end - if descendantsChangeConMap[instance] then - descendantsChangeConMap[instance]:disconnect() - descendantsChangeConMap[instance] = nil - end - 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 - - highLowRecheck() - setSliderSizeAndPosition() - end - end) - - return scrollingFrame, controlFrame -end - -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" - scrollUpButton.Name = "ScrollUpButton" - scrollUpButton.BackgroundTransparency = 1 - scrollUpButton.Image = "rbxasset://textures/ui/scrollbuttonUp.png" - scrollUpButton.Size = UDim2.new(0, 17, 0, 17) - - 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" - 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" - 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" - mouseDrag.Active = false - mouseDrag.Size = UDim2.new(1.5, 0, 1.5, 0) - mouseDrag.AutoButtonColor = false - mouseDrag.BackgroundTransparency = 1 - mouseDrag.Name = "mouseDrag" - mouseDrag.Position = UDim2.new(-0.25, 0, -0.25, 0) - mouseDrag.ZIndex = 10 - - local style = "simple" - 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 = {} - if orderList then - for _, child in ipairs(orderList) do - if child.Parent == frame then - table.insert(guiObjects, child) - end - end - else - local children = frame:GetChildren() - if children then - for _, child in ipairs(children) do - if child:IsA "GuiObject" then - table.insert(guiObjects, child) - end - end - end - end - if #guiObjects == 0 then - scrollUpButton.Active = false - scrollDownButton.Active = false - scrollDrag.Active = false - scrollPosition = 1 - return - end - - if scrollPosition > #guiObjects then - scrollPosition = #guiObjects - end - - if scrollPosition < 1 then - scrollPosition = 1 - end - - local totalPixelsY = frame.AbsoluteSize.Y - local pixelsRemainingY = frame.AbsoluteSize.Y - - 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 - --count up from current scroll position to fill out grid - while pos <= #guiObjects and pixelsBelowScrollbar < totalPixelsY do - xCounter = xCounter + guiObjects[pos].AbsoluteSize.X - --previous pos was the end of a row - if xCounter >= totalPixelsX then - pixelsBelowScrollbar = pixelsBelowScrollbar + currentRowY - currentRowY = 0 - xCounter = guiObjects[pos].AbsoluteSize.X - end - if guiObjects[pos].AbsoluteSize.Y > currentRowY then - currentRowY = guiObjects[pos].AbsoluteSize.Y - end - pos = pos + 1 - end - --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 - rowSizeCounter = rowSizeCounter + 1 - if xCounter >= totalPixelsX then - rowSize = rowSizeCounter - 1 - rowSizeCounter = 0 - xCounter = guiObjects[pos].AbsoluteSize.X - if pixelsBelowScrollbar + currentRowY <= totalPixelsY then - --It fits, so back up our scroll position - pixelsBelowScrollbar = pixelsBelowScrollbar + currentRowY - if scrollPosition <= rowSize then - scrollPosition = 1 - break - else - scrollPosition = scrollPosition - rowSize - end - currentRowY = 0 - else - 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 - end - - xCounter = 0 - --pos = scrollPosition - rowSizeCounter = 0 - setRowSize = true - local lastChildSize = 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) - end - - for i, child in ipairs(guiObjects) do - if i < scrollPosition then - --print("Hiding " .. child.Name) - child.Visible = false - else - if pixelsRemainingY < 0 then - --print("Out of Space " .. child.Name) - child.Visible = false - else - --print("Laying out " .. child.Name) - --GuiObject - if setRowSize then - rowSizeCounter = rowSizeCounter + 1 - end - if xCounter + child.AbsoluteSize.X >= totalPixelsX then - if setRowSize then - rowSize = rowSizeCounter - 1 - setRowSize = false - end - xCounter = 0 - pixelsRemainingY = pixelsRemainingY - child.AbsoluteSize.Y - end - 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 - end - end - end - - scrollUpButton.Active = (scrollPosition > 1) - if lastChildSize == 0 then - scrollDownButton.Active = false - else - scrollDownButton.Active = ((pixelsRemainingY - lastChildSize.Y) < 0) - end - scrollDrag.Active = #guiObjects > howManyDisplayed - scrollDrag.Visible = scrollDrag.Active - end - - local layoutSimpleScrollBar = function() - local guiObjects = {} - howManyDisplayed = 0 - - if orderList then - for _, child in ipairs(orderList) do - if child.Parent == frame then - table.insert(guiObjects, child) - end - end - else - local children = frame:GetChildren() - if children then - for _, child in ipairs(children) do - if child:IsA "GuiObject" then - table.insert(guiObjects, child) - end - end - end - end - if #guiObjects == 0 then - scrollUpButton.Active = false - scrollDownButton.Active = false - scrollDrag.Active = false - scrollPosition = 1 - return - end - - if scrollPosition > #guiObjects then - scrollPosition = #guiObjects - end - - local totalPixels = frame.AbsoluteSize.Y - local pixelsRemaining = frame.AbsoluteSize.Y - - local pixelsBelowScrollbar = 0 - local pos = #guiObjects - while pixelsBelowScrollbar < totalPixels and pos >= 1 do - if pos >= scrollPosition then - pixelsBelowScrollbar = pixelsBelowScrollbar + guiObjects[pos].AbsoluteSize.Y - else - if pixelsBelowScrollbar + guiObjects[pos].AbsoluteSize.Y <= totalPixels then - --It fits, so back up our scroll position - pixelsBelowScrollbar = pixelsBelowScrollbar + guiObjects[pos].AbsoluteSize.Y - if scrollPosition <= 1 then - scrollPosition = 1 - break - else - --local ("Backing up ScrollPosition from -- " ..scrollPosition) - scrollPosition = scrollPosition - 1 - end - else - break - end - end - pos = pos - 1 - end - - pos = scrollPosition - for i, child in ipairs(guiObjects) do - if i < scrollPosition then - --print("Hiding " .. child.Name) - child.Visible = false - else - if pixelsRemaining < 0 then - --print("Out of Space " .. child.Name) - child.Visible = false - else - --print("Laying out " .. child.Name) - --GuiObject - child.Position = - UDim2.new(child.Position.X.Scale, child.Position.X.Offset, 0, totalPixels - pixelsRemaining) - pixelsRemaining = pixelsRemaining - child.AbsoluteSize.Y - if pixelsRemaining >= 0 then - child.Visible = true - howManyDisplayed = howManyDisplayed + 1 - else - child.Visible = false - end - end - end - end - scrollUpButton.Active = (scrollPosition > 1) - scrollDownButton.Active = (pixelsRemaining < 0) - scrollDrag.Active = #guiObjects > howManyDisplayed - scrollDrag.Visible = scrollDrag.Active - end - - local moveDragger = function() - local guiObjects = 0 - local children = frame:GetChildren() - if children then - for _, 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 - 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) - end - - local reentrancyGuard = false - local recalculate = function() - if reentrancyGuard then - return - end - reentrancyGuard = true - wait() - local success, err = nil - if style == "grid" then - success, err = pcall(function() - layoutGridScrollBar() - end) - elseif style == "simple" then - success, err = pcall(function() - layoutSimpleScrollBar() - end) - 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 - recalculate(nil) - end - - local doScrollDown = function() - scrollPosition = scrollPosition + rowSize - recalculate(nil) - end - - local scrollUp = function(mouseYPos) - if scrollUpButton.Active then - scrollStamp = tick() - local current = scrollStamp - local upCon - upCon = mouseDrag.MouseButton1Up:connect(function() - scrollStamp = tick() - mouseDrag.Parent = nil - upCon:disconnect() - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - doScrollUp() - wait(0.2) - local t = tick() - local w = 0.1 - while scrollStamp == current do - doScrollUp() - if mouseYPos and mouseYPos > scrollDrag.AbsolutePosition.y then - break - end - if not scrollUpButton.Active then - break - end - if tick() - t > 5 then - w = 0 - elseif tick() - t > 2 then - w = 0.06 - end - wait(w) - end - end - end - - local scrollDown = function(mouseYPos) - if scrollDownButton.Active then - scrollStamp = tick() - local current = scrollStamp - local downCon - downCon = mouseDrag.MouseButton1Up:connect(function() - scrollStamp = tick() - mouseDrag.Parent = nil - downCon:disconnect() - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - doScrollDown() - wait(0.2) - local t = tick() - local w = 0.1 - while scrollStamp == current do - doScrollDown() - 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 - w = 0 - elseif tick() - t > 2 then - w = 0.06 - end - wait(w) - end - end - end - - -- local y = 0 - scrollDrag.MouseButton1Down:connect(function(_, y) - if scrollDrag.Active then - scrollStamp = tick() - local mouseOffset = y - scrollDrag.AbsolutePosition.y - local dragCon - local upCon - dragCon = mouseDrag.MouseMoved:connect(function(_, 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 _, child in ipairs(children) do - if child:IsA "GuiObject" then - guiObjects = guiObjects + 1 - end - end - end - - 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 - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - end - end) - - local scrollMouseCount = 0 - - 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) - - scrollbar.MouseButton1Up:connect(function() - scrollStamp = tick() - end) - scrollbar.MouseButton1Down:connect(function(_, 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) - end) - - 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) - - return frame, scrollUpButton, scrollDownButton, recalculate, scrollbar -end -local function binaryGrow(min, max, fits) - if min > max then - return min - end - local biggestLegal = min - - while min <= max do - 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 - --Doesn't fit, shrink - max = mid - 1 - end - end - return biggestLegal -end - -local function binaryShrink(min, max, fits) - if min > max then - return min - end - local smallestLegal = max - - while min <= max do - 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 - else - --Doesn't fit, grow - min = mid + 1 - end - end - return smallestLegal -end - -local function getGuiOwner(instance) - while instance ~= nil do - if instance:IsA "ScreenGui" or instance:IsA "BillboardGui" then - return instance - end - instance = instance.Parent - end - return nil -end - -t.AutoTruncateTextObject = function(textLabel) - local text = textLabel.Text - - local fullLabel = textLabel:Clone() - 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.Visible = false - fullLabel.Parent = textLabel - - local shortText = nil - local mouseEnterConnection = nil - local mouseLeaveConnection = nil - - local checkForResize = function() - if getGuiOwner(textLabel) == nil then - return - end - textLabel.Text = text - if textLabel.TextFits then - --Tear down the rollover if it is active - if mouseEnterConnection then - mouseEnterConnection:disconnect() - mouseEnterConnection = nil - end - if mouseLeaveConnection then - mouseLeaveConnection:disconnect() - mouseLeaveConnection = nil - end - else - local len = string.len(text) - 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) - 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) - - --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) - end - if mouseLeaveConnection == nil then - 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) - - checkForResize() - - local function changeText(newText) - text = newText - fullLabel.Text = text - checkForResize() - end - - return textLabel, changeText -end - -local function TransitionTutorialPages(fromPage, toPage, transitionFrame, currentPageValue) - if fromPage then - fromPage.Visible = false - if transitionFrame.Visible == false then - transitionFrame.Size = fromPage.Size - transitionFrame.Position = fromPage.Position - end - else - if transitionFrame.Visible == false then - transitionFrame.Size = UDim2.new(0, 50, 0, 50) - transitionFrame.Position = UDim2.new(0.5, -25, 0.5, -25) - end - end - transitionFrame.Visible = true - currentPageValue.Value = nil - - local newSize, newPosition - if toPage then - --Make it visible so it resizes - toPage.Visible = true - - newSize = toPage.Size - newPosition = toPage.Position - - toPage.Visible = false - else - 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, - function(state) - if state == Enum.TweenStatus.Completed then - transitionFrame.Visible = false - if toPage then - toPage.Visible = true - currentPageValue.Value = toPage - end - end - end - ) -end - -t.CreateTutorial = function(name, tutorialKey, createButtons) - 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" - transitionFrame.Name = "TransitionFrame" - transitionFrame.Style = Enum.FrameStyle.RobloxRound - transitionFrame.Size = UDim2.new(0.6, 0, 0.6, 0) - transitionFrame.Position = UDim2.new(0.2, 0, 0.2, 0) - transitionFrame.Visible = false - transitionFrame.Parent = frame - - local currentPageValue = Instance.new "ObjectValue" - currentPageValue.Name = "CurrentTutorialPage" - currentPageValue.Value = nil - currentPageValue.Parent = frame - - local boolValue = Instance.new "BoolValue" - boolValue.Name = "Buttons" - boolValue.Value = createButtons - boolValue.Parent = frame - - local pages = Instance.new "Frame" - pages.Name = "Pages" - pages.BackgroundTransparency = 1 - 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 _, child in ipairs(children) do - if child.Visible then - if visiblePage then - child.Visible = false - else - visiblePage = child - end - end - end - end - return visiblePage - end - - local showTutorial = function(alwaysShow) - if alwaysShow or UserSettings().GameSettings:GetTutorialState(tutorialKey) == false then - print("Showing tutorial-", tutorialKey) - local currentTutorialPage = getVisiblePageAndHideOthers() - - local firstPage = pages:FindFirstChild "TutorialPage1" - if firstPage then - TransitionTutorialPages(currentTutorialPage, firstPage, transitionFrame, currentPageValue) - else - error "Could not find TutorialPage1" - end - end - end - - local dismissTutorial = function() - local currentTutorialPage = getVisiblePageAndHideOthers() - - if currentTutorialPage then - TransitionTutorialPages(currentTutorialPage, nil, transitionFrame, currentPageValue) - end - - UserSettings().GameSettings:SetTutorialState(tutorialKey, true) - end - - local gotoPage = function(pageNum) - local page = pages:FindFirstChild("TutorialPage" .. pageNum) - local currentTutorialPage = getVisiblePageAndHideOthers() - TransitionTutorialPages(currentTutorialPage, page, transitionFrame, currentPageValue) - end - - return frame, showTutorial, dismissTutorial, gotoPage -end - -local function CreateBasicTutorialPage(name, handleResize, skipTutorial, giveDoneButton) - 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" - 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.TextXAlignment = Enum.TextXAlignment.Center - frameHeader.TextWrap = true - frameHeader.Size = UDim2.new(1, -55, 0, 22) - frameHeader.Position = UDim2.new(0, 0, 0, 0) - frameHeader.Parent = frame - - local skipButton = Instance.new "ImageButton" - skipButton.Name = "SkipButton" - skipButton.AutoButtonColor = false - skipButton.BackgroundTransparency = 1 - skipButton.Image = "rbxasset://textures/ui/closeButton.png" - skipButton.MouseButton1Click:connect(function() - skipTutorial() - end) - skipButton.MouseEnter:connect(function() - skipButton.Image = "rbxasset://textures/ui/closeButton_dn.png" - end) - skipButton.MouseLeave:connect(function() - skipButton.Image = "rbxasset://textures/ui/closeButton.png" - end) - 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" - doneButton.Name = "DoneButton" - doneButton.Style = Enum.ButtonStyle.RobloxButtonDefault - doneButton.Text = "Done" - 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) - - if skipTutorial then - doneButton.MouseButton1Click:connect(function() - skipTutorial() - end) - end - - doneButton.Parent = frame - end - - local innerFrame = Instance.new "Frame" - innerFrame.Name = "ContentFrame" - innerFrame.BackgroundTransparency = 1 - innerFrame.Position = UDim2.new(0, 0, 0, 25) - innerFrame.Parent = frame - - local nextButton = Instance.new "TextButton" - nextButton.Name = "NextButton" - nextButton.Text = "Next" - 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.Position = UDim2.new(0.5, 5, 1, -32) - nextButton.Active = false - nextButton.Visible = false - nextButton.Parent = frame - - local prevButton = Instance.new "TextButton" - prevButton.Name = "PrevButton" - prevButton.Text = "Previous" - 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.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) - else - innerFrame.Size = UDim2.new(1, 0, 1, -22) - end - - local parentConnection = nil - - 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) - 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 - end - - if prop == "Visible" then - basicHandleResize() - end - end) - - return frame, innerFrame -end - -t.CreateTextTutorialPage = function(name, text, skipTutorialFunc) - local frame = nil - local contentFrame = nil - - local textLabel = Instance.new "TextLabel" - textLabel.BackgroundTransparency = 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) - - local function handleResize(minSize, maxSize) - local 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) - end - - frame, contentFrame = CreateBasicTutorialPage(name, handleResize, skipTutorialFunc) - textLabel.Parent = contentFrame - - return frame -end - -t.CreateImageTutorialPage = function(name, imageAsset, x, y, skipTutorialFunc, giveDoneButton) - local frame = nil - local contentFrame = nil - - 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) - - local function handleResize(minSize, maxSize) - local 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) - 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) - 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) - 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) - end - - frame, contentFrame = CreateBasicTutorialPage(name, handleResize, skipTutorialFunc, giveDoneButton) - imageLabel.Parent = contentFrame - - return frame -end - -t.AddTutorialPage = function(tutorial, tutorialPage) - local transitionFrame = tutorial.TransitionFrame - local currentPageValue = tutorial.CurrentTutorialPage - - if not tutorial.Buttons.Value then - tutorialPage.NextButton.Parent = nil - tutorialPage.PrevButton.Parent = nil - end - - local children = tutorial.Pages:GetChildren() - if children and #children > 0 then - tutorialPage.Name = "TutorialPage" .. (#children + 1) - local previousPage = children[#children] - 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" - 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" - end - tutorialPage.PrevButton.MouseButton1Click:connect(function() - TransitionTutorialPages(tutorialPage, previousPage, transitionFrame, currentPageValue) - end) - tutorialPage.PrevButton.Active = true - tutorialPage.PrevButton.Visible = true - end - - tutorialPage.Parent = tutorial.Pages - else - --First child - tutorialPage.Name = "TutorialPage1" - tutorialPage.Parent = tutorial.Pages - end -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" - 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" - ) - end - if not objectSelected then - 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!" - ) - end - if dialogClosed and type(dialogClosed) ~= "function" then - 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 - - local arrayPosition = 1 - local insertButtons = {} - local insertButtonCons = {} - local contents = nil - local setGui = nil - - -- used for water selections - 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=" - else - 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 - 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 terrainShapeMap = {} - for i = 1, #terrainShapes do - terrainShapeMap[terrainShapes[i]] = i - 1 - end - terrainShapeMap[terrainShapes[#terrainShapes]] = 6 - - local function createWaterGui() - local waterForceDirections = { "NegX", "X", "NegY", "Y", "NegZ", "Z" } - local waterForces = { "None", "Small", "Medium", "Strong", "Max" } - - local waterFrame = Instance.new "Frame" - waterFrame.Name = "WaterFrame" - waterFrame.Style = Enum.FrameStyle.RobloxSquare - waterFrame.Size = UDim2.new(0, 150, 0, 110) - waterFrame.Visible = false - - local waterForceLabel = Instance.new "TextLabel" - waterForceLabel.Name = "WaterForceLabel" - waterForceLabel.BackgroundTransparency = 1 - 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.TextXAlignment = Enum.TextXAlignment.Left - waterForceLabel.Text = "Water Force" - waterForceLabel.Parent = waterFrame - - local waterForceDirLabel = waterForceLabel:Clone() - waterForceDirLabel.Name = "WaterForceDirectionLabel" - waterForceDirLabel.Text = "Water Force Direction" - waterForceDirLabel.Position = UDim2.new(0, 0, 0, 50) - waterForceDirLabel.Parent = waterFrame - - local waterTypeChangedEvent = Instance.new "BindableEvent" - waterTypeChangedEvent.Name = "WaterTypeChangedEvent" - waterTypeChangedEvent.Parent = waterFrame - - local waterForceDirectionSelectedFunc = function(newForceDirection) - waterForceDirection = newForceDirection - waterTypeChangedEvent:Fire { waterForce, waterForceDirection } - end - local waterForceSelectedFunc = function(newForce) - waterForce = newForce - 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" - 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) - waterForceDropDown.Parent = waterForceLabel - - return waterFrame, waterTypeChangedEvent - end - - -- Helper Function that contructs gui elements - local function createSetGui() - local setGui = Instance.new "ScreenGui" - setGui.Name = "SetGui" - - local setPanel = Instance.new "Frame" - setPanel.Name = "SetPanel" - setPanel.Active = true - setPanel.BackgroundTransparency = 1 - if position then - setPanel.Position = position - else - setPanel.Position = UDim2.new(0.2, 29, 0.1, 24) - end - if size then - setPanel.Size = size - else - setPanel.Size = UDim2.new(0.6, -58, 0.64, 0) - end - 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 - - return setGui - end - - local function createSetButton(text) - 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.BorderSizePixel = 0 - 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.TextXAlignment = Enum.TextXAlignment.Left - - return setButton - end - - local function buildSetButton(name, setId, _, _, _) - local button = createSetButton(name) - button.Text = name - button.Name = "SetButton" - button.Visible = true - - local setValue = Instance.new "IntValue" - setValue.Name = "SetId" - setValue.Value = setId - setValue.Parent = button - - 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 - for i = 1, #sets do - 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) - 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) - end - - local function makeInsertAssetButton() - 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.BackgroundTransparency = 1 - insertAssetButtonExample.ZIndex = 6 - insertAssetButtonExample.Visible = false - - local assetId = Instance.new "IntValue" - assetId.Name = "AssetId" - assetId.Value = 0 - assetId.Parent = insertAssetButtonExample - - local assetName = Instance.new "StringValue" - assetName.Name = "AssetName" - assetName.Value = "" - assetName.Parent = insertAssetButtonExample - - 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.ZIndex = 6 - button.Parent = insertAssetButtonExample - - 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.BackgroundTransparency = 1 - buttonImage.ZIndex = 7 - buttonImage.Parent = button - - 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.Image = "" - configIcon.ZIndex = 6 - configIcon.Parent = insertAssetButtonExample - - return insertAssetButtonExample - end - - local function showLargePreview(insertButton) - 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) - end) - end - 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 - ) - end - end - - local function createTerrainTypeButton(name, parent) - 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.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.MouseEnter:connect(function() - dropDownTextButton.BackgroundTransparency = 0 - dropDownTextButton.TextColor3 = Color3.new(0, 0, 0) - end) - - dropDownTextButton.MouseLeave:connect(function() - dropDownTextButton.BackgroundTransparency = 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.Parent.Visible = false - end - selectTerrainShape(terrainShapeMap[dropDownTextButton.Text]) - end) - - return dropDownTextButton - end - - local function createTerrainDropDownMenu(zIndex) - 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.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) - shapeButton.Parent = dropDown - dropDown.Size = UDim2.new(0, 200, 0, dropDown.Size.Y.Offset + shapeButton.Size.Y.Offset) - end - - dropDown.MouseLeave:connect(function() - dropDown.Visible = false - end) - end - - local function createDropDownMenuButton(parent) - 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.ZIndex = parent.ZIndex + 2 - dropDownButton.Parent = parent - - 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) - currTerrainDropDownFrame = parent - end) - end - - local function buildInsertButton() - local insertButton = makeInsertAssetButton() - insertButton.Name = "InsertAssetButton" - insertButton.Visible = true - - if Data.Category[Data.CurrentCategory].SetName == "High Scalability" then - createDropDownMenuButton(insertButton) - end - - local lastEnter = nil - local mouseEnterCon = insertButton.MouseEnter:connect(function() - lastEnter = insertButton - delay(0.1, function() - if lastEnter == insertButton then - showLargePreview(insertButton) - end - end) - end) - return insertButton, mouseEnterCon - end - - local function realignButtonGrid(columns) - local x = 0 - local y = 0 - for i = 1, #insertButtons do - insertButtons[i].Position = UDim2.new(0, buttonWidth * x, 0, buttonHeight * y) - x = x + 1 - if x >= columns then - x = 0 - y = y + 1 - end - end - end - - local function setInsertButtonImageBehavior(insertFrame, visible, name, assetId) - if visible then - insertFrame.AssetName.Value = name - insertFrame.AssetId.Value = 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 - end) - end - 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") - waterGui.Visible = isWaterSelected - if isWaterSelected then - objectSelected(name, tonumber(assetId), nil) - else - objectSelected(name, tonumber(assetId)) - end - end) - ) - insertFrame.Visible = true - else - insertFrame.Visible = false - end - end - - local function loadSectionOfItems(setGui, rows, columns) - local pageSize = rows * columns - - if arrayPosition > #contents then - return - end - - local origArrayPos = arrayPosition - - for _ = 1, pageSize + 1 do - if arrayPosition >= #contents + 1 then - break - end - - local buttonCon - insertButtons[arrayPosition], buttonCon = buildInsertButton() - table.insert(insertButtonCons, buttonCon) - insertButtons[arrayPosition].Parent = setGui.SetPanel.ItemsFrame - arrayPosition = arrayPosition + 1 - end - realignButtonGrid(columns) - - -- local indexCopy = origArrayPos - 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() - end - end - - local assetId - if useAssetVersionId then - assetId = contents[index].AssetVersionId - else - assetId = contents[index].AssetId - end - setInsertButtonImageBehavior(insertButtons[index], true, contents[index].Name, assetId) - else - break - end - else - break - end - -- indexCopy = index - end - end - - local function setSetIndex() - Data.Category[Data.CurrentCategory].Index = 0 - - local rows = 7 - local columns = math.floor(setGui.SetPanel.ItemsFrame.AbsoluteSize.X / buttonWidth) - - contents = Data.Category[Data.CurrentCategory].Contents - if contents then - -- remove our buttons and their connections - for i = 1, #insertButtons do - insertButtons[i]:remove() - end - for i = 1, #insertButtonCons do - if insertButtonCons[i] then - insertButtonCons[i]:disconnect() - end - end - insertButtonCons = {} - insertButtons = {} - - arrayPosition = 1 - loadSectionOfItems(setGui, rows, columns) - end - end - - local function selectSet(button, setName, setId, _) - if button and Data.Category[Data.CurrentCategory] ~= nil then - if button ~= Data.Category[Data.CurrentCategory].Button then - Data.Category[Data.CurrentCategory].Button = button - - if SetCache[setId] == nil then - SetCache[setId] = game:GetService("InsertService"):GetCollection(setId) - end - Data.Category[Data.CurrentCategory].Contents = SetCache[setId] - - Data.Category[Data.CurrentCategory].SetName = setName - Data.Category[Data.CurrentCategory].SetId = setId - end - setSetIndex() - end - end - - local function selectCategoryPage(buttons, _) - if buttons ~= Data.CurrentCategory then - if Data.CurrentCategory then - for _, button in pairs(Data.CurrentCategory) do - button.Visible = false - end - end - - Data.CurrentCategory = buttons - if Data.Category[Data.CurrentCategory] == nil then - Data.Category[Data.CurrentCategory] = {} - if #buttons > 0 then - selectSet(buttons[1], buttons[1].SetName.Value, buttons[1].SetId.Value, 0) - 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 - ) - 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 - setButtons[i].Selected = false - setButtons[i].BackgroundTransparency = 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.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.BackgroundTransparency = 0 - end - - button.MouseEnter:connect(function() - if not button.Selected then - button.BackgroundTransparency = 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) - 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.BackgroundTransparency = 0 - selectSet(button, button.Text, userCategoryButtons[i].SetId.Value, 0) - end) - - currRow = currRow + 1 - end - - 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 - selectSet(buttons[i], buttons[i].Text, userCategoryButtons[i].SetId.Value, 0) - selectCategory(userCategoryButtons) - break - end - end - end - end - - setGui = createSetGui() - waterGui, waterTypeChangedEvent = createWaterGui() - 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 - handleResize() - 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.Name = "ItemsFrame" - scrollFrame.ZIndex = 6 - scrollFrame.Parent = setGui.SetPanel - scrollFrame.BackgroundTransparency = 1 - - drillDownSetZIndex(controlFrame, 7) - - controlFrame.Parent = setGui.SetPanel - controlFrame.Position = UDim2.new(0.76, 5, 0, 0) - - local debounce = false - controlFrame.ScrollBottom.Changed:connect(function(_) - if controlFrame.ScrollBottom.Value == true then - if debounce then - return - end - debounce = true - loadSectionOfItems(setGui, rows, columns) - debounce = false - end - end) - - local userData = {} - for id = 1, #userIdsForSets do - local newUserData = game:GetService("InsertService"):GetUserSets(userIdsForSets[id]) - if newUserData and #newUserData > 2 then - -- 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]) - 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) - - populateSetsFrame() - - --[[local insertPanelCloseCon = ]] - setGui.SetPanel.CancelButton.MouseButton1Click:connect(function() - setGui.SetPanel.Visible = false - if dialogClosed then - dialogClosed() - end - end) - - local setVisibilityFunction = function(visible) - if visible then - setGui.SetPanel.Visible = true - else - setGui.SetPanel.Visible = false - end - end - - local getVisibilityFunction = function() - if setGui 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" - terrainMaterialSelectionChanged.Name = "TerrainMaterialSelectionChanged" - - local selectedButton = nil - - local frame = Instance.new "Frame" - frame.Name = "TerrainMaterialSelector" - if size then - frame.Size = size - else - frame.Size = UDim2.new(0, 245, 0, 230) - end - if position then - frame.Position = position - end - frame.BorderSizePixel = 0 - frame.BackgroundColor3 = Color3.new(0, 0, 0) - frame.Active = true - - terrainMaterialSelectionChanged.Parent = frame - - 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)", - } - if waterEnabled then - 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" - elseif choice == Enum.CellMaterial.Sand or choice == 2 then - return "Sand" - elseif choice == Enum.CellMaterial.Empty or choice == 0 then - return "Erase" - elseif choice == Enum.CellMaterial.Brick or choice == 3 then - return "Brick" - elseif choice == Enum.CellMaterial.Granite or choice == 4 then - return "Granite" - elseif choice == Enum.CellMaterial.Asphalt or choice == 5 then - return "Asphalt" - elseif choice == Enum.CellMaterial.Iron or choice == 6 then - return "Iron" - elseif choice == Enum.CellMaterial.Aluminum or choice == 7 then - return "Aluminum" - elseif choice == Enum.CellMaterial.Gold or choice == 8 then - return "Gold" - elseif choice == Enum.CellMaterial.WoodPlank or choice == 9 then - return "Plank" - elseif choice == Enum.CellMaterial.WoodLog or choice == 10 then - return "Log" - elseif choice == Enum.CellMaterial.Gravel or choice == 11 then - return "Gravel" - elseif choice == Enum.CellMaterial.CinderBlock or choice == 12 then - return "Cinder Block" - elseif choice == Enum.CellMaterial.MossyStone or choice == 13 then - return "Stone Wall" - elseif choice == Enum.CellMaterial.Cement or choice == 14 then - return "Concrete" - elseif choice == Enum.CellMaterial.RedPlastic or choice == 15 then - return "Plastic (red)" - elseif 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) - terrainMaterialSelectionChanged:Fire(currentMaterial) - end - - -- we so need a better way to do this - for _, 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!! - 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) - scrollFrame.Parent = frame - - scrollUp.Parent = frame - scrollUp.Visible = true - scrollUp.Position = UDim2.new(1, -19, 0, 0) - - scrollDown.Parent = frame - scrollDown.Visible = true - scrollDown.Position = UDim2.new(1, -19, 1, -17) - - local function goToNewMaterial(buttonWrap, materialName) - updateMaterialChoice(materialName) - buttonWrap.BackgroundTransparency = 0 - selectedButton.BackgroundTransparency = 1 - selectedButton = buttonWrap - end - - 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.BorderSizePixel = 0 - buttonWrap.BackgroundTransparency = 1 - buttonWrap.AutoButtonColor = false - buttonWrap.Name = tostring(name) - - 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.Name = tostring(name) - imageButton.Parent = buttonWrap - imageButton.Image = materialToImageMap[name].Regular - - local enumType = Instance.new "NumberValue" - enumType.Name = "EnumType" - enumType.Parent = buttonWrap - enumType.Value = 0 - - imageButton.MouseEnter:connect(function() - buttonWrap.BackgroundTransparency = 0 - end) - imageButton.MouseLeave:connect(function() - if selectedButton ~= buttonWrap then - buttonWrap.BackgroundTransparency = 1 - end - end) - imageButton.MouseButton1Click:connect(function() - if selectedButton ~= buttonWrap then - goToNewMaterial(buttonWrap, tostring(name)) - end - end) - - 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 - - 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 string.find(buttons[i].Name, matName) then - goToNewMaterial(buttons[i], matName) - return - end - end - end - - frame.Changed:connect(function(prop) - if prop == "AbsoluteSize" then - recalculateScroll() - end - end) - - recalculateScroll() - return frame, terrainMaterialSelectionChanged, forceTerrainMaterialSelection -end - -t.CreateLoadingFrame = function(name, size, position) - game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=35238053" - - 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 - - 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.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 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" - cancelButton.Name = "CancelButton" - 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.Text = "Cancel" - cancelButton.Style = Enum.ButtonStyle.RobloxButton - cancelButton.Parent = loadingFrame - - 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.Font = Enum.Font.Arial - loadingName.Text = name - loadingName.TextColor3 = Color3.new(1, 1, 1) - loadingName.TextStrokeTransparency = 1 - loadingName.FontSize = Enum.FontSize.Size18 - loadingName.Parent = loadingFrame - - local cancelButtonClicked = Instance.new "BindableEvent" - cancelButtonClicked.Name = "CancelButtonClicked" - cancelButtonClicked.Parent = cancelButton - cancelButton.MouseButton1Click:connect(function() - cancelButtonClicked:Fire() - end) - - local updateLoadingGuiPercent = function(percent, tweenAction, tweenLength) - if percent and type(percent) ~= "number" then - 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) - elseif percent > 1 then - newSize = UDim2.new(1, 0, 1, 0) - else - 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" - end - - if newSize.X.Scale > 0 then - loadingGreenBar.Visible = 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 - ) - end - else - loadingGreenBar.Size = newSize - loadingGreenBar.Visible = (newSize.X.Scale > 0) - end - end - - loadingGreenBar.Changed:connect(function(prop) - if prop == "Size" then - 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" - button.AutoButtonColor = false - button.Name = name - button.BackgroundTransparency = 1 - button.Position = position - button.Size = size - button.Font = Enum.Font.ArialBold - button.FontSize = fontsize - button.Text = text - button.TextColor3 = Color3.new(1, 1, 1) - button.BorderSizePixel = 0 - button.BackgroundColor3 = Color3.new(20 / 255, 20 / 255, 20 / 255) - - 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.BackgroundTransparency = 1 - end) - - button.Parent = parent - - return button - end - - 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) - if size then - 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) - end - if position then - dragBar.Position = position - end - dragBar.Active = true - dragBar.Draggable = true - --dragBar.Visible = false - 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) - end) - dragBar.Parent = parent - - -- plugin name label - local pluginNameLabel = Instance.new "TextLabel" - pluginNameLabel.Name = "BarNameLabel" - pluginNameLabel.Text = " " .. tostring(name) - pluginNameLabel.TextColor3 = Color3.new(1, 1, 1) - pluginNameLabel.TextStrokeTransparency = 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" - closeEvent.Name = "CloseEvent" - closeEvent.Parent = closeButton - 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" - 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.Active = true - helpFrame.BorderSizePixel = 0 - helpFrame.Visible = false - helpFrame.Parent = dragBar - - helpButton.MouseButton1Click:connect(function() - helpFrame.Visible = not helpFrame.Visible - if helpFrame.Visible then - helpButton.Selected = true - helpButton.BackgroundTransparency = 0 - 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) - else -- position on right hand side - helpFrame.Position = UDim2.new(1, 5, 0, 0) - end - else - helpFrame.Position = UDim2.new(1, 5, 0, 0) - end - else - helpButton.Selected = false - helpButton.BackgroundTransparency = 1 - end - end) - - 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" - 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) - if size then - 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) - end - minimizeFrame.Visible = false - minimizeFrame.Parent = dragBar - - 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.Style = Enum.ButtonStyle.RobloxButton - minimizeBigButton.Font = Enum.Font.ArialBold - minimizeBigButton.FontSize = Enum.FontSize.Size18 - minimizeBigButton.TextColor3 = Color3.new(1, 1, 1) - minimizeBigButton.Text = "Show" - minimizeBigButton.Parent = minimizeFrame - - local separatingLine = Instance.new "Frame" - separatingLine.Name = "SeparatingLine" - 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.Parent = dragBar - - local otherSeparatingLine = separatingLine:clone() - otherSeparatingLine.Position = UDim2.new(1, -35, 0.5, -7) - otherSeparatingLine.Parent = 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) - if not scrollable then - widgetContainer.BackgroundTransparency = 0 - 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) - end - else - if scrollable then - widgetContainer.Size = UDim2.new(0, 163, 0, 400) - else - widgetContainer.Size = UDim2.new(0, dragBar.AbsoluteSize.X, 0, 400) - end - end - if position then - widgetContainer.Position = position + UDim2.new(0, 0, 0, 20) - end - - local frame, control, verticalDragger = nil - if scrollable then - --frame for widgets - 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.Active = true - frame.Parent = widgetContainer - control.Parent = dragBar - control.BackgroundColor3 = Color3.new(72 / 255, 72 / 255, 72 / 255) - control.BorderSizePixel = 0 - control.BackgroundTransparency = 0 - control.Position = UDim2.new(1, -21, 1, 1) - if size then - control.Size = UDim2.new(0, 21, size.Y.Scale, size.Y.Offset) - else - control.Size = UDim2.new(0, 21, 0, 400) - end - control:FindFirstChild("ScrollDownButton").Position = UDim2.new(0, 0, 1, -20) - - 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.Parent = control - - 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.Active = true - verticalDragger.Text = "" - verticalDragger.Parent = widgetContainer - - local scrubFrame = Instance.new "Frame" - scrubFrame.Name = "ScrubFrame" - 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.ZIndex = 5 - scrubFrame.Parent = verticalDragger - local scrubTwo = scrubFrame:clone() - 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.Parent = verticalDragger - - local areaSoak = Instance.new "TextButton" - areaSoak.Name = "AreaSoak" - 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) - end) - verticalDragger.MouseLeave:connect(function() - verticalDragger.BackgroundColor3 = Color3.new(50 / 255, 50 / 255, 50 / 255) - end) - verticalDragger.MouseButton1Down:connect(function(_, y) - draggingVertical = true - areaSoak.Visible = true - startYPos = y - end) - areaSoak.MouseButton1Up:connect(function() - draggingVertical = false - areaSoak.Visible = false - 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 - return - 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 - - 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) - end - end) - end - - local function switchMinimize() - minimizeFrame.Visible = not minimizeFrame.Visible - if scrollable then - frame.Visible = not frame.Visible - verticalDragger.Visible = not verticalDragger.Visible - control.Visible = not control.Visible - else - widgetContainer.Visible = not widgetContainer.Visible - end - - if minimizeFrame.Visible then - minimizeButton.Text = "+" - else - minimizeButton.Text = "-" - end - end - - minimizeBigButton.MouseButton1Click:connect(function() - switchMinimize() - end) - - minimizeButton.MouseButton1Click:connect(function() - switchMinimize() - end) - - if scrollable then - return dragBar, frame, helpFrame, closeEvent - else - return dragBar, widgetContainer, helpFrame, closeEvent - 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 == "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/lua/45374389.lua b/lua/45374389.lua deleted file mode 100644 index a197f9f..0000000 --- a/lua/45374389.lua +++ /dev/null @@ -1,20 +0,0 @@ -local t = {} - -t.Foo = function() - print "foo" -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 -end - -return t diff --git a/lua/46295863.lua b/lua/46295863.lua deleted file mode 100644 index a13a343..0000000 --- a/lua/46295863.lua +++ /dev/null @@ -1,2417 +0,0 @@ -local function waitForChild(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end -end - -local function waitForProperty(instance, property) - while not instance[property] do - instance.Changed:wait() - end -end - --- A Few Script Globals -local gui -if script.Parent:FindFirstChild "ControlFrame" then - gui = script.Parent:FindFirstChild "ControlFrame" -else - gui = script.Parent -end - -local helpButton = nil -local updateCameraDropDownSelection = nil -local updateVideoCaptureDropDownSelection = nil -local tweenTime = 0.2 - -local mouseLockLookScreenUrl = "http://www.roblox.com/asset?id=54071825" -local classicLookScreenUrl = "http://www.roblox.com/Asset?id=45915798" - -local hasGraphicsSlider = (game:GetService("CoreGui").Version >= 5) -local GraphicsQualityLevels = 10 -- how many levels we allow on graphics slider -local recordingVideo = false - -local currentMenuSelection = nil -local lastMenuSelection = {} - --- local defaultPosition = UDim2.new(0, 0, 0, 0) --- local newGuiPlaces = { 0, 41324860 } - -local centerDialogs = {} -local mainShield = nil - -local inStudioMode = UserSettings().GameSettings:InStudioMode() - -local macClient = false -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) -end - -local function robloxLock(instance) - instance.RobloxLocked = true - local children = instance:GetChildren() - if children then - for _, 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.Visible = false - for i = 1, #centerDialogs do - centerDialogs[i].Visible = false - game.GuiService:RemoveCenterDialog(centerDialogs[i]) - end - game.GuiService:RemoveCenterDialog(shield) - settingsButton.Active = true - currentMenuSelection = nil - lastMenuSelection = {} - end) -end - -function goToMenu(container, menuName, moveDirection, size, position) - if type(menuName) ~= "string" then - return - end - - table.insert(lastMenuSelection, currentMenuSelection) - if menuName == "GameMainMenu" then - lastMenuSelection = {} - end - - local containerChildren = container:GetChildren() - for i = 1, #containerChildren do - if containerChildren[i].Name == menuName then - containerChildren[i].Visible = true - 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 - ) - 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 - ) - else - 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 - ) - elseif moveDirection == "right" then - 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 - ) - elseif moveDirection == "down" then - containerChildren[i]:TweenPosition( - UDim2.new(0, 0, 1, 400), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - end - delay(tweenTime, function() - containerChildren[i].Visible = false - end) - end - end -end - -function resetLocalCharacter() - local player = game.Players.LocalPlayer - if player 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" - 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.Text = text - return newTextButton -end - -local function CreateTextButtons(frame, buttons, yPos, ySize) - if #buttons < 1 then - error "Must have more than one button" - end - - local buttonNum = 1 - local buttonObjs = {} - - local function toggleSelection(button) - for _, obj in ipairs(buttonObjs) do - if obj == button then - obj.Style = Enum.ButtonStyle.RobloxButtonDefault - else - obj.Style = Enum.ButtonStyle.RobloxButton - end - end - end - - for _, 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.Parent = frame - buttonObjs[buttonNum] = button - - buttonNum = buttonNum + 1 - end - - toggleSelection(buttonObjs[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(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(0.35, 0, ySize.Scale, ySize.Offset) - - frame.Button2.Position = UDim2.new(0.55, 0, yPos.Scale, yPos.Offset) - frame.Button2.Size = UDim2.new(0.35, 0, ySize.Scale, ySize.Offset) - elseif numButtons >= 3 then - 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].Size = UDim2.new(buttonSize, 0, ySize.Scale, ySize.Offset) - buttonNum = buttonNum + 1 - end - end -end - -function setRecordGui(recording, stopRecordButton, recordVideoButton) - if recording then - stopRecordButton.Visible = true - recordVideoButton.Text = "Stop Recording" - else - stopRecordButton.Visible = false - recordVideoButton.Text = "Record Video" - end -end - -function recordVideoClick(recordVideoButton, stopRecordButton) - recordingVideo = not recordingVideo - setRecordGui(recordingVideo, stopRecordButton, recordVideoButton) -end - -function backToGame(buttonClicked, shield, settingsButton) - buttonClicked.Parent.Parent.Parent.Parent.Visible = false - shield.Visible = false - for i = 1, #centerDialogs do - game.GuiService:RemoveCenterDialog(centerDialogs[i]) - centerDialogs[i].Visible = false - end - centerDialogs = {} - game.GuiService:RemoveCenterDialog(shield) - settingsButton.Active = true -end - -function setDisabledState(guiObject) - if not guiObject then - return - end - - if guiObject:IsA "TextLabel" then - guiObject.TextTransparency = 0.9 - 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) - end - end -end - -local function createHelpDialog(baseZIndex) - if helpButton == nil 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 - helpButton = gui.BottomRightControl.Help - end - end - - 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.BackgroundTransparency = 0.4 - shield.ZIndex = baseZIndex + 1 - - local helpDialog = Instance.new "Frame" - helpDialog.Name = "HelpDialog" - helpDialog.Style = Enum.FrameStyle.RobloxRound - 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" - 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.BackgroundTransparency = 1 - titleLabel.Parent = helpDialog - - local buttonRow = Instance.new "Frame" - buttonRow.Name = "Buttons" - 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" - imageFrame.Name = "ImageFrame" - imageFrame.Position = UDim2.new(0.05, 0, 0.075, 80) - imageFrame.Size = UDim2.new(0.9, 0, 0.9, -120) - imageFrame.BackgroundTransparency = 1 - imageFrame.Parent = helpDialog - - 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) - layoutFrame.BackgroundTransparency = 1 - layoutFrame.SizeConstraint = Enum.SizeConstraint.RelativeYY - layoutFrame.Parent = imageFrame - - local image = Instance.new "ImageLabel" - image.Name = "Image" - if UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then - image.Image = mouseLockLookScreenUrl - else - image.Image = classicLookScreenUrl - end - image.Position = UDim2.new(-0.5, 0, 0, 0) - image.Size = UDim2.new(1, 0, 1, 0) - image.BackgroundTransparency = 1 - image.Parent = layoutFrame - - local buttons = {} - buttons[1] = {} - buttons[1].Text = "Look" - buttons[1].Function = function() - if UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then - image.Image = mouseLockLookScreenUrl - else - image.Image = classicLookScreenUrl - end - end - buttons[2] = {} - buttons[2].Text = "Move" - buttons[2].Function = function() - image.Image = "http://www.roblox.com/Asset?id=45915811" - end - buttons[3] = {} - buttons[3].Text = "Gear" - buttons[3].Function = function() - image.Image = "http://www.roblox.com/Asset?id=45917596" - end - buttons[4] = {} - buttons[4].Text = "Zoom" - buttons[4].Function = function() - image.Image = "http://www.roblox.com/Asset?id=45915825" - end - - 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.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 - end - end - end - ) - end) - - 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, 0.975, -50) - okBtn.Font = Enum.Font.Arial - okBtn.FontSize = Enum.FontSize.Size18 - okBtn.BackgroundTransparency = 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.Parent = helpDialog - - robloxLock(shield) - return shield -end - -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.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) - ) - 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) - ) - 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 - ) - end) - - local leaveText = Instance.new "TextLabel" - leaveText.Name = "LeaveText" - leaveText.Text = "Leave this game?" - leaveText.Size = UDim2.new(1, 0, 0.8, 0) - leaveText.TextWrap = true - 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" - frame.Name = "ResetConfirmationMenu" - frame.BackgroundTransparency = 1 - 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) - ) - yesButton.Name = "YesButton" - yesButton.ZIndex = baseZIndex + 4 - yesButton.Parent = frame - 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) - ) - 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 - ) - end) - - 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.TextWrap = true - 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.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" - gameMainMenuFrame.Name = "GameMainMenu" - gameMainMenuFrame.BackgroundTransparency = 1 - gameMainMenuFrame.Size = UDim2.new(1, 0, 1, 0) - gameMainMenuFrame.ZIndex = baseZIndex + 4 - gameMainMenuFrame.Parent = settingsFrame - - -- GameMainMenu Children - - 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.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) - ) - 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.Active = true - - 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.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) - ) - screenshotButton.Name = "ScreenshotButton" - screenshotButton.ZIndex = baseZIndex + 4 - screenshotButton.Parent = gameMainMenuFrame - screenshotButton.Visible = not macClient - screenshotButton:SetVerb "Screenshot" - - local screenshotShortcut = helpShortcut:clone() - screenshotShortcut.Name = "ScreenshotShortcutText" - screenshotShortcut.Text = "PrintSc" - 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) - ) - recordVideoButton.Name = "RecordVideoButton" - recordVideoButton.ZIndex = baseZIndex + 4 - recordVideoButton.Parent = gameMainMenuFrame - recordVideoButton.Visible = not macClient - 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.Parent = recordVideoButton - - 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.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) - ) - 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) - ) - 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) - ) - 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) - ) - 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) - ) - 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 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) - ) - resetButton.Name = "ResetButton" - resetButton.ZIndex = baseZIndex + 4 - resetButton.Parent = gameMainMenuFrame - - return gameMainMenuFrame -end - -local function createGameSettingsMenu(baseZIndex, _) - local gameSettingsMenuFrame = Instance.new "Frame" - gameSettingsMenuFrame.Name = "GameSettingsMenu" - gameSettingsMenuFrame.BackgroundTransparency = 1 - gameSettingsMenuFrame.Size = UDim2.new(1, 0, 1, 0) - gameSettingsMenuFrame.ZIndex = baseZIndex + 4 - - 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.Font = Enum.Font.ArialBold - title.FontSize = Enum.FontSize.Size36 - title.TextColor3 = Color3.new(1, 1, 1) - title.ZIndex = baseZIndex + 4 - title.BackgroundTransparency = 1 - title.Parent = gameSettingsMenuFrame - - 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.Font = Enum.Font.Arial - fullscreenText.FontSize = Enum.FontSize.Size18 - fullscreenText.TextColor3 = Color3.new(1, 1, 1) - fullscreenText.ZIndex = baseZIndex + 4 - fullscreenText.BackgroundTransparency = 1 - fullscreenText.Parent = gameSettingsMenuFrame - - 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.ZIndex = baseZIndex + 4 - fullscreenShortcut.Parent = gameSettingsMenuFrame - - 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.Font = Enum.Font.Arial - studioText.FontSize = Enum.FontSize.Size18 - 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.Parent = gameSettingsMenuFrame - - local studioCheckbox = nil - - if hasGraphicsSlider then - 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.Font = Enum.Font.Arial - qualityText.FontSize = Enum.FontSize.Size18 - 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.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.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.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.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.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) - ) - 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 - 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" - 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.Font = Enum.Font.Arial - graphicsSetter.FontSize = Enum.FontSize.Size18 - graphicsSetter.Text = "Auto" - graphicsSetter.ZIndex = 1 - graphicsSetter.TextWrap = true - graphicsSetter.Parent = gameSettingsMenuFrame - graphicsSetter.Visible = not inStudioMode - - local isAutoGraphics = true - if not inStudioMode then - isAutoGraphics = (UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic) - else - settings().Rendering.EnableFRM = false - end - - local listenToGraphicsLevelChange = true - - local function setAutoGraphicsGui(active) - isAutoGraphics = active - if active then - autoGraphicsButton.Text = "X" - betterQualityText.ZIndex = 1 - betterQualityShortcut.ZIndex = 1 - fasterShortcut.ZIndex = 1 - fasterText.ZIndex = 1 - graphicsSlider.Bar.ZIndex = 1 - graphicsSlider.Bar.Slider.ZIndex = 1 - graphicsSetter.ZIndex = 1 - graphicsSetter.Text = "Auto" - else - autoGraphicsButton.Text = "" - graphicsSlider.Bar.ZIndex = baseZIndex + 4 - graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5 - betterQualityShortcut.ZIndex = baseZIndex + 4 - fasterShortcut.ZIndex = baseZIndex + 4 - betterQualityText.ZIndex = baseZIndex + 4 - fasterText.ZIndex = baseZIndex + 4 - 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 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 - elseif newLevel == 1 then -- make sure we can go to lowest settings (for terrible computers) - newSetting = 1 - 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) - - if explicitLevel then - graphicsLevel.Value = explicitLevel - else - 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 - betterQualityShortcut.ZIndex = baseZIndex + 4 - fasterShortcut.ZIndex = baseZIndex + 4 - betterQualityText.ZIndex = baseZIndex + 4 - fasterText.ZIndex = baseZIndex + 4 - graphicsSetter.ZIndex = baseZIndex + 4 - end - - local function hideManualGraphics() - betterQualityText.ZIndex = 1 - betterQualityShortcut.ZIndex = 1 - fasterShortcut.ZIndex = 1 - fasterText.ZIndex = 1 - graphicsSlider.Bar.ZIndex = 1 - graphicsSlider.Bar.Slider.ZIndex = 1 - graphicsSetter.ZIndex = 1 - end - - local function translateSavedQualityLevelToInt(savedQualityLevel) - if savedQualityLevel == Enum.SavedQualitySetting.Automatic then - return 0 - elseif savedQualityLevel == Enum.SavedQualitySetting.QualityLevel1 then - return 1 - elseif savedQualityLevel == Enum.SavedQualitySetting.QualityLevel2 then - return 2 - elseif savedQualityLevel == Enum.SavedQualitySetting.QualityLevel3 then - return 3 - elseif savedQualityLevel == Enum.SavedQualitySetting.QualityLevel4 then - return 4 - elseif savedQualityLevel == Enum.SavedQualitySetting.QualityLevel5 then - return 5 - elseif savedQualityLevel == Enum.SavedQualitySetting.QualityLevel6 then - return 6 - elseif savedQualityLevel == Enum.SavedQualitySetting.QualityLevel7 then - return 7 - elseif savedQualityLevel == Enum.SavedQualitySetting.QualityLevel8 then - return 8 - elseif savedQualityLevel == Enum.SavedQualitySetting.QualityLevel9 then - return 9 - elseif savedQualityLevel == Enum.SavedQualitySetting.QualityLevel10 then - return 10 - end - end - - local function enableGraphicsWidget() - settings().Rendering.EnableFRM = true - - isAutoGraphics = (UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic) - if isAutoGraphics then - showAutoGraphics() - goToAutoGraphics() - else - showAutoGraphics() - showManualGraphics() - goToManualGraphics(translateSavedQualityLevelToInt(UserSettings().GameSettings.SavedQualityLevel)) - end - end - - local function disableGraphicsWidget() - hideManualGraphics() - hideAutoGraphics() - settings().Rendering.EnableFRM = false - end - - graphicsSetter.FocusLost:connect(function() - 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 - 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(_) - 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 - settings().Rendering.EnableFRM = false - disableGraphicsWidget() - else - settings().Rendering.EnableFRM = true - goToAutoGraphics() - end - else - 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 not isAutoGraphics then - goToAutoGraphics() - else - goToManualGraphics(graphicsLevel.Value) - end - end) - - game.GraphicsQualityChangeRequest:connect(function(graphicsIncrease) - if isAutoGraphics then - return - end -- only can set graphics in manual mode - - if graphicsIncrease then - 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", - "Increased to (" .. graphicsSetter.Text .. ")", - "", - 2, - function() end - ) - else - 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", - "Decreased to (" .. graphicsSetter.Text .. ")", - "", - 2, - function() end - ) - end - end) - - game.Players.PlayerAdded:connect(function(player) - if player == game.Players.LocalPlayer and inStudioMode then - enableGraphicsWidget() - end - end) - game.Players.PlayerRemoving:connect(function(player) - if player == game.Players.LocalPlayer and inStudioMode then - disableGraphicsWidget() - end - end) - - 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.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" - disableGraphicsWidget() - elseif inStudioMode then - studioCheckbox.Text = "X" - enableGraphicsWidget() - end - if hasGraphicsSlider then - UserSettings().GameSettings.StudioModeChanged:connect(function(isStudioMode) - inStudioMode = isStudioMode - if isStudioMode then - wasManualGraphics = (settings().Rendering.QualityLevel ~= Enum.QualityLevel.Automatic) - goToAutoGraphics() - studioCheckbox.Text = "X" - autoGraphicsButton.ZIndex = 1 - autoText.ZIndex = 1 - else - if wasManualGraphics then - goToManualGraphics() - end - studioCheckbox.Text = "" - autoGraphicsButton.ZIndex = baseZIndex + 4 - autoText.ZIndex = baseZIndex + 4 - end - end) - else - studioCheckbox.MouseButton1Click:connect(function() - if not studioCheckbox.Active then - return - end - - if studioCheckbox.Text == "" then - studioCheckbox.Text = "X" - else - studioCheckbox.Text = "" - end - end) - end - end - - 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 - if hasGraphicsSlider then - UserSettings().GameSettings.FullscreenChanged:connect(function(isFullscreen) - if isFullscreen then - fullscreenCheckbox.Text = "X" - else - fullscreenCheckbox.Text = "" - end - end) - else - fullscreenCheckbox.MouseButton1Click:connect(function() - if fullscreenCheckbox.Text == "" then - fullscreenCheckbox.Text = "X" - else - fullscreenCheckbox.Text = "" - end - end) - end - - 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.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.Modal = true - end - - backButton.Name = "BackButton" - backButton.ZIndex = baseZIndex + 4 - backButton.Parent = gameSettingsMenuFrame - - syncVideoCaptureSetting = nil - - if not macClient then - 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.BackgroundTransparency = 1 - videoCaptureLabel.TextColor3 = Color3I(255, 255, 255) - videoCaptureLabel.TextXAlignment = Enum.TextXAlignment.Left - videoCaptureLabel.ZIndex = baseZIndex + 4 - videoCaptureLabel.Parent = gameSettingsMenuFrame - - local videoNames = {} - local videoNameToItem = {} - videoNames[1] = "Just Save to Disk" - videoNameToItem[videoNames[1]] = Enum.UploadSetting["Never"] - videoNames[2] = "Upload to YouTube" - 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.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.Parent = gameSettingsMenuFrame - - syncVideoCaptureSetting = function() - if UserSettings().GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Never"] then - updateVideoCaptureDropDownSelection(videoNames[1]) - elseif UserSettings().GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Ask me first"] then - updateVideoCaptureDropDownSelection(videoNames[2]) - else - UserSettings().GameSettings.VideoUploadPromptBehavior = Enum.UploadSetting["Ask me first"] - updateVideoCaptureDropDownSelection(videoNames[2]) - end - end - end - - 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.TextXAlignment = Enum.TextXAlignment.Left - cameraLabel.BackgroundTransparency = 1 - cameraLabel.ZIndex = baseZIndex + 4 - cameraLabel.Parent = gameSettingsMenuFrame - - local mouseLockLabel = game.CoreGui.RobloxGui:FindFirstChild("MouseLockLabel", true) - - local enumItems = Enum.ControlMode:GetEnumItems() - local enumNames = {} - local enumNameToItem = {} - 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) - 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.Parent = gameSettingsMenuFrame - - return gameSettingsMenuFrame -end - -if LoadLibrary then - RbxGui = LoadLibrary "RbxGui" - local baseZIndex = 0 - if UserSettings then - 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 - - 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 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) - 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) - - 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() - 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 - end - centerDialogs = {} - 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) - - 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 - - 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() - end - - 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 - ) - 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 - ) - 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 Mercury 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 Mercury.", - "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 Mercury..." - 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 - - local createReportAbuseDialog = function() - --Only show things if we are a NetworkClient - waitForChild(game, "NetworkClient") - - 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 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 closeAndResetDialog - - 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 recordedMessageBox = RbxGui.CreateMessageDialog( - "Thanks for your report!", - "We've recorded your report for evaluation.", - messageBoxButtons - ) - recordedMessageBox.Visible = false - recordedMessageBox.Parent = shield - - 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 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 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 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 _, 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 - 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(0.425, 0, 0, 102) - playerDropDown.Size = UDim2.new(0.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 - - 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 - - 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 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 - 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, - --ShowFunction - function() - reportAbuseButton.Active = false - shield.Visible = true - mainShield.Visible = false - end, - --HideFunction - function() - reportAbuseButton.Active = true - shield.Visible = false - end - ) - end) - - robloxLock(shield) - return shield - end - - -- 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 - - -- 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 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 - -- chatBox.Text = "" - -- chatBox.Visible = true - -- chatBox:CaptureFocus() - -- end - - -- chatButton.MouseButton1Click:connect(activateChat) - - -- -- local hotKeyEnabled = true - -- local toggleHotKey = function(_) - -- -- 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 - -- game.Players:TeamChat(string.sub(str, 2)) - -- else - -- game.Players:Chat(str) - -- end - -- end - -- end - -- chatBox.Text = "" - -- chatBox.Visible = false - -- chatButton.Visible = true - -- 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() - local saveDialogs = createSaveDialogs() - saveDialogs.Parent = gui - - game.RequestShutdown = function() - table.insert(centerDialogs, saveDialogs) - game.GuiService:AddCenterDialog( - saveDialogs, - Enum.CenterDialogType.QuitDialog, - --ShowFunction - function() - saveDialogs.Visible = true - end, - --HideFunction - function() - saveDialogs.Visible = false - end - ) - - return true - end - end) - end - - --Spawn a thread for the Report Abuse dialogs - delay(0, function() - createReportAbuseDialog().Parent = gui - 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") - gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton.Active = true - end) - - --Spawn a thread for Chat Bar - --[[local success, luaChat = ]] - pcall(function() - return game.GuiService.UseLuaChat - end) - -- if success and luaChat then - - --[[delay(0, - function() - waitForChild(game, "Players") - waitForProperty(game.Players, "LocalPlayer") - - local advancedChatBarSupported = game.Players.LocalPlayer.ChatMode - local chatBar, toggleHotKey = createChatBar() - - [if advancedChatBarSupported then - local function toggleChatBar(chatMode) - if chatMode == Enum.ChatMode.Menu then - chatBar.Parent = nil - game.GuiService:SetGlobalSizeOffsetPixel(0,0) - toggleHotKey(false) - elseif chatMode == Enum.ChatMode.TextAndMenu then - --chatBar.Parent = gui - --game.GuiService:SetGlobalSizeOffsetPixel(0,-22) - toggleHotKey(true) - end - end - game.Players.LocalPlayer.Changed:connect( - function(prop) - if prop == "ChatMode" then - toggleChatBar(game.Players.LocalPlayer.ChatMode) - end - end) - toggleChatBar(game.Players.LocalPlayer.ChatMode) - else - --chatBar.Parent = gui - --game.GuiService:SetGlobalSizeOffsetPixel(0,-22) - 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") - 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) - waitForChild(character, "Humanoid") - character.Humanoid:SetClickToWalkEnabled(false) - end) - end - end) -end --LoadLibrary if diff --git a/lua/48488235.lua b/lua/48488235.lua deleted file mode 100644 index d798482..0000000 --- a/lua/48488235.lua +++ /dev/null @@ -1,3229 +0,0 @@ ---new playerlist by Zach Lindblad (fusroblox) ---contact him for any revisions/issues --------------------- --- Super Util --------------------- - ---[[ local ADMINS = -{ - aceswayuphigh = 1, - adamintygum = 1, - afackler11 = 1, - aleverns = 1, - aquabot8 = 1, - arbolito = 1, - argforpirates = 1, - argonpirate = 1, - asmohdian = 1, - bellavour = 1, - blockhaak = 1, - brighteyes = 1, - briguy9876 = 1, - builderman = 1, - cdakkar = 1, - chiefjustus = 1, - chro = 1, - cmed = 1, - coatp0cketninja = 1, - codewriter = 1, - commandercrow = 1, - corgiparade = 1, - dapperbuffalo = 1, - dbapostle = 1, - deeana00 = 1, - doughtless = 1, - dunbar1138 = 1, - echodown = 1, - ffjosh = 1, - foyle = 1, - gemlocker = 1, - goddessnoob = 1, - gongfutiger = 1, - gordonrox24 = 1, - gorroth = 1, - grossinger = 1, - groundcontroll2 = 1, - hawkeyebandit = 1, - hawkington = 1, - ibanez2189 = 1, - iltalumi = 1, - inventx = 1, - jackssmirkingrevenge = 1, - jeditkacheff = 'http://www.roblox.com/asset/?id=134032333', - kbux = 1, - keith = 1, - limon = 1, - loopylens = 1, - lordrugdumph = 1, - majortom4321 = 1, - malcomso = 1, - maxvee = 1, - midwinterfires = 1, - mistersquirrel = 1, - morganic = 1, - motornerve = 1, - mrdoombringer = 1, - mse6 = 1, - newtrat = 1, - niquemonster = 1, - nobledragon = 1, - noob007 = 1, - nrawat1 = 1, - olive71 = 1, - onlytwentycharacters = 1, - orcasparkles = 1, - ostrichsized = 1, - phaedre = 1, - phil = 1, - pulmoesflor = 1, - raeglyn = 1, - rbadam = 1, - reesemcblox = 1, - robliu = 1, - roblowilson = 1, - robloxsai = 1, - roboyz = 1, - saurauss = 1, - screenme = 1, - scubasomething = 1, - seanthornton = 1, - shedletsky = 'http://www.roblox.com/asset/?id=105897927', - sickenedmonkey = 1, - slingshotjunkie = 1, - smeaferblox = 1, - soggoth = 1, - solarcrane = 1, - sooraya = 1, - sorcus = 'http://www.roblox.com/asset/?id=113059239', - squidcod = 1, - stickmasterluke = 1, - stuball = 1, - tabemono = 1, - tarabyte = 1, - thelorekt = 1, - thorasaur = 1, - timobius = 1, - tobotrobot = 1, - tone = 1, - totallynothere = 1, - totbl = 1, - twberg = 1, - vaiobot = 1, - varia = 1, - vladthefirst = 1, - wonderboy76 = 1, - xerolayne = 1, - yesth = 1, - yumyumcheerios = 1, - zeuxcg = 1, - zodiaczak = 1, - ['erik.cassel'] = 1, - ['david.baszucki'] = 1, - ['matt dusek'] = 1, -} --]] - -local ADMINS = { - taskmanager = 1, - Heliodex = 1, - multako = "http://www.roblox.com/asset/?id=6923328292", - mercury = 1, - 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", -} - -local BASE_TWEEN = 0.25 - -local MOUSE_DRAG_DISTANCE = 15 - ---[[ - Generic object Create function, which I am using to create Gui's - Thanks to Stravant! ---]] -local Obj = {} -function Obj.Create(guiType) - return function(data) - local obj = Instance.new(guiType) - for k, v in pairs(data) do - if type(k) == "number" then - v.Parent = obj - else - obj[k] = v - end - end - return obj - end -end - ---[[ - makes a full sized background for a guiobject - @Args: - imgName asset name of image to fill background - @Return: background gui object ---]] -function MakeBackgroundGuiObj(imgName) - return Obj.Create "ImageLabel" { - Name = "Background", - BackgroundTransparency = 1, - Image = imgName, - Position = UDim2.new(0, 0, 0, 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) -end - ---[[ - Gets correct icon for builder's club status to display by name - @Args: - membershipType Enum of membership status - @Return: string of image asset ---]] -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 - return ADMINS[string.lower(playerName)] - end - elseif membershipType == Enum.MembershipType.None then - return "" - elseif membershipType == Enum.MembershipType.BuildersClub then - return "rbxasset://textures/ui/TinyBcIcon.png" - elseif membershipType == Enum.MembershipType.TurboBuildersClub then - return "rbxasset://textures/ui/TinyTbcIcon.png" - elseif membershipType == Enum.MembershipType.OutrageousBuildersClub then - return "rbxasset://textures/ui/TinyObcIcon.png" - else - error("Unknown membershipType" .. membershipType) - end -end - -local function getFriendStatusIcon(friendStatus) - if friendStatus == Enum.FriendStatus.Unknown or friendStatus == Enum.FriendStatus.NotFriend then - return "" - elseif friendStatus == Enum.FriendStatus.Friend then - return "http://www.roblox.com/asset/?id=99749771" - elseif friendStatus == Enum.FriendStatus.FriendRequestSent then - return "http://www.roblox.com/asset/?id=99776888" - elseif friendStatus == Enum.FriendStatus.FriendRequestReceived then - return "http://www.roblox.com/asset/?id=99776838" - else - error("Unknown FriendStatus: " .. friendStatus) - end -end - ---[[ - Utility function to create buttons for the popup menus - @Args: - nparent what to parent this button to - ntext text to put on this button - index number index of this entry in menu - 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", - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 1 * index, 0), - Size = UDim2.new(1, 0, 1, 0), - ZIndex = 7, - Obj.Create "TextLabel" { - Name = "ButtonText", - BackgroundTransparency = 1, - Position = UDim2.new(0.07, 0, 0.07, 0), - Size = UDim2.new(0.86, 0, 0.86, 0), - Parent = HeaderFrame, - Font = "ArialBold", - Text = ntext, - FontSize = "Size14", - TextScaled = true, - TextColor3 = Color3.new(1, 1, 1), - TextStrokeTransparency = 1, - ZIndex = 7, - }, - Parent = nparent, - } - 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"] - else - 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" - else - tobj.Image = "http://www.roblox.com/asset/?id=97109338" - end - end - return tobj -end - ---[[ - obligatory wait for child function - @Args: - parent Parent object to look for child in - child name of child object to look for - @Return: object waited for ---]] -function WaitForChild(parent, child) - while not parent:FindFirstChild(child) do - wait() - debugprint(" child " .. parent.Name .. " waiting for " .. child) - end - return parent[child] -end - ---------------------------- --- Workspace Objects ---------------------------- - --- might want to move all this to an init function, wait for localplayer elsewhere -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() -end - -local LocalPlayer = Players.LocalPlayer -local Mouse = LocalPlayer:GetMouse() - -local ScreenGui = Obj.Create "Frame" { - Name = "PlayerListScreen", - Size = UDim2.new(1, 0, 1, 0), - BackgroundTransparency = 1, - Parent = script.Parent, -} -local MainFrame = Obj.Create "Frame" { - Name = "LeaderBoardFrame", - Position = UDim2.new(1, -150, 0.005, 0), - Size = UDim2.new(0, 150, 0, 800), - BackgroundTransparency = 1, - Parent = ScreenGui, -} - ---frame used for expanding leaderstats when frame is 'focused' -local FocusFrame = Obj.Create "Frame" { - Name = "FocusFrame", - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, 0, 100), - BackgroundTransparency = 1, - Active = true, - Parent = MainFrame, -} - --- HEADER -local HeaderFrame = Obj.Create "Frame" { - Name = "Header", - BackgroundTransparency = 1, - 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", -} -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, 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, -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, -} -local PopUpPanel = nil -local PopUpPanelTemplate = Obj.Create "Frame" { - Name = "Panel", - BackgroundTransparency = 1, - 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 MiddleTemplate = Obj.Create "Frame" { - Name = "MidTemplate", - BackgroundTransparency = 1, - 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(0.005, 5, 0.20, 0), - Size = UDim2.new(0, 16, 0, 16), - SizeConstraint = "RelativeYY", - Image = "", - ZIndex = 3, - }, - Obj.Create "ImageLabel" { - Name = "FriendLabel", - Active = true, - BackgroundTransparency = 1, - 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", - Active = true, - BackgroundTransparency = 1, - Position = UDim2.new(0.005, 1, 0, 0), - Size = UDim2.new(0.96, 0, 1, 0), - ZIndex = 3, - }, - Obj.Create "Frame" { - Name = "TitleFrame", - BackgroundTransparency = 1, - 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", - ZIndex = 3, - }, - }, - - 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", - ZIndex = 3, - }, - --Obj.Create'IntValue'{Name = 'ID'}, - --Obj.Create'ObjectValue'{Name = 'Player'}, - --Obj.Create'IntValue'{Name = 'Score'}, - ZIndex = 3, -} -local MiddleBGTemplate = Obj.Create "Frame" { - Name = "MidBGTemplate", - BackgroundTransparency = 1, - 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 - -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), - BackgroundTransparency = 1, -} - -local ReportAbuseFrame = Obj.Create "Frame" { - Name = "Settings", - 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" { - 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" { - Name = "Title", - Text = "Report Abuse", - TextColor3 = Color3I(221, 221, 221), - Position = UDim2.new(0.5, 0, 0, 30), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size36, - }, - 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(0.01, 0, 0, 55), - Size = UDim2.new(0.99, 0, 0, 40), - BackgroundTransparency = 1, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - TextWrap = true, - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top, - }, - 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), - TextXAlignment = Enum.TextXAlignment.Left, - }, - 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), - TextXAlignment = Enum.TextXAlignment.Left, - BackgroundTransparency = 1, - }, - 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), - TextXAlignment = Enum.TextXAlignment.Left, - Parent = AbuseSettingsFrame, - }, - - Parent = ReportAbuseFrame, -} - -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), - TextXAlignment = Enum.TextXAlignment.Right, - Parent = AbuseSettingsFrame, -} - -local SubmitReportButton = Obj.Create "ImageButton" { - Name = "SubmitReportBtn", - Active = false, - BackgroundTransparency = 1, - 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', - Parent = AbuseSettingsFrame, -} - -local CancelReportButton = Obj.Create "ImageButton" { - Name = "CancelBtn", - BackgroundTransparency = 1, - 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", - Parent = AbuseSettingsFrame, -} - -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), - BorderSizePixel = 0, - Parent = AbuseSettingsFrame, -} - -local AbuseDescriptionBox - -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), - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top, - TextWrap = true, - 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, 0.05, 0), - Size = UDim2.new(1, -30, 0.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, 0.20, 0), - Size = UDim2.new(1, -30, 0.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", - 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", - }, - 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 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 -function debugprint(str) - --print(str) - if DebugPrintEnabled then - debugOutput.Text = str - end -end - -------------------------- --- Script objects -------------------------- -local RbxGui = assert(LoadLibrary "RbxGui") - --- 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) -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) -local ScoreNames = {} --- 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) -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) -local TeamFrames = {} --- one special entry from teamFrames, for unaffiliated players, only shown if players non - empty -local NeutralTeam = nil - --- final 'to be displayed' list of frames -local MiddleFrames = {} -local MiddleFrameBackgrounds = {} --- time of last click -local LastClick = 0 -local ButtonCooldown = 0.25 - -local OnIos = false -pcall(function() - OnIos = Game:GetService("UserInputService").TouchEnabled -end) - --- 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(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 = -0.04 - --- where the scroll par currently is positioned - -local DefaultBottomClipPos = BottomClipFrame.Position.Y.Scale - -local SelectedPlayerEntry = nil -local SelectedPlayer = nil - --- locks(semaphores) for stopping race conditions -local AddingFrameLock = false -local AddingStatLock = false -local BaseUpdateLock = false -local WaitForClickLock = false -local InPopupWaitForClick = false -local PlayerChangedLock = false -local NeutralTeamLock = false - -local ScrollWheelConnections = {} - -local DefaultListSize = 8 -if not OnIos then - DefaultListSize = 12 -end -local DidMinimizeDrag = false - ---local PlaceCreatorId=game.CreatorId - --- report abuse objects -local AbuseName -local Abuses = { - "Bad Words or Threats", - "Bad Username", - "Talking about Dating", - "Account Trading or Sharing", - "Asking Personal Questions", - "Rude or Mean Behavior", - "False Reporting Me", -} -local UpdateAbuseFunction -local AbuseDropDown - -local PrivilegeLevel = { - Owner = 255, - Admin = 240, - Member = 128, - Visitor = 10, - Banned = 0, -} - -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 - end -end) -------------------------------- --- Static Functions -------------------------------- --- function GetTotalEntries() --- return math.min(#MiddleFrameBackgrounds, DefaultEntriesOnScreen) --- end - --- function GetEntryListLength() --- local numEnts = #PlayerFrames + #TeamFrames --- if NeutralTeam then --- numEnts = numEnts + 1 --- end --- return numEnts --- end - -function AreAllEntriesOnScreen() - return #MiddleFrameBackgrounds * MiddleTemplate.Size.Y.Scale <= 1 + DefaultBottomClipPos -end - --- function GetLengthOfVisbleScroll() --- return 1 + DefaultBottomClipPos --- end - -function GetMaxScroll() - return DefaultBottomClipPos * -1 -end --- can be optimized by caching when this varible changes -function GetMinScroll() - if AreAllEntriesOnScreen() then - return GetMaxScroll() - else - return (GetMaxScroll() - (#MiddleFrameBackgrounds * MiddleTemplate.Size.Y.Scale)) + (1 + DefaultBottomClipPos) - end -end - -function AbsoluteToPercent(x, y) - return Vector2.new(x, y) / ScreenGui.AbsoluteSize -end ---[[ - tweens property of element from starta to enda over length of time - Warning: should be put in a Spawn call - @Args: - element textobject to tween transparency on - propName - starta alpha to start tweening - enda alpha to end tweening on - length how many seconds to spend tweening ---]] -function TweenProperty(obj, propName, inita, enda, length) - local startTime = tick() - while tick() - startTime < length do - obj[propName] = ((enda - inita) * ((tick() - startTime) / length)) + inita - wait(1 / 30) - end - obj[propName] = enda -end ---[[ - UGLY UGLY HACK FUNCTION - replace with some sort of global input catching A.S.A. FREAKING P. - creates a fullsize gui element to catch next mouse up event(completeing a click) - @Args: - frameParent Object to parent fullscreen gui to - polledFunction function to call on mouse moved events in this gui - exitFunction function to call when click event is fired ---]] - -function WaitForClick(frameParent, polledFunction, exitFunction) - if WaitForClickLock then - return - end - WaitForClickLock = true - local connection, connection2 - connection = BigButton.MouseButton1Up:connect(function(nx, ny) - exitFunction(nx, ny) - BigButton.Visible = false - connection:disconnect() - if connection2 then - connection2:disconnect() - end - --debugprint('mouse up!') - end) - connection2 = BigButton.MouseMoved:connect(function(nx, ny) - polledFunction(nx, ny) - end) - - --debugprint('waiting for click!') - BigButton.Visible = true - BigButton.Active = true - BigButton.Parent = frameParent - frameParent.AncestryChanged:connect(function(child, nparent) - if child == frameParent and nparent == nil then - exitFunction(nx, ny) - BigButton.Visible = false - connection:disconnect() - connection2:disconnect() - debugprint "forced out of wait for click" - end - end) - WaitForClickLock = false -end - ---------------------------- ---Personal Server Handling ---------------------------- ---[[ - returns privlage level based on integer rank - Note: these privilege levels seem completely arbitrary, but no documentation exists - this is all from the old player list, really weird - @Args: - rank Integer rank value for player - @Return Normalized integer value for rank? ---]] --- function GetPrivilegeType(rank) --- if rank <= PrivilegeLevel["Banned"] then --- return PrivilegeLevel["Banned"] --- elseif rank <= PrivilegeLevel["Visitor"] then --- return PrivilegeLevel["Visitor"] --- elseif rank <= PrivilegeLevel["Member"] then --- return PrivilegeLevel["Member"] --- elseif rank <= PrivilegeLevel["Admin"] then --- return PrivilegeLevel["Admin"] --- else --- return PrivilegeLevel["Owner"] --- end --- end - ---[[ - gives a player a new privilage rank - Note: Very odd that I have to use loops with this instead of directly setting the rank - but no documentation for personal server service exists - @Args: - player player to change rank of - nrank new integer rank to give player ---]] -function SetPrivilegeRank(player, nrank) - while player.PersonalServerRank < nrank do - game:GetService("PersonalServerService"):Promote(player) - end - while player.PersonalServerRank > nrank do - game:GetService("PersonalServerService"):Demote(player) - end -end ---[[ - called when player selects new privilege level from popup menu - @Args: - 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) -end - ---[[ - Highlights current rank of this player in the popup menu - @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"] - end -end - --------------------------- --- Report abuse handling --------------------------- ---[[ - does final reporting of abuse on selected player, calls closeAbuseDialog ---]] -function OnSubmitAbuse() - if SubmitReportButton.Active then - if AbuseName and SelectedPlayer then - AbuseSettingsFrame.Visible = false - game.Players:ReportAbuse(SelectedPlayer, AbuseName, AbuseDescriptionBox.Text) - if AbuseName == "Rude or Mean Behavior" or AbuseName == "False Reporting Me" then - CalmingAbuseBox.Parent = ReportAbuseShield - else - debugprint "opening abuse box" - NormalAbuseBox.Parent = ReportAbuseShield - end - else - CloseAbuseDialog() - end - end -end - ---[[ - opens the abuse dialog, initialises text to display selectedplayer ---]] -function OpenAbuseDialog() - 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() - AbuseDescriptionBox.Parent = AbuseDescriptionWrapper - ReportAbuseShield.Parent = ScreenGui - ClosePopUpPanel() -end ---[[ - resets and closes abuse dialog ---]] -function CloseAbuseDialog() - AbuseName = nil - SubmitReportButton.Active = false - SubmitReportButton.Image = "http://www.roblox.com/asset/?id=96502438" -- 96501119', - AbuseDescriptionBox:Destroy() - CalmingAbuseBox.Parent = nil - NormalAbuseBox.Parent = nil - ReportAbuseShield.Parent = nil - AbuseSettingsFrame.Visible = true -end - ---[[ - creates dropdownbox, registers all listeners for abuse dialog ---]] -function InitReportAbuse() - UpdateAbuseFunction = function(abuseText) - AbuseName = abuseText - if AbuseName and SelectedPlayer then - SubmitReportButton.Active = true - SubmitReportButton.Image = "http://www.roblox.com/asset/?id=96501119" - end - end - - AbuseDropDown, _ = 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.Parent = AbuseSettingsFrame - - CancelReportButton.MouseButton1Click:connect(CloseAbuseDialog) - SubmitReportButton.MouseButton1Click:connect(OnSubmitAbuse) - - CalmingAbuseBox:FindFirstChild("OkButton").MouseButton1Down:connect(CloseAbuseDialog) - NormalAbuseBox:FindFirstChild("OkButton").MouseButton1Down:connect(CloseAbuseDialog) -end - -------------------------------------- --- Friend/unfriending -------------------------------------- ---[[ - gets enum val of friend status, uses pcall for some reason?(from old playerlist) - @Args: - player player object to check if friends with - @Return: enum of friend status ---]] -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) - if success then - return result - else - return Enum.FriendStatus.NotFriend - end - end -end - ---[[ - when friend button is clicked, tries to take appropriate action, - based on current friend status with SelectedPlayer ---]] -function OnFriendButtonSelect() - local friendStatus = GetFriendStatus(SelectedPlayer) - if friendStatus == Enum.FriendStatus.Friend then - LocalPlayer:RevokeFriendship(SelectedPlayer) - 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) - ClosePopUpPanel() - --PopUpPanel:TweenPosition(UDim2.new(1,0,0,0), "Out", "Linear", BASE_TWEEN,true) -end - -function OnFriendRefuseButtonSelect() - LocalPlayer:RevokeFriendship(SelectedPlayer) - ClosePopUpPanel() - 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() - end - 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 -function BlowThisPopsicleStand() - --ScreenGui:Destroy() - --script:Destroy() - --time to make the fanboys rage... - Tabify() -end ---[[ - used by lua's table.sort to prioritize score entries ---]] -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 a.Priority == b.Priority then - return a.AddId < b.AddId - end - return a.Priority < b.Priority -end ---[[ - doing WAAY too much here, for optimization update only your team - @Args: - 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 -end ---[[ - Called when stat is added - if playerEntry is localplayer, will add to score names and re-sort the stats, and resize the width of the leaderboard - for all players, will add a listener for if this stat changes - if stat is a string value, crashes the leaderboard - Note:change crash to a 'tabify' leaderboard later - @Args: - 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 - 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 - BlowThisPopsicleStand() - else - local haveScore = false - 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 - end - 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"]) - end - UpdateMaximize() - end - 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 - --print('player:' .. playerf['Player'].Name ..' has stat') - return true - end - end - return false -end - ---[[ - Called when stat is removed from player - for all players, destroys the stat frame associated with this value, - then calls statchanged(to resize frame) - if playerEntry==localplayer, will remove from scorenames - @Args: - 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 - 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() - end - end - end - end - end - AddingStatLock = false - StatChanged(playerEntry) -end ---[[ - clears all stats from a given playerEntry - used when leaderstats are removed, or when new leaderstats are added(for weird edge case)+ ---]] -function RemoveAllStats(playerEntry) - for _, val in ipairs(ScoreNames) do - StatRemoved(val, playerEntry) - end -end - -function GetScoreValue(score) - 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 - else - return score.Value - end -end ---[[ - ---]] -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"]) - else - return - end - - 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 - 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 - end - nscoretxt.Text = tostring(GetScoreValue(thisScore)) - BaseUpdate() - end) - return nscoretxt -end - -function CreateStatTitle(statName) - local ntitle = MiddleTemplate:FindFirstChild("PlayerScore"):Clone() - ntitle.Name = statName - ntitle.Text = statName - -- ntitle - if IsMaximized.Value then - ntitle.TextTransparency = 0 - else - ntitle.TextTransparency = 1 - end - ntitle.Parent = StatTitles -end - -function RecreateScoreColumns(ptable) - 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 - - -- foreach known leaderstat - for j = #ScoreNames, 1, -1 do - local scoreval = ScoreNames[j] - - MaxSizeColumn = 0 - -- for each entry in this player table - for _, 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 - -- make an entry for this object - local nentry = MakeScoreEntry(entry, scoreval, panel) - if nentry then - 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 - local ntitle = nentry:Clone() - --ntitle.TextXAlignment = 'Right' - ntitle.Parent = entry["MyTeam"]["Frame"] - end - end - end - scoreval["XOffset"] = Xoffset - - 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 - ) - else - 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) - end - 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 ---------------------------- - -function ToggleMinimize() - IsMinimized.Value = not IsMinimized.Value - UpdateStatNames() -end - -function ToggleMaximize() - IsMaximized.Value = not IsMaximized.Value - RecreateScoreColumns(PlayerFrames) --done to re-position stat names NOTE: optimize-able -end - -function Tabify() - 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 - ) -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) - end -end - ---[[ - Does more than it looks like - monitors positions of the clipping frames and bottom frames - 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(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" - else - if not IsMaximized.Value then - 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)) - 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" - end -end - ---[[ - Manages the position/size of the mainFrame, swaps out different resolution images for the frame - fades in and out the stat names, moves position of headername and header score ---]] -function UpdateMaximize() - if IsMaximized.Value then - for j = 1, #ScoreNames, 1 do - local scoreval = ScoreNames[j] - 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(-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"] - else - i.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["LargeLight"] - end - end - 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 - local scoreval = ScoreNames[j] - 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 _, entry in ipairs(PlayerFrames) do - WaitForChild(entry["Frame"], "TitleFrame").Size = - UDim2.new(0.38, 0, entry["Frame"].TitleFrame.Size.Y.Scale, 0) - end - - for _, entry in ipairs(TeamFrames) do - WaitForChild(entry["Frame"], "TitleFrame").Size = - UDim2.new(0.38, 0, entry["Frame"].TitleFrame.Size.Y.Scale, 0) - end - else - if not IsMinimized.Value then - MainFrame:TweenSizeAndPosition(NormalBounds, NormalPosition, "Out", "Linear", BASE_TWEEN * 1.2, true) - end - 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"] - else - i.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["midLight"] - end - end - for _, i in ipairs(MiddleFrames) 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 - --print('updateing stat position: ' .. scoreval['Name']) - i[scoreval["Name"]]:TweenPosition( - UDim2.new(RightEdgeSpace, -scoreval["XOffset"], 0, 0), - "Out", - "Linear", - BASE_TWEEN, - true - ) - end - end - end - end - - for _, 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 _, 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 - -function ExpandNames() - if #ScoreNames ~= 0 then - for _, i in pairs(StatTitles:GetChildren()) do - Spawn(function() - TweenProperty(i, "TextTransparency", i.TextTransparency, 0, BASE_TWEEN) - end) - end - 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) - end -end - -function CloseNames() - if #ScoreNames ~= 0 then - 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 - ) - end -end - -function UpdateStatNames() - if not AreNamesExpanded.Value or IsMinimized.Value then - CloseNames() - else - ExpandNames() - 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()) - - ListFrame.Position = UDim2.new(StartFrame.X.Scale, StartFrame.X.Offset, newFrameY, StartFrame.Y.Offset) - UpdateScrollPosition() - end -end - -function AttachScrollWheel() - if ScrollWheelConnections then - return - end - ScrollWheelConnections = {} - 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 - i:disconnect() - end - end - ScrollWheelConnections = nil -end - -FocusFrame.MouseEnter:connect(function() - if not (IsMinimized.Value or IsTabified.Value) then - AttachScrollWheel() - end -end) -FocusFrame.MouseLeave:connect(function() - --if not (IsMaximized.Value or IsMinimized.Value) then - DetachScrollWheel() - --end -end) - ------------------------- --- Scroll Bar functions ------------------------- ---[[ - updates whether the scroll bar should be showing, if it is showing, updates - the size of it ---]] -function UpdateScrollBarVisibility() - if AreAllEntriesOnScreen() then - ScrollBar.BackgroundTransparency = 1 - else - ScrollBar.BackgroundTransparency = 0 - UpdateScrollBarSize() - 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 ---[[ - 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 ---]] -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 adjustedLength = 1 - ScrollBar.Size.Y.Scale - ScrollBar.Position = - UDim2.new(0, 0, adjustedLength - (adjustedLength * ((ListFrame.Position.Y.Scale - minPos) / scrollLength)), 0) -end - ---[[ - WARNING:this is in a working state, but uses massive hacks - revize when global input is available - Manages scrolling of the playerlist on mouse drag ---]] -function StartDrag(entry, startx, starty) - 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 - 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 - WaitForClick(ScreenGui, dragpoll, dragExit) -end - -function StartMinimizeDrag() - Delay(0, function() - local startTime = tick() - debugprint "Got Click2" - local function dragExit() - --debugprint('undone click2') - if tick() - startTime < 0.25 then --was click - ToggleMinimize() - else --was drag - DidMinimizeDrag = true - if IsMinimized.Value then - ToggleMinimize() - end - end - -- stopDrag = true - end - local startY = nil - local StartFrame = DefaultBottomClipPos - local function dragpoll(nx, ny) - if not IsMinimized.Value then - if not startY then - 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) - ) - 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) - UpdateScrollBarSize() - UpdateScrollPosition() - UpdateScrollBarVisibility() - end - end - Spawn(function() - WaitForClick(ScreenGui, dragpoll, dragExit) - end) - end) -end - -------------------------------- --- 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 - LastClick = time() - if IsTabified.Value then - UnTabify() - else - StartMinimizeDrag() - end -end) - -MaximizeButton.MouseButton1Click:connect(function() - if (time() - LastClick < ButtonCooldown) or InPopupWaitForClick then - return - end - LastClick = time() - if IsTabified.Value then - UnTabify() - elseif not AreNamesExpanded.Value then - AreNamesExpanded.Value = true - BaseUpdate() - else - ToggleMaximize() - end -end) - -MaximizeButton.MouseButton2Click:connect(function() - if (time() - LastClick < ButtonCooldown) or InPopupWaitForClick then - return - end - LastClick = time() - if IsTabified.Value then - UnTabify() - elseif IsMaximized.Value then - ToggleMaximize() - elseif AreNamesExpanded.Value then - AreNamesExpanded.Value = false - BaseUpdate() - else - Tabify() - end -end) - -------------------------------- --- MiddleFrames management -------------------------------- ---[[ - adds a background frame to the listframe ---]] -function AddMiddleBGFrame() - local nBGFrame = MiddleBGTemplate:Clone() - 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"] - else - 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"] - else - nBGFrame.Background.Image = "http://www.roblox.com/asset/?id=" .. Images["midLight"] - end - end - nBGFrame.Parent = ListFrame - table.insert(MiddleFrameBackgrounds, nBGFrame) - - if #MiddleFrameBackgrounds < DefaultListSize and not DidMinimizeDrag then - --print('readjusting bottom clip') - DefaultBottomClipPos = -1 + (#MiddleFrameBackgrounds * MiddleBGTemplate.Size.Y.Scale) - end - - if not IsMinimized.Value then - UpdateMinimize() - end -end ---[[ - removes a background from from the listframe ---]] -function RemoveMiddleBGFrame() - MiddleFrameBackgrounds[#MiddleFrameBackgrounds]:Destroy() - table.remove(MiddleFrameBackgrounds, #MiddleFrameBackgrounds) - if not IsMinimized.Value then - UpdateMinimize() - end -end -------------------------------- --- Player Callback functions -------------------------------- -local FONT_SIZES = { "Size8", "Size9", "Size10", "Size11", "Size12", "Size14", "Size24", "Size36", "Size48" } ---[[ - note:should probably set to something other than mainFrame.AbsoluteSize, should work for now - if textbounds ever works on textscaled, switch to that :( ---]] -function ChangeHeaderName(nname) - HeaderName.Text = nname - UpdateHeaderNameSize() -end - ---[[ - Will fit the player's name to the bounds of the header - called on resize of the window and playedr name change events - HACK: cannot use 'Textscaled' due to unable to find text bounds when scaled ---]] -function UpdateHeaderNameSize() - 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 - 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 -ScreenGui.Changed:connect(UpdateHeaderNameSize) - ---[[ - called only when the leaderstats object is added to a given player entry - removes old stats, adds any existing stats, and sets up listeners for new stats - @Args: - playerEntry A reference to the ENTRY(table) of the player who had leaderstats added ---]] -function LeaderstatsAdded(playerEntry) - --RemoveAllStats(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) -end ---[[ - called when leaderstats object is removed from play in player entry - Note: may not be needed, might be able to just rely on leaderstats added - @Args: - oldLeaderstats leaderstats object to be removed - playerEntry A reference to the ENTRY(table) of the player ---]] -function LeaderstatsRemoved(_, playerEntry) - while AddingFrameLock do - debugprint("waiting to insert " .. playerEntry["Player"].Name) - wait(1 / 30) - end - AddingFrameLock = true - RemoveAllStats(playerEntry) - AddingFrameLock = false -end - -function ClosePopUpPanel() - if SelectedPlayerEntry then - 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(0.1) - InPopupWaitForClick = false - SelectedPlayerEntry = nil -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 - - if PopUpPanel then - PopUpPanel:Destroy() - end - 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) - - 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 - 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) - - BanPlayerButton.MouseButton1Click:connect(function() - OnPrivilegeLevelSelect( - player, - PrivilegeLevel["Banned"], - BanPlayerButton, - VisitorButton, - MemberButton, - AdminButton - ) - end) - VisitorButton.MouseButton1Click:connect(function() - OnPrivilegeLevelSelect( - player, - PrivilegeLevel["Visitor"], - BanPlayerButton, - VisitorButton, - MemberButton, - AdminButton - ) - end) - MemberButton.MouseButton1Click:connect(function() - OnPrivilegeLevelSelect( - player, - PrivilegeLevel["Member"], - BanPlayerButton, - VisitorButton, - MemberButton, - AdminButton - ) - end) - AdminButton.MouseButton1Click:connect(function() - OnPrivilegeLevelSelect( - player, - PrivilegeLevel["Admin"], - BanPlayerButton, - VisitorButton, - MemberButton, - AdminButton - ) - end) - - HighlightMyRank(SelectedPlayer, BanPlayerButton, VisitorButton, MemberButton, AdminButton) - end - - PopUpPanel:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Linear", BASE_TWEEN, true) - Delay(0, function() - local tconnection - tconnection = Mouse.Button1Down:connect(function() - tconnection:disconnect() - ClosePopUpPanel() - end) - end) - - 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) - wait() - end - end) -end - ---[[ - Called when a player entry in the leaderboard is clicked - either will highlight entry and start the drag event, or open a popup menu - @Args: - entry the player entry clicked ---]] -function OnPlayerEntrySelect(entry, startx, starty) - if not InPopupWaitForClick then - SelectedPlayerEntry = entry - 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, 0.5, 0.5) - end) - InPopupWaitForClick = true - InitMovingPanel(entry, entry["Player"]) -end - ---[[ - the basic update for the playerlist mode's state, - assures the order and length of the player frames ---]] -function PlayerListModeUpdate() - RecreateScoreColumns(PlayerFrames) - table.sort(PlayerFrames, PlayerSortFunction) - for i, val in ipairs(PlayerFrames) do - MiddleFrames[i] = val["Frame"] - end - for i = #PlayerFrames + 1, #MiddleFrames, 1 do - MiddleFrames[i] = nil - end - UpdateMinimize() -end ---[[ - this one's a doozie, happens when a player is added to the game - inits their player frame and player entry, assigns them to a team if possible, - and hooks up their leaderstats - @Args: - 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) - end - - if nplayer.Name == LocalPlayer.Name then - 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 - -- else - -- --Delay(2, function () OnFriendshipChanged(nplayer,LocalPlayer:GetFriendStatus(nplayer)) end) - end - nFrame.TitleFrame.Title.Font = "ArialBold" - - nFrame.Parent = ListFrame - 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 - AddId = AddId + 1 - table.insert(PlayerFrames, nentry) - if #TeamFrames ~= 0 then - if nplayer.Neutral then - nentry["MyTeam"] = nil - if not NeutralTeam then - AddNeutralTeam() - else - AddPlayerToTeam(NeutralTeam, nentry) - end - else - local addedToTeam = false - for _, 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() - else - AddPlayerToTeam(NeutralTeam, nentry) - end - nentry["MyTeam"] = NeutralTeam - end - end - end - - 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 - AddingFrameLock = true - LeaderstatsAdded(nentry) - AddingFrameLock = false - end - end) - - 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") - listener.Active = true - listener.MouseButton1Down:connect(function(nx, ny) - OnPlayerEntrySelect(nentry, nx, ny) - end) - - AddMiddleBGFrame() - BaseUpdate() - AddingFrameLock = false -end - ---[[ - Note:major optimization can be done here - 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 - AddingFrameLock = true - - local tteam - 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) - end - end - if tteam then - for j, tentry in ipairs(tteam["MyPlayers"]) do - if tentry["Player"] == tplayer then - RemovePlayerFromTeam(tteam, j) - end - end - end - - RemoveMiddleBGFrame() - UpdateMinimize() - BaseUpdate() - AddingFrameLock = false -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 - @Args: - tframes the team entries to unroll - outframes the list to unroll these entries into ---]] -function UnrollTeams(tframes, outframes) - local numEntries = 0 - if NeutralTeam and not NeutralTeam["IsHidden"] then - for _, val in ipairs(NeutralTeam["MyPlayers"]) do - numEntries = numEntries + 1 - outframes[numEntries] = val["Frame"] - end - numEntries = numEntries + 1 - outframes[numEntries] = NeutralTeam["Frame"] - end - 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"] - end - numEntries = numEntries + 1 - outframes[numEntries] = val["Frame"] - end - end - -- 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"] - end - 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 - sorts each of the team's player lists induvidually, adds up the team scores. - @Args: - tentries table of team entries ---]] -function SortTeams(tentries) - for _, val in ipairs(tentries) do - table.sort(val["MyPlayers"], PlayerSortFunction) - AddTeamScores(val) - end - table.sort(tentries, TeamSortFunc) -end ---[[ - base update for team mode, adds up the scores of all teams, sorts them, - then unrolls them into middleframes ---]] -function TeamListModeUpdate() - RecreateScoreColumns(PlayerFrames) - SortTeams(TeamFrames) - if NeutralTeam then - AddTeamScores(NeutralTeam) - --RecreateScoreColumns(NeutralTeam['MyPlayers']) - end - UnrollTeams(TeamFrames, MiddleFrames) -end ---[[ - adds up all the score of this team's players to form the team score - @Args: - team team entry to sum the scores of ---]] -function AddTeamScores(team) - for j = 1, #ScoreNames, 1 do - local i = ScoreNames[j] - local tscore = 0 - for _, j in ipairs(team["MyPlayers"]) do - local tval = j["Player"]:FindFirstChild "leaderstats" and j["Player"].leaderstats:FindFirstChild(i["Name"]) - 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 - --team['Frame'][i['Name'] ].Size = UDim2.new(1 - (ScrollBarFrame.Size.X.Scale * 2),- ((j-1) * SpacingPerStat),1,0) - team["Frame"][i["Name"]].Text = tostring(tscore) - end - end - UpdateMinimize() -end - ---[[ - finds previous team this player was on, and if it exists calls removeplayerfromteam - @Args - 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) - return - end - end - elseif NeutralTeam then - for j, oldEntry in ipairs(NeutralTeam["MyPlayers"]) do - if oldEntry["Player"] == entry["Player"] then - RemovePlayerFromTeam(NeutralTeam, j) - return - end - end - end -end ---[[ - removes a single player from a given team (not usually called directly) - @Args: - 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) - --if teamEntry['AutoHide'] and #teamEntry['MyPlayers'] == 0 then - if teamEntry == NeutralTeam and #teamEntry["MyPlayers"] == 0 then - RemoveNeutralTeam() - end -end ---[[ - adds player entry entry to teamentry - removes them from any previous team - @Args: - teamEntry entry of team to add player to - entry player entry to add to this team ---]] -function AddPlayerToTeam(teamEntry, entry) - FindRemovePlayerFromTeam(entry) - table.insert(teamEntry["MyPlayers"], entry) - entry["MyTeam"] = teamEntry - if teamEntry["IsHidden"] then - teamEntry["Frame"].Parent = ListFrame - AddMiddleBGFrame() - end - 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 _, 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 - AddNeutralTeam() - else - AddPlayerToTeam(NeutralTeam, entry) - end - end -end - ---[[ - Note:another big one, consiter breaking up - called when any children of player changes - handles 'Neutral', teamColor, Name and MembershipType changes - @Args - entry Player entry changed - property name of property changed ---]] -function PlayerChanged(entry, property) - while PlayerChangedLock do - debugprint "in playerchanged lock" - wait(1 / 30) - end - 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") - FindRemovePlayerFromTeam(entry) - entry["MyTeam"] = nil - if not NeutralTeam then - debugprint(entry["Player"].Name .. "creating neutral team") - AddNeutralTeam() - else - 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") - 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") - 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(0.01, 30, 0.1, 0) - end - if entry["Player"] == LocalPlayer then - entry["Frame"].TitleFrame.DropShadow.Text = entry["Player"].Name - ChangeHeaderName(entry["Player"].Name) - end - BaseUpdate() - end - PlayerChangedLock = false -end - -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 - 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) - end - entry["Frame"].FriendLabel.Image = nicon - return - end - end - end) -end - -LocalPlayer.FriendStatusChanged:connect(OnFriendshipChanged) - ---[[ - adds a neutral team if nessisary - 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 - NeutralTeamLock = true - - 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, 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 - NeutralTeam = nentry - UpdateMinimize() - BaseUpdate() - end - NeutralTeamLock = false -end - -function RemoveNeutralTeam() - while NeutralTeamLock do - debugprint "in neutral team lock" - wait() - end - NeutralTeamLock = true - NeutralTeam["Frame"]:Destroy() - NeutralTeam = nil - RemoveMiddleBGFrame() - NeutralTeamLock = false -end - ---[[ - ---]] -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) - 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 - 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! - end - end - - entry["MyPlayers"] = {} - - for _, i in pairs(PlayerFrames) do - SetPlayerToTeam(i) - end - BaseUpdate() - end -end - ---[[ - creates team entry and frame for this team, sets up listeners for this team - adds any players intended for this team,Creates neutral team if this is the first team added - Note:might be best to break this into multiple functions to simplify - @Args: - nteam new team object added ---]] -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, 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 - 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(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 - AddNeutralTeam() - end - AddingFrameLock = false -end ---[[ - removes team from team list - @Args: - nteam Teamobject to remove ---]] -function RemoveTeamFrame(nteam) - 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 - myEntry = key - key["Frame"]:Destroy() - table.remove(TeamFrames, i) - end - end - 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") - end - RemoveMiddleBGFrame() - BaseUpdate() - AddingFrameLock = false -end - -function TeamAdded(nteam) - InsertTeamFrame(nteam) -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 - BaseUpdateLock = true - --print ('baseupdate') - UpdateStatNames() - - if #TeamFrames == 0 and not NeutralTeam then - PlayerListModeUpdate() - else - TeamListModeUpdate() - end - for i, key in ipairs(MiddleFrames) do - if key.Parent ~= nil then - 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 - UpdateScrollPosition() - end - - UpdateMinimize() - - UpdateScrollBarSize() - UpdateScrollPosition() - - UpdateScrollBarVisibility() - --debugprint('EndBaseUpdate') - BaseUpdateLock = false -end - ---[[ - code for attaching tab key to maximizing player list ---]] -game.GuiService:AddKey "\t" -local LastTabTime = time() -game.GuiService.KeyPressed:connect(function(key) - if key == "\t" then - 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) - IsMaximized.Value = true - else - 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 - end - else - ToggleMaximize() - end - end - end - end -end) - -function PlayersChildAdded(tplayer) - if tplayer:IsA "Player" then - Spawn(function() - debugPlayerAdd(tplayer) - end) - else - BlowThisPopsicleStand() - end -end - -function coreGuiChanged(coreGuiType, enabled) - if coreGuiType == Enum.CoreGuiType.All or coreGuiType == Enum.CoreGuiType.PlayerList then - MainFrame.Visible = enabled - end -end - -function TeamsChildAdded(nteam) - if nteam:IsA "Team" then - TeamAdded(nteam) - else - BlowThisPopsicleStand() - end -end - -function TeamsChildRemoved(nteam) - if nteam:IsA "Team" then - TeamRemoved(nteam) - else - BlowThisPopsicleStand() - end -end - ----------------------------- --- Hookups and initialization ----------------------------- -function debugPlayerAdd(p) - InsertPlayerFrame(p) -end - -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 - -game.Teams.ChildAdded:connect(TeamsChildAdded) -game.Teams.ChildRemoved:connect(TeamsChildRemoved) -Players.ChildAdded:connect(PlayersChildAdded) - -InitReportAbuse() -AreNamesExpanded.Value = true -BaseUpdate() - ---UGGGLY,find a better way later -wait(2) -IsPersonalServer = not not game.Workspace:FindFirstChild "PSVariable" - ----------------------------- --- Running Logic ----------------------------- - ---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 - end - debugplayers.Text = str_players - wait(0.5) - end - end) -end diff --git a/lua/48488398.lua b/lua/48488398.lua deleted file mode 100644 index bb9e594..0000000 --- a/lua/48488398.lua +++ /dev/null @@ -1,354 +0,0 @@ -function waitForProperty(instance, property) - while not instance[property] do - instance.Changed:wait() - end -end -function waitForChild(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end -end - -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 friendRequestBlacklist = {} - -local teleportEnabled = true - -local makePopupInvisible = function() - 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! - - 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" - - 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) - - 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() - ) - 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() - ) - end) -end - -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 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 - ) - 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", - "From " .. fromPlayer.Name, - "http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=48&y=48", - 8, - function() - 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 - ) - end - end -end) - -function showOneButton() - local popup = script.Parent:FindFirstChild "Popup" - if popup then - popup.OKButton.Visible = true - popup.DeclineButton.Visible = false - popup.AcceptButton.Visible = false - end -end - -function showTwoButtons() - local popup = script.Parent:FindFirstChild "Popup" - if popup then - popup.OKButton.Visible = false - popup.DeclineButton.Visible = true - popup.AcceptButton.Visible = true - end -end - -function showTeleportUI(message, timer) - if teleportUI ~= nil then - teleportUI:Remove() - end - waitForChild(localPlayer, "PlayerGui") - teleportUI = Instance.new "Message" - teleportUI.Text = message - teleportUI.Parent = localPlayer.PlayerGui - if timer > 0 then - wait(timer) - teleportUI:Remove() - end -end - -function onTeleport(teleportState, _, _) - if game:GetService("TeleportService").CustomizedTeleportUI == false then - if teleportState == Enum.TeleportState.Started then - showTeleportUI("Teleport started...", 0) - elseif teleportState == Enum.TeleportState.WaitingForServer then - showTeleportUI("Requesting server...", 0) - elseif teleportState == Enum.TeleportState.InProgress then - showTeleportUI("Teleporting...", 0) - elseif teleportState == Enum.TeleportState.Failed then - showTeleportUI("Teleport failed. Insufficient privileges or target place does not exist.", 3) - end - end -end - -if teleportEnabled then - localPlayer.OnTeleport:connect(onTeleport) - - game:GetService("TeleportService").ErrorCallback = function(message) - 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() - ) - 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 - game:GetService("TeleportService").ConfirmationCallback = function(message, placeId, spawnName) - 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() - ) - end - - yesCon = popup.AcceptButton.MouseButton1Click:connect(function() - killCons() - 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() - ) - 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() - 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) - - if centerDialogSuccess == false then - 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) - end - return true - end -end diff --git a/lua/48488451.lua b/lua/48488451.lua deleted file mode 100644 index f93b7c3..0000000 --- a/lua/48488451.lua +++ /dev/null @@ -1,72 +0,0 @@ ---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) -popupFrame.Style = Enum.FrameStyle.RobloxRound -popupFrame.ZIndex = 4 -popupFrame.Name = "Popup" -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.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) -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.Text = "Yes" -acceptButton.ZIndex = 5 -acceptButton.Name = "AcceptButton" -acceptButton.Parent = popupFrame - -local declineButton = acceptButton:clone() -declineButton.Position = UDim2.new(1, -120, 0, 270) -declineButton.Text = "No" -declineButton.Name = "DeclineButton" -declineButton.Parent = popupFrame - -local okButton = acceptButton:clone() -okButton.Name = "OKButton" -okButton.Text = "OK" -okButton.Position = UDim2.new(0.5, -50, 0, 270) -okButton.Visible = false -okButton.Parent = popupFrame - -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.ZIndex = 3 -popupImage.Name = "PopupImage" -popupImage.Parent = popupFrame - -local backing = Instance.new "ImageLabel" -backing.BackgroundTransparency = 1 -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" -popupText.Name = "PopupText" -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.TextWrap = true -popupText.ZIndex = 5 -popupText.Parent = popupFrame - -script:remove() diff --git a/lua/53878047.lua b/lua/53878047.lua deleted file mode 100644 index eb5b87d..0000000 --- a/lua/53878047.lua +++ /dev/null @@ -1,959 +0,0 @@ --- 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 - -local gui = script.Parent - --- A couple of necessary functions -local function waitForChild(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end -end -local function waitForProperty(instance, property) - while not instance[property] do - instance.Changed:wait() - end -end - -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 -end - -waitForChild(game, "Players") -waitForProperty(game.Players, "LocalPlayer") - --- First up is the current loadout -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) -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) -CLBackground.Image = "http://www.roblox.com/asset/?id=96536002" -CLBackground.BackgroundTransparency = 1 -CLBackground.Position = UDim2.new(-0.1, 0, -0.1, 0) -CLBackground.ZIndex = 0.0 -CLBackground.Parent = CurrentLoadout -CLBackground.Visible = false - -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 -BackgroundUp.Parent = CLBackground - -local Debounce = Instance.new "BoolValue" -Debounce.Name = "Debounce" -Debounce.RobloxLocked = true -Debounce.Parent = CurrentLoadout - -local BackpackButton = Instance.new "ImageButton" -BackpackButton.RobloxLocked = true -BackpackButton.Visible = false -BackpackButton.Name = "BackpackButton" -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") -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) -end - -for i = 0, NumSlots do - local slotFrame = Instance.new "Frame" - slotFrame.RobloxLocked = true - slotFrame.BackgroundColor3 = Color3.new(0, 0, 0) - slotFrame.BackgroundTransparency = 1 - slotFrame.BorderColor3 = Color3.new(1, 1, 1) - slotFrame.Name = "Slot" .. tostring(i) - slotFrame.ZIndex = 4.0 - 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.Size = UDim2.new(0, 54, 1, 0) - 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 -end - -local TempSlot = Instance.new "ImageButton" -TempSlot.Name = "TempSlot" -TempSlot.Active = true -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 -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 -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 - -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 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 - -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 - -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" -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.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(-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 - --- 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.BackgroundTransparency = 1 -GearButton.Parent = GearGrid - -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 - --- 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 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 - -------------------------------- WARDROBE ------------------------------------------------------- -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 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 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 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 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 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 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 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 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 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 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 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 otherPantFrame = pantFrame:clone() -otherPantFrame.Position = UDim2.new(0.5, 3, 0.5, 0) -otherPantFrame.RobloxLocked = true -otherPantFrame.Parent = PantsFrame - -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 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 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 - --- no need for this to stick around - -script:Destroy() diff --git a/lua/53878057.lua b/lua/53878057.lua deleted file mode 100644 index 2b3168a..0000000 --- a/lua/53878057.lua +++ /dev/null @@ -1,1257 +0,0 @@ -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) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end - return instance:FindFirstChild(name) -end -local function waitForProperty(instance, property) - while not instance[property] do - instance.Changed:wait() - end -end - -local currentLoadout = script.Parent -local StaticTabName = "gear" -local backpackEnabled = true - -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") - -waitForChild(currentLoadout, "Background") -local clBackground = currentLoadout.Background - -local function IsTouchDevice() - local touchEnabled = false - 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"] - 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"] - tray.Visible = visible -end - ---- Begin Locals -waitForChild(game, "Players") -waitForProperty(game.Players, "LocalPlayer") -local player = game.Players.LocalPlayer - -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 -end) - -waitForChild(game, "LocalBackpack") -game.LocalBackpack:SetOldSchoolBackpack(false) - -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 inGearTab = true - -local maxNumLoadoutItems = 10 -if robloxGui.AbsoluteSize.Y <= 320 then - maxNumLoadoutItems = 4 -end - -local characterChildAddedCon = nil -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 enlargeOverride = true -local guiTweenSpeed = 0.5 - -local firstInstanceOfLoadout = false - -local inventory = {} - -local gearSlots = {} -for i = 1, maxNumLoadoutItems do - gearSlots[i] = "empty" -end - -local backpackWasOpened = false ---- End Locals - --- Begin Functions -local function backpackIsOpen() - if guiBackpack then - return guiBackpack.Visible - end - return false -end - -local function kill(prop, con, gear) - if con then - con:disconnect() - end - if prop == true and gear then - reorganizeLoadout(gear, false) - end -end - -function registerNumberKeys() - for i = 0, 9 do - game:GetService("GuiService"):AddKey(tostring(i)) - end -end - -function unregisterNumberKeys() - pcall(function() - for i = 0, 9 do - game:GetService("GuiService"):RemoveKey(tostring(i)) - end - end) -end - -function characterInWorkspace() - if game.Players["LocalPlayer"] then - if game.Players.LocalPlayer["Character"] then - if game.Players.LocalPlayer.Character ~= nil then - if game.Players.LocalPlayer.Character.Parent ~= nil then - return true - end - end - end - end - - return false -end - -function removeGear(gear) - local emptySlot = nil - for i = 1, #gearSlots do - if gearSlots[i] == gear and gear.Parent ~= nil then - emptySlot = i - break - end - end - if emptySlot then - if gearSlots[emptySlot].GearReference.Value then - if gearSlots[emptySlot].GearReference.Value.Parent == game.Players.LocalPlayer.Character then -- if we currently have this equipped, unequip it - 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 - gearSlots[emptySlot].GearReference.Value:Disable() - gearSlots[emptySlot].GearReference.Value.Active = false - end - end - - gearSlots[emptySlot] = "empty" - - -- 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) - - 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 - - if allEmpty then - if #player.Backpack:GetChildren() < 1 then - backpackButton.Visible = false - else - backpackButton.Position = UDim2.new(0.5, -60, 1, -44) - end - clBackground.Visible = false - end - end) - end -end - -function insertGear(gear, addToSlot) - local pos = nil - if not addToSlot then - for i = 1, #gearSlots do - if gearSlots[i] == "empty" then - pos = i - break - end - end - - 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 - local start = 1 - for i = 1, #gearSlots do - if gearSlots[i] == "empty" then - start = i - break - end - end - for i = start, pos + 1, -1 do - gearSlots[i] = gearSlots[i - 1] - if i == 10 then - gearSlots[i].SlotNumber.Text = "0" - gearSlots[i].SlotNumberDownShadow.Text = "0" - gearSlots[i].SlotNumberUpShadow.Text = "0" - else - gearSlots[i].SlotNumber.Text = i - gearSlots[i].SlotNumberDownShadow.Text = i - gearSlots[i].SlotNumberUpShadow.Text = i - end - end - end - - gearSlots[pos] = gear - if pos ~= maxNumLoadoutItems then - if type(tostring(pos)) == "string" then - local posString = tostring(pos) - gear.SlotNumber.Text = posString - gear.SlotNumberDownShadow.Text = posString - gear.SlotNumberUpShadow.Text = posString - end - else -- tenth gear doesn't follow mathematical pattern :( - gear.SlotNumber.Text = "0" - gear.SlotNumberDownShadow.Text = "0" - gear.SlotNumberUpShadow.Text = "0" - end - gear.Visible = true - - local con = nil - con = gear.Kill.Changed:connect(function(prop) - kill(prop, con, gear) - end) -end - -function reorganizeLoadout(gear, inserting, _, addToSlot) - if inserting then -- add in gear - insertGear(gear, addToSlot) - else - removeGear(gear) - 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 - for i = 1, #gearSlots do - if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then - if parent == nil then - gearSlots[i].Kill.Value = true - return false - elseif child.Parent == player.Character then - 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 - return true - end - - gearSlots[i].Kill.Value = true - return false - end - end - end -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 - stuff[i]:Disable() - end - end - end -end - -function hopperBinSwitcher(numKey, physGear) - if not physGear then - return - end - - physGear:ToggleSelect() - - if gearSlots[numKey] == "empty" then - return - end - - if not physGear.Active then - gearSlots[numKey].Selected = false - normalizeButton(gearSlots[numKey]) - else - gearSlots[numKey].Selected = true - enlargeButton(gearSlots[numKey]) - end -end - -function toolSwitcher(numKey) - if not gearSlots[numKey] then - return - end - local physGear = gearSlots[numKey].GearReference.Value - 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 - - 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 - gearSlots[i].GearReference.Value:ToggleSelect() - end - end - end - - 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 - - enlargeButton(gearSlots[numKey]) - end - end -end - -function activateGear(num) - local numKey = nil - if num == "0" then - numKey = 10 -- why do lua indexes have to start at 1? :( - else - numKey = tonumber(num) - 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 - - for i = 1, #gearSlots do - if gearSlots[i] == "empty" then - break - end - if gearSlots[i] ~= button then - normalizeButton(gearSlots[i]) - end - end - - if not enlargeOverride then - return - end - - if button:FindFirstChild "Highlight" then - button.Highlight.Visible = true - end - - 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 - ) - end -end - -normalizeAllButtons = function() - for i = 1, #gearSlots do - if gearSlots[i] == "empty" then - break - end - if gearSlots[i] ~= button then - 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 - - local moveSpeed = speed - if moveSpeed == nil or type(moveSpeed) ~= "number" then - moveSpeed = guiTweenSpeed / 5 - end - - if button:FindFirstChild "Highlight" then - button.Highlight.Visible = false - end - - if button:IsA "ImageButton" or button:IsA "TextButton" then - button.ZIndex = 1 - 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 - -local waitForDebounce = function() - while debounce do - wait() - end -end - -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 - end - end - return false -end - -function swapGear(gearClone, toFrame) - local toFrameChildren = toFrame:GetChildren() - if #toFrameChildren == 1 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 - - gearSlots[toSlot] = gearClone - gearSlots[gearCloneSlot] = toFrameChildren[1] - - toFrameChildren[1].SlotNumber.Text = gearClone.SlotNumber.Text - toFrameChildren[1].SlotNumberDownShadow.Text = gearClone.SlotNumber.Text - toFrameChildren[1].SlotNumberUpShadow.Text = gearClone.SlotNumber.Text - - 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) - - toFrameChildren[1].Parent = gearClone.Parent - gearClone.Parent = toFrame - end - else - local slotNum = tonumber(gearClone.SlotNumber.Text) - if slotNum == 0 then - slotNum = 10 - end - gearSlots[slotNum] = "empty" -- reset this gear slot - - 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 - gearSlots[toSlotNum] = gearClone - 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) - - 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]) - return true - end - end - end - - if - (x < frame.AbsolutePosition.x or x > (frame.AbsolutePosition.x + frame.AbsoluteSize.x)) - or (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 - return -1 - end -end - -function unequipAllItems(dontEquipThis) - for i = 1, #gearSlots do - 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 - gearSlots[i].GearReference.Value:Disable() - elseif gearSlots[i].GearReference.Value:IsA "Tool" then - gearSlots[i].GearReference.Value.Parent = game.Players.LocalPlayer.Backpack - end - gearSlots[i].Selected = false - end - end -end - -function showToolTip(button, tip) - 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.Visible = true - end -end - -function hideToolTip(button, _) - 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) - 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 - debounce = false - return -- we don't care about anything besides tools (sigh...) - end - end - - if not addToSlot then - for i = 1, #gearSlots do - if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then -- we already have gear, do nothing - debounce = false - return - end - end - end - - local gearClone = currentLoadout.TempSlot:clone() - gearClone.Name = child.Name - gearClone.GearImage.Image = child.TextureId - if gearClone.GearImage.Image == "" then - 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 - 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 - hideToolTip(gearClone, gearClone.GearReference.Value.ToolTip) - end - end) - - gearClone.RobloxLocked = true - - local slotToMod = -1 - - if not addToSlot then - for i = 1, #gearSlots do - if gearSlots[i] == "empty" then - slotToMod = i - break - end - end - else - slotToMod = addToSlot - end - - if slotToMod == -1 then -- No available slot to add in! - debounce = false - return - end - - local slotNum = slotToMod % 10 - 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.ZIndex = 4 - end - - if addToSlot then - reorganizeLoadout(gearClone, true, equipped, addToSlot) - else - reorganizeLoadout(gearClone, true) - end - - 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) - end - end) - end - - local dragBeginPos - local clickCon, buttonDeleteCon, mouseEnterCon, mouseLeaveCon, dragStop, dragBegin - clickCon = gearClone.MouseButton1Click:connect(function() - if characterInWorkspace() then - if not gearClone.Draggable then - activateGear(gearClone.SlotNumber.Text) - end - end - end) - mouseEnterCon = gearClone.MouseEnter:connect(function() - if guiBackpack.Visible then - gearClone.Draggable = true - end - end) - dragBegin = gearClone.DragBegin:connect(function(pos) - 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 - 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 - end - end - end) - dragStop = gearClone.DragStopped:connect(function(x, y) - if gearClone.Selected then - gearClone.ZIndex = 4 - else - gearClone.ZIndex = 3 - end - local children = gearClone:GetChildren() - for i = 1, #children do - 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 - end - end - 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 - 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 - removeFromInventory(child) - elseif parent == game.Players.LocalPlayer.Backpack then - normalizeButton(gearClone) - end - end) - - childChangeCon = child.Changed:connect(function(prop) - if prop == "Name" then - if gearClone and gearClone.GearImage.Image == "" then - gearClone.GearText.Text = child.Name - end - elseif prop == "Active" then - if child and child:IsA "HopperBin" then - if not child.Active then - gearClone.Selected = false - normalizeButton(gearClone) - end - end - elseif prop == "TextureId" then - gearClone.GearImage.Image = child.TextureId - end - end) - - debounce = false - - Spawn(function() - 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 - end - end - end - end) -end - -function addToInventory(child) - 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 - end - if slot then - inventory[slot] = child - elseif #inventory < 1 then - inventory[1] = child - else - inventory[#inventory + 1] = child - end -end - -function removeFromInventory(child) - for i = 1, #inventory do - if inventory[i] == child then - table.remove(inventory, i) - inventory[i] = nil - end - end -end - -local spreadOutGear = function() - loadoutChildren = currentLoadout:GetChildren() - - for i = 1, #loadoutChildren do - 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 - end - end -end - -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]:GetChildren() > 0 then - if loadoutChildren[i].Name == "Slot0" then - lastSlotAdd = loadoutChildren[i] - else - table.insert(gearButtons, loadoutChildren[i]) - end - end - 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 - end -end - -function editLoadout() - backpackWasOpened = true - if inGearTab then - spreadOutGear() - end -end - -function readonlyLoadout() - if not inGearTab then - centerGear() - 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 - if backpackEnabled then - backpackButton.Visible = true - clBackground.Visible = true - end - end - addingPlayerChild(child) - addToInventory(child) - end) -end - -function playerCharacterChildAdded(child) - addingPlayerChild(child, true) - addToInventory(child) -end - -function activateLoadout() - currentLoadout.Visible = true -end - -function deactivateLoadout() - currentLoadout.Visible = false -end - -function tabHandler(inFocus) - inGearTab = inFocus - if inFocus then - editLoadout() - else - readonlyLoadout() - end -end - -function coreGuiChanged(coreGuiType, enabled) - if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then - backpackButton.Visible = enabled - clBackground.Visible = enabled - backpackEnabled = enabled - - if enabled then - registerNumberKeys() - else - unregisterNumberKeys() - end - end - - if coreGuiType == Enum.CoreGuiType.Health or coreGuiType == Enum.CoreGuiType.All then - setHealthBarVisible(game.Players.LocalPlayer.PlayerGui, enabled) - end -end --- End Functions - --- Begin Script -registerNumberKeys() - -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) -end) - -wait() -- let stuff initialize incase this is first heartbeat... - -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() - local backpackChildren = player.Backpack:GetChildren() - local size = math.min(10, #backpackChildren) - for i = 1, size do - if backpackEnabled then - backpackButton.Visible = true - clBackground.Visible = true - end - 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) - --end -end) - -player.ChildAdded:connect(function(child) - if child:IsA "PlayerGui" then - moveHealthBar(child) - end -end) - -waitForProperty(player, "Character") -for _, v in ipairs(player.Character:GetChildren()) do - playerCharacterChildAdded(v) -end -characterChildAddedCon = player.Character.ChildAdded:connect(function(child) - playerCharacterChildAdded(child) -end) - -waitForChild(player.Character, "Humanoid") -humanoidDiedCon = player.Character.Humanoid.Died:connect(function() - if humanoidDiedCon then - humanoidDiedCon:disconnect() - humanoidDiedCon = nil - end - deactivateLoadout() - if backpackChildCon then - backpackChildCon:disconnect() - backpackChildCon = nil - end - backpackWasOpened = false -end) - -player.CharacterRemoving:connect(function() - for i = 1, #gearSlots do - if gearSlots[i] ~= "empty" then - gearSlots[i].Parent = nil - gearSlots[i] = "empty" - end - end -end) - -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") - - delay(1, function() - local backpackChildren = player.Backpack:GetChildren() - local size = math.min(10, #backpackChildren) - for i = 1, size do - if backpackEnabled then - backpackButton.Visible = true - clBackground.Visible = true - end - addingPlayerChild(backpackChildren[i], false) - end - setupBackpackListener() - end) - - activateLoadout() - - if characterChildAddedCon then - characterChildAddedCon:disconnect() - characterChildAddedCon = nil - end - - characterChildAddedCon = player.Character.ChildAdded:connect(function(child) - addingPlayerChild(child, true) - end) - - 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") - moveHealthBar(player.PlayerGui) - 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) -end) - -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 gearSlots[pos] then - reorganizeLoadout(gearSlots[pos], false) - end - if swapSlot.GearButton.Value then - addingPlayerChild(swapSlot.GearButton.Value.GearReference.Value, false, pos) - end - guiBackpack.SwapSlot.Value = false - end -end) - -game:GetService("GuiService").KeyPressed:connect(function(key) - if characterInWorkspace() then - activateGear(key) - end -end) - -backpackOpenEvent.Event:connect(editLoadout) -backpackCloseEvent.Event:connect(centerGear) -tabClickedEvent.Event:connect(function(tabName) - tabHandler(tabName == StaticTabName) -end) diff --git a/lua/59002209.lua b/lua/59002209.lua deleted file mode 100644 index e69de29..0000000 diff --git a/lua/60595411.lua b/lua/60595411.lua deleted file mode 100644 index 6115b7f..0000000 --- a/lua/60595411.lua +++ /dev/null @@ -1,1067 +0,0 @@ -local t = {} - ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------JSON Functions Begin---------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- - ---JSON Encoder and Parser for Lua 5.1 --- ---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. - -local assert = assert - -local StringBuilder = { - buffer = {}, -} - -function StringBuilder:New() - local o = {} - setmetatable(o, self) - self.__index = self - o.buffer = {} - return o -end - -function StringBuilder:Append(s) - self.buffer[#self.buffer + 1] = s -end - -function StringBuilder:ToString() - return table.concat(self.buffer) -end - -local JsonWriter = { - backslashes = { - ["\b"] = "\\b", - ["\t"] = "\\t", - ["\n"] = "\\n", - ["\f"] = "\\f", - ["\r"] = "\\r", - ['"'] = '\\"', - ["\\"] = "\\\\", - ["/"] = "\\/", - }, -} - -function JsonWriter:New() - local o = {} - o.writer = StringBuilder:New() - setmetatable(o, self) - self.__index = self - return o -end - -function JsonWriter:Append(s) - self.writer:Append(s) -end - -function JsonWriter:ToString() - return self.writer:ToString() -end - -function JsonWriter:Write(o) - local t = type(o) - if t == "nil" then - self:WriteNil() - elseif t == "boolean" or t == "number" then - self:WriteString(o) - elseif t == "string" then - self:ParseString(o) - elseif t == "table" then - self:WriteTable(o) - elseif t == "function" then - self:WriteFunction(o) - elseif t == "thread" or t == "userdata" then - self:WriteError(o) - end -end - -function JsonWriter:WriteNil() - self:Append "null" -end - -function JsonWriter:WriteString(o) - self:Append(tostring(o)) -end - -function JsonWriter:ParseString(s) - self:Append '"' - self:Append(string.gsub(s, '[%z%c\\"/]', function(n) - local c = self.backslashes[n] - if c then - return c - end - return string.format("\\u%.4X", string.byte(n)) - end)) - self:Append '"' -end - -function JsonWriter:IsArray(t) - local count = 0 - local isindex = function(k) - if type(k) == "number" and k > 0 then - if math.floor(k) == k then - return true - end - end - return false - end - for k, _ in pairs(t) do - if not isindex(k) then - return false, "{", "}" - else - count = math.max(count, k) - end - end - return true, "[", "]", count -end - -function JsonWriter:WriteTable(t) - local ba, st, et, n = self:IsArray(t) - self:Append(st) - if ba then - for i = 1, n do - self:Write(t[i]) - if i < n then - self:Append "," - end - end - else - local first = true - for k, v in pairs(t) do - if not first then - self:Append "," - end - first = false - self:ParseString(k) - self:Append ":" - self:Write(v) - end - end - self:Append(et) -end - -function JsonWriter:WriteError(o) - error(string.format("Encoding of %s unsupported", tostring(o))) -end - -function JsonWriter:WriteFunction(o) - if o == Null then - self:WriteNil() - else - self:WriteError(o) - end -end - -local StringReader = { - s = "", - i = 0, -} - -function StringReader:New(s) - local o = {} - setmetatable(o, self) - self.__index = self - o.s = s or o.s - return o -end - -function StringReader:Peek() - local i = self.i + 1 - if i <= #self.s then - return string.sub(self.s, i, i) - end - return nil -end - -function StringReader:Next() - self.i = self.i + 1 - if self.i <= #self.s then - return string.sub(self.s, self.i, self.i) - end - return nil -end - -function StringReader:All() - return self.s -end - -local JsonReader = { - escapes = { - ["t"] = "\t", - ["n"] = "\n", - ["f"] = "\f", - ["r"] = "\r", - ["b"] = "\b", - }, -} - -function JsonReader:New(s) - local o = {} - o.reader = StringReader:New(s) - setmetatable(o, self) - self.__index = self - 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 - return self:ReadObject() - 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 - return self:ReadTrue() - elseif peek == "f" then - return self:ReadFalse() - elseif peek == "n" then - return self:ReadNull() - elseif peek == "/" then - self:ReadComment() - return self:Read() - else - return nil - end -end - -function JsonReader:ReadTrue() - self:TestReservedWord { "t", "r", "u", "e" } - return true -end - -function JsonReader:ReadFalse() - self:TestReservedWord { "f", "a", "l", "s", "e" } - return false -end - -function JsonReader:ReadNull() - self:TestReservedWord { "n", "u", "l", "l" } - return nil -end - -function JsonReader:TestReservedWord(t) - for _, v in ipairs(t) do - if self:Next() ~= v then - 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() - end - result = tonumber(result) - if result == nil then - error(string.format("Invalid number: '%s'", result)) - else - return result - end -end - -function JsonReader:ReadString() - local result = "" - assert(self:Next() == '"') - while self:Peek() ~= '"' do - local ch = self:Next() - if ch == "\\" then - ch = self:Next() - if self.escapes[ch] then - ch = self.escapes[ch] - end - end - result = result .. ch - end - assert(self:Next() == '"') - local fromunicode = function(m) - return string.char(tonumber(m, 16)) - end - 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())) - end -end - -function JsonReader:ReadBlockComment() - local done = false - while not done do - 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 - end - self:Next() -end - -function JsonReader:ReadSingleLineComment() - local ch = self:Next() - while ch ~= "\r" and ch ~= "\n" do - ch = self:Next() - end -end - -function JsonReader:ReadArray() - local result = {} - assert(self:Next() == "[") - local done = false - if self:Peek() == "]" then - done = true - end - while not done do - local item = self:Read() - result[#result + 1] = item - self:SkipWhiteSpace() - 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)) - end - end - end - assert("]" == self:Next()) - return result -end - -function JsonReader:ReadObject() - local result = {} - assert(self:Next() == "{") - local done = false - 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)) - end - self:SkipWhiteSpace() - local ch = self:Next() - 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 - done = true - end - if not done then - ch = self:Next() - if ch ~= "," then - error(string.format("Invalid array: '%s' near: '%s'", self:All(), ch)) - end - end - end - assert(self:Next() == "}") - return result -end - -function JsonReader:SkipWhiteSpace() - local p = self:Peek() - while p ~= nil and string.find(p, "[%s/]") do - if p == "/" then - self:ReadComment() - else - self:Next() - end - p = self:Peek() - end -end - -function JsonReader:Peek() - return self.reader:Peek() -end - -function JsonReader:Next() - return self.reader:Next() -end - -function JsonReader:All() - return self.reader:All() -end - -function Encode(o) - local writer = JsonWriter:New() - writer:Write(o) - return writer:ToString() -end - -function Decode(s) - local reader = JsonReader:New(s) - return reader:Read() -end - -function Null() - return Null -end --------------------- End JSON Parser ------------------------ - -t.DecodeJSON = function(jsonString) - pcall(function() - warn "RbxUtility.DecodeJSON is deprecated, please use Game:GetService('HttpService'):JSONDecode() instead." - end) - - if type(jsonString) == "string" then - return Decode(jsonString) - end - print "RbxUtil.DecodeJSON expects string argument!" - return nil -end - -t.EncodeJSON = function(jsonTable) - pcall(function() - warn "RbxUtility.EncodeJSON is deprecated, please use Game:GetService('HttpService'):JSONEncode() instead." - end) - return Encode(jsonTable) -end - ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------Terrain Utilities Begin----------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ---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 w ---returns true if made a wedge, false if the cell remains a block -t.MakeWedge = function(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 - - assert(regionToSelect) - assert(color) - - if not type(regionToSelect) == "Region3" then - 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)) - end - - -- frequently used terrain calls (speeds up call, no lookup necessary) - local GetCell = terrain.GetCell - local WorldToCellPreferSolid = terrain.WorldToCellPreferSolid - local CellCenterToWorld = terrain.CellCenterToWorld - local emptyMaterial = Enum.CellMaterial.Empty - - -- container for all adornments, passed back to user - local selectionContainer = Instance.new "Model" - selectionContainer.Name = "SelectionContainer" - selectionContainer.Archivable = false - if selectionParent then - selectionContainer.Parent = selectionParent - else - selectionContainer.Parent = game.Workspace - end - - local updateSelection = nil -- function we return to allow user to update selection - local currentKeepAliveTag = nil -- a tag that determines whether adorns should be destroyed - local aliveCounter = 0 -- helper for currentKeepAliveTag - local lastRegion = nil -- used to stop updates that do nothing - local adornments = {} -- contains all adornments - local reusableAdorns = {} - - local selectionPart = Instance.new "Part" - selectionPart.Name = "SelectionPart" - selectionPart.Transparency = 1 - selectionPart.Anchored = true - selectionPart.Locked = true - selectionPart.CanCollide = false - selectionPart.Size = Vector3.new(4.2, 4.2, 4.2) - - local selectionBox = Instance.new "SelectionBox" - - -- srs translation from region3 to region3int16 - -- local function Region3ToRegion3int16(region3) - -- 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 highCell = WorldToCellPreferSolid(terrain, theHighVec) - - -- 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) - -- end - - -- helper function that creates the basis for a selection box - function createAdornment(theColor) - local selectionPartClone = nil - local selectionBoxClone = nil - - if #reusableAdorns > 0 then - selectionPartClone = reusableAdorns[1]["part"] - selectionBoxClone = reusableAdorns[1]["box"] - table.remove(reusableAdorns, 1) - - selectionBoxClone.Visible = true - else - selectionPartClone = selectionPart:Clone() - selectionPartClone.Archivable = false - - selectionBoxClone = selectionBox:Clone() - selectionBoxClone.Archivable = false - - selectionBoxClone.Adornee = selectionPartClone - selectionBoxClone.Parent = selectionContainer - - selectionBoxClone.Adornee = selectionPartClone - - selectionBoxClone.Parent = selectionContainer - end - - if theColor then - selectionBoxClone.Color = theColor - end - - return selectionPartClone, selectionBoxClone - end - - -- 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 }) - adornments[cellPos] = nil - end - end - end - - -- helper function to update tag - function incrementAliveCounter() - aliveCounter = aliveCounter + 1 - if aliveCounter > 1000000 then - aliveCounter = 0 - end - return aliveCounter - end - - -- 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 cellPosBegin = WorldToCellPreferSolid(terrain, regionBegin) - local cellPosEnd = WorldToCellPreferSolid(terrain, regionEnd) - - currentKeepAliveTag = incrementAliveCounter() - for y = cellPosBegin.y, cellPosEnd.y do - 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 updated = false - for cellPosAdorn, adornTable in pairs(adornments) do - if cellPosAdorn == cellPos then - adornTable.KeepAlive = currentKeepAliveTag - if color then - adornTable.SelectionBox.Color = color - end - updated = true - break - end - end - - if not updated then - local selectionPart, selectionBox = createAdornment(color) - selectionPart.Size = Vector3.new(4, 4, 4) - selectionPart.CFrame = CFrame.new(cframePos) - local adornTable = { - SelectionPart = selectionPart, - SelectionBox = selectionBox, - KeepAlive = currentKeepAliveTag, - } - adornments[cellPos] = adornTable - end - end - end - end - end - cleanUpAdornments() - end - - ------------------------------------- setup code ------------------------------ - lastRegion = regionToSelect - - if selectEmptyCells then -- use one big selection to represent the area selected - local selectionPart, selectionBox = createAdornment(color) - - selectionPart.Size = regionToSelect.Size - selectionPart.CFrame = regionToSelect.CFrame - - 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 - 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 - end - end - - local destroyFunc = function() - updateSelection = nil - if selectionContainer then - selectionContainer:Destroy() - end - adornments = nil - end - - return updateSelection, destroyFunc -end - ------------------------------Terrain Utilities End----------------------------- - ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------Signal class begin------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ---[[ -A 'Signal' object identical to the internal RBXScriptSignal object in it's public API and semantics. This function -can be used to create "custom events" for user-made code. -API: -Method :connect( function handler ) - Arguments: The function to connect to. - Returns: A new connection object which can be used to disconnect the connection - Description: Connects this signal to the function specified by |handler|. That is, when |fire( ... )| is called for - the signal the |handler| will be called with the arguments given to |fire( ... )|. Note, the functions - connected to a signal are called in NO PARTICULAR ORDER, so connecting one function after another does - NOT mean that the first will be called before the second as a result of a call to |fire|. - -Method :disconnect() - Arguments: None - Returns: None - Description: Disconnects all of the functions connected to this signal. - -Method :fire( ... ) - Arguments: Any arguments are accepted - Returns: None - Description: Calls all of the currently connected functions with the given arguments. - -Method :wait() - Arguments: None - Returns: The arguments given to fire - Description: This call blocks until -]] - -function t.CreateSignal() - local this = {} - - 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) - end - local cn = mBindableEvent.Event:connect(func) - mAllCns[cn] = true - local pubCn = {} - function pubCn:disconnect() - cn:disconnect() - mAllCns[cn] = nil - end - pubCn.Disconnect = pubCn.disconnect - - return pubCn - end - - function this:disconnect() - 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 - return mBindableEvent.Event:wait() - end - - function this:fire(...) - if self ~= this then - error("fire must be called with `:`, not `.`", 2) - end - mBindableEvent:Fire(...) - end - - this.Connect = this.connect - this.Disconnect = this.disconnect - this.Wait = this.wait - this.Fire = this.fire - - return this -end - -------------------------------------------------- Sigal class End ------------------------------------------------------ - ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------Create Function Begins--------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ---[[ -A "Create" function for easy creation of Roblox instances. The function accepts a string which is the classname of -the object to be created. The function then returns another function which either accepts accepts no arguments, in -which case it simply creates an object of the given type, or a table argument that may contain several types of data, -in which case it mutates the object in varying ways depending on the nature of the aggregate data. These are the -type of data and what operation each will perform: -1) A string key mapping to some value: - Key-Value pairs in this form will be treated as properties of the object, and will be assigned in NO PARTICULAR - ORDER. If the order in which properties is assigned matter, then they must be assigned somewhere else than the - |Create| call's body. - -2) An integral key mapping to another Instance: - Normal numeric keys mapping to Instances will be treated as children if the object being created, and will be - parented to it. This allows nice recursive calls to Create to create a whole hierarchy of objects without a - need for temporary variables to store references to those objects. - -3) A key which is a value returned from Create.Event( eventname ), and a value which is a function function - The Create.E( string ) function provides a limited way to connect to signals inside of a Create hierarchy - for those who really want such a functionality. The name of the event whose name is passed to - Create.E( string ) - -4) A key which is the Create function itself, and a value which is a function - The function will be run with the argument of the object itself after all other initialization of the object is - done by create. This provides a way to do arbitrary things involving the object from withing the create - hierarchy. - Note: This function is called SYNCHRONOUSLY, that means that you should only so initialization in - it, not stuff which requires waiting, as the Create call will block until it returns. While waiting in the - constructor callback function is possible, it is probably not a good design choice. - Note: Since the constructor function is called after all other initialization, a Create block cannot have two - constructor functions, as it would not be possible to call both of them last, also, this would be unnecessary. - - -Some example usages: - -A simple example which uses the Create function to create a model object and assign two of it's properties. -local model = Create'Model'{ - Name = 'A New model', - Parent = game.Workspace, -} - - -An example where a larger hierarchy of object is made. After the call the hierarchy will look like this: -Model_Container - |-ObjectValue - | | - | `-BoolValueChild - `-IntValue - -local model = Create'Model'{ - Name = 'Model_Container', - Create'ObjectValue'{ - Create'BoolValue'{ - Name = 'BoolValueChild', - }, - }, - Create'IntValue'{}, -} - - -An example using the event syntax: - -local part = Create'Part'{ - [Create.E'Touched'] = function(part) - print("I was touched by "..part.Name) - end, -} - - -An example using the general constructor syntax: - -local model = Create'Part'{ - [Create] = function(this) - print("Constructor running!") - this.Name = GetGlobalFoosAndBars(this) - end, -} - - -Note: It is also perfectly legal to save a reference to the function returned by a call Create, this will not cause - any unexpected behavior. EG: - local partCreatingFunction = Create'Part' - local part = partCreatingFunction() -]] - ---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 - error("Argument of Create must be a string", 2) - end - --return the proxy function that gives us the nice Create'string'{data} syntax - --The first function call is a function call using Lua's single-string-argument syntax - --The second function call is using Lua's single-table-argument syntax - --Both can be chained together for the nice effect. - return function(dat) - --default to nothing, to handle the no argument given case - dat = dat or {} - - --make the object to mutate - local obj = Instance.new(objectType) - local parent = nil - - --stored constructor function to be called after other initialization - local ctor = nil - - for k, v in pairs(dat) do - --add property - if type(k) == "string" then - if k == "Parent" then - -- Parent should always be set last, setting the Parent of a new object - -- immediately makes performance worse for all subsequent property updates. - parent = v - else - obj[k] = v - end - - --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) - 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 - ) - 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 - ) - 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) - end - end - - --apply constructor function if it exists - if ctor then - ctor(obj) - end - - if parent then - obj.Parent = parent - end - - --return the completed object - return obj - end -end - ---now, create the functor: -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 } -end - --------------------------------------------------Create function End---------------------------------------------------- - ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------Documentation Begin----------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------- - -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/lua/60595695.lua b/lua/60595695.lua deleted file mode 100644 index a151712..0000000 --- a/lua/60595695.lua +++ /dev/null @@ -1,26 +0,0 @@ --- Library Registration Script --- This script is used to register RbxLua libraries on game servers, so game scripts have --- access to all of the libraries (otherwise only local scripts do) - -local deepakTestingPlace = 3569749 -local sc = game:GetService "ScriptContext" -local tries = 0 - -while not sc and tries < 3 do - tries = tries + 1 - sc = game:GetService "ScriptContext" - wait(0.2) -end - -if sc then - sc:RegisterLibrary("Libraries/RbxGui", "45284430") - sc:RegisterLibrary("Libraries/RbxGear", "45374389") - if game.PlaceId == deepakTestingPlace then - sc:RegisterLibrary("Libraries/RbxStatus", "52177566") - end - sc:RegisterLibrary("Libraries/RbxUtility", "60595411") - sc:RegisterLibrary("Libraries/RbxStamper", "73157242") - sc:LibraryRegistrationComplete() -else - print "failed to find script context, libraries did not load" -end diff --git a/lua/73157242.lua b/lua/73157242.lua deleted file mode 100644 index 6dd5e2a..0000000 --- a/lua/73157242.lua +++ /dev/null @@ -1,2544 +0,0 @@ -local t = {} - --- function waitForChild(instance, name) --- while not instance:FindFirstChild(name) do --- instance.ChildAdded:wait() --- end --- 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 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 - local t = normal:Dot(p3 - startPos) / startEndDot - if t >= 0 and t <= 1 then - local intersection = ((endPos - startPos) * t) + startPos - cellPos = game.Workspace.Terrain:WorldToCell(intersection) - hit = true - end - end - - return cellPos, hit -end - --- Purpose: --- Checks for terrain touched by the mouse hit. --- Will do a plane intersection if no terrain is touched. --- --- mouse - Mouse to check the .hit for. --- --- Return: --- cellPos - Cell position hit. Nil if none. -function GetTerrainForMouse(mouse) - -- There was no target, so all it could be is a plane intersection. - -- Check for a plane intersection. If there isn't one then nothing will get hit. - local cell = game.Workspace.Terrain:WorldToCellPreferSolid(Vector3.new(mouse.hit.x, mouse.hit.y, mouse.hit.z)) - local planeLoc = nil - -- If nothing was hit, do the plane intersection. - if 0 == game.Workspace.Terrain:GetCell(cell.X, cell.Y, cell.Z).Value then - cell = nil - planeLoc, hit = PlaneIntersection(Vector3.new(mouse.hit.x, mouse.hit.y, mouse.hit.z)) - if hit then - cell = planeLoc - end - end - return cell -end - --- setup helper functions -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 - 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 -end - -local function modelRotate(model, yAngle) - local rotCF = CFrame.Angles(0, yAngle, 0) - local offsetFromOrigin = model:GetModelCFrame().p - - 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 - end - - for _, 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 startCell = cluster:WorldToCell(startVector) - local endCell = cluster:WorldToCell(endVector) - - local startX = startCell.X - local startY = startCell.Y - local startZ = startCell.Z - - local endX = endCell.X - 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 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 - end - end - end - - return false -end - -local function findSeatsInModel(parent, seatTable) - if not parent then - return - end - - if parent.className == "Seat" or parent.className == "VehicleSeat" then - table.insert(seatTable, parent) - end - local myChildren = parent:GetChildren() - for j = 1, #myChildren do - findSeatsInModel(myChildren[j], seatTable) - end -end - -local function setSeatEnabledStatus(model, isEnabled) - local seatList = {} - findSeatsInModel(model, seatList) - - 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 - 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" - fakeWeld.Name = "SeatWeld" - fakeWeld.Parent = seatList[i] - end - end -end - -local function autoAlignToFace(parts) - 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 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 - - if math.abs(xDot) > math.abs(yDot) and math.abs(xDot) > math.abs(zDot) then - if xDot > 0 then - return 0 - else - return 3 - end - elseif math.abs(yDot) > math.abs(xDot) and math.abs(yDot) > math.abs(zDot) then - if yDot > 0 then - return 1 - else - return 4 - end - else - if zDot > 0 then - return 2 - else - return 5 - 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 - insertCFrame = currentParts:GetModelCFrame() - currentParts:TranslateBy(aCFrame.p - insertCFrame.p) - else - currentParts.CFrame = aCFrame - end - return currentParts -end - -local function calcRayHitTime(rayStart, raySlope, intersectionPlane) - 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 - -local function modelTargetSurface(partOrModel, rayStart, rayEnd) - if not partOrModel then - return 0 - end - - local modelCFrame = nil - local modelSize = nil - if partOrModel:IsA "Model" then - modelCFrame = partOrModel:GetModelCFrame() - modelSize = partOrModel:GetModelSize() - else - modelCFrame = partOrModel.CFrame - modelSize = partOrModel.Size - end - - local mouseRayStart = modelCFrame:pointToObjectSpace(rayStart) - local mouseRayEnd = modelCFrame:pointToObjectSpace(rayEnd) - local mouseSlope = mouseRayEnd - mouseRayStart - - 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 - - -- 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 hitFace = 0 - - --if xHitTime >= 0 and yHitTime >= 0 and zHitTime >= 0 then - if xHitTime > yHitTime then - if xHitTime > zHitTime then - -- xFace is hit - hitFace = 1 * xPositive - else - -- zFace is hit - hitFace = 3 * zPositive - end - else - if yHitTime > zHitTime then - -- yFace is hit - hitFace = 2 * yPositive - else - -- zFace is hit - hitFace = 3 * zPositive - end - end - - return hitFace -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 - minVec = Vector3.new(-2, -2, -2) - maxVec = Vector3.new(2, 2, 2) - elseif partOrModel:IsA "BasePart" then - minVec = -0.5 * partOrModel.Size - maxVec = -minVec - else - 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" - if justifyValue ~= nil then - -- find the multiple of 4 that contains the model - local justify = justifyValue.Value - local two = Vector3.new(2, 2, 2) - local actualBox = maxVec - minVec - Vector3.new(0.01, 0.01, 0.01) - local containingGridBox = - Vector3.new(4 * math.ceil(actualBox.x / 4), 4 * math.ceil(actualBox.y / 4), 4 * math.ceil(actualBox.z / 4)) - local adjustment = containingGridBox - actualBox - minVec = minVec - 0.5 * adjustment * justify - maxVec = maxVec + 0.5 * adjustment * (two - justify) - end - - return minVec, maxVec -end - -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 - local vec1 = partOrModel.CFrame:pointToWorldSpace(-0.5 * partOrModel.Size) - local 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 not 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) - -- else - local vec1 = partOrModel:GetModelCFrame():pointToWorldSpace(-0.5 * partOrModel:GetModelSize()) - local vec2 = partOrModel:GetModelCFrame():pointToWorldSpace(0.5 * partOrModel:GetModelSize()) - 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)) - end - - return minVec, maxVec -end - -local function getTargetPartBoundingBox(targetPart) - if targetPart.Parent:FindFirstChild "RobloxModel" ~= nil then - return getBoundingBox2(targetPart.Parent) - else - return getBoundingBox2(targetPart) - end -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 - 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 - return isBlocker(part.Parent) -end - --- helper function to determine if a character can be pushed upwards by a certain amount --- 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(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 - end - - 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 - -- And, it assumes the insert CF axes are orthongonal with the insert bounding box faces - -- 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 - - local grid = 4.0 - local admissibleConfig = false - 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 - insertCFrame = stampData.CurrentParts:GetModelCFrame() - else - insertCFrame = stampData.CurrentParts.CFrame - end - - if Mouse then - if stampData.CurrentParts:IsA "Tool" then - Mouse.TargetFilter = stampData.CurrentParts.Handle - else - Mouse.TargetFilter = stampData.CurrentParts - end - end - - local hitPlane = false - local targetPart = nil - local success = pcall(function() - targetPart = Mouse.Target - end) - - 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) - if nil == cellPos then - hitPlane = false - return admissibleConfig, targetConfig - else - targetPart = game.Workspace.Terrain - hitPlane = true - -- Take into account error that will occur. - cellPos = Vector3.new(cellPos.X - 1, cellPos.Y, cellPos.Z) - mouseHitInWorld = game.Workspace.Terrain:CellCenterToWorld(cellPos.x, cellPos.y, cellPos.z) - end - end - - -- test mouse hit location - local minBBTarget, maxBBTarget = getTargetPartBoundingBox(targetPart) - local diagBBTarget = maxBBTarget - minBBTarget - local targetCFrame = getMouseTargetCFrame(targetPart) - - 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) - 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 - --[[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)} - if hitFace > 0 then - targetVectorInWorld = targetCFrame:vectorToWorldSpace(WORLD_AXES[hitFace]) - elseif hitFace < 0 then - targetVectorInWorld = targetCFrame:vectorToWorldSpace(-WORLD_AXES[-hitFace]) - end - end]] - end - - local targetRefPointInTarget, insertRefPointInInsert - local clampToSurface - - 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) - 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) - 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) - 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) - 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) - else - targetRefPointInTarget = targetCFrame:vectorToObjectSpace(Vector3.new(1, -1, -1)) - insertRefPointInInsert = insertCFrame:vectorToObjectSpace(Vector3.new(1, -1, 1)) - 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) - ) - deltaClamped = deltaClamped * clampToSurface - local targetTouchInTarget = deltaClamped + targetRefPointInTarget - - local TargetTouchRelToWorld = targetCFrame:pointToWorldSpace(targetTouchInTarget) - local InsertTouchInWorld = insertCFrame:vectorToWorldSpace(insertRefPointInInsert) - local posInsertOriginInWorld = TargetTouchRelToWorld - InsertTouchInWorld - - local _, _, _, 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 - ) - admissibleConfig = true - - return admissibleConfig, targetConfig, getClosestAlignedWorldDirection(targetVectorInWorld) -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 frac = little / hypotenuse - - local bigSign = 1 - local littleSign = 1 - if bigValue < 0 then - bigSign = -1 - end - if littleValue < 0 then - littleSign = -1 - end - - if frac > 0.382683432 then - -- between 22.5 and 45 degrees, so truncate to 45-degree tilt - 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 - table.insert(manualWeldTable, object) - table.insert(manualWeldParentTable, object.Parent) - else - local children = object:GetChildren() - for i = 1, #children do - saveTheWelds(children[i], manualWeldTable, manualWeldParentTable) - end - end -end - -local function restoreTheWelds(manualWeldTable, manualWeldParentTable) - for i = 1, #manualWeldTable do - manualWeldTable[i].Parent = manualWeldParentTable[i] - end -end - -t.CanEditRegion = function(partOrModel, EditRegion) -- todo: use model and stamper metadata - 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 - 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 - end - - return true, false -end - -t.GetStampModel = function(assetId, terrainShape, useAssetVersionId) - if assetId == 0 then - return nil, "No Asset" - end - if assetId < 0 then - return nil, "Negative Asset" - end - - local function UnlockInstances(object) - if object:IsA "BasePart" then - object.Locked = false - end - for _, child in pairs(object:GetChildren()) do - UnlockInstances(child) - end - end - - local function getClosestColorToTerrainMaterial(terrainValue) - if terrainValue == 1 then - return BrickColor.new "Bright green" - elseif terrainValue == 2 then - return BrickColor.new "Bright yellow" - elseif terrainValue == 3 then - return BrickColor.new "Bright red" - elseif terrainValue == 4 then - return BrickColor.new "Sand red" - elseif terrainValue == 5 then - return BrickColor.new "Black" - elseif terrainValue == 6 then - return BrickColor.new "Dark stone grey" - elseif terrainValue == 7 then - return BrickColor.new "Sand blue" - elseif terrainValue == 8 then - return BrickColor.new "Deep orange" - elseif terrainValue == 9 then - return BrickColor.new "Dark orange" - elseif terrainValue == 10 then - return BrickColor.new "Reddish brown" - elseif terrainValue == 11 then - return BrickColor.new "Light orange" - elseif terrainValue == 12 then - return BrickColor.new "Light stone grey" - elseif terrainValue == 13 then - return BrickColor.new "Sand green" - elseif terrainValue == 14 then - return BrickColor.new "Medium stone grey" - elseif terrainValue == 15 then - return BrickColor.new "Really red" - elseif terrainValue == 16 then - return BrickColor.new "Really blue" - elseif terrainValue == 17 then - return BrickColor.new "Bright blue" - else - 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 - newTerrainPiece.Name = "MegaClusterCube" - newTerrainPiece.Size = Vector3.new(4, 4, 4) - newTerrainPiece.BottomSurface = "Smooth" - newTerrainPiece.TopSurface = "Smooth" - - -- can add decals or textures here if feeling particularly adventurous... for now, can make a table of look-up colors - newTerrainPiece.BrickColor = getClosestColorToTerrainMaterial(cellMat) - - 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 == 3 then - 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" - 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 - local loading = true - if useAssetVersionId then - loader = coroutine.create(function() - root = game:GetService("InsertService"):LoadAssetVersion(assetId) - loading = false - end) - coroutine.resume(loader) - else - loader = coroutine.create(function() - root = game:GetService("InsertService"):LoadAsset(assetId) - loading = false - end) - coroutine.resume(loader) - end - - local lastGameTime = 0 - local totalTime = 0 - local maxWait = 8 - while loading and totalTime < maxWait do - lastGameTime = tick() - wait(1) - totalTime = totalTime + tick() - lastGameTime - end - loading = false - - if totalTime >= maxWait then - return nil, "Load Time Fail" - end - - if root == nil then - return nil, "Load Asset Fail" - end - - if not root:IsA "Model" then - return nil, "Load Type Fail" - end - - local instances = root:GetChildren() - if #instances == 0 then - return nil, "Empty Model Fail" - end - - --Unlock all parts that are inserted, to make sure they are editable - UnlockInstances(root) - - --Continue the insert process - root = root:GetChildren()[1] - - --Examine the contents and decide what it looks like - for _, 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 _, 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" - stringTag.Name = "RobloxModel" - stringTag.Parent = 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" - autowedgeTag.Name = "AutoWedge" - autowedgeTag.Parent = root - else - local clusterTag = root:FindFirstChild "ClusterMaterial" - if clusterTag then - if clusterTag:IsA "Vector3Value" then - root = setupFakeTerrainPart(clusterTag.Value.X, terrainShape, clusterTag.Value.Z) - else - root = setupFakeTerrainPart(clusterTag.Value, terrainShape, 0) - end - else - root = setupFakeTerrainPart(1, terrainShape, 0) - end - end - end - end - - 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 - 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 - end - if not Mouse then - 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 - 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'" - return nil - end - if not AllowedStampRegion then - 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" - errorBox.Transparency = 0 - errorBox.Archivable = false - - -- for megacluster MEGA STAMPING - 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" - adorn.Adornee = adornPart - adorn.Visible = true - adorn.Transparency = 0 - adorn.Name = "HighScalabilityStamperLine" - adorn.Archivable = false - - local HighScalabilityLine = {} - HighScalabilityLine.Start = nil - HighScalabilityLine.End = nil - HighScalabilityLine.Adorn = adorn - HighScalabilityLine.AdornPart = adornPart - HighScalabilityLine.InternalLine = nil - HighScalabilityLine.NewHint = true - - 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" - 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") - ) - end - - local function DoHighScalabilityRegionSelect() - 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 - -- will use this internal representation of the line for the actual stamping - line = (HighScalabilityLine.End - HighScalabilityLine.Start) - - if math.abs(line.X) < math.abs(line.Y) then - 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 - newY, newZ = truncateToCircleEighth(line.Y, line.Z) - else - newZ, newY = truncateToCircleEighth(line.Z, line.Y) - end - line = Vector3.new(0, newY, newZ) - else - -- limit to X/Y plane, with Y dominating - local newY, newX = truncateToCircleEighth(line.Y, line.X) - line = Vector3.new(newX, newY, 0) - end - else - if math.abs(line.Y) < math.abs(line.Z) then - -- limit to X/Z plane, domination unknown - local newX, newZ - if math.abs(line.X) > math.abs(line.Z) then - newX, newZ = truncateToCircleEighth(line.X, line.Z) - else - newZ, newX = truncateToCircleEighth(line.Z, line.X) - end - line = Vector3.new(newX, 0, newZ) - 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) - - 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) - - if math.abs(yComp) > math.abs(xComp) then - line2 = line2 - xAxis * xComp - else - line2 = line2 - yAxis * yComp - end - - HighScalabilityLine.InternalLine = line2 - elseif HighScalabilityLine.Dimensions == 3 then - line = HighScalabilityLine.MoreLines[1] - line2 = HighScalabilityLine.MoreLines[2] - line3 = HighScalabilityLine.End - HighScalabilityLine.MorePoints[2] - - -- zero out all components of previous lines - line3 = line3 - line.unit * line.unit:Dot(line3) - line3 = line3 - line2.unit * line2.unit:Dot(line3) - - HighScalabilityLine.InternalLine = line3 - end - - -- 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 - 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) - 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) - 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 - (HighScalabilityLine.Dimensions == 1 and line.magnitude > 3) - or HighScalabilityLine.Dimensions > 1 - then -- don't show if mouse hasn't moved enough - HighScalabilityLine.Adorn.Parent = gui - end - end - end - - if gui == nil then -- we are in studio - gui = game:GetService "CoreGui" - if (HighScalabilityLine.Dimensions == 1 and line.magnitude > 3) or HighScalabilityLine.Dimensions > 1 then -- don't show if mouse hasn't moved enough - HighScalabilityLine.Adorn.Parent = gui - end - end - end - - local function DoStamperMouseMove(Mouse) - if not Mouse then - 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") - return - end - - -- There wasn't a target (no part or terrain), so check for plane intersection. - if not Mouse.Target then - local cellPos = GetTerrainForMouse(Mouse) - if nil == cellPos then - return - end - end - - if not stampData then - return - end - - -- don't move with dragger - will move in one step on mouse down - -- draw ghost at acceptable positions - configFound, targetCFrame, targetSurface = findConfigAtMouseTarget(Mouse, stampData) - if not configFound then - error "RbxStamper.DoStamperMouseMove No configFound, returning" - return - 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) - end - end - - local ry = math.pi / 2 - gInitial90DegreeRotations = gInitial90DegreeRotations + numRotations - if stampData.CurrentParts:IsA "Model" or stampData.CurrentParts:IsA "Tool" then - --stampData.CurrentParts:Rotate(0, ry*numRotations, 0) - modelRotate(stampData.CurrentParts, ry * numRotations) - else - stampData.CurrentParts.CFrame = CFrame.fromEulerAnglesXYZ(0, ry * numRotations, 0) - * stampData.CurrentParts.CFrame - end - - -- CODE TO CHECK FOR DRAGGING GHOST PART INTO A COLLIDING STATE - local minBB, maxBB = getBoundingBoxInWorldCoordinates(stampData.CurrentParts) - - -- need to offset by distance to be dragged - local currModelCFrame = nil - if stampData.CurrentParts:IsA "Model" then - currModelCFrame = stampData.CurrentParts:GetModelCFrame() - 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 - local theClusterMaterial = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) - if theClusterMaterial:IsA "Vector3Value" then - local stampClusterMaterial = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) - if stampClusterMaterial then - stampClusterMaterial = clusterMat - end - end - end - end - return - end - - -- 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 _, _, _, 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 - ) - end - - positionPartsAtCFrame3(targetCFrame, stampData.CurrentParts) - 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 - 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" - - --if (modelInfo and modelInfo.Parent:FindFirstChild("UnstampableFaces")) or (modelInfo and myModelInfo) then -- need better targetSurface calcs - 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 - local hitFace = 0 - - 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 - if hitFace == tonumber(bf) then - -- return before we hit the JointsService code below! - unstampableSurface = true - game.JointsService:ClearJoinAfterMoveJoints() -- clear the JointsService cache - return - end - 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 - ) - - -- are we stamping WITH an unstampable surface? - for bf in string.gmatch(myBreakingFaces, "[^,]+") do - if hitFace == tonumber(bf) then - unstampableSurface = true - game.JointsService:ClearJoinAfterMoveJoints() -- clear the JointsService cache - return - end - end - - -- just need to match breakingFace against targetSurface using rotation supplied by modelCFrame - -- targetSurface: 1 is top, 4 is bottom, - end - end - - -- to show joints during the mouse move - unstampableSurface = false - 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 - return - else - return - end - end) - then - 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 - game.JointsService:SetJoinAfterMoveTarget(Mouse.Target) - else - game.JointsService:SetJoinAfterMoveTarget(nil) - end - game.JointsService:ShowPermissibleJoints() - - -- here we allow for a line of high-scalability parts - if isMegaClusterPart() and HighScalabilityLine and HighScalabilityLine.Start then - 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 - - key = string.lower(key) - 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) - 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 - --stampData.CurrentParts:Rotate(0, ry, 0) - modelRotate(stampData.CurrentParts, ry) - else - stampData.CurrentParts.CFrame = CFrame.fromEulerAnglesXYZ(0, ry, 0) * stampData.CurrentParts.CFrame - end - - -- After rotating, update the position - 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 - HighScalabilityLine.MorePoints[HighScalabilityLine.Dimensions] = HighScalabilityLine.End - HighScalabilityLine.MoreLines[HighScalabilityLine.Dimensions] = HighScalabilityLine.InternalLine - HighScalabilityLine.Dimensions = HighScalabilityLine.Dimensions + 1 - HighScalabilityLine.NewHint = true - 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 - HighScalabilityLine.End = nil - HighScalabilityLine.InternalLine = nil - HighScalabilityLine.NewHint = true - end - end - - local function flashRedBox() - local gui = game.CoreGui - if game:FindFirstChild "Players" then - if game.Players["LocalPlayer"] then - if game.Players.LocalPlayer:FindFirstChild "PlayerGui" then - gui = game.Players.LocalPlayer.PlayerGui - end - end - end - if not stampData["ErrorBox"] then - return - end - - stampData.ErrorBox.Parent = gui - if stampData.CurrentParts:IsA "Tool" then - stampData.ErrorBox.Adornee = stampData.CurrentParts.Handle - else - stampData.ErrorBox.Adornee = stampData.CurrentParts - end - - delay(0, function() - for _ = 1, 3 do - if stampData["ErrorBox"] then - stampData.ErrorBox.Visible = true - end - wait(0.13) - if stampData["ErrorBox"] then - stampData.ErrorBox.Visible = false - end - wait(0.13) - end - if stampData["ErrorBox"] then - stampData.ErrorBox.Adornee = nil - stampData.ErrorBox.Parent = Tool - end - end) - end - - local function DoStamperMouseDown(Mouse) - if not Mouse then - 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") - return - end - if not stampData then - return - end - - if isMegaClusterPart() then - if Mouse and HighScalabilityLine then - local megaCube = stampData.CurrentParts:FindFirstChild("MegaClusterCube", true) - local terrain = game.Workspace.Terrain - if megaCube then - HighScalabilityLine.Dimensions = 1 - local tempCell = terrain:WorldToCell(megaCube.CFrame.p) - HighScalabilityLine.Start = terrain:CellCenterToWorld(tempCell.X, tempCell.Y, tempCell.Z) - return - else - HighScalabilityLine.Dimensions = 1 - local tempCell = terrain:WorldToCell(stampData.CurrentParts.CFrame.p) - HighScalabilityLine.Start = terrain:CellCenterToWorld(tempCell.X, tempCell.Y, tempCell.Z) - return - end - end - end - end - - local function loadSurfaceTypes(part, surfaces) - part.TopSurface = surfaces[1] - part.BottomSurface = surfaces[2] - part.LeftSurface = surfaces[3] - part.RightSurface = surfaces[4] - part.FrontSurface = surfaces[5] - part.BackSurface = surfaces[6] - end - - local function saveSurfaceTypes(part, myTable) - local tempTable = {} - tempTable[1] = part.TopSurface - tempTable[2] = part.BottomSurface - tempTable[3] = part.LeftSurface - tempTable[4] = part.RightSurface - tempTable[5] = part.FrontSurface - tempTable[6] = part.BackSurface - - myTable[part] = tempTable - end - - -- local function makeSurfaceUnjoinable(part, surface) - -- -- TODO: FILL OUT! - -- end - - local function prepareModel(model) - if not model then - return nil - end - - local gDesiredTrans = 0.7 - local gStaticTrans = 1 - - local clone = model:Clone() - local scripts = {} - local parts = {} - local decals = {} - - stampData = {} - stampData.DisabledScripts = {} - stampData.TransparencyTable = {} - stampData.MaterialTable = {} - stampData.CanCollideTable = {} - stampData.AnchoredTable = {} - stampData.ArchivableTable = {} - stampData.DecalTransparencyTable = {} - stampData.SurfaceTypeTable = {} - - collectParts(clone, parts, scripts, decals) - - if #parts <= 0 then - return nil, "no parts found in modelToStamp" - end - - for _, script in pairs(scripts) do - if not script.Disabled then - script.Disabled = true - stampData.DisabledScripts[#stampData.DisabledScripts + 1] = script - end - end - for _, part in pairs(parts) do - stampData.TransparencyTable[part] = part.Transparency - part.Transparency = gStaticTrans + (1 - gStaticTrans) * part.Transparency - stampData.MaterialTable[part] = part.Material - part.Material = Enum.Material.Plastic - stampData.CanCollideTable[part] = part.CanCollide - part.CanCollide = false - stampData.AnchoredTable[part] = part.Anchored - part.Anchored = true - stampData.ArchivableTable[part] = part.Archivable - part.Archivable = false - - saveSurfaceTypes(part, stampData.SurfaceTypeTable) - - local fadeInDelayTime = 0.5 - local transFadeInTime = 0.5 - 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)) - 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 stampData["TransparencyTable"] and stampData.TransparencyTable[part] then - part.Transparency = gDesiredTrans + (1 - gDesiredTrans) * stampData.TransparencyTable[part] - end - end - end) - end - - for _, decal in pairs(decals) do - stampData.DecalTransparencyTable[decal] = decal.Transparency - decal.Transparency = gDesiredTrans + (1 - gDesiredTrans) * decal.Transparency - end - - -- disable all seats - setSeatEnabledStatus(clone, true) - setSeatEnabledStatus(clone, false) - - stampData.CurrentParts = clone - - -- if auto-alignable, we enforce a pre-rotation to the canonical "0-frame" - if autoAlignToFace(clone) then - 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 - --stampData.CurrentParts:Rotate(0, ry, 0) - modelRotate(stampData.CurrentParts, ry) - else - stampData.CurrentParts.CFrame = CFrame.fromEulerAnglesXYZ(0, ry, 0) * stampData.CurrentParts.CFrame - end - end - - -- since we're cloning the old model instead of the new one, we will need to update the orientation based on the original value AND how many more - -- rotations we expect since then [either that or we need to store the just-stamped clusterMaterial.Value.Z somewhere]. This should fix the terrain rotation - -- 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 - ) - end - - -- After rotating, update the position - local configFound, targetCFrame = findConfigAtMouseTarget(Mouse, stampData) - 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 skipThisCell = false - - for b = 1, #cellBlockingParts do - 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 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! - 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) - or (cellPos.X - 2 < allowedStampRegion.CFrame.p.X - allowedStampRegion.Size.X / 2) - or (cellPos.Y + 2 > allowedStampRegion.CFrame.p.Y + allowedStampRegion.Size.Y / 2) - or (cellPos.Y - 2 < allowedStampRegion.CFrame.p.Y - allowedStampRegion.Size.Y / 2) - or (cellPos.Z + 2 > allowedStampRegion.CFrame.p.Z + allowedStampRegion.Size.Z / 2) - or (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 cluster = game.Workspace.Terrain - - local line = HighScalabilityLine.InternalLine - local cMax = game.Workspace.Terrain.MaxExtents.Max - local cMin = game.Workspace.Terrain.MaxExtents.Min - - local clusterMaterial = 1 -- default is grass - local clusterType = 0 -- default is brick - local clusterOrientation = 0 -- default is 0 rotation - - local autoWedgeClusterParts = false - 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 - clusterType = clusterMaterial.Value.Y - clusterOrientation = clusterMaterial.Value.Z - clusterMaterial = clusterMaterial.Value.X - 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 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 + 0.5), - math.floor(lines[i].Y + 0.5), - math.floor(lines[i].Z + 0.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 < 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 - local outerStepVectIndex = 1 - while outerStepVectIndex < 4 do - stepVect[2] = Vector3.new(0, 0, 0) - 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 - 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 - -- check if overlaps player or part - 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] - ) - else - cluster:SetCell( - cellPos.X, - cellPos.Y, - cellPos.Z, - clusterMaterial, - clusterType, - clusterOrientation - ) - end - 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) - ) - ) - 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 - innerStepVectIndex = innerStepVectIndex + 1 - end - 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 - end - 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]) - 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 - end - end - end - - -- 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) - end - - return cellSet - end - - local function DoStamperMouseUp(Mouse) - if not Mouse then - 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") - return false - end - - if not stampData.Dragger then - 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 - else - canStamp, checkHighScalabilityStamp = t.CanEditRegion(stampData.CurrentParts, allowedStampRegion) - end - - if not canStamp then - if stampFailedFunc then - stampFailedFunc() - end - return false - end - end - - -- if unstampable face, then don't let us stamp there! - if unstampableSurface then - 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 - if stampFailedFunc then - stampFailedFunc() - end - return false - 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 - -- 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 - flashRedBox() - return false - end - - 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() - return false - end - 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 - --------------------------------------------------------------------------- - 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 - --------------------------------------------------------------------------- - 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.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 - stampTracker.Value = true - end - end - end - end - - -- if we drew a line of mega parts, stamp them out - if HighScalabilityLine.Start and HighScalabilityLine.Adorn.Parent and isMegaClusterPart() then - if ResolveMegaClusterStamp(checkHighScalabilityStamp) or checkHighScalabilityStamp then - -- kill the ghost part - stampData.CurrentParts.Parent = nil - return true - end - end - - -- 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 - if isMegaClusterPart() then - -- if targetCFrame is inside cluster, just set that cell to 1 and return - --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 - - local cMax = game.Workspace.Terrain.MaxExtents.Max - local cMin = game.Workspace.Terrain.MaxExtents.Min - - 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 waterForceTag then - 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 - ) - 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 - - -- 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) - ) - ) - end - - -- 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) - return true - end - 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.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 - -- Tyler's magical hack-code for allowing/preserving clones of both Surface and Manual Welds... just don't ask X< - local manualWeldTable = {} - local manualWeldParentTable = {} - saveTheWelds(stampData.CurrentParts, manualWeldTable, manualWeldParentTable) - stampData.CurrentParts:BreakJoints() - 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" - if playerIdTag ~= nil then - tempPlayerValue = getPlayer() - if tempPlayerValue ~= nil then - playerIdTag.Value = tempPlayerValue.userId - end - end - if playerNameTag ~= nil then - if game:FindFirstChild "Players" and game.Players["LocalPlayer"] then - tempPlayerValue = game.Players.LocalPlayer - 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" - stringTag.Name = "RobloxModel" - stringTag.Parent = 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" - 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 - - -- Restore the original properties for all parts being stamped - for part, transparency in pairs(stampData.TransparencyTable) do - part.Transparency = transparency - end - for part, archivable in pairs(stampData.ArchivableTable) do - part.Archivable = archivable - end - for part, material in pairs(stampData.MaterialTable) do - part.Material = material - end - for part, collide in pairs(stampData.CanCollideTable) do - part.CanCollide = collide - end - for part, anchored in pairs(stampData.AnchoredTable) do - part.Anchored = anchored - end - for decal, transparency in pairs(stampData.DecalTransparencyTable) do - decal.Transparency = transparency - end - - for part, surfaces in pairs(stampData.SurfaceTypeTable) do - loadSurfaceTypes(part, surfaces) - end - - if isMegaClusterPart() then - stampData.CurrentParts.Transparency = 0 - end - - -- re-enable all seats - setSeatEnabledStatus(stampData.CurrentParts, true) - - stampData.TransparencyTable = nil - stampData.ArchivableTable = nil - stampData.MaterialTable = nil - stampData.CanCollideTable = nil - stampData.AnchoredTable = nil - stampData.SurfaceTypeTable = nil - - -- ...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" - 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 - - --Re-enable the scripts - for _, 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 _, 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) - 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 isPositive = 1 - if whichSurface < 0 then - isPositive = isPositive * -1 - whichSurface = whichSurface * -1 - end - local surfaceNormal = isPositive * modelCFrame:vectorToWorldSpace(AXIS_VECTORS[whichSurface]) - - for i = 1, #parts do - local currPart = parts[i] - - -- now just need to find which surface of currPart most closely match surfaceNormal and then set that to Unjoinable - 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 - else - 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 - else - if surfaceNormalInLocalCoords.Z > 0 then - currPart.BackSurface = "Unjoinable" - else - currPart.FrontSurface = "Unjoinable" - end - end - end - end - end - - local function resumeStamper() - clone, parts = prepareModel(modelToStamp) - - if not clone or not parts then - return - end - - -- if we have unjoinable faces, then we want to change those surfaces to be Unjoinable - local unjoinableTag = clone:FindFirstChild("UnjoinableFaces", true) - if unjoinableTag then - for unjoinableSurface in string.gmatch(unjoinableTag.Value, "[^,]*") do - if tonumber(unjoinableSurface) then - if clone:IsA "Model" then - prepareUnjoinableSurfaces(clone:GetModelCFrame(), parts, tonumber(unjoinableSurface)) - else - prepareUnjoinableSurfaces(clone.CFrame, parts, tonumber(unjoinableSurface)) - end - end - end - end - - stampData.ErrorBox = errorBox - if stampInModel then - clone.Parent = stampInModel - 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 - cellInfo.Material = clusterMaterial.Value.X - cellInfo.clusterType = clusterMaterial.Value.Y - cellInfo.clusterOrientation = clusterMaterial.Value.Z - 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 - game.JointsService:SetJoinAfterMoveTarget(mouseTarget) - else - game.JointsService:SetJoinAfterMoveTarget(nil) - end - game.JointsService:ShowPermissibleJoints() - - for _, object in pairs(stampData.DisabledScripts) do - if object.Name == "GhostRemovalScript" then - object.Parent = stampData.CurrentParts - end - end - - 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:MouseUp() - - DoStamperMouseMove(Mouse) - - 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 - stamped.Value = DoStamperMouseUp(Mouse) - resetHighScalabilityLine() - 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!" - 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!" - 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" - 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" - 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 stampData then - if stampData["Dragger"] then - stampData.Dragger:Destroy() - end - if stampData.CurrentParts then - stampData.CurrentParts:Destroy() - end - end - if control and control["Stamped"] then - control.Stamped:Destroy() - end - control = nil - end - - 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 -end - -return t diff --git a/lua/89449008.lua b/lua/89449008.lua deleted file mode 100644 index fc35871..0000000 --- a/lua/89449008.lua +++ /dev/null @@ -1,952 +0,0 @@ --- A couple of necessary functions -local function waitForChild(instance, name) - assert(instance) - assert(name) - while not instance:FindFirstChild(name) do - print("Waiting for ...", instance, name) - instance.ChildAdded:wait() - end - return instance:FindFirstChild(name) -end -local function waitForProperty(instance, property) - assert(instance) - assert(property) - while not instance[property] do - instance.Changed:wait() - end -end - -local function IsTouchDevice() - local touchEnabled = 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 RbxGui, _ = LoadLibrary "RbxGui" -if not RbxGui then - print "could not find RbxGui!" - return -end - ---- Begin Locals -local StaticTabName = "gear" - -local backpack = script.Parent - -local backpackItems = {} -local buttons = {} - -local debounce = false -local browsingMenu = false - -local mouseEnterCons = {} -local mouseClickCons = {} - -local characterChildAddedCon = nil -local characterChildRemovedCon = nil -local backpackAddCon = nil - -local playerBackpack = waitForChild(player, "Backpack") - -waitForChild(backpack, "Tabs") - -waitForChild(backpack, "Gear") -local gearPreview = waitForChild(backpack.Gear, "GearPreview") - -local scroller = waitForChild(backpack.Gear, "GearGridScrollingArea") - -local currentLoadout = waitForChild(backpack.Parent, "CurrentLoadout") - -local grid = waitForChild(backpack.Gear, "GearGrid") -local gearButton = waitForChild(grid, "GearButton") - -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") - --- 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.Parent = backpack.Gear.GearGrid - -local scrollBar = Instance.new "Frame" -scrollBar.Name = "ScrollBar" -scrollBar.BackgroundTransparency = 0.9 -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.Parent = scroller - -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.Parent = backpack.Gear.GearLoadouts.LoadoutsList - -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.Style = Enum.ButtonStyle.RobloxButton -LoadoutButton.Text = "Loadout #1" -LoadoutButton.TextColor3 = Color3.new(1, 1, 1) -LoadoutButton.Parent = scrollFrameLoadout - -local LoadoutButtonTwo = LoadoutButton:clone() -LoadoutButtonTwo.Text = "Loadout #2" -LoadoutButtonTwo.Parent = scrollFrameLoadout - -local LoadoutButtonThree = LoadoutButton:clone() -LoadoutButtonThree.Text = "Loadout #3" -LoadoutButtonThree.Parent = scrollFrameLoadout - -local LoadoutButtonFour = LoadoutButton:clone() -LoadoutButtonFour.Text = "Loadout #4" -LoadoutButtonFour.Parent = scrollFrameLoadout - -local scrollBarLoadout = Instance.new "Frame" -scrollBarLoadout.Name = "ScrollBarLoadout" -scrollBarLoadout.BackgroundTransparency = 0.9 -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.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea - -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) - for i = 1, #map do - if map[i] == object then - table.remove(map, i) - break - end - end -end - -function robloxLock(instance) - instance.RobloxLocked = true - children = instance:GetChildren() - if children then - for _, child in ipairs(children) do - robloxLock(child) - end - end -end - -function resize() - local size = 0 - if gearPreview.AbsoluteSize.Y > gearPreview.AbsoluteSize.X then - size = gearPreview.AbsoluteSize.X * 0.75 - else - 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) - - resizeGrid() -end - -function addToGrid(child) - if not child:IsA "Tool" then - if not child:IsA "HopperBin" then - return - end - end - if child:FindFirstChild "RobloxBuildTool" then - return - end - - for _, 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 - if buttons[child].Image == "" then - buttons[child].GearText.Text = child.Name - end - end - end - end) - local ancestryCon = nil - ancestryCon = child.AncestryChanged:connect(function(_, _) - local thisObject = nil - for _, 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 _, 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 - buttons[v].Parent = nil - buttons[v] = nil - break - end - end - - removeFromMap(backpackItems, thisObject) - - resizeGrid() - else - resizeGrid() - end - updateGridActive() - end) - resizeGrid() -end - -function buttonClick(button) - if button:FindFirstChild "UnequipContextMenu" and not button.Active then - button.UnequipContextMenu.Visible = true - browsingMenu = true - end -end - -function previewGear(button) - if not browsingMenu then - gearPreview.Visible = false - gearPreview.GearImage.Image = button.Image - gearPreview.GearStats.GearName.Text = button.GearReference.Value.Name - end -end - -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 not smallestNum or (smallestNum > frameNum) then - smallestNum = frameNum - end - end - end - if smallestNum == 10 then - smallestNum = 0 - end - return smallestNum -end - -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) - return true - end - end - end - end - return false -end - -function resizeGrid() - for _, 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 - buttonClone.Image = v.TextureId - if buttonClone.Image == "" then - buttonClone.GearText.Text = v.Name - end - - buttonClone.GearReference.Value = v - buttonClone.Draggable = true - buttons[v] = buttonClone - - if not IsTouchDevice() then - local unequipMenu = getGearContextMenu() - - unequipMenu.Visible = false - unequipMenu.Parent = buttonClone - end - - local beginPos = nil - buttonClone.DragBegin:connect(function(value) - 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 - 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 - ) - buttonClone.Draggable = false - delay(0.5, function() - buttonClone.Draggable = true - end) - else - buttonClone.Position = beginPos - end - end - end) - local clickTime = tick() - 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) - end - else - buttonClick(buttonClone) - end - clickTime = newClickTime - end) - end - end - end - recalculateScroll() -end - -function showPartialGrid(subset) - for _, v in pairs(buttons) do - v.Parent = nil - end - if subset then - for _, v in pairs(subset) do - v.Parent = grid.ScrollingFrame - end - end - recalculateScroll() -end - -function showEntireGrid() - for _, v in pairs(buttons) do - v.Parent = grid.ScrollingFrame - end - recalculateScroll() -end - -function inLoadout(gear) - local children = currentLoadout:GetChildren() - for i = 1, #children do - 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 - return true - end - end - end - end - return false -end - -function updateGridActive() - 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) or inLoadout(gear) then - buttons[v].Active = false - else - buttons[v].Active = true - end - end - end -end - -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 - 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 - ) - end -end - -function tabClickHandler(tabName) - if tabName == StaticTabName then - backpackOpenHandler(tabName) - else - backpackCloseHandler(tabName) - end -end - -function backpackOpenHandler(currentTab) - if currentTab and currentTab ~= StaticTabName then - backpack.Gear.Visible = false - return - end - - backpack.Gear.Visible = true - updateGridActive() - - resizeGrid() - resize() - tellBackpackReadyFunc:Invoke() -end - -function backpackCloseHandler(currentTab) - if currentTab and currentTab ~= StaticTabName then - backpack.Gear.Visible = false - return - end - - backpack.Gear.Visible = false - - resizeGrid() - resize() - tellBackpackReadyFunc:Invoke() -end - -function loadoutCheck(child, selectState) - if not child:IsA "ImageButton" then - return - end - for _, v in pairs(backpackItems) do - if buttons[v] 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 - end - end - end - end -end - -function clearPreview() - gearPreview.GearImage.Image = "" - gearPreview.GearStats.GearName.Text = "" -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 --- stuff[i].Parent = playerBackpack --- end --- end --- end - --- function equipGear(physGear) --- removeAllEquippedGear(physGear) --- physGear.Parent = player.Character --- updateGridActive() --- end - -function unequipGear(physGear) - physGear.Parent = playerBackpack - updateGridActive() -end - -function highlight(button) - 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) -end - -function swapGearSlot(slot, gearButton) - if not swapSlot.Value then -- signal loadout to swap a gear out - swapSlot.Slot.Value = slot - swapSlot.GearButton.Value = gearButton - swapSlot.Value = true - updateGridActive() - end -end - -local UnequipGearMenuClick = function(element, menu) - if type(element.Action) ~= "number" then - return - end - local num = element.Action - if num == 1 then -- remove from loadout - unequipGear(menu.Parent.GearReference.Value) - local inventoryButton = menu.Parent - local gearToUnequip = inventoryButton.GearReference.Value - local loadoutChildren = currentLoadout:GetChildren() - local slot = -1 - for i = 1, #loadoutChildren do - 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 - break - end - end - end - 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) - - -- 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(_) - 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 -end - -function trim(s) - return (s:gsub("^%s*(.-)%s*$", "%1")) -end - -function filterGear(terms) - local filteredGear = {} - for _, 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]) - break - end - end - end - end - - return filteredGear -end -function splitByWhitespace(text) - 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 - end - return terms -end -function showSearchGear(searchTerms) - if not backpack.Gear.Visible then - return - end -- currently not active tab - - local searchTermTable = splitByWhitespace(searchTerms) - local currSearchTerms - if searchTermTable and (#searchTermTable > 0) then - currSearchTerms = searchTermTable - else - currSearchTerms = nil - end - - if searchTermTable == nil then - showEntireGrid() - return - end - - local filteredButtons = filterGear(currSearchTerms) - showPartialGrid(filteredButtons) -end - -function nukeBackpack() - while #buttons > 0 do - table.remove(buttons) - end - buttons = {} - while #backpackItems > 0 do - table.remove(backpackItems) - end - backpackItems = {} - local scrollingFrameChildren = grid.ScrollingFrame:GetChildren() - for i = 1, #scrollingFrameChildren do - scrollingFrameChildren[i]:remove() - end -end - -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.BackgroundTransparency = 1 - gearContextMenu.Visible = false - - local gearContextMenuButton = Instance.new "TextButton" - gearContextMenuButton.Name = "UnequipContextMenuButton" - gearContextMenuButton.Text = "" - gearContextMenuButton.Style = Enum.ButtonStyle.RobloxButtonDefault - gearContextMenuButton.ZIndex = 8 - gearContextMenuButton.Size = UDim2.new(1, 0, 1, -20) - gearContextMenuButton.Visible = true - gearContextMenuButton.Parent = gearContextMenu - - local elementHeight = 12 - - local contextMenuElements = {} - local contextMenuElementsName = { "Remove Hotkey" } - - for i = 1, #contextMenuElementsName do - local element = {} - element.Type = "Button" - element.Text = contextMenuElementsName[i] - element.Action = i - element.DoIt = UnequipGearMenuClick - 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" - button.Name = "UnequipContextButton" .. i - 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.ZIndex = 9 - button.Parent = gearContextMenuButton - - if not IsTouchDevice() then - button.MouseButton1Click:connect(function() - if button.Active and not gearContextMenu.Parent.Active then - 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) - end - end) - button.MouseLeave:connect(function() - if button.Active and gearContextMenu.Parent.Active then - clearHighlight(button) - end - end) - end - - contextElement.Button = button - contextElement.Element = button - elseif element.Type == "Label" then - 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" - label.Name = "Text1" - label.BackgroundTransparency = 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) - label.Size = UDim2.new(0.5, 0, 1, 0) - 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.Name = "Text2" - label.BackgroundTransparency = 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.ZIndex = 9 - label.Parent = frame - element.Label2 = label - end - frame.Parent = gearContextMenuButton - element.Label = frame - element.Element = frame - end - end - - gearContextMenu.ZIndex = 4 - gearContextMenu.MouseLeave:connect(function() - browsingMenu = false - gearContextMenu.Visible = false - clearPreview() - end) - robloxLock(gearContextMenu) - - return gearContextMenu -end - -function coreGuiChanged(coreGuiType, enabled) - if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then - if not enabled then - backpack.Gear.Visible = false - end - end -end - -local backpackChildren = player.Backpack:GetChildren() -for i = 1, #backpackChildren do - addToGrid(backpackChildren[i]) -end - -------------------------- Start Lifelong Connections ----------------------- - -resizeEvent.Event:connect(function(_) - if debounce then - return - end - - debounce = true - wait() - resize() - resizeGrid() - debounce = false -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 - centerGear(currentLoadout:GetChildren()) - end -end) -currentLoadout.DescendantRemoving:connect(function(descendant) - 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) - -player.CharacterRemoving:connect(function() - removeCharacterConnections() - nukeBackpack() -end) -player.CharacterAdded:connect(function() - setupCharacterConnections() -end) - -player.ChildAdded:connect(function(child) - 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) - end -end) - -swapSlot.Changed:connect(function() - if not swapSlot.Value then - updateGridActive() - end -end) - -local loadoutChildren = currentLoadout:GetChildren() -for i = 1, #loadoutChildren do - if loadoutChildren[i]:IsA "Frame" and string.find(loadoutChildren[i].Name, "Slot") then - loadoutChildren[i].ChildRemoved:connect(function() - updateGridActive() - end) - loadoutChildren[i].ChildAdded:connect(function() - updateGridActive() - end) - end -end -------------------------- End Lifelong Connections ----------------------- - -pcall(function() - coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)) - Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) -end) - -resize() -resizeGrid() - --- make sure any items in the loadout are accounted for in inventory -local loadoutChildren = currentLoadout:GetChildren() -for i = 1, #loadoutChildren do - loadoutCheck(loadoutChildren[i], false) -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) -end - -backpackOpenEvent.Event:connect(backpackOpenHandler) -backpackCloseEvent.Event:connect(backpackCloseHandler) -tabClickedEvent.Event:connect(tabClickHandler) -searchRequestedEvent.Event:connect(showSearchGear) - -recalculateScrollLoadout() diff --git a/lua/89449093.lua b/lua/89449093.lua deleted file mode 100644 index e241e7f..0000000 --- a/lua/89449093.lua +++ /dev/null @@ -1,476 +0,0 @@ --- 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 - --- basic functions -local function waitForChild(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end - return instance:FindFirstChild(name) -end -local function waitForProperty(instance, property) - while not instance[property] do - instance.Changed:wait() - end -end - --- don't do anything if we are in an empty game -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") - ------------------------- Locals ------------------------------ -local backpack = script.Parent -waitForChild(backpack, "Gear") - -local screen = script.Parent.Parent -assert(screen:IsA "ScreenGui") - -waitForChild(backpack, "Tabs") -waitForChild(backpack.Tabs, "CloseButton") -local closeButton = backpack.Tabs.CloseButton - -waitForChild(backpack.Tabs, "InventoryButton") -local inventoryButton = backpack.Tabs.InventoryButton - -local wardrobeButton -if game.CoreGui.Version >= 8 then - waitForChild(backpack.Tabs, "WardrobeButton") - wardrobeButton = backpack.Tabs.WardrobeButton -end -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 robloxGui = waitForChild(Game.CoreGui, "RobloxGui") -local currentLoadout = waitForChild(robloxGui, "CurrentLoadout") -local loadoutBackground = waitForChild(currentLoadout, "Background") - -local canToggle = true -local readyForNextEvent = true -local backpackIsOpen = false -local active = true -local disabledByDeveloper = false - -local humanoidDiedCon = nil - -local guiTweenSpeed = 0.25 -- how quickly we open/close the backpack - -local searchDefaultText = "Search..." -local tilde = "~" -local backquote = "`" - -local backpackSize = UDim2.new(0, 600, 0, 400) - -if robloxGui.AbsoluteSize.Y <= 320 then - backpackSize = UDim2.new(0, 200, 0, 140) -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" - newEvent.Name = tostring(eventName) - newEvent.Parent = script - - return newEvent -end - -function createPublicFunction(funcName, invokeFunc) - assert(funcName, "funcName is nil") - 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" - newFunction.Name = tostring(funcName) - newFunction.OnInvoke = invokeFunc - newFunction.Parent = script - - return newFunction -end - --- 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() - backpack.Visible = false - active = false -end - -function initHumanoidDiedConnections() - if humanoidDiedCon then - humanoidDiedCon:disconnect() - end - waitForProperty(game.Players.LocalPlayer, "Character") - waitForChild(game.Players.LocalPlayer.Character, "Humanoid") - humanoidDiedCon = game.Players.LocalPlayer.Character.Humanoid.Died:connect(deactivateBackpack) -end - -function activateBackpack() - initHumanoidDiedConnections() - active = true - backpack.Visible = backpackIsOpen - if backpackIsOpen then - toggleBackpack() - end -end - -local hideBackpack = function() - backpackIsOpen = false - readyForNextEvent = false - backpackButton.Selected = false - resetSearch() - 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, - function() - game.GuiService:RemoveCenterDialog(backpack) - backpack.Visible = false - backpackButton.Selected = false - end - ) - delay(guiTweenSpeed, function() - game.GuiService:RemoveCenterDialog(backpack) - backpack.Visible = false - backpackButton.Selected = false - 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 - 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() - backpack.Tabs.Visible = false - searchFrame.Visible = true - backpackOpenEvent:Fire(currentTab) - canToggle = true - readyForNextEvent = true - 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 - readyForNextEvent = false - canToggle = false - - backpackIsOpen = not backpackIsOpen - - 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 - backpackButton.Position = UDim2.new(0.5, -60, 1, -44) - loadoutBackground.Visible = false - backpackButton.Selected = false - backpackButton.Image = "http://www.roblox.com/asset/?id=97617958" - 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) - 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 - backpackButton.Position = UDim2.new(0.5, -60, 1, -108) - backpackButton.Visible = true - loadoutBackground.Visible = true - if frame:GetChildren()[1]:IsA "ImageButton" then - local imgButton = frame:GetChildren()[1] - imgButton.Active = true - imgButton.Draggable = false - end - end - end - end - end -end - -function closeBackpack() - if backpackIsOpen then - toggleBackpack() - end -end - -function setSelected(tab) - assert(tab) - 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) - tab.Selected = false - tab.ZIndex = 1 -end - -function updateTabGui(selectedTab) - assert(selectedTab) - - if selectedTab == "gear" then - setSelected(inventoryButton) - setUnselected(wardrobeButton) - elseif selectedTab == "wardrobe" then - setSelected(wardrobeButton) - setUnselected(inventoryButton) - end -end - -function mouseLeaveTab(button) - assert(button) - 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) -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")) -end - --- function splitByWhitespace(text) --- 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 --- end --- return terms --- end - -function resetSearchBoxGui() - resetButton.Visible = false - searchBox.Text = searchDefaultText -end - -function doSearch() - local searchText = searchBox.Text - if searchText == "" then - resetSearch() - return - end - searchText = trim(searchText) - resetButton.Visible = true - -- termTable = splitByWhitespace(searchText) - searchRequestedEvent:Fire(searchText) -- todo: replace this with termtable when table passing is possible -end - -function resetSearch() - resetSearchBoxGui() - searchRequestedEvent:Fire() -end - -local backpackReady = function() - readyForNextEvent = true -end - -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() - game:GetService("GuiService"):RemoveKey(tilde) - game:GetService("GuiService"):RemoveKey(backquote) - end) - else - game:GetService("GuiService"):AddKey(tilde) - game:GetService("GuiService"):AddKey(backquote) - end - - resetSearch() - searchFrame.Visible = enabled and backpackIsOpen - - currentLoadout.Visible = enabled - backpack.Visible = enabled - backpackButton.Visible = enabled - end -end - ---------------------------- End Internal Functions ------------------------------------- - ------------------------------- Public Functions Setup ------------------------------------- -createPublicFunction("CloseBackpack", hideBackpack) -createPublicFunction("BackpackReady", backpackReady) ------------------------------- End Public Functions Setup --------------------------------- - ------------------------- Connections/Script Main ------------------------------------------- - -pcall(function() - coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)) - 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) - -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) -end - -closeButton.MouseButton1Click:connect(closeBackpack) - -screen.Changed:connect(function(prop) - if prop == "AbsoluteSize" then - resizeEvent:Fire(screen.AbsoluteSize) - end -end) - --- GuiService key setup -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 key == tilde or key == backquote then - toggleBackpack() - end -end) -backpackButton.MouseButton1Click:connect(function() - if not active or disabledByDeveloper then - return - end - toggleBackpack() -end) - -if game.Players.LocalPlayer["Character"] then - activateBackpack() -end - -game.Players.LocalPlayer.CharacterAdded:connect(activateBackpack) - --- search functions -searchBox.FocusLost:connect(function(enterPressed) - if enterPressed or searchBox.Text ~= "" then - doSearch() - elseif searchBox.Text == "" then - resetSearch() - end -end) -searchButton.MouseButton1Click:connect(doSearch) -resetButton.MouseButton1Click:connect(resetSearch) - -if searchFrame and robloxGui.AbsoluteSize.Y <= 320 then - searchFrame.RobloxLocked = false - searchFrame:Destroy() -end diff --git a/lua/97188756.lua b/lua/97188756.lua deleted file mode 100644 index aee1491..0000000 --- a/lua/97188756.lua +++ /dev/null @@ -1,1789 +0,0 @@ ---[[ - //FileName: ChatScript.LUA - //Written by: Sorcus - //Description: Code for lua side chat on Mercury. Supports Scrolling. - //NOTE: If you find any bugs or inaccuracies PM Sorcus on Roblox or @Canavus on Twitter -]] - -local forceChatGUI = false - --- Utility functions + Globals -local function WaitForChild(parent, childName) - while parent:FindFirstChild(childName) == nil do - parent.ChildAdded:wait(0.03) - end - return parent[childName] -end - -local function typedef(obj) - 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 -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 -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 - return (str:gsub("^%s*(.-)%s*$", "%1")) -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 - --- Services -local CoreGuiService = Game:GetService "CoreGui" -local PlayersService = Game:GetService "Players" -local GuiService = Game:GetService "GuiService" - --- Lua Enums -local Enums, CreateEnum -do - Enums = {} - local EnumName = {} -- used as unique key for enum name - local enum_mt = { - __call = function(self, value) - return self[value] or self[tonumber(value)] - end, - __index = { - GetEnumItems = function(self) - local t = {} - 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) - return t - end, - }, - __tostring = function(self) - return "Enum." .. self[EnumName] - end, - } - local item_mt = { - __call = function(self, value) - return value == self or value == self.Name or value == self.Value - end, - __tostring = function(self) - return "Enum." .. self[EnumName] .. "." .. self.Name - end, - } - CreateEnum = function(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) - e[i] = item - e[name] = item - e[item] = item - end - Enums[enumName] = e - return setmetatable(e, enum_mt) - end - end -end ---------------------------------------------------- ------------------- Input class -------------------- -local Input = { - Mouse = Player:GetMouse(), - Speed = 0, - Simulating = false, - - Configuration = { - DefaultSpeed = 1, - }, - UserIsScrolling = false, -} - ---------------------------------------------------- ------------------- Chat class -------------------- -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", - }, - - Gui = nil, - Frame = nil, - RenderFrame = nil, - TapToChatLabel = nil, - ClickToChatButton = 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 = {}, - - -- 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, - - Messages_List = {}, - MessageThread = nil, - - --[[ 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', 'Mercury', 'RBAdam', 'Doughtless', - 'Anaminus', 'Stravant', 'Cr3470r', 'CodeWriter', 'Games', 'AcesWayUpHigh', 'Phil' - }, --]] - 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 May Day!"] = true, - ["Happy Towel Day!"] = true, - ["Happy Mercury 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, - }, - - ["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, -} ---------------------------------------------------- - -local function GetNameValue(pName) - local value = 0 - 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 - 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 - --- 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 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 - end) - end - end) - - self.RenderFrame.MouseLeave:connect(function() - Camera.CameraType = "Custom" - self.MouseOnFrame = false - end) - 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 -function Chat:IsTouchDevice() - 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 - --- 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 - Spawn(function() - wait(0.05) - while label.TextTransparency >= 0 do - label.TextTransparency = label.TextTransparency - 0.2 - wait(0.03) - end - if label == field["Message"] then - label.TextStrokeTransparency = 0.8 - 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 - -- 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 -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 - --- 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, - Text = nString, - Name = "SpaceButton", - } - else - self.TempSpaceLabel.Text = nString - end - - while self.TempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do - nString = nString .. " " - self.TempSpaceLabel.Text = nString - end - nString = nString .. " " - self.CachedSpaceStrings_List[pLabel.Text] = nString - self.TempSpaceLabel.Text = "" - return nString -end - --- 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 - table.insert(Chat.Messages_List, messageField) - end -end - -function Chat:RecalculateSpacing() - --[[for i = 1, #self.MessageQueue do - local pLabel = self.MessageQueue[i]['Player'] - local mLabel = self.MessageQueue[i]['Message'] - - local prevYScale = mLabel.Size.Y.Scale - local prevText = mLabel.Text - mLabel.Text = prevText - - local heightField = mLabel.TextBounds.Y - - mLabel.Size = UDim2.new(1, 0, heightField/self.RenderFrame.AbsoluteSize.Y, 0) - pLabel.Size = mLabel.Size - - local diff = mLabel.Size.Y.Scale - prevYScale - - Chat:UpdateQueue(self.MessageQueue[i], diff) - 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 - --- 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) - 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 - --[[pLabel = self.MessageQueue[#self.MessageQueue]['Player'] - mLabel = self.MessageQueue[#self.MessageQueue]['Message'] - - pLabel.Text = pName .. ':' - pLabel.Name = pName - - local pColor - if cPlayer.Neutral then - pLabel.TextColor3 = Chat:ComputeChatColor(pName) - else - pLabel.TextColor3 = cPlayer.TeamColor.Color - end - - local nString - - if not self.CachedSpaceStrings_List[pName] then - nString = Chat:ComputeSpaceString(pLabel) - else - nString = self.CachedSpaceStrings_List[pName] - end - - mLabel.Text = "" - mLabel.Name = pName .. " - message" - mLabel.Text = nString .. message; - - mLabel.Parent = nil - mLabel.Parent = self.RenderFrame - - 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 - 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; - } - if cPlayer.Neutral then - pLabel.TextColor3 = Chat:ComputeChatColor(pName) - else - pLabel.TextColor3 = cPlayer.TeamColor.Color - end - - local nString - - 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, - 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 - - for _, adminName in pairs(self.Admins_List) do - if string.lower(adminName) == string.lower(pName) then - mLabel.TextColor3 = self.Configuration.AdminMessageColor - end - end - - pLabel.Visible = true - mLabel.Visible = true - - -- 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 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) - Chat:UpdateQueue(queueField) -end - -function Chat:ScreenSizeChanged() - wait() - while self.Frame.AbsoluteSize.Y > 120 do - self.Frame.Size = self.Frame.Size - UDim2.new(0, 0, 0.005, 0) - end - Chat:RecalculateSpacing() -end - -function Chat:FindButtonTree(scButton, rootList) - local list = {} - rootList = rootList or self.SafeChatTree - for button, _ in pairs(rootList) do - if button == scButton then - list = rootList[button] - elseif type(rootList[button]) == "table" then - list = Chat:FindButtonTree(scButton, rootList[button]) - 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 - return true - end - return false -end - -function Chat:CreateSafeChatOptions(list, rootButton) - local text_List = {} - 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) - ), - } - - count = count + 1 - - if type(list[msg]) == "table" then - text_List[rootButton][chatText] = Chat:CreateSafeChatOptions(list[msg], chatText) - -- else - -- --table.insert(text_List[chatText], true) - end - chatText.MouseEnter:connect(function() - Chat:ToggleSafeChatMenu(chatText) - end) - - chatText.MouseLeave:connect(function() - Chat:ToggleSafeChatMenu(chatText) - end) - - 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) - 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, - - 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 - self.SafeChatTree[self.SafeChatButton] = Chat:CreateSafeChatOptions(self.SafeChat_List, self.SafeChatButton) - - self.SafeChatButton.MouseButton1Click:connect(function() - Chat:ToggleSafeChatMenu(self.SafeChatButton) - end) -end - -function Chat:FocusOnChatBar() - if self.ClickToChatButton then - self.ClickToChatButton.Visible = false - end - - self.GotFocus = true - 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, - Parent = self.Gui, - - 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, - 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 - end) -end - --- 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, - 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, - 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, - } - - -- 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 - GuiService:SetGlobalSizeOffsetPixel(0, -20) - end - -- CHatHotKey is '/' - GuiService:AddSpecialKey(Enum.SpecialKey.ChatHotkey) - GuiService.SpecialKeyPressed:connect(function(key) - if key == Enum.SpecialKey.ChatHotkey then - Chat:FocusOnChatBar() - end - end) - - self.ClickToChatButton.MouseButton1Click:connect(function() - Chat:FocusOnChatBar() - end) - end -end - --- 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, - --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, - 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, - 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, - --ClipsDescendants = true; - ZIndex = 0, - Active = false, - }, - } - - Spawn(function() - wait(0.5) - 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 - - if forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu then - if Chat:IsTouchDevice() then - Chat:CreateTouchButton() - else - Chat:CreateChatBar() - --Chat:CreateSafeChatGui() - end - - 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 - - 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 - Spawn(function() - wait(5.0) - 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 - wait(0.25) - end - elseif Input.Speed < 0 then - while Input.Speed < 0 do - Input.Speed = Input.Speed + 1 - wait(0.25) - end - end - wait(0.03) - end - 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 - Input:OnMouseScroll() - end -end - -function Input:Initialize() - self.Mouse.WheelBackward:connect(function() - Input:ApplySpeed(self.Configuration.DefaultSpeed) - end) - - self.Mouse.WheelForward:connect(function() - Input:ApplySpeed(self.Configuration.DefaultSpeed) - end) -end - -function Chat:FindMessageInSafeChat(message, list) - local foundMessage = false - for msg, _ in pairs(list) do - if msg == message then - return true - end - if type(list[msg]) == "table" then - foundMessage = Chat:FindMessageInSafeChat(message, list[msg]) - 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("#", ...) - local player - local message - -- This doesn't look very good, but what else to do? - if args[2] then - player = args[2] - end - if args[3] then - message = args[3] - if string.sub(message, 1, 1) == "%" then - message = "(TEAM) " .. string.sub(message, 2, #message) - end - end - - if PlayersService.ClassicChat then - if - not (string.sub(message, 1, 3) == "/e " or string.sub(message, 1, 7) == "/emote ") - and (forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu) - or (Player.ChatMode == Enum.ChatMode.Menu and string.sub(message, 1, 3) == "/sc") - or (Chat:FindMessageInSafeChat(message, self.SafeChat_List)) - then - Chat:UpdateChat(player, message) - end - end -end - --- 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 -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 - wait(5.0) - end -end - --- 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 - Chat:LockAllFields(children[i]) - end - end -end - -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 not Chat:IsTouchDevice() and self.ChatBar then - self.ChatBar.Visible = enabled - if enabled then - GuiService:SetGlobalGuiInset(0, 0, 0, 20) - else - GuiService:SetGlobalGuiInset(0, 0, 0, 0) - end - end - end -end - --- 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) - end) - - 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() - -- 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 - 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:PlayerChatted(...) - end) - end) - - Spawn(function() - Chat:CullThread() - end) - - self.Frame.RobloxLocked = true - Chat:LockAllFields(self.Frame) - self.Frame.DescendantAdded:connect(function(descendant) - Chat:LockAllFields(descendant) - end) -end - -Chat:Initialize() diff --git a/processed/107893730.lua b/processed/107893730.lua index 923d594..f2364f3 100644 --- a/processed/107893730.lua +++ b/processed/107893730.lua @@ -1,996 +1,271 @@ -print("[Mercury]: Loaded corescript 107893730") -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -while not Game do - wait(0.1) -end -while not game:GetService("MarketplaceService") do - wait(0.1) -end -while not game:FindFirstChild("CoreGui") do - wait(0.1) -end -while not game.CoreGui:FindFirstChild("RobloxGui") do - wait(0.1) -end -local RbxUtility -local baseUrl = game:GetService("ContentProvider").BaseUrl:lower() -local currentProductInfo, currentAssetId, currentCurrencyType, currentCurrencyAmount, currentEquipOnPurchase, currentProductId, currentServerResponseTable -local checkingPlayerFunds = false -local openBCUpSellWindowConnection -local purchasingConsumable = false -local enableBrowserWindowClosedEvent = true -local openBuyCurrencyWindowConnection -local currentlyPrompting = false -local purchaseDialog -local tweenTime = 0.3 -local showPosition = UDim2.new(0.5, -330, 0.5, -200) -local hidePosition = UDim2.new(0.5, -330, 1, 25) -local isSmallScreen -local spinning = false -local spinnerIcons -local smallScreenThreshold = 450 -local assetUrls = { } -local assetUrl -assetUrl = function(str) - return "http://www.roblox.com/Asset/?id=" .. tostring(str) -end -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 buyHeaderText = "Buy" -local takeHeaderText = "Take" -local buyFailedHeaderText = "An Error Occurred" -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 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 getSecureApiBaseUrl -getSecureApiBaseUrl = function() - local secureApiUrl = string.gsub(baseUrl, "http", "https") - secureApiUrl = string.gsub(secureApiUrl, "www", "api") - return secureApiUrl -end -local getRbxUtility -getRbxUtility = function() - if not RbxUtility then - RbxUtility = LoadLibrary("RbxUtility") - end - return RbxUtility -end -local preloadAssets -preloadAssets = function() - for i = 1, #assetUrls do - game:GetService("ContentProvider"):Preload(assetUrls[i]) - end -end -local removeCurrentPurchaseInfo -removeCurrentPurchaseInfo = function() - currentAssetId = nil - currentCurrencyType = nil - currentCurrencyAmount = nil - currentEquipOnPurchase = nil - currentProductId = nil - currentProductInfo = nil - currentServerResponseTable = nil - checkingPlayerFunds = false -end -local hidePurchasing -hidePurchasing = function() - purchaseDialog.PurchasingFrame.Visible = false - spinning = false -end -local closePurchasePrompt -closePurchasePrompt = function() - return purchaseDialog:TweenPosition(hidePosition, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTime, true, function() - game.GuiService:RemoveCenterDialog(purchaseDialog) - hidePurchasing() - purchaseDialog.Visible = false - currentlyPrompting = false - end) -end -local setButtonsVisible -setButtonsVisible = function(...) - local args = { - ... - } - local argCount = select("#", ...) - local bodyFrameChildren = purchaseDialog.BodyFrame:GetChildren() - for i = 1, #bodyFrameChildren do - if bodyFrameChildren[i]:IsA("GuiButton") then - bodyFrameChildren[i].Visible = false - for j = 1, argCount do - if bodyFrameChildren[i] == args[j] then - bodyFrameChildren[i].Visible = true - break - end - end - end - end -end -local signalPromptEnded -signalPromptEnded = function(isSuccess) - closePurchasePrompt() - if purchasingConsumable then - game:GetService("MarketplaceService"):SignalPromptProductPurchaseFinished(game.Players.LocalPlayer.userId, currentProductId, isSuccess) - else - game:GetService("MarketplaceService"):SignalPromptPurchaseFinished(game.Players.LocalPlayer, currentAssetId, isSuccess) - end - return removeCurrentPurchaseInfo() -end -local userPurchaseActionsEnded -userPurchaseActionsEnded = function(isSuccess) - checkingPlayerFunds = false - if isSuccess then - local newPurchasedSucceededText = string.gsub(purchaseSucceededText, "itemName", tostring(currentProductInfo["Name"])) - purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText - setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton) - return hidePurchasing() - else - return signalPromptEnded(isSuccess) - end -end -local isFreeItem -isFreeItem = function() - return currentProductInfo and currentProductInfo["IsForSale"] == true and currentProductInfo["IsPublicDomain"] == true -end -local setHeaderText -setHeaderText = function(text) - purchaseDialog.TitleLabel.Text = text - purchaseDialog.TitleBackdrop.Text = text -end -local assetTypeToString -assetTypeToString = function(assetType) - if 1 == assetType then - return "Image" - elseif 2 == assetType then - return "T-Shirt" - elseif 3 == assetType then - return "Audio" - elseif 4 == assetType then - return "Mesh" - elseif 5 == assetType then - return "Lua" - elseif 6 == assetType then - return "HTML" - elseif 7 == assetType then - return "Text" - elseif 8 == assetType then - return "Hat" - elseif 9 == assetType then - return "Place" - elseif 10 == assetType then - return "Model" - elseif 11 == assetType then - return "Shirt" - elseif 12 == assetType then - return "Pants" - elseif 13 == assetType then - return "Decal" - elseif 16 == assetType then - return "Avatar" - elseif 17 == assetType then - return "Head" - elseif 18 == assetType then - return "Face" - elseif 19 == assetType then - return "Gear" - elseif 21 == assetType then - return "Badge" - elseif 22 == assetType then - return "Group Emblem" - elseif 24 == assetType then - return "Animation" - elseif 25 == assetType then - return "Arms" - elseif 26 == assetType then - return "Legs" - elseif 27 == assetType then - return "Torso" - elseif 28 == assetType then - return "Right Arm" - elseif 29 == assetType then - return "Left Arm" - elseif 30 == assetType then - return "Left Leg" - elseif 31 == assetType then - return "Right Leg" - elseif 32 == assetType then - return "Package" - elseif 33 == assetType then - return "YouTube Video" - elseif 34 == assetType then - return "Game Pass" - elseif 0 == assetType then - return "Product" - else - return "" - end -end -local currencyTypeToString -currencyTypeToString = function(currencyType) - if currencyType == Enum.CurrencyType.Tix then - return "Tix" - else - return "R$" - end -end -local updatePurchasePromptData -updatePurchasePromptData = function(_) - local newItemDescription = "" - if not currentProductId then - currentProductId = currentProductInfo["ProductId"] - end - if isFreeItem() then - newItemDescription = string.gsub(freeItemPurchaseText, "itemName", tostring(currentProductInfo["Name"])) - newItemDescription = string.gsub(newItemDescription, "assetType", tostring(assetTypeToString(currentProductInfo["AssetTypeId"]))) - setHeaderText(takeHeaderText) - else - 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" - else - purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl .. "thumbs/asset.ashx?assetid=" .. tostring(currentAssetId) .. "&x=100&y=100&format=png" - end -end -local setCurrencyAmountAndType -setCurrencyAmountAndType = function(priceInRobux, priceInTix) - if currentCurrencyType == Enum.CurrencyType.Default or currentCurrencyType == Enum.CurrencyType.Robux then - if (priceInRobux ~= nil) and priceInRobux ~= 0 then - currentCurrencyAmount = priceInRobux - currentCurrencyType = Enum.CurrencyType.Robux - else - currentCurrencyAmount = priceInTix - currentCurrencyType = Enum.CurrencyType.Tix - end - elseif currentCurrencyType == Enum.CurrencyType.Tix then - if (priceInTix ~= nil) and priceInTix ~= 0 then - currentCurrencyAmount = priceInTix - currentCurrencyType = Enum.CurrencyType.Tix - else - currentCurrencyAmount = priceInRobux - currentCurrencyType = Enum.CurrencyType.Robux - end - else - return false - end - if not (currentCurrencyAmount ~= nil) then - return false - end - return true -end -local getPlayerBalance -getPlayerBalance = function() - local playerBalance - local success, errorCode - success, errorCode = pcall(function() - playerBalance = game:HttpGetAsync(tostring(getSecureApiBaseUrl()) .. "currency/balance") - end) - if not success then - print("Get player balance failed because", errorCode) - return nil - end - if playerBalance == "" then - return nil - end - playerBalance = getRbxUtility().DecodeJSON(playerBalance) - return playerBalance -end -local membershipTypeToNumber -membershipTypeToNumber = function(membership) - if Enum.MembershipType.None == membership then - return 0 - elseif Enum.MembershipType.BuildersClub == membership then - return 1 - elseif Enum.MembershipType.TurboBuildersClub == membership then - return 2 - elseif Enum.MembershipType.OutrageousBuildersClub == membership then - return 3 - else - return -1 - end -end -local openBuyCurrencyWindow -openBuyCurrencyWindow = function() - checkingPlayerFunds = true - return game:GetService("GuiService"):OpenBrowserWindow(tostring(baseUrl) .. "Upgrades/Robux.aspx") -end -local updateAfterBalanceText -updateAfterBalanceText = function(playerBalance, notRightBc) - if isFreeItem() then - purchaseDialog.BodyFrame.AfterBalanceButton.Text = freeItemBalanceText - return true, false - end - local keyWord - if currentCurrencyType == Enum.CurrencyType.Robux then - keyWord = "robux" - elseif currentCurrencyType == Enum.CurrencyType.Tix then - keyWord = "tickets" - end - if not keyWord then - return false - end - local playerBalanceNumber = tonumber(playerBalance[keyWord]) - if not playerBalanceNumber then - return false - end - local afterBalanceNumber = playerBalanceNumber - currentCurrencyAmount - if not notRightBc then - if afterBalanceNumber < 0 and keyWord == "robux" then - if not (openBuyCurrencyWindowConnection ~= nil) then - openBuyCurrencyWindowConnection = purchaseDialog.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(openBuyCurrencyWindow) - end - purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need " .. tostring(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) .. " " .. tostring(currencyTypeToString(currentCurrencyType)) .. " more to buy this item." - return true, true - end - end - if openBuyCurrencyWindowConnection then - openBuyCurrencyWindowConnection:disconnect() - openBuyCurrencyWindowConnection = nil - end - purchaseDialog.BodyFrame.AfterBalanceButton.Text = "Your balance after this transaction will be " .. tostring(currencyTypeToString(currentCurrencyType)) .. " " .. tostring(afterBalanceNumber) .. "." - return true, false -end -local canPurchaseItem -canPurchaseItem = function() - local playerOwnsAsset = false - local notRightBc = false - local descText - local success = false - if purchasingConsumable then - local currentProductInfoRaw - success = pcall(function() - currentProductInfoRaw = Game:HttpGetAsync(tostring(getSecureApiBaseUrl()) .. "marketplace/productDetails?productid=" .. tostring(currentProductId)) - end) - if success then - currentProductInfo = getRbxUtility().DecodeJSON(currentProductInfoRaw) - end - else - success = pcall(function() - currentProductInfo = game:GetService("MarketplaceService"):GetProductInfo(currentAssetId) - end) - end - if not (currentProductInfo ~= nil) or not success then - descText = "In-game sales are temporarily disabled. Please try again later." - 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") - return false - end - if currentAssetId <= 0 then - print("current asset id is negative, this should always be positive") - return false - end - local success, errorCode - success, errorCode = pcall(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) - return false - end - 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 - if type(currentProductInfo) ~= "table" then - currentProductInfo = getRbxUtility().DecodeJSON(currentProductInfo) - end - if not currentProductInfo then - descText = "Could not get product info. Please try again later." - return true, nil, nil, true, descText - end - if currentProductInfo["IsForSale"] == false and currentProductInfo["IsPublicDomain"] == false then - descText = "This item is no longer for sale." - return true, nil, nil, true, descText - end - 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 - local playerBalance = getPlayerBalance() - if not playerBalance then - descText = "Could not retrieve your balance. Please try again later." - return true, nil, nil, true, descText - end - if tonumber(currentProductInfo["MinimumMembershipLevel"]) > membershipTypeToNumber(game.Players.LocalPlayer.MembershipType) then - notRightBc = true - end - local updatedBalance, insufficientFunds - updatedBalance, insufficientFunds = updateAfterBalanceText(playerBalance, notRightBc) - if notRightBc then - purchaseDialog.BodyFrame.AfterBalanceButton.Active = true - 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 - end - end - if (currentProductInfo["IsLimited"] == true or currentProductInfo["IsLimitedUnique"] == true) and (currentProductInfo["Remaining"] == "" or currentProductInfo["Remaining"] == 0 or not (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." - return true, nil, nil, true, descText - end - purchaseDialog.BodyFrame.AfterBalanceButton.Active = true - return true, insufficientFunds -end -local doPlayerFundsCheck -doPlayerFundsCheck = function(checkIndefinitely) - if checkingPlayerFunds then - local canPurchase, insufficientFunds - canPurchase, insufficientFunds = canPurchaseItem() - if canPurchase and insufficientFunds then - local retries = 1000 - 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 - return setButtonsVisible(purchaseDialog.BodyFrame.BuyButton, purchaseDialog.BodyFrame.CancelButton, purchaseDialog.BodyFrame.AfterBalanceButton) - end - end -end -local openBCUpSellWindow -openBCUpSellWindow = function() - return Game:GetService("GuiService"):OpenBrowserWindow(tostring(baseUrl) .. "Upgrades/BuildersClubMemberships.aspx") -end -local doDeclinePurchase -doDeclinePurchase = function() - return userPurchaseActionsEnded(false) -end -local showPurchasePrompt -showPurchasePrompt = function() - local canPurchase, insufficientFunds, notRightBC, override, descText - canPurchase, insufficientFunds, notRightBC, override, descText = canPurchaseItem() - if canPurchase then - updatePurchasePromptData() - if override and descText then - purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = descText - purchaseDialog.BodyFrame.AfterBalanceButton.Visible = false - end - game.GuiService:AddCenterDialog(purchaseDialog, Enum.CenterDialogType.ModalDialog, function() - 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 - return 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) - else - setButtonsVisible(purchaseDialog.BodyFrame.BuyButton, purchaseDialog.BodyFrame.CancelButton) - end - purchaseDialog:TweenPosition(showPosition, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenTime, true) - if canPurchase and insufficientFunds and not enableBrowserWindowClosedEvent then - checkingPlayerFunds = true - return doPlayerFundsCheck(true) - end - end, function() - purchaseDialog.Visible = false - end) - return purchaseDialog - else - return doDeclinePurchase() - end -end -local getToolAssetID -getToolAssetID = function(assetID) - local newTool = game:GetService("InsertService"):LoadAsset(assetID) - if not newTool then - return nil - end - if newTool:IsA("Tool") then - return newTool - end - local toolChildren = newTool:GetChildren() - for i = 1, #toolChildren do - if toolChildren[i]:IsA("Tool") then - return toolChildren[i] - end - end - return nil -end -local purchaseFailed -purchaseFailed = function(inGamePurchasesDisabled) - local name = "Item" - if currentProductInfo then - name = currentProductInfo["Name"] - end - local newPurchasedFailedText = string.gsub(purchaseFailedText, "itemName", tostring(name)) - if inGamePurchasesDisabled then - newPurchasedFailedText = string.gsub(newPurchasedFailedText, "errorReason", tostring(errorPurchasesDisabledText)) - else - newPurchasedFailedText = string.gsub(newPurchasedFailedText, "errorReason", tostring(errorPurchasesUnknownText)) - end - purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedFailedText - purchaseDialog.BodyFrame.ItemPreview.Image = errorImageUrl - setButtonsVisible(purchaseDialog.BodyFrame.OkButton) - setHeaderText(buyFailedHeaderText) - return hidePurchasing() -end -local startSpinner -startSpinner = function() - spinning = true - return Spawn(function() - local spinPos = 0 - while spinning do - local pos = 0 - while pos < 8 do - spinnerIcons[pos + 1].Image = "http://www.roblox.com/Asset/?id=" .. (function() - if pos == spinPos or pos == (spinPos + 1) % 8 then - return "45880668" - else - return "45880710" - end - end)() - pos = pos + 1 - end - spinPos = (spinPos + 1) % 8 - wait(1 / 15) - end - end) -end -local showPurchasing -showPurchasing = function() - startSpinner() - purchaseDialog.PurchasingFrame.Visible = true -end -local currencyEnumToInt -currencyEnumToInt = function(currencyEnum) - if currencyEnum == Enum.CurrencyType.Robux or currencyEnum == Enum.CurrencyType.Default then - return 1 - elseif currencyEnum == Enum.CurrencyType.Tix then - return 2 - end -end -local doAcceptPurchase -doAcceptPurchase = function(_) - showPurchasing() - local startTime = tick() - local response = "none" - local url - if purchasingConsumable then - 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=" .. tostring(Game.PlaceId) - end - local success, reason - success, reason = pcall(function() - response = game:HttpPostAsync(url, "RobloxPurchaseRequest") - end) - print("doAcceptPurchase success from ypcall is ", success, "reason is", reason) - if (tick() - startTime) < 1 then - wait(1) - end - if response == "none" or not (response ~= nil) or response == "" then - print("did not get a proper response from web on purchase of", currentAssetId, currentProductId) - purchaseFailed() - return - end - response = getRbxUtility().DecodeJSON(response) - 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") - return - end - end - else - print("web return response of non parsable JSON on purchase of", currentAssetId) - purchaseFailed() - return - end - if currentEquipOnPurchase and success and currentAssetId and tonumber(currentProductInfo["AssetTypeId"]) == 19 then - local tool = getToolAssetID(tonumber(currentAssetId)) - if tool then - tool.Parent = game.Players.LocalPlayer.Backpack - end - end - if purchasingConsumable then - if not response["receipt"] then - print("tried to buy productId, but no receipt returned. productId was", currentProductId) - purchaseFailed() - return - end - return Game:GetService("MarketplaceService"):SignalClientPurchaseSuccess(tostring(response["receipt"]), game.Players.LocalPlayer.userId, currentProductId) - else - return userPurchaseActionsEnded(success) - end -end -local createSpinner -createSpinner = function(size, position, parent) - local spinnerFrame = New("Frame", "Spinner", { - Size = size, - Position = position, - BackgroundTransparency = 1, - ZIndex = 10, - Parent = parent - }) - spinnerIcons = { } - local spinnerNum = 1 - while spinnerNum <= 8 do - local spinnerImage = New("ImageLabel", "Spinner" .. tostring(spinnerNum), { - Size = UDim2.new(0, 16, 0, 16), - 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), - BackgroundTransparency = 1, - ZIndex = 10, - Image = "http://www.roblox.com/Asset/?id=45880710", - Parent = spinnerFrame - }) - spinnerIcons[spinnerNum] = spinnerImage - spinnerNum = spinnerNum + 1 - end -end -local createTextObject -createTextObject = function(name, text, type, size) - return New(type, name, { - Font = Enum.Font.ArialBold, - TextColor3 = Color3.new(217 / 255, 217 / 255, 217 / 255), - TextWrapped = true, - Text = text, - BackgroundTransparency = 1, - BorderSizePixel = 0, - FontSize = size - }) -end -local createImageButton -createImageButton = function(name) - return New("ImageButton", name, { - Size = UDim2.new(0, 153, 0, 46), - Name = name - }) -end -local userPurchaseProductActionsEnded -userPurchaseProductActionsEnded = function(userIsClosingDialog) - checkingPlayerFunds = false - if userIsClosingDialog then - closePurchasePrompt() - if currentServerResponseTable then - local isPurchased = false - if (tostring(currentServerResponseTable["isValid"])):lower() == "true" then - isPurchased = true - end - Game:GetService("MarketplaceService"):SignalPromptProductPurchaseFinished(tonumber(currentServerResponseTable["playerId"]), tonumber(currentServerResponseTable["productId"]), isPurchased) - else - print("Something went wrong, no currentServerResponseTable") - end - return removeCurrentPurchaseInfo() - else - local newPurchasedSucceededText = string.gsub(purchaseSucceededText, "itemName", tostring(currentProductInfo["Name"])) - purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText - setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton) - return hidePurchasing() - end -end -local createPurchasePromptGui -createPurchasePromptGui = function() - purchaseDialog = New("Frame", "PurchaseFrame", { - Size = UDim2.new(0, 660, 0, 400), - Position = hidePosition, - Visible = false, - BackgroundColor3 = Color3.new(141 / 255, 141 / 255, 141 / 255), - BorderColor3 = Color3.new(204 / 255, 204 / 255, 204 / 255), - Parent = game.CoreGui.RobloxGui, - New("Frame", "BodyFrame", { - Size = UDim2.new(1, 0, 1, -60), - Position = UDim2.new(0, 0, 0, 60), - BackgroundColor3 = Color3.new(67 / 255, 67 / 255, 67 / 255), - BorderSizePixel = 0, - ZIndex = 8 - }) - }) - local bodyFrame = purchaseDialog.BodyFrame - do - local _with_0 = createTextObject("TitleLabel", "Buy Item", "TextLabel", Enum.FontSize.Size48) - _with_0.ZIndex = 8 - _with_0.Size = UDim2.new(1, 0, 0, 60) - do - local _with_1 = _with_0:Clone() - _with_1.Name = "TitleBackdrop" - _with_1.TextColor3 = Color3.new(32 / 255, 32 / 255, 32 / 255) - _with_1.BackgroundTransparency = 0.0 - _with_1.BackgroundColor3 = Color3.new(54 / 255, 96 / 255, 171 / 255) - _with_1.Position = UDim2.new(0, 0, 0, -2) - _with_1.ZIndex = 8 - _with_1.Parent = purchaseDialog - end - _with_0.Parent = purchaseDialog - end - local distanceBetweenButtons = 90 - do - local _with_0 = createImageButton("CancelButton") - _with_0.Position = UDim2.new(0.5, distanceBetweenButtons / 2, 1, -120) - _with_0.BackgroundTransparency = 1 - _with_0.BorderSizePixel = 0 - _with_0.Parent = bodyFrame - _with_0.Modal = true - _with_0.ZIndex = 8 - _with_0.Image = cancelButtonImageUrl - _with_0.MouseButton1Down:connect(function() - _with_0.Image = cancelButtonDownUrl - end) - _with_0.MouseButton1Up:connect(function() - _with_0.Image = cancelButtonImageUrl - end) - _with_0.MouseLeave:connect(function() - _with_0.Image = cancelButtonImageUrl - end) - _with_0.MouseButton1Click:connect(doDeclinePurchase) - end - local buyButton = createImageButton("BuyButton") - buyButton.Position = UDim2.new(0.5, -153 - (distanceBetweenButtons / 2), 1, -120) - buyButton.BackgroundTransparency = 1 - buyButton.BorderSizePixel = 0 - buyButton.Image = buyImageUrl - buyButton.ZIndex = 8 - buyButton.MouseButton1Down:connect(function() - buyButton.Image = buyImageDownUrl - end) - buyButton.MouseButton1Up:connect(function() - buyButton.Image = buyImageUrl - end) - buyButton.MouseLeave:connect(function() - buyButton.Image = buyImageUrl - end) - buyButton.Parent = bodyFrame - do - local _with_0 = buyButton:Clone() - _with_0.Name = "BuyDisabledButton" - _with_0.AutoButtonColor = false - _with_0.Visible = false - _with_0.Active = false - _with_0.Image = buyImageDisabledUrl - _with_0.ZIndex = 8 - _with_0.Parent = bodyFrame - end - local freeButton = buyButton:Clone() - freeButton.BackgroundTransparency = 1 - freeButton.Name = "FreeButton" - freeButton.Visible = false - freeButton.ZIndex = 8 - freeButton.Image = freeButtonImageUrl - freeButton.MouseButton1Down:connect(function() - freeButton.Image = freeButtonImageDownUrl - end) - freeButton.MouseButton1Up:connect(function() - freeButton.Image = freeButtonImageUrl - end) - freeButton.MouseLeave:connect(function() - freeButton.Image = freeButtonImageUrl - end) - freeButton.Parent = bodyFrame - local okButton = buyButton:Clone() - okButton.Name = "OkButton" - okButton.BackgroundTransparency = 1 - okButton.Visible = false - 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.Image = okButtonUrl - end) - okButton.MouseLeave:connect(function() - okButton.Image = okButtonUrl - end) - okButton.Parent = bodyFrame - do - local _with_0 = okButton:Clone() - _with_0.ZIndex = 8 - _with_0.Name = "OkPurchasedButton" - _with_0.MouseButton1Down:connect(function() - _with_0.Image = okButtonPressedrl - end) - _with_0.MouseButton1Up:connect(function() - _with_0.Image = okButtonUrl - end) - _with_0.MouseLeave:connect(function() - _with_0.Image = okButtonUrl - end) - _with_0.Parent = bodyFrame - _with_0.MouseButton1Click:connect(function() - if purchasingConsumable then - return userPurchaseProductActionsEnded(true) - else - return signalPromptEnded(true) - end - end) - end - okButton.MouseButton1Click:connect(function() - return userPurchaseActionsEnded(false) - end) - buyButton.MouseButton1Click:connect(function() - return doAcceptPurchase(Enum.CurrencyType.Robux) - end) - freeButton.MouseButton1Click:connect(function() - return doAcceptPurchase(false) - end) - local itemPreview = New("ImageLabel", "ItemPreview", { - BackgroundColor3 = Color3.new(32 / 255, 32 / 255, 32 / 255), - BorderColor3 = Color3.new(141 / 255, 141 / 255, 141 / 255), - Position = UDim2.new(0, 30, 0, 20), - Size = UDim2.new(0, 180, 0, 180), - ZIndex = 9, - Parent = bodyFrame - }) - do - local _with_0 = createTextObject("ItemDescription", "Would you like to buy the 'itemName' for currencyType currencyAmount?", "TextLabel", Enum.FontSize.Size24) - _with_0.Position = UDim2.new(1, 20, 0, 0) - _with_0.Size = UDim2.new(0, 410, 1, 0) - _with_0.ZIndex = 8 - _with_0.Parent = itemPreview - end - do - local _with_0 = createTextObject("AfterBalanceButton", "Place holder text ip sum lorem dodo ashs", "TextButton", Enum.FontSize.Size24) - _with_0.AutoButtonColor = false - _with_0.TextColor3 = Color3.new(222 / 255, 59 / 255, 30 / 255) - _with_0.Position = UDim2.new(0, 5, 1, -55) - _with_0.Size = UDim2.new(1, -10, 0, 50) - _with_0.ZIndex = 8 - _with_0.Parent = bodyFrame - end - local purchasingFrame = New("Frame", "PurchasingFrame", { - Size = UDim2.new(1, 0, 1, 0), - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.2, - BorderSizePixel = 0, - ZIndex = 9, - Visible = false, - Active = true, - Parent = purchaseDialog - }) - local purchasingLabel = createTextObject("PurchasingLabel", "Purchasing...", "TextLabel", Enum.FontSize.Size48) - purchasingLabel.Size = UDim2.new(1, 0, 1, 0) - purchasingLabel.ZIndex = 10 - purchasingLabel.Parent = purchasingFrame - return createSpinner(UDim2.new(0, 50, 0, 50), UDim2.new(0.5, -25, 0.5, 30), purchasingLabel) -end -local cutSizeInHalfRecursive -cutSizeInHalfRecursive = function(_) end -local doubleSizeRecursive -doubleSizeRecursive = function(_) end -local changeGuiToScreenSize -changeGuiToScreenSize = function(smallScreen) - if smallScreen then - return cutSizeInHalfRecursive(purchaseDialog) - else - return doubleSizeRecursive(purchaseDialog) - end -end -local doPurchasePrompt -doPurchasePrompt = function(player, assetId, equipIfPurchased, currencyType, productId) - if not purchaseDialog then - createPurchasePromptGui() - end - if player == game.Players.LocalPlayer then - if currentlyPrompting then - return - end - currentlyPrompting = true - currentAssetId = assetId - currentProductId = productId - currentCurrencyType = currencyType - currentEquipOnPurchase = equipIfPurchased - purchasingConsumable = (currentProductId ~= nil) - return showPurchasePrompt() - end -end -local doProcessServerPurchaseResponse -doProcessServerPurchaseResponse = function(serverResponseTable) - if not serverResponseTable then - print("Server response table was nil, cancelling purchase") - purchaseFailed() - return - end - if serverResponseTable["playerId"] and tonumber(serverResponseTable["playerId"]) == game.Players.LocalPlayer.userId then - currentServerResponseTable = serverResponseTable - return userPurchaseProductActionsEnded(false) - end -end -preloadAssets() -game:GetService("MarketplaceService").PromptProductPurchaseRequested:connect(function(player, productId, equipIfPurchased, currencyType) - return doPurchasePrompt(player, nil, equipIfPurchased, currencyType, productId) -end) -Game:GetService("MarketplaceService").PromptPurchaseRequested:connect(function(player, assetId, equipIfPurchased, currencyType) - return doPurchasePrompt(player, assetId, equipIfPurchased, currencyType, nil) -end) -Game:GetService("MarketplaceService").ServerPurchaseVerification:connect(function(serverResponseTable) - return doProcessServerPurchaseResponse(serverResponseTable) -end) -if enableBrowserWindowClosedEvent then - Game:GetService("GuiService").BrowserWindowClosed:connect(function() - return doPlayerFundsCheck(false) - end) -end -Game.CoreGui.RobloxGui.Changed:connect(function() - local nowIsSmallScreen = game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold - if nowIsSmallScreen and not isSmallScreen then - changeGuiToScreenSize(true) - elseif not nowIsSmallScreen and isSmallScreen then - changeGuiToScreenSize(false) - end - isSmallScreen = nowIsSmallScreen -end) -isSmallScreen = game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold -if isSmallScreen then - return changeGuiToScreenSize(true) -end +print'[Mercury]: Loaded corescript 107893730'local a a=function(b,c,d)if not(d~= +nil)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for +g,h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h +end elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e. +Parent=f return e end while not Game do wait(0.1)end while not game:GetService +'MarketplaceService'do wait(0.1)end while not game:FindFirstChild'CoreGui'do +wait(0.1)end while not game.CoreGui:FindFirstChild'RobloxGui'do wait(0.1)end +local b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=nil,game:GetService +'ContentProvider'.BaseUrl:lower(),nil,nil,nil,nil,nil,nil,nil,false,nil,false, +true,nil,false,nil,0.3,UDim2.new(0.5,-330,0.5,-200),UDim2.new(0.5,-330,1,25),nil +,false,nil,450,{},nil z=function(A)return'http://www.roblox.com/Asset/?id='.. +tostring(A)end local A=z'42557901'table.insert(y,A)local B=z'104651457'table. +insert(y,B)local C=z'104651515'table.insert(y,C)local D=z'104651532'table. +insert(y,D)local E=z'104651592'table.insert(y,E)local F=z'104651639'table. +insert(y,F)local G=z'104651665'table.insert(y,G)local H=z'104651707'table. +insert(y,H)local I=z'104651733'table.insert(y,I)local J=z'104651761'table. +insert(y,J)local K=z'102481431'table.insert(y,K)local L=z'102481419'table. +insert(y,L)local M,N,O,P,Q,R,S,T,U,V,W='Buy','Take','An Error Occurred', +'in-game purchases are disabled','Roblox is performing maintenance', +'Your purchase of itemName succeeded!', +[[Your purchase of itemName failed because errorReason. Your account has not been charged. Please try again soon.]] +,[[Would you like to buy 'itemName' for currencyType currencyAmount?]], +"Would you like to take the assetType 'itemName' for FREE?", +[[Your balance of Robux or Tix will not be affected by this transaction.]],nil W +=function()local X=string.gsub(c,'http','https')X=string.gsub(X,'www','api') +return X end local X X=function()if not b then b=LoadLibrary'RbxUtility'end +return b end local Y Y=function()for Z=1,#y do game:GetService'ContentProvider': +Preload(y[Z])end end local Z Z=function()e=nil f=nil g=nil h=nil i=nil d=nil j= +nil k=false end local _ _=function()q.PurchasingFrame.Visible=false v=false end +local aa aa=function()return q:TweenPosition(t,Enum.EasingDirection.Out,Enum. +EasingStyle.Quad,r,true,function()game.GuiService:RemoveCenterDialog(q)_()q. +Visible=false p=false end)end local ab ab=function(...)local ac,ad,ae={...}, +select('#',...),q.BodyFrame:GetChildren()for af=1,#ae do if ae[af]:IsA +'GuiButton'then ae[af].Visible=false for ag=1,ad do if ae[af]==ac[ag]then ae[af] +.Visible=true break end end end end end local ac ac=function(ad)aa()if m then +game:GetService'MarketplaceService':SignalPromptProductPurchaseFinished(game. +Players.LocalPlayer.userId,i,ad)else game:GetService'MarketplaceService': +SignalPromptPurchaseFinished(game.Players.LocalPlayer,e,ad)end return Z()end +local ad ad=function(ae)k=false if ae then local af=string.gsub(R,'itemName', +tostring(d['Name']))q.BodyFrame.ItemPreview.ItemDescription.Text=af ab(q. +BodyFrame.OkPurchasedButton)return _()else return ac(ae)end end local ae ae= +function()return d and d['IsForSale']==true and d['IsPublicDomain']==true end +local af af=function(ag)q.TitleLabel.Text=ag q.TitleBackdrop.Text=ag end local +ag ag=function(ah)if 1==ah then return'Image'elseif 2==ah then return'T-Shirt' +elseif 3==ah then return'Audio'elseif 4==ah then return'Mesh'elseif 5==ah then +return'Lua'elseif 6==ah then return'HTML'elseif 7==ah then return'Text'elseif 8 +==ah then return'Hat'elseif 9==ah then return'Place'elseif 10==ah then return +'Model'elseif 11==ah then return'Shirt'elseif 12==ah then return'Pants'elseif 13 +==ah then return'Decal'elseif 16==ah then return'Avatar'elseif 17==ah then +return'Head'elseif 18==ah then return'Face'elseif 19==ah then return'Gear'elseif +21==ah then return'Badge'elseif 22==ah then return'Group Emblem'elseif 24==ah +then return'Animation'elseif 25==ah then return'Arms'elseif 26==ah then return +'Legs'elseif 27==ah then return'Torso'elseif 28==ah then return'Right Arm'elseif +29==ah then return'Left Arm'elseif 30==ah then return'Left Leg'elseif 31==ah +then return'Right Leg'elseif 32==ah then return'Package'elseif 33==ah then +return'YouTube Video'elseif 34==ah then return'Game Pass'elseif 0==ah then +return'Product'else return''end end local ah ah=function(ai)if ai==Enum. +CurrencyType.Tix then return'Tix'else return'R$'end end local ai ai=function(aj) +local ak=''if not i then i=d['ProductId']end if ae()then ak=string.gsub(U, +'itemName',tostring(d['Name']))ak=string.gsub(ak,'assetType',tostring(ag(d[ +'AssetTypeId'])))af(N)else ak=string.gsub(T,'itemName',tostring(d['Name']))ak= +string.gsub(ak,'currencyType',tostring(ah(f)))ak=string.gsub(ak,'currencyAmount' +,tostring(g))af(M)end q.BodyFrame.ItemPreview.ItemDescription.Text=ak if m then +q.BodyFrame.ItemPreview.Image=c..'thumbs/asset.ashx?assetid='..tostring(d[ +'IconImageAssetId'])..'&x=100&y=100&format=png'else q.BodyFrame.ItemPreview. +Image=c..'thumbs/asset.ashx?assetid='..tostring(e)..'&x=100&y=100&format=png'end +end local aj aj=function(ak,al)if f==Enum.CurrencyType.Default or f==Enum. +CurrencyType.Robux then if(ak~=nil)and ak~=0 then g=ak f=Enum.CurrencyType.Robux +else g=al f=Enum.CurrencyType.Tix end elseif f==Enum.CurrencyType.Tix then if(al +~=nil)and al~=0 then g=al f=Enum.CurrencyType.Tix else g=ak f=Enum.CurrencyType. +Robux end else return false end if not(g~=nil)then return false end return true +end local ak ak=function()local al,am,an am,an=pcall(function()al=game: +HttpGetAsync(tostring(W())..'currency/balance')end)if not am then print( +'Get player balance failed because',an)return nil end if al==''then return nil +end al=X().DecodeJSON(al)return al end local al al=function(am)if Enum. +MembershipType.None==am then return 0 elseif Enum.MembershipType.BuildersClub== +am then return 1 elseif Enum.MembershipType.TurboBuildersClub==am then return 2 +elseif Enum.MembershipType.OutrageousBuildersClub==am then return 3 else return- +1 end end local am am=function()k=true return game:GetService'GuiService': +OpenBrowserWindow(tostring(c)..'Upgrades/Robux.aspx')end local an an=function(ao +,ap)if ae()then q.BodyFrame.AfterBalanceButton.Text=V return true,false end +local aq if f==Enum.CurrencyType.Robux then aq='robux'elseif f==Enum. +CurrencyType.Tix then aq='tickets'end if not aq then return false end local ar= +tonumber(ao[aq])if not ar then return false end local as=ar-g if not ap then if +as<0 and aq=='robux'then if not(o~=nil)then o=q.BodyFrame.AfterBalanceButton. +MouseButton1Click:connect(am)end q.BodyFrame.AfterBalanceButton.Text='You need ' +..tostring(ah(f))..' '..tostring(-as).. +' more to buy this, click here to purchase more.'return true,true elseif as<0 +and aq=='tickets'then q.BodyFrame.AfterBalanceButton.Text='You need '..tostring( +-as)..' '..tostring(ah(f))..' more to buy this item.'return true,true end end if +o then o:disconnect()o=nil end q.BodyFrame.AfterBalanceButton.Text= +'Your balance after this transaction will be '..tostring(ah(f))..' '..tostring( +as)..'.'return true,false end local ao ao=function()local ap,aq,ar,as=false, +false,nil,false if m then local at as=pcall(function()at=Game:HttpGetAsync( +tostring(W())..'marketplace/productDetails?productid='..tostring(i))end)if as +then d=X().DecodeJSON(at)end else as=pcall(function()d=game:GetService +'MarketplaceService':GetProductInfo(e)end)end if not(d~=nil)or not as then ar= +[[In-game sales are temporarily disabled. Please try again later.]]return true, +nil,nil,true,ar end if not m then if not e then print +'current asset id is nil, this should always have a value'return false end if e +<=0 then print[[current asset id is negative, this should always be positive]] +return false end local at,au at,au=pcall(function()ap=game:HttpGetAsync(W().. +'ownership/hasAsset?userId='..tostring(game.Players.LocalPlayer.userId).. +'&assetId='..tostring(e))end)if not at then print( +'could not tell if player owns asset because',au)return false end if ap==true or +ap=='true'then ar='You already own this item.'return true,nil,nil,true,ar end +end q.BodyFrame.AfterBalanceButton.Visible=true if type(d)~='table'then d=X(). +DecodeJSON(d)end if not d then ar= +'Could not get product info. Please try again later.'return true,nil,nil,true,ar +end if d['IsForSale']==false and d['IsPublicDomain']==false then ar= +'This item is no longer for sale.'return true,nil,nil,true,ar end if not aj( +tonumber(d['PriceInRobux']),tonumber(d['PriceInTickets']))then ar= +[[We could retrieve the price of the item correctly. Please try again later.]] +return true,nil,nil,true,ar end local at=ak()if not at then ar= +'Could not retrieve your balance. Please try again later.'return true,nil,nil, +true,ar end if tonumber(d['MinimumMembershipLevel'])>al(game.Players.LocalPlayer +.MembershipType)then aq=true end local au,av au,av=an(at,aq)if aq then q. +BodyFrame.AfterBalanceButton.Active=true return true,av,aq,false end if d[ +'ContentRatingTypeId']==1 then if game.Players.LocalPlayer:GetUnder13()then ar= +[[Your account is under 13 so purchase of this item is not allowed.]]return true +,nil,nil,true,ar end end if(d['IsLimited']==true or d['IsLimitedUnique']==true) +and(d['Remaining']==''or d['Remaining']==0 or not(d['Remaining']~=nil))then ar= +[[All copies of this item have been sold out! Try buying from other users on the website.]] +return true,nil,nil,true,ar end if not au then ar= +[[Could not update your balance. Please check back after some time.]]return true +,nil,nil,true,ar end q.BodyFrame.AfterBalanceButton.Active=true return true,av +end local ap ap=function(aq)if k then local ar,as ar,as=ao()if ar and as then +local at=1000 while(at>0 or aq)and as and k and ar do wait(0.1)ar,as=ao()at=at-1 +end end if ar and not as then return ab(q.BodyFrame.BuyButton,q.BodyFrame. +CancelButton,q.BodyFrame.AfterBalanceButton)end end end local aq aq=function() +return Game:GetService'GuiService':OpenBrowserWindow(tostring(c).. +'Upgrades/BuildersClubMemberships.aspx')end local ar ar=function()return ad( +false)end local as as=function()local at,au,av,aw,ax at,au,av,aw,ax=ao()if at +then ai()if aw and ax then q.BodyFrame.ItemPreview.ItemDescription.Text=ax q. +BodyFrame.AfterBalanceButton.Visible=false end game.GuiService:AddCenterDialog(q +,Enum.CenterDialogType.ModalDialog,function()q.Visible=true if ae()then ab(q. +BodyFrame.FreeButton,q.BodyFrame.CancelButton,q.BodyFrame.AfterBalanceButton) +elseif av then q.BodyFrame.AfterBalanceButton.Text= +[[You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade.]] +if not l then l=q.BodyFrame.AfterBalanceButton.MouseButton1Click:connect( +function()if q.BodyFrame.AfterBalanceButton.Text== +[[You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade.]] +then return aq()end end)end ab(q.BodyFrame.BuyDisabledButton,q.BodyFrame. +CancelButton,q.BodyFrame.AfterBalanceButton)elseif au then ab(q.BodyFrame. +BuyDisabledButton,q.BodyFrame.CancelButton,q.BodyFrame.AfterBalanceButton)elseif +aw then ab(q.BodyFrame.BuyDisabledButton,q.BodyFrame.CancelButton)else ab(q. +BodyFrame.BuyButton,q.BodyFrame.CancelButton)end q:TweenPosition(s,Enum. +EasingDirection.Out,Enum.EasingStyle.Quad,r,true)if at and au and not n then k= +true return ap(true)end end,function()q.Visible=false end)return q else return +ar()end end local at at=function(au)local av=game:GetService'InsertService': +LoadAsset(au)if not av then return nil end if av:IsA'Tool'then return av end +local aw=av:GetChildren()for ax=1,#aw do if aw[ax]:IsA'Tool'then return aw[ax] +end end return nil end local au au=function(av)local aw='Item'if d then aw=d[ +'Name']end local ax=string.gsub(S,'itemName',tostring(aw))if av then ax=string. +gsub(ax,'errorReason',tostring(P))else ax=string.gsub(ax,'errorReason',tostring( +Q))end q.BodyFrame.ItemPreview.ItemDescription.Text=ax q.BodyFrame.ItemPreview. +Image=A ab(q.BodyFrame.OkButton)af(O)return _()end local av av=function()v=true +return Spawn(function()local aw=0 while v do local ax=0 while ax<8 do w[ax+1]. +Image='http://www.roblox.com/Asset/?id='..(function()if ax==aw or ax==(aw+1)%8 +then return'45880668'else return'45880710'end end)()ax=ax+1 end aw=(aw+1)%8 +wait(6.666666666666666E-2)end end)end local aw aw=function()av()q. +PurchasingFrame.Visible=true end local ax ax=function(ay)if ay==Enum. +CurrencyType.Robux or ay==Enum.CurrencyType.Default then return 1 elseif ay== +Enum.CurrencyType.Tix then return 2 end end local ay ay=function(az)aw()local aA +,aB,aC=tick(),'none',nil if m then aC=W().. +'marketplace/submitpurchase?productId='..tostring(i)..'¤cyTypeId='.. +tostring(ax(f))..'&expectedUnitPrice='..tostring(g)..'&placeId='..tostring(Game. +PlaceId)else aC=W()..'marketplace/purchase?productId='..tostring(i).. +'¤cyTypeId='..tostring(ax(f))..'&purchasePrice='..tostring(g).. +'&locationType=Game'..'&locationId='..tostring(Game.PlaceId)end local aD,aE aD, +aE=pcall(function()aB=game:HttpPostAsync(aC,'RobloxPurchaseRequest')end)print( +'doAcceptPurchase success from ypcall is ',aD,'reason is',aE)if(tick()-aA)<1 +then wait(1)end if aB=='none'or not(aB~=nil)or aB==''then print( +'did not get a proper response from web on purchase of',e,i)au()return end aB=X( +).DecodeJSON(aB)if aB then if aB['success']==false then if aB['status']~= +'AlreadyOwned'then print('web return response of fail on purchase of',e,i)au(aB[ +'status']=='EconomyDisabled')return end end else print( +'web return response of non parsable JSON on purchase of',e)au()return end if h +and aD and e and tonumber(d['AssetTypeId'])==19 then local aF=at(tonumber(e))if +aF then aF.Parent=game.Players.LocalPlayer.Backpack end end if m then if not aB[ +'receipt']then print( +[[tried to buy productId, but no receipt returned. productId was]],i)au()return +end return Game:GetService'MarketplaceService':SignalClientPurchaseSuccess( +tostring(aB['receipt']),game.Players.LocalPlayer.userId,i)else return ad(aD)end +end local az az=function(aA,aB,aC)local aD=a('Frame','Spinner',{Size=aA,Position +=aB,BackgroundTransparency=1,ZIndex=10,Parent=aC})w={}local aE=1 while aE<=8 do +local aF=a('ImageLabel','Spinner'..tostring(aE),{Size=UDim2.new(0,16,0,16), +Position=UDim2.new(0.5+0.3*math.cos(math.rad(45*aE)),-8,0.5+0.3*math.sin(math. +rad(45*aE)),-8),BackgroundTransparency=1,ZIndex=10,Image= +'http://www.roblox.com/Asset/?id=45880710',Parent=aD})w[aE]=aF aE=aE+1 end end +local aA aA=function(aB,aC,aD,aE)return a(aD,aB,{Font=Enum.Font.ArialBold, +TextColor3=Color3.new(0.8509803921568627,0.8509803921568627,0.8509803921568627), +TextWrapped=true,Text=aC,BackgroundTransparency=1,BorderSizePixel=0,FontSize=aE} +)end local aB aB=function(aC)return a('ImageButton',aC,{Size=UDim2.new(0,153,0, +46),Name=aC})end local aC aC=function(aD)k=false if aD then aa()if j then local +aE=false if(tostring(j['isValid'])):lower()=='true'then aE=true end Game: +GetService'MarketplaceService':SignalPromptProductPurchaseFinished(tonumber(j[ +'playerId']),tonumber(j['productId']),aE)else print +'Something went wrong, no currentServerResponseTable'end return Z()else local aE +=string.gsub(R,'itemName',tostring(d['Name']))q.BodyFrame.ItemPreview. +ItemDescription.Text=aE ab(q.BodyFrame.OkPurchasedButton)return _()end end local +aD aD=function()q=a('Frame','PurchaseFrame',{Size=UDim2.new(0,660,0,400), +Position=t,Visible=false,BackgroundColor3=Color3.new(0.5529411764705883, +0.5529411764705883,0.5529411764705883),BorderColor3=Color3.new(0.8,0.8,0.8), +Parent=game.CoreGui.RobloxGui,a('Frame','BodyFrame',{Size=UDim2.new(1,0,1,-60), +Position=UDim2.new(0,0,0,60),BackgroundColor3=Color3.new(0.2627450980392157, +0.2627450980392157,0.2627450980392157),BorderSizePixel=0,ZIndex=8})})local aE=q. +BodyFrame do local aF=aA('TitleLabel','Buy Item','TextLabel',Enum.FontSize. +Size48)aF.ZIndex=8 aF.Size=UDim2.new(1,0,0,60)do local aG=aF:Clone()aG.Name= +'TitleBackdrop'aG.TextColor3=Color3.new(0.12549019607843137,0.12549019607843137, +0.12549019607843137)aG.BackgroundTransparency=0 aG.BackgroundColor3=Color3.new( +0.21176470588235294,0.3764705882352941,0.6705882352941176)aG.Position=UDim2.new( +0,0,0,-2)aG.ZIndex=8 aG.Parent=q end aF.Parent=q end local aF=90 do local aG=aB +'CancelButton'aG.Position=UDim2.new(0.5,aF/2,1,-120)aG.BackgroundTransparency=1 +aG.BorderSizePixel=0 aG.Parent=aE aG.Modal=true aG.ZIndex=8 aG.Image=E aG. +MouseButton1Down:connect(function()aG.Image=F end)aG.MouseButton1Up:connect( +function()aG.Image=E end)aG.MouseLeave:connect(function()aG.Image=E end)aG. +MouseButton1Click:connect(ar)end local aG=aB'BuyButton'aG.Position=UDim2.new(0.5 +,-153-(aF/2),1,-120)aG.BackgroundTransparency=1 aG.BorderSizePixel=0 aG.Image=B +aG.ZIndex=8 aG.MouseButton1Down:connect(function()aG.Image=C end)aG. +MouseButton1Up:connect(function()aG.Image=B end)aG.MouseLeave:connect(function() +aG.Image=B end)aG.Parent=aE do local aH=aG:Clone()aH.Name='BuyDisabledButton'aH. +AutoButtonColor=false aH.Visible=false aH.Active=false aH.Image=D aH.ZIndex=8 aH +.Parent=aE end local aH=aG:Clone()aH.BackgroundTransparency=1 aH.Name= +'FreeButton'aH.Visible=false aH.ZIndex=8 aH.Image=I aH.MouseButton1Down:connect( +function()aH.Image=J end)aH.MouseButton1Up:connect(function()aH.Image=I end)aH. +MouseLeave:connect(function()aH.Image=I end)aH.Parent=aE local aI=aG:Clone()aI. +Name='OkButton'aI.BackgroundTransparency=1 aI.Visible=false aI.Position=UDim2. +new(0.5,-aI.Size.X.Offset/2,1,-120)aI.Modal=true aI.Image=G aI.ZIndex=8 aI. +MouseButton1Down:connect(function()aI.Image=H end)aI.MouseButton1Up:connect( +function()aI.Image=G end)aI.MouseLeave:connect(function()aI.Image=G end)aI. +Parent=aE do local aJ=aI:Clone()aJ.ZIndex=8 aJ.Name='OkPurchasedButton'aJ. +MouseButton1Down:connect(function()aJ.Image=H end)aJ.MouseButton1Up:connect( +function()aJ.Image=G end)aJ.MouseLeave:connect(function()aJ.Image=G end)aJ. +Parent=aE aJ.MouseButton1Click:connect(function()if m then return aC(true)else +return ac(true)end end)end aI.MouseButton1Click:connect(function()return ad( +false)end)aG.MouseButton1Click:connect(function()return ay(Enum.CurrencyType. +Robux)end)aH.MouseButton1Click:connect(function()return ay(false)end)local aJ=a( +'ImageLabel','ItemPreview',{BackgroundColor3=Color3.new(0.12549019607843137, +0.12549019607843137,0.12549019607843137),BorderColor3=Color3.new( +0.5529411764705883,0.5529411764705883,0.5529411764705883),Position=UDim2.new(0, +30,0,20),Size=UDim2.new(0,180,0,180),ZIndex=9,Parent=aE})do local aK=aA( +'ItemDescription', +[[Would you like to buy the 'itemName' for currencyType currencyAmount?]], +'TextLabel',Enum.FontSize.Size24)aK.Position=UDim2.new(1,20,0,0)aK.Size=UDim2. +new(0,410,1,0)aK.ZIndex=8 aK.Parent=aJ end do local aK=aA('AfterBalanceButton', +'Place holder text ip sum lorem dodo ashs','TextButton',Enum.FontSize.Size24)aK. +AutoButtonColor=false aK.TextColor3=Color3.new(0.8705882352941177, +0.23137254901960785,0.11764705882352941)aK.Position=UDim2.new(0,5,1,-55)aK.Size= +UDim2.new(1,-10,0,50)aK.ZIndex=8 aK.Parent=aE end local aK,aL=a('Frame', +'PurchasingFrame',{Size=UDim2.new(1,0,1,0),BackgroundColor3=Color3.new(0,0,0), +BackgroundTransparency=0.2,BorderSizePixel=0,ZIndex=9,Visible=false,Active=true, +Parent=q}),aA('PurchasingLabel','Purchasing...','TextLabel',Enum.FontSize.Size48 +)aL.Size=UDim2.new(1,0,1,0)aL.ZIndex=10 aL.Parent=aK return az(UDim2.new(0,50,0, +50),UDim2.new(0.5,-25,0.5,30),aL)end local aE aE=function(aF)end local aF aF= +function(aG)end local aG aG=function(aH)if aH then return aE(q)else return aF(q) +end end local aH aH=function(aI,aJ,aK,aL,aM)if not q then aD()end if aI==game. +Players.LocalPlayer then if p then return end p=true e=aJ i=aM f=aL h=aK m=(i~= +nil)return as()end end local aI aI=function(aJ)if not aJ then print +'Server response table was nil, cancelling purchase'au()return end if aJ[ +'playerId']and tonumber(aJ['playerId'])==game.Players.LocalPlayer.userId then j= +aJ return aC(false)end end Y()game:GetService'MarketplaceService'. +PromptProductPurchaseRequested:connect(function(aJ,aK,aL,aM)return aH(aJ,nil,aL, +aM,aK)end)Game:GetService'MarketplaceService'.PromptPurchaseRequested:connect( +function(aJ,aK,aL,aM)return aH(aJ,aK,aL,aM,nil)end)Game:GetService +'MarketplaceService'.ServerPurchaseVerification:connect(function(aJ)return aI(aJ +)end)if n then Game:GetService'GuiService'.BrowserWindowClosed:connect(function( +)return ap(false)end)end Game.CoreGui.RobloxGui.Changed:connect(function()local +aJ=game.CoreGui.RobloxGui.AbsoluteSize.Y<=x if aJ and not u then aG(true)elseif +not aJ and u then aG(false)end u=aJ end)u=game.CoreGui.RobloxGui.AbsoluteSize.Y +<=x if u then return aG(true)end \ No newline at end of file diff --git a/processed/152908679.lua b/processed/152908679.lua index 664c2bf..b13b899 100644 --- a/processed/152908679.lua +++ b/processed/152908679.lua @@ -1,246 +1,52 @@ -print("[Mercury]: Loaded corescript 152908679") -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local contextActionService = Game:GetService("ContextActionService") -local isTouchDevice = Game:GetService("UserInputService").TouchEnabled -local functionTable = { } -local buttonVector = { } -local buttonScreenGui -local buttonFrame -local ContextDownImage = "http://www.banland.xyz/asset/?id=97166756" -local ContextUpImage = "http://www.banland.xyz/asset/?id=97166444" -local oldTouches = { } -local buttonPositionTable = { - UDim2.new(0, 123, 0, 70), - UDim2.new(0, 30, 0, 60), - UDim2.new(0, 180, 0, 160), - UDim2.new(0, 85, 0, -25), - UDim2.new(0, 185, 0, -25), - UDim2.new(0, 185, 0, 260), - UDim2.new(0, 216, 0, 65) -} -local maxButtons = #buttonPositionTable -do - local _with_0 = Game:GetService("ContentProvider") - _with_0:Preload(ContextDownImage) - _with_0:Preload(ContextUpImage) -end -while not Game.Players do - wait() -end -while not Game.Players.LocalPlayer do - wait() -end -local createContextActionGui -createContextActionGui = function() - if not buttonScreenGui and isTouchDevice then - buttonScreenGui = New("ScreenGui", "ContextActionGui", { - New("Frame", "ContextButtonFrame", { - BackgroundTransparency = 1, - Size = UDim2.new(0.3, 0, 0.5, 0), - Position = UDim2.new(0.7, 0, 0.5, 0) - }) - }) - end -end -local contextButtonDown -contextButtonDown = function(button, inputObject, actionName) - if inputObject.UserInputType == Enum.UserInputType.Touch then - button.Image = ContextDownImage - return contextActionService:CallFunction(actionName, Enum.UserInputState.Begin) - end -end -local contextButtonMoved -contextButtonMoved = function(button, inputObject, actionName) - if inputObject.UserInputType == Enum.UserInputType.Touch then - button.Image = ContextDownImage - return contextActionService:CallFunction(actionName, Enum.UserInputState.Change) - end -end -local contextButtonUp -contextButtonUp = function(button, inputObject, actionName) - button.Image = ContextUpImage - if inputObject.UserInputType == Enum.UserInputType.Touch and inputObject.UserInputState == Enum.UserInputState.End then - return contextActionService:CallFunction(actionName, Enum.UserInputState.End, inputObject) - end -end -local isSmallScreenDevice -isSmallScreenDevice = function() - return Game:GetService("GuiService"):GetScreenResolution().y <= 320 -end -local createNewButton -createNewButton = function(actionName, functionInfoTable) - local contextButton = New("ImageButton", "ContextActionButton", { - BackgroundTransparency = 1, - Size = UDim2.new((function() - if isSmallScreenDevice() then - return 0, 90, 0, 90 - else - return 0, 70, 0, 70 - end - end)()), - Active = true, - Image = ContextUpImage, - Parent = buttonFrame - }) - local currentButtonTouch - Game:GetService("UserInputService").InputEnded:connect(function(inputObject) - oldTouches[inputObject] = nil - end) - contextButton.InputBegan:connect(function(inputObject) - if oldTouches[inputObject] then - return - end - if inputObject.UserInputState == Enum.UserInputState.Begin and not (currentButtonTouch ~= nil) then - currentButtonTouch = inputObject - return contextButtonDown(contextButton, inputObject, actionName) - end - end) - contextButton.InputChanged:connect(function(inputObject) - if oldTouches[inputObject] or currentButtonTouch ~= inputObject then - return - end - return contextButtonMoved(contextButton, inputObject, actionName) - end) - contextButton.InputEnded:connect(function(inputObject) - if oldTouches[inputObject] or currentButtonTouch ~= inputObject then - return - end - currentButtonTouch = nil - oldTouches[inputObject] = true - return contextButtonUp(contextButton, inputObject, actionName) - end) - local actionIcon = New("ImageLabel", "ActionIcon", { - Position = UDim2.new(0.175, 0, 0.175, 0), - Size = UDim2.new(0.65, 0, 0.65, 0), - BackgroundTransparency = 1 - }) - if functionInfoTable["image"] and type(functionInfoTable["image"]) == "string" then - actionIcon.Image = functionInfoTable["image"] - end - actionIcon.Parent = contextButton - local actionTitle = New("TextLabel", "ActionTitle", { - Size = UDim2.new(1, 0, 1, 0), - BackgroundTransparency = 1, - Font = Enum.Font.SourceSansBold, - TextColor3 = Color3.new(1, 1, 1), - TextStrokeTransparency = 0, - FontSize = Enum.FontSize.Size18, - TextWrapped = true, - Text = "" - }) - if functionInfoTable["title"] and type(functionInfoTable["title"]) == "string" then - actionTitle.Text = functionInfoTable["title"] - end - actionTitle.Parent = contextButton - return contextButton -end -local createButton -createButton = function(actionName, functionInfoTable) - local button = createNewButton(actionName, functionInfoTable) - local position - for i = 1, #buttonVector do - if buttonVector[i] == "empty" then - position = i - break - end - end - if not position then - position = #buttonVector + 1 - end - if position > maxButtons then - return - end - buttonVector[position] = button - functionTable[actionName]["button"] = button - button.Position = buttonPositionTable[position] - button.Parent = buttonFrame - if buttonScreenGui and not (buttonScreenGui.Parent ~= nil) then - buttonScreenGui.Parent = Game.Players.LocalPlayer.PlayerGui - end -end -local removeAction -removeAction = function(actionName) - if not functionTable[actionName] then - return - end - local actionButton = functionTable[actionName]["button"] - if actionButton then - actionButton.Parent = nil - for i = 1, #buttonVector do - if buttonVector[i] == actionButton then - buttonVector[i] = "empty" - break - end - end - actionButton:Destroy() - end - functionTable[actionName] = nil -end -local addAction -addAction = function(actionName, createTouchButton, functionInfoTable) - if functionTable[actionName] then - removeAction(actionName) - end - functionTable[actionName] = { - functionInfoTable - } - if createTouchButton and isTouchDevice then - createContextActionGui() - return createButton(actionName, functionInfoTable) - end -end -contextActionService.BoundActionChanged:connect(function(actionName, changeName, changeTable) - if functionTable[actionName] and changeTable then - do - local button = functionTable[actionName]["button"] - if button then - if changeName == "image" then - button.ActionIcon.Image = changeTable[changeName] - elseif changeName == "title" then - button.ActionTitle.Text = changeTable[changeName] - elseif changeName == "position" then - button.Position = changeTable[changeName] - end - end - end - end -end) -contextActionService.BoundActionAdded:connect(function(actionName, createTouchButton, functionInfoTable) - return addAction(actionName, createTouchButton, functionInfoTable) -end) -contextActionService.BoundActionRemoved:connect(function(actionName, _) - return removeAction(actionName) -end) -contextActionService.GetActionButtonEvent:connect(function(actionName) - if functionTable[actionName] then - return contextActionService:FireActionButtonFoundSignal(actionName, functionTable[actionName]["button"]) - end -end) -local boundActions = contextActionService:GetAllBoundActionInfo() -for actionName, actionData in pairs(boundActions) do - addAction(actionName, actionData["createTouchButton"], actionData) -end +print'[Mercury]: Loaded corescript 152908679'local a a=function(b,c,d)if not(d~= +nil)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for +g,h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h +end elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e. +Parent=f return e end local b,c,d,e,f,g,h,i,j,k=Game:GetService +'ContextActionService',Game:GetService'UserInputService'.TouchEnabled,{},{},nil, +nil,'http://www.banland.xyz/asset/?id=97166756', +'http://www.banland.xyz/asset/?id=97166444',{},{UDim2.new(0,123,0,70),UDim2.new( +0,30,0,60),UDim2.new(0,180,0,160),UDim2.new(0,85,0,-25),UDim2.new(0,185,0,-25), +UDim2.new(0,185,0,260),UDim2.new(0,216,0,65)}local l=#k do local m=Game: +GetService'ContentProvider'm:Preload(h)m:Preload(i)end while not Game.Players do +wait()end while not Game.Players.LocalPlayer do wait()end local m m=function()if +not f and c then f=a('ScreenGui','ContextActionGui',{a('Frame', +'ContextButtonFrame',{BackgroundTransparency=1,Size=UDim2.new(0.3,0,0.5,0), +Position=UDim2.new(0.7,0,0.5,0)})})end end local n n=function(o,p,q)if p. +UserInputType==Enum.UserInputType.Touch then o.Image=h return b:CallFunction(q, +Enum.UserInputState.Begin)end end local o o=function(p,q,r)if q.UserInputType== +Enum.UserInputType.Touch then p.Image=h return b:CallFunction(r,Enum. +UserInputState.Change)end end local p p=function(q,r,s)q.Image=i if r. +UserInputType==Enum.UserInputType.Touch and r.UserInputState==Enum. +UserInputState.End then return b:CallFunction(s,Enum.UserInputState.End,r)end +end local q q=function()return Game:GetService'GuiService':GetScreenResolution() +.y<=320 end local r r=function(s,t)local u,v=a('ImageButton', +'ContextActionButton',{BackgroundTransparency=1,Size=UDim2.new((function()if q() +then return 0,90,0,90 else return 0,70,0,70 end end)()),Active=true,Image=i, +Parent=g}),nil Game:GetService'UserInputService'.InputEnded:connect(function(w)j +[w]=nil end)u.InputBegan:connect(function(w)if j[w]then return end if w. +UserInputState==Enum.UserInputState.Begin and not(v~=nil)then v=w return n(u,w,s +)end end)u.InputChanged:connect(function(w)if j[w]or v~=w then return end return +o(u,w,s)end)u.InputEnded:connect(function(w)if j[w]or v~=w then return end v=nil +j[w]=true return p(u,w,s)end)local w=a('ImageLabel','ActionIcon',{Position=UDim2 +.new(0.175,0,0.175,0),Size=UDim2.new(0.65,0,0.65,0),BackgroundTransparency=1})if +t['image']and type(t['image'])=='string'then w.Image=t['image']end w.Parent=u +local x=a('TextLabel','ActionTitle',{Size=UDim2.new(1,0,1,0), +BackgroundTransparency=1,Font=Enum.Font.SourceSansBold,TextColor3=Color3.new(1,1 +,1),TextStrokeTransparency=0,FontSize=Enum.FontSize.Size18,TextWrapped=true,Text +=''})if t['title']and type(t['title'])=='string'then x.Text=t['title']end x. +Parent=u return u end local s s=function(t,u)local v,w=r(t,u),nil for x=1,#e do +if e[x]=='empty'then w=x break end end if not w then w=#e+1 end if w>l then +return end e[w]=v d[t]['button']=v v.Position=k[w]v.Parent=g if f and not(f. +Parent~=nil)then f.Parent=Game.Players.LocalPlayer.PlayerGui end end local t t= +function(u)if not d[u]then return end local v=d[u]['button']if v then v.Parent= +nil for w=1,#e do if e[w]==v then e[w]='empty'break end end v:Destroy()end d[u]= +nil end local u u=function(v,w,x)if d[v]then t(v)end d[v]={x}if w and c then m() +return s(v,x)end end b.BoundActionChanged:connect(function(v,w,x)if d[v]and x +then do local y=d[v]['button']if y then if w=='image'then y.ActionIcon.Image=x[w +]elseif w=='title'then y.ActionTitle.Text=x[w]elseif w=='position'then y. +Position=x[w]end end end end end)b.BoundActionAdded:connect(function(v,w,x) +return u(v,w,x)end)b.BoundActionRemoved:connect(function(v,w)return t(v)end)b. +GetActionButtonEvent:connect(function(v)if d[v]then return b: +FireActionButtonFoundSignal(v,d[v]['button'])end end)local v=b: +GetAllBoundActionInfo()for w,x in pairs(v)do u(w,x['createTouchButton'],x)end \ No newline at end of file diff --git a/processed/153556783.lua b/processed/153556783.lua index 8b93e53..82b1322 100644 --- a/processed/153556783.lua +++ b/processed/153556783.lua @@ -1,527 +1,104 @@ -print("[Mercury]: Loaded corescript 153556783") -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -while not Game do - wait() -end -while not Game:FindFirstChild("Players") do - wait() -end -while not Game.Players.LocalPlayer do - wait() -end -while not Game:FindFirstChild("CoreGui") do - wait() -end -while not Game.CoreGui:FindFirstChild("RobloxGui") do - wait() -end -local userInputService = Game:GetService("UserInputService") -local success = pcall(function() - return userInputService:IsLuaTouchControls() -end) -if not success then - script:Destroy() -end -local screenResolution = Game:GetService("GuiService"):GetScreenResolution() -local isSmallScreenDevice -isSmallScreenDevice = function() - return screenResolution.y <= 320 -end -local localPlayer = Game.Players.LocalPlayer -local thumbstickSize = 120 -if isSmallScreenDevice() then - thumbstickSize = 70 -end -local touchControlsSheet = "rbxasset://textures/ui/TouchControlsSheet.png" -local ThumbstickDeadZone = 5 -local ThumbstickMaxPercentGive = 0.92 -local thumbstickTouches = { } -local jumpButtonSize = 90 -if isSmallScreenDevice() then - jumpButtonSize = 70 -end -local oldJumpTouches = { } -local currentJumpTouch -local CameraRotateSensitivity = 0.007 -local CameraRotateDeadZone = CameraRotateSensitivity * 16 -local CameraZoomSensitivity = 0.03 -local PinchZoomDelay = 0.2 -local cameraTouch -Game:GetService("ContentProvider"):Preload(touchControlsSheet) -local DistanceBetweenTwoPoints -DistanceBetweenTwoPoints = function(point1, point2) - local dx = point2.x - point1.x - local dy = point2.y - point1.y - return math.sqrt(dx * dx + dy * dy) -end -local transformFromCenterToTopLeft -transformFromCenterToTopLeft = function(pointToTranslate, guiObject) - return UDim2.new(0, pointToTranslate.x - guiObject.AbsoluteSize.x / 2, 0, pointToTranslate.y - guiObject.AbsoluteSize.y / 2) -end -local rotatePointAboutLocation -rotatePointAboutLocation = function(pointToRotate, pointToRotateAbout, radians) - local sinAnglePercent = math.sin(radians) - local cosAnglePercent = math.cos(radians) - local transformedPoint = pointToRotate - transformedPoint = Vector2.new(transformedPoint.x - pointToRotateAbout.x, transformedPoint.y - pointToRotateAbout.y) - local xNew = transformedPoint.x * cosAnglePercent - transformedPoint.y * sinAnglePercent - local yNew = transformedPoint.x * sinAnglePercent + transformedPoint.y * cosAnglePercent - transformedPoint = Vector2.new(xNew + pointToRotateAbout.x, yNew + pointToRotateAbout.y) - return transformedPoint -end -local dotProduct -dotProduct = function(v1, v2) - return v1.x * v2.x + v1.y * v2.y -end -local stationaryThumbstickTouchMove -stationaryThumbstickTouchMove = function(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) - 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 -local followThumbstickTouchMove -followThumbstickTouchMove = function(thumbstickFrame, thumbstickOuter, touchLocation) - local thumbstickOuterCenter = Vector2.new(thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x / 2, thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y / 2) - 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 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) - 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 math.abs(anglePercent) > 0.00001 then - local outerThumbCenter = rotatePointAboutLocation(thumbstickOuterCenter, thumbstickInnerCenter, anglePercent) - thumbstickOuter.Position = transformFromCenterToTopLeft(Vector2.new(outerThumbCenter.x, outerThumbCenter.y), thumbstickOuter) - end - thumbstickOuter.Position = UDim2.new(0, thumbstickOuter.Position.X.Offset + movementVector.x, 0, thumbstickOuter.Position.Y.Offset + movementVector.y) - end - thumbstickFrame.Position = transformFromCenterToTopLeft(touchLocation, thumbstickFrame) - local thumbstickFramePosition = Vector2.new(thumbstickFrame.Position.X.Offset, thumbstickFrame.Position.Y.Offset) - local 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 -local movementOutsideDeadZone -movementOutsideDeadZone = function(movementVector) - return (math.abs(movementVector.x) > ThumbstickDeadZone) or (math.abs(movementVector.y) > ThumbstickDeadZone) -end -local constructThumbstick -constructThumbstick = function(defaultThumbstickPos, updateFunction, stationaryThumbstick) - local thumbstickFrame = New("Frame", "ThumbstickFrame", { - Active = true, - Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize), - Position = defaultThumbstickPos, - BackgroundTransparency = 1 - }) - New("ImageLabel", "InnerThumbstick", { - Image = touchControlsSheet, - ImageRectOffset = Vector2.new(220, 0), - ImageRectSize = Vector2.new(111, 111), - BackgroundTransparency = 1, - Size = UDim2.new(0, thumbstickSize / 2, 0, thumbstickSize / 2), - Position = UDim2.new(0, thumbstickFrame.Size.X.Offset / 2 - thumbstickSize / 4, 0, thumbstickFrame.Size.Y.Offset / 2 - thumbstickSize / 4), - ZIndex = 2, - Parent = thumbstickFrame - }) - local outerThumbstick = New("ImageLabel", "OuterThumbstick", { - Image = touchControlsSheet, - ImageRectOffset = Vector2.new(0, 0), - ImageRectSize = Vector2.new(220, 220), - BackgroundTransparency = 1, - Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize), - Position = defaultThumbstickPos, - Parent = Game.CoreGui.RobloxGui - }) - local thumbstickTouch - local userInputServiceTouchMovedCon - local userInputSeviceTouchEndedCon - local startInputTracking - 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 - thumbstickTouch = inputObject - table.insert(thumbstickTouches, thumbstickTouch) - thumbstickFrame.Position = transformFromCenterToTopLeft(thumbstickTouch.Position, thumbstickFrame) - outerThumbstick.Position = thumbstickFrame.Position - userInputServiceTouchMovedCon = userInputService.TouchMoved:connect(function(movedInput) - if movedInput == thumbstickTouch then - local movementVector - if stationaryThumbstick then - 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)) - end - if updateFunction then - return 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) - end - userInputSeviceTouchEndedCon:disconnect() - userInputServiceTouchMovedCon:disconnect() - thumbstickFrame.Position = defaultThumbstickPos - outerThumbstick.Position = defaultThumbstickPos - for i, object in pairs(thumbstickTouches) do - if object == thumbstickTouch then - table.remove(thumbstickTouches, i) - break - end - end - thumbstickTouch = nil - end - end) - end - userInputService.Changed:connect(function(prop) - if prop == "ModalEnabled" then - do - local _tmp_0 = not userInputService.ModalEnabled - thumbstickFrame.Visible = _tmp_0 - outerThumbstick.Visible = _tmp_0 - end - end - end) - thumbstickFrame.InputBegan:connect(startInputTracking) - return thumbstickFrame -end -local setupCharacterMovement -setupCharacterMovement = function(parentFrame) - local lastMovementVector, lastMaxMovement - local moveCharacterFunc = localPlayer.MoveCharacter - local moveCharacterFunction - moveCharacterFunction = function(movementVector, maxMovement) - if localPlayer then - if movementOutsideDeadZone(movementVector) then - lastMovementVector = movementVector - lastMaxMovement = maxMovement - if movementVector.magnitude / maxMovement > ThumbstickMaxPercentGive then - maxMovement = movementVector.magnitude - 1 - end - return moveCharacterFunc(localPlayer, movementVector, maxMovement) - else - lastMovementVector = Vector2.new(0, 0) - lastMaxMovement = 1 - return moveCharacterFunc(localPlayer, lastMovementVector, lastMaxMovement) - end - end - end - local thumbstickPos = UDim2.new(0, thumbstickSize / 2, 1, -thumbstickSize * 1.75) - if isSmallScreenDevice() then - thumbstickPos = UDim2.new(0, (thumbstickSize / 2) - 10, 1, -thumbstickSize - 20) - end - local characterThumbstick = constructThumbstick(thumbstickPos, moveCharacterFunction, false) - characterThumbstick.Name = "CharacterThumbstick" - characterThumbstick.Parent = parentFrame - local refreshCharacterMovement - refreshCharacterMovement = function() - if localPlayer and moveCharacterFunc and lastMovementVector and lastMaxMovement then - return moveCharacterFunc(localPlayer, lastMovementVector, lastMaxMovement) - end - end - return refreshCharacterMovement -end -local setupJumpButton -setupJumpButton = function(parentFrame) - local jumpButton = New("ImageButton", "JumpButton", { - BackgroundTransparency = 1, - Image = touchControlsSheet, - ImageRectOffset = Vector2.new(176, 222), - ImageRectSize = Vector2.new(174, 174), - Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize), - Position = UDim2.new(1, (function() - if isSmallScreenDevice() then - return -(jumpButtonSize * 2.25), 1, -jumpButtonSize - 20 - else - return -(jumpButtonSize * 2.75), 1, -jumpButtonSize - 120 - end - end)()) - }) - local playerJumpFunc = localPlayer.JumpCharacter - local doJumpLoop - doJumpLoop = function() - while currentJumpTouch do - if localPlayer then - playerJumpFunc(localPlayer) - end - 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 - for _, touch in pairs(oldJumpTouches) do - if touch == inputObject then - return - end - end - currentJumpTouch = inputObject - jumpButton.ImageRectOffset = Vector2.new(0, 222) - jumpButton.ImageRectSize = Vector2.new(174, 174) - return 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) - if inputObject == currentJumpTouch then - table.insert(oldJumpTouches, currentJumpTouch) - currentJumpTouch = nil - end - end) - userInputService.InputEnded:connect(function(globalInputObject) - for i, touch in pairs(oldJumpTouches) do - if touch == globalInputObject then - table.remove(oldJumpTouches, i) - break - end - end - end) - userInputService.Changed:connect(function(prop) - if prop == "ModalEnabled" then - jumpButton.Visible = not userInputService.ModalEnabled - end - end) - jumpButton.Parent = parentFrame -end -local isTouchUsedByJumpButton -isTouchUsedByJumpButton = function(touch) - if touch == currentJumpTouch then - return true - end - for _, touchToCompare in pairs(oldJumpTouches) do - if touch == touchToCompare then - return true - end - end - return false -end -local isTouchUsedByThumbstick -isTouchUsedByThumbstick = function(touch) - for _, touchToCompare in pairs(thumbstickTouches) do - if touch == touchToCompare then - return true - end - end - return false -end -local setupCameraControl -setupCameraControl = function(parentFrame, refreshCharacterMoveFunc) - local lastPos - local hasRotatedCamera = false - local rotateCameraFunc = userInputService.RotateCamera - local pinchTime = -1 - local shouldPinch = false - local lastPinchScale - local zoomCameraFunc = userInputService.ZoomCamera - local pinchTouches = { } - local pinchFrame - local resetCameraRotateState - resetCameraRotateState = function() - cameraTouch = nil - hasRotatedCamera = false - lastPos = nil - end - local resetPinchState - resetPinchState = function() - pinchTouches = { } - lastPinchScale = nil - shouldPinch = false - pinchFrame:Destroy() - pinchFrame = nil - end - local startPinch - startPinch = function(firstTouch, secondTouch) - if pinchFrame ~= nil then - pinchFrame:Destroy() - end - pinchFrame = New("Frame", { - Name = "PinchFrame", - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 1, 0), - Parent = parentFrame - }) - pinchFrame.InputChanged:connect(function(inputObject) - if not shouldPinch then - resetPinchState() - return - end - resetCameraRotateState() - if not (lastPinchScale ~= nil) then - if inputObject == firstTouch then - lastPinchScale = (inputObject.Position - secondTouch.Position).magnitude - firstTouch = inputObject - elseif inputObject == secondTouch then - lastPinchScale = (inputObject.Position - firstTouch.Position).magnitude - secondTouch = inputObject - end - else - local newPinchDistance = 0 - if inputObject == firstTouch then - newPinchDistance = (inputObject.Position - secondTouch.Position).magnitude - firstTouch = inputObject - elseif inputObject == secondTouch then - newPinchDistance = (inputObject.Position - firstTouch.Position).magnitude - secondTouch = inputObject - end - if newPinchDistance ~= 0 then - local pinchDiff = newPinchDistance - lastPinchScale - if pinchDiff ~= 0 then - zoomCameraFunc(userInputService, (pinchDiff * CameraZoomSensitivity)) - end - lastPinchScale = newPinchDistance - end - end - end) - return pinchFrame.InputEnded:connect(function(inputObject) - if inputObject == firstTouch or inputObject == secondTouch then - return resetPinchState() - end - end) - end - local pinchGestureReceivedTouch - pinchGestureReceivedTouch = function(inputObject) - 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) - return startPinch(pinchTouches[1], pinchTouches[2]) - else - pinchTouches = { } - end - end - 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 - pinchGestureReceivedTouch(inputObject) - end - if not (cameraTouch ~= nil) and not usedByThumbstick then - cameraTouch = inputObject - lastPos = Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y) - end - 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 touchDiff = (lastPos - newPos) * CameraRotateSensitivity - if not hasRotatedCamera and (touchDiff.magnitude > CameraRotateDeadZone) then - hasRotatedCamera = true - lastPos = newPos - end - if hasRotatedCamera and (lastPos ~= newPos) then - rotateCameraFunc(userInputService, touchDiff) - refreshCharacterMoveFunc() - lastPos = newPos - end - end) - return userInputService.InputEnded:connect(function(inputObject) - if cameraTouch == inputObject or not (cameraTouch ~= nil) then - resetCameraRotateState() - end - for i, touch in pairs(pinchTouches) do - if touch == inputObject then - table.remove(pinchTouches, i) - end - end - end) -end -local setupTouchControls -setupTouchControls = function() - local touchControlFrame = New("Frame", "TouchControlFrame", { - Size = UDim2.new(1, 0, 1, 0), - BackgroundTransparency = 1, - Parent = Game.CoreGui.RobloxGui - }) - local refreshCharacterMoveFunc = setupCharacterMovement(touchControlFrame) - setupJumpButton(touchControlFrame) - setupCameraControl(touchControlFrame, refreshCharacterMoveFunc) - return userInputService.ProcessedEvent:connect(function(inputObject, processed) - if not processed then - return - end - if inputObject == cameraTouch and inputObject.UserInputState == Enum.UserInputState.Begin then - cameraTouch = nil - end - end) -end -return setupTouchControls() +print'[Mercury]: Loaded corescript 153556783'local a a=function(b,c,d)if not(d~= +nil)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for +g,h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h +end elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e. +Parent=f return e end while not Game do wait()end while not Game:FindFirstChild +'Players'do wait()end while not Game.Players.LocalPlayer do wait()end while not +Game:FindFirstChild'CoreGui'do wait()end while not Game.CoreGui:FindFirstChild +'RobloxGui'do wait()end local b=Game:GetService'UserInputService'local c=pcall( +function()return b:IsLuaTouchControls()end)if not c then script:Destroy()end +local d,e=Game:GetService'GuiService':GetScreenResolution(),nil e=function() +return d.y<=320 end local f,g=Game.Players.LocalPlayer,120 if e()then g=70 end +local h,i,j,k,l='rbxasset://textures/ui/TouchControlsSheet.png',5,0.92,{},90 if +e()then l=70 end local m,n,o={},nil,0.007 local p,q,r,s=o*16,0.03,0.2,nil Game: +GetService'ContentProvider':Preload(h)local t t=function(u,v)local w,x=v.x-u.x,v +.y-u.y return math.sqrt(w*w+x*x)end local u u=function(v,w)return UDim2.new(0,v. +x-w.AbsoluteSize.x/2,0,v.y-w.AbsoluteSize.y/2)end local v v=function(w,x,y)local +z,A,B=math.sin(y),math.cos(y),w B=Vector2.new(B.x-x.x,B.y-x.y)local C,D=B.x*A-B. +y*z,B.x*z+B.y*A B=Vector2.new(C+x.x,D+x.y)return B end local w w=function(x,y) +return x.x*y.x+x.y*y.y end local x x=function(y,z,A)local B=Vector2.new(z. +Position.X.Offset+z.AbsoluteSize.x/2,z.Position.Y.Offset+z.AbsoluteSize.y/2) +local C=t(A,B)if C>(g/2)then local D=Vector2.new(A.x-B.x,A.y-B.y)local E=D.unit +if E.x==math.nan or E.x==math.inf then E=Vector2.new(0,E.y)end if E.y==math.nan +or E.y==math.inf then E=Vector2.new(E.x,0)end local F=B+(E*(g/2))y.Position=u(F, +y)else y.Position=u(A,y)end return Vector2.new(y.Position.X.Offset-z.Position.X. +Offset,y.Position.Y.Offset-z.Position.Y.Offset)end local y y=function(z,A,B) +local C=Vector2.new(A.Position.X.Offset+A.AbsoluteSize.x/2,A.Position.Y.Offset+A +.AbsoluteSize.y/2)if t(B,C)>g/2 then local D=Vector2.new(z.Position.X.Offset+z. +AbsoluteSize.x/2,z.Position.Y.Offset+z.AbsoluteSize.y/2)local E,F=Vector2.new(B. +x-D.x,B.y-D.y).unit,Vector2.new(D.x-C.x,D.y-C.y)local G,H=F.unit,Vector2.new(B.x +-D.x,B.y-D.y)local I=(G.x*E.y)-(G.y*E.x)local J=math.atan2(I,w(G,E))local K=J* +math.min(H.magnitude/F.magnitude,1)if math.abs(K)>0.00001 then local L=v(C,D,K)A +.Position=u(Vector2.new(L.x,L.y),A)end A.Position=UDim2.new(0,A.Position.X. +Offset+H.x,0,A.Position.Y.Offset+H.y)end z.Position=u(B,z)local D,E=Vector2.new( +z.Position.X.Offset,z.Position.Y.Offset),Vector2.new(A.Position.X.Offset,A. +Position.Y.Offset)if t(D,E)>g/2 then local F=(E-D).unit*g/2 A.Position=UDim2. +new(0,D.x+F.x,0,D.y+F.y)end return Vector2.new(z.Position.X.Offset-A.Position.X. +Offset,z.Position.Y.Offset-A.Position.Y.Offset)end local z z=function(A)return( +math.abs(A.x)>i)or(math.abs(A.y)>i)end local A A=function(B,C,D)local E=a( +'Frame','ThumbstickFrame',{Active=true,Size=UDim2.new(0,g,0,g),Position=B, +BackgroundTransparency=1})a('ImageLabel','InnerThumbstick',{Image=h, +ImageRectOffset=Vector2.new(220,0),ImageRectSize=Vector2.new(111,111), +BackgroundTransparency=1,Size=UDim2.new(0,g/2,0,g/2),Position=UDim2.new(0,E.Size +.X.Offset/2-g/4,0,E.Size.Y.Offset/2-g/4),ZIndex=2,Parent=E})local F,G,H,I,J=a( +'ImageLabel','OuterThumbstick',{Image=h,ImageRectOffset=Vector2.new(0,0), +ImageRectSize=Vector2.new(220,220),BackgroundTransparency=1,Size=UDim2.new(0,g,0 +,g),Position=B,Parent=Game.CoreGui.RobloxGui}),nil,nil,nil,nil J=function(K)if G +then return end if K==s then return end if K==n then return end if K. +UserInputType~=Enum.UserInputType.Touch then return end G=K table.insert(k,G)E. +Position=u(G.Position,E)F.Position=E.Position H=b.TouchMoved:connect(function(L) +if L==G then local M if D then M=x(E,F,Vector2.new(L.Position.x,L.Position.y)) +else M=y(E,F,Vector2.new(L.Position.x,L.Position.y))end if C then return C(M,F. +Size.X.Offset/2)end end end)I=b.TouchEnded:connect(function(L)if L==G then if C +then C(Vector2.new(0,0),1)end I:disconnect()H:disconnect()E.Position=B F. +Position=B for M,N in pairs(k)do if N==G then table.remove(k,M)break end end G= +nil end end)end b.Changed:connect(function(K)if K=='ModalEnabled'then do local L +=not b.ModalEnabled E.Visible=L F.Visible=L end end end)E.InputBegan:connect(J) +return E end local B B=function(C)local D,E,F,G=nil,nil,f.MoveCharacter,nil G= +function(H,I)if f then if z(H)then D=H E=I if H.magnitude/I>j then I=H.magnitude +-1 end return F(f,H,I)else D=Vector2.new(0,0)E=1 return F(f,D,E)end end end +local H=UDim2.new(0,g/2,1,-g*1.75)if e()then H=UDim2.new(0,(g/2)-10,1,-g-20)end +local I=A(H,G,false)I.Name='CharacterThumbstick'I.Parent=C local J J=function() +if f and F and D and E then return F(f,D,E)end end return J end local C C= +function(D)local E,F,G=a('ImageButton','JumpButton',{BackgroundTransparency=1, +Image=h,ImageRectOffset=Vector2.new(176,222),ImageRectSize=Vector2.new(174,174), +Size=UDim2.new(0,l,0,l),Position=UDim2.new(1,(function()if e()then return-(l* +2.25),1,-l-20 else return-(l*2.75),1,-l-120 end end)())}),f.JumpCharacter,nil G= +function()while n do if f then F(f)end wait(1.6666666666666665E-2)end end E. +InputBegan:connect(function(H)if H.UserInputType~=Enum.UserInputType.Touch then +return end if n then return end if H==s then return end for I,J in pairs(m)do if +J==H then return end end n=H E.ImageRectOffset=Vector2.new(0,222)E.ImageRectSize +=Vector2.new(174,174)return G()end)E.InputEnded:connect(function(H)if H. +UserInputType~=Enum.UserInputType.Touch then return end E.ImageRectOffset= +Vector2.new(176,222)E.ImageRectSize=Vector2.new(174,174)if H==n then table. +insert(m,n)n=nil end end)b.InputEnded:connect(function(H)for I,J in pairs(m)do +if J==H then table.remove(m,I)break end end end)b.Changed:connect(function(H)if +H=='ModalEnabled'then E.Visible=not b.ModalEnabled end end)E.Parent=D end local +D D=function(E)if E==n then return true end for F,G in pairs(m)do if E==G then +return true end end return false end local E E=function(F)for G,H in pairs(k)do +if F==H then return true end end return false end local F F=function(G,H)local I +,J,K,L,M,N,O,P,Q,R=nil,false,b.RotateCamera,-1,false,nil,b.ZoomCamera,{},nil,nil +R=function()s=nil J=false I=nil end local S S=function()P={}N=nil M=false Q: +Destroy()Q=nil end local T T=function(U,V)if Q~=nil then Q:Destroy()end Q=a( +'Frame',{Name='PinchFrame',BackgroundTransparency=1,Size=UDim2.new(1,0,1,0), +Parent=G})Q.InputChanged:connect(function(W)if not M then S()return end R()if +not(N~=nil)then if W==U then N=(W.Position-V.Position).magnitude U=W elseif W==V +then N=(W.Position-U.Position).magnitude V=W end else local X=0 if W==U then X=( +W.Position-V.Position).magnitude U=W elseif W==V then X=(W.Position-U.Position). +magnitude V=W end if X~=0 then local Y=X-N if Y~=0 then O(b,(Y*q))end N=X end +end end)return Q.InputEnded:connect(function(W)if W==U or W==V then return S() +end end)end local U U=function(V)if#P<1 then table.insert(P,V)L=tick()M=false +elseif#P==1 then M=((tick()-L)<=r)if M then table.insert(P,V)return T(P[1],P[2]) +else P={}end end end G.InputBegan:connect(function(V)if V.UserInputType~=Enum. +UserInputType.Touch then return end if D(V)then return end local W=E(V)if not W +then U(V)end if not(s~=nil)and not W then s=V I=Vector2.new(s.Position.x,s. +Position.y)end end)b.InputChanged:connect(function(V)if V.UserInputType~=Enum. +UserInputType.Touch then return end if s~=V then return end local W=Vector2.new( +s.Position.x,s.Position.y)local X=(I-W)*o if not J and(X.magnitude>p)then J=true +I=W end if J and(I~=W)then K(b,X)H()I=W end end)return b.InputEnded:connect( +function(V)if s==V or not(s~=nil)then R()end for W,X in pairs(P)do if X==V then +table.remove(P,W)end end end)end local G G=function()local H=a('Frame', +'TouchControlFrame',{Size=UDim2.new(1,0,1,0),BackgroundTransparency=1,Parent= +Game.CoreGui.RobloxGui})local I=B(H)C(H)F(H,I)return b.ProcessedEvent:connect( +function(J,K)if not K then return end if J==s and J.UserInputState==Enum. +UserInputState.Begin then s=nil end end)end return G() \ No newline at end of file diff --git a/processed/157877000.lua b/processed/157877000.lua index 6d4b7fa..a38f528 100644 --- a/processed/157877000.lua +++ b/processed/157877000.lua @@ -1,835 +1,202 @@ -print("[Mercury]: Loaded corescript 157877000") -local Create = assert(LoadLibrary("RbxUtility")).Create -local gui = script.Parent:FindFirstChild("ControlFrame") or script.Parent -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 devConsoleInitialized = false -local initializeDeveloperConsole -initializeDeveloperConsole = function() - if devConsoleInitialized then - return - end - devConsoleInitialized = true - local LOCAL_CONSOLE = 1 - local SERVER_CONSOLE = 2 - local MAX_LIST_SIZE = 1000 - local minimumSize = Vector2.new(245, 180) - local currentConsole = LOCAL_CONSOLE - local localMessageList = { } - local serverMessageList = { } - 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 - 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, - 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, - Position = UDim2.new(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), - 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) - }) - 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) - }) - 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, 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) - }) - 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_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) - }) - 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) - }) - 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, - 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_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 - }) - 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, - TextColor3 = Color3.new(1, 1, 1), - Text = "Roblox Developer Console", - TextYAlignment = Enum.TextYAlignment.Top - }) - local previousMousePos - local pPos - local previousMousePosResize - local pSize - local previousMousePosScroll - local pOffset - local scrollUpIsDown = false - local scrollDownIsDown = false - local clean - clean = function() - previousMousePos = nil - pPos = nil - previousMousePosResize = nil - pSize = nil - previousMousePosScroll = nil - pOffset = nil - scrollUpIsDown = false - scrollDownIsDown = false - end - local refreshConsolePosition - refreshConsolePosition = function(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 - Dev_TitleBar.TextButton.MouseButton1Down:connect(function(x, y) - previousMousePos = Vector2.new(x, y) - pPos = Dev_Container.AbsolutePosition - end) - Dev_TitleBar.TextButton.MouseButton1Up:connect(clean) - local refreshConsoleSize - refreshConsoleSize = function(x, y) - 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)) - 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(clean) - Dev_TitleBar.CloseButton.MouseButton1Down:connect(function() - Dev_Container.Visible = false - end) - Dev_Container.TitleBar.CloseButton.MouseButton1Up:connect(clean) - local optionsHidden = true - local animating = false - local startAnimation - startAnimation = function() - if animating then - return - end - animating = true - repeat - frameNumber = frameNumber + (function() - if optionsHidden then - return -1 - else - return 1 - end - 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() - optionsHidden = not optionsHidden - return startAnimation() - end) - local repositionList - repositionList = function() - 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) - 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 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 - offsetRatio = localOffset / Dev_TextHolder.AbsoluteSize.Y - 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 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) - Dev_ScrollArea.Handle.Size = UDim2.new(1, 0, 0, scrollHandleSize) - Dev_ScrollArea.Handle.Position = UDim2.new(0, 0, 0, sPos) - Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize + (function() - if currentConsole == LOCAL_CONSOLE then - return localOffset - elseif currentConsole == SERVER_CONSOLE then - return serverOffset - end - end)()) - end - end - local changeOffset - changeOffset = function(value) - if currentConsole == LOCAL_CONSOLE then - localOffset = localOffset + value - elseif currentConsole == SERVER_CONSOLE then - serverOffset = serverOffset + value - end - return repositionList() - end - local refreshTextHolderForReal - refreshTextHolderForReal = function() - local childMessages = Dev_TextHolder:GetChildren() - local messageList - if currentConsole == LOCAL_CONSOLE then - messageList = localMessageList - 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 - }) - 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 - do - message.TextWrapped = wordWrapToggleOn - message.Size = UDim2.new(0.98, 0, 0, 2000) - message.Parent = Dev_Container - message.Text = tostring(messageList[i].Time) .. " -- " .. tostring(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 - end - if movePosition 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 - message.TextColor3 = Color3.new((function() - if messageList[i].Type == Enum.MessageType.MessageError then - return 1, 0, 0 - elseif messageList[i].Type == Enum.MessageType.MessageInfo then - return 0.4, 0.5, 1 - elseif messageList[i].Type == Enum.MessageType.MessageWarning then - return 1, 0.6, 0.4 - else - return 1, 1, 1 - end - end)()) - end - end - textHolderSize = posOffset - end - local refreshQueued = false - local refreshTextHolder - refreshTextHolder = function() - if refreshQueued then - return - end - Delay(0.1, function() - refreshQueued = false - return refreshTextHolderForReal() - end) - refreshQueued = true - end - local inside = 0 - local holdingUpButton - holdingUpButton = function() - if scrollUpIsDown then - return - end - scrollUpIsDown = true - wait(0.6) - inside = inside + 1 - while scrollUpIsDown and inside < 2 do - wait() - changeOffset(12) - end - inside = inside - 1 - end - local holdingDownButton - holdingDownButton = function() - if scrollDownIsDown then - return - end - scrollDownIsDown = true - wait(0.6) - inside = inside + 1 - while scrollDownIsDown and inside < 2 do - wait() - changeOffset(-12) - end - inside = inside - 1 - end - Dev_Container.Body.ScrollBar.Up.MouseButton1Click:connect(function() - return changeOffset(10) - end) - Dev_Container.Body.ScrollBar.Up.MouseButton1Down:connect(function() - changeOffset(10) - return holdingUpButton() - end) - Dev_Container.Body.ScrollBar.Up.MouseButton1Up:connect(clean) - Dev_Container.Body.ScrollBar.Down.MouseButton1Down:connect(function() - changeOffset(-10) - return holdingDownButton() - end) - Dev_Container.Body.ScrollBar.Down.MouseButton1Up:connect(clean) - local handleScroll - handleScroll = function(x, y) - 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 - localOffset = pOffset - offsetChange - elseif currentConsole == SERVER_CONSOLE then - serverOffset = pOffset - offsetChange - end - end - Dev_ScrollArea.Handle.MouseButton1Down:connect(function(x, y) - previousMousePosScroll = Vector2.new(x, y) - if currentConsole == LOCAL_CONSOLE then - pOffset = localOffset - elseif currentConsole == SERVER_CONSOLE then - pOffset = serverOffset - end - end) - Dev_ScrollArea.Handle.MouseButton1Up:connect(clean) - local existsInsideContainer - existsInsideContainer = function(container, x, y) - local pos = container.AbsolutePosition - local size = container.AbsoluteSize - if x < pos.X or x > pos.X + size.X or y < pos.y or y > pos.y + size.y then - return false - end - return true - end - local numberWithZero - numberWithZero = function(num) - if num < 10 then - return "0" .. tostring(num) - else - return num - end - end - local str = "%s:%s:%s" - local ConvertTimeStamp - ConvertTimeStamp = function(timeStamp) - local localTime = timeStamp - os.time() + math.floor(tick()) - local dayTime = localTime % 86400 - local hour = math.floor(dayTime / 3600) - dayTime = dayTime - (hour * 3600) - local minute = math.floor(dayTime / 60) - dayTime = dayTime - (minute * 60) - local h = numberWithZero(hour) - local m = numberWithZero(minute) - local s = numberWithZero(dayTime) - return str:format(h, m, s) - end - Dev_OptionsBar.ErrorToggleButton.MouseButton1Down:connect(function() - errorToggleOn = not errorToggleOn - Dev_OptionsBar.ErrorToggleButton.CheckFrame.Visible = errorToggleOn - refreshTextHolder() - return repositionList() - end) - Dev_OptionsBar.WarningToggleButton.MouseButton1Down:connect(function() - warningToggleOn = not warningToggleOn - Dev_OptionsBar.WarningToggleButton.CheckFrame.Visible = warningToggleOn - refreshTextHolder() - return repositionList() - end) - Dev_OptionsBar.InfoToggleButton.MouseButton1Down:connect(function() - infoToggleOn = not infoToggleOn - Dev_OptionsBar.InfoToggleButton.CheckFrame.Visible = infoToggleOn - refreshTextHolder() - return repositionList() - end) - Dev_OptionsBar.OutputToggleButton.MouseButton1Down:connect(function() - outputToggleOn = not outputToggleOn - Dev_OptionsBar.OutputToggleButton.CheckFrame.Visible = outputToggleOn - refreshTextHolder() - return repositionList() - end) - Dev_OptionsBar.WordWrapToggleButton.MouseButton1Down:connect(function() - wordWrapToggleOn = not wordWrapToggleOn - Dev_OptionsBar.WordWrapToggleButton.CheckFrame.Visible = wordWrapToggleOn - refreshTextHolder() - return repositionList() - end) - local AddLocalMessage - AddLocalMessage = function(str, messageType, timeStamp) - localMessageList[#localMessageList + 1] = { - Message = str, - Time = ConvertTimeStamp(timeStamp), - Type = messageType - } - while #localMessageList > MAX_LIST_SIZE do - table.remove(localMessageList, 1) - end - refreshTextHolder() - return repositionList() - end - local AddServerMessage - AddServerMessage = function(str, messageType, timeStamp) - serverMessageList[#serverMessageList + 1] = { - Message = str, - Time = ConvertTimeStamp(timeStamp), - Type = messageType - } - while #serverMessageList > MAX_LIST_SIZE do - table.remove(serverMessageList, 1) - end - refreshTextHolder() - return repositionList() - end - Dev_Container.Body.LocalConsole.MouseButton1Click:connect(function() - 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 - local mouse = game.Players.LocalPlayer:GetMouse() - refreshConsolePosition(mouse.X, mouse.Y) - refreshConsoleSize(mouse.X, mouse.Y) - handleScroll(mouse.X, mouse.Y) - end - refreshTextHolder() - return repositionList() - end - end) - Dev_Container.Body.LocalConsole.MouseButton1Up:connect(clean) - local serverHistoryRequested = false - Dev_Container.Body.ServerConsole.MouseButton1Click:connect(function() - if not serverHistoryRequested then - serverHistoryRequested = true - game:GetService("LogService"):RequestServerOutput() - end - 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 - local mouse = game.Players.LocalPlayer:GetMouse() - refreshConsolePosition(mouse.X, mouse.Y) - refreshConsoleSize(mouse.X, mouse.Y) - handleScroll(mouse.X, mouse.Y) - end - refreshTextHolder() - return repositionList() - end - end) - Dev_Container.Body.ServerConsole.MouseButton1Up:connect(clean) - 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() - refreshConsolePosition(mouse.X, mouse.Y) - refreshConsoleSize(mouse.X, mouse.Y) - handleScroll(mouse.X, mouse.Y) - refreshTextHolder() - return repositionList() - end) - LocalMouse.Button1Up:connect(clean) - LocalMouse.WheelForward:connect(function() - if not Dev_Container.Visible then - return - end - if existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) then - return changeOffset(10) - end - end) - LocalMouse.WheelBackward:connect(function() - if not Dev_Container.Visible then - return - end - if existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) then - return changeOffset(-10) - end - end) - end - Dev_ScrollArea.Handle.MouseButton1Down:connect(function() - return repositionList() - end) - local history = game:GetService("LogService"):GetLogHistory() - for i = 1, #history do - AddLocalMessage(history[i].message, history[i].messageType, history[i].timestamp) - end - local _with_0 = game:GetService("LogService") - _with_0.MessageOut:connect(function(message, messageType) - return AddLocalMessage(message, messageType, os.time()) - end) - _with_0.ServerMessageOut:connect(AddServerMessage) - return _with_0 -end -local currentlyToggling = false -ToggleConsole.OnInvoke = function() - if currentlyToggling then - return - end - currentlyToggling = true - initializeDeveloperConsole() - Dev_Container.Visible = not Dev_Container.Visible - currentlyToggling = false -end +print'[Mercury]: Loaded corescript 157877000'local a,b=assert(LoadLibrary +'RbxUtility').Create,script.Parent:FindFirstChild'ControlFrame'or script.Parent +local c,d,e,f=a'Frame'{Name='DevConsoleContainer',Parent=b,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},a'BindableFunction'{Name= +'ToggleDevConsole',Parent=b},false,nil f=function()if e then return end e=true +local g,h,i,j=1,2,1000,Vector2.new(245,180)local k,l,m,n,o,p,q,r,s,t,u,v,w=g,{}, +{},0,0,true,true,true,true,false,0,0,a'Frame'{Name='Body',Parent=c, +BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position=UDim2. +new(0,0,0,21),Size=UDim2.new(1,0,1,-25)}local x=a'Frame'{Name='OptionsHolder', +Parent=w,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 y=a +'Frame'{Name='OptionsBar',Parent=x,BackgroundColor3=Color3.new(0,0,0), +BackgroundTransparency=1,Position=UDim2.new(0,-250,0,4),Size=UDim2.new(0,234,0, +18)}local z=a'TextButton'{Name='ErrorToggleButton',Parent=y,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)}a'Frame'{Name='CheckFrame',Parent=z, +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)}local A=a'TextButton'{Name= +'InfoToggleButton',Parent=y,BackgroundColor3=Color3.new(0,0,0),BorderColor3= +Color3.new(0.4,0.5,1),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)}a'Frame'{Name='CheckFrame',Parent=A,BackgroundColor3=Color3.new( +0.4,0.5,1),BorderColor3=Color3.new(0.4,0.5,1),Position=UDim2.new(0,4,0,4),Size= +UDim2.new(0,10,0,10)}local B=a'TextButton'{Name='OutputToggleButton',Parent=y, +BackgroundColor3=Color3.new(0,0,0),BorderColor3=Color3.new(1,1,1),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)}a'Frame'{Name='CheckFrame', +Parent=B,BackgroundColor3=Color3.new(1,1,1),BorderColor3=Color3.new(1,1,1), +Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,10,0,10)}local C=a'TextButton'{Name +='WarningToggleButton',Parent=y,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)}a'Frame'{Name='CheckFrame',Parent=C,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)}local D=a'TextButton'{Name='WordWrapToggleButton',Parent=y, +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)}a'Frame'{Name= +'CheckFrame',Parent=D,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}a'TextLabel'{Name='Filter',Parent=y,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)}a +'TextLabel'{Name='WordWrap',Parent=y,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 E=a'Frame'{ +Name='ScrollBar',Parent=w,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}local F=a'Frame'{Name='ScrollArea',Parent=E, +BackgroundTransparency=1,Position=UDim2.new(0,0,0,23),Size=UDim2.new(1,0,1,-46)} +local G=a'ImageButton'{Name='Handle',Parent=F,BackgroundColor3=Color3.new(0,0,0) +,BackgroundTransparency=0.5,Position=UDim2.new(0,0,0.2,0),Size=UDim2.new(0,20,0, +40)}a'ImageLabel'{Name='ImageLabel',Parent=G,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 H=a'ImageButton'{Name='Down', +Parent=E,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position= +UDim2.new(0,0,1,-20),Size=UDim2.new(0,20,0,20)}a'ImageLabel'{Name='ImageLabel', +Parent=H,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 I=a +'ImageButton'{Name='Up',Parent=E,BackgroundColor3=Color3.new(0,0,0), +BackgroundTransparency=0.5,Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,20,0,20) +}a'ImageLabel'{Name='ImageLabel',Parent=I,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 J=a'Frame'{Name='TextBox', +Parent=w,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 K,L=a +'Frame'{Name='TextHolder',Parent=J,BackgroundTransparency=1,Position=UDim2.new(0 +,0,0,0),Size=UDim2.new(1,0,1,0)},a'ImageButton'{Name='OptionsButton',Parent=w, +BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,Position=UDim2.new(0 +,200,0,2),Size=UDim2.new(0,20,0,20)}a'ImageLabel'{Name='ImageLabel',Parent=L, +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 M=a +'ImageButton'{Name='ResizeButton',Parent=w,BackgroundColor3=Color3.new(0,0,0), +BackgroundTransparency=0.5,Position=UDim2.new(1,-20,1,-20),Size=UDim2.new(0,20,0 +,20)}a'ImageLabel'{Name='ImageLabel',Parent=M,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'}a'TextButton'{Name='LocalConsole', +Parent=w,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}a'TextButton'{Name='ServerConsole', +Parent=w,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 N=a'Frame'{Name='TitleBar', +Parent=c,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position= +UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0,20)}local O=a'ImageButton'{Name= +'CloseButton',Parent=N,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency +=0.5,Position=UDim2.new(1,-20,0,0),Size=UDim2.new(0,20,0,20)}a'ImageLabel'{ +Parent=O,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'}a'TextButton'{Name='TextButton', +Parent=N,BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,Position= +UDim2.new(0,0,0,0),Size=UDim2.new(1,-23,1,0),Text=''}a'TextLabel'{Name= +'TitleText',Parent=N,BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size= +UDim2.new(0,185,0,20),Font='SourceSansBold',FontSize=Enum.FontSize.Size18, +TextColor3=Color3.new(1,1,1),Text='Roblox Developer Console',TextYAlignment=Enum +.TextYAlignment.Top}local P,Q,R,S,T,U,V,W,X=nil,nil,nil,nil,nil,nil,false,false, +nil X=function()P=nil Q=nil R=nil S=nil T=nil U=nil V=false W=false end local Y +Y=function(Z,_)if not P then return end local aa=Vector2.new(Z,_-P)c.Position= +UDim2.new(0,Q.X+aa.X,0,Q.Y+aa.Y)end N.TextButton.MouseButton1Down:connect( +function(aa,Z)P=Vector2.new(aa,Z)Q=c.AbsolutePosition end)N.TextButton. +MouseButton1Up:connect(X)local aa aa=function(Z,_)if not R then return end local +ab=Vector2.new(Z,_-R)c.Size=UDim2.new(0,math.max(S.X+ab.X,j.X),0,math.max(S.Y+ab +.Y,j.Y))end c.Body.ResizeButton.MouseButton1Down:connect(function(ab,Z)R=Vector2 +.new(ab,Z)S=c.AbsoluteSize end)c.Body.ResizeButton.MouseButton1Up:connect(X)N. +CloseButton.MouseButton1Down:connect(function()c.Visible=false end)c.TitleBar. +CloseButton.MouseButton1Up:connect(X)local ab,Z,_=true,false,nil _=function()if +Z then return end Z=true repeat v=v+(function()if ab then return-1 else return 1 +end end)()local ac=v/5 local ad=ac*ac*(3-(2*ac))L.ImageLabel.Rotation=ad*5*9 y. +Position=UDim2.new(0,(ad*5*50)-250,0,4)wait()if(v<=0 and ab)or(v>=5 and not ab) +then Z=false end until not Z end L.MouseButton1Down:connect(function()ab=not ab +return _()end)local ac ac=function()if k==g then n=math.min(math.max(n,0),u-c. +Body.TextBox.AbsoluteSize.Y)K.Size=UDim2.new(1,0,0,u)elseif k==h then o=math. +min(math.max(o,0),u-c.Body.TextBox.AbsoluteSize.Y)K.Size=UDim2.new(1,0,0,u)end +local ad=c.Body.TextBox.AbsoluteSize.Y/K.AbsoluteSize.Y if ad>=1 then c.Body. +ScrollBar.Visible=false c.Body.TextBox.Size=UDim2.new(1,-4,1,-28)if k==g or k==h +then K.Position=UDim2.new(0,0,1,0-u)end else c.Body.ScrollBar.Visible=true c. +Body.TextBox.Size=UDim2.new(1,-25,1,-28)local ae,af=1-ad,nil if k==g then af=n/K +.AbsoluteSize.Y elseif k==h then af=o/K.AbsoluteSize.Y end local ag,ah=math.max( +0,ae-af),math.max(F.AbsoluteSize.Y*ad,21)local ai=ah/F.AbsoluteSize.Y local aj=( +1-ai)/(1-ad)local ak=ag*aj local al=math.min(F.AbsoluteSize.Y*ak,F.AbsoluteSize. +Y-ah)F.Handle.Size=UDim2.new(1,0,0,ah)F.Handle.Position=UDim2.new(0,0,0,al)K. +Position=UDim2.new(0,0,1,0-u+(function()if k==g then return n elseif k==h then +return o end end)())end end local ad ad=function(ae)if k==g then n=n+ae elseif k +==h then o=o+ae end return ac()end local ae ae=function()local af,ag=K: +GetChildren(),nil if k==g then ag=l elseif k==h then ag=m end local ah=0 for ai= +1,#af do af[ai].Visible=false end for ai=1,#ag do local aj,ak=nil,false if ai># +af then aj=a'TextLabel'{Name='Message',Parent=K,BackgroundTransparency=1, +TextXAlignment='Left',Size=UDim2.new(1,0,0,14),FontSize='Size10',ZIndex=1}ak= +true else aj=af[ai]end if(s or ag[ai].Type~=Enum.MessageType.MessageOutput)and(r +or ag[ai].Type~=Enum.MessageType.MessageInfo)and(q or ag[ai].Type~=Enum. +MessageType.MessageWarning)and(p or ag[ai].Type~=Enum.MessageType.MessageError) +then do aj.TextWrapped=t aj.Size=UDim2.new(0.98,0,0,2000)aj.Parent=c aj.Text= +tostring(ag[ai].Time)..' -- '..tostring(ag[ai].Message)aj.Size=UDim2.new(0.98,0, +0,aj.TextBounds.Y)aj.Position=UDim2.new(0,5,0,ah)aj.Parent=K ah=ah+aj.TextBounds +.Y end if ak then if(k==g and n>0)or(k==h and o>0)then ad(aj.TextBounds.Y)end +end aj.Visible=true aj.TextColor3=Color3.new((function()if ag[ai].Type==Enum. +MessageType.MessageError then return 1,0,0 elseif ag[ai].Type==Enum.MessageType. +MessageInfo then return 0.4,0.5,1 elseif ag[ai].Type==Enum.MessageType. +MessageWarning then return 1,0.6,0.4 else return 1,1,1 end end)())end end u=ah +end local af,ag=false,nil ag=function()if af then return end Delay(0.1,function( +)af=false return ae()end)af=true end local ah,ai=0,nil ai=function()if V then +return end V=true wait(0.6)ah=ah+1 while V and ah<2 do wait()ad(12)end ah=ah-1 +end local aj aj=function()if W then return end W=true wait(0.6)ah=ah+1 while W +and ah<2 do wait()ad(-12)end ah=ah-1 end c.Body.ScrollBar.Up.MouseButton1Click: +connect(function()return ad(10)end)c.Body.ScrollBar.Up.MouseButton1Down:connect( +function()ad(10)return ai()end)c.Body.ScrollBar.Up.MouseButton1Up:connect(X)c. +Body.ScrollBar.Down.MouseButton1Down:connect(function()ad(-10)return aj()end)c. +Body.ScrollBar.Down.MouseButton1Up:connect(X)local ak ak=function(al,am)if not T +then return end local an,ao,ap=(Vector2.new(al,am-T)).Y,1-(c.Body.TextBox. +AbsoluteSize.Y/K.AbsoluteSize.Y),F.AbsoluteSize.Y-F.Handle.AbsoluteSize.Y local +aq=math.max(math.min(an,ap),0-ap)local ar,as=aq/ap,(ao*K.AbsoluteSize.Y)local at +=as*ar if k==g then n=U-at elseif k==h then o=U-at end end F.Handle. +MouseButton1Down:connect(function(al,am)T=Vector2.new(al,am)if k==g then U=n +elseif k==h then U=o end end)F.Handle.MouseButton1Up:connect(X)local al al= +function(am,an,ao)local ap,aq=am.AbsolutePosition,am.AbsoluteSize if anap.X+aq.X or aoap.y+aq.y then return false end return true end +local am am=function(an)if an<10 then return'0'..tostring(an)else return an end +end local an,ao='%s:%s:%s',nil ao=function(ap)local aq=ap-os.time()+math.floor( +tick())local ar=aq%86400 local as=math.floor(ar/3600)ar=ar-(as*3600)local at= +math.floor(ar/60)ar=ar-(at*60)local au,av,aw=am(as),am(at),am(ar)return an: +format(au,av,aw)end y.ErrorToggleButton.MouseButton1Down:connect(function()p=not +p y.ErrorToggleButton.CheckFrame.Visible=p ag()return ac()end)y. +WarningToggleButton.MouseButton1Down:connect(function()q=not q y. +WarningToggleButton.CheckFrame.Visible=q ag()return ac()end)y.InfoToggleButton. +MouseButton1Down:connect(function()r=not r y.InfoToggleButton.CheckFrame.Visible +=r ag()return ac()end)y.OutputToggleButton.MouseButton1Down:connect(function()s= +not s y.OutputToggleButton.CheckFrame.Visible=s ag()return ac()end)y. +WordWrapToggleButton.MouseButton1Down:connect(function()t=not t y. +WordWrapToggleButton.CheckFrame.Visible=t ag()return ac()end)local ap ap= +function(aq,ar,as)l[#l+1]={Message=aq,Time=ao(as),Type=ar}while#l>i do table. +remove(l,1)end ag()return ac()end local aq aq=function(ar,as,at)m[#m+1]={Message +=ar,Time=ao(at),Type=as}while#m>i do table.remove(m,1)end ag()return ac()end c. +Body.LocalConsole.MouseButton1Click:connect(function()if k==h then k=g local ar, +as=c.Body.LocalConsole,c.Body.ServerConsole ar.Size=UDim2.new(0,90,0,20)as.Size= +UDim2.new(0,90,0,17)ar.BackgroundTransparency=0.6 as.BackgroundTransparency=0.8 +if game:FindFirstChild'Players'and game.Players['LocalPlayer']then local at=game +.Players.LocalPlayer:GetMouse()Y(at.X,at.Y)aa(at.X,at.Y)ak(at.X,at.Y)end ag() +return ac()end end)c.Body.LocalConsole.MouseButton1Up:connect(X)local ar=false c +.Body.ServerConsole.MouseButton1Click:connect(function()if not ar then ar=true +game:GetService'LogService':RequestServerOutput()end if k==g then k=h local as, +at=c.Body.LocalConsole,c.Body.ServerConsole at.Size=UDim2.new(0,90,0,20)as.Size= +UDim2.new(0,90,0,17)at.BackgroundTransparency=0.6 as.BackgroundTransparency=0.8 +if game:FindFirstChild'Players'and game.Players['LocalPlayer']then local au=game +.Players.LocalPlayer:GetMouse()Y(au.X,au.Y)aa(au.X,au.Y)ak(au.X,au.Y)end ag() +return ac()end end)c.Body.ServerConsole.MouseButton1Up:connect(X)if game: +FindFirstChild'Players'and game.Players['LocalPlayer']then local as=game.Players +.LocalPlayer:GetMouse()as.Move:connect(function()if not c.Visible then return +end local at=game.Players.LocalPlayer:GetMouse()Y(at.X,at.Y)aa(at.X,at.Y)ak(at.X +,at.Y)ag()return ac()end)as.Button1Up:connect(X)as.WheelForward:connect(function +()if not c.Visible then return end if al(c,as.X,as.Y)then return ad(10)end end) +as.WheelBackward:connect(function()if not c.Visible then return end if al(c,as.X +,as.Y)then return ad(-10)end end)end F.Handle.MouseButton1Down:connect(function( +)return ac()end)local as=game:GetService'LogService':GetLogHistory()for at=1,#as +do ap(as[at].message,as[at].messageType,as[at].timestamp)end local at=game: +GetService'LogService'at.MessageOut:connect(function(au,av)return ap(au,av,os. +time())end)at.ServerMessageOut:connect(aq)return at end local aa=false d. +OnInvoke=function()if aa then return end aa=true f()c.Visible=not c.Visible aa= +false end \ No newline at end of file diff --git a/processed/36868950.lua b/processed/36868950.lua index cde05e6..d70d1d9 100644 --- a/processed/36868950.lua +++ b/processed/36868950.lua @@ -1,127 +1,28 @@ -print("[Mercury]: Loaded corescript 36868950") -local controlFrame = script.Parent:FindFirstChild("ControlFrame") -if not controlFrame then - return -end -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local bottomLeftControl = controlFrame:FindFirstChild("BottomLeftControl") -local bottomRightControl = controlFrame:FindFirstChild("BottomRightControl") -local frameTip = New("TextLabel", "ToolTip", { - Text = "", - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size12, - TextColor3 = Color3.new(1, 1, 1), - BorderSizePixel = 0, - ZIndex = 10, - Size = UDim2.new(2, 0, 1, 0), - Position = UDim2.new(1, 0, 0, 0), - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 1, - TextTransparency = 1, - TextWrap = true, - New("BoolValue", "inside", { - Value = false - }) -}) -local setUpListeners -setUpListeners = function(frameToListen) - local fadeSpeed = 0.1 - frameToListen.Parent.MouseEnter:connect(function() - if frameToListen:FindFirstChild("inside") then - frameToListen.inside.Value = true - wait(1.2) - if frameToListen.inside.Value then - while frameToListen.inside.Value and frameToListen.BackgroundTransparency > 0 do - frameToListen.BackgroundTransparency = frameToListen.BackgroundTransparency - fadeSpeed - frameToListen.TextTransparency = frameToListen.TextTransparency - fadeSpeed - wait() - end - end - end - end) - local killTip - killTip = function(killFrame) - killFrame.inside.Value = false - killFrame.BackgroundTransparency = 1 - killFrame.TextTransparency = 1 - end - frameToListen.Parent.MouseLeave:connect(function() - return killTip(frameToListen) - end) - return frameToListen.Parent.MouseButton1Click:connect(function() - return killTip(frameToListen) - end) -end -local createSettingsButtonTip -createSettingsButtonTip = function(parent) - if not (parent ~= nil) then - 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) - return toolTip -end -wait(5) -local bottomLeftChildren = bottomLeftControl:GetChildren() -for i = 1, #bottomLeftChildren do - if bottomLeftChildren[i].Name == "Exit" then - do - 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) - end - elseif bottomLeftChildren[i].Name == "SettingsButton" then - createSettingsButtonTip(bottomLeftChildren[i]) - end -end -local bottomRightChildren = bottomRightControl:GetChildren() -for i = 1, #bottomRightChildren do - if (bottomRightChildren[i].Name:find("Camera") ~= nil) then - do - 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) - else - cameraTip.Position = UDim2.new(0, 0, -1.5, 0) - end - cameraTip.Size = UDim2.new(2, 0, 1.25, 0) - cameraTip.Parent = bottomRightChildren[i] - setUpListeners(cameraTip) - end - end -end +print'[Mercury]: Loaded corescript 36868950'local a=script.Parent:FindFirstChild +'ControlFrame'if not a then return end local b b=function(c,d,e)if not(e~=nil) +then e=d d=nil end local f=Instance.new(c)if d then f.Name=d end local g for h,i +in pairs(e)do if type(h)=='string'then if h=='Parent'then g=i else f[h]=i end +elseif type(h)=='number'and type(i)=='userdata'then i.Parent=f end end f.Parent= +g return f end local c,d,e,f=a:FindFirstChild'BottomLeftControl',a: +FindFirstChild'BottomRightControl',b('TextLabel','ToolTip',{Text='',Font=Enum. +Font.ArialBold,FontSize=Enum.FontSize.Size12,TextColor3=Color3.new(1,1,1), +BorderSizePixel=0,ZIndex=10,Size=UDim2.new(2,0,1,0),Position=UDim2.new(1,0,0,0), +BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,TextTransparency=1, +TextWrap=true,b('BoolValue','inside',{Value=false})}),nil f=function(g)local h= +0.1 g.Parent.MouseEnter:connect(function()if g:FindFirstChild'inside'then g. +inside.Value=true wait(1.2)if g.inside.Value then while g.inside.Value and g. +BackgroundTransparency>0 do g.BackgroundTransparency=g.BackgroundTransparency-h +g.TextTransparency=g.TextTransparency-h wait()end end end end)local i i=function +(j)j.inside.Value=false j.BackgroundTransparency=1 j.TextTransparency=1 end g. +Parent.MouseLeave:connect(function()return i(g)end)return g.Parent. +MouseButton1Click:connect(function()return i(g)end)end local g g=function(h)if +not(h~=nil)then h=c:FindFirstChild'SettingsButton'end local i=e:clone()i. +RobloxLocked=true i.Text='Settings/Leave Game'i.Position=UDim2.new(0,0,0,-18)i. +Size=UDim2.new(0,120,0,20)i.Parent=h f(i)return i end wait(5)local h=c: +GetChildren()for i=1,#h do if h[i].Name=='Exit'then do local j=e:clone()j. +RobloxLocked=true j.Text='Leave Place'j.Position=UDim2.new(0,0,-1,0)j.Size=UDim2 +.new(1,0,1,0)j.Parent=h[i]f(j)end elseif h[i].Name=='SettingsButton'then g(h[i]) +end end local i=d:GetChildren()for j=1,#i do if(i[j].Name:find'Camera'~=nil)then +do local k=e:clone()k.RobloxLocked=true k.Text='Camera View'if i[j].Name:find +'Zoom'then k.Position=UDim2.new(-1,0,-1.5)else k.Position=UDim2.new(0,0,-1.5,0) +end k.Size=UDim2.new(2,0,1.25,0)k.Parent=i[j]f(k)end end end \ No newline at end of file diff --git a/processed/37801172.lua b/processed/37801172.lua index 8595044..bca4389 100644 --- a/processed/37801172.lua +++ b/processed/37801172.lua @@ -1,69 +1,34 @@ -print("[Mercury]: Loaded corescript 37801172") -local scriptContext = game:GetService("ScriptContext") -local touchEnabled = false -pcall(function() - touchEnabled = game:GetService("UserInputService").TouchEnabled -end) -scriptContext:AddCoreScript(60595695, scriptContext, "/Libraries/LibraryRegistration/LibraryRegistration") -local waitForChild -waitForChild = function(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end -end -scriptContext = game:GetService("ScriptContext") -scriptContext:AddCoreScript(59002209, scriptContext, "CoreScripts/Sections") -waitForChild(game:GetService("CoreGui"), "RobloxGui") -local screenGui = game:GetService("CoreGui"):FindFirstChild("RobloxGui") -if not touchEnabled then - scriptContext:AddCoreScript(36868950, screenGui, "CoreScripts/ToolTip") - scriptContext:AddCoreScript(46295863, screenGui, "CoreScripts/Settings") -else - scriptContext:AddCoreScript(153556783, screenGui, "CoreScripts/TouchControls") -end -scriptContext:AddCoreScript(39250920, screenGui, "CoreScripts/MainBotChatScript") -scriptContext:AddCoreScript(48488451, screenGui, "CoreScripts/PopupScript") -scriptContext:AddCoreScript(48488398, screenGui, "CoreScripts/NotificationScript") -scriptContext:AddCoreScript(97188756, screenGui, "CoreScripts/ChatScript") -scriptContext:AddCoreScript(107893730, screenGui, "CoreScripts/PurchasePromptScript") -if not touchEnabled or screenGui.AbsoluteSize.Y > 600 then - scriptContext:AddCoreScript(48488235, screenGui, "CoreScripts/PlayerListScript") -else - delay(5, function() - if screenGui.AbsoluteSize.Y >= 600 then - return scriptContext:AddCoreScript(48488235, screenGui, "CoreScripts/PlayerListScript") - end - end) -end -if game.CoreGui.Version >= 3 and game.PlaceId ~= 130815926 then - scriptContext:AddCoreScript(53878047, screenGui, "CoreScripts/BackpackScripts/BackpackBuilder") - waitForChild(screenGui, "CurrentLoadout") - waitForChild(screenGui, "Backpack") - local Backpack = screenGui.Backpack - if game.CoreGui.Version >= 7 then - scriptContext:AddCoreScript(89449093, Backpack, "CoreScripts/BackpackScripts/BackpackManager") - end - scriptContext:AddCoreScript(89449008, Backpack, "CoreScripts/BackpackScripts/BackpackGear") - scriptContext:AddCoreScript(53878057, screenGui.CurrentLoadout, "CoreScripts/BackpackScripts/LoadoutScript") - if game.CoreGui.Version >= 8 then - scriptContext:AddCoreScript(-1, Backpack, "CoreScripts/BackpackScripts/BackpackWardrobe") - end -end -local IsPersonalServer = not not game.Workspace:FindFirstChild("PSVariable") -if IsPersonalServer then - 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 - return scriptContext:AddCoreScript(64164692, game.Players.LocalPlayer, "BuildToolManager") - end -end) -if touchEnabled then - 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 +print'[Mercury]: Loaded corescript 37801172'local a,b=game:GetService +'ScriptContext',false pcall(function()b=game:GetService'UserInputService'. +TouchEnabled end)a:AddCoreScript(60595695,a, +'/Libraries/LibraryRegistration/LibraryRegistration')local c c=function(d,e) +while not d:FindFirstChild(e)do d.ChildAdded:wait()end end a=game:GetService +'ScriptContext'a:AddCoreScript(59002209,a,'CoreScripts/Sections')c(game: +GetService'CoreGui','RobloxGui')local d=game:GetService'CoreGui':FindFirstChild +'RobloxGui'if not b then a:AddCoreScript(36868950,d,'CoreScripts/ToolTip')a: +AddCoreScript(46295863,d,'CoreScripts/Settings')else a:AddCoreScript(153556783,d +,'CoreScripts/TouchControls')end a:AddCoreScript(39250920,d, +'CoreScripts/MainBotChatScript')a:AddCoreScript(48488451,d, +'CoreScripts/PopupScript')a:AddCoreScript(48488398,d, +'CoreScripts/NotificationScript')a:AddCoreScript(97188756,d, +'CoreScripts/ChatScript')a:AddCoreScript(107893730,d, +'CoreScripts/PurchasePromptScript')if not b or d.AbsoluteSize.Y>600 then a: +AddCoreScript(48488235,d,'CoreScripts/PlayerListScript')else delay(5,function() +if d.AbsoluteSize.Y>=600 then return a:AddCoreScript(48488235,d, +'CoreScripts/PlayerListScript')end end)end if game.CoreGui.Version>=3 and game. +PlaceId~=130815926 then a:AddCoreScript(53878047,d, +'CoreScripts/BackpackScripts/BackpackBuilder')c(d,'CurrentLoadout')c(d, +'Backpack')local e=d.Backpack if game.CoreGui.Version>=7 then a:AddCoreScript( +89449093,e,'CoreScripts/BackpackScripts/BackpackManager')end a:AddCoreScript( +89449008,e,'CoreScripts/BackpackScripts/BackpackGear')a:AddCoreScript(53878057,d +.CurrentLoadout,'CoreScripts/BackpackScripts/LoadoutScript')if game.CoreGui. +Version>=8 then a:AddCoreScript(-1,e, +'CoreScripts/BackpackScripts/BackpackWardrobe')end end local e=not not game. +Workspace:FindFirstChild'PSVariable'if e then a:AddCoreScript(64164692,game. +Players.LocalPlayer,'BuildToolManager')end game.Workspace.ChildAdded:connect( +function(f)if f.Name=='PSVariable'and f:IsA'BoolValue'then e=true return a: +AddCoreScript(64164692,game.Players.LocalPlayer,'BuildToolManager')end end)if b +then a:AddCoreScript(152908679,d,'CoreScripts/ContextActionTouch')c(d, +'ControlFrame')c(d.ControlFrame,'BottomLeftControl')d.ControlFrame. +BottomLeftControl.Visible=false c(d.ControlFrame,'TopLeftControl')d.ControlFrame +.TopLeftControl.Visible=false end \ No newline at end of file diff --git a/processed/38037565.lua b/processed/38037565.lua index 70671de..4749dc7 100644 --- a/processed/38037565.lua +++ b/processed/38037565.lua @@ -1,231 +1,50 @@ -print("[Mercury]: Loaded corescript 38037565") -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local damageGuiWidth = 5.0 -local damageGuiHeight = 5.0 -local waitForChild -waitForChild = function(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 -end -local Figure = script.Parent -local Humanoid = waitForChild(Figure, "Humanoid") -local Torso = waitForChild(Figure, "Torso") -local config = Figure:FindFirstChild("PlayerStats") -local inCharTag = Instance.new("BoolValue") -inCharTag.Name = "InCharTag" -local hider = Instance.new("BoolValue") -hider.Name = "RobloxBuildTool" -if not (config ~= nil) then - config = New("Configuration", "PlayerStats", { - Parent = Figure - }) -end -local myHealth = config:FindFirstChild("MaxHealth") -if not (myHealth ~= nil) then - myHealth = New("NumberValue", "MaxHealth", { - Value = 100, - Parent = config - }) -end -Humanoid.MaxHealth = myHealth.Value -Humanoid.Health = myHealth.Value -local onMaxHealthChange -onMaxHealthChange = function() - Humanoid.MaxHealth = myHealth.Value - Humanoid.Health = myHealth.Value -end -myHealth.Changed:connect(onMaxHealthChange) -local vPlayer = game.Players:GetPlayerFromCharacter(script.Parent) -local dotGui = vPlayer.PlayerGui:FindFirstChild("DamageOverTimeGui") -if not (dotGui ~= nil) then - dotGui = New("BillboardGui", "DamageOverTimeGui", { - Parent = vPlayer.PlayerGui, - Adornee = script.Parent:FindFirstChild("Head"), - Active = true, - size = UDim2.new(damageGuiWidth, 0, damageGuiHeight, 0.0), - StudsOffset = Vector3.new(0, 2.0, 0.0) - }) -end -print("newHealth declarations finished") -local billboardHealthChange -billboardHealthChange = function(dmg) - local textLabel = New("TextLabel", { - Text = tostring(dmg), - TextColor3 = (function() - if dmg > 0 then - return Color3.new(0, 1, 0) - else - return Color3.new(1, 0, 1) - end - end)(), - size = UDim2.new(1, 0, 1, 0.0), - Active = true, - FontSize = 6, - BackgroundTransparency = 1, - Parent = dotGui - }) - 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 - return textLabel:remove() -end -local setMaxHealth -setMaxHealth = function() - if myHealth.Value >= 0 then - Humanoid.MaxHealth = myHealth.Value - print(Humanoid.MaxHealth) - if Humanoid.Health > Humanoid.MaxHealth then - Humanoid.Health = Humanoid.MaxHealth - end - end -end -myHealth.Changed:connect(setMaxHealth) -local fireEffect = New("Fire", "FireEffect", { - Heat = 0.1, - Size = 3.0, - Enabled = false -}) -while true do - local s = wait(1) - local health = Humanoid.Health - if health > 0 then - local delta = 0 - if config then - local regen = config:FindFirstChild("Regen") - local poison = config:FindFirstChild("Poison") - local ice = config:FindFirstChild("Ice") - local fire = config:FindFirstChild("Fire") - local 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) - elseif regen.Value.Y == -1 then - regen.Value = Vector3.new(regen.Value.X + regen.Value.Z, -1, regen.Value.Z) - else - regen:remove() - end - 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 - end - if ice then - 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 - local backpackTools - if stun.Value > 0 then - Torso.Anchored = true - local 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 - for i = 1, #backpackTools do - if not (backpackTools[i]:FindFirstChild("RobloxBuildTool") ~= nil) then - hider:Clone().Parent = backpackTools[i] - backpackTools[i].Parent = game.Lighting - 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 - local 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 - local wasInChar = 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 - end - if delta ~= 0 then - coroutine.resume(coroutine.create(billboardHealthChange), delta) - end - end - health = Humanoid.Health + delta * s - if health * 1.01 < Humanoid.MaxHealth then - Humanoid.Health = health - elseif delta > 0 then - Humanoid.Health = Humanoid.MaxHealth - end - end -end +print'[Mercury]: Loaded corescript 38037565'local a a=function(b,c,d)if not(d~= +nil)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for +g,h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h +end elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e. +Parent=f return e end local b,c,d=5,5,nil d=function(e,f)local g=e: +findFirstChild(f)if g then return g end while true do g=e.ChildAdded:wait()if g. +Name==f then return g end end end local e=script.Parent local f,g,h,i=d(e, +'Humanoid'),d(e,'Torso'),e:FindFirstChild'PlayerStats',Instance.new'BoolValue'i. +Name='InCharTag'local j=Instance.new'BoolValue'j.Name='RobloxBuildTool'if not(h +~=nil)then h=a('Configuration','PlayerStats',{Parent=e})end local k=h: +FindFirstChild'MaxHealth'if not(k~=nil)then k=a('NumberValue','MaxHealth',{Value +=100,Parent=h})end f.MaxHealth=k.Value f.Health=k.Value local l l=function()f. +MaxHealth=k.Value f.Health=k.Value end k.Changed:connect(l)local m=game.Players: +GetPlayerFromCharacter(script.Parent)local n=m.PlayerGui:FindFirstChild +'DamageOverTimeGui'if not(n~=nil)then n=a('BillboardGui','DamageOverTimeGui',{ +Parent=m.PlayerGui,Adornee=script.Parent:FindFirstChild'Head',Active=true,size= +UDim2.new(b,0,c,0),StudsOffset=Vector3.new(0,2,0)})end print +'newHealth declarations finished'local o o=function(p)local q=a('TextLabel',{ +Text=tostring(p),TextColor3=(function()if p>0 then return Color3.new(0,1,0)else +return Color3.new(1,0,1)end end)(),size=UDim2.new(1,0,1,0),Active=true,FontSize= +6,BackgroundTransparency=1,Parent=n})for r=1,10 do wait(0.1)q.TextTransparency=r +/10 q.Position=UDim2.new(0,0,0,-r*5)q.FontSize=6-r*0.6 end return q:remove()end +local p p=function()if k.Value>=0 then f.MaxHealth=k.Value print(f.MaxHealth)if +f.Health>f.MaxHealth then f.Health=f.MaxHealth end end end k.Changed:connect(p) +local q=a('Fire','FireEffect',{Heat=0.1,Size=3,Enabled=false})while true do +local r,s=wait(1),f.Health if s>0 then local t=0 if h then local u,v,w,x,y=h: +FindFirstChild'Regen',h:FindFirstChild'Poison',h:FindFirstChild'Ice',h: +FindFirstChild'Fire',h:FindFirstChild'Stun'if u then t=t+u.Value.X if u.Value.Y +>=0 then u.Value=Vector3.new(u.Value.X+u.Value.Z,u.Value.Y-r,u.Value.Z)elseif u. +Value.Y==-1 then u.Value=Vector3.new(u.Value.X+u.Value.Z,-1,u.Value.Z)else u: +remove()end end if v then t=t-v.Value.X if v.Value.Y>=0 then v.Value=Vector3. +new(v.Value.X+v.Value.Z,v.Value.Y-r,v.Value.Z)elseif v.Value.Y==-1 then v.Value= +Vector3.new(v.Value.X+v.Value.Z,-1,v.Value.Z)else v:remove()end end if w then t= +t-w.Value.X if w.Value.Y>=0 then w.Value=Vector3.new(w.Value.X,w.Value.Y-r,w. +Value.Z)else w:remove()end end if x then q.Enabled=true q.Parent=e.Torso t=t-x. +Value.X if x.Value.Y>=0 then x.Value=Vector3.new(x.Value.X,x.Value.Y-r,x.Value.Z +)else x:remove()q.Enabled=false q.Parent=nil end end if y then local z if y. +Value>0 then g.Anchored=true local A=script.Parent:GetChildren()z=game.Players: +GetPlayerFromCharacter(script.Parent).Backpack:GetChildren()for B=1,#A do if A[B +].className=='Tool'then i:Clone().Parent=A[B]print(z)table.insert(z,A[B])end end +for B=1,#z do if not(z[B]:FindFirstChild'RobloxBuildTool'~=nil)then j:Clone(). +Parent=z[B]z[B].Parent=game.Lighting end end wait(0.2)for B=1,#z do z[B].Parent= +game.Players:GetPlayerFromCharacter(script.Parent).Backpack end y.Value=y.Value- +r else g.Anchored=false for A=1,#z do local B=z[A]:FindFirstChild +'RobloxBuildTool'if B then B:Remove()end z[A].Parent=game.Lighting end wait(0.2) +for A=1,#z do local B=z[A]:FindFirstChild'InCharTag'if B then B:Remove()z[A]. +Parent=script.Parent else z[A].Parent=game.Players:GetPlayerFromCharacter(script +.Parent).Backpack end end y:Remove()end end if t~=0 then coroutine.resume( +coroutine.create(o),t)end end s=f.Health+t*r if s*1.010 then f.Health=f.MaxHealth end end end \ No newline at end of file diff --git a/processed/39250920.lua b/processed/39250920.lua index df12ac6..d42555e 100644 --- a/processed/39250920.lua +++ b/processed/39250920.lua @@ -1,542 +1,132 @@ -print("[Mercury]: Loaded corescript 39250920") -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local waitForProperty -waitForProperty = function(instance, name) - while not instance[name] do - instance.Changed:wait() - end -end -local waitForChild -waitForChild = function(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end -end -local mainFrame -local choices = { } -local lastChoice -local choiceMap = { } -local currentConversationDialog -local currentConversationPartner -local currentAbortDialogScript -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 conversationTimedOutSize = 350 -local player -local chatNotificationGui -local messageDialog -local timeoutScript -local reenableDialogScript -local dialogMap = { } -local dialogConnections = { } -local gui -waitForChild(game, "CoreGui") -waitForChild(game.CoreGui, "RobloxGui") -if game.CoreGui.RobloxGui:FindFirstChild("ControlFrame") then - gui = game.CoreGui.RobloxGui.ControlFrame -else - gui = game.CoreGui.RobloxGui -end -local currentTone -currentTone = function() - if currentConversationDialog then - return currentConversationDialog.Tone - else - return Enum.DialogTone.Neutral - end -end -local createChatNotificationGui -createChatNotificationGui = function() - chatNotificationGui = New("BillboardGui", "ChatNotificationGui", { - ExtentsOffset = Vector3.new(0, 1, 0), - Size = UDim2.new(4, 0, 5.42857122, 0), - SizeOffset = Vector2.new(0, 0), - StudsOffset = Vector3.new(0.4, 4.3, 0), - Enabled = true, - RobloxLocked = true, - Active = true, - New("ImageLabel", "Image", { - Active = false, - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, 1, 0), - Image = "", - RobloxLocked = true, - New("ImageButton", "Button", { - AutoButtonColor = false, - Position = UDim2.new(0.088, 0, 0.053, 0), - Size = UDim2.new(0.83, 0, 0.46, 0), - Image = "", - BackgroundTransparency = 1, - RobloxLocked = true - }) - }) - }) -end -local getChatColor -getChatColor = function(tone) - if tone == Enum.DialogTone.Neutral then - return Enum.ChatColor.Blue - elseif tone == Enum.DialogTone.Friendly then - return Enum.ChatColor.Green - elseif tone == Enum.DialogTone.Enemy then - return Enum.ChatColor.Red - end -end -local resetColor -resetColor = function(frame, tone) - if tone == Enum.DialogTone.Neutral then - frame.BackgroundColor3 = Color3.new(0, 0, 179 / 255) - frame.Number.TextColor3 = Color3.new(45 / 255, 142 / 255, 245 / 255) - elseif tone == Enum.DialogTone.Friendly then - frame.BackgroundColor3 = Color3.new(0, 77 / 255, 0) - frame.Number.TextColor3 = Color3.new(0, 190 / 255, 0) - elseif tone == Enum.DialogTone.Enemy then - frame.BackgroundColor3 = Color3.new(140 / 255, 0, 0) - frame.Number.TextColor3 = Color3.new(255 / 255, 88 / 255, 79 / 255) - end -end -local styleChoices -styleChoices = function(tone) - for _, obj in pairs(choices) do - resetColor(obj, tone) - end - return resetColor(lastChoice, tone) -end -local styleMainFrame -styleMainFrame = function(tone) - if tone == Enum.DialogTone.Neutral then - mainFrame.Style = Enum.FrameStyle.ChatBlue - mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png" - elseif tone == Enum.DialogTone.Friendly then - mainFrame.Style = Enum.FrameStyle.ChatGreen - mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botGreen_tailRight.png" - elseif tone == Enum.DialogTone.Enemy then - mainFrame.Style = Enum.FrameStyle.ChatRed - mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botRed_tailRight.png" - end - return styleChoices(tone) -end -local setChatNotificationTone -setChatNotificationTone = function(gui, purpose, tone) - if tone == Enum.DialogTone.Neutral then - gui.Image.Image = "rbxasset://textures/chatBubble_botBlue_notify_bkg.png" - elseif tone == Enum.DialogTone.Friendly then - gui.Image.Image = "rbxasset://textures/chatBubble_botGreen_notify_bkg.png" - elseif tone == Enum.DialogTone.Enemy then - gui.Image.Image = "rbxasset://textures/chatBubble_botRed_notify_bkg.png" - end - if purpose == Enum.DialogPurpose.Quest then - gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_bang.png" - elseif purpose == Enum.DialogPurpose.Help then - gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_question.png" - elseif purpose == Enum.DialogPurpose.Shop then - gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_money.png" - end -end -local createMessageDialog -createMessageDialog = function() - messageDialog = New("Frame", "DialogScriptMessage", { - Style = Enum.FrameStyle.RobloxRound, - Visible = false, - New("TextLabel", "Text", { - Position = UDim2.new(0, 0, 0, -1), - Size = UDim2.new(1, 0, 1, 0), - FontSize = Enum.FontSize.Size14, - BackgroundTransparency = 1, - TextColor3 = Color3.new(1, 1, 1), - RobloxLocked = true - }) - }) -end -local showMessage -showMessage = function(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.Visible = true - wait(2) - messageDialog.Visible = false - return messageDialog -end -local variableDelay -variableDelay = function(str) - local length = math.min(string.len(str), 100) - return wait(0.75 + (length / 75) * 1.5) -end -local highlightColor -highlightColor = function(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) - elseif tone == Enum.DialogTone.Friendly then - frame.BackgroundColor3 = Color3.new(0, 128 / 255, 0) - frame.Number.TextColor3 = Color3.new(1, 1, 1) - elseif tone == Enum.DialogTone.Enemy then - frame.BackgroundColor3 = Color3.new(204 / 255, 0, 0) - frame.Number.TextColor3 = Color3.new(1, 1, 1) - end -end -local endDialog -endDialog = function() - if currentAbortDialogScript then - currentAbortDialogScript:Remove() - currentAbortDialogScript = nil - end - local dialog = currentConversationDialog - currentConversationDialog = nil - if dialog and dialog.InUse then - local reenableScript = reenableDialogScript:Clone() - reenableScript.archivable = false - reenableScript.Disabled = false - reenableScript.Parent = dialog - end - for dialog, gui in pairs(dialogMap) do - if dialog and gui then - gui.Enabled = not dialog.InUse - end - end - currentConversationPartner = nil -end -local wanderDialog -wanderDialog = function() - print("Wander") - mainFrame.Visible = false - endDialog() - return showMessage(characterWanderedOffMessage, characterWanderedOffSize) -end -local timeoutDialog -timeoutDialog = function() - print("Timeout") - mainFrame.Visible = false - endDialog() - return showMessage(conversationTimedOut, conversationTimedOutSize) -end -local normalEndDialog -normalEndDialog = function() - print("Done") - return endDialog() -end -local sanitizeMessage -sanitizeMessage = function(msg) - if string.len(msg) == 0 then - return "..." - else - return msg - end -end -local renewKillswitch -renewKillswitch = function(dialog) - if currentAbortDialogScript then - currentAbortDialogScript:Remove() - currentAbortDialogScript = nil - end - currentAbortDialogScript = timeoutScript:Clone() - currentAbortDialogScript.archivable = false - currentAbortDialogScript.Disabled = false - currentAbortDialogScript.Parent = dialog - return currentAbortDialogScript -end -local presentDialogChoices -presentDialogChoices = function(talkingPart, dialogChoices) - if not currentConversationDialog then - return - end - currentConversationPartner = talkingPart - local sortedDialogChoices = { } - for _, obj in pairs(dialogChoices) do - if obj:IsA("DialogChoice") then - table.insert(sortedDialogChoices, obj) - end - end - table.sort(sortedDialogChoices, function(a, b) - return a.Name < b.Name - end) - if #sortedDialogChoices == 0 then - normalEndDialog() - return - end - local pos = 1 - local yPosition = 0 - choiceMap = { } - for _, obj in pairs(choices) do - obj.Visible = false - end - for _, obj in pairs(sortedDialogChoices) do - if pos <= #choices then - 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 - 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 - pos = pos + 1 - end - end - 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, -mainFrame.Size.Y.Offset - 20) - styleMainFrame(currentTone()) - mainFrame.Visible = true -end -local selectChoice -selectChoice = function(choice) - renewKillswitch(currentConversationDialog) - mainFrame.Visible = false - if choice == lastChoice then - game.Chat:Chat(game.Players.LocalPlayer.Character, "Goodbye!", getChatColor(currentTone())) - return normalEndDialog() - else - local dialogChoice = choiceMap[choice] - 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())) - variableDelay(dialogChoice.ResponseDialog) - return presentDialogChoices(currentConversationPartner, dialogChoice:GetChildren()) - end -end -local newChoice -newChoice = function(numberText) - local frame = New("TextButton", { - BackgroundColor3 = Color3.new(0, 0, 179 / 255), - AutoButtonColor = false, - BorderSizePixel = 0, - Text = "", - RobloxLocked = true, - New("TextLabel", "Number", { - TextColor3 = Color3.new(127 / 255, 212 / 255, 255 / 255), - Text = numberText, - FontSize = Enum.FontSize.Size14, - BackgroundTransparency = 1, - Position = UDim2.new(0, 4, 0, 2), - Size = UDim2.new(0, 20, 0, 24), - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top, - RobloxLocked = true - }), - New("TextLabel", "UserPrompt", { - BackgroundTransparency = 1, - TextColor3 = Color3.new(1, 1, 1), - FontSize = Enum.FontSize.Size14, - Position = UDim2.new(0, 28, 0, 2), - Size = UDim2.new(1, -32, 1, -4), - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top, - TextWrap = true, - RobloxLocked = true - }) - }) - frame.MouseEnter:connect(function() - return highlightColor(frame, currentTone()) - end) - frame.MouseLeave:connect(function() - return resetColor(frame, currentTone()) - end) - frame.MouseButton1Click:connect(function() - return selectChoice(frame) - end) - return frame -end -local initialize -initialize = function(parent) - choices[1] = newChoice("1)") - choices[2] = newChoice("2)") - choices[3] = newChoice("3)") - choices[4] = newChoice("4)") - lastChoice = newChoice("5)") - lastChoice.UserPrompt.Text = "Goodbye!" - lastChoice.Size = UDim2.new(1, 0, 0, 28) - mainFrame = New("Frame", "UserDialogArea", { - Size = UDim2.new(0, 350, 0, 200), - Style = Enum.FrameStyle.ChatBlue, - Visible = false, - New("ImageLabel", "Tail", { - Size = UDim2.new(0, 62, 0, 53), - Position = UDim2.new(1, 8, 0.25), - Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png", - BackgroundTransparency = 1, - RobloxLocked = true - }) - }) - for _, obj in pairs(choices) do - obj.RobloxLocked = true - obj.Parent = mainFrame - lastChoice.RobloxLocked = true - end - lastChoice.Parent = mainFrame - mainFrame.RobloxLocked = true - mainFrame.Parent = parent -end -local doDialog -doDialog = function(dialog) - while not Instance.Lock(dialog, player) do - wait() - end - if dialog.InUse then - Instance.Unlock(dialog) - return - else - dialog.InUse = true - Instance.Unlock(dialog) - end - currentConversationDialog = dialog - game.Chat:Chat(dialog.Parent, dialog.InitialPrompt, getChatColor(dialog.Tone)) - variableDelay(dialog.InitialPrompt) - return presentDialogChoices(dialog.Parent, dialog:GetChildren()) -end -local checkForLeaveArea -checkForLeaveArea = function() - while currentConversationDialog do - if currentConversationDialog.Parent and (player:DistanceFromCharacter(currentConversationDialog.Parent.Position >= currentConversationDialog.ConversationDistance)) then - wanderDialog() - end - wait(1) - end -end -local startDialog -startDialog = function(dialog) - if dialog.Parent and dialog.Parent:IsA("BasePart") then - if player:DistanceFromCharacter(dialog.Parent.Position) >= dialog.ConversationDistance then - showMessage(tooFarAwayMessage, tooFarAwaySize) - return - end - for dialog, gui in pairs(dialogMap) do - if dialog and gui then - gui.Enabled = false - end - end - renewKillswitch(dialog) - delay(1, checkForLeaveArea) - return doDialog(dialog) - end -end -local removeDialog -removeDialog = function(dialog) - if dialogMap[dialog] then - dialogMap[dialog]:Remove() - dialogMap[dialog] = nil - end - if dialogConnections[dialog] then - dialogConnections[dialog]:disconnect() - dialogConnections[dialog] = nil - end -end -local addDialog -addDialog = function(dialog) - if dialog.Parent then - if dialog.Parent:IsA("BasePart") then - local chatGui = chatNotificationGui:clone() - chatGui.Enabled = not dialog.InUse - chatGui.Adornee = dialog.Parent - chatGui.RobloxLocked = true - chatGui.Parent = game.CoreGui - chatGui.Image.Button.MouseButton1Click:connect(function() - return 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 - removeDialog(dialog) - return addDialog(dialog) - elseif prop == "InUse" then - chatGui.Enabled = not currentConversationDialog and not dialog.InUse - if dialog == currentConversationDialog then - return timeoutDialog() - end - elseif prop == "Tone" or prop == "Purpose" then - return setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone) - end - end) - else - dialogConnections[dialog] = dialog.Changed:connect(function(prop) - if prop == "Parent" and dialog.Parent then - removeDialog(dialog) - return addDialog(dialog) - end - end) - end - end -end -local fetchScripts -fetchScripts = function() - local model = game:GetService("InsertService"):LoadAsset(39226062) - if type(model) == "string" then - wait(0.1) - model = game:GetService("InsertService"):LoadAsset(39226062) - end - if type(model) == "string" then - return - end - waitForChild(model, "TimeoutScript") - timeoutScript = model.TimeoutScript - waitForChild(model, "ReenableDialogScript") - reenableDialogScript = model.ReenableDialogScript -end -local onLoad -onLoad = function() - waitForProperty(game.Players, "LocalPlayer") - player = game.Players.LocalPlayer - waitForProperty(player, "Character") - fetchScripts() - createChatNotificationGui() - createMessageDialog() - messageDialog.RobloxLocked = true - messageDialog.Parent = gui - waitForChild(gui, "BottomLeftControl") - local frame = New("Frame", "DialogFrame", { - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(0, 0, 0, 0), - BackgroundTransparency = 1, - RobloxLocked = true, - Parent = gui.BottomLeftControl - }) - initialize(frame) - game.CollectionService.ItemAdded:connect(function(obj) - if obj:IsA("Dialog") then - return addDialog(obj) - end - end) - game.CollectionService.ItemRemoved:connect(function(obj) - if obj:IsA("Dialog") then - return removeDialog(obj) - end - end) - for _, obj in pairs(game.CollectionService:GetCollection("Dialog")) do - if obj:IsA("Dialog") then - addDialog(obj) - end - end -end -return onLoad() +print'[Mercury]: Loaded corescript 39250920'local a a=function(b,c,d)if not(d~= +nil)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for +g,h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h +end elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e. +Parent=f return e end local b b=function(c,d)while not c[d]do c.Changed:wait() +end end local c c=function(d,e)while not d:FindFirstChild(e)do d.ChildAdded: +wait()end end local d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=nil,{},nil,{},nil, +nil,nil,'You are too far away to chat!',300,'Chat ended because you walked away' +,350,"Chat ended because you didn't reply",350,nil,nil,nil,nil,nil,{},{},nil c( +game,'CoreGui')c(game.CoreGui,'RobloxGui')if game.CoreGui.RobloxGui: +FindFirstChild'ControlFrame'then x=game.CoreGui.RobloxGui.ControlFrame else x= +game.CoreGui.RobloxGui end local y y=function()if h then return h.Tone else +return Enum.DialogTone.Neutral end end local z z=function()r=a('BillboardGui', +'ChatNotificationGui',{ExtentsOffset=Vector3.new(0,1,0),Size=UDim2.new(4,0, +5.42857122,0),SizeOffset=Vector2.new(0,0),StudsOffset=Vector3.new(0.4,4.3,0), +Enabled=true,RobloxLocked=true,Active=true,a('ImageLabel','Image',{Active=false, +BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,1,0), +Image='',RobloxLocked=true,a('ImageButton','Button',{AutoButtonColor=false, +Position=UDim2.new(0.088,0,0.053,0),Size=UDim2.new(0.83,0,0.46,0),Image='', +BackgroundTransparency=1,RobloxLocked=true})})})end local A A=function(B)if B== +Enum.DialogTone.Neutral then return Enum.ChatColor.Blue elseif B==Enum. +DialogTone.Friendly then return Enum.ChatColor.Green elseif B==Enum.DialogTone. +Enemy then return Enum.ChatColor.Red end end local B B=function(C,D)if D==Enum. +DialogTone.Neutral then C.BackgroundColor3=Color3.new(0,0,0.7019607843137254)C. +Number.TextColor3=Color3.new(0.17647058823529413,0.5568627450980392, +0.9607843137254902)elseif D==Enum.DialogTone.Friendly then C.BackgroundColor3= +Color3.new(0,0.30196078431372547,0)C.Number.TextColor3=Color3.new(0, +0.7450980392156863,0)elseif D==Enum.DialogTone.Enemy then C.BackgroundColor3= +Color3.new(0.5490196078431373,0,0)C.Number.TextColor3=Color3.new(1, +0.34509803921568627,0.30980392156862746)end end local C C=function(D)for E,F in +pairs(e)do B(F,D)end return B(f,D)end local D D=function(E)if E==Enum.DialogTone +.Neutral then d.Style=Enum.FrameStyle.ChatBlue d.Tail.Image= +'rbxasset://textures/chatBubble_botBlue_tailRight.png'elseif E==Enum.DialogTone. +Friendly then d.Style=Enum.FrameStyle.ChatGreen d.Tail.Image= +'rbxasset://textures/chatBubble_botGreen_tailRight.png'elseif E==Enum.DialogTone +.Enemy then d.Style=Enum.FrameStyle.ChatRed d.Tail.Image= +'rbxasset://textures/chatBubble_botRed_tailRight.png'end return C(E)end local E +E=function(F,G,H)if H==Enum.DialogTone.Neutral then F.Image.Image= +'rbxasset://textures/chatBubble_botBlue_notify_bkg.png'elseif H==Enum.DialogTone +.Friendly then F.Image.Image= +'rbxasset://textures/chatBubble_botGreen_notify_bkg.png'elseif H==Enum. +DialogTone.Enemy then F.Image.Image= +'rbxasset://textures/chatBubble_botRed_notify_bkg.png'end if G==Enum. +DialogPurpose.Quest then F.Image.Button.Image= +'rbxasset://textures/chatBubble_bot_notify_bang.png'elseif G==Enum.DialogPurpose +.Help then F.Image.Button.Image= +'rbxasset://textures/chatBubble_bot_notify_question.png'elseif G==Enum. +DialogPurpose.Shop then F.Image.Button.Image= +'rbxasset://textures/chatBubble_bot_notify_money.png'end end local F F=function( +)s=a('Frame','DialogScriptMessage',{Style=Enum.FrameStyle.RobloxRound,Visible= +false,a('TextLabel','Text',{Position=UDim2.new(0,0,0,-1),Size=UDim2.new(1,0,1,0) +,FontSize=Enum.FontSize.Size14,BackgroundTransparency=1,TextColor3=Color3.new(1, +1,1),RobloxLocked=true})})end local G G=function(H,I)s.Text.Text=H s.Size=UDim2. +new(0,I,0,40)s.Position=UDim2.new(0.5,-I/2,0.5,-40)s.Visible=true wait(2)s. +Visible=false return s end local H H=function(I)local J=math.min(string.len(I), +100)return wait(0.75+(J/75)*1.5)end local I I=function(J,K)if K==Enum.DialogTone +.Neutral then J.BackgroundColor3=Color3.new(7.8431372549019605E-3, +0.4235294117647059,1)J.Number.TextColor3=Color3.new(1,1,1)elseif K==Enum. +DialogTone.Friendly then J.BackgroundColor3=Color3.new(0,0.5019607843137255,0)J. +Number.TextColor3=Color3.new(1,1,1)elseif K==Enum.DialogTone.Enemy then J. +BackgroundColor3=Color3.new(0.8,0,0)J.Number.TextColor3=Color3.new(1,1,1)end end +local J J=function()if j then j:Remove()j=nil end local K=h h=nil if K and K. +InUse then local L=u:Clone()L.archivable=false L.Disabled=false L.Parent=K end +for L,M in pairs(v)do if L and M then M.Enabled=not L.InUse end end i=nil end +local L L=function()print'Wander'd.Visible=false J()return G(m,n)end local M M= +function()print'Timeout'd.Visible=false J()return G(o,p)end local N N=function() +print'Done'return J()end local O O=function(P)if string.len(P)==0 then return +'...'else return P end end local P P=function(Q)if j then j:Remove()j=nil end j= +t:Clone()j.archivable=false j.Disabled=false j.Parent=Q return j end local Q Q= +function(R,S)if not h then return end i=R local T={}for U,V in pairs(S)do if V: +IsA'DialogChoice'then table.insert(T,V)end end table.sort(T,function(W,X)return +W.Name=h.ConversationDistance))then L()end +wait(1)end end local W W=function(X)if X.Parent and X.Parent:IsA'BasePart'then +if q:DistanceFromCharacter(X.Parent.Position)>=X.ConversationDistance then G(k,l +)return end for _,ac in pairs(v)do if _ and ac then ac.Enabled=false end end P(_ +)delay(1,T)return S(_)end end local ac ac=function(X)if v[X]then v[X]:Remove()v[ +X]=nil end if w[X]then w[X]:disconnect()w[X]=nil end end local X X=function(_)if +_.Parent then if _.Parent:IsA'BasePart'then local ad=r:clone()ad.Enabled=not _. +InUse ad.Adornee=_.Parent ad.RobloxLocked=true ad.Parent=game.CoreGui ad.Image. +Button.MouseButton1Click:connect(function()return W(_)end)E(ad,_.Purpose,_.Tone) +v[_]=ad w[_]=_.Changed:connect(function(ae)if ae=='Parent'and _.Parent then ac(_ +)return X(_)elseif ae=='InUse'then ad.Enabled=not h and not _.InUse if _==h then +return M()end elseif ae=='Tone'or ae=='Purpose'then return E(ad,_.Purpose,_.Tone +)end end)else w[_]=_.Changed:connect(function(ad)if ad=='Parent'and _.Parent +then ac(_)return X(_)end end)end end end local ad ad=function()local ae=game: +GetService'InsertService':LoadAsset(39226062)if type(ae)=='string'then wait(0.1) +ae=game:GetService'InsertService':LoadAsset(39226062)end if type(ae)=='string' +then return end c(ae,'TimeoutScript')t=ae.TimeoutScript c(ae, +'ReenableDialogScript')u=ae.ReenableDialogScript end local ae ae=function()b( +game.Players,'LocalPlayer')q=game.Players.LocalPlayer b(q,'Character')ad()z()F() +s.RobloxLocked=true s.Parent=x c(x,'BottomLeftControl')local _=a('Frame', +'DialogFrame',{Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,0,0,0), +BackgroundTransparency=1,RobloxLocked=true,Parent=x.BottomLeftControl})R(_)game. +CollectionService.ItemAdded:connect(function(af)if af:IsA'Dialog'then return X( +af)end end)game.CollectionService.ItemRemoved:connect(function(af)if af:IsA +'Dialog'then return ac(af)end end)for af,ag in pairs(game.CollectionService: +GetCollection'Dialog')do if ag:IsA'Dialog'then X(ag)end end end return ae() \ No newline at end of file diff --git a/processed/45284430.lua b/processed/45284430.lua index 71b9c38..ae325d1 100644 --- a/processed/45284430.lua +++ b/processed/45284430.lua @@ -1,3533 +1,843 @@ -print("[Mercury]: Loaded corescript 45284430") -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local t = { } -local ScopedConnect -ScopedConnect = function(parentInstance, instance, event, signalFunc, syncFunc, removeFunc) - local eventConnection - local tryConnect - tryConnect = function() - if game:IsAncestorOf(parentInstance) then - if not eventConnection then - eventConnection = instance[event]:connect(signalFunc) - if syncFunc then - return syncFunc() - end - end - else - if eventConnection then - eventConnection:disconnect() - if removeFunc then - return removeFunc() - end - end - end - end - local connection = parentInstance.AncestryChanged:connect(tryConnect) - tryConnect() - return connection -end -local getScreenGuiAncestor -getScreenGuiAncestor = function(instance) - local localInstance = instance - while localInstance and not localInstance:IsA("ScreenGui") do - localInstance = localInstance.Parent - end - return localInstance -end -local CreateButtons -CreateButtons = function(frame, buttons, yPos, ySize) - local buttonNum = 1 - local buttonObjs = { } - for _, obj in ipairs(buttons) do - local button = New("TextButton", "Button" .. tostring(buttonNum), { - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - AutoButtonColor = true, - Modal = true, - Style = (function() - if obj["Style"] then - return obj.Style - else - return Enum.ButtonStyle.RobloxButton - end - end)(), - Text = obj.Text, - TextColor3 = Color3.new(1, 1, 1), - Parent = frame - }) - button.MouseButton1Click:connect(obj.Function) - buttonObjs[buttonNum] = button - buttonNum = buttonNum + 1 - end - 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(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(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(0.35, 0, ySize.Scale, ySize.Offset) - elseif numButtons >= 3 then - 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].Size = UDim2.new(buttonSize, 0, ySize.Scale, ySize.Offset) - buttonNum = buttonNum + 1 - end - end -end -local setSliderPos -setSliderPos = function(newAbsPosX, slider, sliderPosition, bar, steps) - local newStep = steps - 1 - 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 - local result = math.ceil(relativePosX * newStep) - if sliderPosition.Value ~= (result + 1) then - sliderPosition.Value = result + 1 - slider.Position = UDim2.new(relativePosX, -slider.AbsoluteSize.X / 2, slider.Position.Y.Scale, slider.Position.Y.Offset) - end -end -local cancelSlide -cancelSlide = function(areaSoak) - areaSoak.Visible = false - if areaSoakMouseMoveCon then - return areaSoakMouseMoveCon:disconnect() - end -end -t.CreateStyledMessageDialog = function(title, message, style, buttons) - local frame = New("Frame", "MessageDialog", { - Size = UDim2.new(0.5, 0, 0, 165), - Position = UDim2.new(0.25, 0, 0.5, -72.5), - Active = true, - Style = Enum.FrameStyle.RobloxRound, - New("TextLabel", "Title", { - Text = title, - TextStrokeTransparency = 0, - BackgroundTransparency = 1, - TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255), - Position = UDim2.new(0, 80, 0, 0), - Size = UDim2.new(1, -80, 0, 40), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size36, - TextXAlignment = Enum.TextXAlignment.Center, - TextYAlignment = Enum.TextYAlignment.Center - }), - New("TextLabel", "Message", { - Text = message, - TextStrokeTransparency = 0, - TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255), - Position = UDim2.new(0.025, 80, 0, 45), - Size = UDim2.new(0.95, -80, 0, 55), - BackgroundTransparency = 1, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - TextWrap = true, - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top - }) - }) - local styleImage = New("ImageLabel", "StyleImage", { - BackgroundTransparency = 1, - 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" - elseif style == "notify" or style == "Notify" then - styleImage.Size = UDim2.new(0, 71, 0, 71) - styleImage.Image = "http://www.roblox.com/asset?id=42604978" - elseif style == "confirm" or style == "Confirm" then - styleImage.Size = UDim2.new(0, 74, 0, 76) - styleImage.Image = "http://www.roblox.com/asset?id=42557901" - else - return t.CreateMessageDialog(title, message, buttons) - end - styleImage.Parent = frame - CreateButtons(frame, buttons, UDim.new(0, 105), UDim.new(0, 40)) - return frame -end -t.CreateMessageDialog = function(title, message, buttons) - local frame = New("Frame", "MessageDialog", { - Size = UDim2.new(0.5, 0, 0.5, 0), - Position = UDim2.new(0.25, 0, 0.25, 0), - Active = true, - Style = Enum.FrameStyle.RobloxRound, - New("TextLabel", "Title", { - Text = title, - BackgroundTransparency = 1, - TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255), - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, 0.15, 0), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size36, - TextXAlignment = Enum.TextXAlignment.Center, - TextYAlignment = Enum.TextYAlignment.Center - }), - New("TextLabel", "Message", { - Text = message, - TextColor3 = Color3.new(221 / 255, 221 / 255, 221 / 255), - Position = UDim2.new(0.025, 0, 0.175, 0), - Size = UDim2.new(0.95, 0, 0.55, 0), - BackgroundTransparency = 1, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - TextWrap = true, - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top - }) - }) - CreateButtons(frame, buttons, UDim.new(0.8, 0), UDim.new(0.15, 0)) - return frame -end -t.CreateDropDownMenu = function(items, onSelect, forRoblox) - local width = UDim.new(0, 100) - local height = UDim.new(0, 32) - local frame = New("Frame", "DropDownMenu", { - BackgroundTransparency = 1, - Size = UDim2.new(width, height) - }) - local dropDownMenu = New("TextButton", "DropDownMenuButton", { - TextWrap = true, - TextColor3 = Color3.new(1, 1, 1), - Text = "Choose One", - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Center, - BackgroundTransparency = 1, - AutoButtonColor = true, - Style = Enum.ButtonStyle.RobloxButton, - Size = UDim2.new(1, 0, 1, 0), - Parent = frame, - ZIndex = 2, - New("ImageLabel", "Icon", { - Active = false, - Image = "http://www.roblox.com/asset/?id=45732894", - BackgroundTransparency = 1, - Size = UDim2.new(0, 11, 0, 6), - Position = UDim2.new(1, -11, 0.5, -2), - ZIndex = 2 - }) - }) - local itemCount = #items - local dropDownItemCount = #items - local useScrollButtons = false - if dropDownItemCount > 6 then - useScrollButtons = true - dropDownItemCount = 6 - end - local droppedDownMenu = New("TextButton", "List", { - Text = "", - BackgroundTransparency = 1, - Style = Enum.ButtonStyle.RobloxButton, - Visible = false, - Active = true, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, (1 + dropDownItemCount) * 0.8, 0), - Parent = frame, - ZIndex = 2 - }) - local choiceButton = New("TextButton", "ChoiceButton", { - BackgroundTransparency = 1, - BorderSizePixel = 0, - Text = "ReplaceMe", - TextColor3 = Color3.new(1, 1, 1), - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Center, - BackgroundColor3 = Color3.new(1, 1, 1), - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - Size = (function() - if useScrollButtons then - return UDim2.new(1, -13, 0.8 / ((dropDownItemCount + 1) * 0.8), 0) - else - return UDim2.new(1, 0, 0.8 / ((dropDownItemCount + 1) * 0.8), 0) - end - end)(), - TextWrap = true, - ZIndex = 2 - }) - local areaSoak = New("TextButton", "AreaSoak", { - Text = "", - BackgroundTransparency = 1, - Active = true, - Size = UDim2.new(1, 0, 1, 0), - Visible = false, - ZIndex = 3 - }) - local dropDownSelected = false - local scrollUpButton - local scrollDownButton - local scrollMouseCount = 0 - local setZIndex - setZIndex = function(baseZIndex) - 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 _, child in ipairs(children) do - if child.Name == "ChoiceButton" then - child.ZIndex = baseZIndex + 2 - elseif child.Name == "ClickCaptureButton" then - child.ZIndex = baseZIndex - end - end - end - end - local scrollBarPosition = 1 - local updateScroll - updateScroll = function() - if scrollUpButton then - scrollUpButton.Active = scrollBarPosition > 1 - end - if scrollDownButton then - scrollDownButton.Active = scrollBarPosition + dropDownItemCount <= itemCount - end - local children = droppedDownMenu:GetChildren() - if not children then - return - end - local childNum = 1 - for _, 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) * 0.8) / ((dropDownItemCount + 1) * 0.8), 0) - obj.Visible = true - end - obj.TextColor3 = Color3.new(1, 1, 1) - obj.BackgroundTransparency = 1 - childNum = childNum + 1 - end - end - end - local toggleVisibility - toggleVisibility = function() - dropDownSelected = not dropDownSelected - areaSoak.Visible = not areaSoak.Visible - dropDownMenu.Visible = not dropDownSelected - droppedDownMenu.Visible = dropDownSelected - if dropDownSelected then - setZIndex(4) - else - setZIndex(2) - end - if useScrollButtons then - return updateScroll() - end - end - droppedDownMenu.MouseButton1Click:connect(toggleVisibility) - local updateSelection - updateSelection = function(text) - local foundItem = false - local children = droppedDownMenu:GetChildren() - local childNum = 1 - if children then - for _, obj in ipairs(children) do - if obj.Name == "ChoiceButton" then - if obj.Text == text then - obj.Font = Enum.Font.ArialBold - foundItem = true - scrollBarPosition = childNum - else - obj.Font = Enum.Font.Arial - end - childNum = childNum + 1 - end - end - end - if not text then - dropDownMenu.Text = "Choose One" - scrollBarPosition = 1 - else - if not foundItem then - error("Invalid Selection Update -- " .. text) - end - if scrollBarPosition + dropDownItemCount > itemCount + 1 then - scrollBarPosition = itemCount - dropDownItemCount + 1 - end - dropDownMenu.Text = text - end - end - local scrollDown - scrollDown = function() - if scrollBarPosition + dropDownItemCount <= itemCount then - scrollBarPosition = scrollBarPosition + 1 - updateScroll() - return true - end - return false - end - local scrollUp - scrollUp = function() - if scrollBarPosition > 1 then - scrollBarPosition = scrollBarPosition - 1 - updateScroll() - return true - end - return false - end - if useScrollButtons then - scrollUpButton = New("ImageButton", "ScrollUpButton", { - BackgroundTransparency = 1, - Image = "rbxasset://textures/ui/scrollbuttonUp.png", - Size = UDim2.new(0, 17, 0, 17), - 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 = New("ImageButton", "ScrollDownButton", { - BackgroundTransparency = 1, - Image = "rbxasset://textures/ui/scrollbuttonDown.png", - Size = UDim2.new(0, 17, 0, 17), - Position = UDim2.new(1, -11, 1, -11), - 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 - scrollDown() - local val = scrollMouseCount - wait(0.5) - while val == scrollMouseCount do - if scrollDown() == false then - break - end - wait(0.1) - end - end) - New("ImageLabel", "ScrollBar", { - Image = "rbxasset://textures/ui/scrollbar.png", - BackgroundTransparency = 1, - Size = UDim2.new(0, 18, (dropDownItemCount * 0.8) / ((dropDownItemCount + 1) * 0.8), -17 - 11 - 4), - Position = UDim2.new(1, -11, (1 * 0.8) / ((dropDownItemCount + 1) * 0.8), 17 + 2), - Parent = droppedDownMenu - }) - end - for _, item in ipairs(items) do - local button = choiceButton:clone() - if forRoblox then - button.RobloxLocked = true - end - button.Text = item - button.Parent = droppedDownMenu - button.MouseButton1Click:connect(function() - button.TextColor3 = Color3.new(1, 1, 1) - button.BackgroundTransparency = 1 - updateSelection(item) - onSelect(item) - return toggleVisibility() - end) - button.MouseEnter:connect(function() - button.TextColor3 = Color3.new(0, 0, 0) - button.BackgroundTransparency = 0 - end) - button.MouseLeave:connect(function() - button.TextColor3 = Color3.new(1, 1, 1) - button.BackgroundTransparency = 1 - end) - end - updateScroll() - frame.AncestryChanged:connect(function(_, parent) - if parent == nil then - areaSoak.Parent = nil - else - areaSoak.Parent = getScreenGuiAncestor(frame) - end - end) - dropDownMenu.MouseButton1Click:connect(toggleVisibility) - areaSoak.MouseButton1Click:connect(toggleVisibility) - return frame, updateSelection -end -t.CreatePropertyDropDownMenu = function(instance, property, enum) - local items = enum:GetEnumItems() - local names = { } - local nameToItem = { } - 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) - ScopedConnect(frame, instance, "Changed", function(prop) - if prop == property then - return updateSelection(instance[property].Name) - end - end, function() - return 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") - end - if font == Enum.Font.Legacy then - if Enum.FontSize.Size8 == fontSize then - return 12 - elseif Enum.FontSize.Size9 == fontSize then - return 14 - elseif Enum.FontSize.Size10 == fontSize then - return 15 - elseif Enum.FontSize.Size11 == fontSize then - return 17 - elseif Enum.FontSize.Size12 == fontSize then - return 18 - elseif Enum.FontSize.Size14 == fontSize then - return 21 - elseif Enum.FontSize.Size18 == fontSize then - return 27 - elseif Enum.FontSize.Size24 == fontSize then - return 36 - elseif Enum.FontSize.Size36 == fontSize then - return 54 - elseif Enum.FontSize.Size48 == fontSize then - return 72 - else - return error("Unknown FontSize") - end - elseif font == Enum.Font.Arial or font == Enum.Font.ArialBold then - if Enum.FontSize.Size8 == fontSize then - return 8 - elseif Enum.FontSize.Size9 == fontSize then - return 9 - elseif Enum.FontSize.Size10 == fontSize then - return 10 - elseif Enum.FontSize.Size11 == fontSize then - return 11 - elseif Enum.FontSize.Size12 == fontSize then - return 12 - elseif Enum.FontSize.Size14 == fontSize then - return 14 - elseif Enum.FontSize.Size18 == fontSize then - return 18 - elseif Enum.FontSize.Size24 == fontSize then - return 24 - elseif Enum.FontSize.Size36 == fontSize then - return 36 - elseif Enum.FontSize.Size48 == fontSize then - return 48 - else - return error("Unknown FontSize") - end - else - return error("Unknown Font " .. font) - end -end -local layoutGuiObjectsHelper -layoutGuiObjectsHelper = function(frame, guiObjects, settingsTable) - local totalPixels = frame.AbsoluteSize.Y - local pixelsRemaining = frame.AbsoluteSize.Y - for _, child in ipairs(guiObjects) do - 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.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"]) - 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 - if isLabel then - pixelsRemaining = pixelsRemaining - settingsTable["TextLabelPositionPadY"] - else - pixelsRemaining = pixelsRemaining - settingsTable["TextButtonPositionPadY"] - end - else - child.Visible = false - pixelsRemaining = -1 - end - else - 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 - end -end -t.LayoutGuiObjects = function(frame, guiObjects, settingsTable) - if not frame:IsA("GuiObject") then - error("Frame must be a GuiObject") - end - for _, child in ipairs(guiObjects) do - if not child:IsA("GuiObject") then - error("All elements that are layed out must be of type GuiObject") - end - end - if not settingsTable then - settingsTable = { } - end - if not settingsTable["TextLabelSizePadY"] then - settingsTable["TextLabelSizePadY"] = 0 - end - if not settingsTable["TextLabelPositionPadY"] then - settingsTable["TextLabelPositionPadY"] = 0 - end - if not settingsTable["TextButtonSizePadY"] then - settingsTable["TextButtonSizePadY"] = 12 - end - if not settingsTable["TextButtonPositionPadY"] then - settingsTable["TextButtonPositionPadY"] = 2 - end - local wrapperFrame = New("Frame", "WrapperFrame", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 1, 0), - Parent = frame - }) - for _, child in ipairs(guiObjects) do - child.Parent = wrapperFrame - end - local recalculate - recalculate = function() - wait() - return layoutGuiObjectsHelper(wrapperFrame, guiObjects, settingsTable) - end - frame.Changed:connect(function(prop) - if prop == "AbsoluteSize" then - return recalculate(nil) - end - end) - frame.AncestryChanged:connect(recalculate) - return layoutGuiObjectsHelper(wrapperFrame, guiObjects, settingsTable) -end -t.CreateSlider = function(steps, width, position) - local sliderGui = New("Frame", "SliderGui", { - Size = UDim2.new(1, 0, 1, 0), - BackgroundTransparency = 1 - }) - local sliderSteps = New("IntValue", "SliderSteps", { - Value = steps, - Parent = sliderGui - }) - local areaSoak = New("TextButton", "AreaSoak", { - Text = "", - BackgroundTransparency = 1, - Active = false, - Size = UDim2.new(1, 0, 1, 0), - Visible = false, - ZIndex = 4 - }) - sliderGui.AncestryChanged:connect(function(_, parent) - if parent == nil then - areaSoak.Parent = nil - else - areaSoak.Parent = getScreenGuiAncestor(sliderGui) - end - end) - local sliderPosition = New("IntValue", "SliderPosition", { - Value = 0, - Parent = sliderGui - }) - local bar = New("TextButton", "Bar", { - Text = "", - AutoButtonColor = false, - BackgroundColor3 = Color3.new(0, 0, 0), - Size = (function() - if type(width) == "number" then - return UDim2.new(0, width, 0, 5) - else - return UDim2.new(0, 200, 0, 5) - end - end)(), - BorderColor3 = Color3.new(95 / 255, 95 / 255, 95 / 255), - ZIndex = 2, - 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 - bar.Position = position - end - local slider = New("ImageButton", "Slider", { - BackgroundTransparency = 1, - Image = "rbxasset://textures/ui/Slider.png", - Position = UDim2.new(0, 0, 0.5, -10), - Size = UDim2.new(0, 20, 0, 20), - ZIndex = 3, - Parent = bar - }) - local areaSoakMouseMoveCon - areaSoak.MouseLeave:connect(function() - if areaSoak.Visible then - return cancelSlide(areaSoak) - end - end) - areaSoak.MouseButton1Up:connect(function() - if areaSoak.Visible then - return cancelSlide(areaSoak) - end - end) - slider.MouseButton1Down:connect(function() - areaSoak.Visible = true - if areaSoakMouseMoveCon then - areaSoakMouseMoveCon:disconnect() - end - areaSoakMouseMoveCon = areaSoak.MouseMoved:connect(function(x, _) - return setSliderPos(x, slider, sliderPosition, bar, steps) - end) - end) - slider.MouseButton1Up:connect(function() - return cancelSlide(areaSoak) - end) - sliderPosition.Changed:connect(function(_) - 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, _) - return setSliderPos(x, slider, sliderPosition, bar, steps) - end) - return sliderGui, sliderPosition, sliderSteps -end -t.CreateTrueScrollingFrame = function() - local lowY, highY - local dragCon, upCon - local internalChange = false - local descendantsChangeConMap = { } - local scrollingFrame = New("Frame", "ScrollingFrame", { - Active = true, - Size = UDim2.new(1, 0, 1, 0), - ClipsDescendants = true - }) - local controlFrame = New("Frame", "ControlFrame", { - BackgroundTransparency = 1, - Size = UDim2.new(0, 18, 1, 0), - Position = UDim2.new(1, -20, 0, 0), - Parent = scrollingFrame - }) - local scrollBottom = New("BoolValue", "ScrollBottom", { - Value = false, - Parent = controlFrame - }) - local scrollUp = New("BoolValue", "scrollUp", { - Value = false, - Parent = controlFrame - }) - local scrollUpButton = New("TextButton", "ScrollUpButton", { - Text = "", - AutoButtonColor = false, - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(1, 1, 1), - BackgroundTransparency = 0.5, - Size = UDim2.new(0, 18, 0, 18), - ZIndex = 2, - Parent = controlFrame - }) - for i = 1, 6 do - New("Frame", "tri" .. tostring(i), { - BorderColor3 = Color3.new(1, 1, 1), - ZIndex = 3, - BackgroundTransparency = 0.5, - Size = UDim2.new(0, 12 - ((i - 1) * 2), 0, 0), - Position = UDim2.new(0, 3 + (i - 1), 0.5, 2 - (i - 1)), - Parent = scrollUpButton - }) - end - scrollUpButton.MouseEnter:connect(function() - scrollUpButton.BackgroundTransparency = 0.1 - local upChildren = scrollUpButton:GetChildren() - for i = 1, #upChildren do - upChildren[i].BackgroundTransparency = 0.1 - end - end) - scrollUpButton.MouseLeave:connect(function() - scrollUpButton.BackgroundTransparency = 0.5 - local upChildren = scrollUpButton:GetChildren() - for i = 1, #upChildren do - upChildren[i].BackgroundTransparency = 0.5 - end - end) - local scrollDownButton = scrollUpButton:clone() - scrollDownButton.Name = "ScrollDownButton" - 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)) - end - scrollDownButton.MouseEnter:connect(function() - scrollDownButton.BackgroundTransparency = 0.1 - downChildren = scrollDownButton:GetChildren() - for i = 1, #downChildren do - downChildren[i].BackgroundTransparency = 0.1 - end - end) - scrollDownButton.MouseLeave:connect(function() - scrollDownButton.BackgroundTransparency = 0.5 - downChildren = scrollDownButton:GetChildren() - for i = 1, #downChildren do - downChildren[i].BackgroundTransparency = 0.5 - end - end) - scrollDownButton.Parent = controlFrame - local scrollTrack = New("Frame", "ScrollTrack", { - BackgroundTransparency = 1, - Size = UDim2.new(0, 18, 1, -38), - Position = UDim2.new(0, 0, 0, 19), - Parent = controlFrame - }) - local scrollbar = New("TextButton", "ScrollBar", { - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(1, 1, 1), - BackgroundTransparency = 0.5, - AutoButtonColor = false, - Text = "", - Active = true, - ZIndex = 2, - Size = UDim2.new(0, 18, 0.1, 0), - Position = UDim2.new(0, 0, 0, 0), - Parent = scrollTrack - }) - local scrollNub = New("Frame", "ScrollNub", { - BorderColor3 = Color3.new(1, 1, 1), - Size = UDim2.new(0, 10, 0, 0), - Position = UDim2.new(0.5, -5, 0.5, 0), - ZIndex = 2, - BackgroundTransparency = 0.5, - Parent = scrollbar - }) - local newNub = scrollNub:clone() - 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.Parent = scrollbar - scrollbar.MouseEnter:connect(function() - scrollbar.BackgroundTransparency = 0.1 - scrollNub.BackgroundTransparency = 0.1 - newNub.BackgroundTransparency = 0.1 - lastNub.BackgroundTransparency = 0.1 - end) - scrollbar.MouseLeave:connect(function() - scrollbar.BackgroundTransparency = 0.5 - scrollNub.BackgroundTransparency = 0.5 - newNub.BackgroundTransparency = 0.5 - lastNub.BackgroundTransparency = 0.5 - end) - local mouseDrag = New("ImageButton", "mouseDrag", { - Active = false, - Size = UDim2.new(1.5, 0, 1.5, 0), - AutoButtonColor = false, - BackgroundTransparency = 1, - Position = UDim2.new(-0.25, 0, -0.25, 0), - ZIndex = 10 - }) - local positionScrollBar - positionScrollBar = function(_, 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) - return (oldPos ~= scrollbar.Position) - end - 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) - return (oldPos ~= scrollbar.Position) - end - local newScaleYPos = (y - scrollTrack.AbsolutePosition.y - offset) / scrollTrack.AbsoluteSize.y - if newScaleYPos + relativeSize > 1 then - newScaleYPos = 1 - relativeSize - scrollBottom.Value = true - scrollUp.Value = false - elseif newScaleYPos <= 0 then - newScaleYPos = 0 - scrollUp.Value = true - scrollBottom.Value = false - else - scrollUp.Value = false - scrollBottom.Value = false - end - scrollbar.Position = UDim2.new(scrollbar.Position.X.Scale, scrollbar.Position.X.Offset, newScaleYPos, 0) - return (oldPos ~= scrollbar.Position) - end - local drillDownSetHighLow - drillDownSetHighLow = function(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 (lowY and lowY > instance.AbsolutePosition.Y) or not lowY then - lowY = instance.AbsolutePosition.Y - end - if (highY and highY < (instance.AbsolutePosition.Y + instance.AbsoluteSize.Y)) or not highY then - highY = instance.AbsolutePosition.Y + instance.AbsoluteSize.Y - end - local children = instance:GetChildren() - for i = 1, #children do - drillDownSetHighLow(children[i]) - end - end - local resetHighLow - resetHighLow = function() - local firstChildren = scrollingFrame:GetChildren() - for i = 1, #firstChildren do - drillDownSetHighLow(firstChildren[i]) - end - end - local recalculate - recalculate = function() - internalChange = true - 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) - else - percentFrame = 0 - end - 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)) - end - end - lowY = nil - highY = nil - resetHighLow() - internalChange = false - end - local setSliderSizeAndPosition - setSliderSizeAndPosition = function() - if not highY or not lowY then - return - end - local totalYSpan = math.abs(highY - lowY) - if totalYSpan == 0 then - scrollbar.Visible = false - scrollDownButton.Visible = false - scrollUpButton.Visible = false - if dragCon then - dragCon:disconnect() - dragCon = nil - end - if upCon then - upCon:disconnect() - upCon = nil - end - return - end - local percentShown = scrollingFrame.AbsoluteSize.Y / totalYSpan - if percentShown >= 1 then - scrollbar.Visible = false - scrollDownButton.Visible = false - scrollUpButton.Visible = false - recalculate() - else - scrollbar.Visible = true - scrollDownButton.Visible = true - scrollUpButton.Visible = true - 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) - if scrollbar.AbsolutePosition.y < scrollTrack.AbsolutePosition.y then - 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) - end - end - local buttonScrollAmountPixels = 7 - local reentrancyGuardScrollUp = false - local doScrollUp - doScrollUp = function() - if reentrancyGuardScrollUp then - return - end - reentrancyGuardScrollUp = true - if positionScrollBar(0, scrollbar.AbsolutePosition.Y - buttonScrollAmountPixels, 0) then - recalculate() - end - reentrancyGuardScrollUp = false - end - local reentrancyGuardScrollDown = false - local doScrollDown - doScrollDown = function() - if reentrancyGuardScrollDown then - return - end - reentrancyGuardScrollDown = true - if positionScrollBar(0, scrollbar.AbsolutePosition.Y + buttonScrollAmountPixels, 0) then - recalculate() - end - reentrancyGuardScrollDown = false - end - scrollUp = function(mouseYPos) - if scrollUpButton.Active then - local scrollStamp = tick() - local current = scrollStamp - local upCon - upCon = mouseDrag.MouseButton1Up:connect(function() - scrollStamp = tick() - mouseDrag.Parent = nil - return upCon:disconnect() - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - doScrollUp() - wait(0.2) - t = tick() - local w = 0.1 - while scrollStamp == current do - doScrollUp() - if mouseYPos and mouseYPos > scrollbar.AbsolutePosition.y then - break - end - if not scrollUpButton.Active then - break - end - if tick() - t > 5 then - w = 0 - elseif tick() - t > 2 then - w = 0.06 - end - wait(w) - end - end - end - local scrollDown - scrollDown = function(mouseYPos) - if scrollDownButton.Active then - local scrollStamp = tick() - local current = scrollStamp - local downCon - downCon = mouseDrag.MouseButton1Up:connect(function() - scrollStamp = tick() - mouseDrag.Parent = nil - return downCon:disconnect() - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - doScrollDown() - wait(0.2) - t = tick() - local w = 0.1 - while scrollStamp == current do - doScrollDown() - 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 - w = 0 - elseif tick() - t > 2 then - w = 0.06 - end - wait(w) - end - end - end - scrollbar.MouseButton1Down:connect(function(_, y) - if scrollbar.Active then - local scrollStamp = tick() - local mouseOffset = y - scrollbar.AbsolutePosition.y - if dragCon then - dragCon:disconnect() - dragCon = nil - end - if upCon then - upCon:disconnect() - upCon = nil - end - local reentrancyGuardMouseScroll = false - dragCon = mouseDrag.MouseMoved:connect(function(x, y) - if reentrancyGuardMouseScroll then - return - end - reentrancyGuardMouseScroll = true - 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 - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - end - end) - local scrollMouseCount = 0 - scrollUpButton.MouseButton1Down:connect(function() - return scrollUp() - end) - scrollDownButton.MouseButton1Down:connect(function() - return scrollDown() - end) - local scrollTick - scrollTick = function() - scrollStamp = tick() - end - scrollUpButton.MouseButton1Up:connect(scrollTick) - scrollDownButton.MouseButton1Up:connect(scrollTick) - scrollbar.MouseButton1Up:connect(scrollTick) - local highLowRecheck - highLowRecheck = function() - local oldLowY = lowY - local oldHighY = highY - lowY = nil - highY = nil - resetHighLow() - if (lowY ~= oldLowY) or (highY ~= oldHighY) then - return setSliderSizeAndPosition() - end - end - local descendantChanged - descendantChanged = function(this, prop) - if internalChange then - return - end - if not this.Visible then - return - end - if prop == "Size" or prop == "Position" then - wait() - return highLowRecheck() - end - end - scrollingFrame.DescendantAdded:connect(function(instance) - if not instance:IsA("GuiObject") then - return - end - if instance.Visible then - wait() - highLowRecheck() - end - descendantsChangeConMap[instance] = instance.Changed:connect(function(prop) - return descendantChanged(instance, prop) - end) - end) - scrollingFrame.DescendantRemoving:connect(function(instance) - if not instance:IsA("GuiObject") then - return - end - if descendantsChangeConMap[instance] then - descendantsChangeConMap[instance]:disconnect() - descendantsChangeConMap[instance] = nil - end - wait() - return highLowRecheck() - end) - scrollingFrame.Changed:connect(function(prop) - if prop == "AbsoluteSize" then - if not highY or not lowY then - return - end - highLowRecheck() - return setSliderSizeAndPosition() - end - end) - return scrollingFrame, controlFrame -end -t.CreateScrollingFrame = function(orderList, scrollStyle) - local frame = New("Frame", "ScrollingFrame", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 1, 0) - }) - local scrollUpButton = New("ImageButton", "ScrollUpButton", { - BackgroundTransparency = 1, - Image = "rbxasset://textures/ui/scrollbuttonUp.png", - Size = UDim2.new(0, 17, 0, 17) - }) - local scrollDownButton = New("ImageButton", "ScrollDownButton", { - BackgroundTransparency = 1, - Image = "rbxasset://textures/ui/scrollbuttonDown.png", - Size = UDim2.new(0, 17, 0, 17) - }) - local scrollbar = New("ImageButton", "ScrollBar", { - Image = "rbxasset://textures/ui/scrollbar.png", - BackgroundTransparency = 1, - Size = UDim2.new(0, 18, 0, 150) - }) - local scrollStamp = 0 - local scrollDrag = New("ImageButton", "ScrollDrag", { - Image = "http://www.roblox.com/asset/?id=61367186", - Size = UDim2.new(1, 0, 0, 16), - BackgroundTransparency = 1, - Active = true, - Parent = scrollbar - }) - local mouseDrag = New("ImageButton", "mouseDrag", { - Active = false, - Size = UDim2.new(1.5, 0, 1.5, 0), - AutoButtonColor = false, - BackgroundTransparency = 1, - Position = UDim2.new(-0.25, 0, -0.25, 0), - ZIndex = 10 - }) - local style = "simple" - if scrollStyle and tostring(scrollStyle) then - style = scrollStyle - end - local scrollPosition = 1 - local rowSize = 0 - local howManyDisplayed = 0 - local layoutGridScrollBar - layoutGridScrollBar = function() - howManyDisplayed = 0 - local guiObjects = { } - if orderList then - for _, child in ipairs(orderList) do - if child.Parent == frame then - table.insert(guiObjects, child) - end - end - else - local children = frame:GetChildren() - if children then - for _, child in ipairs(children) do - if child:IsA("GuiObject") then - table.insert(guiObjects, child) - end - end - end - end - if #guiObjects == 0 then - scrollUpButton.Active = false - scrollDownButton.Active = false - scrollDrag.Active = false - scrollPosition = 1 - return - end - if scrollPosition > #guiObjects then - scrollPosition = #guiObjects - end - if scrollPosition < 1 then - scrollPosition = 1 - end - local totalPixelsY = frame.AbsoluteSize.Y - local pixelsRemainingY = frame.AbsoluteSize.Y - 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 - while pos <= #guiObjects and pixelsBelowScrollbar < totalPixelsY do - xCounter = xCounter + guiObjects[pos].AbsoluteSize.X - if xCounter >= totalPixelsX then - pixelsBelowScrollbar = pixelsBelowScrollbar + currentRowY - currentRowY = 0 - xCounter = guiObjects[pos].AbsoluteSize.X - end - if guiObjects[pos].AbsoluteSize.Y > currentRowY then - currentRowY = guiObjects[pos].AbsoluteSize.Y - end - pos = pos + 1 - end - pixelsBelowScrollbar = pixelsBelowScrollbar + currentRowY - currentRowY = 0 - pos = scrollPosition - 1 - xCounter = 0 - while pixelsBelowScrollbar + currentRowY < totalPixelsY and pos >= 1 do - xCounter = xCounter + guiObjects[pos].AbsoluteSize.X - rowSizeCounter = rowSizeCounter + 1 - if xCounter >= totalPixelsX then - rowSize = rowSizeCounter - 1 - rowSizeCounter = 0 - xCounter = guiObjects[pos].AbsoluteSize.X - if pixelsBelowScrollbar + currentRowY <= totalPixelsY then - pixelsBelowScrollbar = pixelsBelowScrollbar + currentRowY - if scrollPosition <= rowSize then - scrollPosition = 1 - break - else - scrollPosition = scrollPosition - rowSize - end - currentRowY = 0 - else - break - end - end - if guiObjects[pos].AbsoluteSize.Y > currentRowY then - currentRowY = guiObjects[pos].AbsoluteSize.Y - end - pos = pos - 1 - end - if (pos == 0) and (pixelsBelowScrollbar + currentRowY <= totalPixelsY) then - scrollPosition = 1 - end - xCounter = 0 - rowSizeCounter = 0 - setRowSize = true - local lastChildSize = 0 - local xOffset = 0 - local 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) - end - for i, child in ipairs(guiObjects) do - if i < scrollPosition then - child.Visible = false - else - if pixelsRemainingY < 0 then - child.Visible = false - else - if setRowSize then - rowSizeCounter = rowSizeCounter + 1 - end - if xCounter + child.AbsoluteSize.X >= totalPixelsX then - if setRowSize then - rowSize = rowSizeCounter - 1 - setRowSize = false - end - xCounter = 0 - pixelsRemainingY = pixelsRemainingY - child.AbsoluteSize.Y - end - 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 - end - end - end - scrollUpButton.Active = (scrollPosition > 1) - if lastChildSize == 0 then - scrollDownButton.Active = false - else - scrollDownButton.Active = ((pixelsRemainingY - lastChildSize.Y) < 0) - end - scrollDrag.Active = #guiObjects > howManyDisplayed - scrollDrag.Visible = scrollDrag.Active - end - local layoutSimpleScrollBar - layoutSimpleScrollBar = function() - local guiObjects = { } - howManyDisplayed = 0 - if orderList then - for _, child in ipairs(orderList) do - if child.Parent == frame then - table.insert(guiObjects, child) - end - end - else - local children = frame:GetChildren() - if children then - for _, child in ipairs(children) do - if child:IsA("GuiObject") then - table.insert(guiObjects, child) - end - end - end - end - if #guiObjects == 0 then - scrollUpButton.Active = false - scrollDownButton.Active = false - scrollDrag.Active = false - scrollPosition = 1 - return - end - if scrollPosition > #guiObjects then - scrollPosition = #guiObjects - end - local totalPixels = frame.AbsoluteSize.Y - local pixelsRemaining = frame.AbsoluteSize.Y - local pixelsBelowScrollbar = 0 - local pos = #guiObjects - while pixelsBelowScrollbar < totalPixels and pos >= 1 do - if pos >= scrollPosition then - pixelsBelowScrollbar = pixelsBelowScrollbar + guiObjects[pos].AbsoluteSize.Y - else - if pixelsBelowScrollbar + guiObjects[pos].AbsoluteSize.Y <= totalPixels then - pixelsBelowScrollbar = pixelsBelowScrollbar + guiObjects[pos].AbsoluteSize.Y - if scrollPosition <= 1 then - scrollPosition = 1 - break - else - scrollPosition = scrollPosition - 1 - end - else - break - end - end - pos = pos - 1 - end - pos = scrollPosition - for i, child in ipairs(guiObjects) do - if i < scrollPosition then - child.Visible = false - else - if pixelsRemaining < 0 then - child.Visible = false - else - child.Position = UDim2.new(child.Position.X.Scale, child.Position.X.Offset, 0, totalPixels - pixelsRemaining) - pixelsRemaining = pixelsRemaining - child.AbsoluteSize.Y - if pixelsRemaining >= 0 then - child.Visible = true - howManyDisplayed = howManyDisplayed + 1 - else - child.Visible = false - end - end - end - end - scrollUpButton.Active = (scrollPosition > 1) - scrollDownButton.Active = (pixelsRemaining < 0) - scrollDrag.Active = #guiObjects > howManyDisplayed - scrollDrag.Visible = scrollDrag.Active - end - local moveDragger - moveDragger = function() - local guiObjects = 0 - local children = frame:GetChildren() - if children then - for _, 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 - 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) - end - local reentrancyGuard = false - local recalculate - recalculate = function() - if reentrancyGuard then - return - end - reentrancyGuard = true - wait() - local success, err - if style == "grid" then - success, err = pcall(function() - return layoutGridScrollBar() - end) - elseif style == "simple" then - success, err = pcall(function() - return layoutSimpleScrollBar() - end) - end - if not success then - print(err) - end - moveDragger() - reentrancyGuard = false - end - local doScrollUp - doScrollUp = function() - scrollPosition = scrollPosition - rowSize - if scrollPosition < 1 then - scrollPosition = 1 - end - return recalculate(nil) - end - local doScrollDown - doScrollDown = function() - scrollPosition = scrollPosition + rowSize - return recalculate(nil) - end - local scrollUp - scrollUp = function(mouseYPos) - if scrollUpButton.Active then - scrollStamp = tick() - local current = scrollStamp - local upCon - upCon = mouseDrag.MouseButton1Up:connect(function() - scrollStamp = tick() - mouseDrag.Parent = nil - return upCon:disconnect() - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - doScrollUp() - wait(0.2) - t = tick() - local w = 0.1 - while scrollStamp == current do - doScrollUp() - if mouseYPos and mouseYPos > scrollDrag.AbsolutePosition.y then - break - end - if not scrollUpButton.Active then - break - end - if tick() - t > 5 then - w = 0 - elseif tick() - t > 2 then - w = 0.06 - end - wait(w) - end - end - end - local scrollDown - scrollDown = function(mouseYPos) - if scrollDownButton.Active then - scrollStamp = tick() - local current = scrollStamp - local downCon - downCon = mouseDrag.MouseButton1Up:connect(function() - scrollStamp = tick() - mouseDrag.Parent = nil - return downCon:disconnect() - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - doScrollDown() - wait(0.2) - t = tick() - local w = 0.1 - while scrollStamp == current do - doScrollDown() - 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 - w = 0 - elseif tick() - t > 2 then - w = 0.06 - end - wait(w) - end - end - end - scrollDrag.MouseButton1Down:connect(function(_, y) - if scrollDrag.Active then - scrollStamp = tick() - local mouseOffset = y - scrollDrag.AbsolutePosition.y - local dragCon, upCon - dragCon = mouseDrag.MouseMoved:connect(function(_, 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 _, child in ipairs(children) do - if child:IsA("GuiObject") then - guiObjects = guiObjects + 1 - end - end - end - 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 - return recalculate(nil) - end) - upCon = mouseDrag.MouseButton1Up:connect(function() - scrollStamp = tick() - mouseDrag.Parent = nil - dragCon:disconnect() - dragCon = nil - upCon:disconnect() - drag = nil - end) - mouseDrag.Parent = getScreenGuiAncestor(scrollbar) - end - end) - local scrollMouseCount = 0 - scrollUpButton.MouseButton1Down:connect(function() - return scrollUp() - end) - scrollUpButton.MouseButton1Up:connect(function() - scrollStamp = tick() - end) - scrollDownButton.MouseButton1Up:connect(function() - scrollStamp = tick() - end) - scrollDownButton.MouseButton1Down:connect(function() - return scrollDown() - end) - scrollbar.MouseButton1Up:connect(function() - scrollStamp = tick() - end) - scrollbar.MouseButton1Down:connect(function(_, y) - if y > (scrollDrag.AbsoluteSize.y + scrollDrag.AbsolutePosition.y) then - return scrollDown(y) - elseif y < scrollDrag.AbsolutePosition.y then - return scrollUp(y) - end - end) - frame.ChildAdded:connect(function() - return recalculate(nil) - end) - frame.ChildRemoved:connect(function() - return recalculate(nil) - end) - frame.Changed:connect(function(prop) - if prop == "AbsoluteSize" then - return recalculate(nil) - end - end) - frame.AncestryChanged:connect(function() - return recalculate(nil) - end) - return frame, scrollUpButton, scrollDownButton, recalculate, scrollbar -end -local binaryGrow -binaryGrow = function(min, max, fits) - if min > max then - return min - end - local biggestLegal = min - while min <= max do - local mid = min + math.floor((max - min) / 2) - if fits(mid and (biggestLegal == nil or biggestLegal < mid)) then - biggestLegal = mid - min = mid + 1 - else - max = mid - 1 - end - end - return biggestLegal -end -local binaryShrink -binaryShrink = function(min, max, fits) - if min > max then - return min - end - local smallestLegal = max - while min <= max do - local mid = min + math.floor((max - min) / 2) - if fits(mid and (smallestLegal == nil or smallestLegal > mid)) then - smallestLegal = mid - max = mid - 1 - else - min = mid + 1 - end - end - return smallestLegal -end -local getGuiOwner -getGuiOwner = function(instance) - while (instance ~= nil) do - if instance:IsA("ScreenGui") or instance:IsA("BillboardGui") then - return instance - end - instance = instance.Parent - end - return nil -end -t.AutoTruncateTextObject = function(textLabel) - local text = textLabel.Text - local fullLabel = textLabel:Clone() - 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.Visible = false - fullLabel.Parent = textLabel - local shortText - local mouseEnterConnection - local mouseLeaveConnection - local checkForResize - checkForResize = function() - if getGuiOwner(textLabel == nil) then - return - end - textLabel.Text = text - if textLabel.TextFits then - if mouseEnterConnection then - mouseEnterConnection:disconnect() - mouseEnterConnection = nil - end - if mouseLeaveConnection then - mouseLeaveConnection:disconnect() - mouseLeaveConnection = nil - end - else - local len = string.len(text) - textLabel.Text = 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) - shortText = string.sub(text, 1, textSize) .. "~" - textLabel.Text = shortText - if not fullLabel.TextFits then - fullLabel.Size = UDim2.new(0, 10000, 1, 0) - end - 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) - if mouseEnterConnection == nil then - mouseEnterConnection = textLabel.MouseEnter:connect(function() - fullLabel.ZIndex = textLabel.ZIndex + 1 - fullLabel.Visible = true - end) - end - if mouseLeaveConnection == nil then - mouseLeaveConnection = textLabel.MouseLeave:connect(function() - fullLabel.Visible = false - end) - end - end - end - textLabel.AncestryChanged:connect(checkForResize) - textLabel.Changed:connect(function(prop) - if prop == "AbsoluteSize" then - return checkForResize() - end - end) - checkForResize() - local changeText - changeText = function(newText) - text = newText - fullLabel.Text = text - return checkForResize() - end - return textLabel, changeText -end -local TransitionTutorialPages -TransitionTutorialPages = function(fromPage, toPage, transitionFrame, currentPageValue) - if fromPage then - fromPage.Visible = false - if transitionFrame.Visible == false then - transitionFrame.Size = fromPage.Size - transitionFrame.Position = fromPage.Position - end - else - if transitionFrame.Visible == false then - transitionFrame.Size = UDim2.new(0, 50, 0, 50) - transitionFrame.Position = UDim2.new(0.5, -25, 0.5, -25) - end - end - transitionFrame.Visible = true - currentPageValue.Value = nil - local newSize, newPosition - if toPage then - toPage.Visible = true - newSize = toPage.Size - newPosition = toPage.Position - toPage.Visible = false - else - newSize = UDim2.new(0, 50, 0, 50) - newPosition = UDim2.new(0.5, -25, 0.5, -25) - end - return transitionFrame:TweenSizeAndPosition(newSize, newPosition, Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.3, true, function(state) - if state == Enum.TweenStatus.Completed then - transitionFrame.Visible = false - if toPage then - toPage.Visible = true - currentPageValue.Value = toPage - end - end - end) -end -t.CreateTutorial = function(name, tutorialKey, createButtons) - local frame = New("Frame", "Tutorial-" .. tostring(name), { - BackgroundTransparency = 1, - Size = UDim2.new(0.6, 0, 0.6, 0), - Position = UDim2.new(0.2, 0, 0.2, 0), - New("BoolValue", "Buttons", { - Value = createButtons - }) - }) - local transitionFrame = New("Frame", "TransitionFrame", { - Style = Enum.FrameStyle.RobloxRound, - Size = UDim2.new(0.6, 0, 0.6, 0), - Position = UDim2.new(0.2, 0, 0.2, 0), - Visible = false, - Parent = frame - }) - local currentPageValue = New("ObjectValue", "CurrentTutorialPage", { - Value = nil, - Parent = frame - }) - local pages = New("Frame", "Pages", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 1, 0), - Parent = frame - }) - local getVisiblePageAndHideOthers - getVisiblePageAndHideOthers = function() - local visiblePage - local children = pages:GetChildren() - if children then - for _, child in ipairs(children) do - if child.Visible then - if visiblePage then - child.Visible = false - else - visiblePage = child - end - end - end - end - return visiblePage - end - local showTutorial - showTutorial = function(alwaysShow) - if alwaysShow or UserSettings().GameSettings:GetTutorialState(tutorialKey == false) then - print("Showing tutorial-", tutorialKey) - local currentTutorialPage = getVisiblePageAndHideOthers() - local firstPage = pages:FindFirstChild("TutorialPage1") - if firstPage then - return TransitionTutorialPages(currentTutorialPage, firstPage, transitionFrame, currentPageValue) - else - return error("Could not find TutorialPage1") - end - end - end - local dismissTutorial - dismissTutorial = function() - local currentTutorialPage = getVisiblePageAndHideOthers() - if currentTutorialPage then - TransitionTutorialPages(currentTutorialPage, nil, transitionFrame, currentPageValue) - end - return UserSettings().GameSettings:SetTutorialState(tutorialKey, true) - end - local gotoPage - gotoPage = function(pageNum) - local page = pages:FindFirstChild("TutorialPage" .. pageNum) - local currentTutorialPage = getVisiblePageAndHideOthers() - return TransitionTutorialPages(currentTutorialPage, page, transitionFrame, currentPageValue) - end - return frame, showTutorial, dismissTutorial, gotoPage -end -local CreateBasicTutorialPage -CreateBasicTutorialPage = function(name, handleResize, skipTutorial, giveDoneButton) - local frame = New("Frame", "TutorialPage", { - Style = Enum.FrameStyle.RobloxRound, - Size = UDim2.new(0.6, 0, 0.6, 0), - Position = UDim2.new(0.2, 0, 0.2, 0), - Visible = false, - New("TextButton", "NextButton", { - Text = "Next", - TextColor3 = Color3.new(1, 1, 1), - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - Style = Enum.ButtonStyle.RobloxButtonDefault, - Size = UDim2.new(0, 80, 0, 32), - Position = UDim2.new(0.5, 5, 1, -32), - Active = false, - Visible = false - }), - New("TextButton", "PrevButton", { - Text = "Previous", - TextColor3 = Color3.new(1, 1, 1), - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - Style = Enum.ButtonStyle.RobloxButton, - Size = UDim2.new(0, 80, 0, 32), - Position = UDim2.new(0.5, -85, 1, -32), - Active = false, - Visible = false - }), - New("TextLabel", "Header", { - Text = name, - BackgroundTransparency = 1, - FontSize = Enum.FontSize.Size24, - Font = Enum.Font.ArialBold, - TextColor3 = Color3.new(1, 1, 1), - TextXAlignment = Enum.TextXAlignment.Center, - TextWrap = true, - Size = UDim2.new(1, -55, 0, 22), - Position = UDim2.new(0, 0, 0, 0) - }) - }) - local skipButton = New("ImageButton", "SkipButton", { - AutoButtonColor = false, - BackgroundTransparency = 1, - Image = "rbxasset://textures/ui/closeButton.png", - Size = UDim2.new(0, 25, 0, 25), - Position = UDim2.new(1, -25, 0, 0), - Parent = frame - }) - skipButton.MouseButton1Click:connect(function() - return skipTutorial() - end) - skipButton.MouseEnter:connect(function() - skipButton.Image = "rbxasset://textures/ui/closeButton_dn.png" - end) - skipButton.MouseLeave:connect(function() - skipButton.Image = "rbxasset://textures/ui/closeButton.png" - end) - if giveDoneButton then - local doneButton = New("TextButton", "DoneButton", { - Style = Enum.ButtonStyle.RobloxButtonDefault, - Text = "Done", - TextColor3 = Color3.new(1, 1, 1), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - Size = UDim2.new(0, 100, 0, 50), - Position = UDim2.new(0.5, -50, 1, -50) - }) - if skipTutorial then - doneButton.MouseButton1Click:connect(function() - return skipTutorial() - end) - end - doneButton.Parent = frame - end - local innerFrame = New("Frame", "ContentFrame", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 25), - Parent = frame - }) - if giveDoneButton then - innerFrame.Size = UDim2.new(1, 0, 1, -75) - else - innerFrame.Size = UDim2.new(1, 0, 1, -22) - end - local parentConnection - local basicHandleResize - basicHandleResize = function() - if frame.Visible and frame.Parent then - local maxSize = math.min(frame.Parent.AbsoluteSize.X, frame.Parent.AbsoluteSize.Y) - return 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() - return basicHandleResize() - end - end) - basicHandleResize() - end - end - if prop == "Visible" then - return basicHandleResize() - end - end) - return frame, innerFrame -end -t.CreateTextTutorialPage = function(name, text, skipTutorialFunc) - local frame - local contentFrame - local textLabel = New("TextLabel", { - BackgroundTransparency = 1, - TextColor3 = Color3.new(1, 1, 1), - Text = text, - TextWrap = true, - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Center, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size14, - Size = UDim2.new(1, 0, 1, 0) - }) - local handleResize - handleResize = function(minSize, maxSize) - local 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) - end - frame, contentFrame = CreateBasicTutorialPage(name, handleResize, skipTutorialFunc) - textLabel.Parent = contentFrame - return frame -end -t.CreateImageTutorialPage = function(name, imageAsset, x, y, skipTutorialFunc, giveDoneButton) - local frame - local contentFrame - local imageLabel = New("ImageLabel", { - BackgroundTransparency = 1, - Image = imageAsset, - Size = UDim2.new(0, x, 0, y), - Position = UDim2.new(0.5, -x / 2, 0.5, -y / 2) - }) - local handleResize - handleResize = function(minSize, maxSize) - local 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) - else - if x > y then - imageLabel.Size = UDim2.new(1, 0, y / x, 0) - imageLabel.Position = UDim2.new(0, 0, 0.5 - (y / x) / 2, 0) - else - 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) - end - frame, contentFrame = CreateBasicTutorialPage(name, handleResize, skipTutorialFunc, giveDoneButton) - imageLabel.Parent = contentFrame - return frame -end -t.AddTutorialPage = function(tutorial, tutorialPage) - local transitionFrame = tutorial.TransitionFrame - local currentPageValue = tutorial.CurrentTutorialPage - if not tutorial.Buttons.Value then - tutorialPage.NextButton.Parent = nil - tutorialPage.PrevButton.Parent = nil - end - local children = tutorial.Pages:GetChildren() - if children and #children > 0 then - tutorialPage.Name = "TutorialPage" .. tostring(#children + 1) - local previousPage = children[#children] - 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") - end - previousPage.NextButton.MouseButton1Click:connect(function() - return 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") - end - tutorialPage.PrevButton.MouseButton1Click:connect(function() - return TransitionTutorialPages(tutorialPage, previousPage, transitionFrame, currentPageValue) - end) - tutorialPage.PrevButton.Active = true - tutorialPage.PrevButton.Visible = true - end - tutorialPage.Parent = tutorial.Pages - else - tutorialPage.Name = "TutorialPage1" - tutorialPage.Parent = tutorial.Pages - end -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") - end - if type(userIdsForSets) ~= "table" and type(userIdsForSets) ~= "userdata" then - error("CreateSetPanel: userIdsForSets (first arg) is of type " .. tostring(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!") - end - if type(objectSelected) ~= "function" then - error("CreateSetPanel: objectSelected (second arg) is of type " .. tostring(type(objectSelected)) .. ", should be of type function!") - end - if dialogClosed and type(dialogClosed) ~= "function" then - error("CreateSetPanel: dialogClosed (third arg) is of type " .. tostring(type(dialogClosed)) .. ", should be of type function!") - end - if showAdminCategories == nil then - showAdminCategories = false - end - local arrayPosition = 1 - local insertButtons = { } - local insertButtonCons = { } - local contents - local setGui - local waterForceDirection = "NegX" - local waterForce = "None" - local waterGui, waterTypeChangedEvent - local Data = { } - Data.CurrentCategory = nil - Data.Category = { } - local SetCache = { } - local userCategoryButtons - local buttonWidth = 64 - local buttonHeight = buttonWidth - local SmallThumbnailUrl - local LargeThumbnailUrl - 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=" - else - 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 drillDownSetZIndex - drillDownSetZIndex = function(parent, index) - local children = parent:GetChildren() - for i = 1, #children do - if children[i]:IsA("GuiObject") then - children[i].ZIndex = index - end - drillDownSetZIndex(children[i], index) - end - end - local currTerrainDropDownFrame - 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 - terrainShapeMap[terrainShapes[#terrainShapes]] = 6 - local createWaterGui - createWaterGui = function() - local waterForceDirections = { - "NegX", - "X", - "NegY", - "Y", - "NegZ", - "Z" - } - local waterForces = { - "None", - "Small", - "Medium", - "Strong", - "Max" - } - local waterFrame = New("Frame", "WaterFrame", { - Style = Enum.FrameStyle.RobloxSquare, - Size = UDim2.new(0, 150, 0, 110), - Visible = false - }) - local waterForceLabel = New("TextLabel", "WaterForceLabel", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 0, 12), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size12, - TextColor3 = Color3.new(1, 1, 1), - TextXAlignment = Enum.TextXAlignment.Left, - Text = "Water Force", - Parent = waterFrame - }) - local waterForceDirLabel = waterForceLabel:Clone() - waterForceDirLabel.Name = "WaterForceDirectionLabel" - waterForceDirLabel.Text = "Water Force Direction" - waterForceDirLabel.Position = UDim2.new(0, 0, 0, 50) - waterForceDirLabel.Parent = waterFrame - waterTypeChangedEvent = New("BindableEvent", "WaterTypeChangedEvent", { - Parent = waterFrame - }) - local waterForceDirectionSelectedFunc - waterForceDirectionSelectedFunc = function(newForceDirection) - waterForceDirection = newForceDirection - return waterTypeChangedEvent:Fire({ - waterForce, - waterForceDirection - }) - end - local waterForceSelectedFunc - waterForceSelectedFunc = function(newForce) - waterForce = newForce - return 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") - 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) - waterForceDropDown.Parent = waterForceLabel - return waterFrame, waterTypeChangedEvent - end - local createSetGui - createSetGui = function() - setGui = New("ScreenGui", "SetGui", { - New("Frame", "SetPanel", { - Active = true, - BackgroundTransparency = 1, - Position = (function() - if position then - return position - else - return UDim2.new(0.2, 29, 0.1, 24) - end - end)(), - Size = (function() - if size then - return size - else - return UDim2.new(0.6, -58, 0.64, 0) - end - end)(), - Style = Enum.FrameStyle.RobloxRound, - ZIndex = 6, - Parent = setGui, - New("TextButton", "CancelButton", { - Position = UDim2.new(1, -32, 0, -2), - Size = UDim2.new(0, 34, 0, 34), - Style = Enum.ButtonStyle.RobloxButtonDefault, - ZIndex = 6, - Text = "", - Modal = true, - New("ImageLabel", "CancelImage", { - BackgroundTransparency = 1, - Image = "http://www.roblox.com/asset?id=54135717", - Position = UDim2.new(0, -2, 0, -2), - Size = UDim2.new(0, 16, 0, 16), - ZIndex = 6 - }) - }), - New("Frame", "ItemPreview", { - BackgroundTransparency = 1, - Position = UDim2.new(0.8, 5, 0.085, 0), - Size = UDim2.new(0.21, 0, 0.9, 0), - ZIndex = 6, - New("ImageLabel", "LargePreview", { - BackgroundTransparency = 1, - Image = "", - Size = UDim2.new(1, 0, 0, 170), - ZIndex = 6 - }), - New("Frame", "TextPanel", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0.45, 0), - Size = UDim2.new(1, 0, 0.55, 0), - ZIndex = 6, - New("TextLabel", "RolloverText", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 0, 48), - ZIndex = 6, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size24, - Text = "", - TextColor3 = Color3.new(1, 1, 1), - TextWrap = true, - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top - }) - }) - }), - New("Frame", "Sets", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 5), - Size = UDim2.new(0.23, 0, 1, -5), - ZIndex = 6, - New("TextLabel", "SetsHeader", { - BackgroundTransparency = 1, - Size = UDim2.new(0, 47, 0, 24), - ZIndex = 6, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size24, - Text = "Sets", - TextColor3 = Color3.new(1, 1, 1), - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top - }), - New("Frame", "Line", { - BackgroundColor3 = Color3.new(1, 1, 1), - BackgroundTransparency = 0.7, - BorderSizePixel = 0, - Position = UDim2.new(1, -3, 0.06, 0), - Size = UDim2.new(0, 3, 0.9, 0), - ZIndex = 6 - }) - }) - }) - }) - 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 = setGui.SetPanel.Sets - drillDownSetZIndex(controlFrame, 7) - return setGui - end - local createSetButton - createSetButton = function(text) - return New("TextButton", { - Text = (function() - if text then - return text - else - return "" - end - end)(), - AutoButtonColor = false, - BackgroundTransparency = 1, - BackgroundColor3 = Color3.new(1, 1, 1), - BorderSizePixel = 0, - Size = UDim2.new(1, -5, 0, 18), - ZIndex = 6, - Visible = false, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - TextColor3 = Color3.new(1, 1, 1), - TextXAlignment = Enum.TextXAlignment.Left - }) - end - local buildSetButton - buildSetButton = function(name, setId, _, _, _) - local button = createSetButton(name) - button.Text = name - button.Name = "SetButton" - button.Visible = true - New("IntValue", "SetId", { - Value = setId, - Parent = button - }) - New("StringValue", "SetName", { - Value = name, - Parent = button - }) - return button - end - local processCategory - processCategory = function(sets) - local setButtons = { } - local numSkipped = 0 - for i = 1, #sets do - 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) - end - end - return setButtons - end - local handleResize - handleResize = function() - wait() - 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) - end - local makeInsertAssetButton - makeInsertAssetButton = function() - local insertAssetButtonExample = New("Frame", "InsertAssetButtonExample", { - Position = UDim2.new(0, 128, 0, 64), - Size = UDim2.new(0, 64, 0, 64), - BackgroundTransparency = 1, - ZIndex = 6, - Visible = false, - New("IntValue", "AssetId", { - Value = 0 - }), - New("StringValue", "AssetName", { - Value = "" - }) - }) - local button = New("TextButton", "Button", { - Text = "", - Style = Enum.ButtonStyle.RobloxButton, - Position = UDim2.new(0.025, 0, 0.025, 0), - Size = UDim2.new(0.95, 0, 0.95, 0), - ZIndex = 6, - Parent = insertAssetButtonExample - }) - local buttonImage = New("ImageLabel", "ButtonImage", { - Image = "", - Position = UDim2.new(0, -7, 0, -7), - Size = UDim2.new(1, 14, 1, 14), - BackgroundTransparency = 1, - ZIndex = 7, - Parent = button - }) - 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.Image = "" - configIcon.ZIndex = 6 - configIcon.Parent = insertAssetButtonExample - return insertAssetButtonExample - end - local showLargePreview - showLargePreview = function(insertButton) - 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) - end) - end - if insertButton:FindFirstChild("AssetName") then - setGui.SetPanel.ItemPreview.TextPanel.RolloverText.Text = insertButton.AssetName.Value - end - end - local selectTerrainShape - selectTerrainShape = function(shape) - if currTerrainDropDownFrame then - return objectSelected(tostring(currTerrainDropDownFrame.AssetName.Value), tonumber(currTerrainDropDownFrame.AssetId.Value), shape) - end - end - local createTerrainTypeButton - createTerrainTypeButton = function(name, parent) - local dropDownTextButton = New("TextButton", tostring(name) .. "Button", { - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size14, - BorderSizePixel = 0, - TextColor3 = Color3.new(1, 1, 1), - Text = name, - TextXAlignment = Enum.TextXAlignment.Left, - BackgroundTransparency = 1, - ZIndex = parent.ZIndex + 1, - Size = UDim2.new(0, parent.Size.X.Offset - 2, 0, 16), - Position = UDim2.new(0, 1, 0, 0) - }) - dropDownTextButton.MouseEnter:connect(function() - dropDownTextButton.BackgroundTransparency = 0 - dropDownTextButton.TextColor3 = Color3.new(0, 0, 0) - end) - dropDownTextButton.MouseLeave:connect(function() - dropDownTextButton.BackgroundTransparency = 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.Parent.Visible = false - end - return selectTerrainShape(terrainShapeMap[dropDownTextButton.Text]) - end) - return dropDownTextButton - end - local createTerrainDropDownMenu - createTerrainDropDownMenu = function(zIndex) - local dropDown = New("Frame", "TerrainDropDown", { - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(1, 0, 0), - Size = UDim2.new(0, 200, 0, 0), - Visible = false, - ZIndex = zIndex, - 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) - shapeButton.Parent = dropDown - dropDown.Size = UDim2.new(0, 200, 0, dropDown.Size.Y.Offset + shapeButton.Size.Y.Offset) - end - return dropDown.MouseLeave:connect(function() - dropDown.Visible = false - end) - end - local createDropDownMenuButton - createDropDownMenuButton = function(parent) - local dropDownButton = New("ImageButton", "DropDownButton", { - Image = "http://www.roblox.com/asset/?id=67581509", - BackgroundTransparency = 1, - Size = UDim2.new(0, 16, 0, 16), - Position = UDim2.new(1, -24, 0, 6), - ZIndex = parent.ZIndex + 2, - Parent = parent - }) - if not setGui:FindFirstChild("TerrainDropDown") then - createTerrainDropDownMenu(8) - end - return dropDownButton.MouseButton1Click:connect(function() - setGui.TerrainDropDown.Visible = true - setGui.TerrainDropDown.Position = UDim2.new(0, parent.AbsolutePosition.X, 0, parent.AbsolutePosition.Y) - currTerrainDropDownFrame = parent - end) - end - local buildInsertButton - buildInsertButton = function() - local insertButton = makeInsertAssetButton() - insertButton.Name = "InsertAssetButton" - insertButton.Visible = true - if Data.Category[Data.CurrentCategory].SetName == "High Scalability" then - createDropDownMenuButton(insertButton) - end - local lastEnter - local mouseEnterCon = insertButton.MouseEnter:connect(function() - lastEnter = insertButton - return delay(0.1, function() - if lastEnter == insertButton then - return showLargePreview(insertButton) - end - end) - end) - return insertButton, mouseEnterCon - end - local realignButtonGrid - realignButtonGrid = function(columns) - local x = 0 - local y = 0 - for i = 1, #insertButtons do - insertButtons[i].Position = UDim2.new(0, buttonWidth * x, 0, buttonHeight * y) - x = x + 1 - if x >= columns then - x = 0 - y = y + 1 - end - end - end - local setInsertButtonImageBehavior - setInsertButtonImageBehavior = function(insertFrame, visible, name, assetId) - if visible then - insertFrame.AssetName.Value = name - insertFrame.AssetId.Value = 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 - end) - end - table.insert(insertButtonCons, insertFrame.Button.MouseButton1Click:connect(function() - local isWaterSelected = (name == "Water") and (Data.Category[Data.CurrentCategory].SetName == "High Scalability") - waterGui.Visible = isWaterSelected - if isWaterSelected then - return objectSelected(name, tonumber(assetId, nil)) - else - return objectSelected(name, tonumber(assetId)) - end - end)) - insertFrame.Visible = true - else - insertFrame.Visible = false - end - end - local loadSectionOfItems - loadSectionOfItems = function(setGui, rows, columns) - local pageSize = rows * columns - if arrayPosition > #contents then - return - end - local origArrayPos = arrayPosition - for _ = 1, pageSize + 1 do - if arrayPosition >= #contents + 1 then - break - end - local buttonCon - insertButtons[arrayPosition], buttonCon = buildInsertButton() - table.insert(insertButtonCons, buttonCon) - insertButtons[arrayPosition].Parent = setGui.SetPanel.ItemsFrame - arrayPosition = arrayPosition + 1 - end - realignButtonGrid(columns) - for index = origArrayPos, arrayPosition do - if insertButtons[index] then - if contents[index] then - if contents[index].Name == "Water" then - if Data.Category[Data.CurrentCategory].SetName == "High Scalability" then - insertButtons[index]:FindFirstChild("DropDownButton", true):Destroy() - end - end - local assetId - if useAssetVersionId then - assetId = contents[index].AssetVersionId - else - assetId = contents[index].AssetId - end - setInsertButtonImageBehavior(insertButtons[index], true, contents[index].Name, assetId) - else - break - end - else - break - end - end - end - local setSetIndex - setSetIndex = function() - Data.Category[Data.CurrentCategory].Index = 0 - local rows = 7 - local columns = math.floor(setGui.SetPanel.ItemsFrame.AbsoluteSize.X / buttonWidth) - contents = Data.Category[Data.CurrentCategory].Contents - if contents then - for i = 1, #insertButtons do - insertButtons[i]:remove() - end - for i = 1, #insertButtonCons do - if insertButtonCons[i] then - insertButtonCons[i]:disconnect() - end - end - insertButtonCons = { } - insertButtons = { } - arrayPosition = 1 - return loadSectionOfItems(setGui, rows, columns) - end - end - local selectSet - selectSet = function(button, setName, setId, _) - if button and (Data.Category[Data.CurrentCategory] ~= nil) then - if button ~= Data.Category[Data.CurrentCategory].Button then - Data.Category[Data.CurrentCategory].Button = button - if SetCache[setId] == nil then - SetCache[setId] = game:GetService("InsertService"):GetCollection(setId) - end - Data.Category[Data.CurrentCategory].Contents = SetCache[setId] - Data.Category[Data.CurrentCategory].SetName = setName - Data.Category[Data.CurrentCategory].SetId = setId - end - return setSetIndex() - end - end - local selectCategoryPage - selectCategoryPage = function(buttons, _) - if buttons ~= Data.CurrentCategory then - if Data.CurrentCategory then - for _, button in pairs(Data.CurrentCategory) do - button.Visible = false - end - end - Data.CurrentCategory = buttons - if Data.Category[Data.CurrentCategory] == nil then - Data.Category[Data.CurrentCategory] = { } - if #buttons > 0 then - return selectSet(buttons[1], buttons[1].SetName.Value, buttons[1].SetId.Value, 0) - end - else - Data.Category[Data.CurrentCategory].Button = nil - return 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 selectCategory - selectCategory = function(category) - return selectCategoryPage(category, 0) - end - local resetAllSetButtonSelection - resetAllSetButtonSelection = function() - local setButtons = setGui.SetPanel.Sets.SetsLists:GetChildren() - for i = 1, #setButtons do - 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) - end - end - end - local populateSetsFrame - populateSetsFrame = function() - 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.Parent = setGui.SetPanel.Sets.SetsLists - if i == 1 then - button.Selected = true - 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) - end - end) - button.MouseLeave:connect(function() - if not button.Selected then - button.BackgroundTransparency = 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.BackgroundTransparency = 0 - return selectSet(button, button.Text, userCategoryButtons[i].SetId.Value, 0) - end) - currRow = currRow + 1 - end - local buttons = setGui.SetPanel.Sets.SetsLists:GetChildren() - if buttons then - for i = 1, #buttons do - if buttons[i]:IsA("TextButton") then - selectSet(buttons[i], buttons[i].Text, userCategoryButtons[i].SetId.Value, 0) - selectCategory(userCategoryButtons) - break - end - end - end - end - setGui = createSetGui() - waterGui, waterTypeChangedEvent = createWaterGui() - waterGui.Position = UDim2.new(0, 55, 0, 0) - waterGui.Parent = setGui - setGui.Changed:connect(function(prop) - if prop == "AbsoluteSize" then - handleResize() - return 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.Name = "ItemsFrame" - scrollFrame.ZIndex = 6 - scrollFrame.Parent = setGui.SetPanel - scrollFrame.BackgroundTransparency = 1 - drillDownSetZIndex(controlFrame, 7) - controlFrame.Parent = setGui.SetPanel - controlFrame.Position = UDim2.new(0.76, 5, 0, 0) - local debounce = false - controlFrame.ScrollBottom.Changed:connect(function(_) - if controlFrame.ScrollBottom.Value == true then - if debounce then - return - end - debounce = true - loadSectionOfItems(setGui, rows, columns) - debounce = false - end - end) - local userData = { } - for id = 1, #userIdsForSets do - local newUserData = game:GetService("InsertService"):GetUserSets(userIdsForSets[id]) - if newUserData and #newUserData > 2 then - for category = 3, #newUserData do - if newUserData[category].Name == "High Scalability" then - 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) - populateSetsFrame() - setGui.SetPanel.CancelButton.MouseButton1Click:connect(function() - setGui.SetPanel.Visible = false - if dialogClosed ~= nil then - return dialogClosed() - end - return nil - end) - local setVisibilityFunction - setVisibilityFunction = function(visible) - if visible then - setGui.SetPanel.Visible = true - else - setGui.SetPanel.Visible = false - end - end - local getVisibilityFunction - getVisibilityFunction = function() - if setGui and setGui:FindFirstChild("SetPanel") then - return setGui.SetPanel.Visible - end - return false - end - return setGui, setVisibilityFunction, getVisibilityFunction, waterTypeChangedEvent -end -t.CreateTerrainMaterialSelector = function(size, position) - local terrainMaterialSelectionChanged = Instance.new("BindableEvent") - terrainMaterialSelectionChanged.Name = "TerrainMaterialSelectionChanged" - local selectedButton - local frame = New("Frame", "TerrainMaterialSelector", { - Size = (function() - if size then - return size - else - return UDim2.new(0, 245, 0, 230) - end - end)(), - BorderSizePixel = 0, - BackgroundColor3 = Color3.new(0, 0, 0), - Active = true - }) - if position then - frame.Position = position - end - terrainMaterialSelectionChanged.Parent = frame - local materialToImageMap = { } - local materialNames = { - "Grass", - "Sand", - "Brick", - "Granite", - "Asphalt", - "Iron", - "Aluminum", - "Gold", - "Plank", - "Log", - "Gravel", - "Cinder Block", - "Stone Wall", - "Concrete", - "Plastic (red)", - "Plastic (blue)", - "Water" - } - local currentMaterial = 1 - local getEnumFromName - getEnumFromName = function(choice) - if "Grass" == choice then - return 1 - elseif "Sand" == choice then - return 2 - elseif "Erase" == choice then - return 0 - elseif "Brick" == choice then - return 3 - elseif "Granite" == choice then - return 4 - elseif "Asphalt" == choice then - return 5 - elseif "Iron" == choice then - return 6 - elseif "Aluminum" == choice then - return 7 - elseif "Gold" == choice then - return 8 - elseif "Plank" == choice then - return 9 - elseif "Log" == choice then - return 10 - elseif "Gravel" == choice then - return 11 - elseif "Cinder Block" == choice then - return 12 - elseif "Stone Wall" == choice then - return 13 - elseif "Concrete" == choice then - return 14 - elseif "Plastic (red)" == choice then - return 15 - elseif "Plastic (blue)" == choice then - return 16 - elseif "Water" == choice then - return 17 - end - end - local getNameFromEnum - getNameFromEnum = function(choice) - if Enum.CellMaterial.Grass == choice or 1 == choice then - return "Grass" - elseif Enum.CellMaterial.Sand == choice or 2 == choice then - return "Sand" - elseif Enum.CellMaterial.Empty == choice or 0 == choice then - return "Erase" - elseif Enum.CellMaterial.Brick == choice or 3 == choice then - return "Brick" - elseif Enum.CellMaterial.Granite == choice or 4 == choice then - return "Granite" - elseif Enum.CellMaterial.Asphalt == choice or 5 == choice then - return "Asphalt" - elseif Enum.CellMaterial.Iron == choice or 6 == choice then - return "Iron" - elseif Enum.CellMaterial.Aluminum == choice or 7 == choice then - return "Aluminum" - elseif Enum.CellMaterial.Gold == choice or 8 == choice then - return "Gold" - elseif Enum.CellMaterial.WoodPlank == choice or 9 == choice then - return "Plank" - elseif Enum.CellMaterial.WoodLog == choice or 10 == choice then - return "Log" - elseif Enum.CellMaterial.Gravel == choice or 11 == choice then - return "Gravel" - elseif Enum.CellMaterial.CinderBlock == choice or 12 == choice then - return "Cinder Block" - elseif Enum.CellMaterial.MossyStone == choice or 13 == choice then - return "Stone Wall" - elseif Enum.CellMaterial.Cement == choice or 14 == choice then - return "Concrete" - elseif Enum.CellMaterial.RedPlastic == choice or 15 == choice then - return "Plastic (red)" - elseif Enum.CellMaterial.BluePlastic == choice or 16 == choice then - return "Plastic (blue)" - elseif Enum.CellMaterial.Water == choice or 17 == choice then - return "Water" - end - end - local updateMaterialChoice - updateMaterialChoice = function(choice) - currentMaterial = getEnumFromName(choice) - return terrainMaterialSelectionChanged:Fire(currentMaterial) - end - for _, v in pairs(materialNames) do - materialToImageMap[v] = { } - materialToImageMap[v].Regular = "http://www.roblox.com/asset/?id=" .. (function() - if "Grass" == v then - return "56563112" - elseif "Sand" == v then - return "62356652" - elseif "Brick" == v then - return "65961537" - elseif "Granite" == v then - return "67532153" - elseif "Asphalt" == v then - return "67532038" - elseif "Iron" == v then - return "67532093" - elseif "Aluminum" == v then - return "67531995" - elseif "Gold" == v then - return "67532118" - elseif "Plastic (red)" == v then - return "67531848" - elseif "Plastic (blue)" == v then - return "67531924" - elseif "Plank" == v then - return "67532015" - elseif "Log" == v then - return "67532051" - elseif "Gravel" == v then - return "67532206" - elseif "Cinder Block" == v then - return "67532103" - elseif "Stone Wall" == v then - return "67531804" - elseif "Concrete" == v then - return "67532059" - elseif "Water" == v then - return "81407474" - else - return "66887593" - end - 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) - scrollFrame.Parent = frame - scrollUp.Parent = frame - scrollUp.Visible = true - scrollUp.Position = UDim2.new(1, -19, 0, 0) - scrollDown.Parent = frame - scrollDown.Visible = true - scrollDown.Position = UDim2.new(1, -19, 1, -17) - local goToNewMaterial - goToNewMaterial = function(buttonWrap, materialName) - updateMaterialChoice(materialName) - buttonWrap.BackgroundTransparency = 0 - selectedButton.BackgroundTransparency = 1 - selectedButton = buttonWrap - end - local createMaterialButton - createMaterialButton = function(name) - local buttonWrap = New("TextButton", tostring(name), { - Text = "", - Size = UDim2.new(0, 32, 0, 32), - BackgroundColor3 = Color3.new(1, 1, 1), - BorderSizePixel = 0, - BackgroundTransparency = 1, - AutoButtonColor = false, - New("NumberValue", "EnumType", { - Value = 0 - }) - }) - local imageButton = New("ImageButton", tostring(name), { - AutoButtonColor = false, - BackgroundTransparency = 1, - Size = UDim2.new(0, 30, 0, 30), - Position = UDim2.new(0, 1, 0, 1), - Parent = buttonWrap, - Image = materialToImageMap[name].Regular - }) - imageButton.MouseEnter:connect(function() - buttonWrap.BackgroundTransparency = 0 - end) - imageButton.MouseLeave:connect(function() - if selectedButton ~= buttonWrap then - buttonWrap.BackgroundTransparency = 1 - end - end) - imageButton.MouseButton1Click:connect(function() - if selectedButton ~= buttonWrap then - return goToNewMaterial(buttonWrap, tostring(name)) - end - end) - return buttonWrap - end - for i = 1, #materialNames do - local imageButton = createMaterialButton(materialNames[i]) - if materialNames[i] == "Grass" then - selectedButton = imageButton - imageButton.BackgroundTransparency = 0 - end - imageButton.Parent = scrollFrame - end - local forceTerrainMaterialSelection - forceTerrainMaterialSelection = function(newMaterialType) - 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 string.find(buttons[i].Name, matName) then - goToNewMaterial(buttons[i], matName) - return - end - end - end - frame.Changed:connect(function(prop) - if prop == "AbsoluteSize" then - return recalculateScroll() - end - end) - recalculateScroll() - return frame, terrainMaterialSelectionChanged, forceTerrainMaterialSelection -end -t.CreateLoadingFrame = function(name, size, position) - game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=35238053") - local loadingFrame = New("Frame", "LoadingFrame", { - Style = Enum.FrameStyle.RobloxRound, - Size = (function() - if size then - return size - else - return UDim2.new(0, 300, 0, 160) - end - end)(), - Position = (function() - if position then - return position - else - return UDim2.new(0.5, -150, 0.5, -80) - end - end)(), - New("TextLabel", "loadingName", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 0, 18), - Position = UDim2.new(0, 0, 0, 2), - Font = Enum.Font.Arial, - Text = name, - TextColor3 = Color3.new(1, 1, 1), - TextStrokeTransparency = 1, - FontSize = Enum.FontSize.Size18 - }) - }) - local loadingBar = New("Frame", "LoadingBar", { - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(79 / 255, 79 / 255, 79 / 255), - Position = UDim2.new(0, 0, 0, 41), - Size = UDim2.new(1, 0, 0, 30), - Parent = loadingFrame - }) - local loadingGreenBar = New("ImageLabel", "LoadingGreenBar", { - Image = "http://www.roblox.com/asset/?id=35238053", - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(0, 0, 1, 0), - Visible = false, - Parent = loadingBar - }) - local loadingPercent = New("TextLabel", "LoadingPercent", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 1, 0), - Size = UDim2.new(1, 0, 0, 14), - Font = Enum.Font.Arial, - Text = "0%", - FontSize = Enum.FontSize.Size14, - TextColor3 = Color3.new(1, 1, 1), - Parent = loadingBar - }) - local cancelButton = New("TextButton", "CancelButton", { - Position = UDim2.new(0.5, -60, 1, -40), - Size = UDim2.new(0, 120, 0, 40), - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - TextColor3 = Color3.new(1, 1, 1), - Text = "Cancel", - Style = Enum.ButtonStyle.RobloxButton, - Parent = loadingFrame - }) - local cancelButtonClicked = New("BindableEvent", "CancelButtonClicked", { - Parent = cancelButton - }) - cancelButton.MouseButton1Click:connect(function() - return cancelButtonClicked:Fire() - end) - local updateLoadingGuiPercent - updateLoadingGuiPercent = function(percent, tweenAction, tweenLength) - if percent and type(percent ~= "number") then - error("updateLoadingGuiPercent expects number as argument, got " .. tostring(type(percent)) .. " instead") - end - local newSize - if percent < 0 then - newSize = UDim2.new(0, 0, 1, 0) - elseif percent > 1 then - newSize = UDim2.new(1, 0, 1, 0) - else - 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") - end - if newSize.X.Scale > 0 then - loadingGreenBar.Visible = true - return loadingGreenBar:TweenSize(newSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenLength, true) - else - return 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) - end - end - loadingGreenBar.Changed:connect(function(prop) - if prop == "Size" then - 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) - local createMenuButton - createMenuButton = function(size, position, text, fontsize, name, parent) - local button = New("TextButton", name, { - AutoButtonColor = false, - BackgroundTransparency = 1, - Position = position, - Size = size, - Font = Enum.Font.ArialBold, - FontSize = fontsize, - Text = text, - TextColor3 = Color3.new(1, 1, 1), - BorderSizePixel = 0, - BackgroundColor3 = Color3.new(20 / 255, 20 / 255, 20 / 255) - }) - 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.BackgroundTransparency = 1 - end) - button.Parent = parent - return button - end - local dragBar = New("Frame", tostring(name) .. "DragBar", { - BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255), - BorderColor3 = Color3.new(0, 0, 0), - Size = (function() - if size then - return UDim2.new(size.X.Scale, size.X.Offset, 0, 20) + UDim2.new(0, 20, 0, 0) - else - return UDim2.new(0, 183, 0, 20) - end - end)(), - Active = true, - Draggable = true - }) - if position then - dragBar.Position = position - end - 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) - end) - dragBar.Parent = parent - New("TextLabel", "BarNameLabel", { - Text = " " .. tostring(name), - TextColor3 = Color3.new(1, 1, 1), - TextStrokeTransparency = 0, - Size = UDim2.new(1, 0, 1, 0), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - TextXAlignment = Enum.TextXAlignment.Left, - BackgroundTransparency = 1, - Parent = dragBar - }) - local closeButton = createMenuButton(UDim2.new(0, 15, 0, 17), UDim2.new(1, -16, 0.5, -8), "X", Enum.FontSize.Size14, "CloseButton", dragBar) - local closeEvent = New("BindableEvent", "CloseEvent", { - Parent = closeButton - }) - closeButton.MouseButton1Click:connect(function() - closeEvent:Fire() - closeButton.BackgroundTransparency = 1 - end) - local helpButton = createMenuButton(UDim2.new(0, 15, 0, 17), UDim2.new(1, -51, 0.5, -8), "?", Enum.FontSize.Size14, "HelpButton", dragBar) - local helpFrame = New("Frame", "HelpFrame", { - BackgroundColor3 = Color3.new(0, 0, 0), - Size = UDim2.new(0, 300, 0, 552), - Position = UDim2.new(1, 5, 0, 0), - Active = true, - BorderSizePixel = 0, - Visible = false, - Parent = dragBar - }) - helpButton.MouseButton1Click:connect(function() - helpFrame.Visible = not helpFrame.Visible - if helpFrame.Visible then - helpButton.Selected = true - helpButton.BackgroundTransparency = 0 - local screenGui = getScreenGuiAncestor(helpFrame) - if screenGui then - if helpFrame.AbsolutePosition.X + helpFrame.AbsoluteSize.X > screenGui.AbsoluteSize.X then - helpFrame.Position = UDim2.new(0, -5 - helpFrame.AbsoluteSize.X, 0, 0) - else - helpFrame.Position = UDim2.new(1, 5, 0, 0) - end - else - helpFrame.Position = UDim2.new(1, 5, 0, 0) - end - else - helpButton.Selected = false - helpButton.BackgroundTransparency = 1 - end - end) - 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 = New("Frame", "MinimizeFrame", { - BackgroundColor3 = Color3.new(73 / 255, 73 / 255, 73 / 255), - BorderColor3 = Color3.new(0, 0, 0), - Position = UDim2.new(0, 0, 1, 0), - Size = (function() - if size then - return UDim2.new(size.X.Scale, size.X.Offset, 0, 50) + UDim2.new(0, 20, 0, 0) - else - return UDim2.new(0, 183, 0, 50) - end - end)(), - Visible = false, - Parent = dragBar - }) - local minimizeBigButton = New("TextButton", "MinimizeButton", { - Position = UDim2.new(0.5, -50, 0.5, -20), - Size = UDim2.new(0, 100, 0, 40), - Style = Enum.ButtonStyle.RobloxButton, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - TextColor3 = Color3.new(1, 1, 1), - Text = "Show", - Parent = minimizeFrame - }) - local separatingLine = New("Frame", "SeparatingLine", { - BackgroundColor3 = Color3.new(115 / 255, 115 / 255, 115 / 255), - BorderSizePixel = 0, - Position = UDim2.new(1, -18, 0.5, -7), - Size = UDim2.new(0, 1, 0, 14), - Parent = dragBar - }) - local otherSeparatingLine = separatingLine:clone() - otherSeparatingLine.Position = UDim2.new(1, -35, 0.5, -7) - otherSeparatingLine.Parent = dragBar - local widgetContainer = New("Frame", "WidgetContainer", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 1, 0), - BorderColor3 = Color3.new(0, 0, 0) - }) - if not scrollable then - widgetContainer.BackgroundTransparency = 0 - 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) - end - else - if scrollable then - widgetContainer.Size = UDim2.new(0, 163, 0, 400) - else - widgetContainer.Size = UDim2.new(0, dragBar.AbsoluteSize.X, 0, 400) - end - end - if position then - widgetContainer.Position = widgetContainer.Position + UDim2.new(0, 0, 0, 20) - end - local frame, control, verticalDragger - if scrollable then - 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.Active = true - frame.Parent = widgetContainer - control.Parent = dragBar - control.BackgroundColor3 = Color3.new(72 / 255, 72 / 255, 72 / 255) - control.BorderSizePixel = 0 - control.BackgroundTransparency = 0 - control.Position = UDim2.new(1, -21, 1, 1) - if size then - control.Size = UDim2.new(0, 21, size.Y.Scale, size.Y.Offset) - else - control.Size = UDim2.new(0, 21, 0, 400) - end - control:FindFirstChild("ScrollDownButton").Position = UDim2.new(0, 0, 1, -20) - New("Frame", "FakeLine", { - BorderSizePixel = 0, - BackgroundColor3 = Color3.new(0, 0, 0), - Size = UDim2.new(0, 1, 1, 1), - Position = UDim2.new(1, 0, 0, 0), - Parent = control - }) - verticalDragger = New("TextButton", "VerticalDragger", { - ZIndex = 2, - AutoButtonColor = false, - BackgroundColor3 = Color3.new(50 / 255, 50 / 255, 50 / 255), - BorderColor3 = Color3.new(0, 0, 0), - Size = UDim2.new(1, 20, 0, 20), - Position = UDim2.new(0, 0, 1, 0), - Active = true, - Text = "", - Parent = widgetContainer - }) - local scrubFrame = New("Frame", "ScrubFrame", { - BackgroundColor3 = Color3.new(1, 1, 1), - BorderSizePixel = 0, - Position = UDim2.new(0.5, -5, 0.5, 0), - Size = UDim2.new(0, 10, 0, 1), - ZIndex = 5, - Parent = verticalDragger - }) - local scrubTwo = scrubFrame:clone() - 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.Parent = verticalDragger - local areaSoak = New("TextButton", "AreaSoak", { - Size = UDim2.new(1, 0, 1, 0), - BackgroundTransparency = 1, - BorderSizePixel = 0, - Text = "", - ZIndex = 10, - Visible = false, - Active = true, - Parent = getScreenGuiAncestor(parent) - }) - local draggingVertical = false - local startYPos - 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) - end) - verticalDragger.MouseButton1Down:connect(function(_, y) - draggingVertical = true - areaSoak.Visible = true - startYPos = y - end) - areaSoak.MouseButton1Up:connect(function() - draggingVertical = false - areaSoak.Visible = false - 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 - return - 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 - 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) - end - end) - end - local switchMinimize - switchMinimize = function() - minimizeFrame.Visible = not minimizeFrame.Visible - if scrollable then - frame.Visible = not frame.Visible - verticalDragger.Visible = not verticalDragger.Visible - control.Visible = not control.Visible - else - widgetContainer.Visible = not widgetContainer.Visible - end - if minimizeFrame.Visible then - minimizeButton.Text = "+" - else - minimizeButton.Text = "-" - end - end - minimizeBigButton.MouseButton1Click:connect(function() - return switchMinimize() - end) - minimizeButton.MouseButton1Click:connect(function() - return switchMinimize() - end) - if scrollable then - return dragBar, frame, helpFrame, closeEvent - else - return dragBar, widgetContainer, helpFrame, closeEvent - end -end -t.Help = function(funcNameOrFunc) - 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'" - elseif 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" - elseif 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" - elseif 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" - elseif 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" - elseif 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)" - elseif 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." - elseif 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" - elseif 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." - elseif 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." - elseif 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 +print'[Mercury]: Loaded corescript 45284430'local a a=function(b,c,d)if not(d~= +nil)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for +g,h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h +end elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e. +Parent=f return e end local b,c={},nil c=function(d,e,f,g,h,i)local j,k k= +function()if game:IsAncestorOf(d)then if not j then j=e[f]:connect(g)if h then +return h()end end else if j then j:disconnect()if i then return i()end end end +end local l=d.AncestryChanged:connect(k)k()return l end local d d=function(e) +local f=e while f and not f:IsA'ScreenGui'do f=f.Parent end return f end local e +e=function(f,g,h,i)local j,k=1,{}for l,m in ipairs(g)do local n=a('TextButton', +'Button'..tostring(j),{Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size18, +AutoButtonColor=true,Modal=true,Style=(function()if m['Style']then return m. +Style else return Enum.ButtonStyle.RobloxButton end end)(),Text=m.Text, +TextColor3=Color3.new(1,1,1),Parent=f})n.MouseButton1Click:connect(m.Function)k[ +j]=n j=j+1 end local n=j-1 if n==1 then f.Button1.Position=UDim2.new(0.35,0,h. +Scale,h.Offset)f.Button1.Size=UDim2.new(0.4,0,i.Scale,i.Offset)elseif n==2 then +f.Button1.Position=UDim2.new(0.1,0,h.Scale,h.Offset)f.Button1.Size=UDim2.new( +0.26666666666666666,0,i.Scale,i.Offset)f.Button2.Position=UDim2.new(0.55,0,h. +Scale,h.Offset)f.Button2.Size=UDim2.new(0.35,0,i.Scale,i.Offset)elseif n>=3 then +local o,p=0.1/n,0.9/n j=1 while j<=n do k[j].Position=UDim2.new(o*j+(j-1)*p,0,h. +Scale,h.Offset)k[j].Size=UDim2.new(p,0,i.Scale,i.Offset)j=j+1 end end end local +f f=function(g,h,i,j,k)local l,m=k-1,math.min(1,math.max(0,(g-j.AbsolutePosition +.X)/j.AbsoluteSize.X))local n,o=math.modf(m*l)if o>0.5 then n=n+1 end m=n/l +local p=math.ceil(m*l)if i.Value~=(p+1)then i.Value=p+1 h.Position=UDim2.new(m,- +h.AbsoluteSize.X/2,h.Position.Y.Scale,h.Position.Y.Offset)end end local g g= +function(h)h.Visible=false if areaSoakMouseMoveCon then return +areaSoakMouseMoveCon:disconnect()end end b.CreateStyledMessageDialog=function(h, +i,j,k)local l,m=a('Frame','MessageDialog',{Size=UDim2.new(0.5,0,0,165),Position= +UDim2.new(0.25,0,0.5,-72.5),Active=true,Style=Enum.FrameStyle.RobloxRound,a( +'TextLabel','Title',{Text=h,TextStrokeTransparency=0,BackgroundTransparency=1, +TextColor3=Color3.new(0.8666666666666667,0.8666666666666667,0.8666666666666667), +Position=UDim2.new(0,80,0,0),Size=UDim2.new(1,-80,0,40),Font=Enum.Font.ArialBold +,FontSize=Enum.FontSize.Size36,TextXAlignment=Enum.TextXAlignment.Center, +TextYAlignment=Enum.TextYAlignment.Center}),a('TextLabel','Message',{Text=i, +TextStrokeTransparency=0,TextColor3=Color3.new(0.8666666666666667, +0.8666666666666667,0.8666666666666667),Position=UDim2.new(0.025,80,0,45),Size= +UDim2.new(0.95,-80,0,55),BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize= +Enum.FontSize.Size18,TextWrap=true,TextXAlignment=Enum.TextXAlignment.Left, +TextYAlignment=Enum.TextYAlignment.Top})}),a('ImageLabel','StyleImage',{ +BackgroundTransparency=1,Position=UDim2.new(0,5,0,15)})if j=='error'or j== +'Error'then m.Size=UDim2.new(0,71,0,71)m.Image= +'http://www.roblox.com/asset?id=42565285'elseif j=='notify'or j=='Notify'then m. +Size=UDim2.new(0,71,0,71)m.Image='http://www.roblox.com/asset?id=42604978'elseif +j=='confirm'or j=='Confirm'then m.Size=UDim2.new(0,74,0,76)m.Image= +'http://www.roblox.com/asset?id=42557901'else return b.CreateMessageDialog(h,i,k +)end m.Parent=l e(l,k,UDim.new(0,105),UDim.new(0,40))return l end b. +CreateMessageDialog=function(h,i,j)local k=a('Frame','MessageDialog',{Size=UDim2 +.new(0.5,0,0.5,0),Position=UDim2.new(0.25,0,0.25,0),Active=true,Style=Enum. +FrameStyle.RobloxRound,a('TextLabel','Title',{Text=h,BackgroundTransparency=1, +TextColor3=Color3.new(0.8666666666666667,0.8666666666666667,0.8666666666666667), +Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0.15,0),Font=Enum.Font.ArialBold, +FontSize=Enum.FontSize.Size36,TextXAlignment=Enum.TextXAlignment.Center, +TextYAlignment=Enum.TextYAlignment.Center}),a('TextLabel','Message',{Text=i, +TextColor3=Color3.new(0.8666666666666667,0.8666666666666667,0.8666666666666667), +Position=UDim2.new(0.025,0,0.175,0),Size=UDim2.new(0.95,0,0.55,0), +BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size18, +TextWrap=true,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum. +TextYAlignment.Top})})e(k,j,UDim.new(0.8,0),UDim.new(0.15,0))return k end b. +CreateDropDownMenu=function(h,i,j)local k,l=UDim.new(0,100),UDim.new(0,32)local +m=a('Frame','DropDownMenu',{BackgroundTransparency=1,Size=UDim2.new(k,l)})local +n,o,p,q=a('TextButton','DropDownMenuButton',{TextWrap=true,TextColor3=Color3. +new(1,1,1),Text='Choose One',Font=Enum.Font.ArialBold,FontSize=Enum.FontSize. +Size18,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum. +TextYAlignment.Center,BackgroundTransparency=1,AutoButtonColor=true,Style=Enum. +ButtonStyle.RobloxButton,Size=UDim2.new(1,0,1,0),Parent=m,ZIndex=2,a( +'ImageLabel','Icon',{Active=false,Image= +'http://www.roblox.com/asset/?id=45732894',BackgroundTransparency=1,Size=UDim2. +new(0,11,0,6),Position=UDim2.new(1,-11,0.5,-2),ZIndex=2})}),#h,#h,false if p>6 +then q=true p=6 end local r,s,t,u,v,w,x,y=a('TextButton','List',{Text='', +BackgroundTransparency=1,Style=Enum.ButtonStyle.RobloxButton,Visible=false, +Active=true,Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,(1+p)*0.8,0),Parent=m +,ZIndex=2}),a('TextButton','ChoiceButton',{BackgroundTransparency=1, +BorderSizePixel=0,Text='ReplaceMe',TextColor3=Color3.new(1,1,1),TextXAlignment= +Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Center, +BackgroundColor3=Color3.new(1,1,1),Font=Enum.Font.Arial,FontSize=Enum.FontSize. +Size18,Size=(function()if q then return UDim2.new(1,-13,0.8/((p+1)*0.8),0)else +return UDim2.new(1,0,0.8/((p+1)*0.8),0)end end)(),TextWrap=true,ZIndex=2}),a( +'TextButton','AreaSoak',{Text='',BackgroundTransparency=1,Active=true,Size=UDim2 +.new(1,0,1,0),Visible=false,ZIndex=3}),false,nil,nil,0,nil y=function(z)r.ZIndex +=z+1 if v then v.ZIndex=z+3 end if w then w.ZIndex=z+3 end local A=r: +GetChildren()if A then for B,C in ipairs(A)do if C.Name=='ChoiceButton'then C. +ZIndex=z+2 elseif C.Name=='ClickCaptureButton'then C.ZIndex=z end end end end +local z,A=1,nil A=function()if v then v.Active=z>1 end if w then w.Active=z+p<=o +end local B=r:GetChildren()if not B then return end local C=1 for D,E in ipairs( +B)do if E.Name=='ChoiceButton'then if C=z+p then E.Visible=false else E. +Position=UDim2.new(0,0,((C-z+1)*0.8)/((p+1)*0.8),0)E.Visible=true end E. +TextColor3=Color3.new(1,1,1)E.BackgroundTransparency=1 C=C+1 end end end local B +B=function()u=not u t.Visible=not t.Visible n.Visible=not u r.Visible=u if u +then y(4)else y(2)end if q then return A()end end r.MouseButton1Click:connect(B) +local C C=function(D)local E,F,G=false,r:GetChildren(),1 if F then for H,I in +ipairs(F)do if I.Name=='ChoiceButton'then if I.Text==D then I.Font=Enum.Font. +ArialBold E=true z=G else I.Font=Enum.Font.Arial end G=G+1 end end end if not D +then n.Text='Choose One'z=1 else if not E then error( +'Invalid Selection Update -- '..D)end if z+p>o+1 then z=o-p+1 end n.Text=D end +end local D D=function()if z+p<=o then z=z+1 A()return true end return false end +local E E=function()if z>1 then z=z-1 A()return true end return false end if q +then v=a('ImageButton','ScrollUpButton',{BackgroundTransparency=1,Image= +'rbxasset://textures/ui/scrollbuttonUp.png',Size=UDim2.new(0,17,0,17),Position= +UDim2.new(1,-11,(0.8)/((p+1)*0.8),0)})v.MouseButton1Click:connect(function()x=x+ +1 end)v.MouseLeave:connect(function()x=x+1 end)v.MouseButton1Down:connect( +function()x=x+1 E()local F=x wait(0.5)while F==x do if E()==false then break end +wait(0.1)end end)v.Parent=r w=a('ImageButton','ScrollDownButton',{ +BackgroundTransparency=1,Image='rbxasset://textures/ui/scrollbuttonDown.png', +Size=UDim2.new(0,17,0,17),Position=UDim2.new(1,-11,1,-11),Parent=r})w. +MouseButton1Click:connect(function()x=x+1 end)w.MouseLeave:connect(function()x=x ++1 end)w.MouseButton1Down:connect(function()x=x+1 D()local F=x wait(0.5)while F +==x do if D()==false then break end wait(0.1)end end)a('ImageLabel','ScrollBar', +{Image='rbxasset://textures/ui/scrollbar.png',BackgroundTransparency=1,Size= +UDim2.new(0,18,(p*0.8)/((p+1)*0.8),-32),Position=UDim2.new(1,-11,(0.8)/((p+1)* +0.8),19),Parent=r})end for F,G in ipairs(h)do local H=s:clone()if j then H. +RobloxLocked=true end H.Text=G H.Parent=r H.MouseButton1Click:connect(function() +H.TextColor3=Color3.new(1,1,1)H.BackgroundTransparency=1 C(G)i(G)return B()end)H +.MouseEnter:connect(function()H.TextColor3=Color3.new(0,0,0)H. +BackgroundTransparency=0 end)H.MouseLeave:connect(function()H.TextColor3=Color3. +new(1,1,1)H.BackgroundTransparency=1 end)end A()m.AncestryChanged:connect( +function(H,I)if I==nil then t.Parent=nil else t.Parent=d(m)end end)n. +MouseButton1Click:connect(B)t.MouseButton1Click:connect(B)return m,C end b. +CreatePropertyDropDownMenu=function(h,i,j)local k,l,m=j:GetEnumItems(),{},{}for +n,o in ipairs(k)do l[n]=o.Name m[o.Name]=o end local p,q p,q=b. +CreateDropDownMenu(l,function(r)h[i]=m[r]end)c(p,h,'Changed',function(r)if r==i +then return q(h[i].Name)end end,function()return q(h[i].Name)end)return p end b. +GetFontHeight=function(h,i)if h==nil or i==nil then error +'Font and FontSize must be non-nil'end if h==Enum.Font.Legacy then if Enum. +FontSize.Size8==i then return 12 elseif Enum.FontSize.Size9==i then return 14 +elseif Enum.FontSize.Size10==i then return 15 elseif Enum.FontSize.Size11==i +then return 17 elseif Enum.FontSize.Size12==i then return 18 elseif Enum. +FontSize.Size14==i then return 21 elseif Enum.FontSize.Size18==i then return 27 +elseif Enum.FontSize.Size24==i then return 36 elseif Enum.FontSize.Size36==i +then return 54 elseif Enum.FontSize.Size48==i then return 72 else return error +'Unknown FontSize'end elseif h==Enum.Font.Arial or h==Enum.Font.ArialBold then +if Enum.FontSize.Size8==i then return 8 elseif Enum.FontSize.Size9==i then +return 9 elseif Enum.FontSize.Size10==i then return 10 elseif Enum.FontSize. +Size11==i then return 11 elseif Enum.FontSize.Size12==i then return 12 elseif +Enum.FontSize.Size14==i then return 14 elseif Enum.FontSize.Size18==i then +return 18 elseif Enum.FontSize.Size24==i then return 24 elseif Enum.FontSize. +Size36==i then return 36 elseif Enum.FontSize.Size48==i then return 48 else +return error'Unknown FontSize'end else return error('Unknown Font '..h)end end +local h h=function(i,j,k)local l,m=i.AbsoluteSize.Y,i.AbsoluteSize.Y for n,o in +ipairs(j)do if o:IsA'TextLabel'or o:IsA'TextButton'then local p=o:IsA'TextLabel' +if p then m=m-k['TextLabelPositionPadY']else m=m-k['TextButtonPositionPadY']end +o.Position=UDim2.new(o.Position.X.Scale,o.Position.X.Offset,0,l-m)o.Size=UDim2. +new(o.Size.X.Scale,o.Size.X.Offset,0,m)if o.TextFits and o.TextBounds.Y=0)end end end b.LayoutGuiObjects=function(i,j,k)if not i:IsA'GuiObject'then +error'Frame must be a GuiObject'end for l,m in ipairs(j)do if not m:IsA +'GuiObject'then error'All elements that are layed out must be of type GuiObject' +end end if not k then k={}end if not k['TextLabelSizePadY']then k[ +'TextLabelSizePadY']=0 end if not k['TextLabelPositionPadY']then k[ +'TextLabelPositionPadY']=0 end if not k['TextButtonSizePadY']then k[ +'TextButtonSizePadY']=12 end if not k['TextButtonPositionPadY']then k[ +'TextButtonPositionPadY']=2 end local n=a('Frame','WrapperFrame',{ +BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),Parent=i})for o,p in ipairs(j) +do p.Parent=n end local q q=function()wait()return h(n,j,k)end i.Changed: +connect(function(r)if r=='AbsoluteSize'then return q(nil)end end)i. +AncestryChanged:connect(q)return h(n,j,k)end b.CreateSlider=function(i,j,k)local +n=a('Frame','SliderGui',{Size=UDim2.new(1,0,1,0),BackgroundTransparency=1})local +o,p=a('IntValue','SliderSteps',{Value=i,Parent=n}),a('TextButton','AreaSoak',{ +Text='',BackgroundTransparency=1,Active=false,Size=UDim2.new(1,0,1,0),Visible= +false,ZIndex=4})n.AncestryChanged:connect(function(q,r)if r==nil then p.Parent= +nil else p.Parent=d(n)end end)local q,r=a('IntValue','SliderPosition',{Value=0, +Parent=n}),a('TextButton','Bar',{Text='',AutoButtonColor=false,BackgroundColor3= +Color3.new(0,0,0),Size=(function()if type(j)=='number'then return UDim2.new(0,j, +0,5)else return UDim2.new(0,200,0,5)end end)(),BorderColor3=Color3.new( +0.37254901960784315,0.37254901960784315,0.37254901960784315),ZIndex=2,Parent=n}) +if k['X']and k['X']['Scale']and k['X']['Offset']and k['Y']and k['Y']['Scale']and +k['Y']['Offset']then r.Position=k end local s,t=a('ImageButton','Slider',{ +BackgroundTransparency=1,Image='rbxasset://textures/ui/Slider.png',Position= +UDim2.new(0,0,0.5,-10),Size=UDim2.new(0,20,0,20),ZIndex=3,Parent=r}),nil p. +MouseLeave:connect(function()if p.Visible then return g(p)end end)p. +MouseButton1Up:connect(function()if p.Visible then return g(p)end end)s. +MouseButton1Down:connect(function()p.Visible=true if t then t:disconnect()end t= +p.MouseMoved:connect(function(u,v)return f(u,s,q,r,i)end)end)s.MouseButton1Up: +connect(function()return g(p)end)q.Changed:connect(function(u)q.Value=math.min(i +,math.max(1,q.Value))local v=(q.Value-1)/(i-1)s.Position=UDim2.new(v,-s. +AbsoluteSize.X/2,s.Position.Y.Scale,s.Position.Y.Offset)end)r.MouseButton1Down: +connect(function(u,v)return f(u,s,q,r,i)end)return n,q,o end b. +CreateTrueScrollingFrame=function()local i,j,k,n,o,p,q=nil,nil,nil,nil,false,{}, +a('Frame','ScrollingFrame',{Active=true,Size=UDim2.new(1,0,1,0),ClipsDescendants +=true})local r=a('Frame','ControlFrame',{BackgroundTransparency=1,Size=UDim2. +new(0,18,1,0),Position=UDim2.new(1,-20,0,0),Parent=q})local s,t,u=a('BoolValue', +'ScrollBottom',{Value=false,Parent=r}),a('BoolValue','scrollUp',{Value=false, +Parent=r}),a('TextButton','ScrollUpButton',{Text='',AutoButtonColor=false, +BackgroundColor3=Color3.new(0,0,0),BorderColor3=Color3.new(1,1,1), +BackgroundTransparency=0.5,Size=UDim2.new(0,18,0,18),ZIndex=2,Parent=r})for v=1, +6 do a('Frame','tri'..tostring(v),{BorderColor3=Color3.new(1,1,1),ZIndex=3, +BackgroundTransparency=0.5,Size=UDim2.new(0,12-((v-1)*2),0,0),Position=UDim2. +new(0,3+(v-1),0.5,2-(v-1)),Parent=u})end u.MouseEnter:connect(function()u. +BackgroundTransparency=0.1 local v=u:GetChildren()for w=1,#v do v[w]. +BackgroundTransparency=0.1 end end)u.MouseLeave:connect(function()u. +BackgroundTransparency=0.5 local v=u:GetChildren()for w=1,#v do v[w]. +BackgroundTransparency=0.5 end end)local v=u:clone()v.Name='ScrollDownButton'v. +Position=UDim2.new(0,0,1,-18)local w=v:GetChildren()for x=1,#w do w[x].Position= +UDim2.new(0,3+(x-1),0.5,-2+(x-1))end v.MouseEnter:connect(function()v. +BackgroundTransparency=0.1 w=v:GetChildren()for x=1,#w do w[x]. +BackgroundTransparency=0.1 end end)v.MouseLeave:connect(function()v. +BackgroundTransparency=0.5 w=v:GetChildren()for x=1,#w do w[x]. +BackgroundTransparency=0.5 end end)v.Parent=r local x=a('Frame','ScrollTrack',{ +BackgroundTransparency=1,Size=UDim2.new(0,18,1,-38),Position=UDim2.new(0,0,0,19) +,Parent=r})local y=a('TextButton','ScrollBar',{BackgroundColor3=Color3.new(0,0,0 +),BorderColor3=Color3.new(1,1,1),BackgroundTransparency=0.5,AutoButtonColor= +false,Text='',Active=true,ZIndex=2,Size=UDim2.new(0,18,0.1,0),Position=UDim2. +new(0,0,0,0),Parent=x})local z=a('Frame','ScrollNub',{BorderColor3=Color3.new(1, +1,1),Size=UDim2.new(0,10,0,0),Position=UDim2.new(0.5,-5,0.5,0),ZIndex=2, +BackgroundTransparency=0.5,Parent=y})local A=z:clone()A.Position=UDim2.new(0.5,- +5,0.5,-2)A.Parent=y local B=z:clone()B.Position=UDim2.new(0.5,-5,0.5,2)B.Parent= +y y.MouseEnter:connect(function()y.BackgroundTransparency=0.1 z. +BackgroundTransparency=0.1 A.BackgroundTransparency=0.1 B.BackgroundTransparency +=0.1 end)y.MouseLeave:connect(function()y.BackgroundTransparency=0.5 z. +BackgroundTransparency=0.5 A.BackgroundTransparency=0.5 B.BackgroundTransparency +=0.5 end)local C,D=a('ImageButton','mouseDrag',{Active=false,Size=UDim2.new(1.5, +0,1.5,0),AutoButtonColor=false,BackgroundTransparency=1,Position=UDim2.new(-0.25 +,0,-0.25,0),ZIndex=10}),nil D=function(E,F,G)local H=y.Position if F(x.AbsolutePosition.y+x.AbsoluteSize.y)then y.Position=UDim2.new(y.Position.X. +Scale,y.Position.X.Offset,1-I,0)return(H~=y.Position)end local J=(F-x. +AbsolutePosition.y-G)/x.AbsoluteSize.y if J+I>1 then J=1-I s.Value=true t.Value= +false elseif J<=0 then J=0 t.Value=true s.Value=false else t.Value=false s.Value +=false end y.Position=UDim2.new(y.Position.X.Scale,y.Position.X.Offset,J,0) +return(H~=y.Position)end local E E=function(F)if not F or not F:IsA'GuiObject' +then return end if F==r then return end if F:IsDescendantOf(r)then return end if +not F.Visible then return end if(i and i>F.AbsolutePosition.Y)or not i then i=F. +AbsolutePosition.Y end if(j and j<(F.AbsolutePosition.Y+F.AbsoluteSize.Y))or not +j then j=F.AbsolutePosition.Y+F.AbsoluteSize.Y end local G=F:GetChildren()for H= +1,#G do E(G[H])end end local F F=function()local G=q:GetChildren()for H=1,#G do +E(G[H])end end local G G=function()o=true local H=0 if y.Position.Y.Scale>0 then +if y.Visible then H=y.Position.Y.Scale/((x.AbsoluteSize.Y-y.AbsoluteSize.Y)/x. +AbsoluteSize.Y)else H=0 end end if H>0.99 then H=1 end local I,J=(q.AbsoluteSize +.Y-(j-i))*H,q:GetChildren()for K=1,#J do if J[K]~=r then J[K].Position=UDim2. +new(J[K].Position.X.Scale,J[K].Position.X.Offset,0,math.ceil(J[K]. +AbsolutePosition.Y)-math.ceil(i+I))end end i=nil j=nil F()o=false end local H H= +function()if not j or not i then return end local I=math.abs(j-i)if I==0 then y. +Visible=false v.Visible=false u.Visible=false if k then k:disconnect()k=nil end +if n then n:disconnect()n=nil end return end local J=q.AbsoluteSize.Y/I if J>=1 +then y.Visible=false v.Visible=false u.Visible=false G()else y.Visible=true v. +Visible=true u.Visible=true y.Size=UDim2.new(y.Size.X.Scale,y.Size.X.Offset,J,0) +end local K=(q.AbsolutePosition.Y-i)/I y.Position=UDim2.new(y.Position.X.Scale,y +.Position.X.Offset,K,-y.AbsoluteSize.X/2)if y.AbsolutePosition.y(x.AbsolutePosition.y+x +.AbsoluteSize.y)then local L=y.AbsoluteSize.Y/x.AbsoluteSize.Y y.Position=UDim2. +new(y.Position.X.Scale,y.Position.X.Offset,1-L,0)end end local I,J,K=7,false,nil +K=function()if J then return end J=true if D(0,y.AbsolutePosition.Y-I,0)then G() +end J=false end local L,M=false,nil M=function()if L then return end L=true if +D(0,y.AbsolutePosition.Y+I,0)then G()end L=false end t=function(N)if u.Active +then local O=tick()local P,Q=O,nil Q=C.MouseButton1Up:connect(function()O=tick() +C.Parent=nil return Q:disconnect()end)C.Parent=d(y)K()wait(0.2)b=tick()local R= +0.1 while O==P do K()if N and N>y.AbsolutePosition.y then break end if not u. +Active then break end if tick()-b>5 then R=0 elseif tick()-b>2 then R=0.06 end +wait(R)end end end local N N=function(O)if v.Active then local P=tick()local Q,R +=P,nil R=C.MouseButton1Up:connect(function()P=tick()C.Parent=nil return R: +disconnect()end)C.Parent=d(y)M()wait(0.2)b=tick()local S=0.1 while P==Q do M()if +O and O<(y.AbsolutePosition.y+y.AbsoluteSize.x)then break end if not v.Active +then break end if tick()-b>5 then S=0 elseif tick()-b>2 then S=0.06 end wait(S) +end end end y.MouseButton1Down:connect(function(O,P)if y.Active then local Q,R= +tick(),P-y.AbsolutePosition.y if k then k:disconnect()k=nil end if n then n: +disconnect()n=nil end local S=false k=C.MouseMoved:connect(function(T,U)if S +then return end S=true if D(T,U,R)then G()end S=false end)n=C.MouseButton1Up: +connect(function()Q=tick()C.Parent=nil k:disconnect()k=nil n:disconnect()drag= +nil end)C.Parent=d(y)end end)local O=0 u.MouseButton1Down:connect(function() +return t()end)v.MouseButton1Down:connect(function()return N()end)local P P= +function()scrollStamp=tick()end u.MouseButton1Up:connect(P)v.MouseButton1Up: +connect(P)y.MouseButton1Up:connect(P)local Q Q=function()local R,S=i,j i=nil j= +nil F()if(i~=R)or(j~=S)then return H()end end local R R=function(S,T)if o then +return end if not S.Visible then return end if T=='Size'or T=='Position'then +wait()return Q()end end q.DescendantAdded:connect(function(S)if not S:IsA +'GuiObject'then return end if S.Visible then wait()Q()end p[S]=S.Changed: +connect(function(T)return R(S,T)end)end)q.DescendantRemoving:connect(function(S) +if not S:IsA'GuiObject'then return end if p[S]then p[S]:disconnect()p[S]=nil end +wait()return Q()end)q.Changed:connect(function(S)if S=='AbsoluteSize'then if not +j or not i then return end Q()return H()end end)return q,r end b. +CreateScrollingFrame=function(i,j)local k,n,o,p,q=a('Frame','ScrollingFrame',{ +BackgroundTransparency=1,Size=UDim2.new(1,0,1,0)}),a('ImageButton', +'ScrollUpButton',{BackgroundTransparency=1,Image= +'rbxasset://textures/ui/scrollbuttonUp.png',Size=UDim2.new(0,17,0,17)}),a( +'ImageButton','ScrollDownButton',{BackgroundTransparency=1,Image= +'rbxasset://textures/ui/scrollbuttonDown.png',Size=UDim2.new(0,17,0,17)}),a( +'ImageButton','ScrollBar',{Image='rbxasset://textures/ui/scrollbar.png', +BackgroundTransparency=1,Size=UDim2.new(0,18,0,150)}),0 local r,s,t=a( +'ImageButton','ScrollDrag',{Image='http://www.roblox.com/asset/?id=61367186', +Size=UDim2.new(1,0,0,16),BackgroundTransparency=1,Active=true,Parent=p}),a( +'ImageButton','mouseDrag',{Active=false,Size=UDim2.new(1.5,0,1.5,0), +AutoButtonColor=false,BackgroundTransparency=1,Position=UDim2.new(-0.25,0,-0.25, +0),ZIndex=10}),'simple'if j and tostring(j)then t=j end local u,v,w,x=1,0,0,nil +x=function()w=0 local y={}if i then for z,A in ipairs(i)do if A.Parent==k then +table.insert(y,A)end end else local z=k:GetChildren()if z then for A,B in +ipairs(z)do if B:IsA'GuiObject'then table.insert(y,B)end end end end if#y==0 +then n.Active=false o.Active=false r.Active=false u=1 return end if u>#y then u= +#y end if u<1 then u=1 end local z,A,B,C,D,E,F,G,H=k.AbsoluteSize.Y,k. +AbsoluteSize.Y,k.AbsoluteSize.X,0,0,true,0,#y,0 G=u while G<=#y and F=B then F=F+H H=0 C=y[G].AbsoluteSize.X end if y[G]. +AbsoluteSize.Y>H then H=y[G].AbsoluteSize.Y end G=G+1 end F=F+H H=0 G=u-1 C=0 +while F+H=1 do C=C+y[G].AbsoluteSize.X D=D+1 if C>=B then v=D-1 D=0 C=y +[G].AbsoluteSize.X if F+H<=z then F=F+H if u<=v then u=1 break else u=u-v end H= +0 else break end end if y[G].AbsoluteSize.Y>H then H=y[G].AbsoluteSize.Y end G=G +-1 end if(G==0)and(F+H<=z)then u=1 end C=0 D=0 E=true local I,J,K=0,0,0 if y[1] +then K=math.ceil(math.floor(math.fmod(z,y[1].AbsoluteSize.X))/2)J=math.ceil(math +.floor(math.fmod(B,y[1].AbsoluteSize.Y))/2)end for L,M in ipairs(y)do if L=B then if E then v=D-1 E=false end C=0 A=A-M.AbsoluteSize +.Y end M.Position=UDim2.new(M.Position.X.Scale,C+J,0,z-A+K)C=C+M.AbsoluteSize.X +M.Visible=((A-M.AbsoluteSize.Y)>=0)if M.Visible then w=w+1 end I=M.AbsoluteSize +end end end n.Active=(u>1)if I==0 then o.Active=false else o.Active=((A-I.Y)<0) +end r.Active=#y>w r.Visible=r.Active end local y y=function()local z={}w=0 if i +then for A,B in ipairs(i)do if B.Parent==k then table.insert(z,B)end end else +local A=k:GetChildren()if A then for B,C in ipairs(A)do if C:IsA'GuiObject'then +table.insert(z,C)end end end end if#z==0 then n.Active=false o.Active=false r. +Active=false u=1 return end if u>#z then u=#z end local A,B,C,D=k.AbsoluteSize.Y +,k.AbsoluteSize.Y,0,#z while C=1 do if D>=u then C=C+z[D].AbsoluteSize. +Y else if C+z[D].AbsoluteSize.Y<=A then C=C+z[D].AbsoluteSize.Y if u<=1 then u=1 +break else u=u-1 end else break end end D=D-1 end D=u for E,F in ipairs(z)do if +E=0 +then F.Visible=true w=w+1 else F.Visible=false end end end end n.Active=(u>1)o. +Active=(B<0)r.Active=#z>w r.Visible=r.Active end local z z=function()local A,B=0 +,k:GetChildren()if B then for C,D in ipairs(B)do if D:IsA'GuiObject'then A=A+1 +end end end if not r.Parent then return end local C=r.Parent.AbsoluteSize.y*(1/( +A-w+1))if C<16 then C=16 end r.Size=UDim2.new(r.Size.X.Scale,r.Size.X.Offset,r. +Size.Y.Scale,C)local D=(u-1)/(A-w)if D>1 then D=1 elseif D<0 then D=0 end local +E=0 if D~=0 then E=(D*p.AbsoluteSize.y)-(D*r.AbsoluteSize.y)end r.Position=UDim2 +.new(r.Position.X.Scale,r.Position.X.Offset,r.Position.Y.Scale,E)end local A,B= +false,nil B=function()if A then return end A=true wait()local C,D if t=='grid' +then C,D=pcall(function()return x()end)elseif t=='simple'then C,D=pcall(function +()return y()end)end if not C then print(D)end z()A=false end local C C=function( +)u=u-v if u<1 then u=1 end return B(nil)end local D D=function()u=u+v return B( +nil)end local E E=function(F)if n.Active then q=tick()local G,H=q,nil H=s. +MouseButton1Up:connect(function()q=tick()s.Parent=nil return H:disconnect()end)s +.Parent=d(p)C()wait(0.2)b=tick()local I=0.1 while q==G do C()if F and F>r. +AbsolutePosition.y then break end if not n.Active then break end if tick()-b>5 +then I=0 elseif tick()-b>2 then I=0.06 end wait(I)end end end local F F=function +(G)if o.Active then q=tick()local H,I=q,nil I=s.MouseButton1Up:connect(function( +)q=tick()s.Parent=nil return I:disconnect()end)s.Parent=d(p)D()wait(0.2)b=tick() +local J=0.1 while q==H do D()if G and G<(r.AbsolutePosition.y+r.AbsoluteSize.x) +then break end if not o.Active then break end if tick()-b>5 then J=0 elseif +tick()-b>2 then J=0.06 end wait(J)end end end r.MouseButton1Down:connect( +function(G,H)if r.Active then q=tick()local I,J,K=H-r.AbsolutePosition.y,nil,nil +J=s.MouseMoved:connect(function(L,M)local N,O,P=p.AbsolutePosition.y,p. +AbsoluteSize.y,r.AbsoluteSize.y local Q=N+O-P M=M-I M=MQ and Q or +M M=M-N local R,S=0,k:GetChildren()if S then for T,U in ipairs(S)do if U:IsA +'GuiObject'then R=R+1 end end end local T,U,V=M/(O-P),v,R-(w-1)local W=math. +floor((T*V)+0.5)+U if W(r.AbsoluteSize.y+r.AbsolutePosition. +y)then return F(I)elseif Ik then return j end local o=j while j<=k do +local p=j+math.floor((k-j)/2)if n(p and(o==nil or on then return k end local p=n +while k<=n do local q=k+math.floor((n-k)/2)if o(q and(p==nil or p>q))then p=q n= +q-1 else k=q+1 end end return p end local k k=function(n)while(n~=nil)do if n: +IsA'ScreenGui'or n:IsA'BillboardGui'then return n end n=n.Parent end return nil +end b.AutoTruncateTextObject=function(n)local o,p=n.Text,n:Clone()p.Name='Full' +..n.Name p.BorderSizePixel=0 p.BackgroundTransparency=0 p.Text=o p. +TextXAlignment=Enum.TextXAlignment.Center p.Position=UDim2.new(0,-3,0,0)p.Size= +UDim2.new(0,100,1,0)p.Visible=false p.Parent=n local q,r,s,t t=function()if k(n +==nil)then return end n.Text=o if n.TextFits then if r then r:disconnect()r=nil +end if s then s:disconnect()s=nil end else local u=string.len(o)n.Text=o..'~' +local v=i(0,u,function(v)if v==0 then n.Text='~'else n.Text=string.sub(o,1,v).. +'~'end return n.TextFits end)q=string.sub(o,1,v)..'~'n.Text=q if not p.TextFits +then p.Size=UDim2.new(0,10000,1,0)end local w=j(n.AbsoluteSize.X,p.AbsoluteSize. +X,function(w)p.Size=UDim2.new(0,w,1,0)return p.TextFits end)p.Size=UDim2.new(0,w ++6,1,0)if r==nil then r=n.MouseEnter:connect(function()p.ZIndex=n.ZIndex+1 p. +Visible=true end)end if s==nil then s=n.MouseLeave:connect(function()p.Visible= +false end)end end end n.AncestryChanged:connect(t)n.Changed:connect(function(u) +if u=='AbsoluteSize'then return t()end end)t()local u u=function(v)o=v p.Text=o +return t()end return n,u end local n n=function(o,p,q,r)if o then o.Visible= +false if q.Visible==false then q.Size=o.Size q.Position=o.Position end else if q +.Visible==false then q.Size=UDim2.new(0,50,0,50)q.Position=UDim2.new(0.5,-25,0.5 +,-25)end end q.Visible=true r.Value=nil local s,t if p then p.Visible=true s=p. +Size t=p.Position p.Visible=false else s=UDim2.new(0,50,0,50)t=UDim2.new(0.5,-25 +,0.5,-25)end return q:TweenSizeAndPosition(s,t,Enum.EasingDirection.InOut,Enum. +EasingStyle.Quad,0.3,true,function(u)if u==Enum.TweenStatus.Completed then q. +Visible=false if p then p.Visible=true r.Value=p end end end)end b. +CreateTutorial=function(o,p,q)local r=a('Frame','Tutorial-'..tostring(o),{ +BackgroundTransparency=1,Size=UDim2.new(0.6,0,0.6,0),Position=UDim2.new(0.2,0, +0.2,0),a('BoolValue','Buttons',{Value=q})})local s,t,u,v=a('Frame', +'TransitionFrame',{Style=Enum.FrameStyle.RobloxRound,Size=UDim2.new(0.6,0,0.6,0) +,Position=UDim2.new(0.2,0,0.2,0),Visible=false,Parent=r}),a('ObjectValue', +'CurrentTutorialPage',{Value=nil,Parent=r}),a('Frame','Pages',{ +BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),Parent=r}),nil v=function() +local w,x=nil,u:GetChildren()if x then for y,z in ipairs(x)do if z.Visible then +if w then z.Visible=false else w=z end end end end return w end local w w= +function(x)if x or UserSettings().GameSettings:GetTutorialState(p==false)then +print('Showing tutorial-',p)local y,z=v(),u:FindFirstChild'TutorialPage1'if z +then return n(y,z,s,t)else return error'Could not find TutorialPage1'end end end +local x x=function()local y=v()if y then n(y,nil,s,t)end return UserSettings(). +GameSettings:SetTutorialState(p,true)end local y y=function(z)local A,B=u: +FindFirstChild('TutorialPage'..z),v()return n(B,A,s,t)end return r,w,x,y end +local o o=function(p,q,r,s)local t=a('Frame','TutorialPage',{Style=Enum. +FrameStyle.RobloxRound,Size=UDim2.new(0.6,0,0.6,0),Position=UDim2.new(0.2,0,0.2, +0),Visible=false,a('TextButton','NextButton',{Text='Next',TextColor3=Color3.new( +1,1,1),Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size18,Style=Enum.ButtonStyle +.RobloxButtonDefault,Size=UDim2.new(0,80,0,32),Position=UDim2.new(0.5,5,1,-32), +Active=false,Visible=false}),a('TextButton','PrevButton',{Text='Previous', +TextColor3=Color3.new(1,1,1),Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size18, +Style=Enum.ButtonStyle.RobloxButton,Size=UDim2.new(0,80,0,32),Position=UDim2. +new(0.5,-85,1,-32),Active=false,Visible=false}),a('TextLabel','Header',{Text=p, +BackgroundTransparency=1,FontSize=Enum.FontSize.Size24,Font=Enum.Font.ArialBold, +TextColor3=Color3.new(1,1,1),TextXAlignment=Enum.TextXAlignment.Center,TextWrap= +true,Size=UDim2.new(1,-55,0,22),Position=UDim2.new(0,0,0,0)})})local u=a( +'ImageButton','SkipButton',{AutoButtonColor=false,BackgroundTransparency=1,Image +='rbxasset://textures/ui/closeButton.png',Size=UDim2.new(0,25,0,25),Position= +UDim2.new(1,-25,0,0),Parent=t})u.MouseButton1Click:connect(function()return r() +end)u.MouseEnter:connect(function()u.Image= +'rbxasset://textures/ui/closeButton_dn.png'end)u.MouseLeave:connect(function()u. +Image='rbxasset://textures/ui/closeButton.png'end)if s then local v=a( +'TextButton','DoneButton',{Style=Enum.ButtonStyle.RobloxButtonDefault,Text= +'Done',TextColor3=Color3.new(1,1,1),Font=Enum.Font.ArialBold,FontSize=Enum. +FontSize.Size18,Size=UDim2.new(0,100,0,50),Position=UDim2.new(0.5,-50,1,-50)})if +r then v.MouseButton1Click:connect(function()return r()end)end v.Parent=t end +local v=a('Frame','ContentFrame',{BackgroundTransparency=1,Position=UDim2.new(0, +0,0,25),Parent=t})if s then v.Size=UDim2.new(1,0,1,-75)else v.Size=UDim2.new(1,0 +,1,-22)end local w,x x=function()if t.Visible and t.Parent then local y=math. +min(t.Parent.AbsoluteSize.X,t.Parent.AbsoluteSize.Y)return q(200,y)end end t. +Changed:connect(function(y)if y=='Parent'then if(w~=nil)then w:disconnect()w=nil +end if t.Parent and t.Parent:IsA'GuiObject'then w=t.Parent.Changed:connect( +function(z)if z=='AbsoluteSize'then wait()return x()end end)x()end end if y== +'Visible'then return x()end end)return t,v end b.CreateTextTutorialPage=function +(p,q,r)local s,t,u,v=nil,nil,a('TextLabel',{BackgroundTransparency=1,TextColor3= +Color3.new(1,1,1),Text=q,TextWrap=true,TextXAlignment=Enum.TextXAlignment.Left, +TextYAlignment=Enum.TextYAlignment.Center,Font=Enum.Font.Arial,FontSize=Enum. +FontSize.Size14,Size=UDim2.new(1,0,1,0)}),nil v=function(w,x)local y=j(w,x, +function(y)s.Size=UDim2.new(0,y,0,y)return u.TextFits end)s.Size=UDim2.new(0,y,0 +,y)s.Position=UDim2.new(0.5,-y/2,0.5,-y/2)end s,t=o(p,v,r)u.Parent=t return s +end b.CreateImageTutorialPage=function(p,q,r,s,t,u)local v,w,x,y=nil,nil,a( +'ImageLabel',{BackgroundTransparency=1,Image=q,Size=UDim2.new(0,r,0,s),Position= +UDim2.new(0.5,-r/2,0.5,-s/2)}),nil y=function(z,A)local B=j(z,A,function(B) +return B>=r and B>=s end)if B>=r and B>=s then x.Size=UDim2.new(0,r,0,s)x. +Position=UDim2.new(0.5,-r/2,0.5,-s/2)else if r>s then x.Size=UDim2.new(1,0,s/r,0 +)x.Position=UDim2.new(0,0,0.5-(s/r)/2,0)else x.Size=UDim2.new(r/s,0,1,0)x. +Position=UDim2.new(0.5-(r/s)/2,0,0,0)end end B=B+50 v.Size=UDim2.new(0,B,0,B)v. +Position=UDim2.new(0.5,-B/2,0.5,-B/2)end v,w=o(p,y,t,u)x.Parent=w return v end b +.AddTutorialPage=function(p,q)local r,s=p.TransitionFrame,p.CurrentTutorialPage +if not p.Buttons.Value then q.NextButton.Parent=nil q.PrevButton.Parent=nil end +local t=p.Pages:GetChildren()if t and#t>0 then q.Name='TutorialPage'..tostring(# +t+1)local u=t[#t]if not u:IsA'GuiObject'then error +'All elements under Pages must be GuiObjects'end if p.Buttons.Value then if u. +NextButton.Active then error +[[NextButton already Active on previousPage, please only add pages with RbxGui.AddTutorialPage function]] +end u.NextButton.MouseButton1Click:connect(function()return n(u,q,r,s)end)u. +NextButton.Active=true u.NextButton.Visible=true if q.PrevButton.Active then +error +[[PrevButton already Active on tutorialPage, please only add pages with RbxGui.AddTutorialPage function]] +end q.PrevButton.MouseButton1Click:connect(function()return n(q,u,r,s)end)q. +PrevButton.Active=true q.PrevButton.Visible=true end q.Parent=p.Pages else q. +Name='TutorialPage1'q.Parent=p.Pages end end b.CreateSetPanel=function(p,q,r,s,t +,u,v)if not p then error +[[CreateSetPanel: userIdsForSets (first arg) is nil, should be a table of number ids]] +end if type(p)~='table'and type(p)~='userdata'then error( +'CreateSetPanel: userIdsForSets (first arg) is of type '..tostring(type(p)).. +', should be of type table or userdata')end if not q then error +[[CreateSetPanel: objectSelected (second arg) is nil, should be a callback function!]] +end if type(q)~='function'then error( +'CreateSetPanel: objectSelected (second arg) is of type '..tostring(type(q)).. +', should be of type function!')end if r and type(r)~='function'then error( +'CreateSetPanel: dialogClosed (third arg) is of type '..tostring(type(r)).. +', should be of type function!')end if u==nil then u=false end local w,x,y,z,A,B +,C,D,E,F=1,{},{},nil,nil,'NegX','None',nil,nil,{}F.CurrentCategory=nil F. +Category={}local G,H,I={},nil,64 local J,K,L,M=I,nil,nil,game:GetService +'ContentProvider'.BaseUrl:lower()if v then L=M.. +[[Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&assetversionid=]]K=M.. +[[Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=75&ht=75&assetversionid=]]else L=M.. +'Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&aid='K=M.. +'Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=75&ht=75&aid='end local N N=function( +O,P)local Q=O:GetChildren()for R=1,#Q do if Q[R]:IsA'GuiObject'then Q[R].ZIndex= +P end N(Q[R],P)end end local O,P,Q=nil,{'Block','Vertical Ramp','Corner Wedge', +'Inverse Corner Wedge','Horizontal Ramp','Auto-Wedge'},{}for R=1,#P do Q[P[R]]=R +-1 end Q[P[#P]]=6 local R R=function()local S,T,U={'NegX','X','NegY','Y','NegZ', +'Z'},{'None','Small','Medium','Strong','Max'},a('Frame','WaterFrame',{Style=Enum +.FrameStyle.RobloxSquare,Size=UDim2.new(0,150,0,110),Visible=false})local V=a( +'TextLabel','WaterForceLabel',{BackgroundTransparency=1,Size=UDim2.new(1,0,0,12) +,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size12,TextColor3=Color3.new(1, +1,1),TextXAlignment=Enum.TextXAlignment.Left,Text='Water Force',Parent=U})local +W=V:Clone()W.Name='WaterForceDirectionLabel'W.Text='Water Force Direction'W. +Position=UDim2.new(0,0,0,50)W.Parent=U E=a('BindableEvent', +'WaterTypeChangedEvent',{Parent=U})local X X=function(Y)B=Y return E:Fire{C,B} +end local Y Y=function(Z)C=Z return E:Fire{C,B}end local Z,_=b. +CreateDropDownMenu(S,X)Z.Size=UDim2.new(1,0,0,25)Z.Position=UDim2.new(0,0,1,3)_ +'NegX'Z.Parent=W local aa,ab=b.CreateDropDownMenu(T,Y)ab'None'aa.Size=UDim2.new( +1,0,0,25)aa.Position=UDim2.new(0,0,1,3)aa.Parent=V return U,E end local aa aa= +function()A=a('ScreenGui','SetGui',{a('Frame','SetPanel',{Active=true, +BackgroundTransparency=1,Position=(function()if t then return t else return +UDim2.new(0.2,29,0.1,24)end end)(),Size=(function()if s then return s else +return UDim2.new(0.6,-58,0.64,0)end end)(),Style=Enum.FrameStyle.RobloxRound, +ZIndex=6,Parent=A,a('TextButton','CancelButton',{Position=UDim2.new(1,-32,0,-2), +Size=UDim2.new(0,34,0,34),Style=Enum.ButtonStyle.RobloxButtonDefault,ZIndex=6, +Text='',Modal=true,a('ImageLabel','CancelImage',{BackgroundTransparency=1,Image= +'http://www.roblox.com/asset?id=54135717',Position=UDim2.new(0,-2,0,-2),Size= +UDim2.new(0,16,0,16),ZIndex=6})}),a('Frame','ItemPreview',{ +BackgroundTransparency=1,Position=UDim2.new(0.8,5,0.085,0),Size=UDim2.new(0.21,0 +,0.9,0),ZIndex=6,a('ImageLabel','LargePreview',{BackgroundTransparency=1,Image= +'',Size=UDim2.new(1,0,0,170),ZIndex=6}),a('Frame','TextPanel',{ +BackgroundTransparency=1,Position=UDim2.new(0,0,0.45,0),Size=UDim2.new(1,0,0.55, +0),ZIndex=6,a('TextLabel','RolloverText',{BackgroundTransparency=1,Size=UDim2. +new(1,0,0,48),ZIndex=6,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size24, +Text='',TextColor3=Color3.new(1,1,1),TextWrap=true,TextXAlignment=Enum. +TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top})})}),a('Frame', +'Sets',{BackgroundTransparency=1,Position=UDim2.new(0,0,0,5),Size=UDim2.new(0.23 +,0,1,-5),ZIndex=6,a('TextLabel','SetsHeader',{BackgroundTransparency=1,Size= +UDim2.new(0,47,0,24),ZIndex=6,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize. +Size24,Text='Sets',TextColor3=Color3.new(1,1,1),TextXAlignment=Enum. +TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top}),a('Frame','Line',{ +BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=0.7,BorderSizePixel=0, +Position=UDim2.new(1,-3,0.06,0),Size=UDim2.new(0,3,0.9,0),ZIndex=6})})})})local +ab,S=b.CreateTrueScrollingFrame()ab.Size=UDim2.new(1,-6,0.94,0)ab.Position=UDim2 +.new(0,0,0.06,0)ab.BackgroundTransparency=1 ab.Name='SetsLists'ab.ZIndex=6 ab. +Parent=A.SetPanel.Sets N(S,7)return A end local ab ab=function(S)return a( +'TextButton',{Text=(function()if S then return S else return''end end)(), +AutoButtonColor=false,BackgroundTransparency=1,BackgroundColor3=Color3.new(1,1,1 +),BorderSizePixel=0,Size=UDim2.new(1,-5,0,18),ZIndex=6,Visible=false,Font=Enum. +Font.Arial,FontSize=Enum.FontSize.Size18,TextColor3=Color3.new(1,1,1), +TextXAlignment=Enum.TextXAlignment.Left})end local S S=function(T,U,V,W,X)local +Y=ab(T)Y.Text=T Y.Name='SetButton'Y.Visible=true a('IntValue','SetId',{Value=U, +Parent=Y})a('StringValue','SetName',{Value=T,Parent=Y})return Y end local T T= +function(U)local X,Y={},0 for Z=1,#U do if not u and U[Z].Name=='Beta'then Y=Y+1 +else X[Z-Y]=S(U[Z].Name,U[Z].CategoryId,U[Z].ImageAssetId,Z-Y,#U)end end return +X end local U U=function()wait()local X=A.SetPanel.ItemPreview X.LargePreview. +Size=UDim2.new(1,0,0,X.AbsoluteSize.X)X.LargePreview.Position=UDim2.new(0.5,-X. +LargePreview.AbsoluteSize.X/2,0,0)X.TextPanel.Position=UDim2.new(0,0,0,X. +LargePreview.AbsoluteSize.Y)X.TextPanel.Size=UDim2.new(1,0,0,X.AbsoluteSize.Y-X. +LargePreview.AbsoluteSize.Y)end local X X=function()local Y=a('Frame', +'InsertAssetButtonExample',{Position=UDim2.new(0,128,0,64),Size=UDim2.new(0,64,0 +,64),BackgroundTransparency=1,ZIndex=6,Visible=false,a('IntValue','AssetId',{ +Value=0}),a('StringValue','AssetName',{Value=''})})local Z=a('TextButton', +'Button',{Text='',Style=Enum.ButtonStyle.RobloxButton,Position=UDim2.new(0.025,0 +,0.025,0),Size=UDim2.new(0.95,0,0.95,0),ZIndex=6,Parent=Y})local _=a( +'ImageLabel','ButtonImage',{Image='',Position=UDim2.new(0,-7,0,-7),Size=UDim2. +new(1,14,1,14),BackgroundTransparency=1,ZIndex=7,Parent=Z})local ac=_:clone()ac. +Name='ConfigIcon'ac.Visible=false ac.Position=UDim2.new(1,-23,1,-24)ac.Size= +UDim2.new(0,16,0,16)ac.Image=''ac.ZIndex=6 ac.Parent=Y return Y end local ac ac= +function(Y)if Y:FindFirstChild'AssetId'then delay(0,function()game:GetService +'ContentProvider':Preload(L..tostring(Y.AssetId.Value))A.SetPanel.ItemPreview. +LargePreview.Image='LargeThumbnailUrl'..tostring(Y.AssetId.Value)end)end if Y: +FindFirstChild'AssetName'then A.SetPanel.ItemPreview.TextPanel.RolloverText.Text +=Y.AssetName.Value end end local Y Y=function(Z)if O then return q(tostring(O. +AssetName.Value),tonumber(O.AssetId.Value),Z)end end local Z Z=function(_,ad) +local ae=a('TextButton',tostring(_)..'Button',{Font=Enum.Font.ArialBold,FontSize +=Enum.FontSize.Size14,BorderSizePixel=0,TextColor3=Color3.new(1,1,1),Text=_, +TextXAlignment=Enum.TextXAlignment.Left,BackgroundTransparency=1,ZIndex=ad. +ZIndex+1,Size=UDim2.new(0,ad.Size.X.Offset-2,0,16),Position=UDim2.new(0,1,0,0)}) +ae.MouseEnter:connect(function()ae.BackgroundTransparency=0 ae.TextColor3=Color3 +.new(0,0,0)end)ae.MouseLeave:connect(function()ae.BackgroundTransparency=1 ae. +TextColor3=Color3.new(1,1,1)end)ae.MouseButton1Click:connect(function()ae. +BackgroundTransparency=1 ae.TextColor3=Color3.new(1,1,1)if ae.Parent and ae. +Parent:IsA'GuiObject'then ae.Parent.Visible=false end return Y(Q[ae.Text])end) +return ae end local ad ad=function(ae)local _=a('Frame','TerrainDropDown',{ +BackgroundColor3=Color3.new(0,0,0),BorderColor3=Color3.new(1,0,0),Size=UDim2. +new(0,200,0,0),Visible=false,ZIndex=ae,Parent=A})for af=1,#P do local ag=Z(P[af] +,_)ag.Position=UDim2.new(0,1,0,(af-1)*ag.Size.Y.Offset)ag.Parent=_ _.Size=UDim2. +new(0,200,0,_.Size.Y.Offset+ag.Size.Y.Offset)end return _.MouseLeave:connect( +function()_.Visible=false end)end local ae ae=function(af)local ag=a( +'ImageButton','DropDownButton',{Image='http://www.roblox.com/asset/?id=67581509' +,BackgroundTransparency=1,Size=UDim2.new(0,16,0,16),Position=UDim2.new(1,-24,0,6 +),ZIndex=af.ZIndex+2,Parent=af})if not A:FindFirstChild'TerrainDropDown'then ad( +8)end return ag.MouseButton1Click:connect(function()A.TerrainDropDown.Visible= +true A.TerrainDropDown.Position=UDim2.new(0,af.AbsolutePosition.X,0,af. +AbsolutePosition.Y)O=af end)end local af af=function()local ag=X()ag.Name= +'InsertAssetButton'ag.Visible=true if F.Category[F.CurrentCategory].SetName== +'High Scalability'then ae(ag)end local _ local ah=ag.MouseEnter:connect(function +()_=ag return delay(0.1,function()if _==ag then return ac(ag)end end)end)return +ag,ah end local ag ag=function(ah)local _,ai=0,0 for aj=1,#x do x[aj].Position= +UDim2.new(0,I*_,0,J*ai)_=_+1 if _>=ah then _=0 ai=ai+1 end end end local ah ah= +function(ai,aj,_,ak)if aj then ai.AssetName.Value=_ ai.AssetId.Value=ak local al +=K..ak if al~=ai.Button.ButtonImage.Image then delay(0,function()game:GetService +'ContentProvider':Preload(K..ak)ai.Button.ButtonImage.Image=K..ak end)end table. +insert(y,ai.Button.MouseButton1Click:connect(function()local am=(_=='Water')and( +F.Category[F.CurrentCategory].SetName=='High Scalability')D.Visible=am if am +then return q(_,tonumber(ak,nil))else return q(_,tonumber(ak))end end))ai. +Visible=true else ai.Visible=false end end local ai ai=function(aj,ak,al)local +am=ak*al if w>#z then return end local _=w for an=1,am+1 do if w>=#z+1 then +break end local ao x[w],ao=af()table.insert(y,ao)x[w].Parent=aj.SetPanel. +ItemsFrame w=w+1 end ag(al)for an=_,w do if x[an]then if z[an]then if z[an].Name +=='Water'then if F.Category[F.CurrentCategory].SetName=='High Scalability'then x +[an]:FindFirstChild('DropDownButton',true):Destroy()end end local ao if v then +ao=z[an].AssetVersionId else ao=z[an].AssetId end ah(x[an],true,z[an].Name,ao) +else break end else break end end end local aj aj=function()F.Category[F. +CurrentCategory].Index=0 local ak,al=7,math.floor(A.SetPanel.ItemsFrame. +AbsoluteSize.X/I)z=F.Category[F.CurrentCategory].Contents if z then for am=1,#x +do x[am]:remove()end for am=1,#y do if y[am]then y[am]:disconnect()end end y={}x +={}w=1 return ai(A,ak,al)end end local ak ak=function(al,am,an,ao)if al and(F. +Category[F.CurrentCategory]~=nil)then if al~=F.Category[F.CurrentCategory]. +Button then F.Category[F.CurrentCategory].Button=al if G[an]==nil then G[an]= +game:GetService'InsertService':GetCollection(an)end F.Category[F.CurrentCategory +].Contents=G[an]F.Category[F.CurrentCategory].SetName=am F.Category[F. +CurrentCategory].SetId=an end return aj()end end local al al=function(am,an)if +am~=F.CurrentCategory then if F.CurrentCategory then for ao,_ in pairs(F. +CurrentCategory)do _.Visible=false end end F.CurrentCategory=am if F.Category[F. +CurrentCategory]==nil then F.Category[F.CurrentCategory]={}if#am>0 then return +ak(am[1],am[1].SetName.Value,am[1].SetId.Value,0)end else F.Category[F. +CurrentCategory].Button=nil return ak(F.Category[F.CurrentCategory].ButtonFrame, +F.Category[F.CurrentCategory].SetName,F.Category[F.CurrentCategory].SetId,F. +Category[F.CurrentCategory].Index)end end end local am am=function(an)return al( +an,0)end local an an=function()local ao=A.SetPanel.Sets.SetsLists:GetChildren() +for _=1,#ao do if ao[_]:IsA'TextButton'then ao[_].Selected=false ao[_]. +BackgroundTransparency=1 ao[_].TextColor3=Color3.new(1,1,1)ao[_]. +BackgroundColor3=Color3.new(1,1,1)end end end local ao ao=function()local _=0 +for ap=1,#H do local aq=H[ap]aq.Visible=true aq.Position=UDim2.new(0,5,0,_*aq. +Size.Y.Offset)aq.Parent=A.SetPanel.Sets.SetsLists if ap==1 then aq.Selected=true +aq.BackgroundColor3=Color3.new(0,0.8,0)aq.TextColor3=Color3.new(0,0,0)aq. +BackgroundTransparency=0 end aq.MouseEnter:connect(function()if not aq.Selected +then aq.BackgroundTransparency=0 aq.TextColor3=Color3.new(0,0,0)end end)aq. +MouseLeave:connect(function()if not aq.Selected then aq.BackgroundTransparency=1 +aq.TextColor3=Color3.new(1,1,1)end end)aq.MouseButton1Click:connect(function() +an()aq.Selected=not aq.Selected aq.BackgroundColor3=Color3.new(0,0.8,0)aq. +TextColor3=Color3.new(0,0,0)aq.BackgroundTransparency=0 return ak(aq,aq.Text,H[ +ap].SetId.Value,0)end)_=_+1 end local ap=A.SetPanel.Sets.SetsLists:GetChildren() +if ap then for aq=1,#ap do if ap[aq]:IsA'TextButton'then ak(ap[aq],ap[aq].Text,H +[aq].SetId.Value,0)am(H)break end end end end A=aa()D,E=R()D.Position=UDim2.new( +0,55,0,0)D.Parent=A A.Changed:connect(function(ap)if ap=='AbsoluteSize'then U() +return aj()end end)local ap,aq=b.CreateTrueScrollingFrame()ap.Size=UDim2.new( +0.54,0,0.85,0)ap.Position=UDim2.new(0.24,0,0.085,0)ap.Name='ItemsFrame'ap.ZIndex +=6 ap.Parent=A.SetPanel ap.BackgroundTransparency=1 N(aq,7)aq.Parent=A.SetPanel +aq.Position=UDim2.new(0.76,5,0,0)local _=false aq.ScrollBottom.Changed:connect( +function(ar)if aq.ScrollBottom.Value==true then if _ then return end _=true ai(A +,rows,columns)_=false end end)local ar={}for as=1,#p do local at=game:GetService +'InsertService':GetUserSets(p[as])if at and#at>2 then for au=3,#at do if at[au]. +Name=='High Scalability'then table.insert(ar,1,at[au])else table.insert(ar,at[au +])end end end end if ar then H=T(ar)end rows=math.floor(A.SetPanel.ItemsFrame. +AbsoluteSize.Y/J)columns=math.floor(A.SetPanel.ItemsFrame.AbsoluteSize.X/I)ao()A +.SetPanel.CancelButton.MouseButton1Click:connect(function()A.SetPanel.Visible= +false if r~=nil then return r()end return nil end)local as as=function(at)if at +then A.SetPanel.Visible=true else A.SetPanel.Visible=false end end local at at= +function()if A and A:FindFirstChild'SetPanel'then return A.SetPanel.Visible end +return false end return A,as,at,E end b.CreateTerrainMaterialSelector=function( +aa,ab)local ac=Instance.new'BindableEvent'ac.Name= +'TerrainMaterialSelectionChanged'local ad,ae=nil,a('Frame', +'TerrainMaterialSelector',{Size=(function()if aa then return aa else return +UDim2.new(0,245,0,230)end end)(),BorderSizePixel=0,BackgroundColor3=Color3.new(0 +,0,0),Active=true})if ab then ae.Position=ab end ac.Parent=ae local af,ag,ah,ai= +{},{'Grass','Sand','Brick','Granite','Asphalt','Iron','Aluminum','Gold','Plank', +'Log','Gravel','Cinder Block','Stone Wall','Concrete','Plastic (red)', +'Plastic (blue)','Water'},1,nil ai=function(aj)if'Grass'==aj then return 1 +elseif'Sand'==aj then return 2 elseif'Erase'==aj then return 0 elseif'Brick'==aj +then return 3 elseif'Granite'==aj then return 4 elseif'Asphalt'==aj then return +5 elseif'Iron'==aj then return 6 elseif'Aluminum'==aj then return 7 elseif'Gold' +==aj then return 8 elseif'Plank'==aj then return 9 elseif'Log'==aj then return +10 elseif'Gravel'==aj then return 11 elseif'Cinder Block'==aj then return 12 +elseif'Stone Wall'==aj then return 13 elseif'Concrete'==aj then return 14 elseif +'Plastic (red)'==aj then return 15 elseif'Plastic (blue)'==aj then return 16 +elseif'Water'==aj then return 17 end end local aj aj=function(ak)if Enum. +CellMaterial.Grass==ak or 1==ak then return'Grass'elseif Enum.CellMaterial.Sand +==ak or 2==ak then return'Sand'elseif Enum.CellMaterial.Empty==ak or 0==ak then +return'Erase'elseif Enum.CellMaterial.Brick==ak or 3==ak then return'Brick' +elseif Enum.CellMaterial.Granite==ak or 4==ak then return'Granite'elseif Enum. +CellMaterial.Asphalt==ak or 5==ak then return'Asphalt'elseif Enum.CellMaterial. +Iron==ak or 6==ak then return'Iron'elseif Enum.CellMaterial.Aluminum==ak or 7== +ak then return'Aluminum'elseif Enum.CellMaterial.Gold==ak or 8==ak then return +'Gold'elseif Enum.CellMaterial.WoodPlank==ak or 9==ak then return'Plank'elseif +Enum.CellMaterial.WoodLog==ak or 10==ak then return'Log'elseif Enum.CellMaterial +.Gravel==ak or 11==ak then return'Gravel'elseif Enum.CellMaterial.CinderBlock== +ak or 12==ak then return'Cinder Block'elseif Enum.CellMaterial.MossyStone==ak or +13==ak then return'Stone Wall'elseif Enum.CellMaterial.Cement==ak or 14==ak then +return'Concrete'elseif Enum.CellMaterial.RedPlastic==ak or 15==ak then return +'Plastic (red)'elseif Enum.CellMaterial.BluePlastic==ak or 16==ak then return +'Plastic (blue)'elseif Enum.CellMaterial.Water==ak or 17==ak then return'Water' +end end local ak ak=function(al)ah=ai(al)return ac:Fire(ah)end for al,am in +pairs(ag)do af[am]={}af[am].Regular='http://www.roblox.com/asset/?id='..( +function()if'Grass'==am then return'56563112'elseif'Sand'==am then return +'62356652'elseif'Brick'==am then return'65961537'elseif'Granite'==am then return +'67532153'elseif'Asphalt'==am then return'67532038'elseif'Iron'==am then return +'67532093'elseif'Aluminum'==am then return'67531995'elseif'Gold'==am then return +'67532118'elseif'Plastic (red)'==am then return'67531848'elseif'Plastic (blue)' +==am then return'67531924'elseif'Plank'==am then return'67532015'elseif'Log'==am +then return'67532051'elseif'Gravel'==am then return'67532206'elseif +'Cinder Block'==am then return'67532103'elseif'Stone Wall'==am then return +'67531804'elseif'Concrete'==am then return'67532059'elseif'Water'==am then +return'81407474'else return'66887593'end end)()end local an,ao,ap,aq=b. +CreateScrollingFrame(nil,'grid')an.Size=UDim2.new(0.85,0,1,0)an.Position=UDim2. +new(0,0,0,0)an.Parent=ae ao.Parent=ae ao.Visible=true ao.Position=UDim2.new(1,- +19,0,0)ap.Parent=ae ap.Visible=true ap.Position=UDim2.new(1,-19,1,-17)local ar +ar=function(as,at)ak(at)as.BackgroundTransparency=0 ad.BackgroundTransparency=1 +ad=as end local as as=function(at)local au=a('TextButton',tostring(at),{Text='', +Size=UDim2.new(0,32,0,32),BackgroundColor3=Color3.new(1,1,1),BorderSizePixel=0, +BackgroundTransparency=1,AutoButtonColor=false,a('NumberValue','EnumType',{Value +=0})})local p=a('ImageButton',tostring(at),{AutoButtonColor=false, +BackgroundTransparency=1,Size=UDim2.new(0,30,0,30),Position=UDim2.new(0,1,0,1), +Parent=au,Image=af[at].Regular})p.MouseEnter:connect(function()au. +BackgroundTransparency=0 end)p.MouseLeave:connect(function()if ad~=au then au. +BackgroundTransparency=1 end end)p.MouseButton1Click:connect(function()if ad~=au +then return ar(au,tostring(at))end end)return au end for at=1,#ag do local au= +as(ag[at])if ag[at]=='Grass'then ad=au au.BackgroundTransparency=0 end au.Parent +=an end local at at=function(au)if not au then return end if ah==au then return +end local p,q=aj(au),an:GetChildren()for r=1,#q do if q[r].Name== +'Plastic (blue)'and p=='Plastic (blue)'then ar(q[r],p)return end if q[r].Name== +'Plastic (red)'and p=='Plastic (red)'then ar(q[r],p)return end if string.find(q[ +r].Name,p)then ar(q[r],p)return end end end ae.Changed:connect(function(au)if au +=='AbsoluteSize'then return aq()end end)aq()return ae,ac,at end b. +CreateLoadingFrame=function(aa,ab,ac)game:GetService'ContentProvider':Preload +'http://www.roblox.com/asset/?id=35238053'local ad=a('Frame','LoadingFrame',{ +Style=Enum.FrameStyle.RobloxRound,Size=(function()if ab then return ab else +return UDim2.new(0,300,0,160)end end)(),Position=(function()if ac then return ac +else return UDim2.new(0.5,-150,0.5,-80)end end)(),a('TextLabel','loadingName',{ +BackgroundTransparency=1,Size=UDim2.new(1,0,0,18),Position=UDim2.new(0,0,0,2), +Font=Enum.Font.Arial,Text=aa,TextColor3=Color3.new(1,1,1),TextStrokeTransparency +=1,FontSize=Enum.FontSize.Size18})})local ae=a('Frame','LoadingBar',{ +BackgroundColor3=Color3.new(0,0,0),BorderColor3=Color3.new(0.30980392156862746, +0.30980392156862746,0.30980392156862746),Position=UDim2.new(0,0,0,41),Size=UDim2 +.new(1,0,0,30),Parent=ad})local af,ag,ah=a('ImageLabel','LoadingGreenBar',{Image +='http://www.roblox.com/asset/?id=35238053',Position=UDim2.new(0,0,0,0),Size= +UDim2.new(0,0,1,0),Visible=false,Parent=ae}),a('TextLabel','LoadingPercent',{ +BackgroundTransparency=1,Position=UDim2.new(0,0,1,0),Size=UDim2.new(1,0,0,14), +Font=Enum.Font.Arial,Text='0%',FontSize=Enum.FontSize.Size14,TextColor3=Color3. +new(1,1,1),Parent=ae}),a('TextButton','CancelButton',{Position=UDim2.new(0.5,-60 +,1,-40),Size=UDim2.new(0,120,0,40),Font=Enum.Font.Arial,FontSize=Enum.FontSize. +Size18,TextColor3=Color3.new(1,1,1),Text='Cancel',Style=Enum.ButtonStyle. +RobloxButton,Parent=ad})local ai=a('BindableEvent','CancelButtonClicked',{Parent +=ah})ah.MouseButton1Click:connect(function()return ai:Fire()end)local aj aj= +function(ak,al,am)if ak and type(ak~='number')then error( +'updateLoadingGuiPercent expects number as argument, got '..tostring(type(ak)).. +' instead')end local an if ak<0 then an=UDim2.new(0,0,1,0)elseif ak>1 then an= +UDim2.new(1,0,1,0)else an=UDim2.new(ak,0,1,0)end if al then if not am then error +[[updateLoadingGuiPercent is set to tween new percentage, but got no tween time length! Please pass this in as third argument]] +end if an.X.Scale>0 then af.Visible=true return af:TweenSize(an,Enum. +EasingDirection.Out,Enum.EasingStyle.Quad,am,true)else return af:TweenSize(an, +Enum.EasingDirection.Out,Enum.EasingStyle.Quad,am,true,function()if an.X.Scale<0 +then af.Visible=false end end)end else af.Size=an af.Visible=(an.X.Scale>0)end +end af.Changed:connect(function(ak)if ak=='Size'then ag.Text=tostring(math.ceil( +af.Size.X.Scale*100))..'%'end end)return ad,aj,ai end b.CreatePluginFrame= +function(aa,ab,ac,ad,ae)local af af=function(ag,ah,ai,aj,ak,al)local am=a( +'TextButton',ak,{AutoButtonColor=false,BackgroundTransparency=1,Position=ah,Size +=ag,Font=Enum.Font.ArialBold,FontSize=aj,Text=ai,TextColor3=Color3.new(1,1,1), +BorderSizePixel=0,BackgroundColor3=Color3.new(7.8431372549019605E-2, +7.8431372549019605E-2,7.8431372549019605E-2)})am.MouseEnter:connect(function()if +am.Selected then return end am.BackgroundTransparency=0 end)am.MouseLeave: +connect(function()if am.Selected then return end am.BackgroundTransparency=1 end +)am.Parent=al return am end local ag=a('Frame',tostring(aa)..'DragBar',{ +BackgroundColor3=Color3.new(0.15294117647058825,0.15294117647058825, +0.15294117647058825),BorderColor3=Color3.new(0,0,0),Size=(function()if ab then +return UDim2.new(ab.X.Scale,ab.X.Offset,0,20)+UDim2.new(0,20,0,0)else return +UDim2.new(0,183,0,20)end end)(),Active=true,Draggable=true})if ac then ag. +Position=ac end ag.MouseEnter:connect(function()ag.BackgroundColor3=Color3.new( +0.19215686274509805,0.19215686274509805,0.19215686274509805)end)ag.MouseLeave: +connect(function()ag.BackgroundColor3=Color3.new(0.15294117647058825, +0.15294117647058825,0.15294117647058825)end)ag.Parent=ae a('TextLabel', +'BarNameLabel',{Text=' '..tostring(aa),TextColor3=Color3.new(1,1,1), +TextStrokeTransparency=0,Size=UDim2.new(1,0,1,0),Font=Enum.Font.ArialBold, +FontSize=Enum.FontSize.Size18,TextXAlignment=Enum.TextXAlignment.Left, +BackgroundTransparency=1,Parent=ag})local ah=af(UDim2.new(0,15,0,17),UDim2.new(1 +,-16,0.5,-8),'X',Enum.FontSize.Size14,'CloseButton',ag)local ai=a( +'BindableEvent','CloseEvent',{Parent=ah})ah.MouseButton1Click:connect(function() +ai:Fire()ah.BackgroundTransparency=1 end)local aj,ak=af(UDim2.new(0,15,0,17), +UDim2.new(1,-51,0.5,-8),'?',Enum.FontSize.Size14,'HelpButton',ag),a('Frame', +'HelpFrame',{BackgroundColor3=Color3.new(0,0,0),Size=UDim2.new(0,300,0,552), +Position=UDim2.new(1,5,0,0),Active=true,BorderSizePixel=0,Visible=false,Parent= +ag})aj.MouseButton1Click:connect(function()ak.Visible=not ak.Visible if ak. +Visible then aj.Selected=true aj.BackgroundTransparency=0 local al=d(ak)if al +then if ak.AbsolutePosition.X+ak.AbsoluteSize.X>al.AbsoluteSize.X then ak. +Position=UDim2.new(0,-5-ak.AbsoluteSize.X,0,0)else ak.Position=UDim2.new(1,5,0,0 +)end else ak.Position=UDim2.new(1,5,0,0)end else aj.Selected=false aj. +BackgroundTransparency=1 end end)local al=af(UDim2.new(0,16,0,17),UDim2.new(1,- +34,0.5,-8),'-',Enum.FontSize.Size14,'MinimizeButton',ag)al.TextYAlignment=Enum. +TextYAlignment.Top local am=a('Frame','MinimizeFrame',{BackgroundColor3=Color3. +new(0.28627450980392155,0.28627450980392155,0.28627450980392155),BorderColor3= +Color3.new(0,0,0),Position=UDim2.new(0,0,1,0),Size=(function()if ab then return +UDim2.new(ab.X.Scale,ab.X.Offset,0,50)+UDim2.new(0,20,0,0)else return UDim2.new( +0,183,0,50)end end)(),Visible=false,Parent=ag})local an,ao=a('TextButton', +'MinimizeButton',{Position=UDim2.new(0.5,-50,0.5,-20),Size=UDim2.new(0,100,0,40) +,Style=Enum.ButtonStyle.RobloxButton,Font=Enum.Font.ArialBold,FontSize=Enum. +FontSize.Size18,TextColor3=Color3.new(1,1,1),Text='Show',Parent=am}),a('Frame', +'SeparatingLine',{BackgroundColor3=Color3.new(0.45098039215686275, +0.45098039215686275,0.45098039215686275),BorderSizePixel=0,Position=UDim2.new(1, +-18,0.5,-7),Size=UDim2.new(0,1,0,14),Parent=ag})local ap=ao:clone()ap.Position= +UDim2.new(1,-35,0.5,-7)ap.Parent=ag local aq=a('Frame','WidgetContainer',{ +BackgroundTransparency=1,Position=UDim2.new(0,0,1,0),BorderColor3=Color3.new(0,0 +,0)})if not ad then aq.BackgroundTransparency=0 aq.BackgroundColor3=Color3.new( +0.2823529411764706,0.2823529411764706,0.2823529411764706)end aq.Parent=ag if ab +then if ad then aq.Size=ab else aq.Size=UDim2.new(0,ag.AbsoluteSize.X,ab.Y.Scale +,ab.Y.Offset)end else if ad then aq.Size=UDim2.new(0,163,0,400)else aq.Size= +UDim2.new(0,ag.AbsoluteSize.X,0,400)end end if ac then aq.Position=aq.Position+ +UDim2.new(0,0,0,20)end local ar,as,at if ad then ar,as=b. +CreateTrueScrollingFrame()ar.Size=UDim2.new(1,0,1,0)ar.BackgroundColor3=Color3. +new(0.2823529411764706,0.2823529411764706,0.2823529411764706)ar.BorderColor3= +Color3.new(0,0,0)ar.Active=true ar.Parent=aq as.Parent=ag as.BackgroundColor3= +Color3.new(0.2823529411764706,0.2823529411764706,0.2823529411764706)as. +BorderSizePixel=0 as.BackgroundTransparency=0 as.Position=UDim2.new(1,-21,1,1)if +ab then as.Size=UDim2.new(0,21,ab.Y.Scale,ab.Y.Offset)else as.Size=UDim2.new(0, +21,0,400)end as:FindFirstChild'ScrollDownButton'.Position=UDim2.new(0,0,1,-20)a( +'Frame','FakeLine',{BorderSizePixel=0,BackgroundColor3=Color3.new(0,0,0),Size= +UDim2.new(0,1,1,1),Position=UDim2.new(1,0,0,0),Parent=as})at=a('TextButton', +'VerticalDragger',{ZIndex=2,AutoButtonColor=false,BackgroundColor3=Color3.new( +0.19607843137254902,0.19607843137254902,0.19607843137254902),BorderColor3=Color3 +.new(0,0,0),Size=UDim2.new(1,20,0,20),Position=UDim2.new(0,0,1,0),Active=true, +Text='',Parent=aq})local au=a('Frame','ScrubFrame',{BackgroundColor3=Color3.new( +1,1,1),BorderSizePixel=0,Position=UDim2.new(0.5,-5,0.5,0),Size=UDim2.new(0,10,0, +1),ZIndex=5,Parent=at})local p=au:clone()p.Position=UDim2.new(0.5,-5,0.5,-2)p. +Parent=at local q=au:clone()q.Position=UDim2.new(0.5,-5,0.5,2)q.Parent=at local +r,s,t=a('TextButton','AreaSoak',{Size=UDim2.new(1,0,1,0),BackgroundTransparency= +1,BorderSizePixel=0,Text='',ZIndex=10,Visible=false,Active=true,Parent=d(ae)}), +false,nil at.MouseEnter:connect(function()at.BackgroundColor3=Color3.new( +0.23529411764705882,0.23529411764705882,0.23529411764705882)end)at.MouseLeave: +connect(function()at.BackgroundColor3=Color3.new(0.19607843137254902, +0.19607843137254902,0.19607843137254902)end)at.MouseButton1Down:connect(function +(u,v)s=true r.Visible=true t=v end)r.MouseButton1Up:connect(function()s=false r. +Visible=false end)r.MouseMoved:connect(function(u,v)if not s then return end +local w=v-t if not as.ScrollDownButton.Visible and w>0 then return end if(aq. +Size.Y.Offset+w)<150 then aq.Size=UDim2.new(aq.Size.X.Scale,aq.Size.X.Offset,aq. +Size.Y.Scale,150)as.Size=UDim2.new(0,21,0,150)return end t=v if aq.Size.Y.Offset ++w>=0 then aq.Size=UDim2.new(aq.Size.X.Scale,aq.Size.X.Offset,aq.Size.Y.Scale,aq +.Size.Y.Offset+w)as.Size=UDim2.new(0,21,0,as.Size.Y.Offset+w)end end)end local +au au=function()am.Visible=not am.Visible if ad then ar.Visible=not ar.Visible +at.Visible=not at.Visible as.Visible=not as.Visible else aq.Visible=not aq. +Visible end if am.Visible then al.Text='+'else al.Text='-'end end an. +MouseButton1Click:connect(function()return au()end)al.MouseButton1Click:connect( +function()return au()end)if ad then return ag,ar,ak,ai else return ag,aq,ak,ai +end end b.Help=function(aa)if aa=='CreatePropertyDropDownMenu'or aa==b. +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']] +elseif aa=='CreateDropDownMenu'or aa==b.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]] +elseif aa=='CreateMessageDialog'or aa==b.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]] +elseif aa=='CreateStyledMessageDialog'or aa==b.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]] +elseif aa=='GetFontHeight'or aa==b.GetFontHeight then return +[[Function GetFontHeight. Arguments: (font, fontSize). Side effect: returns the size in pixels of the given font + fontSize]] +elseif aa=='CreateScrollingFrame'or aa==b.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)]] +elseif aa=='CreateTrueScrollingFrame'or aa==b.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.]] +elseif aa=='AutoTruncateTextObject'or aa==b.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]] +elseif aa=='CreateSlider'or aa==b.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.]] +elseif aa=='CreateLoadingFrame'or aa==b.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.]] +elseif aa=='CreateTerrainMaterialSelector'or aa==b.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 b \ No newline at end of file diff --git a/processed/45374389.lua b/processed/45374389.lua index 72fff34..807ddd3 100644 --- a/processed/45374389.lua +++ b/processed/45374389.lua @@ -1,16 +1,6 @@ -print("[Mercury]: Loaded corescript 45374389") -local t = { } -t.Foo = function() - return print("foo") -end -t.Bar = function() - return print("bar") -end -t.Help = function(funcNameOrFunc) - if "Foo" == funcNameOrFunc or t.Foo == funcNameOrFunc then - return "Function Foo. Arguments: None. Side effect: prints foo" - elseif "Bar" == funcNameOrFunc or t.Bar == funcNameOrFunc then - return "Function Bar. Arguments: None. Side effect: prints bar" - end -end -return t +print'[Mercury]: Loaded corescript 45374389'local a={}a.Foo=function()return +print'foo'end a.Bar=function()return print'bar'end a.Help=function(b)if'Foo'==b +or a.Foo==b then return +'Function Foo. Arguments: None. Side effect: prints foo'elseif'Bar'==b or a. +Bar==b then return'Function Bar. Arguments: None. Side effect: prints bar'end +end return a \ No newline at end of file diff --git a/processed/46295863.lua b/processed/46295863.lua index 347fb74..8bd0bf1 100644 --- a/processed/46295863.lua +++ b/processed/46295863.lua @@ -1,1781 +1,522 @@ -print("[Mercury]: Loaded corescript 46295863") -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local waitForChild -waitForChild = function(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end -end -local waitForProperty -waitForProperty = function(instance, property) - while not instance[property] do - instance.Changed:wait() - end -end -local gui -if script.Parent:FindFirstChild("ControlFrame") then - gui = script.Parent:FindFirstChild("ControlFrame") -else - gui = script.Parent -end -local helpButton -local updateCameraDropDownSelection -local updateVideoCaptureDropDownSelection -local tweenTime = 0.2 -local mouseLockLookScreenUrl = "http://www.roblox.com/asset?id=54071825" -local classicLookScreenUrl = "http://www.roblox.com/Asset?id=45915798" -local hasGraphicsSlider = game:GetService("CoreGui").Version >= 5 -local GraphicsQualityLevels = 10 -local recordingVideo = false -local currentMenuSelection -local lastMenuSelection = { } -local centerDialogs = { } -local mainShield -local inStudioMode = UserSettings().GameSettings:InStudioMode() -local macClient = false -local success, isMac -success, isMac = pcall(function() - return not game.GuiService.IsWindows -end) -macClient = success and isMac -local Color3I -Color3I = function(r, g, b) - return Color3.new(r / 255, g / 255, b / 255) -end -local robloxLock -robloxLock = function(instance) - instance.RobloxLocked = true - local children = instance:GetChildren() - if children then - for _, child in ipairs(children) do - robloxLock(child) - end - end -end -local resumeGameFunction -resumeGameFunction = function(shield) - shield.Settings:TweenPosition(UDim2.new(0.5, -262, -0.5, -200), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) - return delay(tweenTime, function() - shield.Visible = false - for i = 1, #centerDialogs do - centerDialogs[i].Visible = false - game.GuiService:RemoveCenterDialog(centerDialogs[i]) - end - game.GuiService:RemoveCenterDialog(shield) - settingsButton.Active = true - currentMenuSelection = nil - lastMenuSelection = { } - end) -end -local goToMenu -goToMenu = function(container, menuName, moveDirection, size, position) - if type(menuName) ~= "string" then - return - end - table.insert(lastMenuSelection, currentMenuSelection) - if menuName == "GameMainMenu" then - lastMenuSelection = { } - end - local containerChildren = container:GetChildren() - for i = 1, #containerChildren do - if containerChildren[i].Name == menuName then - containerChildren[i].Visible = true - currentMenuSelection = { - container = container, - name = menuName, - direction = moveDirection, - lastSize = size - } - if size and position then - 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) - else - 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) - elseif moveDirection == "right" then - 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) - elseif moveDirection == "down" then - containerChildren[i]:TweenPosition(UDim2.new(0, 0, 1, 400), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) - end - delay(tweenTime, function() - containerChildren[i].Visible = false - end) - end - end -end -local resetLocalCharacter -resetLocalCharacter = function() - local player = game.Players.LocalPlayer - if player and player.Character and player.Character:FindFirstChild("Humanoid") then - player.Character.Humanoid.Health = 0 - end -end -local createTextButton -createTextButton = function(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.Text = text - return newTextButton -end -local CreateTextButtons -CreateTextButtons = function(frame, buttons, yPos, ySize) - if #buttons < 1 then - error("Must have more than one button") - end - local buttonNum = 1 - local buttonObjs = { } - local toggleSelection - toggleSelection = function(button) - for _, obj in ipairs(buttonObjs) do - if obj == button then - obj.Style = Enum.ButtonStyle.RobloxButtonDefault - else - obj.Style = Enum.ButtonStyle.RobloxButton - end - end - end - for _, obj in ipairs(buttons) do - local button = New("TextButton", "Button" .. tostring(buttonNum), { - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - AutoButtonColor = true, - Style = Enum.ButtonStyle.RobloxButton, - Text = obj.Text, - TextColor3 = Color3.new(1, 1, 1), - Parent = frame - }) - button.MouseButton1Click:connect(function() - toggleSelection(button) - return obj.Function() - end) - buttonObjs[buttonNum] = button - buttonNum = buttonNum + 1 - end - toggleSelection(buttonObjs[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(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(0.35, 0, ySize.Scale, ySize.Offset) - frame.Button2.Position = UDim2.new(0.55, 0, yPos.Scale, yPos.Offset) - frame.Button2.Size = UDim2.new(0.35, 0, ySize.Scale, ySize.Offset) - elseif numButtons >= 3 then - 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].Size = UDim2.new(buttonSize, 0, ySize.Scale, ySize.Offset) - buttonNum = buttonNum + 1 - end - end -end -local setRecordGui -setRecordGui = function(recording, stopRecordButton, recordVideoButton) - if recording then - stopRecordButton.Visible = true - recordVideoButton.Text = "Stop Recording" - else - stopRecordButton.Visible = false - recordVideoButton.Text = "Record Video" - end -end -local recordVideoClick -recordVideoClick = function(recordVideoButton, stopRecordButton) - recordingVideo = not recordingVideo - return setRecordGui(recordingVideo, stopRecordButton, recordVideoButton) -end -local backToGame -backToGame = function(buttonClicked, shield, settingsButton) - buttonClicked.Parent.Parent.Parent.Parent.Visible = false - shield.Visible = false - for i = 1, #centerDialogs do - game.GuiService:RemoveCenterDialog(centerDialogs[i]) - centerDialogs[i].Visible = false - end - centerDialogs = { } - game.GuiService:RemoveCenterDialog(shield) - settingsButton.Active = true -end -local setDisabledState -setDisabledState = function(guiObject) - if not guiObject then - return - end - if guiObject:IsA("TextLabel") then - guiObject.TextTransparency = 0.9 - elseif guiObject:IsA("TextButton") then - guiObject.TextTransparency = 0.9 - guiObject.Active = false - else - if guiObject["ClassName"] then - return print("setDisabledState! got object of unsupported type. object type is ", guiObject.ClassName) - end - end -end -local createHelpDialog -createHelpDialog = function(baseZIndex) - if helpButton == nil 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 - helpButton = gui.BottomRightControl.Help - end - end - local shield = New("Frame", "HelpDialogShield", { - Active = true, - Visible = false, - Size = UDim2.new(1, 0, 1, 0), - BackgroundColor3 = Color3I(51, 51, 51), - BorderColor3 = Color3I(27, 42, 53), - BackgroundTransparency = 0.4, - ZIndex = baseZIndex + 1 - }) - local helpDialog = New("Frame", "HelpDialog", { - Style = Enum.FrameStyle.RobloxRound, - Position = UDim2.new(0.2, 0, 0.2, 0), - Size = UDim2.new(0.6, 0, 0.6, 0), - Active = true, - Parent = shield, - New("TextLabel", "Title", { - Text = "Keyboard & Mouse Controls", - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size36, - Position = UDim2.new(0, 0, 0.025, 0), - Size = UDim2.new(1, 0, 0, 40), - TextColor3 = Color3.new(1, 1, 1), - BackgroundTransparency = 1 - }), - New("Frame", "Buttons", { - Position = UDim2.new(0.1, 0, 0.07, 40), - Size = UDim2.new(0.8, 0, 0, 45), - BackgroundTransparency = 1 - }), - New("Frame", "ImageFrame", { - Position = UDim2.new(0.05, 0, 0.075, 80), - Size = UDim2.new(0.9, 0, 0.9, -120), - BackgroundTransparency = 1, - New("Frame", "LayoutFrame", { - Position = UDim2.new(0.5, 0, 0, 0), - Size = UDim2.new(1.5, 0, 1, 0), - BackgroundTransparency = 1, - SizeConstraint = Enum.SizeConstraint.RelativeYY, - New("ImageLabel", "Image", { - Image = (function() - if UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then - return mouseLockLookScreenUrl - else - return classicLookScreenUrl - end - end)(), - Position = UDim2.new(-0.5, 0, 0, 0), - Size = UDim2.new(1, 0, 1, 0), - BackgroundTransparency = 1 - }) - }) - }) - }) - local buttonRow, image = helpDialog.Buttons, helpDialog.ImageFrame.LayoutFrame.Image - local buttons = { } - buttons[1] = { } - buttons[1].Text = "Look" - buttons[1].Function = function() - if UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] then - image.Image = mouseLockLookScreenUrl - else - image.Image = classicLookScreenUrl - end - end - buttons[2] = { } - buttons[2].Text = "Move" - buttons[2].Function = function() - image.Image = "http://www.roblox.com/Asset?id=45915811" - end - buttons[3] = { } - buttons[3].Text = "Gear" - buttons[3].Function = function() - image.Image = "http://www.roblox.com/Asset?id=45917596" - end - buttons[4] = { } - buttons[4].Text = "Zoom" - buttons[4].Function = function() - image.Image = "http://www.roblox.com/Asset?id=45915825" - end - CreateTextButtons(buttonRow, buttons, UDim.new(0, 0), UDim.new(1, 0)) - delay(0, function() - 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") - return 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 - if gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Text == "Classic" then - image.Image = classicLookScreenUrl - else - image.Image = mouseLockLookScreenUrl - end - end - end) - end) - local okBtn = New("TextButton", "OkBtn", { - Text = "OK", - Modal = true, - Size = UDim2.new(0.3, 0, 0, 45), - Position = UDim2.new(0.35, 0, 0.975, -50), - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - BackgroundTransparency = 1, - TextColor3 = Color3.new(1, 1, 1), - Style = Enum.ButtonStyle.RobloxButtonDefault, - Parent = helpDialog - }) - okBtn.MouseButton1Click:connect(function() - shield.Visible = false - return game.GuiService:RemoveCenterDialog(shield) - end) - robloxLock(shield) - return shield -end -local createLeaveConfirmationMenu -createLeaveConfirmationMenu = function(baseZIndex, shield) - local frame = New("Frame", "LeaveConfirmationMenu", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 1, 0), - Position = UDim2.new(0, 0, 2, 400), - ZIndex = baseZIndex + 4, - New("TextLabel", "LeaveText", { - Text = "Leave this game?", - Size = UDim2.new(1, 0, 0.8, 0), - TextWrap = true, - TextColor3 = Color3.new(1, 1, 1), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size36, - BackgroundTransparency = 1, - 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)) - 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)) - 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)) - return shield.Settings:TweenSize(UDim2.new(0, 525, 0, 430), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) - end) - return frame -end -local createResetConfirmationMenu -createResetConfirmationMenu = function(baseZIndex, shield) - local frame = New("Frame", "ResetConfirmationMenu", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 1, 0), - Position = UDim2.new(0, 0, 2, 400), - 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)) - yesButton.Name = "YesButton" - yesButton.ZIndex = baseZIndex + 4 - yesButton.Parent = frame - yesButton.Modal = true - yesButton.MouseButton1Click:connect(function() - resumeGameFunction(shield) - return resetLocalCharacter() - end) - 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)) - return shield.Settings:TweenSize(UDim2.new(0, 525, 0, 430), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) - end) - local resetCharacterText = New("TextLabel", "ResetCharacterText", { - Text = "Are you sure you want to reset your character?", - Size = UDim2.new(1, 0, 0.8, 0), - TextWrap = true, - TextColor3 = Color3.new(1, 1, 1), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size36, - BackgroundTransparency = 1, - ZIndex = baseZIndex + 4, - Parent = frame - }) - do - local _with_0 = resetCharacterText:Clone() - _with_0.Name = "FineResetCharacterText" - _with_0.Text = "You will be put back on a spawn point" - _with_0.Size = UDim2.new(0, 303, 0, 18) - _with_0.Position = UDim2.new(0, 109, 0, 215) - _with_0.FontSize = Enum.FontSize.Size18 - _with_0.Parent = frame - end - return frame -end -local createGameMainMenu -createGameMainMenu = function(baseZIndex, shield) - local gameMainMenuFrame = New("Frame", "GameMainMenu", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 1, 0), - ZIndex = baseZIndex + 4, - Parent = settingsFrame, - New("TextLabel", "Title", { - Text = "Game Menu", - BackgroundTransparency = 1, - TextStrokeTransparency = 0, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size36, - Size = UDim2.new(1, 0, 0, 36), - Position = UDim2.new(0, 0, 0, 4), - TextColor3 = Color3.new(1, 1, 1), - ZIndex = baseZIndex + 4 - }) - }) - 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) - return game.GuiService:AddCenterDialog(helpDialog, Enum.CenterDialogType.ModalDialog, function() - helpDialog.Visible = true - mainShield.Visible = false - end, function() - helpDialog.Visible = false - end) - end) - helpButton.Active = true - local helpShortcut = New("TextLabel", "HelpShortcutText", { - Text = "F1", - Visible = false, - BackgroundTransparency = 1, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size12, - Position = UDim2.new(0, 85, 0, 0), - Size = UDim2.new(0, 30, 0, 30), - TextColor3 = Color3.new(0, 1, 0), - ZIndex = baseZIndex + 4, - Parent = robloxHelpButton - }) - 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") - do - local _with_0 = helpShortcut:clone() - _with_0.Name = "ScreenshotShortcutText" - _with_0.Text = "PrintSc" - _with_0.Position = UDim2.new(0, 118, 0, 0) - _with_0.Visible = true - _with_0.Parent = screenshotButton - end - 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") - do - local _with_0 = helpShortcut:clone() - _with_0.Visible = hasGraphicsSlider - _with_0.Name = "RecordVideoShortcutText" - _with_0.Text = "F12" - _with_0.Position = UDim2.new(0, 120, 0, 0) - _with_0.Parent = recordVideoButton - end - local stopRecordButton = New("ImageButton", "StopRecordButton", { - BackgroundTransparency = 1, - Image = "rbxasset://textures/ui/RecordStop.png", - Size = UDim2.new(0, 59, 0, 27) - }) - stopRecordButton:SetVerb("RecordToggle") - stopRecordButton.MouseButton1Click:connect(function() - return 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)) - 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)) - 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)) - resumeGameButton.Name = "resumeGameButton" - resumeGameButton.ZIndex = baseZIndex + 4 - resumeGameButton.Parent = gameMainMenuFrame - resumeGameButton.Modal = true - resumeGameButton.MouseButton1Click:connect(function() - return 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 - 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 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)) - resetButton.Name = "ResetButton" - resetButton.ZIndex = baseZIndex + 4 - resetButton.Parent = gameMainMenuFrame - return gameMainMenuFrame -end -local createGameSettingsMenu -createGameSettingsMenu = function(baseZIndex, _) - local gameSettingsMenuFrame = New("Frame", "GameSettingsMenu", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 1, 0), - ZIndex = baseZIndex + 4, - New("TextLabel", "Title", { - Text = "Settings", - Size = UDim2.new(1, 0, 0, 48), - Position = UDim2.new(0, 9, 0, -9), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size36, - TextColor3 = Color3.new(1, 1, 1), - ZIndex = baseZIndex + 4, - BackgroundTransparency = 1 - }), - New("TextLabel", "FullscreenText", { - Text = "Fullscreen Mode", - Size = UDim2.new(0, 124, 0, 18), - Position = UDim2.new(0, 62, 0, 145), - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - TextColor3 = Color3.new(1, 1, 1), - ZIndex = baseZIndex + 4, - BackgroundTransparency = 1 - }) - }) - local fullscreenShortcut = New("TextLabel", "FullscreenShortcutText", { - Visible = hasGraphicsSlider, - Text = "F11", - BackgroundTransparency = 1, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size12, - Position = UDim2.new(0, 186, 0, 141), - Size = UDim2.new(0, 30, 0, 30), - TextColor3 = Color3.new(0, 1, 0), - ZIndex = baseZIndex + 4, - Parent = gameSettingsMenuFrame - }) - local studioText = New("TextLabel", "StudioText", { - Visible = false, - Text = "Studio Mode", - Size = UDim2.new(0, 95, 0, 18), - Position = UDim2.new(0, 62, 0, 179), - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - TextColor3 = Color3.new(1, 1, 1), - ZIndex = baseZIndex + 4, - BackgroundTransparency = 1, - Parent = gameSettingsMenuFrame - }) - local studioShortcut = fullscreenShortcut:clone() - studioShortcut.Name = "StudioShortcutText" - studioShortcut.Visible = false - studioShortcut.Text = "F2" - studioShortcut.Position = UDim2.new(0, 154, 0, 175) - studioShortcut.Parent = gameSettingsMenuFrame - local studioCheckbox - if hasGraphicsSlider then - local qualityText = New("TextLabel", "QualityText", { - Text = "Graphics Quality", - Size = UDim2.new(0, 128, 0, 18), - Position = UDim2.new(0, 30, 0, 239), - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - TextColor3 = Color3.new(1, 1, 1), - ZIndex = baseZIndex + 4, - BackgroundTransparency = 1, - Parent = gameSettingsMenuFrame, - 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.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.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.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.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.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)) - 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)) - 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 = New("TextBox", "GraphicsSetter", { - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(128 / 255, 128 / 255, 128 / 255), - Size = UDim2.new(0, 50, 0, 25), - Position = UDim2.new(0, 450, 0, 269), - TextColor3 = Color3.new(1, 1, 1), - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - Text = "Auto", - ZIndex = 1, - TextWrap = true, - Parent = gameSettingsMenuFrame, - Visible = not inStudioMode - }) - local isAutoGraphics = true - if not inStudioMode then - isAutoGraphics = (UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic) - else - settings().Rendering.EnableFRM = false - end - local listenToGraphicsLevelChange = true - local setAutoGraphicsGui - setAutoGraphicsGui = function(active) - isAutoGraphics = active - if active then - autoGraphicsButton.Text = "X" - betterQualityText.ZIndex = 1 - betterQualityShortcut.ZIndex = 1 - fasterShortcut.ZIndex = 1 - fasterText.ZIndex = 1 - graphicsSlider.Bar.ZIndex = 1 - graphicsSlider.Bar.Slider.ZIndex = 1 - graphicsSetter.ZIndex = 1 - graphicsSetter.Text = "Auto" - else - autoGraphicsButton.Text = "" - graphicsSlider.Bar.ZIndex = baseZIndex + 4 - graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5 - betterQualityShortcut.ZIndex = baseZIndex + 4 - fasterShortcut.ZIndex = baseZIndex + 4 - betterQualityText.ZIndex = baseZIndex + 4 - fasterText.ZIndex = baseZIndex + 4 - graphicsSetter.ZIndex = baseZIndex + 4 - end - end - local goToAutoGraphics - goToAutoGraphics = function() - setAutoGraphicsGui(true) - UserSettings().GameSettings.SavedQualityLevel = Enum.SavedQualitySetting.Automatic - settings().Rendering.QualityLevel = Enum.QualityLevel.Automatic - end - local setGraphicsQualityLevel - setGraphicsQualityLevel = function(newLevel) - local percentage = newLevel / GraphicsQualityLevels - local newSetting = math.floor((settings().Rendering:GetMaxQualityLevel() - 1) * percentage) - if newSetting == 20 then - newSetting = 21 - elseif newLevel == 1 then - newSetting = 1 - elseif newSetting > settings().Rendering:GetMaxQualityLevel() then - newSetting = settings().Rendering:GetMaxQualityLevel() - 1 - end - UserSettings().GameSettings.SavedQualityLevel = newLevel - settings().Rendering.QualityLevel = newSetting - end - local goToManualGraphics - goToManualGraphics = function(explicitLevel) - setAutoGraphicsGui(false) - if explicitLevel then - graphicsLevel.Value = explicitLevel - else - graphicsLevel.Value = math.floor((settings().Rendering.AutoFRMLevel / (settings().Rendering:GetMaxQualityLevel() - 1))({ - GraphicsQualityLevels - })) - end - if explicitLevel == graphicsLevel.Value then - setGraphicsQualityLevel(graphicsLevel.Value) - end - if not explicitLevel then - UserSettings().GameSettings.SavedQualityLevel = graphicsLevel.Value - end - graphicsSetter.Text = tostring(graphicsLevel.Value) - end - local showAutoGraphics - showAutoGraphics = function() - autoText.ZIndex = baseZIndex + 4 - autoGraphicsButton.ZIndex = baseZIndex + 4 - end - local hideAutoGraphics - hideAutoGraphics = function() - autoText.ZIndex = 1 - autoGraphicsButton.ZIndex = 1 - end - local showManualGraphics - showManualGraphics = function() - graphicsSlider.Bar.ZIndex = baseZIndex + 4 - graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5 - betterQualityShortcut.ZIndex = baseZIndex + 4 - fasterShortcut.ZIndex = baseZIndex + 4 - betterQualityText.ZIndex = baseZIndex + 4 - fasterText.ZIndex = baseZIndex + 4 - graphicsSetter.ZIndex = baseZIndex + 4 - end - local hideManualGraphics - hideManualGraphics = function() - betterQualityText.ZIndex = 1 - betterQualityShortcut.ZIndex = 1 - fasterShortcut.ZIndex = 1 - fasterText.ZIndex = 1 - graphicsSlider.Bar.ZIndex = 1 - graphicsSlider.Bar.Slider.ZIndex = 1 - graphicsSetter.ZIndex = 1 - end - local translateSavedQualityLevelToInt - translateSavedQualityLevelToInt = function(savedQualityLevel) - if Enum.SavedQualitySetting.Automatic == savedQualityLevel then - return 0 - elseif Enum.SavedQualitySetting.QualityLevel1 == savedQualityLevel then - return 1 - elseif Enum.SavedQualitySetting.QualityLevel2 == savedQualityLevel then - return 2 - elseif Enum.SavedQualitySetting.QualityLevel3 == savedQualityLevel then - return 3 - elseif Enum.SavedQualitySetting.QualityLevel4 == savedQualityLevel then - return 4 - elseif Enum.SavedQualitySetting.QualityLevel5 == savedQualityLevel then - return 5 - elseif Enum.SavedQualitySetting.QualityLevel6 == savedQualityLevel then - return 6 - elseif Enum.SavedQualitySetting.QualityLevel7 == savedQualityLevel then - return 7 - elseif Enum.SavedQualitySetting.QualityLevel8 == savedQualityLevel then - return 8 - elseif Enum.SavedQualitySetting.QualityLevel9 == savedQualityLevel then - return 9 - elseif Enum.SavedQualitySetting.QualityLevel10 == savedQualityLevel then - return 10 - end - end - local enableGraphicsWidget - enableGraphicsWidget = function() - settings().Rendering.EnableFRM = true - isAutoGraphics = UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic - if isAutoGraphics then - showAutoGraphics() - return goToAutoGraphics() - else - showAutoGraphics() - showManualGraphics() - return goToManualGraphics(translateSavedQualityLevelToInt(UserSettings().GameSettings.SavedQualityLevel)) - end - end - local disableGraphicsWidget - disableGraphicsWidget = function() - hideManualGraphics() - hideAutoGraphics() - settings().Rendering.EnableFRM = false - end - graphicsSetter.FocusLost:connect(function() - 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 - 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(_) - if isAutoGraphics then - return - end - if not listenToGraphicsLevelChange then - return - end - graphicsSetter.Text = tostring(graphicsLevel.Value) - return setGraphicsQualityLevel(graphicsLevel.Value) - end) - if inStudioMode or UserSettings().GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic then - if inStudioMode then - settings().Rendering.EnableFRM = false - disableGraphicsWidget() - else - settings().Rendering.EnableFRM = true - goToAutoGraphics() - end - else - 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 not isAutoGraphics then - return goToAutoGraphics() - else - return goToManualGraphics(graphicsLevel.Value) - end - end) - game.GraphicsQualityChangeRequest:connect(function(graphicsIncrease) - if isAutoGraphics then - return - end - if graphicsIncrease then - if (graphicsLevel.Value + 1) > GraphicsQualityLevels then - return - end - graphicsLevel.Value = graphicsLevel.Value + 1 - graphicsSetter.Text = tostring(graphicsLevel.Value) - setGraphicsQualityLevel(graphicsLevel.Value) - return game:GetService("GuiService"):SendNotification("Graphics Quality", "Increased to (" .. tostring(graphicsSetter.Text) .. ")", "", 2, function() end) - else - if (graphicsLevel.Value - 1) <= 0 then - return - end - graphicsLevel.Value = graphicsLevel.Value - 1 - graphicsSetter.Text = tostring(graphicsLevel.Value) - setGraphicsQualityLevel(graphicsLevel.Value) - return game:GetService("GuiService"):SendNotification("Graphics Quality", "Decreased to (" .. tostring(graphicsSetter.Text) .. ")", "", 2, function() end) - end - end) - game.Players.PlayerAdded:connect(function(player) - if player == game.Players.LocalPlayer and inStudioMode then - return enableGraphicsWidget() - end - end) - game.Players.PlayerRemoving:connect(function(player) - if player == game.Players.LocalPlayer and inStudioMode then - return disableGraphicsWidget() - end - end) - 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:SetVerb("TogglePlayMode") - studioCheckbox.Visible = false - local wasManualGraphics = (settings().Rendering.QualityLevel ~= Enum.QualityLevel.Automatic) - if inStudioMode and not game.Players.LocalPlayer then - studioCheckbox.Text = "X" - disableGraphicsWidget() - elseif inStudioMode then - studioCheckbox.Text = "X" - enableGraphicsWidget() - end - if hasGraphicsSlider then - UserSettings().GameSettings.StudioModeChanged:connect(function(isStudioMode) - inStudioMode = isStudioMode - if isStudioMode then - wasManualGraphics = (settings().Rendering.QualityLevel ~= Enum.QualityLevel.Automatic) - goToAutoGraphics() - studioCheckbox.Text = "X" - autoGraphicsButton.ZIndex = 1 - autoText.ZIndex = 1 - else - if wasManualGraphics then - goToManualGraphics() - end - studioCheckbox.Text = "" - autoGraphicsButton.ZIndex = baseZIndex + 4 - autoText.ZIndex = baseZIndex + 4 - end - end) - else - studioCheckbox.MouseButton1Click:connect(function() - if not studioCheckbox.Active then - return - end - if studioCheckbox.Text == "" then - studioCheckbox.Text = "X" - else - studioCheckbox.Text = "" - end - end) - end - end - 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 - if hasGraphicsSlider then - UserSettings().GameSettings.FullscreenChanged:connect(function(isFullscreen) - if isFullscreen then - fullscreenCheckbox.Text = "X" - else - fullscreenCheckbox.Text = "" - end - end) - else - fullscreenCheckbox.MouseButton1Click:connect(function() - if fullscreenCheckbox.Text == "" then - fullscreenCheckbox.Text = "X" - else - fullscreenCheckbox.Text = "" - end - end) - end - if game:FindFirstChild("NetworkClient") then - 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.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.Modal = true - end - backButton.Name = "BackButton" - backButton.ZIndex = baseZIndex + 4 - backButton.Parent = gameSettingsMenuFrame - syncVideoCaptureSetting = nil - if not macClient then - New("TextLabel", "VideoCaptureLabel", { - Text = "After Capturing Video", - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0, 32, 0, 100), - Size = UDim2.new(0, 164, 0, 18), - BackgroundTransparency = 1, - TextColor3 = Color3I(255, 255, 255), - TextXAlignment = Enum.TextXAlignment.Left, - ZIndex = baseZIndex + 4, - Parent = gameSettingsMenuFrame - }) - local videoNames = { } - local videoNameToItem = { } - videoNames[1] = "Just Save to Disk" - videoNameToItem[videoNames[1]] = Enum.UploadSetting["Never"] - videoNames[2] = "Upload to YouTube" - videoNameToItem[videoNames[2]] = Enum.UploadSetting["Ask me first"] - local videoCaptureDropDown - 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.Parent = gameSettingsMenuFrame - syncVideoCaptureSetting = function() - return updateVideoCaptureDropDownSelection((function() - if UserSettings().GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Never"] then - return videoNames[1] - elseif UserSettings().GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Ask me first"] then - return videoNames[2] - else - UserSettings().GameSettings.VideoUploadPromptBehavior = Enum.UploadSetting["Ask me first"] - return videoNames[2] - end - end)()) - end - end - New("TextLabel", "CameraLabel", { - Text = "Character & Camera Controls", - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0, 31, 0, 58), - Size = UDim2.new(0, 224, 0, 18), - TextColor3 = Color3I(255, 255, 255), - TextXAlignment = Enum.TextXAlignment.Left, - BackgroundTransparency = 1, - ZIndex = baseZIndex + 4, - Parent = gameSettingsMenuFrame - }) - local mouseLockLabel = game.CoreGui.RobloxGui:FindFirstChild("MouseLockLabel", true) - local enumItems = Enum.ControlMode:GetEnumItems() - local enumNames = { } - local enumNameToItem = { } - 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] - return 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.Parent = gameSettingsMenuFrame - return gameSettingsMenuFrame -end -if LoadLibrary then - RbxGui = LoadLibrary("RbxGui") - local baseZIndex = 0 - if UserSettings then - local createSettingsDialog - createSettingsDialog = function() - waitForChild(gui, "BottomLeftControl") - settingsButton = gui.BottomLeftControl:FindFirstChild("SettingsButton") - if settingsButton == nil then - settingsButton = New("ImageButton", "SettingsButton", { - Image = "rbxasset://textures/ui/SettingsButton.png", - BackgroundTransparency = 1, - Active = false, - Size = UDim2.new(0, 54, 0, 46), - Position = UDim2.new(0, 2, 0, 50), - Parent = gui.BottomLeftControl - }) - end - local shield = New("TextButton", "UserSettingsShield", { - Text = "", - Active = true, - AutoButtonColor = false, - Visible = false, - Size = UDim2.new(1, 0, 1, 0), - BackgroundColor3 = Color3I(51, 51, 51), - BorderColor3 = Color3I(27, 42, 53), - BackgroundTransparency = 0.4, - ZIndex = baseZIndex + 2 - }) - mainShield = shield - local frame = New("Frame", "Settings", { - Position = UDim2.new(0.5, -262, -0.5, -200), - Size = UDim2.new(0, 525, 0, 430), - BackgroundTransparency = 1, - Active = true, - Parent = shield - }) - local settingsFrame = New("Frame", "SettingsStyle", { - Size = UDim2.new(1, 0, 1, 0), - Style = Enum.FrameStyle.RobloxRound, - Active = true, - ZIndex = baseZIndex + 3, - Parent = frame - }) - local gameMainMenu = createGameMainMenu(baseZIndex, shield) - gameMainMenu.Parent = settingsFrame - gameMainMenu.ScreenshotButton.MouseButton1Click:connect(function() - return backToGame(gameMainMenu.ScreenshotButton, shield, settingsButton) - end) - gameMainMenu.RecordVideoButton.MouseButton1Click:connect(function() - recordVideoClick(gameMainMenu.RecordVideoButton, gui.StopRecordButton) - return backToGame(gameMainMenu.RecordVideoButton, shield, settingsButton) - end) - if settings():FindFirstChild("Game Options") then -pcall(function() - return settings():FindFirstChild("Game Options").VideoRecordingChangeRequest:connect(function(recording) - recordingVideo = recording - return setRecordGui(recording, gui.StopRecordButton, gameMainMenu.RecordVideoButton) - end) - end) - end - game.CoreGui.RobloxGui.Changed:connect(function(prop) - if prop == "AbsoluteSize" and recordingVideo then - return recordVideoClick(gameMainMenu.RecordVideoButton, gui.StopRecordButton) - end - end) - local localPlayerChange - localPlayerChange = function() - 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() - return localPlayerChange() - end) - else - delay(0, function() - waitForProperty(game.Players, "LocalPlayer") - gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer - return game.Players.LocalPlayer.Changed:connect(function() - return 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() - return goToMenu(settingsFrame, "ResetConfirmationMenu", "up", UDim2.new(0, 525, 0, 370)) - end) - gameMainMenu.LeaveGameButton.MouseButton1Click:connect(function() - return goToMenu(settingsFrame, "LeaveConfirmationMenu", "down", UDim2.new(0, 525, 0, 300)) - end) - if game.CoreGui.Version >= 4 then - game:GetService("GuiService").EscapeKeyPressed:connect(function() - if currentMenuSelection == nil then - return game.GuiService:AddCenterDialog(shield, Enum.CenterDialogType.ModalDialog, 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) - return settingsFrame.Parent:TweenSize(UDim2.new(0, 525, 0, 430), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) - end, 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 - end - centerDialogs = { } - end - goToMenu(lastMenuSelection[#lastMenuSelection]["container"], lastMenuSelection[#lastMenuSelection]["name"], lastMenuSelection[#lastMenuSelection]["direction"], lastMenuSelection[#lastMenuSelection]["lastSize"]) - table.remove(lastMenuSelection, #lastMenuSelection) - if #lastMenuSelection == 1 then - lastMenuSelection = { } - end - else - return resumeGameFunction(shield) - end - end) - end - local gameSettingsMenu = createGameSettingsMenu(baseZIndex, shield) - gameSettingsMenu.Visible = false - gameSettingsMenu.Parent = settingsFrame - gameMainMenu.SettingsButton.MouseButton1Click:connect(function() - return goToMenu(settingsFrame, "GameSettingsMenu", "left", UDim2.new(0, 525, 0, 350)) - end) - gameSettingsMenu.BackButton.MouseButton1Click:connect(function() - return 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 - robloxLock(shield) - settingsButton.MouseButton1Click:connect(function() - return game.GuiService:AddCenterDialog(shield, Enum.CenterDialogType.ModalDialog, 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 - settingsFrame.Parent:TweenPosition(UDim2.new(0.5, -262, 0.5, -200), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) - return settingsFrame.Parent:TweenSize(UDim2.new(0, 525, 0, 430), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, tweenTime, true) - end, 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) - 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 - local leaveGameButton = gui.BottomLeftControl:FindFirstChild("Exit") - if leaveGameButton ~= nil then - leaveGameButton:Remove() - end - local topLeft = gui:FindFirstChild("TopLeftControl") - if topLeft then - leaveGameButton = topLeft:FindFirstChild("Exit") - if leaveGameButton ~= nil then - leaveGameButton:Remove() - end - return topLeft:Remove() - end - end) - end - local createSaveDialogs - createSaveDialogs = function() - local shield = New("TextButton", "SaveDialogShield", { - Text = "", - AutoButtonColor = false, - Active = true, - Visible = false, - Size = UDim2.new(1, 0, 1, 0), - BackgroundColor3 = Color3I(51, 51, 51), - BorderColor3 = Color3I(27, 42, 53), - BackgroundTransparency = 0.4, - ZIndex = baseZIndex + 1 - }) - local clearAndResetDialog, save, saveLocal, dontSave, cancel - local messageBoxButtons = { } - messageBoxButtons[1] = { } - messageBoxButtons[1].Text = "Save" - messageBoxButtons[1].Style = Enum.ButtonStyle.RobloxButtonDefault - messageBoxButtons[1].Function = function() - return save() - end - messageBoxButtons[2] = { } - messageBoxButtons[2].Text = "Cancel" - messageBoxButtons[2].Function = function() - return cancel() - end - messageBoxButtons[3] = { } - messageBoxButtons[3].Text = "Don't Save" - messageBoxButtons[3].Function = function() - return dontSave() - end - local saveDialogMessageBox = RbxGui.CreateStyledMessageDialog("Unsaved Changes", "Save your changes to Mercury 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() - return saveLocal() - end - buttonOffset = buttonOffset + 1 - end - errorBoxButtons[buttonOffset] = { } - errorBoxButtons[buttonOffset].Text = "Keep Playing" - errorBoxButtons[buttonOffset].Function = function() - return cancel() - end - errorBoxButtons[buttonOffset + 1] = { } - errorBoxButtons[buttonOffset + 1].Text = "Don't Save" - errorBoxButtons[buttonOffset + 1].Function = function() - return dontSave() - end - local errorDialogMessageBox = RbxGui.CreateStyledMessageDialog("Upload Failed", "Sorry, we could not save your changes to Mercury.", "Error", errorBoxButtons) - errorDialogMessageBox.Visible = false - errorDialogMessageBox.Parent = shield - local spinnerDialog = New("Frame", "SpinnerDialog", { - Style = Enum.FrameStyle.RobloxRound, - Size = UDim2.new(0, 350, 0, 150), - Position = UDim2.new(0.5, -175, 0.5, -75), - Visible = false, - Active = true, - Parent = shield, - New("TextLabel", "WaitingLabel", { - Text = "Saving to Mercury...", - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0.5, 25, 0.5, 0), - TextColor3 = Color3.new(1, 1, 1) - }) - }) - local spinnerFrame = New("Frame", "Spinner", { - Size = UDim2.new(0, 80, 0, 80), - Position = UDim2.new(0.5, -150, 0.5, -40), - BackgroundTransparency = 1, - Parent = spinnerDialog - }) - local spinnerIcons = { } - local spinnerNum = 1 - while spinnerNum <= 8 do - local spinnerImage = New("ImageLabel", "Spinner" .. tostring(spinnerNum), { - Size = UDim2.new(0, 16, 0, 16), - 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), - BackgroundTransparency = 1, - Image = "http://www.roblox.com/Asset?id=45880710", - Parent = spinnerFrame - }) - spinnerIcons[spinnerNum] = spinnerImage - spinnerNum = spinnerNum + 1 - end - save = function() - saveDialogMessageBox.Visible = false - spinnerDialog.Visible = true - local spin = true - 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) - local result = game:SaveToRoblox() - if not result then - result = game:SaveToRoblox() - end - spinnerDialog.Visible = false - spin = false - if result then - game:FinishShutdown(false) - return clearAndResetDialog() - else - errorDialogMessageBox.Visible = true - end - end - saveLocal = function() - errorDialogMessageBox.Visible = false - game:FinishShutdown(true) - return clearAndResetDialog() - end - dontSave = function() - saveDialogMessageBox.Visible = false - errorDialogMessageBox.Visible = false - game:FinishShutdown(false) - return clearAndResetDialog() - end - cancel = function() - saveDialogMessageBox.Visible = false - errorDialogMessageBox.Visible = false - return clearAndResetDialog() - end - clearAndResetDialog = function() - saveDialogMessageBox.Visible = true - errorDialogMessageBox.Visible = false - spinnerDialog.Visible = false - shield.Visible = false - return game.GuiService:RemoveCenterDialog(shield) - end - robloxLock(shield) - shield.Visible = false - return shield - end - local createReportAbuseDialog - createReportAbuseDialog = function() - waitForChild(game, "NetworkClient") - 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 shield = New("TextButton", "ReportAbuseShield", { - Text = "", - AutoButtonColor = false, - Active = true, - Visible = false, - Size = UDim2.new(1, 0, 1, 0), - BackgroundColor3 = Color3I(51, 51, 51), - BorderColor3 = Color3I(27, 42, 53), - BackgroundTransparency = 0.4, - ZIndex = baseZIndex + 1 - }) - local closeAndResetDialog - local messageBoxButtons = { } - messageBoxButtons[1] = { } - messageBoxButtons[1].Text = "Ok" - messageBoxButtons[1].Modal = true - messageBoxButtons[1].Function = function() - return 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 recordedMessageBox = RbxGui.CreateMessageDialog("Thanks for your report!", "We've recorded your report for evaluation.", messageBoxButtons) - recordedMessageBox.Visible = false - recordedMessageBox.Parent = shield - 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 frame = New("Frame", "Settings", { - Position = UDim2.new(0.5, -250, 0.5, -200), - Size = UDim2.new(0, 500, 0, 400), - BackgroundTransparency = 1, - Active = true, - Parent = shield - }) - local settingsFrame = New("Frame", "ReportAbuseStyle", { - Size = UDim2.new(1, 0, 1, 0), - Style = Enum.FrameStyle.RobloxRound, - Active = true, - ZIndex = baseZIndex + 1, - Parent = frame, - New("TextLabel", "Title", { - Text = "Report Abuse", - TextColor3 = Color3I(221, 221, 221), - Position = UDim2.new(0.5, 0, 0, 30), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size36, - ZIndex = baseZIndex + 2 - }), - New("TextLabel", "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(0, 0, 0, 55), - Size = UDim2.new(1, 0, 0, 40), - BackgroundTransparency = 1, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - TextWrap = true, - ZIndex = baseZIndex + 2, - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top - }), - New("TextLabel", "PlayerLabel", { - Text = "Which player?", - BackgroundTransparency = 1, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0.025, 0, 0, 100), - Size = UDim2.new(0.4, 0, 0, 36), - TextColor3 = Color3I(255, 255, 255), - TextXAlignment = Enum.TextXAlignment.Left, - ZIndex = baseZIndex + 2 - }), - New("TextLabel", "AbuseLabel", { - Text = "Type of Abuse:", - 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), - TextXAlignment = Enum.TextXAlignment.Left, - ZIndex = baseZIndex + 2 - }) - }) - local abusingPlayer - local abuse - local submitReportButton - local updatePlayerSelection - local createPlayersDropDown - createPlayersDropDown = function() - local players = game:GetService("Players") - local playerNames = { } - local nameToPlayer = { } - local children = players:GetChildren() - local pos = 1 - if children then - for _, 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 - local playerDropDown - 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(0.425, 0, 0, 102) - playerDropDown.Size = UDim2.new(0.55, 0, 0, 32) - return playerDropDown - end - 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 - New("TextLabel", "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), - TextXAlignment = Enum.TextXAlignment.Left, - BackgroundTransparency = 1, - ZIndex = baseZIndex + 2, - Parent = settingsFrame - }) - local shortDescriptionWrapper = New("Frame", "ShortDescriptionWrapper", { - Position = UDim2.new(0.025, 0, 0, 220), - Size = UDim2.new(0.95, 0, 1, -310), - BackgroundColor3 = Color3I(0, 0, 0), - BorderSizePixel = 0, - ZIndex = baseZIndex + 2, - Parent = settingsFrame - }) - local shortDescriptionBox = New("TextBox", "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), - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top, - TextWrap = true, - BackgroundColor3 = Color3I(0, 0, 0), - BorderSizePixel = 0, - ZIndex = baseZIndex + 2, - Parent = shortDescriptionWrapper - }) - submitReportButton = New("TextButton", "SubmitReportBtn", { - Active = false, - Modal = true, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0.1, 0, 1, -80), - Size = UDim2.new(0.35, 0, 0, 50), - AutoButtonColor = true, - Style = Enum.ButtonStyle.RobloxButtonDefault, - Text = "Submit Report", - TextColor3 = Color3I(255, 255, 255), - ZIndex = baseZIndex + 2, - 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 - return closeAndResetDialog() - end - end - end) - local cancelButton = New("TextButton", "CancelBtn", { - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0.55, 0, 1, -80), - Size = UDim2.new(0.35, 0, 0, 50), - AutoButtonColor = true, - Style = Enum.ButtonStyle.RobloxButtonDefault, - Text = "Cancel", - TextColor3 = Color3I(255, 255, 255), - ZIndex = baseZIndex + 2, - Parent = settingsFrame - }) - closeAndResetDialog = function() - 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 - return game.GuiService:RemoveCenterDialog(shield) - end - cancelButton.MouseButton1Click:connect(closeAndResetDialog) - reportAbuseButton.MouseButton1Click:connect(function() - createPlayersDropDown().Parent = settingsFrame - table.insert(centerDialogs, shield) - return game.GuiService:AddCenterDialog(shield, Enum.CenterDialogType.ModalDialog, function() - reportAbuseButton.Active = false - shield.Visible = true - mainShield.Visible = false - end, function() - reportAbuseButton.Active = true - shield.Visible = false - end) - end) - robloxLock(shield) - return shield - end - local isSaveDialogSupported = pcall(function() 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, function() - saveDialogs.Visible = true - end, function() - saveDialogs.Visible = false - end) - return true - end - end) - end - delay(0, function() - createReportAbuseDialog().Parent = gui - 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") - gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton.Active = true - end) -pcall(function() - return game.GuiService.UseLuaChat - end) - local BurningManPlaceID = 41324860 - return 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) - return game.Players.LocalPlayer.CharacterAdded:connect(function(character) - waitForChild(character, "Humanoid") - return character.Humanoid:SetClickToWalkEnabled(false) - end) - end - end) -end +print'[Mercury]: Loaded corescript 46295863'local a a=function(b,c,d)if not(d~= +nil)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for +g,h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h +end elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e. +Parent=f return e end local b b=function(c,d)while not c:FindFirstChild(d)do c. +ChildAdded:wait()end end local c c=function(d,e)while not d[e]do d.Changed:wait( +)end end local d if script.Parent:FindFirstChild'ControlFrame'then d=script. +Parent:FindFirstChild'ControlFrame'else d=script.Parent end local e,f,g,h,i,j,k, +l,m,n,o,p,q,r,s,t,u=nil,nil,nil,0.2,'http://www.roblox.com/asset?id=54071825', +'http://www.roblox.com/Asset?id=45915798',game:GetService'CoreGui'.Version>=5,10 +,false,nil,{},{},nil,UserSettings().GameSettings:InStudioMode(),false,nil,nil t, +u=pcall(function()return not game.GuiService.IsWindows end)s=t and u local v v= +function(w,x,y)return Color3.new(w/255,x/255,y/255)end local w w=function(x)x. +RobloxLocked=true local y=x:GetChildren()if y then for z,A in ipairs(y)do w(A) +end end end local x x=function(y)y.Settings:TweenPosition(UDim2.new(0.5,-262,- +0.5,-200),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)return delay(h +,function()y.Visible=false for z=1,#p do p[z].Visible=false game.GuiService: +RemoveCenterDialog(p[z])end game.GuiService:RemoveCenterDialog(y)settingsButton. +Active=true n=nil o={}end)end local y y=function(z,A,B,C,D)if type(A)~='string' +then return end table.insert(o,n)if A=='GameMainMenu'then o={}end local E=z: +GetChildren()for F=1,#E do if E[F].Name==A then E[F].Visible=true n={container=z +,name=A,direction=B,lastSize=C}if C and D then E[F]:TweenSizeAndPosition(C,D, +Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)elseif C then E[F]: +TweenSizeAndPosition(C,UDim2.new(0.5,-C.X.Offset/2,0.5,-C.Y.Offset/2),Enum. +EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)else E[F]:TweenPosition(UDim2 +.new(0,0,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)end else +if B=='left'then E[F]:TweenPosition(UDim2.new(-1,-525,0,0),Enum.EasingDirection. +InOut,Enum.EasingStyle.Sine,h,true)elseif B=='right'then E[F]:TweenPosition( +UDim2.new(1,525,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,h,true) +elseif B=='up'then E[F]:TweenPosition(UDim2.new(0,0,-1,-400),Enum. +EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)elseif B=='down'then E[F]: +TweenPosition(UDim2.new(0,0,1,400),Enum.EasingDirection.InOut,Enum.EasingStyle. +Sine,h,true)end delay(h,function()E[F].Visible=false end)end end end local z z= +function()local A=game.Players.LocalPlayer if A and A.Character and A.Character: +FindFirstChild'Humanoid'then A.Character.Humanoid.Health=0 end end local A A= +function(B,C,D,E,F)local G=Instance.new'TextButton'G.Font=Enum.Font.Arial G. +FontSize=D G.Size=E G.Position=F G.Style=C G.TextColor3=Color3.new(1,1,1)G.Text= +B return G end local B B=function(C,D,E,F)if#D<1 then error +'Must have more than one button'end local G,H,I=1,{},nil I=function(J)for K,L in +ipairs(H)do if L==J then L.Style=Enum.ButtonStyle.RobloxButtonDefault else L. +Style=Enum.ButtonStyle.RobloxButton end end end for J,K in ipairs(D)do local L= +a('TextButton','Button'..tostring(G),{Font=Enum.Font.Arial,FontSize=Enum. +FontSize.Size18,AutoButtonColor=true,Style=Enum.ButtonStyle.RobloxButton,Text=K. +Text,TextColor3=Color3.new(1,1,1),Parent=C})L.MouseButton1Click:connect(function +()I(L)return K.Function()end)H[G]=L G=G+1 end I(H[1])local L=G-1 if L==1 then C. +Button1.Position=UDim2.new(0.35,0,E.Scale,E.Offset)C.Button1.Size=UDim2.new(0.4, +0,F.Scale,F.Offset)elseif L==2 then C.Button1.Position=UDim2.new(0.1,0,E.Scale,E +.Offset)C.Button1.Size=UDim2.new(0.35,0,F.Scale,F.Offset)C.Button2.Position= +UDim2.new(0.55,0,E.Scale,E.Offset)C.Button2.Size=UDim2.new(0.35,0,F.Scale,F. +Offset)elseif L>=3 then local M,N=0.1/L,0.9/L G=1 while G<=L do H[G].Position= +UDim2.new(M*G+(G-1)*N,0,E.Scale,E.Offset)H[G].Size=UDim2.new(N,0,F.Scale,F. +Offset)G=G+1 end end end local C C=function(D,E,F)if D then E.Visible=true F. +Text='Stop Recording'else E.Visible=false F.Text='Record Video'end end local D D +=function(E,F)m=not m return C(m,F,E)end local E E=function(F,G,H)F.Parent. +Parent.Parent.Parent.Visible=false G.Visible=false for I=1,#p do game.GuiService +:RemoveCenterDialog(p[I])p[I].Visible=false end p={}game.GuiService: +RemoveCenterDialog(G)H.Active=true end local F F=function(G)if not G then return +end if G:IsA'TextLabel'then G.TextTransparency=0.9 elseif G:IsA'TextButton'then +G.TextTransparency=0.9 G.Active=false else if G['ClassName']then return print( +[[setDisabledState! got object of unsupported type. object type is ]],G. +ClassName)end end end local G G=function(H)if e==nil then if d:FindFirstChild(d. +TopLeftControl:FindFirstChild'Help')then e=d.TopLeftControl.Help elseif d: +FindFirstChild(d.BottomRightControl:FindFirstChild'Help')then e=d. +BottomRightControl.Help end end local I=a('Frame','HelpDialogShield',{Active= +true,Visible=false,Size=UDim2.new(1,0,1,0),BackgroundColor3=v(51,51,51), +BorderColor3=v(27,42,53),BackgroundTransparency=0.4,ZIndex=H+1})local J=a( +'Frame','HelpDialog',{Style=Enum.FrameStyle.RobloxRound,Position=UDim2.new(0.2,0 +,0.2,0),Size=UDim2.new(0.6,0,0.6,0),Active=true,Parent=I,a('TextLabel','Title',{ +Text='Keyboard & Mouse Controls',Font=Enum.Font.ArialBold,FontSize=Enum.FontSize +.Size36,Position=UDim2.new(0,0,0.025,0),Size=UDim2.new(1,0,0,40),TextColor3= +Color3.new(1,1,1),BackgroundTransparency=1}),a('Frame','Buttons',{Position=UDim2 +.new(0.1,0,0.07,40),Size=UDim2.new(0.8,0,0,45),BackgroundTransparency=1}),a( +'Frame','ImageFrame',{Position=UDim2.new(0.05,0,0.075,80),Size=UDim2.new(0.9,0, +0.9,-120),BackgroundTransparency=1,a('Frame','LayoutFrame',{Position=UDim2.new( +0.5,0,0,0),Size=UDim2.new(1.5,0,1,0),BackgroundTransparency=1,SizeConstraint= +Enum.SizeConstraint.RelativeYY,a('ImageLabel','Image',{Image=(function()if +UserSettings().GameSettings.ControlMode==Enum.ControlMode['Mouse Lock Switch'] +then return i else return j end end)(),Position=UDim2.new(-0.5,0,0,0),Size=UDim2 +.new(1,0,1,0),BackgroundTransparency=1})})})})local K,L,M=J.Buttons,J.ImageFrame +.LayoutFrame.Image,{}M[1]={}M[1].Text='Look'M[1].Function=function()if +UserSettings().GameSettings.ControlMode==Enum.ControlMode['Mouse Lock Switch'] +then L.Image=i else L.Image=j end end M[2]={}M[2].Text='Move'M[2].Function= +function()L.Image='http://www.roblox.com/Asset?id=45915811'end M[3]={}M[3].Text= +'Gear'M[3].Function=function()L.Image='http://www.roblox.com/Asset?id=45917596' +end M[4]={}M[4].Text='Zoom'M[4].Function=function()L.Image= +'http://www.roblox.com/Asset?id=45915825'end B(K,M,UDim.new(0,0),UDim.new(1,0)) +delay(0,function()b(d,'UserSettingsShield')b(d.UserSettingsShield,'Settings')b(d +.UserSettingsShield.Settings,'SettingsStyle')b(d.UserSettingsShield.Settings. +SettingsStyle,'GameSettingsMenu')b(d.UserSettingsShield.Settings.SettingsStyle. +GameSettingsMenu,'CameraField')b(d.UserSettingsShield.Settings.SettingsStyle. +GameSettingsMenu.CameraField,'DropDownMenuButton')return d.UserSettingsShield. +Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Changed: +connect(function(N)if N~='Text'then return end if K.Button1.Style==Enum. +ButtonStyle.RobloxButtonDefault then if d.UserSettingsShield.Settings. +SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Text=='Classic' +then L.Image=j else L.Image=i end end end)end)local N=a('TextButton','OkBtn',{ +Text='OK',Modal=true,Size=UDim2.new(0.3,0,0,45),Position=UDim2.new(0.35,0,0.975, +-50),Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size18,BackgroundTransparency=1 +,TextColor3=Color3.new(1,1,1),Style=Enum.ButtonStyle.RobloxButtonDefault,Parent= +J})N.MouseButton1Click:connect(function()I.Visible=false return game.GuiService: +RemoveCenterDialog(I)end)w(I)return I end local H H=function(I,J)local K,L=a( +'Frame','LeaveConfirmationMenu',{BackgroundTransparency=1,Size=UDim2.new(1,0,1,0 +),Position=UDim2.new(0,0,2,400),ZIndex=I+4,a('TextLabel','LeaveText',{Text= +'Leave this game?',Size=UDim2.new(1,0,0.8,0),TextWrap=true,TextColor3=Color3. +new(1,1,1),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size36, +BackgroundTransparency=1,ZIndex=I+4})}),A('Leave',Enum.ButtonStyle.RobloxButton, +Enum.FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0,313,0.8,0))L.Name= +'YesButton'L.ZIndex=I+4 L.Parent=K L.Modal=true L:SetVerb'Exit'local M=A('Stay', +Enum.ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,128,0,50), +UDim2.new(0,90,0.8,0))M.Name='NoButton'M.Parent=K M.ZIndex=I+4 M. +MouseButton1Click:connect(function()y(J.Settings.SettingsStyle,'GameMainMenu', +'down',UDim2.new(0,525,0,430))return J.Settings:TweenSize(UDim2.new(0,525,0,430) +,Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)end)return K end local +I I=function(J,K)local L,M=a('Frame','ResetConfirmationMenu',{ +BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),Position=UDim2.new(0,0,2,400), +ZIndex=J+4}),A('Reset',Enum.ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24 +,UDim2.new(0,128,0,50),UDim2.new(0,313,0,299))M.Name='YesButton'M.ZIndex=J+4 M. +Parent=L M.Modal=true M.MouseButton1Click:connect(function()x(K)return z()end) +local N=A('Cancel',Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size24,UDim2.new( +0,128,0,50),UDim2.new(0,90,0,299))N.Name='NoButton'N.Parent=L N.ZIndex=J+4 N. +MouseButton1Click:connect(function()y(K.Settings.SettingsStyle,'GameMainMenu', +'down',UDim2.new(0,525,0,430))return K.Settings:TweenSize(UDim2.new(0,525,0,430) +,Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)end)local O=a( +'TextLabel','ResetCharacterText',{Text= +'Are you sure you want to reset your character?',Size=UDim2.new(1,0,0.8,0), +TextWrap=true,TextColor3=Color3.new(1,1,1),Font=Enum.Font.ArialBold,FontSize= +Enum.FontSize.Size36,BackgroundTransparency=1,ZIndex=J+4,Parent=L})do local P=O: +Clone()P.Name='FineResetCharacterText'P.Text= +'You will be put back on a spawn point'P.Size=UDim2.new(0,303,0,18)P.Position= +UDim2.new(0,109,0,215)P.FontSize=Enum.FontSize.Size18 P.Parent=L end return L +end local J J=function(K,L)local M,N=a('Frame','GameMainMenu',{ +BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),ZIndex=K+4,Parent=settingsFrame +,a('TextLabel','Title',{Text='Game Menu',BackgroundTransparency=1, +TextStrokeTransparency=0,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size36, +Size=UDim2.new(1,0,0,36),Position=UDim2.new(0,0,0,4),TextColor3=Color3.new(1,1,1 +),ZIndex=K+4})}),A('Help',Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18, +UDim2.new(0,164,0,50),UDim2.new(0,82,0,256))N.Name='HelpButton'N.ZIndex=K+4 N. +Parent=M e=N local O=G(K)O.Parent=d e.MouseButton1Click:connect(function()table. +insert(p,O)return game.GuiService:AddCenterDialog(O,Enum.CenterDialogType. +ModalDialog,function()O.Visible=true q.Visible=false end,function()O.Visible= +false end)end)e.Active=true local P,Q=a('TextLabel','HelpShortcutText',{Text= +'F1',Visible=false,BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum. +FontSize.Size12,Position=UDim2.new(0,85,0,0),Size=UDim2.new(0,30,0,30), +TextColor3=Color3.new(0,1,0),ZIndex=K+4,Parent=N}),A('Screenshot',Enum. +ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0,168,0,50),UDim2.new(0, +254,0,256))Q.Name='ScreenshotButton'Q.ZIndex=K+4 Q.Parent=M Q.Visible=not s Q: +SetVerb'Screenshot'do local R=P:clone()R.Name='ScreenshotShortcutText'R.Text= +'PrintSc'R.Position=UDim2.new(0,118,0,0)R.Visible=true R.Parent=Q end local R=A( +'Record Video',Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0, +168,0,50),UDim2.new(0,254,0,306))R.Name='RecordVideoButton'R.ZIndex=K+4 R.Parent +=M R.Visible=not s R:SetVerb'RecordToggle'do local S=P:clone()S.Visible=k S.Name +='RecordVideoShortcutText'S.Text='F12'S.Position=UDim2.new(0,120,0,0)S.Parent=R +end local S=a('ImageButton','StopRecordButton',{BackgroundTransparency=1,Image= +'rbxasset://textures/ui/RecordStop.png',Size=UDim2.new(0,59,0,27)})S:SetVerb +'RecordToggle'S.MouseButton1Click:connect(function()return D(R,S)end)S.Visible= +false S.Parent=d local T=A('Report Abuse',Enum.ButtonStyle.RobloxButton,Enum. +FontSize.Size18,UDim2.new(0,164,0,50),UDim2.new(0,82,0,306))T.Name= +'ReportAbuseButton'T.ZIndex=K+4 T.Parent=M local U=A('Leave Game',Enum. +ButtonStyle.RobloxButton,Enum.FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0, +82,0,358))U.Name='LeaveGameButton'U.ZIndex=K+4 U.Parent=M local V=A( +'Resume Game',Enum.ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24,UDim2. +new(0,340,0,50),UDim2.new(0,82,0,54))V.Name='resumeGameButton'V.ZIndex=K+4 V. +Parent=M V.Modal=true V.MouseButton1Click:connect(function()return x(L)end)local +W=A('Game Settings',Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size24,UDim2. +new(0,340,0,50),UDim2.new(0,82,0,156))W.Name='SettingsButton'W.ZIndex=K+4 W. +Parent=M if game:FindFirstChild'LoadingGuiService'and#game.LoadingGuiService: +GetChildren()>0 then W=A('Game Instructions',Enum.ButtonStyle.RobloxButton,Enum. +FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0,82,0,207))W.Name= +'GameInstructions'W.ZIndex=K+4 W.Parent=M W.MouseButton1Click:connect(function() +if game:FindFirstChild(game.Players['LocalPlayer'])then local X=game.Players. +LocalPlayer:FindFirstChild'PlayerLoadingGui'if X then X.Visible=true end end end +)end local X=A('Reset Character',Enum.ButtonStyle.RobloxButton,Enum.FontSize. +Size24,UDim2.new(0,340,0,50),UDim2.new(0,82,0,105))X.Name='ResetButton'X.ZIndex= +K+4 X.Parent=M return M end local K K=function(L,M)local N=a('Frame', +'GameSettingsMenu',{BackgroundTransparency=1,Size=UDim2.new(1,0,1,0),ZIndex=L+4, +a('TextLabel','Title',{Text='Settings',Size=UDim2.new(1,0,0,48),Position=UDim2. +new(0,9,0,-9),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size36,TextColor3= +Color3.new(1,1,1),ZIndex=L+4,BackgroundTransparency=1}),a('TextLabel', +'FullscreenText',{Text='Fullscreen Mode',Size=UDim2.new(0,124,0,18),Position= +UDim2.new(0,62,0,145),Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size18, +TextColor3=Color3.new(1,1,1),ZIndex=L+4,BackgroundTransparency=1})})local O,P=a( +'TextLabel','FullscreenShortcutText',{Visible=k,Text='F11', +BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size12, +Position=UDim2.new(0,186,0,141),Size=UDim2.new(0,30,0,30),TextColor3=Color3.new( +0,1,0),ZIndex=L+4,Parent=N}),a('TextLabel','StudioText',{Visible=false,Text= +'Studio Mode',Size=UDim2.new(0,95,0,18),Position=UDim2.new(0,62,0,179),Font=Enum +.Font.Arial,FontSize=Enum.FontSize.Size18,TextColor3=Color3.new(1,1,1),ZIndex=L+ +4,BackgroundTransparency=1,Parent=N})local Q=O:clone()Q.Name= +'StudioShortcutText'Q.Visible=false Q.Text='F2'Q.Position=UDim2.new(0,154,0,175) +Q.Parent=N local R if k then local S=a('TextLabel','QualityText',{Text= +'Graphics Quality',Size=UDim2.new(0,128,0,18),Position=UDim2.new(0,30,0,239), +Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size18,TextColor3=Color3.new(1,1,1), +ZIndex=L+4,BackgroundTransparency=1,Parent=N,Visible=not r})local T=S:clone()T. +Name='AutoText'T.Text='Auto'T.Position=UDim2.new(0,183,0,214)T.TextColor3=Color3 +.new(0.5019607843137255,0.5019607843137255,0.5019607843137255)T.Size=UDim2.new(0 +,34,0,18)T.Parent=N T.Visible=not r local U=T:clone()U.Name='FasterText'U.Text= +'Faster'U.Position=UDim2.new(0,185,0,274)U.TextColor3=Color3.new(95,95,95)U. +FontSize=Enum.FontSize.Size14 U.Parent=N U.Visible=not r local V=O:clone()V.Name +='FasterShortcutText'V.Text='F10 + Shift'V.Position=UDim2.new(0,185,0,283)V. +Parent=N V.Visible=not r local W=T:clone()W.Name='BetterQualityText'W.Text= +'Better Quality'W.TextWrap=true W.Size=UDim2.new(0,41,0,28)W.Position=UDim2.new( +0,390,0,269)W.TextColor3=Color3.new(95,95,95)W.FontSize=Enum.FontSize.Size14 W. +Parent=N W.Visible=not r local X=O:clone()X.Name='BetterQualityShortcut'X.Text= +'F10'X.Position=UDim2.new(0,394,0,288)X.Parent=N X.Visible=not r local Y=A('X', +Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0,25,0,25),UDim2. +new(0,187,0,239))Y.Name='AutoGraphicsButton'Y.ZIndex=L+4 Y.Parent=N Y.Visible= +not r local Z,_=RbxGui.CreateSlider(l,150,UDim2.new(0,230,0,280))Z.Parent=N Z. +Bar.ZIndex=L+4 Z.Bar.Slider.ZIndex=L+5 Z.Visible=not r _.Value=math.floor(( +settings().Rendering:GetMaxQualityLevel()-1)/2)local aa,ab=a('TextBox', +'GraphicsSetter',{BackgroundColor3=Color3.new(0,0,0),BorderColor3=Color3.new( +0.5019607843137255,0.5019607843137255,0.5019607843137255),Size=UDim2.new(0,50,0, +25),Position=UDim2.new(0,450,0,269),TextColor3=Color3.new(1,1,1),Font=Enum.Font. +Arial,FontSize=Enum.FontSize.Size18,Text='Auto',ZIndex=1,TextWrap=true,Parent=N, +Visible=not r}),true if not r then ab=(UserSettings().GameSettings. +SavedQualityLevel==Enum.SavedQualitySetting.Automatic)else settings().Rendering. +EnableFRM=false end local ac,ad=true,nil ad=function(ae)ab=ae if ae then Y.Text= +'X'W.ZIndex=1 X.ZIndex=1 V.ZIndex=1 U.ZIndex=1 Z.Bar.ZIndex=1 Z.Bar.Slider. +ZIndex=1 aa.ZIndex=1 aa.Text='Auto'else Y.Text=''Z.Bar.ZIndex=L+4 Z.Bar.Slider. +ZIndex=L+5 X.ZIndex=L+4 V.ZIndex=L+4 W.ZIndex=L+4 U.ZIndex=L+4 aa.ZIndex=L+4 end +end local ae ae=function()ad(true)UserSettings().GameSettings.SavedQualityLevel= +Enum.SavedQualitySetting.Automatic settings().Rendering.QualityLevel=Enum. +QualityLevel.Automatic end local af af=function(ag)local ah=ag/l local ai=math. +floor((settings().Rendering:GetMaxQualityLevel()-1)*ah)if ai==20 then ai=21 +elseif ag==1 then ai=1 elseif ai>settings().Rendering:GetMaxQualityLevel()then +ai=settings().Rendering:GetMaxQualityLevel()-1 end UserSettings().GameSettings. +SavedQualityLevel=ag settings().Rendering.QualityLevel=ai end local ag ag= +function(ah)ad(false)if ah then _.Value=ah else _.Value=math.floor((settings(). +Rendering.AutoFRMLevel/(settings().Rendering:GetMaxQualityLevel()-1)){l})end if +ah==_.Value then af(_.Value)end if not ah then UserSettings().GameSettings. +SavedQualityLevel=_.Value end aa.Text=tostring(_.Value)end local ah ah=function( +)T.ZIndex=L+4 Y.ZIndex=L+4 end local ai ai=function()T.ZIndex=1 Y.ZIndex=1 end +local aj aj=function()Z.Bar.ZIndex=L+4 Z.Bar.Slider.ZIndex=L+5 X.ZIndex=L+4 V. +ZIndex=L+4 W.ZIndex=L+4 U.ZIndex=L+4 aa.ZIndex=L+4 end local ak ak=function()W. +ZIndex=1 X.ZIndex=1 V.ZIndex=1 U.ZIndex=1 Z.Bar.ZIndex=1 Z.Bar.Slider.ZIndex=1 +aa.ZIndex=1 end local al al=function(am)if Enum.SavedQualitySetting.Automatic== +am then return 0 elseif Enum.SavedQualitySetting.QualityLevel1==am then return 1 +elseif Enum.SavedQualitySetting.QualityLevel2==am then return 2 elseif Enum. +SavedQualitySetting.QualityLevel3==am then return 3 elseif Enum. +SavedQualitySetting.QualityLevel4==am then return 4 elseif Enum. +SavedQualitySetting.QualityLevel5==am then return 5 elseif Enum. +SavedQualitySetting.QualityLevel6==am then return 6 elseif Enum. +SavedQualitySetting.QualityLevel7==am then return 7 elseif Enum. +SavedQualitySetting.QualityLevel8==am then return 8 elseif Enum. +SavedQualitySetting.QualityLevel9==am then return 9 elseif Enum. +SavedQualitySetting.QualityLevel10==am then return 10 end end local am am= +function()settings().Rendering.EnableFRM=true ab=UserSettings().GameSettings. +SavedQualityLevel==Enum.SavedQualitySetting.Automatic if ab then ah()return ae() +else ah()aj()return ag(al(UserSettings().GameSettings.SavedQualityLevel))end end +local an an=function()ak()ai()settings().Rendering.EnableFRM=false end aa. +FocusLost:connect(function()if ab then aa.Text=tostring(_.Value)return end local +ao=tonumber(aa.Text)if ao==nil then aa.Text=tostring(_.Value)return end if ao<1 +then ao=1 elseif ao>=settings().Rendering:GetMaxQualityLevel()then ao=settings() +.Rendering:GetMaxQualityLevel()-1 end _.Value=ao af(_.Value)aa.Text=tostring(_. +Value)end)_.Changed:connect(function(ao)if ab then return end if not ac then +return end aa.Text=tostring(_.Value)return af(_.Value)end)if r or UserSettings() +.GameSettings.SavedQualityLevel==Enum.SavedQualitySetting.Automatic then if r +then settings().Rendering.EnableFRM=false an()else settings().Rendering. +EnableFRM=true ae()end else settings().Rendering.EnableFRM=true ag(al( +UserSettings().GameSettings.SavedQualityLevel))end Y.MouseButton1Click:connect( +function()if r and not game.Players.LocalPlayer then return end if not ab then +return ae()else return ag(_.Value)end end)game.GraphicsQualityChangeRequest: +connect(function(ao)if ab then return end if ao then if(_.Value+1)>l then return +end _.Value=_.Value+1 aa.Text=tostring(_.Value)af(_.Value)return game:GetService +'GuiService':SendNotification('Graphics Quality','Increased to ('..tostring(aa. +Text)..')','',2,function()end)else if(_.Value-1)<=0 then return end _.Value=_. +Value-1 aa.Text=tostring(_.Value)af(_.Value)return game:GetService'GuiService': +SendNotification('Graphics Quality','Decreased to ('..tostring(aa.Text)..')','', +2,function()end)end end)game.Players.PlayerAdded:connect(function(ao)if ao==game +.Players.LocalPlayer and r then return am()end end)game.Players.PlayerRemoving: +connect(function(ao)if ao==game.Players.LocalPlayer and r then return an()end +end)R=A('',Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0,25,0, +25),UDim2.new(0,30,0,176))R.Name='StudioCheckbox'R.ZIndex=L+4 R:SetVerb +'TogglePlayMode'R.Visible=false local ao=(settings().Rendering.QualityLevel~= +Enum.QualityLevel.Automatic)if r and not game.Players.LocalPlayer then R.Text= +'X'an()elseif r then R.Text='X'am()end if k then UserSettings().GameSettings. +StudioModeChanged:connect(function(ap)r=ap if ap then ao=(settings().Rendering. +QualityLevel~=Enum.QualityLevel.Automatic)ae()R.Text='X'Y.ZIndex=1 T.ZIndex=1 +else if ao then ag()end R.Text=''Y.ZIndex=L+4 T.ZIndex=L+4 end end)else R. +MouseButton1Click:connect(function()if not R.Active then return end if R.Text== +''then R.Text='X'else R.Text=''end end)end end local aa=A('',Enum.ButtonStyle. +RobloxButton,Enum.FontSize.Size18,UDim2.new(0,25,0,25),UDim2.new(0,30,0,144))aa. +Name='FullscreenCheckbox'aa.ZIndex=L+4 aa.Parent=N aa:SetVerb'ToggleFullScreen' +if UserSettings().GameSettings:InFullScreen()then aa.Text='X'end if k then +UserSettings().GameSettings.FullscreenChanged:connect(function(ab)if ab then aa. +Text='X'else aa.Text=''end end)else aa.MouseButton1Click:connect(function()if aa +.Text==''then aa.Text='X'else aa.Text=''end end)end if game:FindFirstChild +'NetworkClient'then F(P)F(Q)F(R)end local ab if k then ab=A('OK',Enum. +ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,180,0,50),UDim2 +.new(0,170,0,330))ab.Modal=true else ab=A('OK',Enum.ButtonStyle. +RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,180,0,50),UDim2.new(0,170,0 +,270))ab.Modal=true end ab.Name='BackButton'ab.ZIndex=L+4 ab.Parent=N +syncVideoCaptureSetting=nil if not s then a('TextLabel','VideoCaptureLabel',{ +Text='After Capturing Video',Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size18, +Position=UDim2.new(0,32,0,100),Size=UDim2.new(0,164,0,18),BackgroundTransparency +=1,TextColor3=v(255,255,255),TextXAlignment=Enum.TextXAlignment.Left,ZIndex=L+4, +Parent=N})local ac,ad={},{}ac[1]='Just Save to Disk'ad[ac[1]]=Enum.UploadSetting +['Never']ac[2]='Upload to YouTube'ad[ac[2]]=Enum.UploadSetting['Ask me first'] +local ae ae,g=RbxGui.CreateDropDownMenu(ac,function(af)UserSettings(). +GameSettings.VideoUploadPromptBehavior=ad[af]end)ae.Name='VideoCaptureField'ae. +ZIndex=L+4 ae.DropDownMenuButton.ZIndex=L+4 ae.DropDownMenuButton.Icon.ZIndex=L+ +4 ae.Position=UDim2.new(0,270,0,94)ae.Size=UDim2.new(0,200,0,32)ae.Parent=N +syncVideoCaptureSetting=function()return g((function()if UserSettings(). +GameSettings.VideoUploadPromptBehavior==Enum.UploadSetting['Never']then return +ac[1]elseif UserSettings().GameSettings.VideoUploadPromptBehavior==Enum. +UploadSetting['Ask me first']then return ac[2]else UserSettings().GameSettings. +VideoUploadPromptBehavior=Enum.UploadSetting['Ask me first']return ac[2]end end +)())end end a('TextLabel','CameraLabel',{Text='Character & Camera Controls',Font +=Enum.Font.Arial,FontSize=Enum.FontSize.Size18,Position=UDim2.new(0,31,0,58), +Size=UDim2.new(0,224,0,18),TextColor3=v(255,255,255),TextXAlignment=Enum. +TextXAlignment.Left,BackgroundTransparency=1,ZIndex=L+4,Parent=N})local ac,ad,ae +,af=game.CoreGui.RobloxGui:FindFirstChild('MouseLockLabel',true),Enum. +ControlMode:GetEnumItems(),{},{}for ag,ah in ipairs(ad)do ae[ag]=ah.Name af[ah. +Name]=ah end local ai ai,f=RbxGui.CreateDropDownMenu(ae,function(aj) +UserSettings().GameSettings.ControlMode=af[aj]return pcall(function()if ac and +UserSettings().GameSettings.ControlMode==Enum.ControlMode['Mouse Lock Switch'] +then ac.Visible=true elseif ac then ac.Visible=false end end)end)ai.Name= +'CameraField'ai.ZIndex=L+4 ai.DropDownMenuButton.ZIndex=L+4 ai. +DropDownMenuButton.Icon.ZIndex=L+4 ai.Position=UDim2.new(0,270,0,52)ai.Size= +UDim2.new(0,200,0,32)ai.Parent=N return N end if LoadLibrary then RbxGui= +LoadLibrary'RbxGui'local aa=0 if UserSettings then local ab ab=function()b(d, +'BottomLeftControl')settingsButton=d.BottomLeftControl:FindFirstChild +'SettingsButton'if settingsButton==nil then settingsButton=a('ImageButton', +'SettingsButton',{Image='rbxasset://textures/ui/SettingsButton.png', +BackgroundTransparency=1,Active=false,Size=UDim2.new(0,54,0,46),Position=UDim2. +new(0,2,0,50),Parent=d.BottomLeftControl})end local ac=a('TextButton', +'UserSettingsShield',{Text='',Active=true,AutoButtonColor=false,Visible=false, +Size=UDim2.new(1,0,1,0),BackgroundColor3=v(51,51,51),BorderColor3=v(27,42,53), +BackgroundTransparency=0.4,ZIndex=aa+2})q=ac local ad=a('Frame','Settings',{ +Position=UDim2.new(0.5,-262,-0.5,-200),Size=UDim2.new(0,525,0,430), +BackgroundTransparency=1,Active=true,Parent=ac})local ae,af=a('Frame', +'SettingsStyle',{Size=UDim2.new(1,0,1,0),Style=Enum.FrameStyle.RobloxRound, +Active=true,ZIndex=aa+3,Parent=ad}),J(aa,ac)af.Parent=ae af.ScreenshotButton. +MouseButton1Click:connect(function()return E(af.ScreenshotButton,ac, +settingsButton)end)af.RecordVideoButton.MouseButton1Click:connect(function()D(af +.RecordVideoButton,d.StopRecordButton)return E(af.RecordVideoButton,ac, +settingsButton)end)if settings():FindFirstChild'Game Options'then pcall(function +()return settings():FindFirstChild'Game Options'.VideoRecordingChangeRequest: +connect(function(ag)m=ag return C(ag,d.StopRecordButton,af.RecordVideoButton)end +)end)end game.CoreGui.RobloxGui.Changed:connect(function(ag)if ag== +'AbsoluteSize'and m then return D(af.RecordVideoButton,d.StopRecordButton)end +end)local ag ag=function()af.ResetButton.Visible=game.Players.LocalPlayer if +game.Players.LocalPlayer then settings().Rendering.EnableFRM=true elseif r then +settings().Rendering.EnableFRM=false end end af.ResetButton.Visible=game.Players +.LocalPlayer if(game.Players.LocalPlayer~=nil)then game.Players.LocalPlayer. +Changed:connect(function()return ag()end)else delay(0,function()c(game.Players, +'LocalPlayer')af.ResetButton.Visible=game.Players.LocalPlayer return game. +Players.LocalPlayer.Changed:connect(function()return ag()end)end)end af. +ReportAbuseButton.Visible=game:FindFirstChild'NetworkClient'if not af. +ReportAbuseButton.Visible then game.ChildAdded:connect(function(ah)if ah:IsA +'NetworkClient'then af.ReportAbuseButton.Visible=game:FindFirstChild +'NetworkClient'end end)end af.ResetButton.MouseButton1Click:connect(function() +return y(ae,'ResetConfirmationMenu','up',UDim2.new(0,525,0,370))end)af. +LeaveGameButton.MouseButton1Click:connect(function()return y(ae, +'LeaveConfirmationMenu','down',UDim2.new(0,525,0,300))end)if game.CoreGui. +Version>=4 then game:GetService'GuiService'.EscapeKeyPressed:connect(function() +if n==nil then return game.GuiService:AddCenterDialog(ac,Enum.CenterDialogType. +ModalDialog,function()settingsButton.Active=false f(UserSettings().GameSettings. +ControlMode.Name)if syncVideoCaptureSetting then syncVideoCaptureSetting()end y( +ae,'GameMainMenu','right',UDim2.new(0,525,0,430))ac.Visible=true ac.Active=true +ae.Parent:TweenPosition(UDim2.new(0.5,-262,0.5,-200),Enum.EasingDirection.InOut, +Enum.EasingStyle.Sine,h,true)return ae.Parent:TweenSize(UDim2.new(0,525,0,430), +Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)end,function()ae.Parent: +TweenPosition(UDim2.new(0.5,-262,-0.5,-200),Enum.EasingDirection.InOut,Enum. +EasingStyle.Sine,h,true)ae.Parent:TweenSize(UDim2.new(0,525,0,430),Enum. +EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)ac.Visible=false +settingsButton.Active=true end)elseif#o>0 then if#p>0 then for ah=1,#p do game. +GuiService:RemoveCenterDialog(p[ah])p[ah].Visible=false end p={}end y(o[#o][ +'container'],o[#o]['name'],o[#o]['direction'],o[#o]['lastSize'])table.remove(o,# +o)if#o==1 then o={}end else return x(ac)end end)end local ah=K(aa,ac)ah.Visible= +false ah.Parent=ae af.SettingsButton.MouseButton1Click:connect(function()return +y(ae,'GameSettingsMenu','left',UDim2.new(0,525,0,350))end)ah.BackButton. +MouseButton1Click:connect(function()return y(ae,'GameMainMenu','right',UDim2. +new(0,525,0,430))end)local ai=I(aa,ac)ai.Visible=false ai.Parent=ae local aj=H( +aa,ac)aj.Visible=false aj.Parent=ae w(ac)settingsButton.MouseButton1Click: +connect(function()return game.GuiService:AddCenterDialog(ac,Enum. +CenterDialogType.ModalDialog,function()settingsButton.Active=false f( +UserSettings().GameSettings.ControlMode.Name)if syncVideoCaptureSetting then +syncVideoCaptureSetting()end y(ae,'GameMainMenu','right',UDim2.new(0,525,0,430)) +ac.Visible=true ae.Parent:TweenPosition(UDim2.new(0.5,-262,0.5,-200),Enum. +EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)return ae.Parent:TweenSize( +UDim2.new(0,525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,h,true) +end,function()ae.Parent:TweenPosition(UDim2.new(0.5,-262,-0.5,-200),Enum. +EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)ae.Parent:TweenSize(UDim2. +new(0,525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,h,true)ac. +Visible=false settingsButton.Active=true end)end)return ac end delay(0,function( +)ab().Parent=d d.BottomLeftControl.SettingsButton.Active=true d. +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 local ac=d.BottomLeftControl:FindFirstChild +'Exit'if ac~=nil then ac:Remove()end local ad=d:FindFirstChild'TopLeftControl'if +ad then ac=ad:FindFirstChild'Exit'if ac~=nil then ac:Remove()end return ad: +Remove()end end)end local ab ab=function()local ac,ad,ae,af,ag,ah,ai=a( +'TextButton','SaveDialogShield',{Text='',AutoButtonColor=false,Active=true, +Visible=false,Size=UDim2.new(1,0,1,0),BackgroundColor3=v(51,51,51),BorderColor3= +v(27,42,53),BackgroundTransparency=0.4,ZIndex=aa+1}),nil,nil,nil,nil,nil,{}ai[1] +={}ai[1].Text='Save'ai[1].Style=Enum.ButtonStyle.RobloxButtonDefault ai[1]. +Function=function()return ae()end ai[2]={}ai[2].Text='Cancel'ai[2].Function= +function()return ah()end ai[3]={}ai[3].Text="Don't Save"ai[3].Function=function( +)return ag()end local aj=RbxGui.CreateStyledMessageDialog('Unsaved Changes', +'Save your changes to Mercury before leaving?','Confirm',ai)aj.Visible=true aj. +Parent=ac local ak,al={},1 if game.LocalSaveEnabled then ak[al]={}ak[al].Text= +'Save to Disk'ak[al].Function=function()return af()end al=al+1 end ak[al]={}ak[ +al].Text='Keep Playing'ak[al].Function=function()return ah()end ak[al+1]={}ak[al ++1].Text="Don't Save"ak[al+1].Function=function()return ag()end local am=RbxGui. +CreateStyledMessageDialog('Upload Failed', +'Sorry, we could not save your changes to Mercury.','Error',ak)am.Visible=false +am.Parent=ac local an=a('Frame','SpinnerDialog',{Style=Enum.FrameStyle. +RobloxRound,Size=UDim2.new(0,350,0,150),Position=UDim2.new(0.5,-175,0.5,-75), +Visible=false,Active=true,Parent=ac,a('TextLabel','WaitingLabel',{Text= +'Saving to Mercury...',Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18, +Position=UDim2.new(0.5,25,0.5,0),TextColor3=Color3.new(1,1,1)})})local ao,ap,L= +a('Frame','Spinner',{Size=UDim2.new(0,80,0,80),Position=UDim2.new(0.5,-150,0.5,- +40),BackgroundTransparency=1,Parent=an}),{},1 while L<=8 do local M=a( +'ImageLabel','Spinner'..tostring(L),{Size=UDim2.new(0,16,0,16),Position=UDim2. +new(0.5+0.3*math.cos(math.rad(45*L)),-8,0.5+0.3*math.sin(math.rad(45*L)),-8), +BackgroundTransparency=1,Image='http://www.roblox.com/Asset?id=45880710',Parent= +ao})ap[L]=M L=L+1 end ae=function()aj.Visible=false an.Visible=true local M=true +delay(0,function()local N=0 while M do local O=0 while O<8 do if O==N or O==((N+ +1)%8)then ap[O+1].Image='http://www.roblox.com/Asset?id=45880668'else ap[O+1]. +Image='http://www.roblox.com/Asset?id=45880710'end O=O+1 end N=(N+1)%8 wait(0.2) +end end)local N=game:SaveToRoblox()if not N then N=game:SaveToRoblox()end an. +Visible=false M=false if N then game:FinishShutdown(false)return ad()else am. +Visible=true end end af=function()am.Visible=false game:FinishShutdown(true) +return ad()end ag=function()aj.Visible=false am.Visible=false game: +FinishShutdown(false)return ad()end ah=function()aj.Visible=false am.Visible= +false return ad()end ad=function()aj.Visible=true am.Visible=false an.Visible= +false ac.Visible=false return game.GuiService:RemoveCenterDialog(ac)end w(ac)ac. +Visible=false return ac end local ac ac=function()b(game,'NetworkClient')b(game, +'Players')c(game.Players,'LocalPlayer')local ad,ae=game.Players.LocalPlayer,nil +b(d,'UserSettingsShield')b(d.UserSettingsShield,'Settings')b(d. +UserSettingsShield.Settings,'SettingsStyle')b(d.UserSettingsShield.Settings. +SettingsStyle,'GameMainMenu')b(d.UserSettingsShield.Settings.SettingsStyle. +GameMainMenu,'ReportAbuseButton')ae=d.UserSettingsShield.Settings.SettingsStyle. +GameMainMenu.ReportAbuseButton local af,ag,ah=a('TextButton','ReportAbuseShield' +,{Text='',AutoButtonColor=false,Active=true,Visible=false,Size=UDim2.new(1,0,1,0 +),BackgroundColor3=v(51,51,51),BorderColor3=v(27,42,53),BackgroundTransparency= +0.4,ZIndex=aa+1}),nil,{}ah[1]={}ah[1].Text='Ok'ah[1].Modal=true ah[1].Function= +function()return ag()end local ai=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. + +If anyone used swear words, inappropriate language, or threatened you in real life, please report them for Bad Words or Threats]] +,ah)ai.Visible=false ai.Parent=af local aj=RbxGui.CreateMessageDialog( +'Thanks for your report!',"We've recorded your report for evaluation.",ah)aj. +Visible=false aj.Parent=af local ak=RbxGui.CreateMessageDialog( +'Thanks for your report!', +[[Our moderators will review the chat logs and determine what happened.]],ah)ak. +Visible=false ak.Parent=af local al=a('Frame','Settings',{Position=UDim2.new(0.5 +,-250,0.5,-200),Size=UDim2.new(0,500,0,400),BackgroundTransparency=1,Active=true +,Parent=af})local am,an,ao,ap,L,M=a('Frame','ReportAbuseStyle',{Size=UDim2.new(1 +,0,1,0),Style=Enum.FrameStyle.RobloxRound,Active=true,ZIndex=aa+1,Parent=al,a( +'TextLabel','Title',{Text='Report Abuse',TextColor3=v(221,221,221),Position= +UDim2.new(0.5,0,0,30),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size36, +ZIndex=aa+2}),a('TextLabel','Description',{Text= +[[This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action.]] +,TextColor3=v(221,221,221),Position=UDim2.new(0,0,0,55),Size=UDim2.new(1,0,0,40) +,BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size18, +TextWrap=true,ZIndex=aa+2,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment +=Enum.TextYAlignment.Top}),a('TextLabel','PlayerLabel',{Text='Which player?', +BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size18, +Position=UDim2.new(0.025,0,0,100),Size=UDim2.new(0.4,0,0,36),TextColor3=v(255, +255,255),TextXAlignment=Enum.TextXAlignment.Left,ZIndex=aa+2}),a('TextLabel', +'AbuseLabel',{Text='Type of Abuse:',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=v(255,255,255),TextXAlignment=Enum.TextXAlignment. +Left,ZIndex=aa+2})}),nil,nil,nil,nil,nil M=function()local N,O,P=game:GetService +'Players',{},{}local Q,R=N:GetChildren(),1 if Q then for S,T in ipairs(Q)do if T +:IsA'Player'and T~=ad then O[R]=T.Name P[T.Name]=T R=R+1 end end end local S S,L +=RbxGui.CreateDropDownMenu(O,function(T)an=P[T]if ao and an then ap.Active=true +end end)S.Name='PlayersComboBox'S.ZIndex=aa+2 S.Position=UDim2.new(0.425,0,0,102 +)S.Size=UDim2.new(0.55,0,0,32)return S end local N={'Swearing','Bullying', +'Scamming','Dating','Cheating/Exploiting','Personal Questions','Offsite Links', +'Bad Model or Script','Bad Username'}local O,P=RbxGui.CreateDropDownMenu(N, +function(O)ao=O if ao and an then ap.Active=true end end,true)O.Name= +'AbuseComboBox'O.ZIndex=aa+2 O.Position=UDim2.new(0.425,0,0,142)O.Size=UDim2. +new(0.55,0,0,32)O.Parent=am a('TextLabel','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= +v(255,255,255),TextXAlignment=Enum.TextXAlignment.Left,BackgroundTransparency=1, +ZIndex=aa+2,Parent=am})local Q=a('Frame','ShortDescriptionWrapper',{Position= +UDim2.new(0.025,0,0,220),Size=UDim2.new(0.95,0,1,-310),BackgroundColor3=v(0,0,0) +,BorderSizePixel=0,ZIndex=aa+2,Parent=am})local R=a('TextBox','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=v(255,255,255), +TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top, +TextWrap=true,BackgroundColor3=v(0,0,0),BorderSizePixel=0,ZIndex=aa+2,Parent=Q}) +ap=a('TextButton','SubmitReportBtn',{Active=false,Modal=true,Font=Enum.Font. +Arial,FontSize=Enum.FontSize.Size18,Position=UDim2.new(0.1,0,1,-80),Size=UDim2. +new(0.35,0,0,50),AutoButtonColor=true,Style=Enum.ButtonStyle.RobloxButtonDefault +,Text='Submit Report',TextColor3=v(255,255,255),ZIndex=aa+2,Parent=am})ap. +MouseButton1Click:connect(function()if ap.Active then if ao and an then al. +Visible=false game.Players:ReportAbuse(an,ao,R.Text)if ao=='Cheating/Exploiting' +then aj.Visible=true elseif ao=='Bullying'or ao=='Swearing'then ai.Visible=true +else ak.Visible=true end else return ag()end end end)local S=a('TextButton', +'CancelBtn',{Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size18,Position=UDim2. +new(0.55,0,1,-80),Size=UDim2.new(0.35,0,0,50),AutoButtonColor=true,Style=Enum. +ButtonStyle.RobloxButtonDefault,Text='Cancel',TextColor3=v(255,255,255),ZIndex= +aa+2,Parent=am})ag=function()local T=am:FindFirstChild'PlayersComboBox'if T then +T.Parent=nil end an=nil L(nil)ao=nil P(nil)ap.Active=false R.Text=''al.Visible= +true ai.Visible=false aj.Visible=false ak.Visible=false af.Visible=false ae. +Active=true return game.GuiService:RemoveCenterDialog(af)end S.MouseButton1Click +:connect(ag)ae.MouseButton1Click:connect(function()M().Parent=am table.insert(p, +af)return game.GuiService:AddCenterDialog(af,Enum.CenterDialogType.ModalDialog, +function()ae.Active=false af.Visible=true q.Visible=false end,function()ae. +Active=true af.Visible=false end)end)w(af)return af end local ad=pcall(function( +)end)if ad then delay(0,function()local ae=ab()ae.Parent=d game.RequestShutdown= +function()table.insert(p,ae)game.GuiService:AddCenterDialog(ae,Enum. +CenterDialogType.QuitDialog,function()ae.Visible=true end,function()ae.Visible= +false end)return true end end)end delay(0,function()ac().Parent=d b(d, +'UserSettingsShield')b(d.UserSettingsShield,'Settings')b(d.UserSettingsShield. +Settings,'SettingsStyle')b(d.UserSettingsShield.Settings.SettingsStyle, +'GameMainMenu')b(d.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, +'ReportAbuseButton')d.UserSettingsShield.Settings.SettingsStyle.GameMainMenu. +ReportAbuseButton.Active=true end)pcall(function()return game.GuiService. +UseLuaChat end)local ae=41324860 return delay(0,function()b(game,'NetworkClient' +)b(game,'Players')c(game.Players,'LocalPlayer')c(game.Players.LocalPlayer, +'Character')b(game.Players.LocalPlayer.Character,'Humanoid')c(game,'PlaceId')if +game.PlaceId==ae then game.Players.LocalPlayer.Character.Humanoid: +SetClickToWalkEnabled(false)return game.Players.LocalPlayer.CharacterAdded: +connect(function(af)b(af,'Humanoid')return af.Humanoid:SetClickToWalkEnabled( +false)end)end end)end \ No newline at end of file diff --git a/processed/48488235.lua b/processed/48488235.lua index 05ba64f..1beb974 100644 --- a/processed/48488235.lua +++ b/processed/48488235.lua @@ -1,2305 +1,605 @@ -print("[Mercury]: Loaded corescript 48488235") -local ADMINS = { - taskmanager = 1, - Heliodex = 1, - multako = "http://www.roblox.com/asset/?id=6923328292", - mercury = 1, - 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" -} -local BASE_TWEEN = 0.25 -local MOUSE_DRAG_DISTANCE = 15 -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local MakeBackgroundGuiObj -MakeBackgroundGuiObj = function(imgName) - return New("ImageLabel", "Background", { - BackgroundTransparency = 1, - Image = imgName, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, 1, 0) - }) -end -local Color3I -Color3I = function(r, g, b) - return Color3.new(r / 255, g / 255, b / 255) -end -local getMembershipTypeIcon -getMembershipTypeIcon = function(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 - return ADMINS[string.lower(playerName)] - end - elseif membershipType == Enum.MembershipType.None then - return "" - elseif membershipType == Enum.MembershipType.BuildersClub then - return "rbxasset://textures/ui/TinyBcIcon.png" - elseif membershipType == Enum.MembershipType.TurboBuildersClub then - return "rbxasset://textures/ui/TinyTbcIcon.png" - elseif membershipType == Enum.MembershipType.OutrageousBuildersClub then - return "rbxasset://textures/ui/TinyObcIcon.png" - else - return error("Unknown membershipType " .. tostring(membershipType)) - end -end -local getFriendStatusIcon -getFriendStatusIcon = function(friendStatus) - if friendStatus == Enum.FriendStatus.Unknown or friendStatus == Enum.FriendStatus.NotFriend then - return "" - elseif friendStatus == Enum.FriendStatus.Friend then - return "http://www.roblox.com/asset/?id=99749771" - elseif friendStatus == Enum.FriendStatus.FriendRequestSent then - return "http://www.roblox.com/asset/?id=99776888" - elseif friendStatus == Enum.FriendStatus.FriendRequestReceived then - return "http://www.roblox.com/asset/?id=99776838" - else - return error("Unknown FriendStatus: " .. tostring(friendStatus)) - end -end -local MakePopupButton -MakePopupButton = function(nparent, ntext, index, last) - local tobj = New("ImageButton", "ReportButton", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 1 * index, 0), - Size = UDim2.new(1, 0, 1, 0), - ZIndex = 7, - Parent = nparent, - New("TextLabel", "ButtonText", { - BackgroundTransparency = 1, - Position = UDim2.new(0.07, 0, 0.07, 0), - Size = UDim2.new(0.86, 0, 0.86, 0), - Font = "ArialBold", - Text = ntext, - FontSize = "Size14", - TextScaled = true, - TextColor3 = Color3.new(1, 1, 1), - TextStrokeTransparency = 1, - ZIndex = 7 - }) - }) - tobj.Image = "http://www.roblox.com/asset/?id=" .. (function() - if index == 0 then - return "97108784" - elseif last then - if index % 2 == 1 then - return Images["LightPopupBottom"] - else - return Images["DarkPopupBottom"] - end - else - if index % 2 == 1 then - return "97112126" - else - return "97109338" - end - end - end)() - return tobj -end -local debugOutput -local DebugPrintEnabled = true -local debugprint -debugprint = function(str) - if DebugPrintEnabled then - debugOutput.Text = str - end -end -local WaitForChild -WaitForChild = function(parent, child) - while not parent:FindFirstChild(child) do - wait() - debugprint(" child " .. tostring(parent.Name) .. " waiting for " .. tostring(child)) - end - return parent[child] -end -local Players = game:GetService("Players") -while not Players.LocalPlayer do - Players.Changed:wait() -end -local LocalPlayer = Players.LocalPlayer -local Mouse = LocalPlayer:GetMouse() -local ScreenGui = New("Frame", "PlayerListScreen", { - Size = UDim2.new(1, 0, 1, 0), - BackgroundTransparency = 1, - Parent = script.Parent -}) -local MainFrame = New("Frame", "LeaderBoardFrame", { - Position = UDim2.new(1, -150, 0.005, 0), - Size = UDim2.new(0, 150, 0, 800), - BackgroundTransparency = 1, - Parent = ScreenGui -}) -local FocusFrame = New("Frame", "FocusFrame", { - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, 0, 100), - BackgroundTransparency = 1, - Active = true, - Parent = MainFrame -}) -local HeaderFrame = New("Frame", "Header", { - BackgroundTransparency = 1, - 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") -}) -local HeaderFrameHeight = HeaderFrame.Size.Y.Scale -local MaximizeButton = New("ImageButton", "MaximizeButton", { - Active = true, - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, 1, 0), - Parent = HeaderFrame -}) -local HeaderName = New("TextLabel", "PlayerName", { - BackgroundTransparency = 1, - 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", - TextColor3 = Color3.new(1, 1, 1), - TextStrokeColor3 = Color3.new(0, 0, 0), - TextStrokeTransparency = 0, - TextXAlignment = "Right", - TextYAlignment = "Center" -}) -local HeaderScore = New("TextLabel", "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", - TextColor3 = Color3.new(1, 1, 1), - TextStrokeTransparency = 1, - TextXAlignment = "Right" -}) -local BottomShiftFrame = New("Frame", "BottomShiftFrame", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, HeaderFrameHeight, 0), - Size = UDim2.new(1, 0, 1, 0), - Parent = MainFrame -}) -local BottomFrame = New("Frame", "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 = New("ImageButton", "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 = New("ImageButton", "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 = New("Frame", "ListFrame", { - BackgroundTransparency = 1, - Position = UDim2.new(-1, 0, 0.07, 0), - Size = UDim2.new(2, 0, 1, 0), - Parent = MainFrame, - ClipsDescendants = true -}) -local BottomClipFrame = New("Frame", "BottomFrame", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, -0.8, 0), - Size = UDim2.new(1, 0, 1, 0), - Parent = TopClipFrame, - ClipsDescendants = true -}) -local ScrollBarFrame = New("Frame", "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 = New("Frame", "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 = New("Frame", "SubFrame", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0.8, 0), - Size = UDim2.new(1, 0, 1, 0), - Parent = BottomClipFrame -}) -local PopUpClipFrame = New("Frame", "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 -}) -local PopUpPanel = nil -local PopUpPanelTemplate = New("Frame", "Panel", { - BackgroundTransparency = 1, - Position = UDim2.new(1, 0, 0, 0), - Size = UDim2.new(1, 0, 0.032, 0), - Parent = PopUpClipFrame -}) -local StatTitles = New("Frame", "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 MiddleTemplate = New("Frame", { - Name = "MidTemplate", - BackgroundTransparency = 1, - Position = UDim2.new(100, 0, 0.07, 0), - Size = UDim2.new(0.5, 0, 0.025, 0), - New("ImageLabel", { - Name = "BCLabel", - Active = true, - BackgroundTransparency = 1, - Position = UDim2.new(0.005, 5, 0.20, 0), - Size = UDim2.new(0, 16, 0, 16), - SizeConstraint = "RelativeYY", - Image = "", - ZIndex = 3 - }), - New("ImageLabel", { - Name = "FriendLabel", - Active = true, - BackgroundTransparency = 1, - Position = UDim2.new(0.005, 5, 0.15, 0), - Size = UDim2.new(0, 16, 0, 16), - SizeConstraint = "RelativeYY", - Image = "", - ZIndex = 3 - }), - New("ImageButton", "ClickListener", { - Active = true, - BackgroundTransparency = 1, - Position = UDim2.new(0.005, 1, 0, 0), - Size = UDim2.new(0.96, 0, 1, 0), - ZIndex = 3 - }), - New("Frame", "TitleFrame", { - BackgroundTransparency = 1, - Position = UDim2.new(0.01, 0, 0, 0), - Size = UDim2.new(0, 140, 1, 0), - ClipsDescendants = true, - New("TextLabel", "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", - ZIndex = 3 - }) - }), - New("TextLabel", "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", - ZIndex = 3 - }), - ZIndex = 3 -}) -local MiddleBGTemplate = New("Frame", "MidBGTemplate", { - BackgroundTransparency = 1, - Position = UDim2.new(100, 0, 0.07, 0), - Size = UDim2.new(0.5, 0, 0.025, 0), - MakeBackgroundGuiObj("http://www.roblox.com/asset/?id=94692025") -}) -local ReportAbuseShield = New("TextButton", "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), - BackgroundTransparency = 1 -}) -local ReportAbuseFrame = New("Frame", "Settings", { - Position = UDim2.new(0.5, -250, 0.5, -200), - Size = UDim2.new(0, 500, 0, 400), - BackgroundTransparency = 1, - Active = true, - Parent = ReportAbuseShield -}) -local AbuseSettingsFrame -AbuseSettingsFrame = New("Frame", "ReportAbuseStyle", { - Size = UDim2.new(1, 0, 1, 0), - Active = true, - BackgroundTransparency = 1, - Parent = ReportAbuseFrame, - MakeBackgroundGuiObj("http://www.roblox.com/asset/?id=96488767"), - New("TextLabel", "Title", { - Text = "Report Abuse", - TextColor3 = Color3I(221, 221, 221), - Position = UDim2.new(0.5, 0, 0, 30), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size36 - }), - New("TextLabel", "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(0.01, 0, 0, 55), - Size = UDim2.new(0.99, 0, 0, 40), - BackgroundTransparency = 1, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size18, - TextWrap = true, - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top - }), - New("TextLabel", "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), - TextXAlignment = Enum.TextXAlignment.Left - }), - New("TextLabel", "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), - TextXAlignment = Enum.TextXAlignment.Left, - BackgroundTransparency = 1 - }), - New("TextLabel", "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), - TextXAlignment = Enum.TextXAlignment.Left, - Parent = AbuseSettingsFrame - }) -}) -local AbusePlayerLabel = New("TextLabel", "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), - TextXAlignment = Enum.TextXAlignment.Right, - Parent = AbuseSettingsFrame -}) -local SubmitReportButton = New("ImageButton", "SubmitReportBtn", { - Active = false, - BackgroundTransparency = 1, - 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", - Parent = AbuseSettingsFrame -}) -local CancelReportButton = New("ImageButton", "CancelBtn", { - BackgroundTransparency = 1, - 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", - Parent = AbuseSettingsFrame -}) -local AbuseDescriptionWrapper = New("Frame", "AbuseDescriptionWrapper", { - 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 OriginalAbuseDescriptionBox = New("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), - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Top, - TextWrap = true, - BackgroundColor3 = Color3I(0, 0, 0), - BorderSizePixel = 0 -}) -local CalmingAbuseBox = New("Frame", "AbuseFeedbackBox", { - BackgroundTransparency = 1, - Position = UDim2.new(0.25, 0, 0.3, 0), - Size = UDim2.new(0.5, 0, 0.37, 0), - MakeBackgroundGuiObj("http://www.roblox.com/asset/?id=96506233"), - New("TextLabel", "Header", { - Position = UDim2.new(0, 10, 0.05, 0), - Size = UDim2.new(1, -30, 0.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" - }), - New("TextLabel", "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), - 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" - }), - New("ImageButton", "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 = New("Frame", "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"), - New("TextLabel", "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" - }), - New("TextLabel", "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" - }), - New("ImageButton", "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 BigButton = New("ImageButton", { - Size = UDim2.new(1, 0, 1, 0), - BackgroundTransparency = 1, - ZIndex = 8, - Visible = false, - Parent = ScreenGui -}) -local debugFrame = New("Frame", "debugframe", { - BackgroundTransparency = 1, - Position = UDim2.new(0.25, 0, 0.3, 0), - Size = UDim2.new(0.5, 0, 0.37, 0), - MakeBackgroundGuiObj("http://www.roblox.com/asset/?id=96506233") -}) -local debugplayers = New("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" -}) -debugOutput = New("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" -}) -local RbxGui = assert(LoadLibrary("RbxGui")) -local DefaultEntriesOnScreen = 8 -for _, i in pairs(Images) do - Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=" .. tostring(i)) -end -local ScoreNames = { } -local AddId = 0 -local PlayerFrames = { } -local TeamFrames = { } -local NeutralTeam -local MiddleFrames = { } -local MiddleFrameBackgrounds = { } -local LastClick = 0 -local ButtonCooldown = 0.25 -local OnIos = false -pcall(function() - OnIos = Game:GetService("UserInputService").TouchEnabled -end) -local BaseScreenXSize = 150 -local SpacingPerStat = 10 -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) -local RightEdgeSpace = -0.04 -local DefaultBottomClipPos = BottomClipFrame.Position.Y.Scale -local SelectedPlayerEntry -local SelectedPlayer -local AddingFrameLock = false -local AddingStatLock = false -local BaseUpdateLock = false -local WaitForClickLock = false -local InPopupWaitForClick = false -local PlayerChangedLock = false -local NeutralTeamLock = false -local ScrollWheelConnections = { } -local DefaultListSize = 8 -if not OnIos then - DefaultListSize = 12 -end -local DidMinimizeDrag = false -local AbuseName -local Abuses = { - "Bad Words or Threats", - "Bad Username", - "Talking about Dating", - "Account Trading or Sharing", - "Asking Personal Questions", - "Rude or Mean Behavior", - "False Reporting Me" -} -local UpdateAbuseFunction -local AbuseDropDown -local PrivilegeLevel = { - Owner = 255, - Admin = 240, - Member = 128, - Visitor = 10, - Banned = 0 -} -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 - end -end) -local AreAllEntriesOnScreen -AreAllEntriesOnScreen = function() - return #MiddleFrameBackgrounds * MiddleTemplate.Size.Y.Scale <= 1 + DefaultBottomClipPos -end -local GetMaxScroll -GetMaxScroll = function() - return DefaultBottomClipPos * -1 -end -local GetMinScroll -GetMinScroll = function() - if AreAllEntriesOnScreen() then - return GetMaxScroll() - else - return (GetMaxScroll() - (#MiddleFrameBackgrounds * MiddleTemplate.Size.Y.Scale)) + (1 + DefaultBottomClipPos) - end -end -local AbsoluteToPercent -AbsoluteToPercent = function(x, y) - return Vector2.new(x, y) / ScreenGui.AbsoluteSize -end -local TweenProperty -TweenProperty = function(obj, propName, inita, enda, length) - local startTime = tick() - while tick() - startTime < length do - obj[propName] = ((enda - inita) * ((tick() - startTime) / length)) + inita - wait(1 / 30) - end - obj[propName] = enda -end -local WaitForClick -WaitForClick = function(frameParent, polledFunction, exitFunction) - if WaitForClickLock then - return - end - WaitForClickLock = true - local connection, connection2 - connection = BigButton.MouseButton1Up:connect(function(nx, ny) - exitFunction(nx, ny) - BigButton.Visible = false - connection:disconnect() - if connection2 ~= nil then - return connection2:disconnect() - end - return nil - end) - connection2 = BigButton.MouseMoved:connect(function(nx, ny) - return polledFunction(nx, ny) - end) - BigButton.Visible = true - BigButton.Active = true - BigButton.Parent = frameParent - frameParent.AncestryChanged:connect(function(child, nparent) - if child == frameParent and not (nparent ~= nil) then - exitFunction(nx, ny) - BigButton.Visible = false - connection:disconnect() - connection2:disconnect() - return debugprint("forced out of wait for click") - end - end) - WaitForClickLock = false -end -local SetPrivilegeRank -SetPrivilegeRank = function(player, nrank) - while player.PersonalServerRank < nrank do - game:GetService("PersonalServerService"):Promote(player) - end - while player.PersonalServerRank > nrank do - game:GetService("PersonalServerService"):Demote(player) - end -end -local assetid = "http://www.roblox.com/asset/?id=" -local HighlightMyRank -HighlightMyRank = function(player, BanPlayerButton, VisitorButton, MemberButton, AdminButton) - BanPlayerButton.Image = assetid .. Images["LightPopupMid"] - VisitorButton.Image = assetid .. Images["DarkPopupMid"] - MemberButton.Image = assetid .. Images["LightPopupMid"] - AdminButton.Image = assetid .. Images["DarkPopupBottom"] - local rank = player.PersonalServerRank - if rank <= PrivilegeLevel["Banned"] then - BanPlayerButton.Image = assetid .. Images["LightBluePopupMid"] - elseif rank <= PrivilegeLevel["Visitor"] then - VisitorButton.Image = assetid .. Images["DarkBluePopupMid"] - elseif rank <= PrivilegeLevel["Member"] then - MemberButton.Image = assetid .. Images["LightBluePopupMid"] - elseif rank <= PrivilegeLevel["Admin"] then - AdminButton.Image = assetid .. Images["DarkBluePopupBottom"] - end -end -local OnPrivilegeLevelSelect -OnPrivilegeLevelSelect = function(player, nlevel, BanPlayerButton, VisitorButton, MemberButton, AdminButton) - debugprint("setting privilege level") - SetPrivilegeRank(player, nlevel) - return HighlightMyRank(player, BanPlayerButton, VisitorButton, MemberButton, AdminButton) -end -local CloseAbuseDialog -CloseAbuseDialog = function() - AbuseName = nil - SubmitReportButton.Active = false - SubmitReportButton.Image = "http://www.roblox.com/asset/?id=96502438" - AbuseDescriptionBox:Destroy() - CalmingAbuseBox.Parent = nil - NormalAbuseBox.Parent = nil - ReportAbuseShield.Parent = nil - AbuseSettingsFrame.Visible = true -end -local OnSubmitAbuse -OnSubmitAbuse = function() - if SubmitReportButton.Active then - if AbuseName and SelectedPlayer then - AbuseSettingsFrame.Visible = false - game.Players:ReportAbuse(SelectedPlayer, AbuseName, AbuseDescriptionBox.Text) - if AbuseName == "Rude or Mean Behavior" or AbuseName == "False Reporting Me" then - CalmingAbuseBox.Parent = ReportAbuseShield - else - debugprint("opening abuse box") - NormalAbuseBox.Parent = ReportAbuseShield - end - else - return CloseAbuseDialog() - end - end -end -local ClosePopUpPanel -ClosePopUpPanel = function() - if SelectedPlayerEntry then - local tframe = SelectedPlayerEntry["Frame"] - Spawn(function() - return TweenProperty(tframe, "BackgroundTransparency", 0.5, 1, BASE_TWEEN) - end) - end - PopUpPanel:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Linear", BASE_TWEEN, true) - wait(0.1) - InPopupWaitForClick = false - SelectedPlayerEntry = nil -end -local OpenAbuseDialog -OpenAbuseDialog = function() - debugprint("adding report dialog") - AbusePlayerLabel.Text = SelectedPlayer.Name - PopUpPanel:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Linear", BASE_TWEEN, true) - AbuseDescriptionBox = OriginalAbuseDescriptionBox:Clone() - AbuseDescriptionBox.Parent = AbuseDescriptionWrapper - ReportAbuseShield.Parent = ScreenGui - return ClosePopUpPanel() -end -local InitReportAbuse -InitReportAbuse = function() - UpdateAbuseFunction = function(abuseText) - AbuseName = abuseText - if AbuseName and SelectedPlayer then - SubmitReportButton.Active = true - SubmitReportButton.Image = "http://www.roblox.com/asset/?id=96501119" - end - end - local _ - AbuseDropDown, _ = 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.Parent = AbuseSettingsFrame - CancelReportButton.MouseButton1Click:connect(CloseAbuseDialog) - SubmitReportButton.MouseButton1Click:connect(OnSubmitAbuse) - CalmingAbuseBox:FindFirstChild("OkButton").MouseButton1Down:connect(CloseAbuseDialog) - return NormalAbuseBox:FindFirstChild("OkButton").MouseButton1Down:connect(CloseAbuseDialog) -end -local GetFriendStatus -GetFriendStatus = function(player) - if player == game.Players.LocalPlayer then - return Enum.FriendStatus.NotFriend - else - local success, result = pcall(function() - return game.Players.LocalPlayer:GetFriendStatus(player) - end) - if success then - return result - else - return Enum.FriendStatus.NotFriend - end - end -end -local OnFriendButtonSelect -OnFriendButtonSelect = function() - local friendStatus = GetFriendStatus(SelectedPlayer) - if friendStatus == Enum.FriendStatus.Friend then - LocalPlayer:RevokeFriendship(SelectedPlayer) - 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 - return ClosePopUpPanel() -end -local OnFriendRefuseButtonSelect -OnFriendRefuseButtonSelect = function() - LocalPlayer:RevokeFriendship(SelectedPlayer) - ClosePopUpPanel() - return PopUpPanel:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Linear", BASE_TWEEN, true) -end -local PlayerSortFunction -PlayerSortFunction = function(a, b) - 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"] -end -local UpdateMinimize -local Tabify -Tabify = function() - IsTabified.Value = true - IsMaximized.Value = false - IsMinimized.Value = true - UpdateMinimize() - IsTabified.Value = true - return ScreenGui:TweenPosition(UDim2.new(NormalBounds.X.Scale, NormalBounds.X.Offset - 10, 0, 0), "Out", "Linear", BASE_TWEEN * 1.2, true) -end -local UnTabify -UnTabify = function() - if IsTabified.Value then - IsTabified.Value = false - return ScreenGui:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Linear", BASE_TWEEN * 1.2, true) - end -end -local BlowThisPopsicleStand -BlowThisPopsicleStand = function() - return Tabify() -end -local StatSort -StatSort = function(a, b) - if a.IsPrimary ~= b.IsPrimary then - return a.IsPrimary - end - if a.Priority == b.Priority then - return a.AddId < b.AddId - end - return a.Priority < b.Priority -end -local BaseUpdate -local StatChanged -StatChanged = function(_, _) - return BaseUpdate() -end -local CreateStatTitle -CreateStatTitle = function(statName) - local _with_0 = MiddleTemplate:FindFirstChild("PlayerScore"):Clone() - _with_0.Name = statName - _with_0.Text = statName - if IsMaximized.Value then - _with_0.TextTransparency = 0 - else - _with_0.TextTransparency = 1 - end - _with_0.Parent = StatTitles - return _with_0 -end -local UpdateMaximize -local StatAdded -StatAdded = function(nchild, playerEntry) - 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 - BlowThisPopsicleStand() - else - local haveScore = false - 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 - end - 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"]) - end - UpdateMaximize() - end - end - AddingStatLock = false - StatChanged(playerEntry) - return nchild.Changed:connect(function(property) - return StatChanged(playerEntry, property) - end) -end -local DoesStatExist -DoesStatExist = function(statName, exception) - for _, playerf in pairs(PlayerFrames) do - if playerf["Player"] ~= exception and playerf["Player"]:FindFirstChild("leaderstats" and playerf["Player"].leaderstats:FindFirstChild(statName)) then - return true - end - end - return false -end -local StatRemoved -StatRemoved = function(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 - 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() - end - end - end - end - end - AddingStatLock = false - return StatChanged(playerEntry) -end -local RemoveAllStats -RemoveAllStats = function(playerEntry) - for _, val in ipairs(ScoreNames) do - StatRemoved(val, playerEntry) - end -end -local GetScoreValue -GetScoreValue = function(score) - 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 - else - return score.Value - end -end -local MakeScoreEntry -MakeScoreEntry = function(entry, scoreval, panel) - if not panel:FindFirstChild("PlayerScore") then - return - end - local nscoretxt = panel:FindFirstChild("PlayerScore"):Clone() - local thisScore - wait() - 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"] - 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 - 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 - end - nscoretxt.Text = tostring(GetScoreValue(thisScore)) - return BaseUpdate() - end) - return nscoretxt -end -local FONT_SIZES = { - "Size8", - "Size9", - "Size10", - "Size11", - "Size12", - "Size14", - "Size24", - "Size36", - "Size48" -} -local UpdateHeaderNameSize -UpdateHeaderNameSize = function() - local tHeader = HeaderName:Clone() - tHeader.Position = UDim2.new(2, 0, 2, 0) - tHeader.Parent = ScreenGui - local fSize = 7 - tHeader.FontSize = FONT_SIZES[fSize] - return Delay(0.2, function() - while tHeader.TextBounds.x == 0 do - wait(1 / 30) - end - 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 - return tHeader:Destroy() - end) -end -local RecreateScoreColumns -RecreateScoreColumns = function(ptable) - while AddingStatLock do - debugprint("In Adding Stat Lock2") - wait(1 / 30) - end - AddingStatLock = true - local Xoffset = 5 - local maxXOffset = Xoffset - local MaxSizeColumn = 0 - for j = #ScoreNames, 1, -1 do - local scoreval = ScoreNames[j] - MaxSizeColumn = 0 - for _, entry in ipairs(ptable) do - local panel = entry["Frame"] - if not panel:FindFirstChild(scoreval["Name"]) then - local nentry = MakeScoreEntry(entry, scoreval, panel) - if nentry then - debugprint("adding " .. tostring(nentry.Name) .. " to " .. tostring(entry["Player"].Name)) - nentry.Parent = panel - if entry["MyTeam"] and entry["MyTeam"] ~= NeutralTeam and not entry["MyTeam"]["Frame"]:FindFirstChild(scoreval["Name"]) then - local ntitle = nentry:Clone() - ntitle.Parent = entry["MyTeam"]["Frame"] - end - end - end - scoreval["XOffset"] = Xoffset - 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) - else - 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) - end - 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 -local ExpandNames -ExpandNames = function() - if #ScoreNames ~= 0 then - for _, i in pairs(StatTitles:GetChildren()) do - Spawn(function() - return TweenProperty(i, "TextTransparency", i.TextTransparency, 0, BASE_TWEEN) - end) - end - HeaderFrameHeight = 0.09 - 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) - return BottomShiftFrame:TweenPosition(UDim2.new(0, 0, HeaderFrameHeight, 0), "Out", "Linear", BASE_TWEEN * 1.2, true) - end -end -local CloseNames -CloseNames = function() - if #ScoreNames ~= 0 then - HeaderFrameHeight = 0.07 - if not IsMaximized.Value then - for _, i in pairs(StatTitles:GetChildren()) do - Spawn(function() - return 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) - return TopClipFrame:TweenPosition(UDim2.new(TopClipFrame.Position.X.Scale, 0, HeaderFrameHeight, 0), "Out", "Linear", BASE_TWEEN * 1.2, true) - end -end -local UpdateStatNames -UpdateStatNames = function() - if not AreNamesExpanded.Value or IsMinimized.Value then - return CloseNames() - else - return ExpandNames() - end -end -local ToggleMinimize -ToggleMinimize = function() - IsMinimized.Value = not IsMinimized.Value - return UpdateStatNames() -end -local ToggleMaximize -ToggleMaximize = function() - IsMaximized.Value = not IsMaximized.Value - return RecreateScoreColumns(PlayerFrames) -end -local UpdateScrollPosition -UpdateScrollPosition = function() - 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 adjustedLength = 1 - ScrollBar.Size.Y.Scale - ScrollBar.Position = UDim2.new(0, 0, adjustedLength - (adjustedLength * ((ListFrame.Position.Y.Scale - minPos) / scrollLength)), 0) -end -UpdateMinimize = function() - 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(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 - 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) - end - 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" - end -end -UpdateMaximize = function() - if IsMaximized.Value then - for j = 1, #ScoreNames, 1 do - local scoreval = ScoreNames[j] - 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(-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 - i.Background.Image = "http://www.roblox.com/asset/?id=" .. (function() - if index % 2 ~= 1 then - return Images["LargeDark"] - else - return Images["LargeLight"] - end - end)() - end - 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 - local scoreval = ScoreNames[j] - 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 _, entry in ipairs(PlayerFrames) do - WaitForChild(entry["Frame"], "TitleFrame").Size = UDim2.new(0.38, 0, entry["Frame"].TitleFrame.Size.Y.Scale, 0) - end - for _, entry in ipairs(TeamFrames) do - WaitForChild(entry["Frame"], "TitleFrame").Size = UDim2.new(0.38, 0, entry["Frame"].TitleFrame.Size.Y.Scale, 0) - end - else - if not IsMinimized.Value then - MainFrame:TweenSizeAndPosition(NormalBounds, NormalPosition, "Out", "Linear", BASE_TWEEN * 1.2, true) - end - 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 - i.Background.Image = "http://www.roblox.com/asset/?id=" .. (function() - if index % 2 ~= 1 then - return Images["midDark"] - else - return Images["midLight"] - end - end)() - end - for _, i in ipairs(MiddleFrames) 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 - i[scoreval["Name"]]:TweenPosition(UDim2.new(RightEdgeSpace, -scoreval["XOffset"], 0, 0), "Out", "Linear", BASE_TWEEN, true) - end - end - end - end - for _, 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 _, 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 -local OnScrollWheelMove -OnScrollWheelMove = function(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()) - ListFrame.Position = UDim2.new(StartFrame.X.Scale, StartFrame.X.Offset, newFrameY, StartFrame.Y.Offset) - return UpdateScrollPosition() - end -end -local AttachScrollWheel -AttachScrollWheel = function() - if ScrollWheelConnections then - return - end - ScrollWheelConnections = { } - table.insert(ScrollWheelConnections, Mouse.WheelForward:connect(function() - return OnScrollWheelMove(0.05) - end)) - return table.insert(ScrollWheelConnections, Mouse.WheelBackward:connect(function() - return OnScrollWheelMove(-0.05) - end)) -end -local DetachScrollWheel -DetachScrollWheel = function() - if ScrollWheelConnections then - for _, i in pairs(ScrollWheelConnections) do - i:disconnect() - end - end - ScrollWheelConnections = nil -end -FocusFrame.MouseEnter:connect(function() - if not (IsMinimized.Value or IsTabified.Value) then - return AttachScrollWheel() - end -end) -FocusFrame.MouseLeave:connect(function() - return DetachScrollWheel() -end) -local UpdateScrollBarSize -UpdateScrollBarSize = function() - 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 InitMovingPanel -InitMovingPanel = function(entry, player) - PopUpClipFrame.Parent = ScreenGui - if PopUpPanel ~= nil then - PopUpPanel:Destroy() - end - 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() - return 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 - 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) - BanPlayerButton.MouseButton1Click:connect(function() - return OnPrivilegeLevelSelect(player, PrivilegeLevel["Banned"], BanPlayerButton, VisitorButton, MemberButton, AdminButton) - end) - VisitorButton.MouseButton1Click:connect(function() - return OnPrivilegeLevelSelect(player, PrivilegeLevel["Visitor"], BanPlayerButton, VisitorButton, MemberButton, AdminButton) - end) - MemberButton.MouseButton1Click:connect(function() - return OnPrivilegeLevelSelect(player, PrivilegeLevel["Member"], BanPlayerButton, VisitorButton, MemberButton, AdminButton) - end) - AdminButton.MouseButton1Click:connect(function() - return OnPrivilegeLevelSelect(player, PrivilegeLevel["Admin"], BanPlayerButton, VisitorButton, MemberButton, AdminButton) - end) - HighlightMyRank(SelectedPlayer, BanPlayerButton, VisitorButton, MemberButton, AdminButton) - end - PopUpPanel:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Linear", BASE_TWEEN, true) - Delay(0, function() - local tconnection = Mouse.Button1Down:connect(function() - tconnection:disconnect() - return ClosePopUpPanel() - end) - end) - local myFrame = entry["Frame"] - return Spawn(function() - while InPopupWaitForClick do - PopUpClipFrame.Position = UDim2.new(0, myFrame.AbsolutePosition.X - PopUpClipFrame.Size.X.Offset, 0, myFrame.AbsolutePosition.Y) - wait() - end - end) -end -local UpdateScrollBarVisibility -UpdateScrollBarVisibility = function() - if AreAllEntriesOnScreen() then - ScrollBar.BackgroundTransparency = 1 - else - ScrollBar.BackgroundTransparency = 0 - return UpdateScrollBarSize() - end -end -local ActivatePlayerEntryPanel -ActivatePlayerEntryPanel = function(entry) - entry["Frame"].BackgroundColor3 = Color3.new(0, 1, 1) - Spawn(function() - return TweenProperty(entry["Frame"], "BackgroundTransparency", 1, 0.5, 0.5) - end) - InPopupWaitForClick = true - return InitMovingPanel(entry, entry["Player"]) -end -local StartDrag -StartDrag = function(entry, startx, starty) - local openPanel = true - WaitForChild(entry["Frame"], "ClickListener") - local dragExit - dragExit = function() - if entry["Player"] and SelectedPlayer and openPanel and entry["Player"] ~= LocalPlayer and SelectedPlayer.userId > 1 and LocalPlayer.userId > 1 then - return ActivatePlayerEntryPanel(entry) - end - end - local startY - local StartFrame = ListFrame.Position - local dragpoll - dragpoll = function(nx, ny) - if not startY then - startY = AbsoluteToPercent(nx, ny).Y - end - local nowY = AbsoluteToPercent(nx, ny).Y - debugprint("drag dist: " .. tostring(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) - return UpdateScrollPosition() - end - return WaitForClick(ScreenGui, dragpoll, dragExit) -end -local StartMinimizeDrag -StartMinimizeDrag = function() - return Delay(0, function() - local startTime = tick() - debugprint("Got Click2") - local dragExit - dragExit = function() - if tick() - startTime < 0.25 then - return ToggleMinimize() - else - DidMinimizeDrag = true - if IsMinimized.Value then - return ToggleMinimize() - end - end - end - local startY - local StartFrame = DefaultBottomClipPos - local dragpoll - dragpoll = function(nx, ny) - if not IsMinimized.Value then - if not startY then - startY = AbsoluteToPercent(nx, ny).Y - end - local nowY = AbsoluteToPercent(nx, ny).Y - local 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) - UpdateScrollBarSize() - UpdateScrollPosition() - return UpdateScrollBarVisibility() - end - end - return Spawn(function() - return WaitForClick(ScreenGui, dragpoll, dragExit) - end) - end) -end -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 - LastClick = time() - if IsTabified.Value then - return UnTabify() - else - return StartMinimizeDrag() - end -end) -MaximizeButton.MouseButton1Click:connect(function() - if (time() - LastClick < ButtonCooldown) or InPopupWaitForClick then - return - end - LastClick = time() - if IsTabified.Value then - return UnTabify() - elseif not AreNamesExpanded.Value then - AreNamesExpanded.Value = true - return BaseUpdate() - else - return ToggleMaximize() - end -end) -MaximizeButton.MouseButton2Click:connect(function() - if (time() - LastClick < ButtonCooldown) or InPopupWaitForClick then - return - end - LastClick = time() - if IsTabified.Value then - return UnTabify() - elseif IsMaximized.Value then - return ToggleMaximize() - elseif AreNamesExpanded.Value then - AreNamesExpanded.Value = false - return BaseUpdate() - else - return Tabify() - end -end) -local AddMiddleBGFrame -AddMiddleBGFrame = function() - local nBGFrame = MiddleBGTemplate:Clone() - nBGFrame.Position = UDim2.new(0.5, 0, (#MiddleFrameBackgrounds * nBGFrame.Size.Y.Scale), 0) - nBGFrame.Background.Image = "http://www.roblox.com/asset/?id=" .. (function() - if (#MiddleFrameBackgrounds + 1) % 2 ~= 1 then - if IsMaximized.Value then - return Images["LargeDark"] - else - return Images["midDark"] - end - else - if IsMaximized.Value then - return Images["LargeLight"] - else - return Images["midLight"] - end - end - end)() - nBGFrame.Parent = ListFrame - table.insert(MiddleFrameBackgrounds, nBGFrame) - if #MiddleFrameBackgrounds < DefaultListSize and not DidMinimizeDrag then - DefaultBottomClipPos = -1 + #MiddleFrameBackgrounds * MiddleBGTemplate.Size.Y.Scale - end - if not IsMinimized.Value then - return UpdateMinimize() - end -end -local RemoveMiddleBGFrame -RemoveMiddleBGFrame = function() - MiddleFrameBackgrounds[#MiddleFrameBackgrounds]:Destroy() - table.remove(MiddleFrameBackgrounds, #MiddleFrameBackgrounds) - if not IsMinimized.Value then - return UpdateMinimize() - end -end -local ChangeHeaderName -ChangeHeaderName = function(nname) - HeaderName.Text = nname - return UpdateHeaderNameSize() -end -ScreenGui.Changed:connect(UpdateHeaderNameSize) -local LeaderstatsAdded -LeaderstatsAdded = function(playerEntry) - local nplayer = playerEntry["Player"] - for _, i in pairs(nplayer.leaderstats:GetChildren()) do - StatAdded(i, playerEntry) - end - nplayer.leaderstats.ChildAdded:connect(function(nchild) - return StatAdded(nchild, playerEntry) - end) - return nplayer.leaderstats.ChildRemoved:connect(function(nchild) - return StatRemoved(nchild, playerEntry) - end) -end -local LeaderstatsRemoved -LeaderstatsRemoved = function(_, playerEntry) - while AddingFrameLock do - debugprint("waiting to insert " .. tostring(playerEntry["Player"].Name)) - wait(1 / 30) - end - AddingFrameLock = true - RemoveAllStats(playerEntry) - AddingFrameLock = false -end -local OnPlayerEntrySelect -OnPlayerEntrySelect = function(entry, startx, starty) - if not InPopupWaitForClick then - SelectedPlayerEntry = entry - SelectedPlayer = entry["Player"] - return StartDrag(entry, startx, starty) - end -end -local PlayerListModeUpdate -PlayerListModeUpdate = function() - RecreateScoreColumns(PlayerFrames) - table.sort(PlayerFrames, PlayerSortFunction) - for i, val in ipairs(PlayerFrames) do - MiddleFrames[i] = val["Frame"] - end - for i = #PlayerFrames + 1, #MiddleFrames, 1 do - MiddleFrames[i] = nil - end - return UpdateMinimize() -end -local RemoveNeutralTeam -RemoveNeutralTeam = function() - while NeutralTeamLock do - debugprint("in neutral team lock") - wait() - end - NeutralTeamLock = true - NeutralTeam["Frame"]:Destroy() - NeutralTeam = nil - RemoveMiddleBGFrame() - NeutralTeamLock = false -end -local RemovePlayerFromTeam -RemovePlayerFromTeam = function(teamEntry, index) - table.remove(teamEntry["MyPlayers"], index) - if teamEntry == NeutralTeam and #teamEntry["MyPlayers"] == 0 then - return RemoveNeutralTeam() - end -end -local FindRemovePlayerFromTeam -FindRemovePlayerFromTeam = function(entry) - 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) - return - end - end - end -end -local AddPlayerToTeam -AddPlayerToTeam = function(teamEntry, entry) - FindRemovePlayerFromTeam(entry) - table.insert(teamEntry["MyPlayers"], entry) - entry["MyTeam"] = teamEntry - if teamEntry["IsHidden"] then - teamEntry["Frame"].Parent = ListFrame - AddMiddleBGFrame() - end - teamEntry["IsHidden"] = false -end -local AddNeutralTeam -AddNeutralTeam = function() - 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 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, 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) - return 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 - NeutralTeam = nentry - UpdateMinimize() - BaseUpdate() - end - NeutralTeamLock = false -end -local SetPlayerToTeam -SetPlayerToTeam = function(entry) - FindRemovePlayerFromTeam(entry) - local setToTeam = false - for _, tframe in ipairs(TeamFrames) do - if tframe["MyTeam"].TeamColor == entry["Player"].TeamColor then - AddPlayerToTeam(tframe, entry) - setToTeam = true - end - end - if not setToTeam and #(game.Teams:GetTeams()) > 0 then - debugprint(tostring(entry["Player"].Name) .. " could not find team") - entry["MyTeam"] = nil - if not NeutralTeam then - return AddNeutralTeam() - else - return AddPlayerToTeam(NeutralTeam, entry) - end - end -end -local PlayerChanged -PlayerChanged = function(entry, property) - while PlayerChangedLock do - debugprint("in playerchanged lock") - wait(1 / 30) - end - PlayerChangedLock = true - if property == "Neutral" then - if entry["Player"].Neutral and #game.Teams:GetTeams() > 0 then - debugprint(tostring(entry["Player"].Name) .. " setting to neutral") - FindRemovePlayerFromTeam(entry) - entry["MyTeam"] = nil - if not NeutralTeam then - debugprint(tostring(entry["Player"].Name) .. " creating neutral team") - AddNeutralTeam() - else - debugprint(tostring(entry["Player"].Name) .. " adding to neutral team") - AddPlayerToTeam(NeutralTeam, entry) - end - elseif #(game.Teams:GetTeams()) > 0 then - debugprint(tostring(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(tostring(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(0.01, 30, 0.1, 0) - end - if entry["Player"] == LocalPlayer then - entry["Frame"].TitleFrame.DropShadow.Text = entry["Player"].Name - ChangeHeaderName(entry["Player"].Name) - end - BaseUpdate() - end - PlayerChangedLock = false -end -local InsertPlayerFrame -InsertPlayerFrame = function(nplayer) - while AddingFrameLock do - debugprint("waiting to insert " .. tostring(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 - 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" - ChangeHeaderName(nplayer.Name) - do - local _with_0 = nFrame.TitleFrame.Title:Clone() - _with_0.TextColor3 = Color3.new(0, 0, 0) - _with_0.TextTransparency = 0 - _with_0.ZIndex = 2 - _with_0.Position = nFrame.TitleFrame.Title.Position + UDim2.new(0, 1, 0, 1) - _with_0.Name = "DropShadow" - _with_0.Parent = nFrame.TitleFrame - end - end - nFrame.TitleFrame.Title.Font = "ArialBold" - nFrame.Parent = ListFrame - 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 - AddId = AddId + 1 - table.insert(PlayerFrames, nentry) - if #TeamFrames ~= 0 then - if nplayer.Neutral then - nentry["MyTeam"] = nil - if not NeutralTeam then - AddNeutralTeam() - else - AddPlayerToTeam(NeutralTeam, nentry) - end - else - local addedToTeam = false - for _, 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() - else - AddPlayerToTeam(NeutralTeam, nentry) - end - nentry["MyTeam"] = NeutralTeam - end - end - end - 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 - AddingFrameLock = true - LeaderstatsAdded(nentry) - AddingFrameLock = false - end - end) - nplayer.ChildRemoved:connect(function(nchild) - if nplayer == LocalPlayer and nchild.Name == "leaderstats" then - return LeaderstatsRemoved(nchild, nentry) - end - end) - nplayer.Changed:connect(function(prop) - return PlayerChanged(nentry, prop) - end) - local listener = WaitForChild(nFrame, "ClickListener") - listener.Active = true - listener.MouseButton1Down:connect(function(nx, ny) - return OnPlayerEntrySelect(nentry, nx, ny) - end) - AddMiddleBGFrame() - BaseUpdate() - AddingFrameLock = false -end -local RemovePlayerFrame -RemovePlayerFrame = function(tplayer) - 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 - PopUpClipFrame.Parent = nil - end - 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) - end - end - end - RemoveMiddleBGFrame() - UpdateMinimize() - BaseUpdate() - AddingFrameLock = false -end -Players.ChildRemoved:connect(RemovePlayerFrame) -local UnrollTeams -UnrollTeams = function(tframes, outframes) - local numEntries = 0 - if NeutralTeam and not NeutralTeam["IsHidden"] then - for _, val in ipairs(NeutralTeam["MyPlayers"]) do - numEntries = numEntries + 1 - outframes[numEntries] = val["Frame"] - end - numEntries = numEntries + 1 - outframes[numEntries] = NeutralTeam["Frame"] - end - 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"] - end - numEntries = numEntries + 1 - outframes[numEntries] = val["Frame"] - end - end - for i = numEntries + 1, #outframes, 1 do - outframes[i] = nil - end -end -local TeamSortFunc -TeamSortFunc = function(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"] -end -local AddTeamScores -AddTeamScores = function(team) - for j = 1, #ScoreNames, 1 do - local i = ScoreNames[j] - local tscore = 0 - for _, j in ipairs(team["MyPlayers"]) do - local tval = j["Player"]:FindFirstChild("leaderstats" and j["Player"].leaderstats:FindFirstChild(i["Name"])) - 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 - team["Frame"][i["Name"]].Text = tostring(tscore) - end - end - return UpdateMinimize() -end -local SortTeams -SortTeams = function(tentries) - for _, val in ipairs(tentries) do - table.sort(val["MyPlayers"], PlayerSortFunction) - AddTeamScores(val) - end - return table.sort(tentries, TeamSortFunc) -end -local TeamListModeUpdate -TeamListModeUpdate = function() - RecreateScoreColumns(PlayerFrames) - SortTeams(TeamFrames) - if NeutralTeam then - AddTeamScores(NeutralTeam) - end - return UnrollTeams(TeamFrames, MiddleFrames) -end -local OnFriendshipChanged -OnFriendshipChanged = function(player, friendStatus) - return Delay(0.5, function() - debugprint("friend status changed for: " .. tostring(player.Name) .. " " .. tostring(friendStatus) .. " vs " .. tostring(GetFriendStatus(player))) - for _, entry in ipairs(PlayerFrames) do - 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: " .. tostring(player.Name)) - end - entry["Frame"].FriendLabel.Image = nicon - return - end - end - end) -end -LocalPlayer.FriendStatusChanged:connect(OnFriendshipChanged) -local TeamScoreChanged -TeamScoreChanged = function(entry, nscore) - WaitForChild(entry["Frame"], "PlayerScore").Text = tostring(nscore) - entry["TeamScore"] = nscore -end -local TeamChildAdded -TeamChildAdded = function(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 - return nchild.Changed:connect(function() - return TeamScoreChanged(entry, nchild.Value) - end) - end -end -local TeamChildRemoved -TeamChildRemoved = function(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 -local RemoveTeamFrame -RemoveTeamFrame = function(nteam) - while AddingFrameLock do - debugprint("in removing team frame lock") - wait(1 / 30) - end - AddingFrameLock = true - local myEntry - for i, key in ipairs(TeamFrames) do - if nteam == key["MyTeam"] then - myEntry = key - key["Frame"]:Destroy() - table.remove(TeamFrames, i) - end - end - 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") - end - RemoveMiddleBGFrame() - BaseUpdate() - AddingFrameLock = false -end -local TeamChanged -TeamChanged = function(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"]) - end - end - entry["MyPlayers"] = { } - for _, i in pairs(PlayerFrames) do - SetPlayerToTeam(i) - end - return BaseUpdate() - end -end -local InsertTeamFrame -InsertTeamFrame = function(nteam) - while AddingFrameLock do - debugprint("in adding team frame lock") - wait(1 / 30) - end - AddingFrameLock = true - 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, 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) - return 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 - end - if nteam:FindFirstChild("TeamScore") then - TeamChildAdded(nentry, nteam.TeamScore) - end - nteam.ChildAdded:connect(function(nchild) - return TeamChildAdded(nentry, nchild) - end) - nteam.ChildRemoved:connect(function(nchild) - return TeamChildRemoved(nentry, nchild) - end) - nteam.Changed:connect(function(prop) - return 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 - AddNeutralTeam() - end - AddingFrameLock = false -end -local TeamAdded -TeamAdded = function(nteam) - return InsertTeamFrame(nteam) -end -local TeamRemoved -TeamRemoved = function(nteam) - return RemoveTeamFrame(nteam) -end -BaseUpdate = function() - while BaseUpdateLock do - debugprint("in baseupdate lock") - wait(1 / 30) - end - BaseUpdateLock = true - UpdateStatNames() - if #TeamFrames == 0 and not NeutralTeam then - PlayerListModeUpdate() - else - TeamListModeUpdate() - end - for i, key in ipairs(MiddleFrames) do - if not (key.Parent ~= nil) then - 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 - UpdateScrollPosition() - end - UpdateMinimize() - UpdateScrollBarSize() - UpdateScrollPosition() - UpdateScrollBarVisibility() - BaseUpdateLock = false -end -game.GuiService:AddKey("\t") -local LastTabTime = time() -game.GuiService.KeyPressed:connect(function(key) - if key == "\t" then - debugprint("caught tab key") - local modalCheck, isModal - 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) - IsMaximized.Value = true - else - 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 - end - else - return ToggleMaximize() - end - end - end - end -end) -local debugPlayerAdd -debugPlayerAdd = function(p) - return InsertPlayerFrame(p) -end -local PlayersChildAdded -PlayersChildAdded = function(tplayer) - if tplayer:IsA("Player") then - return Spawn(function() - return debugPlayerAdd(tplayer) - end) - else - return BlowThisPopsicleStand() - end -end -local coreGuiChanged -coreGuiChanged = function(coreGuiType, enabled) - if coreGuiType == Enum.CoreGuiType.All or coreGuiType == Enum.CoreGuiType.PlayerList then - MainFrame.Visible = enabled - end -end -local TeamsChildAdded -TeamsChildAdded = function(nteam) - if nteam:IsA("Team") then - return TeamAdded(nteam) - else - return BlowThisPopsicleStand() - end -end -local TeamsChildRemoved -TeamsChildRemoved = function(nteam) - if nteam:IsA("Team") then - return TeamRemoved(nteam) - else - return BlowThisPopsicleStand() - end -end -pcall(function() - coreGuiChanged(Enum.CoreGuiType.PlayerList, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList)) - return 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() - return debugPlayerAdd(i) - end) -end -game.Teams.ChildAdded:connect(TeamsChildAdded) -game.Teams.ChildRemoved:connect(TeamsChildRemoved) -Players.ChildAdded:connect(PlayersChildAdded) -InitReportAbuse() -AreNamesExpanded.Value = true -BaseUpdate() -wait(2) -IsPersonalServer = not not game.Workspace:FindFirstChild("PSVariable") -if LocalPlayer.Name == "newplayerlistisbad" or LocalPlayer.Name == "imtotallyadmin" then - debugFrame.Parent = ScreenGui - return Spawn(function() - while true do - local str_players - str_players = "" - for _, i in pairs(game.Players:GetPlayers()) do - str_players = str_players .. " " .. tostring(i.Name) - end - debugplayers.Text = str_players - wait(0.5) - end - end) -end +print'[Mercury]: Loaded corescript 48488235'local a,b,c,d,e={taskmanager=1, +Heliodex=1,multako='http://www.roblox.com/asset/?id=6923328292',mercury=1, +pizzaboxer='http://www.roblox.com/asset/?id=6917566633'},{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'},0.25,15,nil e=function(f,g,h)if not(h~= +nil)then h=g g=nil end local i=Instance.new(f)if g then i.Name=g end local j for +k,l in pairs(h)do if type(k)=='string'then if k=='Parent'then j=l else i[k]=l +end elseif type(k)=='number'and type(l)=='userdata'then l.Parent=i end end i. +Parent=j return i end local f f=function(g)return e('ImageLabel','Background',{ +BackgroundTransparency=1,Image=g,Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0, +1,0)})end local g g=function(h,i,j)return Color3.new(h/255,i/255,j/255)end local +h h=function(i,j)if(a[string.lower(j)]~=nil)then if a[string.lower(j)]==1 then +return'http://www.roblox.com/asset/?id=6923330951'else return a[string.lower(j)] +end elseif i==Enum.MembershipType.None then return''elseif i==Enum. +MembershipType.BuildersClub then return'rbxasset://textures/ui/TinyBcIcon.png' +elseif i==Enum.MembershipType.TurboBuildersClub then return +'rbxasset://textures/ui/TinyTbcIcon.png'elseif i==Enum.MembershipType. +OutrageousBuildersClub then return'rbxasset://textures/ui/TinyObcIcon.png'else +return error('Unknown membershipType '..tostring(i))end end local i i=function(j +)if j==Enum.FriendStatus.Unknown or j==Enum.FriendStatus.NotFriend then return'' +elseif j==Enum.FriendStatus.Friend then return +'http://www.roblox.com/asset/?id=99749771'elseif j==Enum.FriendStatus. +FriendRequestSent then return'http://www.roblox.com/asset/?id=99776888'elseif j +==Enum.FriendStatus.FriendRequestReceived then return +'http://www.roblox.com/asset/?id=99776838'else return error( +'Unknown FriendStatus: '..tostring(j))end end local j j=function(k,l,m,n)local o +=e('ImageButton','ReportButton',{BackgroundTransparency=1,Position=UDim2.new(0,0 +,1*m,0),Size=UDim2.new(1,0,1,0),ZIndex=7,Parent=k,e('TextLabel','ButtonText',{ +BackgroundTransparency=1,Position=UDim2.new(0.07,0,0.07,0),Size=UDim2.new(0.86,0 +,0.86,0),Font='ArialBold',Text=l,FontSize='Size14',TextScaled=true,TextColor3= +Color3.new(1,1,1),TextStrokeTransparency=1,ZIndex=7})})o.Image= +'http://www.roblox.com/asset/?id='..(function()if m==0 then return'97108784' +elseif n then if m%2==1 then return b['LightPopupBottom']else return b[ +'DarkPopupBottom']end else if m%2==1 then return'97112126'else return'97109338' +end end end)()return o end local k,l,m=nil,true,nil m=function(n)if l then k. +Text=n end end local n n=function(o,p)while not o:FindFirstChild(p)do wait()m( +' child '..tostring(o.Name)..' waiting for '..tostring(p))end return o[p]end +local o=game:GetService'Players'while not o.LocalPlayer do o.Changed:wait()end +local p=o.LocalPlayer local q,r=p:GetMouse(),e('Frame','PlayerListScreen',{Size= +UDim2.new(1,0,1,0),BackgroundTransparency=1,Parent=script.Parent})local s=e( +'Frame','LeaderBoardFrame',{Position=UDim2.new(1,-150,0.005,0),Size=UDim2.new(0, +150,0,800),BackgroundTransparency=1,Parent=r})local t,u=e('Frame','FocusFrame',{ +Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0,100),BackgroundTransparency=1, +Active=true,Parent=s}),e('Frame','Header',{BackgroundTransparency=1,Position= +UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0.07,0),Parent=s,f +'http://www.roblox.com/asset/?id=94692054'})local v,w,x,y=u.Size.Y.Scale,e( +'ImageButton','MaximizeButton',{Active=true,BackgroundTransparency=1,Position= +UDim2.new(0,0,0,0),Size=UDim2.new(1,0,1,0),Parent=u}),e('TextLabel','PlayerName' +,{BackgroundTransparency=1,Position=UDim2.new(0,0,0.01,0),Size=UDim2.new(0.98,0, +0.38,0),Parent=u,Font='ArialBold',Text=p.Name,FontSize='Size24',TextColor3= +Color3.new(1,1,1),TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=0, +TextXAlignment='Right',TextYAlignment='Center'}),e('TextLabel','PlayerScore',{ +BackgroundTransparency=1,Position=UDim2.new(0,0,0.4,0),Size=UDim2.new(0.98,0,0, +30),Parent=u,Font='ArialBold',Text='',FontSize='Size24',TextYAlignment='Top', +TextColor3=Color3.new(1,1,1),TextStrokeTransparency=1,TextXAlignment='Right'}) +local z=e('Frame','BottomShiftFrame',{BackgroundTransparency=1,Position=UDim2. +new(0,0,v,0),Size=UDim2.new(1,0,1,0),Parent=s})local A=e('Frame','Bottom',{ +BackgroundTransparency=1,Position=UDim2.new(0,0,0.07,0),Size=UDim2.new(1,0,0.03, +0),Parent=z,f'http://www.roblox.com/asset/?id=94754966'})local B,C,D=e( +'ImageButton','bigbutton',{Active=true,BackgroundTransparency=1,Position=UDim2. +new(0,0,0,0),Size=UDim2.new(1,0,1.5,0),ZIndex=3,Parent=A}),e('ImageButton', +'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=A}),e('Frame','ListFrame',{ +BackgroundTransparency=1,Position=UDim2.new(-1,0,0.07,0),Size=UDim2.new(2,0,1,0) +,Parent=s,ClipsDescendants=true})local E=e('Frame','BottomFrame',{ +BackgroundTransparency=1,Position=UDim2.new(0,0,-0.8,0),Size=UDim2.new(1,0,1,0), +Parent=D,ClipsDescendants=true})local F=e('Frame','ScrollBarFrame',{ +BackgroundTransparency=1,Position=UDim2.new(0.987,0,0.8,0),Size=UDim2.new(0.01,0 +,0.2,0),Parent=E})local G,H,I,J=e('Frame','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=F}),e('Frame','SubFrame',{BackgroundTransparency= +1,Position=UDim2.new(0,0,0.8,0),Size=UDim2.new(1,0,1,0),Parent=E}),e('Frame', +'PopUpFrame',{BackgroundTransparency=1,SizeConstraint='RelativeXX',Position=s. +Position+UDim2.new(0,-150,0,0),Size=UDim2.new(0,150,0,800),Parent=s, +ClipsDescendants=true,ZIndex=7}),nil local K,L,M,N,O,P,Q,R,S=e('Frame','Panel',{ +BackgroundTransparency=1,Position=UDim2.new(1,0,0,0),Size=UDim2.new(1,0,0.032,0) +,Parent=I}),e('Frame','StatTitles',{BackgroundTransparency=1,Position=UDim2.new( +0,0,1,-10),Size=UDim2.new(1,0,0,0),Parent=u}),Instance.new'BoolValue',Instance. +new'BoolValue',Instance.new'BoolValue',Instance.new'BoolValue',e('Frame',{Name= +'MidTemplate',BackgroundTransparency=1,Position=UDim2.new(100,0,0.07,0),Size= +UDim2.new(0.5,0,0.025,0),e('ImageLabel',{Name='BCLabel',Active=true, +BackgroundTransparency=1,Position=UDim2.new(0.005,5,0.2,0),Size=UDim2.new(0,16,0 +,16),SizeConstraint='RelativeYY',Image='',ZIndex=3}),e('ImageLabel',{Name= +'FriendLabel',Active=true,BackgroundTransparency=1,Position=UDim2.new(0.005,5, +0.15,0),Size=UDim2.new(0,16,0,16),SizeConstraint='RelativeYY',Image='',ZIndex=3} +),e('ImageButton','ClickListener',{Active=true,BackgroundTransparency=1,Position +=UDim2.new(0.005,1,0,0),Size=UDim2.new(0.96,0,1,0),ZIndex=3}),e('Frame', +'TitleFrame',{BackgroundTransparency=1,Position=UDim2.new(0.01,0,0,0),Size=UDim2 +.new(0,140,1,0),ClipsDescendants=true,e('TextLabel','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',ZIndex=3})}),e('TextLabel','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',ZIndex=3}),ZIndex=3}),e('Frame', +'MidBGTemplate',{BackgroundTransparency=1,Position=UDim2.new(100,0,0.07,0),Size= +UDim2.new(0.5,0,0.025,0),f'http://www.roblox.com/asset/?id=94692025'}),e( +'TextButton','ReportAbuseShield',{Text='',AutoButtonColor=false,Active=true, +Visible=true,Size=UDim2.new(1,0,1,0),BackgroundColor3=g(51,51,51),BorderColor3= +g(27,42,53),BackgroundTransparency=1})local T,U=e('Frame','Settings',{Position= +UDim2.new(0.5,-250,0.5,-200),Size=UDim2.new(0,500,0,400),BackgroundTransparency= +1,Active=true,Parent=S}),nil U=e('Frame','ReportAbuseStyle',{Size=UDim2.new(1,0, +1,0),Active=true,BackgroundTransparency=1,Parent=T,f +'http://www.roblox.com/asset/?id=96488767',e('TextLabel','Title',{Text= +'Report Abuse',TextColor3=g(221,221,221),Position=UDim2.new(0.5,0,0,30),Font= +Enum.Font.ArialBold,FontSize=Enum.FontSize.Size36}),e('TextLabel','Description', +{Text= +[[This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action.]] +,TextColor3=g(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,TextWrap=true,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum +.TextYAlignment.Top}),e('TextLabel','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=g(255,255,255), +TextXAlignment=Enum.TextXAlignment.Left}),e('TextLabel','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=g(255,255,255),TextXAlignment=Enum.TextXAlignment.Left, +BackgroundTransparency=1}),e('TextLabel','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=g(255,255,255),TextXAlignment=Enum.TextXAlignment.Left,Parent=U})}) +local V,W,X,Y,Z,_,aa,ab,ac,ad=e('TextLabel','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=g(255, +255,255),TextXAlignment=Enum.TextXAlignment.Right,Parent=U}),e('ImageButton', +'SubmitReportBtn',{Active=false,BackgroundTransparency=1,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',Parent=U}),e('ImageButton', +'CancelBtn',{BackgroundTransparency=1,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',Parent=U}),e('Frame', +'AbuseDescriptionWrapper',{Position=UDim2.new(0.025,0,0,220),Size=UDim2.new(0.95 +,0,1,-310),BackgroundColor3=g(0,0,0),BorderSizePixel=0,Parent=U}),nil,e( +'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 +=g(255,255,255),TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum. +TextYAlignment.Top,TextWrap=true,BackgroundColor3=g(0,0,0),BorderSizePixel=0}), +e('Frame','AbuseFeedbackBox',{BackgroundTransparency=1,Position=UDim2.new(0.25,0 +,0.3,0),Size=UDim2.new(0.5,0,0.37,0),f'http://www.roblox.com/asset/?id=96506233' +,e('TextLabel','Header',{Position=UDim2.new(0,10,0.05,0),Size=UDim2.new(1,-30, +0.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'}),e('TextLabel','content',{Position=UDim2.new(0,10,0.2,0 +),Size=UDim2.new(1,-30,0.4,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. + +If 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'}),e('ImageButton','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'})}),e('Frame', +'AbuseFeedbackBox',{BackgroundTransparency=1,Position=UDim2.new(0.25,0, +0.300000012,0),Size=UDim2.new(0.5,0,0.370000005,0),f +'http://www.roblox.com/asset/?id=96506233',e('TextLabel','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'}),e( +'TextLabel','content',{Position=UDim2.new(0,10,0.2,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'}),e('ImageButton','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'})}),e('ImageButton',{Size= +UDim2.new(1,0,1,0),BackgroundTransparency=1,ZIndex=8,Visible=false,Parent=r}),e( +'Frame','debugframe',{BackgroundTransparency=1,Position=UDim2.new(0.25,0,0.3,0), +Size=UDim2.new(0.5,0,0.37,0),f'http://www.roblox.com/asset/?id=96506233'})local +ae=e('TextLabel',{BackgroundTransparency=0.8,Position=UDim2.new(0,0,0.01,0),Size +=UDim2.new(1,0,0.5,0),Parent=ad,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'})k=e( +'TextLabel',{BackgroundTransparency=0.8,Position=UDim2.new(0,0,0.5,0),Size=UDim2 +.new(1,0,0.5,0),Parent=ad,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 +af,ag=assert(LoadLibrary'RbxGui'),8 for ah,ai in pairs(b)do Game:GetService +'ContentProvider':Preload('http://www.roblox.com/asset/?id='..tostring(ai))end +local aj,ak,al,am,an,ao,ap,aq,ar,as={},0,{},{},nil,{},{},0,0.25,false pcall( +function()as=Game:GetService'UserInputService'.TouchEnabled end)local at,au,av, +aw=150,10,UDim2.new(0.5,0,1,0),UDim2.new(0.25,0,0.1,0)local ax,ay,az,aA,aB,aC,aD +,aE,aF,aG,aH,aI,aJ,aK,aL=UDim2.new(0,at,0,800),UDim2.new(1,-at,0.005,0),-4E-2,E. +Position.Y.Scale,nil,nil,false,false,false,false,false,false,false,{},8 if not +as then aL=12 end local aM,aN,aO,aP,aQ,aR,aS=false,nil,{'Bad Words or Threats', +'Bad Username','Talking about Dating','Account Trading or Sharing', +'Asking Personal Questions','Rude or Mean Behavior','False Reporting Me'},nil, +nil,{Owner=255,Admin=240,Member=128,Visitor=10,Banned=0},not not game.Workspace: +FindFirstChild'PSVariable'game.Workspace.ChildAdded:connect(function(aT)if aT. +Name=='PSVariable'and aT:IsA'BoolValue'then aS=true end end)local aT aT=function +()return#ap*Q.Size.Y.Scale<=1+aA end local aU aU=function()return aA*-1 end +local aV aV=function()if aT()then return aU()else return(aU()-(#ap*Q.Size.Y. +Scale))+(1+aA)end end local aW aW=function(aX,aY)return Vector2.new(aX,aY)/r. +AbsoluteSize end local aX aX=function(aY,aZ,a_,a0,a1)local a2=tick()while tick() +-a2a0 do game:GetService +'PersonalServerService':Demote(a_)end end local a_,a0= +'http://www.roblox.com/asset/?id=',nil a0=function(a1,a2,a3,a4,a5)a2.Image=a_..b +['LightPopupMid']a3.Image=a_..b['DarkPopupMid']a4.Image=a_..b['LightPopupMid']a5 +.Image=a_..b['DarkPopupBottom']local a6=a1.PersonalServerRank if a6<=aR['Banned' +]then a2.Image=a_..b['LightBluePopupMid']elseif a6<=aR['Visitor']then a3.Image= +a_..b['DarkBluePopupMid']elseif a6<=aR['Member']then a4.Image=a_..b[ +'LightBluePopupMid']elseif a6<=aR['Admin']then a5.Image=a_..b[ +'DarkBluePopupBottom']end end local a1 a1=function(a2,a3,a4,a5,a6,a7)m +'setting privilege level'aZ(a2,a3)return a0(a2,a4,a5,a6,a7)end local a2 a2= +function()aN=nil W.Active=false W.Image= +'http://www.roblox.com/asset/?id=96502438'Z:Destroy()aa.Parent=nil ab.Parent=nil +S.Parent=nil U.Visible=true end local a3 a3=function()if W.Active then if aN and +aC then U.Visible=false game.Players:ReportAbuse(aC,aN,Z.Text)if aN== +'Rude or Mean Behavior'or aN=='False Reporting Me'then aa.Parent=S else m +'opening abuse box'ab.Parent=S end else return a2()end end end local a4 a4= +function()if aB then local a5=aB['Frame']Spawn(function()return aX(a5, +'BackgroundTransparency',0.5,1,c)end)end J:TweenPosition(UDim2.new(1,0,0,0), +'Out','Linear',c,true)wait(0.1)aH=false aB=nil end local a5 a5=function()m +'adding report dialog'V.Text=aC.Name J:TweenPosition(UDim2.new(1,0,0,0),'Out', +'Linear',c,true)Z=_:Clone()Z.Parent=Y S.Parent=r return a4()end local a6 a6= +function()aP=function(a7)aN=a7 if aN and aC then W.Active=true W.Image= +'http://www.roblox.com/asset/?id=96501119'end end local a7 aQ,a7=af. +CreateDropDownMenu(aO,aP,true)aQ.Name='AbuseComboBox'aQ.Position=UDim2.new(0.425 +,0,0,142)aQ.Size=UDim2.new(0.55,0,0,32)aQ.Parent=U X.MouseButton1Click:connect( +a2)W.MouseButton1Click:connect(a3)aa:FindFirstChild'OkButton'.MouseButton1Down: +connect(a2)return ab:FindFirstChild'OkButton'.MouseButton1Down:connect(a2)end +local a7 a7=function(a8)if a8==game.Players.LocalPlayer then return Enum. +FriendStatus.NotFriend else local a9,ba=pcall(function()return game.Players. +LocalPlayer:GetFriendStatus(a8)end)if a9 then return ba else return Enum. +FriendStatus.NotFriend end end end local a8 a8=function()local a9=a7(aC)if a9== +Enum.FriendStatus.Friend then p:RevokeFriendship(aC)elseif a9==Enum.FriendStatus +.Unknown or a9==Enum.FriendStatus.NotFriend or a9==Enum.FriendStatus. +FriendRequestSent or a9==Enum.FriendStatus.FriendRequestReceived then p: +RequestFriendship(aC)end return a4()end local a9 a9=function()p: +RevokeFriendship(aC)a4()return J:TweenPosition(UDim2.new(1,0,0,0),'Out','Linear' +,c,true)end local ba ba=function(bb,bc)if bb['Score']==bc['Score']then return bb +['Player'].Name:upper()1 do bu=bu-1 bt. +FontSize=br[bu]wait(0.2)end x.FontSize=bt.FontSize return bt:Destroy()end)end +local bt bt=function(bu)while aE do m'In Adding Stat Lock2'wait( +3.333333333333333E-2)end aE=true local bv=5 local bw,bx=bv,0 for by=#aj,1,-1 do +local bz=aj[by]bx=0 for bA,bB in ipairs(bu)do local bC=bB['Frame']if not bC: +FindFirstChild(bz['Name'])then local bD=bq(bB,bz,bC)if bD then m('adding '.. +tostring(bD.Name)..' to '..tostring(bB['Player'].Name))bD.Parent=bC if bB[ +'MyTeam']and bB['MyTeam']~=an and not bB['MyTeam']['Frame']:FindFirstChild(bz[ +'Name'])then local bE=bD:Clone()bE.Parent=bB['MyTeam']['Frame']end end end bz[ +'XOffset']=bv if bC:FindFirstChild(bz['Name'])then bx=math.max(bx,bC[bz['Name']] +.TextBounds.X)end end if P.Value then bx=math.max(bx,L[bz['Name']].TextBounds.X) +L[bz['Name']]:TweenPosition(UDim2.new(az,-bv,0,0),'Out','Linear',c,true)else L[ +bz['Name']]:TweenPosition(UDim2.new((0.4+((0.6/#aj)*(by-1)))-1,0,0,0),'Out', +'Linear',c,true)end bz['ColumnSize']=bx bv=bv+(au+bx)bw=math.max(bv,bw)end ax= +UDim2.new(0,at+bw-au,0,800)ay=UDim2.new(1,-ax.X.Offset,ay.Y.Scale,0)bs()bk()aE= +false end local bu bu=function()if#aj~=0 then for bv,bw in pairs(L:GetChildren() +)do Spawn(function()return aX(bw,'TextTransparency',bw.TextTransparency,0,c)end) +end v=0.09 u:TweenSizeAndPosition(UDim2.new(u.Size.X.Scale,u.Size.X.Offset,v,0), +u.Position,'Out','Linear',c*1.2,true)D:TweenPosition(UDim2.new(D.Position.X. +Scale,0,v,0),'Out','Linear',c*1.2,true)return z:TweenPosition(UDim2.new(0,0,v,0) +,'Out','Linear',c*1.2,true)end end local bv bv=function()if#aj~=0 then v=0.07 if +not N.Value then for bw,bx in pairs(L:GetChildren())do Spawn(function()return +aX(bx,'TextTransparency',bx.TextTransparency,1,c)end)end end z:TweenPosition( +UDim2.new(0,0,v,0),'Out','Linear',c*1.2,true)u:TweenSizeAndPosition(UDim2.new(u. +Size.X.Scale,u.Size.X.Offset,v,0),u.Position,'Out','Linear',c*1.2,true)return D: +TweenPosition(UDim2.new(D.Position.X.Scale,0,v,0),'Out','Linear',c*1.2,true)end +end local bw bw=function()if not P.Value or M.Value then return bv()else return +bu()end end local bx bx=function()M.Value=not M.Value return bw()end local by by +=function()N.Value=not N.Value return bt(al)end local bz bz=function()local bA, +bB=aV(),aU()local bC,bD=bB-bA,math.max(math.min(H.Position.Y.Scale,bB),bA)H. +Position=UDim2.new(H.Position.X.Scale,H.Position.X.Offset,bD,H.Position.Y.Offset +)local bE=1-G.Size.Y.Scale G.Position=UDim2.new(0,0,bE-(bE*((H.Position.Y.Scale- +bA)/bC)),0)end bb=function()if M.Value then if N.Value then by()end if not O. +Value then s:TweenSizeAndPosition(UDim2.new(0.01,x.TextBounds.X,ax.Y.Scale,ax.Y. +Offset),UDim2.new(0.99,-x.TextBounds.X,ay.Y.Scale,0),'Out','Linear',c*1.2,true) +else s:TweenSizeAndPosition(ax,ay,'Out','Linear',c*1.2,true)end E:TweenPosition( +UDim2.new(0,0,-1,0),'Out','Linear',c*1.2,true)A:TweenPosition(UDim2.new(0,0,0,0) +,'Out','Linear',c*1.2,true)t.Size=UDim2.new(1,0,v,0)C.Image= +'http://www.roblox.com/asset/?id=94692731'else if not N.Value then s: +TweenSizeAndPosition(ax,ay,'Out','Linear',c*1.2,true)end aA=math.min(math.max(aA +,-1),-1+#ap*R.Size.Y.Scale)bz()E.Position=UDim2.new(0,0,aA,0)local bA=aA+E.Size. +Y.Scale A.Position=UDim2.new(0,0,bA,0)t.Size=UDim2.new(1,0,bA+v,0)C.Image= +'http://www.roblox.com/asset/?id=94825585'end end bk=function()if N.Value then +for bA=1,#aj,1 do local bB=aj[bA]L[bB['Name']]:TweenPosition(UDim2.new(0.4+((0.6 +/#aj)*(bA-1))-1,0,0,0),'Out','Linear',c,true)end if M.Value then bx()else bb() +end s:TweenSizeAndPosition(av,aw,'Out','Linear',c*1.2,true)y:TweenPosition(UDim2 +.new(0,0,x.Position.Y.Scale,0),'Out','Linear',c*1.2,true)x:TweenPosition(UDim2. +new(-0.1,-y.TextBounds.x,x.Position.Y.Scale,0),'Out','Linear',c*1.2,true)u. +Background.Image='http://www.roblox.com/asset/?id='..b['LargeHeader']A. +Background.Image='http://www.roblox.com/asset/?id='..b['LargeBottom']for bA,bB +in ipairs(ap)do bB.Background.Image='http://www.roblox.com/asset/?id='..( +function()if bA%2~=1 then return b['LargeDark']else return b['LargeLight']end +end)()end for bC,bD in ipairs(ao)do if bD:FindFirstChild'ClickListener'then bD. +ClickListener.Size=UDim2.new(0.974,0,bD.ClickListener.Size.Y.Scale,0)end for bE= +1,#aj,1 do local bF=aj[bE]if bD:FindFirstChild(bF['Name'])then bD[bF['Name']]: +TweenPosition(UDim2.new(0.4+((0.6/#aj)*(bE-1))-1,0,0,0),'Out','Linear',c,true) +end end end for bE,bF in ipairs(al)do n(bF['Frame'],'TitleFrame').Size=UDim2. +new(0.38,0,bF['Frame'].TitleFrame.Size.Y.Scale,0)end for bG,bH in ipairs(am)do +n(bH['Frame'],'TitleFrame').Size=UDim2.new(0.38,0,bH['Frame'].TitleFrame.Size.Y. +Scale,0)end else if not M.Value then s:TweenSizeAndPosition(ax,ay,'Out','Linear' +,c*1.2,true)end y:TweenPosition(UDim2.new(0,0,0.4,0),'Out','Linear',c*1.2,true)x +:TweenPosition(UDim2.new(0,0,x.Position.Y.Scale,0),'Out','Linear',c*1.2,true)u. +Background.Image='http://www.roblox.com/asset/?id='..b['NormalHeader']A. +Background.Image='http://www.roblox.com/asset/?id='..b['NormalBottom']for bA,bD +in ipairs(ap)do bD.Background.Image='http://www.roblox.com/asset/?id='..( +function()if bA%2~=1 then return b['midDark']else return b['midLight']end end)() +end for bG,bH in ipairs(ao)do if bH:FindFirstChild'ClickListener'then bH. +ClickListener.Size=UDim2.new(0.96,0,bH.ClickListener.Size.Y.Scale,0)for bI=1,#aj +,1 do local bJ=aj[bI]if bH:FindFirstChild(bJ['Name'])and bJ['XOffset']then bH[bJ +['Name']]:TweenPosition(UDim2.new(az,-bJ['XOffset'],0,0),'Out','Linear',c,true) +end end end end for bI,bJ in ipairs(am)do n(bJ['Frame'],'TitleFrame').Size=UDim2 +.new(0,at*0.9,bJ['Frame'].TitleFrame.Size.Y.Scale,0)end for bK,bL in ipairs(al) +do n(bL['Frame'],'TitleFrame').Size=UDim2.new(0,at*0.9,bL['Frame'].TitleFrame. +Size.Y.Scale,0)end end end local bA bA=function(bH)if not(O.Value or M.Value or +aH)then local bK=H.Position local bL=math.max(math.min(bK.Y.Scale+bH,aU()),aV()) +H.Position=UDim2.new(bK.X.Scale,bK.X.Offset,bL,bK.Y.Offset)return bz()end end +local bH bH=function()if aK then return end aK={}table.insert(aK,q.WheelForward: +connect(function()return bA(0.05)end))return table.insert(aK,q.WheelBackward: +connect(function()return bA(-5E-2)end))end local bK bK=function()if aK then for +bL,bM in pairs(aK)do bM:disconnect()end end aK=nil end t.MouseEnter:connect( +function()if not(M.Value or O.Value)then return bH()end end)t.MouseLeave: +connect(function()return bK()end)local bL bL=function()local bM,bN=#ap*Q.Size.Y. +Scale,E.Position.Y.Scale+1 G.Size=UDim2.new(1,0,bN/bM,0)end local bM bM=function +(bN,bO)I.Parent=r if J~=nil then J:Destroy()end J=K:Clone()J.Parent=I local bP, +bQ=2,a7(bO)m(tostring(bQ))local bR,bS=aS and p.PersonalServerRank>=aR['Admin'] +and p.PersonalServerRank>aC.PersonalServerRank,j(J,'Report Player',0)bS. +MouseButton1Click:connect(function()return a5()end)local bT=j(J,'Friend',1,not +bR and bQ~=Enum.FriendStatus.FriendRequestReceived)bT.MouseButton1Click:connect( +a8)if bQ==Enum.FriendStatus.Friend then bT:FindFirstChild'ButtonText'.Text= +'UnFriend Player'elseif bQ==Enum.FriendStatus.Unknown or bQ==Enum.FriendStatus. +NotFriend then bT:FindFirstChild'ButtonText'.Text='Send Request'elseif bQ==Enum. +FriendStatus.FriendRequestSent then bT:FindFirstChild'ButtonText'.Text= +'Revoke Request'elseif bQ==Enum.FriendStatus.FriendRequestReceived then bT: +FindFirstChild'ButtonText'.Text='Accept Friend'local bU=j(J,'Decline Friend',2, +not bR)bU.MouseButton1Click:connect(a9)bP=bP+1 end if bR then local bU,bV,bW,bX= +j(J,'Ban',bP),j(J,'Visitor',bP+1),j(J,'Member',bP+2),j(J,'Admin',bP+3,true)bU. +MouseButton1Click:connect(function()return a1(bO,aR['Banned'],bU,bV,bW,bX)end)bV +.MouseButton1Click:connect(function()return a1(bO,aR['Visitor'],bU,bV,bW,bX)end) +bW.MouseButton1Click:connect(function()return a1(bO,aR['Member'],bU,bV,bW,bX)end +)bX.MouseButton1Click:connect(function()return a1(bO,aR['Admin'],bU,bV,bW,bX)end +)a0(aC,bU,bV,bW,bX)end J:TweenPosition(UDim2.new(0,0,0,0),'Out','Linear',c,true) +Delay(0,function()local bU=q.Button1Down:connect(function()tconnection: +disconnect()return a4()end)end)local bU=bN['Frame']return Spawn(function()while +aH do I.Position=UDim2.new(0,bU.AbsolutePosition.X-I.Size.X.Offset,0,bU. +AbsolutePosition.Y)wait()end end)end local bN bN=function()if aT()then G. +BackgroundTransparency=1 else G.BackgroundTransparency=0 return bL()end end +local bO bO=function(bP)bP['Frame'].BackgroundColor3=Color3.new(0,1,1)Spawn( +function()return aX(bP['Frame'],'BackgroundTransparency',1,0.5,0.5)end)aH=true +return bM(bP,bP['Player'])end local bP bP=function(bQ,bR,bS)local bT=true n(bQ[ +'Frame'],'ClickListener')local bU bU=function()if bQ['Player']and aC and bT and +bQ['Player']~=p and aC.userId>1 and p.userId>1 then return bO(bQ)end end local +bV,bW,bX=nil,H.Position,nil bX=function(bY,bZ)if not bV then bV=aW(bY,bZ).Y end +local b_=aW(bY,bZ).Y m('drag dist: '..tostring(Vector2.new(bR-bY,bS-bZ). +magnitude))if Vector2.new(bR-bY,bS-bZ).magnitude>d then bT=false end local b0= +math.max(math.min(bW.Y.Scale+(b_-bV),aU()),aV())H.Position=UDim2.new(bW.X.Scale, +bW.X.Offset,b0,bW.Y.Offset)return bz()end return aY(r,bX,bU)end local bQ bQ= +function()return Delay(0,function()local bR=tick()m'Got Click2'local bS bS= +function()if tick()-bR<0.25 then return bx()else aM=true if M.Value then return +bx()end end end local bT,bU,bV=nil,aA,nil bV=function(bW,bX)if not M.Value then +if not bT then bT=aW(bW,bX).Y end local bY=aW(bW,bX).Y local bZ=math.min(math. +max(bU+(bY-bT),-1),-1+#ap*R.Size.Y.Scale)aA=bZ bb()F.Size=UDim2.new(F.Size.X. +Scale,0,(aA+E.Size.Y.Scale),0)F.Position=UDim2.new(F.Position.X.Scale,0,1-F.Size +.Y.Scale,0)bL()bz()return bN()end end return Spawn(function()return aY(r,bV,bS) +end)end)end N.Value=false M.Value=false N.Changed:connect(bk)M.Changed:connect( +bb)B.MouseButton1Down:connect(function()if(time()-aq0 then an=b3 bb()bg()end aJ=false end local b2 b2=function(b3) +b_(b3)local b4=false for b5,b6 in ipairs(am)do if b6['MyTeam'].TeamColor==b3[ +'Player'].TeamColor then b0(b6,b3)b4=true end end if not b4 and#(game.Teams: +GetTeams())>0 then m(tostring(b3['Player'].Name)..' could not find team')b3[ +'MyTeam']=nil if not an then return b1()else return b0(an,b3)end end end local +b3 b3=function(b4,b5)while aI do m'in playerchanged lock'wait( +3.333333333333333E-2)end aI=true if b5=='Neutral'then if b4['Player'].Neutral +and#game.Teams:GetTeams()>0 then m(tostring(b4['Player'].Name).. +' setting to neutral')b_(b4)b4['MyTeam']=nil if not an then m(tostring(b4[ +'Player'].Name)..' creating neutral team')b1()else m(tostring(b4['Player'].Name) +..' adding to neutral team')b0(an,b4)end elseif#(game.Teams:GetTeams())>0 then +m(tostring(b4['Player'].Name)..' has been set non-neutral')b2(b4)end bg()elseif +b5=='TeamColor'and not b4['Player'].Neutral and b4['Player']~=b4['MyTeam']then +m(tostring(b4['Player'].Name)..' setting to new team')b2(b4)bg()elseif b5== +'Name'or b5=='MembershipType'then b4['Frame']:FindFirstChild'BCLabel'.Image=h(b4 +['Player'].MembershipType,b4['Player'].Name)b4['Frame'].Name=b4['Player'].Name +b4['Frame'].TitleFrame.Title.Text=b4['Player'].Name if b4['Frame'].BCLabel.Image +~=''then b4['Frame'].TitleFrame.Title.Position=UDim2.new(0.01,30,0.1,0)end if b4 +['Player']==p then b4['Frame'].TitleFrame.DropShadow.Text=b4['Player'].Name bT( +b4['Player'].Name)end bg()end aI=false end local b4 b4=function(b5)while aD do +m('waiting to insert '..tostring(b5.Name))wait(3.333333333333333E-2)end aD=true +local b6=Q:Clone()n(n(b6,'TitleFrame'),'Title').Text=b5.Name b6.Position=UDim2. +new(1,0,(#ao*b6.Size.Y.Scale),0)local b7=a7(b5)b6:FindFirstChild'BCLabel'.Image= +h(b5.MembershipType,b5.Name)b6:FindFirstChild'FriendLabel'.Image=i(b7)b6.Name=b5 +.Name n(n(b6,'TitleFrame'),'Title').Text=b5.Name b6.FriendLabel.Position=b6. +FriendLabel.Position+UDim2.new(0,17,0,0)b6.TitleFrame.Title.Position=b6. +TitleFrame.Title.Position+UDim2.new(0,17,0,0)if b6:FindFirstChild'FriendLabel'. +Image~=''then b6.TitleFrame.Title.Position=b6.TitleFrame.Title.Position+UDim2. +new(0,17,0,0)end if b5.Name==p.Name then b6.TitleFrame.Title.Font='ArialBold'b6. +PlayerScore.Font='ArialBold'bT(b5.Name)do local b8=b6.TitleFrame.Title:Clone()b8 +.TextColor3=Color3.new(0,0,0)b8.TextTransparency=0 b8.ZIndex=2 b8.Position=b6. +TitleFrame.Title.Position+UDim2.new(0,1,0,1)b8.Name='DropShadow'b8.Parent=b6. +TitleFrame end end b6.TitleFrame.Title.Font='ArialBold'b6.Parent=H b6: +TweenPosition(UDim2.new(0.5,0,(#ao*b6.Size.Y.Scale),0),'Out','Linear',c,true)bb( +)local b8={}b8['Frame']=b6 b8['Player']=b5 b8['ID']=ak ak=ak+1 table.insert(al, +b8)if#am~=0 then if b5.Neutral then b8['MyTeam']=nil if not an then b1()else b0( +an,b8)end else local b9=false for ca,cb in ipairs(am)do if cb['MyTeam']. +TeamColor==b5.TeamColor then b0(cb,b8)b8['MyTeam']=cb b9=true end end if not b9 +then b8['MyTeam']=nil if not an then b1()else b0(an,b8)end b8['MyTeam']=an end +end end if b5:FindFirstChild'leaderstats'then bU(b8)end b5.ChildAdded:connect( +function(b9)if b9.Name=='leaderstats'then while aD do m +'in adding leaderstats lock'wait(3.333333333333333E-2)end aD=true bU(b8)aD=false +end end)b5.ChildRemoved:connect(function(b9)if b5==p and b9.Name=='leaderstats' +then return bV(b9,b8)end end)b5.Changed:connect(function(b9)return b3(b8,b9)end) +local b9=n(b6,'ClickListener')b9.Active=true b9.MouseButton1Down:connect( +function(ca,cb)return bW(b8,ca,cb)end)bR()bg()aD=false end local b5 b5=function( +b6)while aD do m'in removing player frame lock'wait(3.333333333333333E-2)end aD= +true local b7 for b8,b9 in ipairs(al)do if b6==b9['Player']then if I.Parent==b9[ +'Frame']then I.Parent=nil end b9['Frame']:Destroy()b7=b9['MyTeam']table.remove( +al,b8)end end if b7 then for ca,cb in ipairs(b7['MyPlayers'])do if cb['Player'] +==b6 then bZ(b7,ca)end end end bS()bb()bg()aD=false end o.ChildRemoved:connect( +b5)local b6 b6=function(b7,b8)local b9=0 if an and not an['IsHidden']then for ca +,cb in ipairs(an['MyPlayers'])do b9=b9+1 b8[b9]=cb['Frame']end b9=b9+1 b8[b9]=an +['Frame']end for ca,cb in ipairs(b7)do if not cb['IsHidden']then for cc,cd in +ipairs(cb.MyPlayers)do b9=b9+1 b8[b9]=cd['Frame']end b9=b9+1 b8[b9]=cb['Frame'] +end end for cc=b9+1,#b8,1 do b8[cc]=nil end end local b7 b7=function(b8,b9)if b8 +['TeamScore']==b9['TeamScore']then return b8['ID']0 then cn['Frame'].Parent=H cn['Frame']: +TweenPosition(UDim2.new(0.5,0,(#ao*cn['Frame'].Size.Y.Scale),0),'Out','Linear',c +,true)bR()else cn['IsHidden']=true cn['Frame'].Parent=nil end table.insert(am,cn +)bb()bg()if#am==1 and not an then b1()end aD=false end local ck ck=function(cn) +return ch(cn)end local cn cn=function(co)return cf(co)end bg=function()while aF +do m'in baseupdate lock'wait(3.333333333333333E-2)end aF=true bw()if#am==0 and +not an then bX()else ca()end for co,cp in ipairs(ao)do if not(cp.Parent~=nil) +then cp:TweenPosition(UDim2.new(0.5,0,((#ao-co)*cp.Size.Y.Scale),0),'Out', +'Linear',c,true)end end if not M.Value and#ao>ag then bz()end bb()bL()bz()bN()aF +=false end game.GuiService:AddKey'\t'local co=time()game.GuiService.KeyPressed: +connect(function(cp)if cp=='\t'then m'caught tab key'local cq,cr cq,cr=pcall( +function()return game.GuiService.IsModalDialog end)if cq==false or(cq and cr== +false)then if time()-co>0.4 then co=time()if O.Value then if not N.Value then r: +TweenPosition(UDim2.new(0,0,0,0),'Out','Linear',c*1.2,true)N.Value=true else r: +TweenPosition(UDim2.new(ax.X.Scale,ax.X.Offset-10,0,0),'Out','Linear',c*1.2,true +)N.Value=false M.Value=true end else return by()end end end end end)local cp cp= +function(cq)return b4(cq)end local cq cq=function(cr)if cr:IsA'Player'then +return Spawn(function()return cp(cr)end)else return be()end end local cr cr= +function(cs,ct)if cs==Enum.CoreGuiType.All or cs==Enum.CoreGuiType.PlayerList +then s.Visible=ct end end local cs cs=function(ct)if ct:IsA'Team'then return ck( +ct)else return be()end end local ct ct=function(cu)if cu:IsA'Team'then return +cn(cu)else return be()end end pcall(function()cr(Enum.CoreGuiType.PlayerList, +Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList))return Game. +StarterGui.CoreGuiChangedSignal:connect(cr)end)while not game:GetService'Teams' +do wait(3.333333333333333E-2)m'Waiting For Teams'end for cu,cv in pairs(game. +Teams:GetTeams())do ck(cv)end for cw,cx in pairs(o:GetPlayers())do Spawn( +function()return cp(cx)end)end game.Teams.ChildAdded:connect(cs)game.Teams. +ChildRemoved:connect(ct)o.ChildAdded:connect(cq)a6()P.Value=true bg()wait(2)aS= +not not game.Workspace:FindFirstChild'PSVariable'if p.Name=='newplayerlistisbad' +or p.Name=='imtotallyadmin'then ad.Parent=r return Spawn(function()while true do +local cy cy=''for cz,cA in pairs(game.Players:GetPlayers())do cy=cy..' '.. +tostring(cA.Name)end ae.Text=cy wait(0.5)end end)end \ No newline at end of file diff --git a/processed/48488398.lua b/processed/48488398.lua index 44ebb8a..80640eb 100644 --- a/processed/48488398.lua +++ b/processed/48488398.lua @@ -1,235 +1,85 @@ -print("[Mercury]: Loaded corescript 48488398") -local waitForProperty -waitForProperty = function(instance, property) - while not instance[property] do - instance.Changed:wait() - end -end -local waitForChild -waitForChild = function(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end -end -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 -local friendRequestBlacklist = { } -local teleportEnabled = true -local showOneButton -showOneButton = function() - local popup = script.Parent:FindFirstChild("Popup") - if popup then - popup.OKButton.Visible = true - popup.DeclineButton.Visible = false - popup.AcceptButton.Visible = false - end - return popup -end -local showTwoButtons -showTwoButtons = function() - local popup = script.Parent:FindFirstChild("Popup") - if popup then - popup.OKButton.Visible = false - popup.DeclineButton.Visible = true - popup.AcceptButton.Visible = true - end - return popup -end -local makePopupInvisible -makePopupInvisible = function() - if script.Parent.Popup then - script.Parent.Popup.Visible = false - end -end -local makeFriend -makeFriend = function(fromPlayer, toPlayer) - local popup = script.Parent:FindFirstChild("Popup") - if not (popup ~= nil) then - return - end - if popup.Visible then - return - end - if friendRequestBlacklist[fromPlayer] then - return - end - 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" - 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) - local yesCon, noCon - yesCon = popup.AcceptButton.MouseButton1Click:connect(function() - popup.Visible = false - toPlayer:RequestFriendship(fromPlayer) - if yesCon ~= nil then - yesCon:disconnect() - end - if noCon ~= nil then - noCon:disconnect() - end - return 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 ~= nil then - yesCon:disconnect() - end - if noCon ~= nil then - noCon:disconnect() - end - return 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) - if fromPlayer ~= localPlayer and toPlayer ~= localPlayer then - return - end - if fromPlayer == localPlayer then - if event == Enum.FriendRequestEvent.Accept then - return game:GetService("GuiService"):SendNotification("You are Friends", "With " .. tostring(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 - return game:GetService("GuiService"):SendNotification("Friend Request", "From " .. tostring(fromPlayer.Name), "http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=48&y=48", 8, function() - return makeFriend(fromPlayer, toPlayer) - end) - elseif event == Enum.FriendRequestEvent.Accept then - return game:GetService("GuiService"):SendNotification("You are Friends", "With " .. tostring(fromPlayer.Name) .. "!", "http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=48&y=48", 5, function() end) - end - end -end) -local showTeleportUI -showTeleportUI = function(message, timer) - if teleportUI ~= nil then - teleportUI:Remove() - end - waitForChild(localPlayer, "PlayerGui") - local _with_0 = Instance.new("Message") - _with_0.Text = message - _with_0.Parent = localPlayer.PlayerGui - if timer > 0 then - wait(timer) - _with_0:Remove() - end - return _with_0 -end -local onTeleport -onTeleport = function(teleportState, _, _) - if game:GetService("TeleportService").CustomizedTeleportUI == false then - return showTeleportUI((function() - if Enum.TeleportState.Started == teleportState then - return "Teleport started...", 0 - elseif Enum.TeleportState.WaitingForServer == teleportState then - return "Requesting server...", 0 - elseif Enum.TeleportState.InProgress == teleportState then - return "Teleporting...", 0 - elseif Enum.TeleportState.Failed == teleportState then - return "Teleport failed. Insufficient privileges or target place does not exist.", 3 - end - end)()) - end -end -if teleportEnabled then - localPlayer.OnTeleport:connect(onTeleport) - game:GetService("TeleportService").ErrorCallback = function(message) - 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")) - return popup:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true, makePopupInvisible()) - end) - return game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup", Enum.CenterDialogType.QuitDialog), function() - showOneButton() - script.Parent:FindFirstChild("Popup").Visible = true - return popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true) - end, function() - return 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") - popup.PopupText.Text = message - popup.PopupImage.Image = "" - local yesCon, noCon - local killCons - killCons = function() - if yesCon ~= nil then - yesCon:disconnect() - end - if noCon ~= nil then - noCon:disconnect() - end - game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild("Popup")) - return 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 - success, err = pcall(function() - return 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 ~= nil then - clickCon:disconnect() - end - game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild("Popup")) - return popup:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true, makePopupInvisible()) - end) - return game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup", Enum.CenterDialogType.QuitDialog), function() - showOneButton() - script.Parent:FindFirstChild("Popup").Visible = true - return popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true) - end, function() - return 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() - return pcall(function() - return game:GetService("TeleportService"):TeleportCancel() - end) - end) - local centerDialogSuccess = pcall(function() - return game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup", Enum.CenterDialogType.QuitDialog), function() - showTwoButtons() - popup.AcceptButton.Text = "Leave" - popup.DeclineButton.Text = "Stay" - script.Parent:FindFirstChild("Popup").Visible = true - return popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true) - end, function() - return 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 - popup.AcceptButton.Text = "Leave" - popup.DeclineButton.Text = "Stay" - popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true) - end - return true - end -end +print'[Mercury]: Loaded corescript 48488398'local a a=function(b,c)while not b[c +]do b.Changed:wait()end end local b b=function(c,d)while not c:FindFirstChild(d) +do c.ChildAdded:wait()end end a(game.Players,'LocalPlayer')b(script.Parent, +'Popup')b(script.Parent.Popup,'AcceptButton')script.Parent.Popup.AcceptButton. +Modal=true local c,d,e,f,g=game.Players.LocalPlayer,nil,{},true,nil g=function() +local h=script.Parent:FindFirstChild'Popup'if h then h.OKButton.Visible=true h. +DeclineButton.Visible=false h.AcceptButton.Visible=false end return h end local +h h=function()local i=script.Parent:FindFirstChild'Popup'if i then i.OKButton. +Visible=false i.DeclineButton.Visible=true i.AcceptButton.Visible=true end +return i end local i i=function()if script.Parent.Popup then script.Parent.Popup +.Visible=false end end local j j=function(k,l)local m=script.Parent: +FindFirstChild'Popup'if not(m~=nil)then return end if m.Visible then return end +if e[k]then return end m.PopupText.Text='Accept Friend Request from '..tostring( +k.Name)..'?'m.PopupImage.Image= +'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId).. +'&x=352&y=352'h()m.Visible=true m.AcceptButton.Text='Accept'm.DeclineButton.Text +='Decline'm:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum. +EasingStyle.Quart,1,true)local n,o n=m.AcceptButton.MouseButton1Click:connect( +function()m.Visible=false l:RequestFriendship(k)if n~=nil then n:disconnect()end +if o~=nil then o:disconnect()end return m:TweenSize(UDim2.new(0,0,0,0),Enum. +EasingDirection.Out,Enum.EasingStyle.Quart,1,true,i())end)o=m.DeclineButton. +MouseButton1Click:connect(function()m.Visible=false l:RevokeFriendship(k)e[k]= +true print'pop up blacklist'if n~=nil then n:disconnect()end if o~=nil then o: +disconnect()end return m:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out, +Enum.EasingStyle.Quart,1,true,i())end)end game.Players.FriendRequestEvent: +connect(function(k,l,m)if k~=c and l~=c then return end if k==c then if m==Enum. +FriendRequestEvent.Accept then return game:GetService'GuiService': +SendNotification('You are Friends','With '..tostring(l.Name)..'!', +'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(l.userId).. +'&x=48&y=48',5,function()end)end elseif l==c then if m==Enum.FriendRequestEvent. +Issue then if e[k]then return end return game:GetService'GuiService': +SendNotification('Friend Request','From '..tostring(k.Name), +'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId).. +'&x=48&y=48',8,function()return j(k,l)end)elseif m==Enum.FriendRequestEvent. +Accept then return game:GetService'GuiService':SendNotification( +'You are Friends','With '..tostring(k.Name)..'!', +'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(k.userId).. +'&x=48&y=48',5,function()end)end end end)local k k=function(l,m)if d~=nil then d +:Remove()end b(c,'PlayerGui')local n=Instance.new'Message'n.Text=l n.Parent=c. +PlayerGui if m>0 then wait(m)n:Remove()end return n end local l l=function(m,n,o +)if game:GetService'TeleportService'.CustomizedTeleportUI==false then return k(( +function()if Enum.TeleportState.Started==m then return'Teleport started...',0 +elseif Enum.TeleportState.WaitingForServer==m then return'Requesting server...', +0 elseif Enum.TeleportState.InProgress==m then return'Teleporting...',0 elseif +Enum.TeleportState.Failed==m then return +[[Teleport failed. Insufficient privileges or target place does not exist.]],3 +end end)())end end if f then c.OnTeleport:connect(l)game:GetService +'TeleportService'.ErrorCallback=function(m)local o=script.Parent:FindFirstChild +'Popup'g()o.PopupText.Text=m local p p=o.OKButton.MouseButton1Click:connect( +function()game:GetService'TeleportService':TeleportCancel()if p then p: +disconnect()end game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild +'Popup')return o:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum. +EasingStyle.Quart,1,true,i())end)return game.GuiService:AddCenterDialog(script. +Parent:FindFirstChild('Popup',Enum.CenterDialogType.QuitDialog),function()g() +script.Parent:FindFirstChild'Popup'.Visible=true return o:TweenSize(UDim2.new(0, +330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function() +return o:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle. +Quart,1,true,i())end)end game:GetService'TeleportService'.ConfirmationCallback= +function(m,o,p)local q=script.Parent:FindFirstChild'Popup'q.PopupText.Text=m q. +PopupImage.Image=''local r,s,t t=function()if r~=nil then r:disconnect()end if s +~=nil then s:disconnect()end game.GuiService:RemoveCenterDialog(script.Parent: +FindFirstChild'Popup')return q:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection +.Out,Enum.EasingStyle.Quart,1,true,i())end r=q.AcceptButton.MouseButton1Click: +connect(function()t()local u,v u,v=pcall(function()return game:GetService +'TeleportService':TeleportImpl(o,p)end)if not u then g()q.PopupText.Text=v local +w w=q.OKButton.MouseButton1Click:connect(function()if w~=nil then w:disconnect() +end game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild'Popup') +return q:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle. +Quart,1,true,i())end)return game.GuiService:AddCenterDialog(script.Parent: +FindFirstChild('Popup',Enum.CenterDialogType.QuitDialog),function()g()script. +Parent:FindFirstChild'Popup'.Visible=true return q:TweenSize(UDim2.new(0,330,0, +350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()return +q:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1 +,true,i())end)end end)s=q.DeclineButton.MouseButton1Click:connect(function()t() +return pcall(function()return game:GetService'TeleportService':TeleportCancel() +end)end)local u=pcall(function()return game.GuiService:AddCenterDialog(script. +Parent:FindFirstChild('Popup',Enum.CenterDialogType.QuitDialog),function()h()q. +AcceptButton.Text='Leave'q.DeclineButton.Text='Stay'script.Parent:FindFirstChild +'Popup'.Visible=true return q:TweenSize(UDim2.new(0,330,0,350),Enum. +EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()return q: +TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1, +true,i())end)end)if u==false then script.Parent:FindFirstChild'Popup'.Visible= +true q.AcceptButton.Text='Leave'q.DeclineButton.Text='Stay'q: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 diff --git a/processed/48488451.lua b/processed/48488451.lua index 1402e50..8acb2c5 100644 --- a/processed/48488451.lua +++ b/processed/48488451.lua @@ -1,91 +1,22 @@ -print("[Mercury]: Loaded corescript 48488451") -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local popupFrame = New("Frame", "Popup", { - Position = UDim2.new(0.5, -165, 0.5, -175), - Size = UDim2.new(0, 330, 0, 350), - Style = Enum.FrameStyle.RobloxRound, - ZIndex = 4, - Visible = false, - Parent = script.Parent, - New("TextLabel", "PopupText", { - Size = UDim2.new(1, 0, 0.8, 0), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size36, - BackgroundTransparency = 1, - Text = "Hello I'm a popup", - TextColor3 = Color3.new(248 / 255, 248 / 255, 248 / 255), - TextWrap = true, - ZIndex = 5 - }), - New("TextButton", "AcceptButton", { - Position = UDim2.new(0, 20, 0, 270), - Size = UDim2.new(0, 100, 0, 50), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size24, - Style = Enum.ButtonStyle.RobloxButton, - TextColor3 = Color3.new(248 / 255, 248 / 255, 248 / 255), - Text = "Yes", - ZIndex = 5 - }), - New("ImageLabel", "PopupImage", { - BackgroundTransparency = 1, - Position = UDim2.new(0.5, -140, 0, 0), - Size = UDim2.new(0, 280, 0, 280), - ZIndex = 3, - New("ImageLabel", "Backing", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 1, 0), - Image = "http://www.roblox.com/asset/?id=47574181", - ZIndex = 2 - }) - }) -}) -local AcceptButton = popupFrame.AcceptButton -do - local _with_0 = popupFrame:clone() - _with_0.Name = "Darken" - _with_0.Size = UDim2.new(1, 16, 1, 16) - _with_0.Position = UDim2.new(0, -8, 0, -8) - _with_0.ZIndex = 1 - _with_0.Parent = popupFrame -end -do - local _with_0 = AcceptButton:clone() - _with_0.Name = "DeclineButton" - _with_0.Position = UDim2.new(1, -120, 0, 270) - _with_0.Text = "No" - _with_0.Parent = popupFrame -end -do - local _with_0 = AcceptButton:clone() - _with_0.Name = "OKButton" - _with_0.Text = "OK" - _with_0.Position = UDim2.new(0.5, -50, 0, 270) - _with_0.Visible = false - _with_0.Parent = popupFrame -end -return script:remove() +print'[Mercury]: Loaded corescript 48488451'local a a=function(b,c,d)if not(d~= +nil)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for +g,h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h +end elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e. +Parent=f return e end local b=a('Frame','Popup',{Position=UDim2.new(0.5,-165,0.5 +,-175),Size=UDim2.new(0,330,0,350),Style=Enum.FrameStyle.RobloxRound,ZIndex=4, +Visible=false,Parent=script.Parent,a('TextLabel','PopupText',{Size=UDim2.new(1,0 +,0.8,0),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size36, +BackgroundTransparency=1,Text="Hello I'm a popup",TextColor3=Color3.new( +0.9725490196078431,0.9725490196078431,0.9725490196078431),TextWrap=true,ZIndex=5 +}),a('TextButton','AcceptButton',{Position=UDim2.new(0,20,0,270),Size=UDim2.new( +0,100,0,50),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size24,Style=Enum. +ButtonStyle.RobloxButton,TextColor3=Color3.new(0.9725490196078431, +0.9725490196078431,0.9725490196078431),Text='Yes',ZIndex=5}),a('ImageLabel', +'PopupImage',{BackgroundTransparency=1,Position=UDim2.new(0.5,-140,0,0),Size= +UDim2.new(0,280,0,280),ZIndex=3,a('ImageLabel','Backing',{BackgroundTransparency +=1,Size=UDim2.new(1,0,1,0),Image='http://www.roblox.com/asset/?id=47574181', +ZIndex=2})})})local c=b.AcceptButton do local d=b:clone()d.Name='Darken'd.Size= +UDim2.new(1,16,1,16)d.Position=UDim2.new(0,-8,0,-8)d.ZIndex=1 d.Parent=b end do +local d=c:clone()d.Name='DeclineButton'd.Position=UDim2.new(1,-120,0,270)d.Text= +'No'd.Parent=b end do local d=c:clone()d.Name='OKButton'd.Text='OK'd.Position= +UDim2.new(0.5,-50,0,270)d.Visible=false d.Parent=b end return script:remove() \ No newline at end of file diff --git a/processed/53878047.lua b/processed/53878047.lua index 2c87031..28b0bb6 100644 --- a/processed/53878047.lua +++ b/processed/53878047.lua @@ -1,758 +1,230 @@ -print("[Mercury]: Loaded corescript 53878047") -if game.CoreGui.Version < 3 then - return -end -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local gui = script.Parent -local waitForChild -waitForChild = function(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end -end -local waitForProperty -waitForProperty = function(instance, property) - while not instance[property] do - instance.Changed:wait() - end -end -local IsTouchDevice -IsTouchDevice = function() - local touchEnabled = false -pcall(function() - touchEnabled = Game:GetService("UserInputService").TouchEnabled - end) - return touchEnabled -end -local IsPhone -IsPhone = function() - if gui.AbsoluteSize.Y <= 320 then - return true - else - return false - end -end -waitForChild(game, "Players") -waitForProperty(game.Players, "LocalPlayer") -local CurrentLoadout = New("Frame", "CurrentLoadout", { - Position = UDim2.new(0.5, -300, 1, -85), - Size = UDim2.new(0, 600, 0, 54), - BackgroundTransparency = 1, - RobloxLocked = true, - Parent = gui, - New("BoolValue", "Debounce", { - RobloxLocked = true - }), - New("ImageLabel", "Background", { - Size = UDim2.new(1.2, 0, 1.2, 0), - Image = "http://www.roblox.com/asset/?id=96536002", - BackgroundTransparency = 1, - Position = UDim2.new(-0.1, 0, -0.1, 0), - ZIndex = 0.0, - Visible = false, - New("ImageLabel", { - Size = UDim2.new(1, 0, 0.025, 1), - Position = UDim2.new(0, 0, 0, 0), - Image = "http://www.roblox.com/asset/?id=97662207", - BackgroundTransparency = 1 - }) - }) -}) -waitForChild(gui, "ControlFrame") -New("ImageButton", "BackpackButton", { - RobloxLocked = true, - Visible = false, - BackgroundTransparency = 1, - Image = "http://www.roblox.com/asset/?id=97617958", - Position = UDim2.new(0.5, -60, 1, -108), - Size = UDim2.new(0, 120, 0, 18), - 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) -end -for i = 0, NumSlots do - local slotFrame = New("Frame", { - Name = "Slot" .. tostring(i), - RobloxLocked = true, - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 1, - BorderColor3 = Color3.new(1, 1, 1), - ZIndex = 4.0, - Position = UDim2.new((function() - if i == 0 then - return 0.9, 0, 0, 0 - else - return (i - 1) * 0.1, (i - 1) * 6, 0, 0 - end - end)()), - Size = UDim2.new(0, 54, 1, 0), - 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) - if i == 0 then - slotFrame:Destroy() - end - end -end -local TempSlot = New("ImageButton", "TempSlot", { - Active = true, - Size = UDim2.new(1, 0, 1, 0), - BackgroundTransparency = 1, - Style = "Custom", - Visible = false, - RobloxLocked = true, - ZIndex = 3.0, - Parent = CurrentLoadout, - New("ImageLabel", "Background", { - BackgroundTransparency = 1, - Image = "http://www.roblox.com/asset/?id=97613075", - Size = UDim2.new(1, 0, 1, 0) - }), - New("ObjectValue", "GearReference", { - RobloxLocked = true - }), - New("TextLabel", "ToolTipLabel", { - RobloxLocked = true, - Text = "", - BackgroundTransparency = 0.5, - BorderSizePixel = 0, - Visible = false, - TextColor3 = Color3.new(1, 1, 1), - BackgroundColor3 = Color3.new(0, 0, 0), - TextStrokeTransparency = 0, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size14, - Size = UDim2.new(1, 60, 0, 20), - Position = UDim2.new(0, -30, 0, -30) - }), - New("BoolValue", "Kill", { - RobloxLocked = true - }), - New("TextLabel", "GearText", { - RobloxLocked = true, - BackgroundTransparency = 1, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size14, - Position = UDim2.new(0, -8, 0, -8), - Size = UDim2.new(1, 16, 1, 16), - Text = "", - TextColor3 = Color3.new(1, 1, 1), - TextWrap = true, - ZIndex = 5.0 - }), - New("ImageLabel", "GearImage", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, 1, 0), - ZIndex = 5.0, - RobloxLocked = true - }) -}) -local SlotNumber = New("TextLabel", "SlotNumber", { - BackgroundTransparency = 1, - BorderSizePixel = 0, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(0, 10, 0, 15), - TextColor3 = Color3.new(1, 1, 1), - TextTransparency = 0, - TextXAlignment = Enum.TextXAlignment.Left, - TextYAlignment = Enum.TextYAlignment.Bottom, - RobloxLocked = true, - Parent = TempSlot, - ZIndex = 5 -}) -if IsTouchDevice() then - SlotNumber.Visible = false -end -local SlotNumberDownShadow -do - local _with_0 = SlotNumber:Clone() - _with_0.Name = "SlotNumberDownShadow" - _with_0.TextColor3 = Color3.new(0, 0, 0) - _with_0.Position = UDim2.new(0, 1, 0, -1) - _with_0.Parent = TempSlot - _with_0.ZIndex = 2 - SlotNumberDownShadow = _with_0 -end -do - local _with_0 = SlotNumberDownShadow:Clone() - _with_0.Name = "SlotNumberUpShadow" - _with_0.Position = UDim2.new(0, -1, 0, -1) - _with_0.Parent = TempSlot -end -local Backpack = New("Frame", "Backpack", { - RobloxLocked = true, - Visible = false, - Position = UDim2.new(0.5, 0, 0.5, 0), - BackgroundColor3 = Color3.new(32 / 255, 32 / 255, 32 / 255), - BackgroundTransparency = 0.0, - BorderSizePixel = 0, - Parent = gui, - Active = true, - New("BoolValue", "SwapSlot", { - RobloxLocked = true, - New("IntValue", "Slot", { - RobloxLocked = true - }), - New("ObjectValue", "GearButton", { - RobloxLocked = true - }) - }), - New("Frame", "SearchFrame", { - RobloxLocked = true, - BackgroundTransparency = 1, - Position = UDim2.new(1, -220, 0, 2), - Size = UDim2.new(0, 220, 0, 24), - New("ImageButton", "SearchButton", { - RobloxLocked = true, - Size = UDim2.new(0, 25, 0, 25), - BackgroundTransparency = 1, - Image = "rbxasset://textures/ui/SearchIcon.png" - }), - New("TextButton", "ResetButton", { - RobloxLocked = true, - Visible = false, - Position = UDim2.new(1, -26, 0, 3), - Size = UDim2.new(0, 20, 0, 20), - Style = Enum.ButtonStyle.RobloxButtonDefault, - Text = "X", - TextColor3 = Color3.new(1, 1, 1), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - ZIndex = 3 - }), - New("TextButton", "SearchBoxFrame", { - RobloxLocked = true, - Position = UDim2.new(0, 25, 0, 0), - Size = UDim2.new(1, -28, 0, 26), - Text = "", - Style = Enum.ButtonStyle.RobloxButton, - New("TextBox", "SearchBox", { - RobloxLocked = true, - BackgroundTransparency = 1, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size12, - Position = UDim2.new(0, -5, 0, -5), - Size = UDim2.new(1, 10, 1, 10), - TextColor3 = Color3.new(1, 1, 1), - TextXAlignment = Enum.TextXAlignment.Left, - ZIndex = 2, - TextWrap = true, - Text = "Search..." - }) - }) - }) -}) -local Tabs = New("Frame", "Tabs", { - Visible = false, - Active = false, - RobloxLocked = true, - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.08, - BorderSizePixel = 0, - Position = UDim2.new(0, 0, -0.1, -4), - Size = UDim2.new(1, 0, 0.1, 4), - Parent = Backpack, - New("Frame", "TabLine", { - RobloxLocked = true, - BackgroundColor3 = Color3.new(53 / 255, 53 / 255, 53 / 255), - BorderSizePixel = 0, - Position = UDim2.new(0, 5, 1, -4), - Size = UDim2.new(1, -10, 0, 4), - ZIndex = 2 - }), - New("TextButton", "InventoryButton", { - RobloxLocked = true, - Size = UDim2.new(0, 60, 0, 30), - Position = UDim2.new(0, 7, 1, -31), - BackgroundColor3 = Color3.new(1, 1, 1), - BorderColor3 = Color3.new(1, 1, 1), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - Text = "Gear", - AutoButtonColor = false, - TextColor3 = Color3.new(0, 0, 0), - Selected = true, - Active = true, - ZIndex = 3 - }), - New("TextButton", "CloseButton", { - RobloxLocked = true, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size24, - Position = UDim2.new(1, -33, 0, 4), - Size = UDim2.new(0, 30, 0, 30), - Style = Enum.ButtonStyle.RobloxButton, - Text = "", - TextColor3 = Color3.new(1, 1, 1), - Modal = true, - New("ImageLabel", "XImage", { - RobloxLocked = true, - Image = (function() - game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=75547445") - return "http://www.roblox.com/asset/?id=75547445" - end)(), - BackgroundTransparency = 1, - Position = UDim2.new(-0.25, -1, -0.25, -1), - Size = UDim2.new(1.5, 2, 1.5, 2), - ZIndex = 2 - }) - }) -}) -if game.CoreGui.Version >= 8 then - New("TextButton", "WardrobeButton", { - RobloxLocked = true, - Size = UDim2.new(0, 90, 0, 30), - Position = UDim2.new(0, 77, 1, -31), - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(1, 1, 1), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - Text = "Wardrobe", - AutoButtonColor = false, - TextColor3 = Color3.new(1, 1, 1), - Selected = false, - Active = true, - Parent = Tabs - }) -end -local Gear = New("Frame", "Gear", { - RobloxLocked = true, - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 1, 0), - ClipsDescendants = true, - Parent = Backpack, - New("Frame", "AssetsList", { - RobloxLocked = true, - BackgroundTransparency = 1, - Size = UDim2.new(0.2, 0, 1, 0), - Style = Enum.FrameStyle.RobloxSquare, - Visible = false - }), - New("Frame", "GearGrid", { - RobloxLocked = true, - Size = UDim2.new(0.95, 0, 1, 0), - BackgroundTransparency = 1, - New("ImageButton", "GearButton", { - RobloxLocked = true, - Visible = false, - Size = UDim2.new(0, 54, 0, 54), - Style = "Custom", - BackgroundTransparency = 1, - New("ImageLabel", "Background", { - BackgroundTransparency = 1, - Image = "http://www.roblox.com/asset/?id=97613075", - Size = UDim2.new(1, 0, 1, 0) - }), - New("ObjectValue", "GearReference", { - RobloxLocked = true - }), - New("Frame", "GreyOutButton", { - RobloxLocked = true, - BackgroundTransparency = 0.5, - Size = UDim2.new(1, 0, 1, 0), - Active = true, - Visible = false, - ZIndex = 3 - }), - New("TextLabel", "GearText", { - RobloxLocked = true, - BackgroundTransparency = 1, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size14, - Position = UDim2.new(0, -8, 0, -8), - Size = UDim2.new(1, 16, 1, 16), - Text = "", - ZIndex = 2, - TextColor3 = Color3.new(1, 1, 1), - TextWrap = true - }) - }) - }) -}) -local GearGridScrollingArea = New("Frame", "GearGridScrollingArea", { - RobloxLocked = true, - Position = UDim2.new(1, -19, 0, 35), - Size = UDim2.new(0, 17, 1, -45), - BackgroundTransparency = 1, - Parent = Gear -}) -local GearLoadouts = New("Frame", "GearLoadouts", { - RobloxLocked = true, - BackgroundTransparency = 1, - Position = UDim2.new(0.7, 23, 0.5, 1), - Size = UDim2.new(0.3, -23, 0.5, -1), - Parent = Gear, - Visible = false, - New("Frame", "LoadoutsList", { - RobloxLocked = true, - Position = UDim2.new(0, 0, 0.15, 2), - Size = UDim2.new(1, -17, 0.85, -2), - Style = Enum.FrameStyle.RobloxSquare - }), - New("Frame", "GearLoadoutsHeader", { - RobloxLocked = true, - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.2, - BorderColor3 = Color3.new(1, 0, 0), - Size = UDim2.new(1, 2, 0.15, -1), - New("TextLabel", "LoadoutsHeaderText", { - RobloxLocked = true, - BackgroundTransparency = 1, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - Size = UDim2.new(1, 0, 1, 0), - Text = "Loadouts", - TextColor3 = Color3.new(1, 1, 1) - }) - }) -}) -do - local _with_0 = GearGridScrollingArea:Clone() - _with_0.Name = "GearLoadoutsScrollingArea" - _with_0.RobloxLocked = true - _with_0.Position = UDim2.new(1, -15, 0.15, 2) - _with_0.Size = UDim2.new(0, 17, 0.85, -2) - _with_0.Parent = GearLoadouts -end -local GearPreview = New("Frame", "GearPreview", { - RobloxLocked = true, - Position = UDim2.new(0.7, 23, 0, 0), - Size = UDim2.new(0.3, -28, 0.5, -1), - BackgroundTransparency = 1, - ZIndex = 7, - Parent = Gear, - New("Frame", "GearStats", { - RobloxLocked = true, - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0.75, 0), - Size = UDim2.new(1, 0, 0.25, 0), - ZIndex = 8, - New("TextLabel", "GearName", { - RobloxLocked = true, - BackgroundTransparency = 1, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0, -3, 0, 0), - Size = UDim2.new(1, 6, 1, 5), - Text = "", - TextColor3 = Color3.new(1, 1, 1), - TextWrap = true, - ZIndex = 9 - }) - }), - New("ImageLabel", "GearImage", { - RobloxLocked = true, - Image = "", - BackgroundTransparency = 1, - Position = UDim2.new(0.125, 0, 0, 0), - Size = UDim2.new(0.75, 0, 0.75, 0), - ZIndex = 8, - New("Frame", "GearIcons", { - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.5, - BorderSizePixel = 0, - RobloxLocked = true, - Position = UDim2.new(0.4, 2, 0.85, -2), - Size = UDim2.new(0.6, 0, 0.15, 0), - Visible = false, - ZIndex = 9, - New("ImageLabel", "GenreImage", { - RobloxLocked = true, - BackgroundColor3 = Color3.new(102 / 255, 153 / 255, 1), - BackgroundTransparency = 0.5, - BorderSizePixel = 0, - Size = UDim2.new(0.25, 0, 1, 0) - }) - }) - }) -}) -local GearIcons, GenreImage -do - local _obj_0 = GearPreview.GearImage - GearIcons, GenreImage = _obj_0.GearIcons, _obj_0.GearIcons.GenreImage -end -do - local _with_0 = GenreImage:Clone() - _with_0.Name = "AttributeOneImage" - _with_0.RobloxLocked = true - _with_0.BackgroundColor3 = Color3.new(1, 51 / 255, 0) - _with_0.Position = UDim2.new(0.25, 0, 0, 0) - _with_0.Parent = GearIcons -end -do - local _with_0 = GenreImage:Clone() - _with_0.Name = "AttributeTwoImage" - _with_0.RobloxLocked = true - _with_0.BackgroundColor3 = Color3.new(153 / 255, 1, 153 / 255) - _with_0.Position = UDim2.new(0.5, 0, 0, 0) - _with_0.Parent = GearIcons -end -do - local _with_0 = GenreImage:Clone() - _with_0.Name = "AttributeThreeImage" - _with_0.RobloxLocked = true - _with_0.BackgroundColor3 = Color3.new(0, 0.5, 0.5) - _with_0.Position = UDim2.new(0.75, 0, 0, 0) - _with_0.Parent = GearIcons -end -if game.CoreGui.Version < 8 then - script:remove() - return -end -local makeCharFrame -makeCharFrame = function(frameName, parent) - return New("Frame", tostring(frameName), { - RobloxLocked = true, - Size = UDim2.new(1, 0, 1, -70), - Position = UDim2.new(0, 0, 0, 20), - BackgroundTransparency = 1, - Parent = parent, - Visible = false - }) -end -local makeZone -makeZone = function(zoneName, image, size, position, parent) - return New("ImageLabel", tostring(zoneName), { - RobloxLocked = true, - Image = image, - Size = size, - BackgroundTransparency = 1, - Position = position, - Parent = parent - }) -end -local makeStyledButton -makeStyledButton = function(buttonName, size, position, parent, buttonStyle) - local button = New("ImageButton", tostring(buttonName), { - RobloxLocked = true, - Size = size, - 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 makeTextLabel -makeTextLabel = function(TextLabelName, text, position, parent) - return New("TextLabel", { - Name = TextLabelName, - RobloxLocked = true, - BackgroundTransparency = 1, - Size = UDim2.new(0, 32, 0, 14), - Font = Enum.Font.Arial, - TextColor3 = Color3.new(1, 1, 1), - FontSize = Enum.FontSize.Size14, - Text = text, - Position = position, - Parent = parent - }) -end -local Wardrobe = New("Frame", "Wardrobe", { - RobloxLocked = true, - BackgroundTransparency = 1, - Visible = false, - Size = UDim2.new(1, 0, 1, 0), - Parent = Backpack, - New("Frame", "AssetList", { - RobloxLocked = true, - Position = UDim2.new(0, 4, 0, 5), - Size = UDim2.new(0, 85, 1, -5), - BackgroundTransparency = 1, - Visible = true - }), - New("TextButton", "PreviewButton", { - RobloxLocked = true, - Text = "Rotate", - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.5, - BorderColor3 = Color3.new(1, 1, 1), - Position = UDim2.new(1.2, -62, 1, -50), - Size = UDim2.new(0, 125, 0, 50), - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size24, - TextColor3 = Color3.new(1, 1, 1), - TextWrapped = true, - TextStrokeTransparency = 0 - }) -}) -local PreviewAssetFrame = New("Frame", "PreviewAssetFrame", { - RobloxLocked = true, - BackgroundTransparency = 1, - Position = UDim2.new(1, -240, 0, 30), - Size = UDim2.new(0, 250, 0, 250), - Parent = Wardrobe -}) -local PreviewAssetBacking = New("TextButton", "PreviewAssetBacking", { - RobloxLocked = true, - Active = false, - Text = "", - AutoButtonColor = false, - Size = UDim2.new(1, 0, 1, 0), - Style = Enum.ButtonStyle.RobloxButton, - Visible = false, - ZIndex = 9, - Parent = PreviewAssetFrame, - New("ImageLabel", "PreviewAssetImage", { - RobloxLocked = true, - BackgroundTransparency = 0.8, - Position = UDim2.new(0.5, -100, 0, 0), - Size = UDim2.new(0, 200, 0, 200), - BorderSizePixel = 0, - ZIndex = 10 - }) -}) -local AssetNameLabel = New("TextLabel", "AssetNameLabel", { - RobloxLocked = true, - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 1, -20), - Size = UDim2.new(0.5, 0, 0, 24), - ZIndex = 10, - Font = Enum.Font.Arial, - Text = "", - TextColor3 = Color3.new(1, 1, 1), - TextScaled = true, - Parent = PreviewAssetBacking -}) -do - local _with_0 = AssetNameLabel:Clone() - _with_0.Name = "AssetTypeLabel" - _with_0.RobloxLocked = true - _with_0.TextScaled = false - _with_0.FontSize = Enum.FontSize.Size18 - _with_0.Position = UDim2.new(0.5, 3, 1, -20) - _with_0.Parent = PreviewAssetBacking -end -local CharacterPane = New("Frame", "CharacterPane", { - RobloxLocked = true, - Position = UDim2.new(1, -220, 0, 32), - Size = UDim2.new(0, 220, 1, -40), - BackgroundTransparency = 1, - Visible = true, - Parent = Wardrobe, - New("TextLabel", "CategoryLabel", { - RobloxLocked = true, - BackgroundTransparency = 1, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - Position = UDim2.new(0, 0, 0, -7), - Size = UDim2.new(1, 0, 0, 20), - TextXAlignment = Enum.TextXAlignment.Center, - Text = "All", - TextColor3 = Color3.new(1, 1, 1) - }), - New("TextButton", "SaveButton", { - RobloxLocked = true, - Size = UDim2.new(0.6, 0, 0, 50), - Position = UDim2.new(0.2, 0, 1, -50), - Style = Enum.ButtonStyle.RobloxButton, - Selected = false, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size18, - Text = "Save", - TextColor3 = Color3.new(1, 1, 1) - }) -}) -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 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 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 pantFrame = New("Frame", "PantFrame", { - RobloxLocked = true, - Size = UDim2.new(0, 25, 0, 56), - Position = UDim2.new(0.5, -26, 0.5, 0), - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(1, 1, 1), - Parent = PantsFrame -}) -do - local _with_0 = pantFrame:Clone() - _with_0.Position = UDim2.new(0.5, 3, 0.5, 0) - _with_0.RobloxLocked = true - _with_0.Parent = PantsFrame -end -New("ImageButton", "CurrentPants", { - RobloxLocked = true, - BackgroundTransparency = 1, - ZIndex = 2, - Position = UDim2.new(0.5, -31, 0.5, -4), - Size = UDim2.new(0, 54, 0, 59), - Parent = 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 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 -return script:Destroy() +print'[Mercury]: Loaded corescript 53878047'if game.CoreGui.Version<3 then +return end local a a=function(b,c,d)if not(d~=nil)then d=c c=nil end local e= +Instance.new(b)if c then e.Name=c end local f for g,h in pairs(d)do if type(g)== +'string'then if g=='Parent'then f=h else e[g]=h end elseif type(g)=='number'and +type(h)=='userdata'then h.Parent=e end end e.Parent=f return e end local b,c= +script.Parent,nil c=function(d,e)while not d:FindFirstChild(e)do d.ChildAdded: +wait()end end local d d=function(e,f)while not e[f]do e.Changed:wait()end end +local e e=function()local f=false pcall(function()f=Game:GetService +'UserInputService'.TouchEnabled end)return f end local f f=function()if b. +AbsoluteSize.Y<=320 then return true else return false end end c(game,'Players') +d(game.Players,'LocalPlayer')local g=a('Frame','CurrentLoadout',{Position=UDim2. +new(0.5,-300,1,-85),Size=UDim2.new(0,600,0,54),BackgroundTransparency=1, +RobloxLocked=true,Parent=b,a('BoolValue','Debounce',{RobloxLocked=true}),a( +'ImageLabel','Background',{Size=UDim2.new(1.2,0,1.2,0),Image= +'http://www.roblox.com/asset/?id=96536002',BackgroundTransparency=1,Position= +UDim2.new(-0.1,0,-0.1,0),ZIndex=0,Visible=false,a('ImageLabel',{Size=UDim2.new(1 +,0,0.025,1),Position=UDim2.new(0,0,0,0),Image= +'http://www.roblox.com/asset/?id=97662207',BackgroundTransparency=1})})})c(b, +'ControlFrame')a('ImageButton','BackpackButton',{RobloxLocked=true,Visible=false +,BackgroundTransparency=1,Image='http://www.roblox.com/asset/?id=97617958', +Position=UDim2.new(0.5,-60,1,-108),Size=UDim2.new(0,120,0,18),Parent=b. +ControlFrame})local h=9 if f()then h=3 g.Size=UDim2.new(0,180,0,54)g.Position= +UDim2.new(0.5,-90,1,-85)end for i=0,h do local j=a('Frame',{Name='Slot'.. +tostring(i),RobloxLocked=true,BackgroundColor3=Color3.new(0,0,0), +BackgroundTransparency=1,BorderColor3=Color3.new(1,1,1),ZIndex=4,Position=UDim2. +new((function()if i==0 then return 0.9,0,0,0 else return(i-1)*0.1,(i-1)*6,0,0 +end end)()),Size=UDim2.new(0,54,1,0),Parent=g})if b.AbsoluteSize.Y<=320 then j. +Position=UDim2.new(0,(i-1)*60,0,-50)print('Well got here',j,j.Position.X.Scale,j +.Position.X.Offset)if i==0 then j:Destroy()end end end local i=a('ImageButton', +'TempSlot',{Active=true,Size=UDim2.new(1,0,1,0),BackgroundTransparency=1,Style= +'Custom',Visible=false,RobloxLocked=true,ZIndex=3,Parent=g,a('ImageLabel', +'Background',{BackgroundTransparency=1,Image= +'http://www.roblox.com/asset/?id=97613075',Size=UDim2.new(1,0,1,0)}),a( +'ObjectValue','GearReference',{RobloxLocked=true}),a('TextLabel','ToolTipLabel', +{RobloxLocked=true,Text='',BackgroundTransparency=0.5,BorderSizePixel=0,Visible= +false,TextColor3=Color3.new(1,1,1),BackgroundColor3=Color3.new(0,0,0), +TextStrokeTransparency=0,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size14, +Size=UDim2.new(1,60,0,20),Position=UDim2.new(0,-30,0,-30)}),a('BoolValue','Kill' +,{RobloxLocked=true}),a('TextLabel','GearText',{RobloxLocked=true, +BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size14, +Position=UDim2.new(0,-8,0,-8),Size=UDim2.new(1,16,1,16),Text='',TextColor3= +Color3.new(1,1,1),TextWrap=true,ZIndex=5}),a('ImageLabel','GearImage',{ +BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,1,0), +ZIndex=5,RobloxLocked=true})})local j=a('TextLabel','SlotNumber',{ +BackgroundTransparency=1,BorderSizePixel=0,Font=Enum.Font.ArialBold,FontSize= +Enum.FontSize.Size18,Position=UDim2.new(0,0,0,0),Size=UDim2.new(0,10,0,15), +TextColor3=Color3.new(1,1,1),TextTransparency=0,TextXAlignment=Enum. +TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Bottom,RobloxLocked=true, +Parent=i,ZIndex=5})if e()then j.Visible=false end local k do local l=j:Clone()l. +Name='SlotNumberDownShadow'l.TextColor3=Color3.new(0,0,0)l.Position=UDim2.new(0, +1,0,-1)l.Parent=i l.ZIndex=2 k=l end do local l=k:Clone()l.Name= +'SlotNumberUpShadow'l.Position=UDim2.new(0,-1,0,-1)l.Parent=i end local l=a( +'Frame','Backpack',{RobloxLocked=true,Visible=false,Position=UDim2.new(0.5,0,0.5 +,0),BackgroundColor3=Color3.new(0.12549019607843137,0.12549019607843137, +0.12549019607843137),BackgroundTransparency=0,BorderSizePixel=0,Parent=b,Active= +true,a('BoolValue','SwapSlot',{RobloxLocked=true,a('IntValue','Slot',{ +RobloxLocked=true}),a('ObjectValue','GearButton',{RobloxLocked=true})}),a( +'Frame','SearchFrame',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2 +.new(1,-220,0,2),Size=UDim2.new(0,220,0,24),a('ImageButton','SearchButton',{ +RobloxLocked=true,Size=UDim2.new(0,25,0,25),BackgroundTransparency=1,Image= +'rbxasset://textures/ui/SearchIcon.png'}),a('TextButton','ResetButton',{ +RobloxLocked=true,Visible=false,Position=UDim2.new(1,-26,0,3),Size=UDim2.new(0, +20,0,20),Style=Enum.ButtonStyle.RobloxButtonDefault,Text='X',TextColor3=Color3. +new(1,1,1),Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18,ZIndex=3}),a( +'TextButton','SearchBoxFrame',{RobloxLocked=true,Position=UDim2.new(0,25,0,0), +Size=UDim2.new(1,-28,0,26),Text='',Style=Enum.ButtonStyle.RobloxButton,a( +'TextBox','SearchBox',{RobloxLocked=true,BackgroundTransparency=1,Font=Enum.Font +.ArialBold,FontSize=Enum.FontSize.Size12,Position=UDim2.new(0,-5,0,-5),Size= +UDim2.new(1,10,1,10),TextColor3=Color3.new(1,1,1),TextXAlignment=Enum. +TextXAlignment.Left,ZIndex=2,TextWrap=true,Text='Search...'})})})})local m=a( +'Frame','Tabs',{Visible=false,Active=false,RobloxLocked=true,BackgroundColor3= +Color3.new(0,0,0),BackgroundTransparency=0.08,BorderSizePixel=0,Position=UDim2. +new(0,0,-0.1,-4),Size=UDim2.new(1,0,0.1,4),Parent=l,a('Frame','TabLine',{ +RobloxLocked=true,BackgroundColor3=Color3.new(0.20784313725490197, +0.20784313725490197,0.20784313725490197),BorderSizePixel=0,Position=UDim2.new(0, +5,1,-4),Size=UDim2.new(1,-10,0,4),ZIndex=2}),a('TextButton','InventoryButton',{ +RobloxLocked=true,Size=UDim2.new(0,60,0,30),Position=UDim2.new(0,7,1,-31), +BackgroundColor3=Color3.new(1,1,1),BorderColor3=Color3.new(1,1,1),Font=Enum.Font +.ArialBold,FontSize=Enum.FontSize.Size18,Text='Gear',AutoButtonColor=false, +TextColor3=Color3.new(0,0,0),Selected=true,Active=true,ZIndex=3}),a('TextButton' +,'CloseButton',{RobloxLocked=true,Font=Enum.Font.ArialBold,FontSize=Enum. +FontSize.Size24,Position=UDim2.new(1,-33,0,4),Size=UDim2.new(0,30,0,30),Style= +Enum.ButtonStyle.RobloxButton,Text='',TextColor3=Color3.new(1,1,1),Modal=true,a( +'ImageLabel','XImage',{RobloxLocked=true,Image=(function()game:GetService +'ContentProvider':Preload'http://www.roblox.com/asset/?id=75547445'return +'http://www.roblox.com/asset/?id=75547445'end)(),BackgroundTransparency=1, +Position=UDim2.new(-0.25,-1,-0.25,-1),Size=UDim2.new(1.5,2,1.5,2),ZIndex=2})})}) +if game.CoreGui.Version>=8 then a('TextButton','WardrobeButton',{RobloxLocked= +true,Size=UDim2.new(0,90,0,30),Position=UDim2.new(0,77,1,-31),BackgroundColor3= +Color3.new(0,0,0),BorderColor3=Color3.new(1,1,1),Font=Enum.Font.ArialBold, +FontSize=Enum.FontSize.Size18,Text='Wardrobe',AutoButtonColor=false,TextColor3= +Color3.new(1,1,1),Selected=false,Active=true,Parent=m})end local n=a('Frame', +'Gear',{RobloxLocked=true,BackgroundTransparency=1,Size=UDim2.new(1,0,1,0), +ClipsDescendants=true,Parent=l,a('Frame','AssetsList',{RobloxLocked=true, +BackgroundTransparency=1,Size=UDim2.new(0.2,0,1,0),Style=Enum.FrameStyle. +RobloxSquare,Visible=false}),a('Frame','GearGrid',{RobloxLocked=true,Size=UDim2. +new(0.95,0,1,0),BackgroundTransparency=1,a('ImageButton','GearButton',{ +RobloxLocked=true,Visible=false,Size=UDim2.new(0,54,0,54),Style='Custom', +BackgroundTransparency=1,a('ImageLabel','Background',{BackgroundTransparency=1, +Image='http://www.roblox.com/asset/?id=97613075',Size=UDim2.new(1,0,1,0)}),a( +'ObjectValue','GearReference',{RobloxLocked=true}),a('Frame','GreyOutButton',{ +RobloxLocked=true,BackgroundTransparency=0.5,Size=UDim2.new(1,0,1,0),Active=true +,Visible=false,ZIndex=3}),a('TextLabel','GearText',{RobloxLocked=true, +BackgroundTransparency=1,Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size14, +Position=UDim2.new(0,-8,0,-8),Size=UDim2.new(1,16,1,16),Text='',ZIndex=2, +TextColor3=Color3.new(1,1,1),TextWrap=true})})})})local o,p=a('Frame', +'GearGridScrollingArea',{RobloxLocked=true,Position=UDim2.new(1,-19,0,35),Size= +UDim2.new(0,17,1,-45),BackgroundTransparency=1,Parent=n}),a('Frame', +'GearLoadouts',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2.new( +0.7,23,0.5,1),Size=UDim2.new(0.3,-23,0.5,-1),Parent=n,Visible=false,a('Frame', +'LoadoutsList',{RobloxLocked=true,Position=UDim2.new(0,0,0.15,2),Size=UDim2.new( +1,-17,0.85,-2),Style=Enum.FrameStyle.RobloxSquare}),a('Frame', +'GearLoadoutsHeader',{RobloxLocked=true,BackgroundColor3=Color3.new(0,0,0), +BackgroundTransparency=0.2,BorderColor3=Color3.new(1,0,0),Size=UDim2.new(1,2, +0.15,-1),a('TextLabel','LoadoutsHeaderText',{RobloxLocked=true, +BackgroundTransparency=1,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18, +Size=UDim2.new(1,0,1,0),Text='Loadouts',TextColor3=Color3.new(1,1,1)})})})do +local q=o:Clone()q.Name='GearLoadoutsScrollingArea'q.RobloxLocked=true q. +Position=UDim2.new(1,-15,0.15,2)q.Size=UDim2.new(0,17,0.85,-2)q.Parent=p end +local q,r,s=a('Frame','GearPreview',{RobloxLocked=true,Position=UDim2.new(0.7,23 +,0,0),Size=UDim2.new(0.3,-28,0.5,-1),BackgroundTransparency=1,ZIndex=7,Parent=n, +a('Frame','GearStats',{RobloxLocked=true,BackgroundTransparency=1,Position=UDim2 +.new(0,0,0.75,0),Size=UDim2.new(1,0,0.25,0),ZIndex=8,a('TextLabel','GearName',{ +RobloxLocked=true,BackgroundTransparency=1,Font=Enum.Font.ArialBold,FontSize= +Enum.FontSize.Size18,Position=UDim2.new(0,-3,0,0),Size=UDim2.new(1,6,1,5),Text= +'',TextColor3=Color3.new(1,1,1),TextWrap=true,ZIndex=9})}),a('ImageLabel', +'GearImage',{RobloxLocked=true,Image='',BackgroundTransparency=1,Position=UDim2. +new(0.125,0,0,0),Size=UDim2.new(0.75,0,0.75,0),ZIndex=8,a('Frame','GearIcons',{ +BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=0.5,BorderSizePixel=0, +RobloxLocked=true,Position=UDim2.new(0.4,2,0.85,-2),Size=UDim2.new(0.6,0,0.15,0) +,Visible=false,ZIndex=9,a('ImageLabel','GenreImage',{RobloxLocked=true, +BackgroundColor3=Color3.new(0.4,0.6,1),BackgroundTransparency=0.5, +BorderSizePixel=0,Size=UDim2.new(0.25,0,1,0)})})})}),nil,nil do local t=q. +GearImage r,s=t.GearIcons,t.GearIcons.GenreImage end do local t=s:Clone()t.Name= +'AttributeOneImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(1,0.2,0)t. +Position=UDim2.new(0.25,0,0,0)t.Parent=r end do local t=s:Clone()t.Name= +'AttributeTwoImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(0.6,1,0.6)t +.Position=UDim2.new(0.5,0,0,0)t.Parent=r end do local t=s:Clone()t.Name= +'AttributeThreeImage't.RobloxLocked=true t.BackgroundColor3=Color3.new(0,0.5,0.5 +)t.Position=UDim2.new(0.75,0,0,0)t.Parent=r end if game.CoreGui.Version<8 then +script:remove()return end local t t=function(u,v)return a('Frame',tostring(u),{ +RobloxLocked=true,Size=UDim2.new(1,0,1,-70),Position=UDim2.new(0,0,0,20), +BackgroundTransparency=1,Parent=v,Visible=false})end local u u=function(v,w,x,y, +z)return a('ImageLabel',tostring(v),{RobloxLocked=true,Image=w,Size=x, +BackgroundTransparency=1,Position=y,Parent=z})end local v v=function(w,x,y,z,A) +local B=a('ImageButton',tostring(w),{RobloxLocked=true,Size=x,Position=y})if A +then B.Style=A else B.BackgroundColor3=Color3.new(0,0,0)B.BorderColor3=Color3. +new(1,1,1)end B.Parent=z return B end local w w=function(x,y,z,A)return a( +'TextLabel',{Name=x,RobloxLocked=true,BackgroundTransparency=1,Size=UDim2.new(0, +32,0,14),Font=Enum.Font.Arial,TextColor3=Color3.new(1,1,1),FontSize=Enum. +FontSize.Size14,Text=y,Position=z,Parent=A})end local x=a('Frame','Wardrobe',{ +RobloxLocked=true,BackgroundTransparency=1,Visible=false,Size=UDim2.new(1,0,1,0) +,Parent=l,a('Frame','AssetList',{RobloxLocked=true,Position=UDim2.new(0,4,0,5), +Size=UDim2.new(0,85,1,-5),BackgroundTransparency=1,Visible=true}),a('TextButton' +,'PreviewButton',{RobloxLocked=true,Text='Rotate',BackgroundColor3=Color3.new(0, +0,0),BackgroundTransparency=0.5,BorderColor3=Color3.new(1,1,1),Position=UDim2. +new(1.2,-62,1,-50),Size=UDim2.new(0,125,0,50),Font=Enum.Font.ArialBold,FontSize= +Enum.FontSize.Size24,TextColor3=Color3.new(1,1,1),TextWrapped=true, +TextStrokeTransparency=0})})local y=a('Frame','PreviewAssetFrame',{RobloxLocked= +true,BackgroundTransparency=1,Position=UDim2.new(1,-240,0,30),Size=UDim2.new(0, +250,0,250),Parent=x})local z=a('TextButton','PreviewAssetBacking',{RobloxLocked= +true,Active=false,Text='',AutoButtonColor=false,Size=UDim2.new(1,0,1,0),Style= +Enum.ButtonStyle.RobloxButton,Visible=false,ZIndex=9,Parent=y,a('ImageLabel', +'PreviewAssetImage',{RobloxLocked=true,BackgroundTransparency=0.8,Position=UDim2 +.new(0.5,-100,0,0),Size=UDim2.new(0,200,0,200),BorderSizePixel=0,ZIndex=10})}) +local A=a('TextLabel','AssetNameLabel',{RobloxLocked=true,BackgroundTransparency +=1,Position=UDim2.new(0,0,1,-20),Size=UDim2.new(0.5,0,0,24),ZIndex=10,Font=Enum. +Font.Arial,Text='',TextColor3=Color3.new(1,1,1),TextScaled=true,Parent=z})do +local B=A:Clone()B.Name='AssetTypeLabel'B.RobloxLocked=true B.TextScaled=false B +.FontSize=Enum.FontSize.Size18 B.Position=UDim2.new(0.5,3,1,-20)B.Parent=z end +local B=a('Frame','CharacterPane',{RobloxLocked=true,Position=UDim2.new(1,-220,0 +,32),Size=UDim2.new(0,220,1,-40),BackgroundTransparency=1,Visible=true,Parent=x, +a('TextLabel','CategoryLabel',{RobloxLocked=true,BackgroundTransparency=1,Font= +Enum.Font.ArialBold,FontSize=Enum.FontSize.Size18,Position=UDim2.new(0,0,0,-7), +Size=UDim2.new(1,0,0,20),TextXAlignment=Enum.TextXAlignment.Center,Text='All', +TextColor3=Color3.new(1,1,1)}),a('TextButton','SaveButton',{RobloxLocked=true, +Size=UDim2.new(0.6,0,0,50),Position=UDim2.new(0.2,0,1,-50),Style=Enum. +ButtonStyle.RobloxButton,Selected=false,Font=Enum.Font.ArialBold,FontSize=Enum. +FontSize.Size18,Text='Save',TextColor3=Color3.new(1,1,1)})})local C=t( +'FacesFrame',B)game:GetService'ContentProvider':Preload +'http://www.roblox.com/asset/?id=75460621'u('FaceZone', +'http://www.roblox.com/asset/?id=75460621',UDim2.new(0,157,0,137),UDim2.new(0.5, +-78,0.5,-68),C)v('Face',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-135),C)local +D=t('HeadsFrame',B)u('FaceZone','http://www.roblox.com/asset/?id=75460621',UDim2 +.new(0,157,0,137),UDim2.new(0.5,-78,0.5,-68),D)v('Head',UDim2.new(0,64,0,64), +UDim2.new(0.5,-32,0.5,-135),D)local E=t('HatsFrame',B)game:GetService +'ContentProvider':Preload'http://www.roblox.com/asset/?id=75457888'local F=u( +'HatsZone','http://www.roblox.com/asset/?id=75457888',UDim2.new(0,186,0,184), +UDim2.new(0.5,-93,0.5,-100),E)v('Hat1Button',UDim2.new(0,64,0,64),UDim2.new(0,-1 +,0,-1),F,Enum.ButtonStyle.RobloxButton)v('Hat2Button',UDim2.new(0,64,0,64),UDim2 +.new(0,63,0,-1),F,Enum.ButtonStyle.RobloxButton)v('Hat3Button',UDim2.new(0,64,0, +64),UDim2.new(0,127,0,-1),F,Enum.ButtonStyle.RobloxButton)local G=t('PantsFrame' +,B)game:GetService'ContentProvider':Preload +'http://www.roblox.com/asset/?id=75457920'u('PantsZone', +'http://www.roblox.com/asset/?id=75457920',UDim2.new(0,121,0,99),UDim2.new(0.5,- +60,0.5,-100),G)local H=a('Frame','PantFrame',{RobloxLocked=true,Size=UDim2.new(0 +,25,0,56),Position=UDim2.new(0.5,-26,0.5,0),BackgroundColor3=Color3.new(0,0,0), +BorderColor3=Color3.new(1,1,1),Parent=G})do local I=H:Clone()I.Position=UDim2. +new(0.5,3,0.5,0)I.RobloxLocked=true I.Parent=G end a('ImageButton', +'CurrentPants',{RobloxLocked=true,BackgroundTransparency=1,ZIndex=2,Position= +UDim2.new(0.5,-31,0.5,-4),Size=UDim2.new(0,54,0,59),Parent=G})local I=t( +'PackagesFrame',B)local J=v('TorsoMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5 +,-32,0.5,-110),I,Enum.ButtonStyle.RobloxButton)w('TorsoLabel','Torso',UDim2.new( +0.5,-16,0,-25),J)local K=v('LeftLegMeshButton',UDim2.new(0,64,0,64),UDim2.new( +0.5,0,0.5,-25),I,Enum.ButtonStyle.RobloxButton)w('LeftLegLabel','Left Leg',UDim2 +.new(0.5,-16,0,-25),K)local L=v('RightLegMeshButton',UDim2.new(0,64,0,64),UDim2. +new(0.5,-64,0.5,-25),I,Enum.ButtonStyle.RobloxButton)w('RightLegLabel', +'Right Leg',UDim2.new(0.5,-16,0,-25),L)local M=v('RightArmMeshButton',UDim2.new( +0,64,0,64),UDim2.new(0.5,-96,0.5,-110),I,Enum.ButtonStyle.RobloxButton)w( +'RightArmLabel','Right Arm',UDim2.new(0.5,-16,0,-25),M)local N=v( +'LeftArmMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5,32,0.5,-110),I,Enum. +ButtonStyle.RobloxButton)w('LeftArmLabel','Left Arm',UDim2.new(0.5,-16,0,-25),N) +local O=t('T-ShirtsFrame',B)game:GetService'ContentProvider':Preload +'http://www.roblox.com/asset/?id=75460642'u('TShirtZone', +'http://www.roblox.com/asset/?id=75460642',UDim2.new(0,121,0,154),UDim2.new(0.5, +-60,0.5,-100),O)v('TShirtButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64) +,O)local P=t('ShirtsFrame',B)u('ShirtZone', +'http://www.roblox.com/asset/?id=75460642',UDim2.new(0,121,0,154),UDim2.new(0.5, +-60,0.5,-100),P)v('ShirtButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64), +P)local Q=t('ColorFrame',B)game:GetService'ContentProvider':Preload +'http://www.roblox.com/asset/?id=76049888'local R=u('ColorZone', +'http://www.roblox.com/asset/?id=76049888',UDim2.new(0,120,0,150),UDim2.new(0.5, +-60,0.5,-100),Q)v('Head',UDim2.new(0.26,0,0.19,0),UDim2.new(0.37,0,0.02,0),R). +AutoButtonColor=false v('LeftArm',UDim2.new(0.19,0,0.36,0),UDim2.new(0.78,0,0.26 +,0),R).AutoButtonColor=false v('RightArm',UDim2.new(0.19,0,0.36,0),UDim2.new( +0.025,0,0.26,0),R).AutoButtonColor=false v('Torso',UDim2.new(0.43,0,0.36,0), +UDim2.new(0.28,0,0.26,0),R).AutoButtonColor=false v('RightLeg',UDim2.new(0.19,0, +0.31,0),UDim2.new(0.275,0,0.67,0),R).AutoButtonColor=false v('LeftLeg',UDim2. +new(0.19,0,0.31,0),UDim2.new(0.525,0,0.67,0),R).AutoButtonColor=false return +script:Destroy() \ No newline at end of file diff --git a/processed/53878057.lua b/processed/53878057.lua index ddb1207..ae14343 100644 --- a/processed/53878057.lua +++ b/processed/53878057.lua @@ -1,1056 +1,228 @@ -print("[Mercury]: Loaded corescript 53878057") -if game.CoreGui.Version < 3 then - return -end -local waitForChild -waitForChild = function(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end - return instance:FindFirstChild(name) -end -local waitForProperty -waitForProperty = function(instance, property) - while not instance[property] do - instance.Changed:wait() - end -end -local currentLoadout = script.Parent -local StaticTabName = "gear" -local backpackEnabled = true -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") -waitForChild(currentLoadout, "Background") -local clBackground = currentLoadout.Background -local IsTouchDevice -IsTouchDevice = function() - local touchEnabled = false -pcall(function() - touchEnabled = Game:GetService("UserInputService").TouchEnabled - end) - return touchEnabled -end -local moveHealthBar -moveHealthBar = function(pGui) - waitForChild(pGui, "HealthGUI") - waitForChild(pGui["HealthGUI"], "tray") - local tray = pGui["HealthGUI"]["tray"] - tray.Position = UDim2.new(0.5, -85, 1, -26) -end -local setHealthBarVisible -setHealthBarVisible = function(pGui, visible) - waitForChild(pGui, "HealthGUI") - waitForChild(pGui["HealthGUI"], "tray") - local tray = pGui["HealthGUI"]["tray"] - tray.Visible = visible -end -waitForChild(game, "Players") -waitForProperty(game.Players, "LocalPlayer") -local player = game.Players.LocalPlayer -waitForChild(player, "PlayerGui") -Spawn(function() - return moveHealthBar(player.PlayerGui) -end) -while not (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") -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 inGearTab = true -local maxNumLoadoutItems = 10 -if robloxGui.AbsoluteSize.Y <= 320 then - maxNumLoadoutItems = 4 -end -local characterChildAddedCon, backpackChildCon -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 enlargeOverride = true -local guiTweenSpeed = 0.5 -local firstInstanceOfLoadout = false -local inventory = { } -local gearSlots = { } -for i = 1, maxNumLoadoutItems do - gearSlots[i] = "empty" -end -local backpackWasOpened = false -local backpackIsOpen -backpackIsOpen = function() - if guiBackpack then - return guiBackpack.Visible - end - return false -end -local reorganizeLoadout -local kill -kill = function(prop, con, gear) - if con ~= nil then - con:disconnect() - end - if prop == true and gear then - return reorganizeLoadout(gear, false) - end -end -local registerNumberKeys -registerNumberKeys = function() - for i = 0, 9 do - game:GetService("GuiService"):AddKey(tostring(i)) - end -end -local unregisterNumberKeys -unregisterNumberKeys = function() - return pcall(function() - for i = 0, 9 do - game:GetService("GuiService"):RemoveKey(tostring(i)) - end - end) -end -local characterInWorkspace -characterInWorkspace = function() - if game.Players["LocalPlayer"] and game.Players.LocalPlayer["Character"] and (game.Players.LocalPlayer.Character ~= nil) and (game.Players.LocalPlayer.Character.Parent ~= nil) then - return true - end - return false -end -local removeGear -removeGear = function(gear) - local emptySlot - for i = 1, #gearSlots do - if gearSlots[i] == gear and (gear.Parent ~= nil) then - emptySlot = i - break - end - end - if emptySlot then - do - local _with_0 = gearSlots[emptySlot] - if _with_0.GearReference.Value then - if _with_0.GearReference.Value.Parent == game.Players.LocalPlayer.Character then - _with_0.GearReference.Value.Parent = game.Players.LocalPlayer.Backpack - end - if _with_0.GearReference.Value:IsA("HopperBin") and _with_0.GearReference.Value.Active then - _with_0.GearReference.Value:Disable() - _with_0.GearReference.Value.Active = false - end - end - end - gearSlots[emptySlot] = "empty" - delay(0, function() - return gear:remove() - end) - return 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 - if allEmpty then - if #player.Backpack:GetChildren() < 1 then - backpackButton.Visible = false - else - backpackButton.Position = UDim2.new(0.5, -60, 1, -44) - end - clBackground.Visible = false - end - end) - end -end -local insertGear -insertGear = function(gear, addToSlot) - local pos - if not addToSlot then - for i = 1, #gearSlots do - if gearSlots[i] == "empty" then - pos = i - break - end - end - if pos == 1 and gearSlots[1] ~= "empty" then - gear:remove() - return - end - else - pos = addToSlot - local start = 1 - for i = 1, #gearSlots do - if gearSlots[i] == "empty" then - start = i - break - end - end - for i = start, pos + 1, -1 do - gearSlots[i] = gearSlots[i - 1] - do - local _tmp_0 - if i == 10 then - _tmp_0 = "0" - else - _tmp_0 = i - end - gearSlots[i].SlotNumber.Text = _tmp_0 - gearSlots[i].SlotNumberDownShadow.Text = _tmp_0 - gearSlots[i].SlotNumberUpShadow.Text = _tmp_0 - end - end - end - gearSlots[pos] = gear - if pos ~= maxNumLoadoutItems then - if type(tostring(pos)) == "string" then - local posString = tostring(pos) - gear.SlotNumber.Text = posString - gear.SlotNumberDownShadow.Text = posString - gear.SlotNumberUpShadow.Text = posString - end - else - gear.SlotNumber.Text = "0" - gear.SlotNumberDownShadow.Text = "0" - gear.SlotNumberUpShadow.Text = "0" - end - gear.Visible = true - local con = gear.Kill.Changed:connect(function(prop) - return kill(prop, con, gear) - end) -end -reorganizeLoadout = function(gear, inserting, _, addToSlot) - if inserting then - insertGear(gear, addToSlot) - else - removeGear(gear) - end - if gear ~= "empty" then - gear.ZIndex = 1 - end -end -local checkToolAncestry -checkToolAncestry = function(child, parent) - if child:FindFirstChild("RobloxBuildTool") then - return - end - 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 not (parent ~= nil) then - gearSlots[i].Kill.Value = true - return false - elseif child.Parent == player.Character then - 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 - return true - end - gearSlots[i].Kill.Value = true - return false - end - end - end -end -local removeAllEquippedGear -removeAllEquippedGear = function(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 - stuff[i]:Disable() - end - end - end -end -local normalizeButton -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 - local moveSpeed = speed - if not (moveSpeed ~= nil) or type(moveSpeed) ~= "number" then - moveSpeed = guiTweenSpeed / 5 - end - if button:FindFirstChild("Highlight") then - button.Highlight.Visible = false - end - if button:IsA("ImageButton") or button:IsA("TextButton") then - button.ZIndex = 1 - local centerizeX = -(buttonSizeNormal.X.Scale - button.Size.X.Scale) / 2 - local centerizeY = -(buttonSizeNormal.Y.Scale - button.Size.Y.Scale) / 2 - return 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 -local enlargeButton -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 - for i = 1, #gearSlots do - if gearSlots[i] == "empty" then - break - end - if gearSlots[i] ~= button then - normalizeButton(gearSlots[i]) - end - end - if not enlargeOverride then - return - end - if button:FindFirstChild("Highlight") then - button.Highlight.Visible = true - end - 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 - return 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 -local hopperBinSwitcher -hopperBinSwitcher = function(numKey, physGear) - if not physGear then - return - end - physGear:ToggleSelect() - if gearSlots[numKey] == "empty" then - return - end - if not physGear.Active then - gearSlots[numKey].Selected = false - return normalizeButton(gearSlots[numKey]) - else - gearSlots[numKey].Selected = true - return enlargeButton(gearSlots[numKey]) - end -end -local toolSwitcher -toolSwitcher = function(numKey) - if not gearSlots[numKey] then - return - end - local physGear = gearSlots[numKey].GearReference.Value - if not (physGear ~= nil) then - return - end - removeAllEquippedGear(physGear) - local key = numKey - 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]) - do - local _with_0 = gearSlots[i] - _with_0.Selected = false - if _with_0.GearReference and _with_0.GearReference.Value and _with_0.GearReference.Value:IsA("HopperBin") and _with_0.GearReference.Value.Active then - _with_0.GearReference.Value:ToggleSelect() - end - end - end - end - if physGear:IsA("HopperBin") then - return hopperBinSwitcher(numKey, physGear) - else - if physGear.Parent == player.Character then - physGear.Parent = player.Backpack - if gearSlots[numKey] ~= "empty" then - gearSlots[numKey].Selected = false - return normalizeButton(gearSlots[numKey]) - end - else - physGear.Parent = player.Character - gearSlots[numKey].Selected = true - return enlargeButton(gearSlots[numKey]) - end - end -end -local activateGear -activateGear = function(num) - local numKey - if num == "0" then - numKey = 10 - else - numKey = tonumber(num) - end - if not (numKey ~= nil) then - return - end - if gearSlots[numKey] ~= "empty" then - return toolSwitcher(numKey) - end -end -local normalizeAllButtons -normalizeAllButtons = function() - for i = 1, #gearSlots do - if gearSlots[i] == "empty" then - break - end - if gearSlots[i] ~= button then - normalizeButton(gearSlots[i], 0.1) - end - end -end -local waitForDebounce -waitForDebounce = function() - while debounce do - wait() - end -end -local pointInRectangle -pointInRectangle = function(point, rectTopLeft, rectSize) - if (point.x > rectTopLeft.x and point.x < (rectTopLeft.x + rectSize.x)) or (point.y > rectTopLeft.y and point.y < (rectTopLeft.y + rectSize.y)) then - return true - end - return false -end -local swapGear -swapGear = function(gearClone, toFrame) - local toFrameChildren = toFrame:GetChildren() - if #toFrameChildren == 1 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 - gearSlots[toSlot] = gearClone - gearSlots[gearCloneSlot] = toFrameChildren[1] - toFrameChildren[1].SlotNumber.Text = gearClone.SlotNumber.Text - toFrameChildren[1].SlotNumberDownShadow.Text = gearClone.SlotNumber.Text - toFrameChildren[1].SlotNumberUpShadow.Text = gearClone.SlotNumber.Text - 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) - toFrameChildren[1].Parent = gearClone.Parent - gearClone.Parent = toFrame - end - else - local slotNum = tonumber(gearClone.SlotNumber.Text) - if slotNum == 0 then - slotNum = 10 - end - gearSlots[slotNum] = "empty" - 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 - gearSlots[toSlotNum] = gearClone - gearClone.Position = UDim2.new(gearClone.Position.X.Scale, 0, gearClone.Position.Y.Scale, 0) - gearClone.Parent = toFrame - end -end -local resolveDrag -resolveDrag = function(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") and pointInRectangle(mousePoint, frames[i].AbsolutePosition, frames[i].AbsoluteSize) then - swapGear(gearClone, frames[i]) - return true - end - end - if (x < frame.AbsolutePosition.x or x > (frame.AbsolutePosition.x + frame.AbsoluteSize.x)) or (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 - return -1 - end -end -local unequipAllItems -unequipAllItems = function(dontEquipThis) - for i = 1, #gearSlots do - if gearSlots[i] == "empty" then - break - end - do - local _with_0 = gearSlots[i] - if _with_0.GearReference.Value and _with_0.GearReference.Value ~= dontEquipThis then - if _with_0.GearReference.Value:IsA("HopperBin") then - _with_0.GearReference.Value:Disable() - elseif _with_0.GearReference.Value:IsA("Tool") then - _with_0.GearReference.Value.Parent = game.Players.LocalPlayer.Backpack - end - _with_0.Selected = false - end - end - end -end -local showToolTip -showToolTip = function(button, tip) - 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.Visible = true - end -end -local hideToolTip -hideToolTip = function(button, _) - if button and button:FindFirstChild("ToolTipLabel") and button.ToolTipLabel:IsA("TextLabel") then - button.ToolTipLabel.Visible = false - end -end -local removeFromInventory -removeFromInventory = function(child) - for i = 1, #inventory do - if inventory[i] == child then - table.remove(inventory, i) - inventory[i] = nil - end - end -end -local addingPlayerChild -addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButton) - waitForDebounce() - debounce = true - if child:FindFirstChild("RobloxBuildTool") then - debounce = false - return - end - if not child:IsA("Tool") and not child:IsA("HopperBin") then - debounce = false - return - end - if not addToSlot then - for i = 1, #gearSlots do - if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then - debounce = false - return - end - end - end - local gearClone = currentLoadout.TempSlot:clone() - gearClone.Name = child.Name - gearClone.GearImage.Image = child.TextureId - if gearClone.GearImage.Image == "" then - 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 - return 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 - return hideToolTip(gearClone, gearClone.GearReference.Value.ToolTip) - end - end) - gearClone.RobloxLocked = true - local slotToMod = -1 - if not addToSlot then - for i = 1, #gearSlots do - if gearSlots[i] == "empty" then - slotToMod = i - break - end - end - else - slotToMod = addToSlot - end - if slotToMod == -1 then - debounce = false - return - end - local slotNum = slotToMod % 10 - 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.ZIndex = 4 - end - reorganizeLoadout(gearClone, (function() - if addToSlot then - return true, equipped, addToSlot - else - return true - end - end)()) - if not (gearClone.Parent ~= nil) then - debounce = false - return - end - if equipped then - gearClone.Selected = true - unequipAllItems(child) - delay(guiTweenSpeed + 0.01, function() - 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 - return enlargeButton(gearClone) - end - end) - end - local dragBeginPos - local clickCon, buttonDeleteCon, mouseEnterCon, mouseLeaveCon, dragStop, dragBegin - clickCon = gearClone.MouseButton1Click:connect(function() - if characterInWorkspace() then - if not gearClone.Draggable then - return activateGear(gearClone.SlotNumber.Text) - end - end - end) - mouseEnterCon = gearClone.MouseEnter:connect(function() - if guiBackpack.Visible then - gearClone.Draggable = true - end - end) - dragBegin = gearClone.DragBegin:connect(function(pos) - 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 - 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 - end - end - end) - dragStop = gearClone.DragStopped:connect(function(x, y) - if gearClone.Selected then - gearClone.ZIndex = 4 - else - gearClone.ZIndex = 3 - end - local children = gearClone:GetChildren() - for i = 1, #children do - 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 - end - end - return 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 ~= nil then - clickCon:disconnect() - end - if buttonDeleteCon ~= nil then - buttonDeleteCon:disconnect() - end - if mouseEnterCon ~= nil then - mouseEnterCon:disconnect() - end - if mouseLeaveCon ~= nil then - mouseLeaveCon:disconnect() - end - if dragStop ~= nil then - dragStop:disconnect() - end - if dragBegin ~= nil then - return dragBegin:disconnect() - end - return nil - end) - local childCon - local childChangeCon - childCon = child.AncestryChanged:connect(function(newChild, parent) - if not checkToolAncestry(newChild, parent) then - if childCon ~= nil then - childCon:disconnect() - end - if childChangeCon ~= nil then - childChangeCon:disconnect() - end - return removeFromInventory(child) - elseif parent == game.Players.LocalPlayer.Backpack then - return normalizeButton(gearClone) - end - end) - childChangeCon = child.Changed:connect(function(prop) - if prop == "Name" then - if gearClone and gearClone.GearImage.Image == "" then - gearClone.GearText.Text = child.Name - end - elseif prop == "Active" then - if child and child:IsA("HopperBin") then - if not child.Active then - gearClone.Selected = false - return normalizeButton(gearClone) - end - end - elseif prop == "TextureId" then - gearClone.GearImage.Image = child.TextureId - end - end) - debounce = false - return Spawn(function() - 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 - end - end - end - end) -end -local addToInventory -addToInventory = function(child) - if not child:IsA("Tool") or not child:IsA("HopperBin") then - return - end - local slot - for i = 1, #inventory do - 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 - elseif #inventory < 1 then - inventory[1] = child - else - inventory[#inventory + 1] = child - end -end -local spreadOutGear -spreadOutGear = function() - local loadoutChildren = currentLoadout:GetChildren() - for i = 1, #loadoutChildren do - 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 - end - end -end -local centerGear -centerGear = function() - local loadoutChildren = currentLoadout:GetChildren() - local gearButtons = { } - local lastSlotAdd - for i = 1, #loadoutChildren do - if loadoutChildren[i]:IsA("Frame") then - if #loadoutChildren[i]:GetChildren() > 0 then - if loadoutChildren[i].Name == "Slot0" then - lastSlotAdd = loadoutChildren[i] - else - table.insert(gearButtons, loadoutChildren[i]) - end - end - 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 - end -end -local editLoadout -editLoadout = function() - backpackWasOpened = true - if inGearTab then - return spreadOutGear() - end -end -local readonlyLoadout -readonlyLoadout = function() - if not inGearTab then - return centerGear() - end -end -local setupBackpackListener -setupBackpackListener = function() - if backpackChildCon ~= nil then - backpackChildCon:disconnect() - end - backpackChildCon = nil - backpackChildCon = player.Backpack.ChildAdded:connect(function(child) - if not firstInstanceOfLoadout then - firstInstanceOfLoadout = true - if backpackEnabled then - backpackButton.Visible = true - clBackground.Visible = true - end - end - addingPlayerChild(child) - return addToInventory(child) - end) -end -local playerCharacterChildAdded -playerCharacterChildAdded = function(child) - addingPlayerChild(child, true) - return addToInventory(child) -end -local activateLoadout -activateLoadout = function() - currentLoadout.Visible = true -end -local deactivateLoadout -deactivateLoadout = function() - currentLoadout.Visible = false -end -local tabHandler -tabHandler = function(inFocus) - inGearTab = inFocus - if inFocus then - return editLoadout() - else - return readonlyLoadout() - end -end -local coreGuiChanged -coreGuiChanged = function(coreGuiType, enabled) - if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then - backpackButton.Visible = enabled - clBackground.Visible = enabled - backpackEnabled = enabled - if enabled then - registerNumberKeys() - else - unregisterNumberKeys() - end - end - if coreGuiType == Enum.CoreGuiType.Health or coreGuiType == Enum.CoreGuiType.All then - return setHealthBarVisible(game.Players.LocalPlayer.PlayerGui, enabled) - end -end -registerNumberKeys() -pcall(function() - coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)) - coreGuiChanged(Enum.CoreGuiType.Health, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health)) - return Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) -end) -wait() -waitForChild(player, "Backpack") -waitForProperty(player, "Character") -delay(1, function() - local backpackChildren = player.Backpack:GetChildren() - local size = math.min(10, #backpackChildren) - for i = 1, size do - if backpackEnabled then - backpackButton.Visible = true - clBackground.Visible = true - end - addingPlayerChild(backpackChildren[i], false) - end - return setupBackpackListener() -end) -delay(2, function() - 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 - return wait(0.25) -end) -player.ChildAdded:connect(function(child) - if child:IsA("PlayerGui") then - return moveHealthBar(child) - end -end) -waitForProperty(player, "Character") -for _, v in ipairs(player.Character:GetChildren()) do - playerCharacterChildAdded(v) -end -characterChildAddedCon = player.Character.ChildAdded:connect(function(child) - return playerCharacterChildAdded(child) -end) -waitForChild(player.Character, "Humanoid") -local humanoidDiedCon = player.Character.Humanoid.Died:connect(function() - do - local _obj_0 = humanoidDiedCon - if _obj_0 ~= nil then - _obj_0:disconnect() - end - end - humanoidDiedCon = nil - deactivateLoadout() - if backpackChildCon ~= nil then - backpackChildCon:disconnect() - end - backpackChildCon = nil - backpackWasOpened = false -end) -player.CharacterRemoving:connect(function() - for i = 1, #gearSlots do - if gearSlots[i] ~= "empty" then - gearSlots[i].Parent = nil - gearSlots[i] = "empty" - end - end -end) -player.CharacterAdded:connect(function() - waitForProperty(game.Players, "LocalPlayer") - player = game.Players.LocalPlayer - waitForChild(player, "Backpack") - delay(1, function() - local backpackChildren = player.Backpack:GetChildren() - local size = math.min(10, #backpackChildren) - for i = 1, size do - if backpackEnabled then - backpackButton.Visible = true - clBackground.Visible = true - end - addingPlayerChild(backpackChildren[i], false) - end - return setupBackpackListener() - end) - activateLoadout() - if characterChildAddedCon ~= nil then - characterChildAddedCon:disconnect() - end - characterChildAddedCon = player.Character.ChildAdded:connect(function(child) - return addingPlayerChild(child, true) - end) - 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 ~= nil then - humanoidDiedCon:disconnect() - end - humanoidDiedCon = nil - if backpackChildCon ~= nil then - backpackChildCon:disconnect() - end - backpackChildCon = nil - end) - waitForChild(player, "PlayerGui") - moveHealthBar(player.PlayerGui) - return delay(2, function() - if (not backpackWasOpened) and (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 - return wait(0.25) - end) -end) -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 gearSlots[pos] then - reorganizeLoadout(gearSlots[pos], false) - end - if swapSlot.GearButton.Value then - addingPlayerChild(swapSlot.GearButton.Value.GearReference.Value, false, pos) - end - guiBackpack.SwapSlot.Value = false - end -end) -game:GetService("GuiService").KeyPressed:connect(function(key) - if characterInWorkspace() then - return activateGear(key) - end -end) -backpackOpenEvent.Event:connect(editLoadout) -backpackCloseEvent.Event:connect(centerGear) -return tabClickedEvent.Event:connect(function(tabName) - return tabHandler(tabName == StaticTabName) -end) +print'[Mercury]: Loaded corescript 53878057'if game.CoreGui.Version<3 then +return end local a a=function(b,c)while not b:FindFirstChild(c)do b.ChildAdded: +wait()end return b:FindFirstChild(c)end local b b=function(c,d)while not c[d]do +c.Changed:wait()end end local c,d,e,f=script.Parent,'gear',true,game:GetService +'CoreGui':FindFirstChild'RobloxGui'assert(f)local g=a(f,'ControlFrame')local h,i +=a(g,'BackpackButton'),a(f,'Backpack')a(f,'CurrentLoadout')a(f.CurrentLoadout, +'TempSlot')a(f.CurrentLoadout.TempSlot,'SlotNumber')a(c,'Background')local j,k=c +.Background,nil k=function()local l=false pcall(function()l=Game:GetService +'UserInputService'.TouchEnabled end)return l end local l l=function(m)a(m, +'HealthGUI')a(m['HealthGUI'],'tray')local n=m['HealthGUI']['tray']n.Position= +UDim2.new(0.5,-85,1,-26)end local m m=function(n,o)a(n,'HealthGUI')a(n[ +'HealthGUI'],'tray')local p=n['HealthGUI']['tray']p.Visible=o end a(game, +'Players')b(game.Players,'LocalPlayer')local n=game.Players.LocalPlayer a(n, +'PlayerGui')Spawn(function()return l(n.PlayerGui)end)while not(n.Character~=nil) +do wait(0.03)end local o=a(n.Character,'Humanoid')o.Died:connect(function()h. +Visible=false end)a(game,'LocalBackpack')game.LocalBackpack: +SetOldSchoolBackpack(false)a(c.Parent,'Backpack')local p=c.Parent.Backpack local +q=a(p,'CoreScripts/BackpackScripts/BackpackManager')local r,s,t,u,v=a(q, +'BackpackOpenEvent'),a(q,'BackpackCloseEvent'),a(q,'TabClickedEvent'),true,10 if +f.AbsoluteSize.Y<=320 then v=4 end local w,x,y,z=nil,nil,false,1.18 local A,B,C, +D,E,F,G=UDim2.new(1*z,0,1*z,0),UDim2.new(1,0,1,0),true,0.5,false,{},{}for H=1,v +do G[H]='empty'end local H,I=false,nil I=function()if p then return p.Visible +end return false end local J,K K=function(L,M,N)if M~=nil then M:disconnect()end +if L==true and N then return J(N,false)end end local L L=function()for M=0,9 do +game:GetService'GuiService':AddKey(tostring(M))end end local M M=function() +return pcall(function()for N=0,9 do game:GetService'GuiService':RemoveKey( +tostring(N))end end)end local N N=function()if game.Players['LocalPlayer']and +game.Players.LocalPlayer['Character']and(game.Players.LocalPlayer.Character~=nil +)and(game.Players.LocalPlayer.Character.Parent~=nil)then return true end return +false end local O O=function(P)local Q for R=1,#G do if G[R]==P and(P.Parent~= +nil)then Q=R break end end if Q then do local R=G[Q]if R.GearReference.Value +then if R.GearReference.Value.Parent==game.Players.LocalPlayer.Character then R. +GearReference.Value.Parent=game.Players.LocalPlayer.Backpack end if R. +GearReference.Value:IsA'HopperBin'and R.GearReference.Value.Active then R. +GearReference.Value:Disable()R.GearReference.Value.Active=false end end end G[Q] +='empty'delay(0,function()return P:remove()end)return Spawn(function()while I() +do wait(0.03)end a(n,'Backpack')local R=true for S=1,#G do if G[S]~='empty'then +R=false end end if R then if#n.Backpack:GetChildren()<1 then h.Visible=false +else h.Position=UDim2.new(0.5,-60,1,-44)end j.Visible=false end end)end end +local P P=function(Q,R)local S if not R then for T=1,#G do if G[T]=='empty'then +S=T break end end if S==1 and G[1]~='empty'then Q:remove()return end else S=R +local T=1 for U=1,#G do if G[U]=='empty'then T=U break end end for U=T,S+1,-1 do +G[U]=G[U-1]do local V if U==10 then V='0'else V=U end G[U].SlotNumber.Text=V G[U +].SlotNumberDownShadow.Text=V G[U].SlotNumberUpShadow.Text=V end end end G[S]=Q +if S~=v then if type(tostring(S))=='string'then local T=tostring(S)Q.SlotNumber. +Text=T Q.SlotNumberDownShadow.Text=T Q.SlotNumberUpShadow.Text=T end else Q. +SlotNumber.Text='0'Q.SlotNumberDownShadow.Text='0'Q.SlotNumberUpShadow.Text='0' +end Q.Visible=true local T=Q.Kill.Changed:connect(function(T)return K(T,con,Q) +end)end J=function(Q,R,S,T)if R then P(Q,T)else O(Q)end if Q~='empty'then Q. +ZIndex=1 end end local Q Q=function(R,S)if R:FindFirstChild'RobloxBuildTool'then +return end if R:IsA'Tool'or R:IsA'HopperBin'then for T=1,#G do if G[T]~='empty' +and G[T].GearReference.Value==R then if not(S~=nil)then G[T].Kill.Value=true +return false elseif R.Parent==n.Character then G[T].Selected=true return true +elseif R.Parent==n.Backpack then if R:IsA'Tool'or R:IsA'HopperBin'then G[T]. +Selected=false end return true end G[T].Kill.Value=true return false end end end +end local R R=function(S)local T=n.Character:GetChildren()for U=1,#T do if(T[U]: +IsA'Tool'or T[U]:IsA'HopperBin')and T[U]~=S then if T[U]:IsA'Tool'then T[U]. +Parent=n.Backpack end if T[U]:IsA'HopperBin'then T[U]:Disable()end end end end +local S S=function(T,U)if not T then return end if T.Size.Y.Scale<=1 then return +end if T.Selected then return end if not T.Parent then return end local V=U if +not(V~=nil)or type(V)~='number'then V=D/5 end if T:FindFirstChild'Highlight'then +T.Highlight.Visible=false end if T:IsA'ImageButton'or T:IsA'TextButton'then T. +ZIndex=1 local W,X=-(B.X.Scale-T.Size.X.Scale)/2,-(B.Y.Scale-T.Size.Y.Scale)/2 +return T:TweenSizeAndPosition(B,UDim2.new(T.Position.X.Scale+W,T.Position.X. +Offset,T.Position.Y.Scale+X,T.Position.Y.Offset),Enum.EasingDirection.Out,Enum. +EasingStyle.Quad,V,C)end end local T T=function(U)if U.Size.Y.Scale>1 then +return end if not U.Parent then return end if not U.Selected then return end for +V=1,#G do if G[V]=='empty'then break end if G[V]~=U then S(G[V])end end if not C +then return end if U:FindFirstChild'Highlight'then U.Highlight.Visible=true end +if U:IsA'ImageButton'or U:IsA'TextButton'then U.ZIndex=5 local V,W=-(A.X.Scale-U +.Size.X.Scale)/2,-(A.Y.Scale-U.Size.Y.Scale)/2 return U:TweenSizeAndPosition(A, +UDim2.new(U.Position.X.Scale+V,U.Position.X.Offset,U.Position.Y.Scale+W,U. +Position.Y.Offset),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,D/5,C)end end +local U U=function(V,W)if not W then return end W:ToggleSelect()if G[V]=='empty' +then return end if not W.Active then G[V].Selected=false return S(G[V])else G[V] +.Selected=true return T(G[V])end end local V V=function(W)if not G[W]then return +end local X=G[W].GearReference.Value if not(X~=nil)then return end R(X)local Y=W +if W==0 then Y=10 end for Z=1,#G do if G[Z]and G[Z]~='empty'and Z~=Y then S(G[Z] +)do local _=G[Z]_.Selected=false if _.GearReference and _.GearReference.Value +and _.GearReference.Value:IsA'HopperBin'and _.GearReference.Value.Active then _. +GearReference.Value:ToggleSelect()end end end end if X:IsA'HopperBin'then return +U(W,X)else if X.Parent==n.Character then X.Parent=n.Backpack if G[W]~='empty' +then G[W].Selected=false return S(G[W])end else X.Parent=n.Character G[W]. +Selected=true return T(G[W])end end end local W W=function(X)local Y if X=='0' +then Y=10 else Y=tonumber(X)end if not(Y~=nil)then return end if G[Y]~='empty' +then return V(Y)end end local X X=function()for Y=1,#G do if G[Y]=='empty'then +break end if G[Y]~=button then S(G[Y],0.1)end end end local Y Y=function()while +y do wait()end end local Z Z=function(_,aa,ab)if(_.x>aa.x and _.x<(aa.x+ab.x))or +(_.y>aa.y and _.y<(aa.y+ab.y))then return true end return false end local aa aa= +function(ab,_)local ac=_:GetChildren()if#ac==1 then if ac[1]:FindFirstChild +'SlotNumber'then local ad,ae=tonumber(ac[1].SlotNumber.Text),tonumber(ab. +SlotNumber.Text)if ad==0 then ad=10 end if ae==0 then ae=10 end G[ad]=ab G[ae]= +ac[1]ac[1].SlotNumber.Text=ab.SlotNumber.Text ac[1].SlotNumberDownShadow.Text=ab +.SlotNumber.Text ac[1].SlotNumberUpShadow.Text=ab.SlotNumber.Text local af= +string.sub(_.Name,5)ab.SlotNumber.Text=af ab.SlotNumberDownShadow.Text=af ab. +SlotNumberUpShadow.Text=af ab.Position=UDim2.new(ab.Position.X.Scale,0,ab. +Position.Y.Scale,0)ac[1].Position=UDim2.new(ac[1].Position.X.Scale,0,ac[1]. +Position.Y.Scale,0)ac[1].Parent=ab.Parent ab.Parent=_ end else local ad= +tonumber(ab.SlotNumber.Text)if ad==0 then ad=10 end G[ad]='empty'local ae=string +.sub(_.Name,5)ab.SlotNumber.Text=ae ab.SlotNumberDownShadow.Text=ae ab. +SlotNumberUpShadow.Text=ae local af=tonumber(ab.SlotNumber.Text)if af==0 then af +=10 end G[af]=ab ab.Position=UDim2.new(ab.Position.X.Scale,0,ab.Position.Y.Scale +,0)ab.Parent=_ end end local ab ab=function(ac,ad,ae)local af,_=Vector2.new(ad, +ae),ac.Parent local ag=_.Parent:GetChildren()for ah=1,#ag do if ag[ah]:IsA +'Frame'and Z(af,ag[ah].AbsolutePosition,ag[ah].AbsoluteSize)then aa(ac,ag[ah]) +return true end end if(ad<_.AbsolutePosition.x or ad>(_.AbsolutePosition.x+_. +AbsoluteSize.x))or(ae<_.AbsolutePosition.y or ae>(_.AbsolutePosition.y+_. +AbsoluteSize.y))then J(ac,false)return false else if dragBeginPos then ac. +Position=dragBeginPos end return-1 end end local ac ac=function(ad)for ae=1,#G +do if G[ae]=='empty'then break end do local af=G[ae]if af.GearReference.Value +and af.GearReference.Value~=ad then if af.GearReference.Value:IsA'HopperBin'then +af.GearReference.Value:Disable()elseif af.GearReference.Value:IsA'Tool'then af. +GearReference.Value.Parent=game.Players.LocalPlayer.Backpack end af.Selected= +false end end end end local ad ad=function(ae,af)if ae and ae:FindFirstChild +'ToolTipLabel'and ae.ToolTipLabel:IsA'TextLabel'and not k()then ae.ToolTipLabel. +Text=tostring(af)local ag=ae.ToolTipLabel.TextBounds.X+6 ae.ToolTipLabel.Size= +UDim2.new(0,ag,0,20)ae.ToolTipLabel.Position=UDim2.new(0.5,-ag/2,0,-30)ae. +ToolTipLabel.Visible=true end end local ae ae=function(af,ag)if af and af: +FindFirstChild'ToolTipLabel'and af.ToolTipLabel:IsA'TextLabel'then af. +ToolTipLabel.Visible=false end end local af af=function(ag)for ah=1,#F do if F[ +ah]==ag then table.remove(F,ah)F[ah]=nil end end end local ag ag=function(ah,_, +ai,aj)Y()y=true if ah:FindFirstChild'RobloxBuildTool'then y=false return end if +not ah:IsA'Tool'and not ah:IsA'HopperBin'then y=false return end if not ai then +for ak=1,#G do if G[ak]~='empty'and G[ak].GearReference.Value==ah then y=false +return end end end local ak=c.TempSlot:clone()ak.Name=ah.Name ak.GearImage.Image +=ah.TextureId if ak.GearImage.Image==''then ak.GearText.Text=ah.Name end ak. +GearReference.Value=ah ak.MouseEnter:connect(function()if ak.GearReference and +ak.GearReference.Value['ToolTip']and ak.GearReference.Value.ToolTip~=''then +return ad(ak,ak.GearReference.Value.ToolTip)end end)ak.MouseLeave:connect( +function()if ak.GearReference and ak.GearReference.Value['ToolTip']and ak. +GearReference.Value.ToolTip~=''then return ae(ak,ak.GearReference.Value.ToolTip) +end end)ak.RobloxLocked=true local al=-1 if not ai then for am=1,#G do if G[am] +=='empty'then al=am break end end else al=ai end if al==-1 then y=false return +end local am=al%10 local an=c:FindFirstChild('Slot'..tostring(am))ak.Parent=an +if aj then local ao,ap=aj.AbsolutePosition,ak.AbsolutePosition local aq=ao-ap ak +.Position=UDim2.new(ak.Position.X.Scale,aq.x,ak.Position.Y.Scale,aq.y)ak.ZIndex= +4 end J(ak,(function()if ai then return true,_,ai else return true end end)())if +not(ak.Parent~=nil)then y=false return end if _ then ak.Selected=true ac(ah) +delay(D+0.01,function()if ak:FindFirstChild'GearReference'and((ak.GearReference. +Value:IsA'Tool'and ak.GearReference.Value.Parent==n.Character)or(ak. +GearReference.Value:IsA'HopperBin'and ak.GearReference.Value.Active==true))then +return T(ak)end end)end local ao,ap,aq,ar,as,at,au ap=ak.MouseButton1Click: +connect(function()if N()then if not ak.Draggable then return W(ak.SlotNumber. +Text)end end end)ar=ak.MouseEnter:connect(function()if p.Visible then ak. +Draggable=true end end)au=ak.DragBegin:connect(function(av)ao=av ak.ZIndex=7 +local aw=ak:GetChildren()for ax=1,#aw do if aw[ax]:IsA'TextLabel'then if string. +find(aw[ax].Name,'Shadow')then aw[ax].ZIndex=8 else aw[ax].ZIndex=9 end elseif +aw[ax]:IsA'Frame'or aw[ax]:IsA'ImageLabel'then aw[ax].ZIndex=7 end end end)at=ak +.DragStopped:connect(function(av,aw)if ak.Selected then ak.ZIndex=4 else ak. +ZIndex=3 end local ax=ak:GetChildren()for ay=1,#ax do if ax[ay]:IsA'TextLabel' +then if string.find(ax[ay].Name,'Shadow')then ax[ay].ZIndex=3 else ax[ay].ZIndex +=4 end elseif ax[ay]:IsA'Frame'or ax[ay]:IsA'ImageLabel'then ax[ay].ZIndex=2 end +end return ab(ak,av,aw)end)as=ak.MouseLeave:connect(function()ak.Draggable=false +end)aq=ak.AncestryChanged:connect(function()if ak.Parent and ak.Parent.Parent==c +then return end if ap~=nil then ap:disconnect()end if aq~=nil then aq: +disconnect()end if ar~=nil then ar:disconnect()end if as~=nil then as: +disconnect()end if at~=nil then at:disconnect()end if au~=nil then return au: +disconnect()end return nil end)local av,aw av=ah.AncestryChanged:connect( +function(ax,ay)if not Q(ax,ay)then if av~=nil then av:disconnect()end if aw~=nil +then aw:disconnect()end return af(ah)elseif ay==game.Players.LocalPlayer. +Backpack then return S(ak)end end)aw=ah.Changed:connect(function(ax)if ax== +'Name'then if ak and ak.GearImage.Image==''then ak.GearText.Text=ah.Name end +elseif ax=='Active'then if ah and ah:IsA'HopperBin'then if not ah.Active then ak +.Selected=false return S(ak)end end elseif ax=='TextureId'then ak.GearImage. +Image=ah.TextureId end end)y=false return Spawn(function()while I()do wait(0.03) +end for ax=1,#G do if G[ax]~='empty'then h.Position=UDim2.new(0.5,-60,1,-108)if +e then h.Visible=true j.Visible=true end end end end)end local ah ah=function(ai +)if not ai:IsA'Tool'or not ai:IsA'HopperBin'then return end local aj for ak=1,#F +do if F[ak]and F[ak]==ai then return end if not F[ak]then aj=ak end end if aj +then F[aj]=ai elseif#F<1 then F[1]=ai else F[#F+1]=ai end end local ai ai= +function()local aj=c:GetChildren()for ak=1,#aj do if aj[ak]:IsA'Frame'then aj[ak +].BackgroundTransparency=0.5 local al=tonumber(string.sub(aj[ak].Name,5))if al== +0 then al=10 end if f.AbsoluteSize.Y<=320 then aj[ak]:TweenPosition(UDim2.new(0, +(al-1)*60,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)else aj[ +ak]:TweenPosition(UDim2.new((al-1)/10,0,0,0),Enum.EasingDirection.Out,Enum. +EasingStyle.Quad,0.25,true)end end end end local aj aj=function()local ak,al,am= +c:GetChildren(),{},nil for an=1,#ak do if ak[an]:IsA'Frame'then if#ak[an]: +GetChildren()>0 then if ak[an].Name=='Slot0'then am=ak[an]else table.insert(al, +ak[an])end end ak[an].BackgroundTransparency=1 end end if am then table.insert( +al,am)end local an=(1-(#al*0.1))/2 for ao=1,#al do if f.AbsoluteSize.Y<=320 then +an=0.5-(#al*0.333)/2 al[ao]:TweenPosition(UDim2.new(an+(ao-1)*0.33,0,0,0),Enum. +EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)else al[ao]:TweenPosition( +UDim2.new(an+((ao-1)*0.1),0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad, +0.25,true)end end end local ak ak=function()H=true if u then return ai()end end +local al al=function()if not u then return aj()end end local am am=function()if +x~=nil then x:disconnect()end x=nil x=n.Backpack.ChildAdded:connect(function(an) +if not E then E=true if e then h.Visible=true j.Visible=true end end ag(an) +return ah(an)end)end local an an=function(ao)ag(ao,true)return ah(ao)end local +ao ao=function()c.Visible=true end local ap ap=function()c.Visible=false end +local aq aq=function(ar)u=ar if ar then return ak()else return al()end end local +ar ar=function(as,at)if as==Enum.CoreGuiType.Backpack or as==Enum.CoreGuiType. +All then h.Visible=at j.Visible=at e=at if at then L()else M()end end if as== +Enum.CoreGuiType.Health or as==Enum.CoreGuiType.All then return m(game.Players. +LocalPlayer.PlayerGui,at)end end L()pcall(function()ar(Enum.CoreGuiType.Backpack +,Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))ar(Enum. +CoreGuiType.Health,Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health)) +return Game.StarterGui.CoreGuiChangedSignal:connect(ar)end)wait()a(n,'Backpack') +b(n,'Character')delay(1,function()local as=n.Backpack:GetChildren()local at=math +.min(10,#as)for au=1,at do if e then h.Visible=true j.Visible=true end ag(as[au] +,false)end return am()end)delay(2,function()if not H then if f.AbsoluteSize.Y<= +320 then local as=c:GetChildren()for at=1,#as do local au=tonumber(string.sub(as +[at].Name,5,string.len(as[at].Name)))if type(au)=='number'then as[at].Position= +UDim2.new(0,(au-1)*60,0,0)end end end end return wait(0.25)end)n.ChildAdded: +connect(function(as)if as:IsA'PlayerGui'then return l(as)end end)b(n,'Character' +)for as,at in ipairs(n.Character:GetChildren())do an(at)end w=n.Character. +ChildAdded:connect(function(au)return an(au)end)a(n.Character,'Humanoid')local +au=n.Character.Humanoid.Died:connect(function()do local au=humanoidDiedCon if au +~=nil then au:disconnect()end end humanoidDiedCon=nil ap()if x~=nil then x: +disconnect()end x=nil H=false end)n.CharacterRemoving:connect(function()for av=1 +,#G do if G[av]~='empty'then G[av].Parent=nil G[av]='empty'end end end)n. +CharacterAdded:connect(function()b(game.Players,'LocalPlayer')n=game.Players. +LocalPlayer a(n,'Backpack')delay(1,function()local av=n.Backpack:GetChildren() +local aw=math.min(10,#av)for ax=1,aw do if e then h.Visible=true j.Visible=true +end ag(av[ax],false)end return am()end)ao()if w~=nil then w:disconnect()end w=n. +Character.ChildAdded:connect(function(av)return ag(av,true)end)a(n.Character, +'Humanoid')if i.Visible then r:Fire()end au=n.Character.Humanoid.Died:connect( +function()if e then h.Visible=false j.Visible=false end E=false ap()if au~=nil +then au:disconnect()end au=nil if x~=nil then x:disconnect()end x=nil end)a(n, +'PlayerGui')l(n.PlayerGui)return delay(2,function()if(not H)and(f.AbsoluteSize.Y +<=320)then local av=c:GetChildren()for aw=1,#av do local ax=tonumber(string.sub( +av[aw].Name,5,string.len(av[aw].Name)))if type(ax)=='number'then av[aw].Position +=UDim2.new(0,(ax-1)*60,0,0)end end end return wait(0.25)end)end)a(p,'SwapSlot')p +.SwapSlot.Changed:connect(function()if p.SwapSlot.Value then local av=p.SwapSlot +local aw=av.Slot.Value if aw==0 then aw=10 end if G[aw]then J(G[aw],false)end if +av.GearButton.Value then ag(av.GearButton.Value.GearReference.Value,false,aw)end +p.SwapSlot.Value=false end end)game:GetService'GuiService'.KeyPressed:connect( +function(av)if N()then return W(av)end end)r.Event:connect(ak)s.Event:connect(aj +)return t.Event:connect(function(av)return aq(av==d)end) \ No newline at end of file diff --git a/processed/59002209.lua b/processed/59002209.lua index a1a2186..524ef3c 100644 --- a/processed/59002209.lua +++ b/processed/59002209.lua @@ -1 +1 @@ -return print("[Mercury]: Loaded corescript 59002209") +return print'[Mercury]: Loaded corescript 59002209' \ No newline at end of file diff --git a/processed/60595411.lua b/processed/60595411.lua index 7faa3bb..f70334e 100644 --- a/processed/60595411.lua +++ b/processed/60595411.lua @@ -1,731 +1,165 @@ -print("[Mercury]: Loaded corescript 60595411") -local t = { } -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local assert = assert -local Null -Null = function() - return Null -end -local StringBuilder = { - buffer = { } -} -StringBuilder.New = function(self) - local o = setmetatable({ }, self) - self.__index = self - o.buffer = { } - return o -end -StringBuilder.Append = function(self, s) - do - local _obj_0 = self.buffer - _obj_0[#_obj_0 + 1] = s - end -end -StringBuilder.ToString = function(self) - return table.concat(self.buffer) -end -local JsonWriter = { - backslashes = { - ["\b"] = "\\b", - ["\t"] = "\\t", - ["\n"] = "\\n", - ["\f"] = "\\f", - ["\r"] = "\\r", - ['"'] = '\\"', - ["\\"] = "\\\\", - ["/"] = "\\/" - } -} -JsonWriter.New = function(self) - local o = setmetatable({ }, self) - o.writer = StringBuilder:New() - self.__index = self - return o -end -JsonWriter.Append = function(self, s) - return self.writer:Append(s) -end -JsonWriter.ToString = function(self) - return self.writer:ToString() -end -JsonWriter.Write = function(self, o) - local _exp_0 = type(o) - if "nil" == _exp_0 then - return self:WriteNil() - elseif "boolean" == _exp_0 or "number" == _exp_0 then - return self:WriteString(o) - elseif "string" == _exp_0 then - return self:ParseString(o) - elseif "table" == _exp_0 then - return self:WriteTable(o) - elseif "function" == _exp_0 then - return self:WriteFunction(o) - elseif "thread" == _exp_0 or "userdata" == _exp_0 then - return self:WriteError(o) - end -end -JsonWriter.WriteNil = function(self) - return self:Append("null") -end -JsonWriter.WriteString = function(self, o) - return self:Append(tostring(o)) -end -JsonWriter.ParseString = function(self, s) - self:Append('"') - self:Append(string.gsub(s, '[%z%c\\"/]', function(n) - local c = self.backslashes[n] - if c then - return c - end - return string.format("\\u%.4X", string.byte(n)) - end)) - return self:Append('"') -end -JsonWriter.IsArray = function(self, t) - local count = 0 - local isindex - isindex = function(k) - if type(k) == "number" and k > 0 and math.floor(k) == k then - return true - end - return false - end - for k, _ in pairs(t) do - if not isindex(k) then - return false, "{", "}" - else - count = math.max(count, k) - end - end - return true, "[", "]", count -end -JsonWriter.WriteTable = function(self, t) - local ba, st, et, n = self:IsArray(t) - self:Append(st) - if ba then - for i = 1, n do - self:Write(t[i]) - if i < n then - self:Append(",") - end - end - else - local first = true - for k, v in pairs(t) do - if not first then - self:Append(",") - end - first = false - self:ParseString(k) - self:Append(":") - self:Write(v) - end - end - return self:Append(et) -end -JsonWriter.WriteError = function(self, o) - return error(string.format("Encoding of %s unsupported", tostring(o))) -end -JsonWriter.WriteFunction = function(self, o) - if o == Null then - return self:WriteNil() - else - return self:WriteError(o) - end -end -local StringReader = { - s = "", - i = 0 -} -StringReader.New = function(self, s) - local o = setmetatable({ }, self) - self.__index = self - o.s = s or o.s - return o -end -StringReader.Peek = function(self) - local i = self.i + 1 - if i <= #self.s then - return string.sub(self.s, i, i) - end - return nil -end -StringReader.Next = function(self) - self.i = self.i + 1 - if self.i <= #self.s then - return string.sub(self.s, self.i, self.i) - end - return nil -end -StringReader.All = function(self) - return self.s -end -local JsonReader = { - escapes = { - ["t"] = "\t", - ["n"] = "\n", - ["f"] = "\f", - ["r"] = "\r", - ["b"] = "\b" - } -} -JsonReader.New = function(self, s) - local o = setmetatable({ }, self) - o.reader = StringReader:New(s) - self.__index = self - return o -end -JsonReader.Read = function(self) - self:SkipWhiteSpace() - local peek = self:Peek() - if not (peek ~= nil) then - return error(string.format("Nil string: '%s'", self:All())) - elseif peek == "{" then - return self:ReadObject() - 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 - return self:ReadTrue() - elseif peek == "f" then - return self:ReadFalse() - elseif peek == "n" then - return self:ReadNull() - elseif peek == "/" then - self:ReadComment() - return self:Read() - else - return nil - end -end -JsonReader.ReadTrue = function(self) - self:TestReservedWord({ - 't', - 'r', - 'u', - 'e' - }) - return true -end -JsonReader.ReadFalse = function(self) - self:TestReservedWord({ - 'f', - 'a', - 'l', - 's', - 'e' - }) - return false -end -JsonReader.ReadNull = function(self) - self:TestReservedWord({ - 'n', - 'u', - 'l', - 'l' - }) - return nil -end -JsonReader.TestReservedWord = function(self, t) - for _, v in ipairs(t) do - if self:Next() ~= v then - error(string.format("Error reading '%s': %s", table.concat(t), self:All())) - end - end -end -JsonReader.ReadNumber = function(self) - 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 not (result ~= nil) then - return error(string.format("Invalid number: '%s'", result)) - else - return result - end -end -JsonReader.ReadString = function(self) - local result = "" - assert(self:Next() == '"') - while self:Peek() ~= '"' do - local ch = self:Next() - if ch == "\\" then - ch = self:Next() - if self.escapes[ch] then - ch = self.escapes[ch] - end - end - result = result .. ch - end - assert(self:Next() == '"') - local fromunicode - fromunicode = function(m) - return string.char(tonumber(m, 16)) - end - return string.gsub(result, "u%x%x(%x%x)", fromunicode) -end -JsonReader.ReadComment = function(self) - assert(self:Next() == "/") - local second = self:Next() - if second == "/" then - return self:ReadSingleLineComment() - elseif second == "*" then - return self:ReadBlockComment() - else - return error(string.format("Invalid comment: %s", self:All())) - end -end -JsonReader.ReadBlockComment = function(self) - local done = false - while not done do - 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 - end - return self:Next() -end -JsonReader.ReadSingleLineComment = function(self) - local ch = self:Next() - while ch ~= "\r" and ch ~= "\n" do - ch = self:Next() - end -end -JsonReader.ReadArray = function(self) - local result = { } - assert(self:Next() == "[") - local done = false - if self:Peek() == "]" then - done = true - end - while not done do - local item = self:Read() - result[#result + 1] = item - self:SkipWhiteSpace() - 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)) - end - end - end - assert("]" == self:Next()) - return result -end -JsonReader.ReadObject = function(self) - local result = { } - assert(self:Next() == "{") - local done = false - 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)) - end - self:SkipWhiteSpace() - local ch = self:Next() - 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 - done = true - end - if not done then - ch = self:Next() - if ch ~= "," then - error(string.format("Invalid array: '%s' near: '%s'", self:All(), ch)) - end - end - end - assert(self:Next() == "}") - return result -end -JsonReader.SkipWhiteSpace = function(self) - local p = self:Peek() - while (p ~= nil) and string.find(p, "[%s/]") do - if p == "/" then - self:ReadComment() - else - self:Next() - end - p = self:Peek() - end -end -JsonReader.Peek = function(self) - return self.reader:Peek() -end -JsonReader.Next = function(self) - return self.reader:Next() -end -JsonReader.All = function(self) - return self.reader:All() -end -local Encode -Encode = function(o) - local _with_0 = JsonWriter:New() - _with_0:Write(o) - _with_0:ToString() - return _with_0 -end -local Decode -Decode = function(s) - local _with_0 = JsonReader:New(s) - _with_0:Read() - return _with_0 -end -t.DecodeJSON = function(jsonString) -pcall(function() - return warn('RbxUtility.DecodeJSON is deprecated, please use Game:GetService("HttpService"):JSONDecode() instead.') - end) - if type(jsonString) == "string" then - return Decode(jsonString) - end - print("RbxUtil.DecodeJSON expects string argument!") - return nil -end -t.EncodeJSON = function(jsonTable) -pcall(function() - return warn('RbxUtility.EncodeJSON is deprecated, please use Game:GetService("HttpService"):JSONEncode() instead.') - end) - return Encode(jsonTable) -end -t.MakeWedge = function(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 - assert(regionToSelect) - assert(color) - if not type(regionToSelect) == "Region3" then - 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)) - end - local GetCell = terrain.GetCell - local WorldToCellPreferSolid = terrain.WorldToCellPreferSolid - local CellCenterToWorld = terrain.CellCenterToWorld - local emptyMaterial = Enum.CellMaterial.Empty - local selectionContainer = New("Model", "SelectionContainer", { - Archivable = false, - Parent = (function() - if selectionParent then - return selectionParent - else - return game.Workspace - end - end)() - }) - local updateSelection - local currentKeepAliveTag - local aliveCounter = 0 - local lastRegion - local adornments = { } - local reusableAdorns = { } - local selectionPart = New("Part", "SelectionPart", { - Transparency = 1, - Anchored = true, - Locked = true, - CanCollide = false, - Size = Vector3.new(4.2, 4.2, 4.2) - }) - local selectionBox = Instance.new("SelectionBox") - local createAdornment - createAdornment = function(theColor) - local selectionPartClone - local selectionBoxClone - if #reusableAdorns > 0 then - selectionPartClone = reusableAdorns[1]["part"] - selectionBoxClone = reusableAdorns[1]["box"] - table.remove(reusableAdorns, 1) - selectionBoxClone.Visible = true - else - selectionPartClone = selectionPart:Clone() - selectionPartClone.Archivable = false - selectionBoxClone = selectionBox:Clone() - selectionBoxClone.Archivable = false - selectionBoxClone.Adornee = selectionPartClone - selectionBoxClone.Parent = selectionContainer - selectionBoxClone.Adornee = selectionPartClone - selectionBoxClone.Parent = selectionContainer - end - if theColor then - selectionBoxClone.Color = theColor - end - return selectionPartClone, selectionBoxClone - end - local cleanUpAdornments - cleanUpAdornments = function() - for cellPos, adornTable in pairs(adornments) do - if adornTable.KeepAlive ~= currentKeepAliveTag then - adornTable.SelectionBox.Visible = false - table.insert(reusableAdorns, { - part = adornTable.SelectionPart, - box = adornTable.SelectionBox - }) - adornments[cellPos] = nil - end - end - end - local incrementAliveCounter - incrementAliveCounter = function() - aliveCounter = aliveCounter + 1 - if aliveCounter > 1000000 then - aliveCounter = 0 - end - return aliveCounter - end - local adornFullCellsInRegion - adornFullCellsInRegion = function(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 cellPosBegin = WorldToCellPreferSolid(terrain, regionBegin) - local cellPosEnd = WorldToCellPreferSolid(terrain, regionEnd) - currentKeepAliveTag = incrementAliveCounter() - for y = cellPosBegin.y, cellPosEnd.y do - 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 updated = false - for cellPosAdorn, adornTable in pairs(adornments) do - if cellPosAdorn == cellPos then - adornTable.KeepAlive = currentKeepAliveTag - if color then - adornTable.SelectionBox.Color = color - end - updated = true - break - end - end - if not updated then - local selectionPart, selectionBox - selectionPart, selectionBox = createAdornment(color) - selectionPart.Size = Vector3.new(4, 4, 4) - selectionPart.CFrame = CFrame.new(cframePos) - local adornTable = { - SelectionPart = selectionPart, - SelectionBox = selectionBox, - KeepAlive = currentKeepAliveTag - } - adornments[cellPos] = adornTable - end - end - end - end - end - return cleanUpAdornments() - end - lastRegion = regionToSelect - if selectEmptyCells then - local selectionPart, selectionBox - selectionPart, selectionBox = createAdornment(color) - selectionPart.Size = regionToSelect.Size - selectionPart.CFrame = regionToSelect.CFrame - 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 - end - else - adornFullCellsInRegion(regionToSelect, color) - updateSelection = function(newRegion, color) - if newRegion and newRegion ~= lastRegion then - lastRegion = newRegion - return adornFullCellsInRegion(newRegion, color) - end - end - end - local destroyFunc - destroyFunc = function() - updateSelection = nil - if selectionContainer ~= nil then - selectionContainer:Destroy() - end - adornments = nil - end - return updateSelection, destroyFunc -end -t.CreateSignal = function() - local this = { } - local mBindableEvent = Instance.new("BindableEvent") - local mAllCns = { } - this.connect = function(self, 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 " .. tostring(type(func)), 2) - end - local cn = mBindableEvent.Event:connect(func) - mAllCns[cn] = true - local pubCn = { } - pubCn.disconnect = function(self) - cn:disconnect() - mAllCns[cn] = nil - end - pubCn.Disconnect = pubCn.disconnect - return pubCn - end - this.disconnect = function(self) - 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 - this.wait = function(self) - if self ~= this then - error("wait must be called with `:`, not `.`", 2) - end - return mBindableEvent.Event:wait() - end - this.fire = function(self, ...) - if self ~= this then - error("fire must be called with `:`, not `.`", 2) - end - return mBindableEvent:Fire(...) - end - this.Connect = this.connect - this.Disconnect = this.disconnect - this.Wait = this.wait - this.Fire = this.fire - return this -end -local Create_PrivImpl -Create_PrivImpl = function(objectType) - if type(objectType) ~= "string" then - error("Argument of Create must be a string", 2) - end - return function(dat) - dat = dat or { } - local obj = Instance.new(objectType) - local parent - local ctor - for k, v in pairs(dat) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - 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: " .. tostring(type(v)), 2) - end - v.Parent = obj - elseif type(k) == "table" and k.__eventname then - if type(v) ~= "function" then - error("Bad entry in Create body: Key `[Create.E'" .. tostring(k.__eventname) .. "']` must have a function value, got: " .. tostring(v), 2) - end - obj[k.__eventname]:connect(v) - 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) - elseif ctor then - 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) - end - end - if ctor ~= nil then - ctor(obj) - end - if parent then - obj.Parent = parent - end - return obj - end -end -t.Create = setmetatable({ }, { - ["__call"] = function(_, ...) - return Create_PrivImpl(...) - end -}) -t.Create.E = function(eventName) - return { - __eventname = eventName - } -end -t.Help = function(funcNameOrFunc) - if "DecodeJSON" == funcNameOrFunc or t.DecodeJSON == funcNameOrFunc then - return "Function DecodeJSON. " .. "Arguments: (string). " .. "Side effect: returns a table with all parsed JSON values" - elseif "EncodeJSON" == funcNameOrFunc or t.EncodeJSON == funcNameOrFunc then - return "Function EncodeJSON. " .. "Arguments: (table). " .. "Side effect: returns a string composed of argument table in JSON data format" - elseif "MakeWedge" == funcNameOrFunc or t.MakeWedge == funcNameOrFunc 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 " - elseif "SelectTerrainRegion" == funcNameOrFunc or t.SelectTerrainRegion == funcNameOrFunc 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" - elseif "CreateSignal" == funcNameOrFunc or t.CreateSignal == funcNameOrFunc 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')." - elseif "Signal:connect" == funcNameOrFunc 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|." - elseif "Signal:wait" == funcNameOrFunc 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." - elseif "Signal:fire" == funcNameOrFunc 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." - elseif "Signal:disconnect" == funcNameOrFunc 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." - elseif "Create" == funcNameOrFunc 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 -return t +print'[Mercury]: Loaded corescript 60595411'local a,b={},nil b=function(c,d,e)if +not(e~=nil)then e=d d=nil end local f=Instance.new(c)if d then f.Name=d end +local g for h,i in pairs(e)do if type(h)=='string'then if h=='Parent'then g=i +else f[h]=i end elseif type(h)=='number'and type(i)=='userdata'then i.Parent=f +end end f.Parent=g return f end local c,d=assert,nil d=function()return d end +local e={buffer={}}e.New=function(f)local g=setmetatable({},f)f.__index=f g. +buffer={}return g end e.Append=function(f,g)do local h=f.buffer h[#h+1]=g end +end e.ToString=function(f)return table.concat(f.buffer)end local f={backslashes= +{['\b']='\\b',['\t']='\\t',['\n']='\\n',['\f']='\\f',['\r']='\\r',['"']='\\"',[ +'\\']='\\\\',['/']='\\/'}}f.New=function(g)local h=setmetatable({},g)h.writer=e: +New()g.__index=g return h end f.Append=function(g,h)return g.writer:Append(h)end +f.ToString=function(g)return g.writer:ToString()end f.Write=function(g,h)local i +=type(h)if'nil'==i then return g:WriteNil()elseif'boolean'==i or'number'==i then +return g:WriteString(h)elseif'string'==i then return g:ParseString(h)elseif +'table'==i then return g:WriteTable(h)elseif'function'==i then return g: +WriteFunction(h)elseif'thread'==i or'userdata'==i then return g:WriteError(h)end +end f.WriteNil=function(g)return g:Append'null'end f.WriteString=function(g,h) +return g:Append(tostring(h))end f.ParseString=function(g,h)g:Append'"'g:Append( +string.gsub(h,'[%z%c\\"/]',function(i)local j=g.backslashes[i]if j then return j +end return string.format('\\u%.4X',string.byte(i))end))return g:Append'"'end f. +IsArray=function(g,h)local i,j=0,nil j=function(k)if type(k)=='number'and k>0 +and math.floor(k)==k then return true end return false end for k,l in pairs(h)do +if not j(k)then return false,'{','}'else i=math.max(i,k)end end return true,'[', +']',i end f.WriteTable=function(g,h)local i,j,k,l=g:IsArray(h)g:Append(j)if i +then for m=1,l do g:Write(h[m])if m0 then E=z[1]['part'] +F=z[1]['box']table.remove(z,1)F.Visible=true else E=A:Clone()E.Archivable=false +F=B:Clone()F.Archivable=false F.Adornee=E F.Parent=t F.Adornee=E F.Parent=t end +if D then F.Color=D end return E,F end local D D=function()for E,F in pairs(y)do +if F.KeepAlive~=v then F.SelectionBox.Visible=false table.insert(z,{part=F. +SelectionPart,box=F.SelectionBox})y[E]=nil end end end local E E=function()w=w+1 +if w>1000000 then w=0 end return w end local F F=function(G,H)local I,J=G.CFrame +.p-G.Size/2+Vector3.new(2,2,2),G.CFrame.p+G.Size/2-Vector3.new(2,2,2)local K,L= +q(o,I),q(o,J)v=E()for M=K.y,L.y do for N=K.z,L.z do for O=K.x,L.x do local P=p(o +,O,M,N)if P~=s then local Q,R,S=r(o,O,M,N),Vector3int16.new(O,M,N),false for T,U +in pairs(y)do if T==R then U.KeepAlive=v if H then U.SelectionBox.Color=H end S= +true break end end if not S then local V,W V,W=C(H)V.Size=Vector3.new(4,4,4)V. +CFrame=CFrame.new(Q)local X={SelectionPart=V,SelectionBox=W,KeepAlive=v}y[R]=X +end end end end end return D()end x=k if m then local G,H G,H=C(l)G.Size=k.Size +G.CFrame=k.CFrame y.SelectionPart=G y.SelectionBox=H u=function(I,J)if I and I~= +x then x=I G.Size=I.Size G.CFrame=I.CFrame end if J then H.Color=J end end else +F(k,l)u=function(G,H)if G and G~=x then x=G return F(G,H)end end end local G G= +function()u=nil if t~=nil then t:Destroy()end y=nil end return u,G end a. +CreateSignal=function()local k,l,m={},Instance.new'BindableEvent',{}k.connect= +function(n,o)if n~=k then error('connect must be called with `:`, not `.`',2)end +if type(o)~='function'then error( +'Argument #1 of connect must be a function, got a '..tostring(type(o)),2)end +local p=l.Event:connect(o)m[p]=true local q={}q.disconnect=function(r)p: +disconnect()m[p]=nil end q.Disconnect=q.disconnect return q end k.disconnect= +function(n)if n~=k then error('disconnect must be called with `:`, not `.`',2) +end for o,p in pairs(m)do o:disconnect()m[o]=nil end end k.wait=function(n)if n +~=k then error('wait must be called with `:`, not `.`',2)end return l.Event: +wait()end k.fire=function(n,...)if n~=k then error( +'fire must be called with `:`, not `.`',2)end return l:Fire(...)end k.Connect=k. +connect k.Disconnect=k.disconnect k.Wait=k.wait k.Fire=k.fire return k end local +k k=function(l)if type(l)~='string'then error( +'Argument of Create must be a string',2)end return function(m)m=m or{}local n,o, +p=Instance.new(l),nil,nil for q,r in pairs(m)do if type(q)=='string'then if q== +'Parent'then o=r else n[q]=r end elseif type(q)=='number'then if type(r)~= +'userdata'then error( +[[Bad entry in Create body: Numeric keys must be paired with children, got a: ]] +..tostring(type(r)),2)end r.Parent=n elseif type(q)=='table'and q.__eventname +then if type(r)~='function'then error( +"Bad entry in Create body: Key `[Create.E'"..tostring(q.__eventname).. +"']` must have a function value, got: "..tostring(r),2)end n[q.__eventname]: +connect(r)elseif q==a.Create then if type(r)~='function'then error( +[[Bad entry in Create body: Key `[Create]` should be paired with a constructor function, got: ]] +..tostring(r),2)elseif p then error( +[[Bad entry in Create body: Only one constructor function is allowed]],2)end p=r +else error('Bad entry ('..tostring(q)..' => '..tostring(r)..') in Create body',2 +)end end if p~=nil then p(n)end if o then n.Parent=o end return n end end a. +Create=setmetatable({},{['__call']=function(l,...)return k(...)end})a.Create.E= +function(l)return{__eventname=l}end a.Help=function(l)if'DecodeJSON'==l or a. +DecodeJSON==l then return +[[Function DecodeJSON. Arguments: (string). Side effect: returns a table with all parsed JSON values]] +elseif'EncodeJSON'==l or a.EncodeJSON==l then return +[[Function EncodeJSON. Arguments: (table). Side effect: returns a string composed of argument table in JSON data format]] +elseif'MakeWedge'==l or a.MakeWedge==l 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 ]] +elseif'SelectTerrainRegion'==l or a.SelectTerrainRegion==l 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]] +elseif'CreateSignal'==l or a.CreateSignal==l 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 inLua 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').]] +elseif'Signal:connect'==l 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|.]] +elseif'Signal:wait'==l 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.]] +elseif'Signal:fire'==l 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.]] +elseif'Signal:disconnect'==l 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.]] +elseif'Create'==l 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 return a \ No newline at end of file diff --git a/processed/60595695.lua b/processed/60595695.lua index fe34147..a6368be 100644 --- a/processed/60595695.lua +++ b/processed/60595695.lua @@ -1,22 +1,8 @@ -print("[Mercury]: Loaded corescript 60595695") -local deepakTestingPlace = 3569749 -local sc = game:GetService("ScriptContext") -local tries = 0 -while not (sc or tries > 2) do - tries = tries + 1 - sc = game:GetService("ScriptContext") - wait(0.2) -end -if sc then - sc:RegisterLibrary("Libraries/RbxGui", "45284430") - sc:RegisterLibrary("Libraries/RbxGear", "45374389") - if game.PlaceId == deepakTestingPlace then - sc:RegisterLibrary("Libraries/RbxStatus", "52177566") - end - sc:RegisterLibrary("Libraries/RbxUtility", "60595411") - sc:RegisterLibrary("Libraries/RbxStamper", "73157242") - sc:LibraryRegistrationComplete() -else - print("failed to find script context, libraries did not load") -end -return sc +print'[Mercury]: Loaded corescript 60595695'local a,b,c=3569749,game:GetService +'ScriptContext',0 while not(b or c>2)do c=c+1 b=game:GetService'ScriptContext' +wait(0.2)end if b then b:RegisterLibrary('Libraries/RbxGui','45284430')b: +RegisterLibrary('Libraries/RbxGear','45374389')if game.PlaceId==a then b: +RegisterLibrary('Libraries/RbxStatus','52177566')end b:RegisterLibrary( +'Libraries/RbxUtility','60595411')b:RegisterLibrary('Libraries/RbxStamper', +'73157242')b:LibraryRegistrationComplete()else print +'failed to find script context, libraries did not load'end return b \ No newline at end of file diff --git a/processed/73157242.lua b/processed/73157242.lua index 8a6fce3..bf088cc 100644 --- a/processed/73157242.lua +++ b/processed/73157242.lua @@ -1,1945 +1,482 @@ -print("[Mercury]: Loaded corescript 73157242") -local t = { } -local PlaneIntersection -PlaneIntersection = function(vectorPos) - local hit = false - local currCamera = game.Workspace.CurrentCamera - local startPos - do - local _with_0 = currCamera.CoordinateFrame.p - startPos = Vector3.new(_with_0.X, _with_0.Y, _with_0.Z) - end - 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 - t = normal:Dot(p3 - startPos) / startEndDot - if t >= 0 and t <= 1 then - local intersection = ((endPos - startPos) * t) + startPos - cellPos = game.Workspace.Terrain:WorldToCell(intersection) - hit = true - end - end - return cellPos, hit -end -local GetTerrainForMouse -GetTerrainForMouse = function(mouse) - local cell = game.Workspace.Terrain:WorldToCellPreferSolid(Vector3.new(mouse.hit.x, mouse.hit.y, mouse.hit.z)) - local planeLoc - if 0 == game.Workspace.Terrain:GetCell(cell.X, cell.Y, cell.Z).Value then - cell = nil - local hit - planeLoc, hit = PlaneIntersection(Vector3.new(mouse.hit.x, mouse.hit.y, mouse.hit.z)) - if hit then - cell = planeLoc - end - end - return cell -end -local insertBoundingBoxOverlapVector = Vector3.new(0.3, 0.3, 0.3) -local rotatePartAndChildren -rotatePartAndChildren = function(part, rotCF, offsetFromOrigin) - if part:IsA("BasePart") then - part.CFrame = (rotCF * (part.CFrame - offsetFromOrigin)) + offsetFromOrigin - end - local partChildren = part:GetChildren() - for c = 1, #partChildren do - rotatePartAndChildren(partChildren[c], rotCF, offsetFromOrigin) - end -end -local modelRotate -modelRotate = function(model, yAngle) - local rotCF = CFrame.Angles(0, yAngle, 0) - local offsetFromOrigin = model:GetModelCFrame().p - return rotatePartAndChildren(model, rotCF, offsetFromOrigin) -end -local collectParts -collectParts = function(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 - end - for _, child in pairs(object:GetChildren()) do - collectParts(child, baseParts, scripts, decals) - end -end -local clusterPartsInRegion -clusterPartsInRegion = function(startVector, endVector) - local cluster = game.Workspace:FindFirstChild("Terrain") - local startCell = cluster:WorldToCell(startVector) - local endCell = cluster:WorldToCell(endVector) - local startX = startCell.X - local startY = startCell.Y - local startZ = startCell.Z - local endX = endCell.X - 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 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 - end - end - end - return false -end -local findSeatsInModel -findSeatsInModel = function(parent, seatTable) - if not parent then - return - end - if parent.className == "Seat" or parent.className == "VehicleSeat" then - table.insert(seatTable, parent) - end - local myChildren = parent:GetChildren() - for j = 1, #myChildren do - findSeatsInModel(myChildren[j], seatTable) - end -end -local setSeatEnabledStatus -setSeatEnabledStatus = function(model, isEnabled) - local seatList = { } - findSeatsInModel(model, seatList) - if isEnabled then - for i = 1, #seatList do - local nextSeat = seatList[i]:FindFirstChild("SeatWeld") - while nextSeat do - nextSeat:Remove() - nextSeat = seatList[i]:FindFirstChild("SeatWeld") - end - end - else - for i = 1, #seatList do - local fakeWeld = Instance.new("Weld") - fakeWeld.Name = "SeatWeld" - fakeWeld.Parent = seatList[i] - end - end -end -local autoAlignToFace -autoAlignToFace = function(parts) - local aatf = parts:FindFirstChild("AutoAlignToFace") - if aatf then - return aatf.Value - else - return false - end -end -local getClosestAlignedWorldDirection -getClosestAlignedWorldDirection = function(aVector3InWorld) - 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 - if math.abs(xDot) > math.abs(yDot) and math.abs(xDot) > math.abs(zDot) then - if xDot > 0 then - return 0 - else - return 3 - end - elseif math.abs(yDot) > math.abs(xDot) and math.abs(yDot) > math.abs(zDot) then - if yDot > 0 then - return 1 - else - return 4 - end - else - if zDot > 0 then - return 2 - else - return 5 - end - end -end -local positionPartsAtCFrame3 -positionPartsAtCFrame3 = function(aCFrame, currentParts) - local insertCFrame - 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 - currentParts.CFrame = aCFrame - end - return currentParts -end -local calcRayHitTime -calcRayHitTime = function(rayStart, raySlope, intersectionPlane) - if math.abs(raySlope) < 0.01 then - return 0 - end - return (intersectionPlane - rayStart) / raySlope -end -local modelTargetSurface -modelTargetSurface = function(partOrModel, rayStart, rayEnd) - if not partOrModel then - return 0 - end - local modelCFrame, modelSize - if partOrModel:IsA("Model") then - modelCFrame = partOrModel:GetModelCFrame() - modelSize = partOrModel:GetModelSize() - else - modelCFrame = partOrModel.CFrame - modelSize = partOrModel.Size - end - local mouseRayStart = modelCFrame:pointToObjectSpace(rayStart) - local mouseRayEnd = modelCFrame:pointToObjectSpace(rayEnd) - local mouseSlope = mouseRayEnd - mouseRayStart - 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 - 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 - if xHitTime > yHitTime then - if xHitTime > zHitTime then - hitFace = 1 * xPositive - else - hitFace = 3 * zPositive - end - else - if yHitTime > zHitTime then - hitFace = 2 * yPositive - else - hitFace = 3 * zPositive - end - end - return hitFace -end -local getBoundingBox2 -getBoundingBox2 = function(partOrModel) - 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 - minVec = Vector3.new(-2, -2, -2) - maxVec = Vector3.new(2, 2, 2) - elseif partOrModel:IsA("BasePart") then - minVec = -0.5 * partOrModel.Size - maxVec = -minVec - else - maxVec = partOrModel:GetModelSize() * 0.5 - minVec = -maxVec - end - local justifyValue = partOrModel:FindFirstChild("Justification") - if (justifyValue ~= nil) then - local justify = justifyValue.Value - local two = Vector3.new(2, 2, 2) - local actualBox = maxVec - minVec - Vector3.new(0.01, 0.01, 0.01) - local containingGridBox = Vector3.new(4 * math.ceil(actualBox.x / 4), 4 * math.ceil(actualBox.y / 4), 4 * math.ceil(actualBox.z / 4)) - local adjustment = containingGridBox - actualBox - minVec = minVec - (0.5 * adjustment * justify) - maxVec = maxVec + (0.5 * adjustment * (two - justify)) - end - return minVec, maxVec -end -local getBoundingBoxInWorldCoordinates -getBoundingBoxInWorldCoordinates = function(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 - local vec1 = partOrModel.CFrame:pointToWorldSpace(-0.5 * partOrModel.Size) - local 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 not partOrModel:IsA("Terrain") then - local vec1 = partOrModel:GetModelCFrame():pointToWorldSpace(-0.5 * partOrModel:GetModelSize()) - local vec2 = partOrModel:GetModelCFrame():pointToWorldSpace(0.5 * partOrModel:GetModelSize()) - 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)) - end - return minVec, maxVec -end -local getTargetPartBoundingBox -getTargetPartBoundingBox = function(targetPart) - return getBoundingBox2((function() - if (targetPart.Parent:FindFirstChild("RobloxModel") ~= nil) then - return targetPart.Parent - else - return targetPart - end - end)()) -end -local getMouseTargetCFrame -getMouseTargetCFrame = function(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 - else - return targetPart.CFrame - end -end -local isBlocker -isBlocker = function(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 - return isBlocker(part.Parent) -end -local spaceAboveCharacter -spaceAboveCharacter = function(charTorso, newTorsoY, stampData) - local partsAboveChar = game.Workspace:FindPartsInRegion3(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 - end - 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 findConfigAtMouseTarget -findConfigAtMouseTarget = function(Mouse, stampData) - if not Mouse then - return - end - if not stampData then - return error("findConfigAtMouseTarget: stampData is nil") - end - if not stampData["CurrentParts"] then - return - end - local grid = 4.0 - local admissibleConfig = false - 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 - insertCFrame = stampData.CurrentParts:GetModelCFrame() - else - insertCFrame = stampData.CurrentParts.CFrame - end - if Mouse then - if stampData.CurrentParts:IsA("Tool") then - Mouse.TargetFilter = stampData.CurrentParts.Handle - else - Mouse.TargetFilter = stampData.CurrentParts - end - end - local hitPlane = false - local targetPart - local success = pcall(function() - targetPart = Mouse.Target - end) - if not success 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 - if nil == targetPart then - cellPos = GetTerrainForMouse(Mouse) - if nil == cellPos then - hitPlane = false - return admissibleConfig, targetConfig - else - targetPart = game.Workspace.Terrain - hitPlane = true - cellPos = Vector3.new(cellPos.X - 1, cellPos.Y, cellPos.Z) - mouseHitInWorld = game.Workspace.Terrain:CellCenterToWorld(cellPos.x, cellPos.y, cellPos.z) - end - end - local minBBTarget, maxBBTarget - minBBTarget, maxBBTarget = getTargetPartBoundingBox(targetPart) - local diagBBTarget = maxBBTarget - minBBTarget - local targetCFrame = getMouseTargetCFrame(targetPart) - 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) - if Mouse then - targetVectorInWorld = targetPart.CFrame:vectorToWorldSpace(Vector3.FromNormalId(Mouse.TargetSurface)) - end - local targetRefPointInTarget, insertRefPointInInsert - local clampToSurface - 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) - 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) - 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) - 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) - 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) - else - targetRefPointInTarget = targetCFrame:vectorToObjectSpace(Vector3.new(1, -1, -1)) - insertRefPointInInsert = insertCFrame:vectorToObjectSpace(Vector3.new(1, -1, 1)) - 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)) - 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)) - deltaClamped = deltaClamped * clampToSurface - local targetTouchInTarget = deltaClamped + targetRefPointInTarget - local TargetTouchRelToWorld = targetCFrame:pointToWorldSpace(targetTouchInTarget) - local InsertTouchInWorld = insertCFrame:vectorToWorldSpace(insertRefPointInInsert) - local posInsertOriginInWorld = TargetTouchRelToWorld - InsertTouchInWorld - local _, _, _, R00, R01, R02, R10, R11, R12, R20, R21, R22 - _, _, _, 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) - admissibleConfig = true - return admissibleConfig, targetConfig, getClosestAlignedWorldDirection(targetVectorInWorld) -end -local truncateToCircleEighth -truncateToCircleEighth = function(bigValue, littleValue) - local big = math.abs(bigValue) - local little = math.abs(littleValue) - 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 frac > 0.382683432 then - return 0.707106781 * hypotenuse * bigSign, 0.707106781 * hypotenuse * littleSign - else - return hypotenuse * bigSign, 0 - end -end -local saveTheWelds -saveTheWelds = function(object, manualWeldTable, manualWeldParentTable) - if object:IsA("ManualWeld") or object:IsA("Rotate") then - table.insert(manualWeldTable, object) - return table.insert(manualWeldParentTable, object.Parent) - else - local children = object:GetChildren() - for i = 1, #children do - saveTheWelds(children[i], manualWeldTable, manualWeldParentTable) - end - end -end -local restoreTheWelds -restoreTheWelds = function(manualWeldTable, manualWeldParentTable) - for i = 1, #manualWeldTable do - manualWeldTable[i].Parent = manualWeldParentTable[i] - end -end -t.CanEditRegion = function(partOrModel, EditRegion) - if not EditRegion then - return true, false - end - local minBB, maxBB - 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 - 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 - end - return true, false -end -t.GetStampModel = function(assetId, terrainShape, useAssetVersionId) - if assetId == 0 then - return nil, "No Asset" - end - if assetId < 0 then - return nil, "Negative Asset" - end - local UnlockInstances - UnlockInstances = function(object) - if object:IsA("BasePart") then - object.Locked = false - end - for _, child in pairs(object:GetChildren()) do - UnlockInstances(child) - end - end - local getClosestColorToTerrainMaterial - getClosestColorToTerrainMaterial = function(terrainValue) - return BrickColor.new((function() - if 1 == terrainValue then - return "Bright green" - elseif 2 == terrainValue then - return "Bright yellow" - elseif 3 == terrainValue then - return "Bright red" - elseif 4 == terrainValue then - return "Sand red" - elseif 5 == terrainValue then - return "Black" - elseif 6 == terrainValue then - return "Dark stone grey" - elseif 7 == terrainValue then - return "Sand blue" - elseif 8 == terrainValue then - return "Deep orange" - elseif 9 == terrainValue then - return "Dark orange" - elseif 10 == terrainValue then - return "Reddish brown" - elseif 11 == terrainValue then - return "Light orange" - elseif 12 == terrainValue then - return "Light stone grey" - elseif 13 == terrainValue then - return "Sand green" - elseif 14 == terrainValue then - return "Medium stone grey" - elseif 15 == terrainValue then - return "Really red" - elseif 16 == terrainValue then - return "Really blue" - elseif 17 == terrainValue then - return "Bright blue" - else - return "Bright green" - end - end)()) - end - local setupFakeTerrainPart - setupFakeTerrainPart = function(cellMat, cellType, cellOrient) - local newTerrainPiece - 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" - newTerrainPiece.TopSurface = "Smooth" - newTerrainPiece.BrickColor = getClosestColorToTerrainMaterial(cellMat) - 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 == 3 then - 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") - materialTag.Value = Vector3.new(cellMat, cellType, cellOrient) - materialTag.Name = "ClusterMaterial" - materialTag.Parent = newTerrainPiece - return newTerrainPiece - end - local root - local loader - local loading = true - if useAssetVersionId then - loader = coroutine.create(function() - root = game:GetService("InsertService"):LoadAssetVersion(assetId) - loading = false - end) - coroutine.resume(loader) - else - loader = coroutine.create(function() - root = game:GetService("InsertService"):LoadAsset(assetId) - loading = false - end) - coroutine.resume(loader) - end - local lastGameTime = 0 - local totalTime = 0 - local maxWait = 8 - while loading and totalTime < maxWait do - lastGameTime = tick() - wait(1) - totalTime = totalTime + (tick() - lastGameTime) - end - loading = false - if totalTime >= maxWait then - return nil, "Load Time Fail" - end - if root == nil then - return nil, "Load Asset Fail" - end - if not root:IsA("Model") then - return nil, "Load Type Fail" - end - local instances = root:GetChildren() - if #instances == 0 then - return nil, "Empty Model Fail" - end - UnlockInstances(root) - root = root:GetChildren()[1] - for _, 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 _, child in pairs(lightingService:GetChildren()) do - if child:IsA("Sky") then - child:Remove() - end - end - instance.Parent = lightingService - return - end - end - if not (root:FindFirstChild("RobloxModel") ~= nil) then - local stringTag = Instance.new("BoolValue") - stringTag.Name = "RobloxModel" - stringTag.Parent = root - if not (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 - local autowedgeTag = Instance.new("BoolValue") - autowedgeTag.Name = "AutoWedge" - autowedgeTag.Parent = root - else - local clusterTag = root:FindFirstChild("ClusterMaterial") - if clusterTag then - if clusterTag:IsA("Vector3Value") then - root = setupFakeTerrainPart(clusterTag.Value.X, terrainShape, clusterTag.Value.Z) - else - root = setupFakeTerrainPart(clusterTag.Value, terrainShape, 0) - end - else - root = setupFakeTerrainPart(1, terrainShape, 0) - end - end - end - end - 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 - 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 - end - if not Mouse then - 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 - end - local stampInModel - local allowedStampRegion - local stampFailedFunc - if StampInModel then - 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") - return nil - end - stampFailedFunc = StampFailedFunc - stampInModel = StampInModel - allowedStampRegion = AllowedStampRegion - end - local gInitial90DegreeRotations = 0 - local stampData - local mouseTarget - local errorBox = Instance.new("SelectionBox") - errorBox.Color = BrickColor.new("Bright red") - errorBox.Transparency = 0 - errorBox.Archivable = false - 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") - adorn.Adornee = adornPart - adorn.Visible = true - adorn.Transparency = 0 - adorn.Name = "HighScalabilityStamperLine" - adorn.Archivable = false - local HighScalabilityLine = { } - HighScalabilityLine.Start = nil - HighScalabilityLine.End = nil - HighScalabilityLine.Adorn = adorn - HighScalabilityLine.AdornPart = adornPart - HighScalabilityLine.InternalLine = nil - HighScalabilityLine.NewHint = true - 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 - 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 isMegaClusterPart - isMegaClusterPart = function() - 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 DoHighScalabilityRegionSelect - DoHighScalabilityRegionSelect = function() - 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 - local line2 = Vector3.new(0, 0, 0) - local line3 = Vector3.new(0, 0, 0) - if HighScalabilityLine.Dimensions == 1 then - line = (HighScalabilityLine.End - HighScalabilityLine.Start) - if math.abs(line.X) < math.abs(line.Y) then - if math.abs(line.X) < math.abs(line.Z) then - local newY, newZ - if math.abs(line.Y) > math.abs(line.Z) then - newY, newZ = truncateToCircleEighth(line.Y, line.Z) - else - newZ, newY = truncateToCircleEighth(line.Z, line.Y) - end - line = Vector3.new(0, newY, newZ) - else - local newY, newX - newY, newX = truncateToCircleEighth(line.Y, line.X) - line = Vector3.new(newX, newY, 0) - end - else - if math.abs(line.Y) < math.abs(line.Z) then - local newX, newZ - if math.abs(line.X) > math.abs(line.Z) then - newX, newZ = truncateToCircleEighth(line.X, line.Z) - else - newZ, newX = truncateToCircleEighth(line.Z, line.X) - end - line = Vector3.new(newX, 0, newZ) - else - local newX, newY - 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] - line2 = line2 - (line.unit * line.unit:Dot(line2)) - local tempCFrame = CFrame.new(HighScalabilityLine.Start, HighScalabilityLine.Start + line) - 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) - if math.abs(yComp) > math.abs(xComp) then - line2 = line2 - (xAxis * xComp) - else - line2 = line2 - (yAxis * yComp) - end - HighScalabilityLine.InternalLine = line2 - elseif HighScalabilityLine.Dimensions == 3 then - line = HighScalabilityLine.MoreLines[1] - line2 = HighScalabilityLine.MoreLines[2] - line3 = HighScalabilityLine.End - HighScalabilityLine.MorePoints[2] - line3 = line3 - (line.unit * line.unit:Dot(line3)) - line3 = line3 - (line2.unit * line2.unit:Dot(line3)) - HighScalabilityLine.InternalLine = line3 - end - local tempCFrame = CFrame.new(HighScalabilityLine.Start, HighScalabilityLine.Start + line) - if HighScalabilityLine.Dimensions == 1 then - 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) - 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) - end - local gui - 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) or HighScalabilityLine.Dimensions > 1 then - HighScalabilityLine.Adorn.Parent = gui - end - end - end - if not (gui ~= nil) then - gui = game:GetService("CoreGui") - if (HighScalabilityLine.Dimensions == 1 and line.magnitude > 3) or HighScalabilityLine.Dimensions > 1 then - HighScalabilityLine.Adorn.Parent = gui - end - end - end - local DoStamperMouseMove - DoStamperMouseMove = function(Mouse) - if not Mouse then - 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") - return - end - if not Mouse.Target then - local cellPos = GetTerrainForMouse(Mouse) - if nil == cellPos then - return - end - end - if not stampData then - return - end - local configFound, targetCFrame, targetSurface = findConfigAtMouseTarget(Mouse, stampData) - if not configFound then - error("RbxStamper.DoStamperMouseMove No configFound, returning") - return - end - local numRotations = 0 - if autoAlignToFace(stampData.CurrentParts) and targetSurface ~= 1 and targetSurface ~= 4 then - 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 - local ry = math.pi / 2 - gInitial90DegreeRotations = gInitial90DegreeRotations + numRotations - if stampData.CurrentParts:IsA("Model") or stampData.CurrentParts:IsA("Tool") then - modelRotate(stampData.CurrentParts, ry * numRotations) - else - stampData.CurrentParts.CFrame = CFrame.fromEulerAnglesXYZ(0, ry * numRotations, 0)({ - stampData.CurrentParts.CFrame - }) - end - local minBB, maxBB - minBB, maxBB = getBoundingBoxInWorldCoordinates(stampData.CurrentParts) - local currModelCFrame - if stampData.CurrentParts:IsA("Model") then - currModelCFrame = stampData.CurrentParts:GetModelCFrame() - else - currModelCFrame = stampData.CurrentParts.CFrame - end - minBB = minBB + (targetCFrame.p - currModelCFrame.p) - maxBB = maxBB + (targetCFrame.p - currModelCFrame.p) - if clusterPartsInRegion(minBB + insertBoundingBoxOverlapVector, maxBB - insertBoundingBoxOverlapVector) then - if lastTarget.CFrame then - if stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) then - local theClusterMaterial = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) - if theClusterMaterial:IsA("Vector3Value") then - local stampClusterMaterial = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) - if stampClusterMaterial then - stampClusterMaterial = clusterMat - end - end - end - end - return - end - if isMegaClusterPart() then - local cellToStamp = game.Workspace.Terrain:WorldToCell(targetCFrame.p) - local newCFramePosition = game.Workspace.Terrain:CellCenterToWorld(cellToStamp.X, cellToStamp.Y, cellToStamp.Z) - local _, _, _, R00, R01, R02, R10, R11, R12, R20, R21, R22 - _, _, _, 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) - end - positionPartsAtCFrame3(targetCFrame, stampData.CurrentParts) - lastTarget.CFrame = targetCFrame - if stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) then - local clusterMat = stampData.CurrentParts:FindFirstChild("ClusterMaterial", true) - if clusterMat:IsA("Vector3Value") then - lastTarget.TerrainOrientation = clusterMat.Value.Z - end - end - 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") - 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 - local hitFace = 0 - if modelInfo then - hitFace = modelTargetSurface(modelInfo.Parent, game.Workspace.CurrentCamera.CoordinateFrame.p, Mouse.Hit.p) - end - for bf in string.gmatch(breakingFaces, "[^,]+") do - if hitFace == tonumber(bf) then - unstampableSurface = true - game.JointsService:ClearJoinAfterMoveJoints() - return - end - end - hitFace = modelTargetSurface(stampData.CurrentParts, Mouse.Hit.p, game.Workspace.CurrentCamera.CoordinateFrame.p) - for bf in string.gmatch(myBreakingFaces, "[^,]+") do - if hitFace == tonumber(bf) then - unstampableSurface = true - game.JointsService:ClearJoinAfterMoveJoints() - return - end - end - end - end - unstampableSurface = false - game.JointsService:SetJoinAfterMoveInstance(stampData.CurrentParts) - if (not pcall(function() - if Mouse and Mouse.Target and not (Mouse.Target.Parent:FindFirstChild("RobloxModel") ~= nil) then - return - else - return - end - end)) then - error("Error: RbxStamper.DoStamperMouseMove Mouse is nil on second check") - game.JointsService:ClearJoinAfterMoveJoints() - Mouse = nil - return - end - if Mouse and Mouse.Target and not (Mouse.Target.Parent:FindFirstChild("RobloxModel") ~= nil) then - game.JointsService:SetJoinAfterMoveTarget(Mouse.Target) - else - game.JointsService:SetJoinAfterMoveTarget(nil) - end - game.JointsService:ShowPermissibleJoints() - if isMegaClusterPart() and HighScalabilityLine and HighScalabilityLine.Start then - return DoHighScalabilityRegionSelect() - end - end - local setupKeyListener - setupKeyListener = function(key, Mouse) - if control and control["Paused"] then - return - end - key = string.lower(key) - if key == "r" and not autoAlignToFace(stampData.CurrentParts) then - gInitial90DegreeRotations = gInitial90DegreeRotations + 1 - 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) - end - local ry = math.pi / 2 - if stampData.CurrentParts:IsA("Model") or stampData.CurrentParts:IsA("Tool") then - modelRotate(stampData.CurrentParts, ry) - else - stampData.CurrentParts.CFrame = CFrame.fromEulerAnglesXYZ(0, ry, 0) * stampData.CurrentParts.CFrame - end - local configFound, targetCFrame = findConfigAtMouseTarget(Mouse, stampData) - if configFound then - positionPartsAtCFrame3(targetCFrame, stampData.CurrentParts) - return DoStamperMouseMove(Mouse) - end - elseif key == "c" then - 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 - HighScalabilityLine.NewHint = true - end - end - end - keyCon = Mouse.KeyDown:connect(function(key) - return setupKeyListener(key, Mouse) - end) - local resetHighScalabilityLine - resetHighScalabilityLine = function() - if HighScalabilityLine then - HighScalabilityLine.Start = nil - HighScalabilityLine.End = nil - HighScalabilityLine.InternalLine = nil - HighScalabilityLine.NewHint = true - end - end - local flashRedBox - flashRedBox = function() - local gui = game.CoreGui - if game:FindFirstChild("Players") then - if game.Players["LocalPlayer"] then - if game.Players.LocalPlayer:FindFirstChild("PlayerGui") then - gui = game.Players.LocalPlayer.PlayerGui - end - end - end - if not stampData["ErrorBox"] then - return - end - stampData.ErrorBox.Parent = gui - if stampData.CurrentParts:IsA("Tool") then - stampData.ErrorBox.Adornee = stampData.CurrentParts.Handle - else - stampData.ErrorBox.Adornee = stampData.CurrentParts - end - return delay(0, function() - for _ = 1, 3 do - if stampData["ErrorBox"] then - stampData.ErrorBox.Visible = true - end - wait(0.13) - if stampData["ErrorBox"] then - stampData.ErrorBox.Visible = false - end - wait(0.13) - end - if stampData["ErrorBox"] then - stampData.ErrorBox.Adornee = nil - stampData.ErrorBox.Parent = Tool - end - end) - end - local DoStamperMouseDown - DoStamperMouseDown = function(Mouse) - if not Mouse then - 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") - return - end - if not stampData then - return - end - if isMegaClusterPart() then - if Mouse and HighScalabilityLine then - local megaCube = stampData.CurrentParts:FindFirstChild("MegaClusterCube", true) - local terrain = game.Workspace.Terrain - if megaCube then - HighScalabilityLine.Dimensions = 1 - local tempCell = terrain:WorldToCell(megaCube.CFrame.p) - HighScalabilityLine.Start = terrain:CellCenterToWorld(tempCell.X, tempCell.Y, tempCell.Z) - return - else - HighScalabilityLine.Dimensions = 1 - local tempCell = terrain:WorldToCell(stampData.CurrentParts.CFrame.p) - HighScalabilityLine.Start = terrain:CellCenterToWorld(tempCell.X, tempCell.Y, tempCell.Z) - return - end - end - end - end - local loadSurfaceTypes - loadSurfaceTypes = function(part, surfaces) - part.TopSurface = surfaces[1] - part.BottomSurface = surfaces[2] - part.LeftSurface = surfaces[3] - part.RightSurface = surfaces[4] - part.FrontSurface = surfaces[5] - part.BackSurface = surfaces[6] - return part - end - local saveSurfaceTypes - saveSurfaceTypes = function(part, myTable) - local tempTable = { } - tempTable[1] = part.TopSurface - tempTable[2] = part.BottomSurface - tempTable[3] = part.LeftSurface - tempTable[4] = part.RightSurface - tempTable[5] = part.FrontSurface - tempTable[6] = part.BackSurface - myTable[part] = tempTable - end - local prepareModel - prepareModel = function(model) - if not model then - return nil - end - local gDesiredTrans = 0.7 - local gStaticTrans = 1 - local clone = model:Clone() - local scripts = { } - local parts = { } - local decals = { } - stampData = { } - stampData.DisabledScripts = { } - stampData.TransparencyTable = { } - stampData.MaterialTable = { } - stampData.CanCollideTable = { } - stampData.AnchoredTable = { } - stampData.ArchivableTable = { } - stampData.DecalTransparencyTable = { } - stampData.SurfaceTypeTable = { } - collectParts(clone, parts, scripts, decals) - if #parts <= 0 then - return nil, "no parts found in modelToStamp" - end - for _, script in pairs(scripts) do - if not script.Disabled then - script.Disabled = true - stampData.DisabledScripts[#stampData.DisabledScripts + 1] = script - end - end - for _, part in pairs(parts) do - stampData.TransparencyTable[part] = part.Transparency - part.Transparency = gStaticTrans + (1 - gStaticTrans) * part.Transparency - stampData.MaterialTable[part] = part.Material - part.Material = Enum.Material.Plastic - stampData.CanCollideTable[part] = part.CanCollide - part.CanCollide = false - stampData.AnchoredTable[part] = part.Anchored - part.Anchored = true - stampData.ArchivableTable[part] = part.Archivable - part.Archivable = false - saveSurfaceTypes(part, stampData.SurfaceTypeTable) - local fadeInDelayTime = 0.5 - local transFadeInTime = 0.5 - delay(0, function() - wait(fadeInDelayTime) - 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)) - 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 stampData["TransparencyTable"] and stampData.TransparencyTable[part] then - part.Transparency = gDesiredTrans + (1 - gDesiredTrans) * stampData.TransparencyTable[part] - end - end - end) - end - for _, decal in pairs(decals) do - stampData.DecalTransparencyTable[decal] = decal.Transparency - decal.Transparency = gDesiredTrans + (1 - gDesiredTrans) * decal.Transparency - end - setSeatEnabledStatus(clone, true) - setSeatEnabledStatus(clone, false) - stampData.CurrentParts = clone - if autoAlignToFace(clone) then - stampData.CurrentParts:ResetOrientationToIdentity() - gInitial90DegreeRotations = 0 - else - local ry = gInitial90DegreeRotations * math.pi / 2 - if stampData.CurrentParts:IsA("Model") or stampData.CurrentParts:IsA("Tool") then - modelRotate(stampData.CurrentParts, ry) - else - stampData.CurrentParts.CFrame = CFrame.fromEulerAnglesXYZ(0, ry, 0) * stampData.CurrentParts.CFrame - end - end - 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) - end - local configFound, targetCFrame - configFound, targetCFrame = findConfigAtMouseTarget(Mouse, stampData) - if configFound then - stampData.CurrentParts = positionPartsAtCFrame3(targetCFrame, stampData.CurrentParts) - end - game.JointsService:SetJoinAfterMoveInstance(stampData.CurrentParts) - return clone, parts - end - local checkTerrainBlockCollisions - checkTerrainBlockCollisions = function(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 skipThisCell = false - for b = 1, #cellBlockingParts do - if isBlocker(cellBlockingParts[b]) then - skipThisCell = true - break - end - end - if not skipThisCell then - local alreadyPushedUp = { } - 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 blockingPersonTorso then - 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 - skipThisCell = true - break - end - end - end - end - end - if not skipThisCell then - local canSetCell = true - if checkHighScalabilityStamp then - if allowedStampRegion then - cellPos = cellCenterToWorld(game.Workspace.Terrain, cellPos.X, cellPos.Y, cellPos.Z) - if (cellPos.X + 2 > allowedStampRegion.CFrame.p.X + allowedStampRegion.Size.X / 2) or (cellPos.X - 2 < allowedStampRegion.CFrame.p.X - allowedStampRegion.Size.X / 2) or (cellPos.Y + 2 > allowedStampRegion.CFrame.p.Y + allowedStampRegion.Size.Y / 2) or (cellPos.Y - 2 < allowedStampRegion.CFrame.p.Y - allowedStampRegion.Size.Y / 2) or (cellPos.Z + 2 > allowedStampRegion.CFrame.p.Z + allowedStampRegion.Size.Z / 2) or (cellPos.Z - 2 < allowedStampRegion.CFrame.p.Z - allowedStampRegion.Size.Z / 2) then - canSetCell = false - end - end - end - return canSetCell - end - return false - end - local ResolveMegaClusterStamp - ResolveMegaClusterStamp = function(checkHighScalabilityStamp) - local cellSet = false - local cluster = game.Workspace.Terrain - local line = HighScalabilityLine.InternalLine - local cMax = game.Workspace.Terrain.MaxExtents.Max - local cMin = game.Workspace.Terrain.MaxExtents.Min - local clusterMaterial = 1 - local clusterType = 0 - local clusterOrientation = 0 - local autoWedgeClusterParts = false - 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 - clusterType = clusterMaterial.Value.Y - clusterOrientation = clusterMaterial.Value.Z - clusterMaterial = clusterMaterial.Value.X - 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 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 + 0.5), math.floor(lines[i].Y + 0.5), math.floor(lines[i].Z + 0.5)) - 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 - local outerStepVectIndex = 1 - while outerStepVectIndex < 4 do - stepVect[2] = Vector3.new(0, 0, 0) - 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 - 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 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]) - else - cluster:SetCell(cellPos.X, cellPos.Y, cellPos.Z, clusterMaterial, clusterType, clusterOrientation) - end - cellSet = true - 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 - innerStepVectIndex = innerStepVectIndex + 1 - end - 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 - end - if stepVect[2].magnitude * 4 > lines[2].magnitude then - innerStepVectIndex = 4 - end - end - end - 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]) - end - outerStepVectIndex = outerStepVectIndex + 1 - else - 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 - HighScalabilityLine.Start = nil - HighScalabilityLine.Adorn.Parent = nil - if cellSet then - stampData.CurrentParts.Parent = nil -pcall(function() - return game:GetService("ChangeHistoryService"):SetWaypoint("StamperMulti") - end) - end - return cellSet - end - local DoStamperMouseUp - DoStamperMouseUp = function(Mouse) - if not Mouse then - 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") - return false - end - if not stampData.Dragger then - error("Error: RbxStamper.DoStamperMouseUp: stampData.Dragger is nil") - return false - end - if not HighScalabilityLine then - return false - end - local checkHighScalabilityStamp - if stampInModel then - local canStamp - local isHSLPart = isMegaClusterPart() - if isHSLPart and HighScalabilityLine and HighScalabilityLine.Start and HighScalabilityLine.InternalLine and HighScalabilityLine.InternalLine.magnitude > 0 then - canStamp = true - checkHighScalabilityStamp = true - else - canStamp, checkHighScalabilityStamp = t.CanEditRegion(stampData.CurrentParts, allowedStampRegion) - end - if not canStamp then - if stampFailedFunc then - stampFailedFunc() - end - return false - end - end - if unstampableSurface then - flashRedBox() - return false - end - local canStamp - canStamp, checkHighScalabilityStamp = t.CanEditRegion(stampData.CurrentParts, allowedStampRegion) - if not canStamp then - if stampFailedFunc then - stampFailedFunc() - end - return false - end - local minBB, maxBB - minBB, maxBB = getBoundingBoxInWorldCoordinates(stampData.CurrentParts) - local configFound, targetCFrame = findConfigAtMouseTarget(Mouse, stampData) - if configFound and not HighScalabilityLine.Adorn.Parent 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) - for b = 1, #blockingParts do - if isBlocker(blockingParts[b]) then - flashRedBox() - return false - end - end - local alreadyPushedUp = { } - 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 - if blockingPersonTorso then - 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 - flashRedBox() - return false - end - end - end - end - elseif (not configFound) and not (HighScalabilityLine.Start and HighScalabilityLine.Adorn.Parent) then - resetHighScalabilityLine() - return false - end - 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 - stampTracker.Value = true - end - end - end - end - if HighScalabilityLine.Start and HighScalabilityLine.Adorn.Parent and isMegaClusterPart() then - if ResolveMegaClusterStamp(checkHighScalabilityStamp) or checkHighScalabilityStamp then - stampData.CurrentParts.Parent = nil - return true - end - end - HighScalabilityLine.Start = nil - HighScalabilityLine.Adorn.Parent = nil - local cluster = game.Workspace.Terrain - if isMegaClusterPart() then - local cellPos - 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 - 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 waterForceTag then - 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) - 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 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 - stampData.CurrentParts.Parent = nil -pcall(function() - return game:GetService("ChangeHistoryService"):SetWaypoint("StamperSingle") - end) - return true - end - else - flashRedBox() - return false - end - end - local getPlayer - getPlayer = function() - if game:FindFirstChild("Players") then - if game.Players["LocalPlayer"] then - return game.Players.LocalPlayer - end - end - return nil - end - if stampData.CurrentParts:IsA("Model") or stampData.CurrentParts:IsA("Tool") then - if stampData.CurrentParts:IsA("Model") then - local manualWeldTable = { } - local manualWeldParentTable = { } - saveTheWelds(stampData.CurrentParts, manualWeldTable, manualWeldParentTable) - stampData.CurrentParts:BreakJoints() - stampData.CurrentParts:MakeJoints() - restoreTheWelds(manualWeldTable, manualWeldParentTable) - end - local playerIdTag = stampData.CurrentParts:FindFirstChild("PlayerIdTag") - local playerNameTag = stampData.CurrentParts:FindFirstChild("PlayerNameTag") - if (playerIdTag ~= nil) then - local tempPlayerValue = getPlayer() - if (tempPlayerValue ~= nil) then - playerIdTag.Value = tempPlayerValue.userId - end - end - if (playerNameTag ~= nil) then - if game:FindFirstChild("Players" and game.Players["LocalPlayer"]) then - local tempPlayerValue = game.Players.LocalPlayer - if (tempPlayerValue ~= nil) then - playerNameTag.Value = tempPlayerValue.Name - end - end - end - if not (stampData.CurrentParts:FindFirstChild("RobloxModel") ~= nil) then - local stringTag = Instance.new("BoolValue") - stringTag.Name = "RobloxModel" - stringTag.Parent = stampData.CurrentParts - if not (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 not (stampData.CurrentParts:FindFirstChild("RobloxStamper") ~= nil) then - local stringTag2 = Instance.new("BoolValue") - stringTag2.Name = "RobloxStamper" - stringTag2.Parent = stampData.CurrentParts - end - end - if not createJoints then - game.JointsService:CreateJoinAfterMoveJoints() - end - for part, transparency in pairs(stampData.TransparencyTable) do - part.Transparency = transparency - end - for part, archivable in pairs(stampData.ArchivableTable) do - part.Archivable = archivable - end - for part, material in pairs(stampData.MaterialTable) do - part.Material = material - end - for part, collide in pairs(stampData.CanCollideTable) do - part.CanCollide = collide - end - for part, anchored in pairs(stampData.AnchoredTable) do - part.Anchored = anchored - end - for decal, transparency in pairs(stampData.DecalTransparencyTable) do - decal.Transparency = transparency - end - for part, surfaces in pairs(stampData.SurfaceTypeTable) do - loadSurfaceTypes(part, surfaces) - end - if isMegaClusterPart() then - stampData.CurrentParts.Transparency = 0 - end - setSeatEnabledStatus(stampData.CurrentParts, true) - stampData.TransparencyTable = nil - stampData.ArchivableTable = nil - stampData.MaterialTable = nil - stampData.CanCollideTable = nil - stampData.AnchoredTable = nil - stampData.SurfaceTypeTable = nil - if not (stampData.CurrentParts:FindFirstChild("RobloxModel") ~= nil) then - local stringTag = Instance.new("BoolValue") - stringTag.Name = "RobloxModel" - stringTag.Parent = stampData.CurrentParts - end - if ghostRemovalScript then - ghostRemovalScript.Parent = nil - end - for _, script in pairs(stampData.DisabledScripts) do - script.Disabled = false - end - for _, script in pairs(stampData.DisabledScripts) do - local oldParent = script.Parent - script.Parent = nil - script:Clone().Parent = oldParent - end - stampData.DisabledScripts = nil - stampData.Dragger = nil - stampData.CurrentParts = nil -pcall(function() - return game:GetService("ChangeHistoryService"):SetWaypoint("StampedObject") - end) - return true - end - local pauseStamper - pauseStamper = function() - for i = 1, #mouseCons do - mouseCons[i]:disconnect() - mouseCons[i] = nil - end - mouseCons = { } - if stampData and stampData.CurrentParts then - stampData.CurrentParts.Parent = nil - stampData.CurrentParts:Remove() - end - resetHighScalabilityLine() - return game.JointsService:ClearJoinAfterMoveJoints() - end - local prepareUnjoinableSurfaces - prepareUnjoinableSurfaces = function(modelCFrame, parts, whichSurface) - local AXIS_VECTORS = { - Vector3.new(1, 0, 0), - Vector3.new(0, 1, 0), - Vector3.new(0, 0, 1) - } - local isPositive = 1 - if whichSurface < 0 then - isPositive = isPositive * (-1) - whichSurface = whichSurface * (-1) - end - local surfaceNormal = isPositive * modelCFrame:vectorToWorldSpace(AXIS_VECTORS[whichSurface]) - for i = 1, #parts do - local currPart = parts[i] - 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 - else - 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 - else - if surfaceNormalInLocalCoords.Z > 0 then - currPart.BackSurface = "Unjoinable" - else - currPart.FrontSurface = "Unjoinable" - end - end - end - end - end - local resumeStamper - resumeStamper = function() - local clone, parts = prepareModel(modelToStamp) - if not clone or not parts then - return - end - local unjoinableTag = clone:FindFirstChild("UnjoinableFaces", true) - if unjoinableTag then - for unjoinableSurface in string.gmatch(unjoinableTag.Value, "[^,]*") do - if tonumber(unjoinableSurface) then - if clone:IsA("Model") then - prepareUnjoinableSurfaces(clone:GetModelCFrame(), parts, tonumber(unjoinableSurface)) - else - prepareUnjoinableSurfaces(clone.CFrame, parts, tonumber(unjoinableSurface)) - end - end - end - end - stampData.ErrorBox = errorBox - if stampInModel then - clone.Parent = stampInModel - else - clone.Parent = game.Workspace - end - if clone:FindFirstChild("ClusterMaterial", true) then - local clusterMaterial = clone:FindFirstChild("ClusterMaterial", true) - 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 - cellInfo.Material = clusterMaterial.Value - end - end -pcall(function() - mouseTarget = Mouse.Target - end) - if mouseTarget and not (mouseTarget.Parent:FindFirstChild("RobloxModel") ~= nil) then - game.JointsService:SetJoinAfterMoveTarget(mouseTarget) - else - game.JointsService:SetJoinAfterMoveTarget(nil) - end - game.JointsService:ShowPermissibleJoints() - for _, object in pairs(stampData.DisabledScripts) do - if object.Name == "GhostRemovalScript" then - object.Parent = stampData.CurrentParts - end - end - stampData.Dragger = Instance.new("Dragger") - 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 - DoStamperMouseMove(Mouse) - movingLock = false - end)) - table.insert(mouseCons, Mouse.Button1Down:connect(function() - return 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)) - stamped.Value = false - end - local resetStamperState - resetStamperState = function(newModelToStamp) - 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!") - end - modelToStamp = newModelToStamp - end - pauseStamper() - return resumeStamper() - end - resetStamperState() - control.Stamped = stamped - control.Paused = false - control.LoadNewModel = function(newStampModel) - 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 - return resetStamperState(newStampModel) - end - control.ReloadModel = function() - return resetStamperState() - end - control.Pause = function() - if not control.Paused then - pauseStamper() - control.Paused = true - else - return print("RbxStamper Warning: Tried to call Control.Pause! when already paused") - end - end - control.Resume = function() - if control.Paused then - resumeStamper() - control.Paused = false - else - return print("RbxStamper Warning: Tried to call Control.Resume! without Pausing First") - end - end - control.ResetRotation = function() end - control.Destroy = function() - for i = 1, #mouseCons do - mouseCons[i]:disconnect() - mouseCons[i] = nil - end - if keyCon ~= nil then - keyCon:disconnect() - end - game.JointsService:ClearJoinAfterMoveJoints() - if adorn ~= nil then - adorn:Destroy() - end - if adornPart ~= nil then - adornPart:Destroy() - end - if errorBox ~= nil then - errorBox:Destroy() - end - if stampData ~= nil then - do - local _obj_0 = stampData.Dragger - if _obj_0 ~= nil then - _obj_0:Destroy() - end - end - end - if stampData ~= nil then - do - local _obj_0 = stampData.CurrentParts - if _obj_0 ~= nil then - _obj_0:Destroy() - end - end - end - if control and control["Stamped"] then - control.Stamped:Destroy() - end - control = nil - end - return control -end -t.Help = function(funcNameOrFunc) - if "GetStampModel" == funcNameOrFunc or t.GetStampModel == funcNameOrFunc 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" - elseif "SetupStamperDragger" == funcNameOrFunc or t.SetupStamperDragger == funcNameOrFunc 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 +print'[Mercury]: Loaded corescript 73157242'local a,b={},nil b=function(c)local +d,e,f=false,game.Workspace.CurrentCamera,nil do local g=e.CoordinateFrame.p f= +Vector3.new(g.X,g.Y,g.Z)end local g,h,i=Vector3.new(c.X,c.Y,c.Z),Vector3.new(0,1 +,0),Vector3.new(0,0,0)local j,k=h:Dot(g-f),c if j~=0 then a=h:Dot(i-f)/j if a>=0 +and a<=1 then local l=((g-f)*a)+f k=game.Workspace.Terrain:WorldToCell(l)d=true +end end return k,d end local c c=function(d)local e,f=game.Workspace.Terrain: +WorldToCellPreferSolid(Vector3.new(d.hit.x,d.hit.y,d.hit.z)),nil if 0==game. +Workspace.Terrain:GetCell(e.X,e.Y,e.Z).Value then e=nil local g f,g=b(Vector3. +new(d.hit.x,d.hit.y,d.hit.z))if g then e=f end end return e end local d,e= +Vector3.new(0.3,0.3,0.3),nil e=function(f,g,h)if f:IsA'BasePart'then f.CFrame=(g +*(f.CFrame-h))+h end local i=f:GetChildren()for j=1,#i do e(i[j],g,h)end end +local f f=function(g,h)local i,j=CFrame.Angles(0,h,0),g:GetModelCFrame().p +return e(g,i,j)end local g g=function(h,i,j,k)if h:IsA'BasePart'then i[#i+1]=h +elseif h:IsA'Script'then j[#j+1]=h elseif h:IsA'Decal'then k[#k+1]=h end for l,m +in pairs(h:GetChildren())do g(m,i,j,k)end end local h h=function(i,j)local k= +game.Workspace:FindFirstChild'Terrain'local l,m=k:WorldToCell(i),k:WorldToCell(j +)local n,o,p,q,r,s=l.X,l.Y,l.Z,m.X,m.Y,m.Z if nk.MaxExtents.Max.X then q= +k.MaxExtents.Max.X end if r>k.MaxExtents.Max.Y then r=k.MaxExtents.Max.Y end if +s>k.MaxExtents.Max.Z then s=k.MaxExtents.Max.Z end for t=n,q do for u=o,r do for +v=p,s do if k:GetCell(t,u,v).Value>0 then return true end end end end return +false end local i i=function(j,k)if not j then return end if j.className=='Seat' +or j.className=='VehicleSeat'then table.insert(k,j)end local l=j:GetChildren() +for m=1,#l do i(l[m],k)end end local j j=function(k,l)local m={}i(k,m)if l then +for n=1,#m do local o=m[n]:FindFirstChild'SeatWeld'while o do o:Remove()o=m[n]: +FindFirstChild'SeatWeld'end end else for n=1,#m do local o=Instance.new'Weld'o. +Name='SeatWeld'o.Parent=m[n]end end end local k k=function(l)local m=l: +FindFirstChild'AutoAlignToFace'if m then return m.Value else return false end +end local l l=function(m)local n,o,p=Vector3.new(1,0,0),Vector3.new(0,1,0), +Vector3.new(0,0,1)local q,r,s=m.x*n.x+m.y*n.y+m.z*n.z,m.x*o.x+m.y*o.y+m.z*o.z,m. +x*p.x+m.y*p.y+m.z*p.z if math.abs(q)>math.abs(r)and math.abs(q)>math.abs(s)then +if q>0 then return 0 else return 3 end elseif math.abs(r)>math.abs(q)and math. +abs(r)>math.abs(s)then if r>0 then return 1 else return 4 end else if s>0 then +return 2 else return 5 end end end local m m=function(n,o)local p if not o then +return o end if o and(o:IsA'Model'or o:IsA'Tool')then p=o:GetModelCFrame()o: +TranslateBy(n.p-p.p)else o.CFrame=n end return o end local n n=function(o,p,q)if +math.abs(p)<0.01 then return 0 end return(q-o)/p end local o o=function(p,q,r)if +not p then return 0 end local s,t if p:IsA'Model'then s=p:GetModelCFrame()t=p: +GetModelSize()else s=p.CFrame t=p.Size end local u,v=s:pointToObjectSpace(q),s: +pointToObjectSpace(r)local w,x,y,z=v-u,1,1,1 if w.X>0 then x=-1 end if w.Y>0 +then y=-1 end if w.Z>0 then z=-1 end local A,B,C,D=n(u.X,w.X,t.X/2*x),n(u.Y,w.Y, +t.Y/2*y),n(u.Z,w.Z,t.Z/2*z),0 if A>B then if A>C then D=1*x else D=3*z end else +if B>C then D=2*y else D=3*z end end return D end local p p=function(q)local r,s +=Vector3.new(math.huge,math.huge,math.huge),Vector3.new(-math.huge,-math.huge,- +math.huge)if q:IsA'Terrain'then r=Vector3.new(-2,-2,-2)s=Vector3.new(2,2,2) +elseif q:IsA'BasePart'then r=-0.5*q.Size s=-r else s=q:GetModelSize()*0.5 r=-s +end local t=q:FindFirstChild'Justification'if(t~=nil)then local u,v,w=t.Value, +Vector3.new(2,2,2),s-r-Vector3.new(0.01,0.01,0.01)local x=Vector3.new(4*math. +ceil(w.x/4),4*math.ceil(w.y/4),4*math.ceil(w.z/4))local y=x-w r=r-(0.5*y*u)s=s+( +0.5*y*(v-u))end return r,s end local q q=function(r)local s,t=Vector3.new(math. +huge,math.huge,math.huge),Vector3.new(-math.huge,-math.huge,-math.huge)if r:IsA +'BasePart'and not r:IsA'Terrain'then local u,v=r.CFrame:pointToWorldSpace(-0.5*r +.Size),r.CFrame:pointToWorldSpace(0.5*r.Size)s=Vector3.new(math.min(u.X,v.X), +math.min(u.Y,v.Y),math.min(u.Z,v.Z))t=Vector3.new(math.max(u.X,v.X),math.max(u.Y +,v.Y),math.max(u.Z,v.Z))elseif not r:IsA'Terrain'then local u,v=r: +GetModelCFrame():pointToWorldSpace(-0.5*r:GetModelSize()),r:GetModelCFrame(): +pointToWorldSpace(0.5*r:GetModelSize())s=Vector3.new(math.min(u.X,v.X),math.min( +u.Y,v.Y),math.min(u.Z,v.Z))t=Vector3.new(math.max(u.X,v.X),math.max(u.Y,v.Y), +math.max(u.Z,v.Z))end return s,t end local r r=function(s)return p((function()if +(s.Parent:FindFirstChild'RobloxModel'~=nil)then return s.Parent else return s +end end)())end local s s=function(t)if(t.Parent:FindFirstChild'RobloxModel'~=nil +)then if t.Parent:IsA'Tool'then return t.Parent.Handle.CFrame else return t. +Parent:GetModelCFrame()end else return t.CFrame end end local t t=function(u)if +not u then return false end if not u.Parent then return false end if u: +FindFirstChild'Humanoid'then return false end if u:FindFirstChild'RobloxStamper' +then return true end if u:IsA'Part'and not u.CanCollide then return false end if +u==game.Lighting then return false end return t(u.Parent)end local u u=function( +v,w,x)local y=game.Workspace:FindPartsInRegion3(Region3.new(Vector3.new(v. +Position.X,w,v.Position.Z)-Vector3.new(0.75,2.75,0.75),Vector3.new(v.Position.X, +w,v.Position.Z)+Vector3.new(0.75,1.75,0.75)),v.Parent,100)for z=1,#y do if y[z]. +CanCollide and not y[z]:IsDescendantOf(x.CurrentParts)then return false end end +if h(Vector3.new(v.Position.X,w,v.Position.Z)-Vector3.new(0.75,2.75,0.75), +Vector3.new(v.Position.X,w,v.Position.Z)+Vector3.new(0.75,1.75,0.75))then return +false end return true end local v v=function(w,x)if not w then return end if not +x then return error'findConfigAtMouseTarget: stampData is nil'end if not x[ +'CurrentParts']then return end local y,z,A,B,C=4,false,CFrame.new(0,0,0),p(x. +CurrentParts)local D,E=C-B,nil if x.CurrentParts:IsA'Model'or x.CurrentParts:IsA +'Tool'then E=x.CurrentParts:GetModelCFrame()else E=x.CurrentParts.CFrame end if +w then if x.CurrentParts:IsA'Tool'then w.TargetFilter=x.CurrentParts.Handle else +w.TargetFilter=x.CurrentParts end end local F,G=false,nil local H=pcall(function +()G=w.Target end)if not H then return z,A end local I=Vector3.new(0,0,0)if w +then I=Vector3.new(w.Hit.x,w.Hit.y,w.Hit.z)end local J if nil==G then J=c(w)if +nil==J then F=false return z,A else G=game.Workspace.Terrain F=true J=Vector3. +new(J.X-1,J.Y,J.Z)I=game.Workspace.Terrain:CellCenterToWorld(J.x,J.y,J.z)end end +local K,L K,L=r(G)local M,N=L-K,s(G)if G:IsA'Terrain'then if not cluster then +cluster=game.Workspace:FindFirstChild'Terrain'end local O=cluster: +WorldToCellPreferSolid(I)if F then O=J end N=CFrame.new(game.Workspace.Terrain: +CellCenterToWorld(O.x,O.y,O.z))end local O,P=N:pointToObjectSpace(I),Vector3. +new(0,0,0)if w then P=G.CFrame:vectorToWorldSpace(Vector3.FromNormalId(w. +TargetSurface))end local Q,R,S if l(P)==0 then Q=N:vectorToObjectSpace(Vector3. +new(1,-1,1))R=E:vectorToObjectSpace(Vector3.new(-1,-1,1))S=Vector3.new(0,1,1) +elseif l(P)==3 then Q=N:vectorToObjectSpace(Vector3.new(-1,-1,-1))R=E: +vectorToObjectSpace(Vector3.new(1,-1,-1))S=Vector3.new(0,1,1)elseif l(P)==1 then +Q=N:vectorToObjectSpace(Vector3.new(-1,1,1))R=E:vectorToObjectSpace(Vector3.new( +-1,-1,1))S=Vector3.new(1,0,1)elseif l(P)==4 then Q=N:vectorToObjectSpace(Vector3 +.new(-1,-1,1))R=E:vectorToObjectSpace(Vector3.new(-1,1,1))S=Vector3.new(1,0,1) +elseif l(P)==2 then Q=N:vectorToObjectSpace(Vector3.new(-1,-1,1))R=E: +vectorToObjectSpace(Vector3.new(-1,-1,-1))S=Vector3.new(1,1,0)else Q=N: +vectorToObjectSpace(Vector3.new(1,-1,-1))R=E:vectorToObjectSpace(Vector3.new(1,- +1,1))S=Vector3.new(1,1,0)end Q=Q*((0.5*M)+0.5*(L+K))R=R*((0.5*D)+0.5*(C+B))local +T=O-Q local U=Vector3.new(y*math.modf(T.x/y),y*math.modf(T.y/y),y*math.modf(T.z/ +y))U=U*S local V=U+Q local W,X=N:pointToWorldSpace(V),E:vectorToWorldSpace(R) +local Y,Z,_,aa,ab,ac,ad,ae,af,ag,ah,ai,aj=W-X,nil,nil,nil,nil,nil,nil,nil,nil, +nil,nil,nil,nil aa,aa,aa,ab,ac,ad,ae,af,ag,ah,ai,aj=E:components()A=CFrame.new(Y +.x,Y.y,Y.z,ab,ac,ad,ae,af,ag,ah,ai,aj)z=true return z,A,l(P)end local aa aa= +function(ab,ac)local ad,ae=math.abs(ab),math.abs(ac)local af=math.sqrt(ad*ad+ae* +ae)local ag,ah,ai=ae/af,1,1 if ab<0 then ah=-1 end if ac<0 then ai=-1 end if ag> +0.382683432 then return 0.707106781*af*ah,0.707106781*af*ai else return af*ah,0 +end end local ab ab=function(ac,ad,ae)if ac:IsA'ManualWeld'or ac:IsA'Rotate'then +table.insert(ad,ac)return table.insert(ae,ac.Parent)else local af=ac: +GetChildren()for ag=1,#af do ab(af[ag],ad,ae)end end end local ac ac=function(ad +,ae)for af=1,#ad do ad[af].Parent=ae[af]end end a.CanEditRegion=function(ad,ae) +if not ae then return true,false end local af,ag af,ag=q(ad)if af.Xae.CFrame.p.X+ae.Size.X/2 or ag.Y>ae. +CFrame.p.Y+ae.Size.Y/2 or ag.Z>ae.CFrame.p.Z+ae.Size.Z/2 then return false,false +end return true,false end a.GetStampModel=function(ad,ae,af)if ad==0 then return +nil,'No Asset'end if ad<0 then return nil,'Negative Asset'end local ag ag= +function(ah)if ah:IsA'BasePart'then ah.Locked=false end for ai,aj in pairs(ah: +GetChildren())do ag(aj)end end local ah ah=function(ai)return BrickColor.new(( +function()if 1==ai then return'Bright green'elseif 2==ai then return +'Bright yellow'elseif 3==ai then return'Bright red'elseif 4==ai then return +'Sand red'elseif 5==ai then return'Black'elseif 6==ai then return +'Dark stone grey'elseif 7==ai then return'Sand blue'elseif 8==ai then return +'Deep orange'elseif 9==ai then return'Dark orange'elseif 10==ai then return +'Reddish brown'elseif 11==ai then return'Light orange'elseif 12==ai then return +'Light stone grey'elseif 13==ai then return'Sand green'elseif 14==ai then return +'Medium stone grey'elseif 15==ai then return'Really red'elseif 16==ai then +return'Really blue'elseif 17==ai then return'Bright blue'else return +'Bright green'end end)())end local ai ai=function(aj,w,x)local y if w==1 or w==4 +then y=Instance.new'WedgePart'y.formFactor='Custom'elseif w==2 then y=Instance. +new'CornerWedgePart'else y=Instance.new'Part'y.formFactor='Custom'end y.Name= +'MegaClusterCube'y.Size=Vector3.new(4,4,4)y.BottomSurface='Smooth'y.TopSurface= +'Smooth'y.BrickColor=ah(aj)local z,A=0,math.pi if w==4 then z=-math.pi/2 end if +w==2 or w==3 then A=0 end y.CFrame=CFrame.Angles(0,math.pi/2*x+A,z)if w==3 then +local B=Instance.new'SpecialMesh'B.MeshType='FileMesh'B.MeshId= +'http://www.roblox.com/asset?id=66832495'B.Scale=Vector3.new(2,2,2)B.Parent=y +end local B=Instance.new'Vector3Value'B.Value=Vector3.new(aj,w,x)B.Name= +'ClusterMaterial'B.Parent=y return y end local aj,w,x=nil,nil,true if af then w= +coroutine.create(function()aj=game:GetService'InsertService':LoadAssetVersion(ad +)x=false end)coroutine.resume(w)else w=coroutine.create(function()aj=game: +GetService'InsertService':LoadAsset(ad)x=false end)coroutine.resume(w)end local +y,z,A=0,0,8 while x and z=A +then return nil,'Load Time Fail'end if aj==nil then return nil,'Load Asset Fail' +end if not aj:IsA'Model'then return nil,'Load Type Fail'end local B=aj: +GetChildren()if#B==0 then return nil,'Empty Model Fail'end ag(aj)aj=aj: +GetChildren()[1]for C,D in pairs(B)do if D:IsA'Team'then D.Parent=game: +GetService'Teams'elseif D:IsA'Sky'then local E=game:GetService'Lighting'for F,G +in pairs(E:GetChildren())do if G:IsA'Sky'then G:Remove()end end D.Parent=E +return end end if not(aj:FindFirstChild'RobloxModel'~=nil)then local E=Instance. +new'BoolValue'E.Name='RobloxModel'E.Parent=aj if not(aj:FindFirstChild +'RobloxStamper'~=nil)then local F=Instance.new'BoolValue'F.Name='RobloxStamper'F +.Parent=aj end end if ae then if aj.Name=='MegaClusterCube'then if ae==6 then +local E=Instance.new'BoolValue'E.Name='AutoWedge'E.Parent=aj else local E=aj: +FindFirstChild'ClusterMaterial'if E then if E:IsA'Vector3Value'then aj=ai(E. +Value.X,ae,E.Value.Z)else aj=ai(E.Value,ae,0)end else aj=ai(1,ae,0)end end end +end return aj end a.SetupStamperDragger=function(ad,ae,af,ag,ah)if not ad then +error +[[SetupStamperDragger: modelToStamp (first arg) is nil! Should be a stamper model]] +return nil end if not ad:IsA'Model'and not ad:IsA'BasePart'then error +[[SetupStamperDragger: modelToStamp (first arg) is neither a Model or Part!]] +return nil end if not ae then error +[[SetupStamperDragger: Mouse (second arg) is nil! Should be a mouse object]] +return nil end if not ae:IsA'Mouse'then error +[[SetupStamperDragger: Mouse (second arg) is not of type Mouse!]]return nil end +local ai,aj,w if af then if not af:IsA'Model'then error +[[SetupStamperDragger: StampInModel (optional third arg) is not of type 'Model']] +return nil end if not ag then error +[[SetupStamperDragger: AllowedStampRegion (optional fourth arg) is nil when StampInModel (optional third arg) is defined]] +return nil end w=ah ai=af aj=ag end local x,y,z,A=0,nil,nil,Instance.new +'SelectionBox'A.Color=BrickColor.new'Bright red'A.Transparency=0 A.Archivable= +false local B=Instance.new'Part'B.Parent=nil B.formFactor='Custom'B.Size=Vector3 +.new(4,4,4)B.CFrame=CFrame.new()B.Archivable=false local C=Instance.new +'SelectionBox'C.Color=BrickColor.new'Toothpaste'C.Adornee=B C.Visible=true C. +Transparency=0 C.Name='HighScalabilityStamperLine'C.Archivable=false local D={}D +.Start=nil D.End=nil D.Adorn=C D.AdornPart=B D.InternalLine=nil D.NewHint=true D +.MorePoints={nil,nil}D.MoreLines={nil,nil}D.Dimensions=1 local E,F,G,H,I,J,K={}, +false,false,false,{},nil,Instance.new'BoolValue'K.Archivable=false K.Value=false +local L={}L.TerrainOrientation=0 L.CFrame=0 local M={}M.Material=1 M.clusterType +=0 M.clusterOrientation=0 local N N=function()if not y then return false end if +not y.CurrentParts then return false end return y.CurrentParts:FindFirstChild( +'ClusterMaterial',true)or(y.CurrentParts.Name=='MegaClusterCube')end local O O= +function()local P=y.CurrentParts:FindFirstChild'MegaClusterCube'if not P then if +not y.CurrentParts.Name=='MegaClusterCube'then return else P=y.CurrentParts end +end D.End=P.CFrame.p local Q,R,S=nil,Vector3.new(0,0,0),Vector3.new(0,0,0)if D. +Dimensions==1 then Q=(D.End-D.Start)if math.abs(Q.X)math.abs(Q.Z)then T,U=aa(Q +.Y,Q.Z)else U,T=aa(Q.Z,Q.Y)end Q=Vector3.new(0,T,U)else local T,U T,U=aa(Q.Y,Q.X +)Q=Vector3.new(U,T,0)end else if math.abs(Q.Y)math.abs(Q.Z)then T,U=aa(Q.X,Q.Z)else U,T=aa(Q.Z,Q.X)end Q=Vector3 +.new(T,0,U)else local T,U T,U=aa(Q.X,Q.Y)Q=Vector3.new(T,U,0)end end D. +InternalLine=Q elseif D.Dimensions==2 then Q=D.MoreLines[1]R=D.End-D.MorePoints[ +1]R=R-(Q.unit*Q.unit:Dot(R))local T=CFrame.new(D.Start,D.Start+Q)local U,V=T: +vectorToWorldSpace(Vector3.new(0,1,0)),T:vectorToWorldSpace(Vector3.new(1,0,0)) +local W,X=V:Dot(R),U:Dot(R)if math.abs(X)>math.abs(W)then R=R-(V*W)else R=R-(U*X +)end D.InternalLine=R elseif D.Dimensions==3 then Q=D.MoreLines[1]R=D.MoreLines[ +2]S=D.End-D.MorePoints[2]S=S-(Q.unit*Q.unit:Dot(S))S=S-(R.unit*R.unit:Dot(S))D. +InternalLine=S end local T=CFrame.new(D.Start,D.Start+Q)if D.Dimensions==1 then +D.AdornPart.Size=Vector3.new(4,4,Q.magnitude+4)D.AdornPart.CFrame=T+T: +vectorToWorldSpace(Vector3.new(2,2,2)-D.AdornPart.Size/2)else local U=T: +vectorToObjectSpace(Q+R+S)D.AdornPart.Size=Vector3.new(4,4,4)+Vector3.new(math. +abs(U.X),math.abs(U.Y),math.abs(U.Z))D.AdornPart.CFrame=T+T:vectorToWorldSpace(U +/2)end local U if game.Players['LocalPlayer']then U=game.Players.LocalPlayer: +FindFirstChild'PlayerGui'if U and U:IsA'PlayerGui'then if(D.Dimensions==1 and Q. +magnitude>3)or D.Dimensions>1 then D.Adorn.Parent=U end end end if not(U~=nil) +then U=game:GetService'CoreGui'if(D.Dimensions==1 and Q.magnitude>3)or D. +Dimensions>1 then D.Adorn.Parent=U end end end local P P=function(Q)if not Q +then error'Error: RbxStamper.DoStamperMouseMove: Mouse is nil'return end if not +Q:IsA'Mouse'then error('Error: RbxStamper.DoStamperMouseMove: Mouse is of type', +Q.className,'should be of type Mouse')return end if not Q.Target then local R=c( +Q)if nil==R then return end end if not y then return end local R,S,T=v(Q,y)if +not R then error'RbxStamper.DoStamperMouseMove No configFound, returning'return +end local U=0 if k(y.CurrentParts)and T~=1 and T~=4 then if T==3 then U=0-x+k(y. +CurrentParts)elseif T==0 then U=2-x+k(y.CurrentParts)elseif T==5 then U=3-x+k(y. +CurrentParts)elseif T==2 then U=1-x+k(y.CurrentParts)end end local V=math.pi/2 x +=x+U if y.CurrentParts:IsA'Model'or y.CurrentParts:IsA'Tool'then f(y. +CurrentParts,V*U)else y.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,V*U,0){y +.CurrentParts.CFrame}end local W,X W,X=q(y.CurrentParts)local Y if y. +CurrentParts:IsA'Model'then Y=y.CurrentParts:GetModelCFrame()else Y=y. +CurrentParts.CFrame end W=W+(S.p-Y.p)X=X+(S.p-Y.p)if h(W+d,X-d)then if L.CFrame +then if y.CurrentParts:FindFirstChild('ClusterMaterial',true)then local ak=y. +CurrentParts:FindFirstChild('ClusterMaterial',true)if ak:IsA'Vector3Value'then +local al=y.CurrentParts:FindFirstChild('ClusterMaterial',true)if al then al= +clusterMat end end end end return end if N()then local ak=game.Workspace.Terrain +:WorldToCell(S.p)local al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax=game.Workspace. +Terrain:CellCenterToWorld(ak.X,ak.Y,ak.Z),nil,nil,nil,nil,nil,nil,nil,nil,nil, +nil,nil,nil ao,ao,ao,ap,aq,ar,as,at,au,av,aw,ax=S:components()S=CFrame.new(al.X, +al.Y,al.Z,ap,aq,ar,as,at,au,av,aw,ax)end m(S,y.CurrentParts)L.CFrame=S if y. +CurrentParts:FindFirstChild('ClusterMaterial',true)then local ak=y.CurrentParts: +FindFirstChild('ClusterMaterial',true)if ak:IsA'Vector3Value'then L. +TerrainOrientation=ak.Value.Z end end if Q and Q.Target and Q.Target.Parent then +local ak=Q.Target:FindFirstChild'RobloxModel'if not ak then ak=Q.Target.Parent: +FindFirstChild'RobloxModel'end local al=y.CurrentParts:FindFirstChild +'UnstampableFaces'do local ao,ap='',''if ak and ak.Parent:FindFirstChild +'UnstampableFaces'then ao=ak.Parent.UnstampableFaces.Value end if al then ap=al. +Value end local aq=0 if ak then aq=o(ak.Parent,game.Workspace.CurrentCamera. +CoordinateFrame.p,Q.Hit.p)end for ar in string.gmatch(ao,'[^,]+')do if aq== +tonumber(ar)then H=true game.JointsService:ClearJoinAfterMoveJoints()return end +end aq=o(y.CurrentParts,Q.Hit.p,game.Workspace.CurrentCamera.CoordinateFrame.p) +for as in string.gmatch(ap,'[^,]+')do if aq==tonumber(as)then H=true game. +JointsService:ClearJoinAfterMoveJoints()return end end end end H=false game. +JointsService:SetJoinAfterMoveInstance(y.CurrentParts)if(not pcall(function()if +Q and Q.Target and not(Q.Target.Parent:FindFirstChild'RobloxModel'~=nil)then +return else return end end))then error +[[Error: RbxStamper.DoStamperMouseMove Mouse is nil on second check]]game. +JointsService:ClearJoinAfterMoveJoints()Q=nil return end if Q and Q.Target and +not(Q.Target.Parent:FindFirstChild'RobloxModel'~=nil)then game.JointsService: +SetJoinAfterMoveTarget(Q.Target)else game.JointsService:SetJoinAfterMoveTarget( +nil)end game.JointsService:ShowPermissibleJoints()if N()and D and D.Start then +return O()end end local ak ak=function(al,ao)if E and E['Paused']then return end +al=string.lower(al)if al=='r'and not k(y.CurrentParts)then x=x+1 local ap=y. +CurrentParts:FindFirstChild('ClusterMaterial',true)if ap and ap:IsA +'Vector3Value'then ap.Value=Vector3.new(ap.Value.X,ap.Value.Y,(ap.Value.Z+1)%4) +end local aq=math.pi/2 if y.CurrentParts:IsA'Model'or y.CurrentParts:IsA'Tool' +then f(y.CurrentParts,aq)else y.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0, +aq,0)*y.CurrentParts.CFrame end local as,at=v(ao,y)if as then m(at,y. +CurrentParts)return P(ao)end elseif al=='c'then if D.InternalLine and D. +InternalLine.magnitude>0 and D.Dimensions<3 then D.MorePoints[D.Dimensions]=D. +End D.MoreLines[D.Dimensions]=D.InternalLine D.Dimensions=D.Dimensions+1 D. +NewHint=true end end end J=ae.KeyDown:connect(function(al)return ak(al,ae)end) +local al al=function()if D then D.Start=nil D.End=nil D.InternalLine=nil D. +NewHint=true end end local ao ao=function()local ap=game.CoreGui if game: +FindFirstChild'Players'then if game.Players['LocalPlayer']then if game.Players. +LocalPlayer:FindFirstChild'PlayerGui'then ap=game.Players.LocalPlayer.PlayerGui +end end end if not y['ErrorBox']then return end y.ErrorBox.Parent=ap if y. +CurrentParts:IsA'Tool'then y.ErrorBox.Adornee=y.CurrentParts.Handle else y. +ErrorBox.Adornee=y.CurrentParts end return delay(0,function()for aq=1,3 do if y[ +'ErrorBox']then y.ErrorBox.Visible=true end wait(0.13)if y['ErrorBox']then y. +ErrorBox.Visible=false end wait(0.13)end if y['ErrorBox']then y.ErrorBox.Adornee +=nil y.ErrorBox.Parent=Tool end end)end local ap ap=function(aq)if not aq then +error'Error: RbxStamper.DoStamperMouseDown: Mouse is nil'return end if not aq: +IsA'Mouse'then error('Error: RbxStamper.DoStamperMouseDown: Mouse is of type',aq +.className,'should be of type Mouse')return end if not y then return end if N() +then if aq and D then local as,at=y.CurrentParts:FindFirstChild( +'MegaClusterCube',true),game.Workspace.Terrain if as then D.Dimensions=1 local +au=at:WorldToCell(as.CFrame.p)D.Start=at:CellCenterToWorld(au.X,au.Y,au.Z)return +else D.Dimensions=1 local au=at:WorldToCell(y.CurrentParts.CFrame.p)D.Start=at: +CellCenterToWorld(au.X,au.Y,au.Z)return end end end end local aq aq=function(as, +at)as.TopSurface=at[1]as.BottomSurface=at[2]as.LeftSurface=at[3]as.RightSurface= +at[4]as.FrontSurface=at[5]as.BackSurface=at[6]return as end local as as=function +(at,au)local av={}av[1]=at.TopSurface av[2]=at.BottomSurface av[3]=at. +LeftSurface av[4]=at.RightSurface av[5]=at.FrontSurface av[6]=at.BackSurface au[ +at]=av end local at at=function(au)if not au then return nil end local av,aw,ax, +Q,R,S=0.7,1,au:Clone(),{},{},{}y={}y.DisabledScripts={}y.TransparencyTable={}y. +MaterialTable={}y.CanCollideTable={}y.AnchoredTable={}y.ArchivableTable={}y. +DecalTransparencyTable={}y.SurfaceTypeTable={}g(ax,R,Q,S)if#R<=0 then return nil +,'no parts found in modelToStamp'end for T,U in pairs(Q)do if not U.Disabled +then U.Disabled=true y.DisabledScripts[#y.DisabledScripts+1]=U end end for V,W +in pairs(R)do y.TransparencyTable[W]=W.Transparency W.Transparency=aw+(1-aw)*W. +Transparency y.MaterialTable[W]=W.Material W.Material=Enum.Material.Plastic y. +CanCollideTable[W]=W.CanCollide W.CanCollide=false y.AnchoredTable[W]=W.Anchored +W.Anchored=true y.ArchivableTable[W]=W.Archivable W.Archivable=false as(W,y. +SurfaceTypeTable)local X,Y=0.5,0.5 delay(0,function()wait(X)local ay=tick()local +az=ay while(az-ay)av do local aA= +1-(((az-ay)/Y)*(aw-av))if y['TransparencyTable']and y.TransparencyTable[W]then W +.Transparency=aA+(1-aA)*y.TransparencyTable[W]end wait(0.03)az=tick()end if W +and W:IsA'BasePart'then if y['TransparencyTable']and y.TransparencyTable[W]then +W.Transparency=av+(1-av)*y.TransparencyTable[W]end end end)end for ay,az in +pairs(S)do y.DecalTransparencyTable[az]=az.Transparency az.Transparency=av+(1-av +)*az.Transparency end j(ax,true)j(ax,false)y.CurrentParts=ax if k(ax)then y. +CurrentParts:ResetOrientationToIdentity()x=0 else local aA=x*math.pi/2 if y. +CurrentParts:IsA'Model'or y.CurrentParts:IsA'Tool'then f(y.CurrentParts,aA)else +y.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,aA,0)*y.CurrentParts.CFrame +end end local aA=y.CurrentParts:FindFirstChild('ClusterMaterial',true)if aA and +aA:IsA'Vector3Value'then aA.Value=Vector3.new(aA.Value.X,aA.Value.Y,(aA.Value.Z+ +x)%4)end local X,Y X,Y=v(ae,y)if X then y.CurrentParts=m(Y,y.CurrentParts)end +game.JointsService:SetJoinAfterMoveInstance(y.CurrentParts)return ax,R end local +au au=function(av,aw)local ax=game.Workspace.Terrain.CellCenterToWorld local ay= +ax(game.Workspace.Terrain,av.X,av.Y,av.Z)local az,aA=game.Workspace: +FindPartsInRegion3(Region3.new(ay-Vector3.new(2,2,2)+d,ay+Vector3.new(2,2,2)-d), +y.CurrentParts,100),false for Q=1,#az do if t(az[Q])then aA=true break end end +if not aA then local Q={}for R=1,#az do if az[R].Parent and not Q[az[R].Parent] +and az[R].Parent:FindFirstChild(az[R].Parent:FindFirstChild'Humanoid':IsA +'Humanoid')then local S=az[R].Parent:FindFirstChild'Torso'Q[az[R].Parent]=true +if S then local U=ay.Y+5 if u(S,U,y)then S.CFrame=S.CFrame+Vector3.new(0,U-S. +CFrame.p.Y,0)else aA=true break end end end end end if not aA then local Q=true +if aw then if aj then av=ax(game.Workspace.Terrain,av.X,av.Y,av.Z)if(av.X+2>aj. +CFrame.p.X+aj.Size.X/2)or(av.X-2aj.CFrame.p +.Y+aj.Size.Y/2)or(av.Y-2aj.CFrame.p.Z+aj. +Size.Z/2)or(av.Z-21)or(az +and az.magnitude>0))then local X,Y,aB,aC,aD,aE,aF,aG=game.Workspace.Terrain: +WorldToCell(D.Start),{0,0,0},{0,0,0},{0,0,0},{nil,nil,nil},{Vector3.new(0,0,0), +Vector3.new(0,0,0),Vector3.new(0,0,0)},{Vector3.new(1,0,0),Vector3.new(0,1,0), +Vector3.new(0,0,1)},{}if D.Dimensions>1 then table.insert(aG,D.MoreLines[1])end +if az and az.magnitude>0 then table.insert(aG,az)end if D.Dimensions>2 then +table.insert(aG,D.MoreLines[2])end for aH=1,#aG do aG[aH]=Vector3.new(math. +floor(aG[aH].X+0.5),math.floor(aG[aH].Y+0.5),math.floor(aG[aH].Z+0.5))if aG[aH]. +X>0 then Y[aH]=1 elseif aG[aH].X<0 then Y[aH]=-1 end if aG[aH].Y>0 then aB[aH]=1 +elseif aG[aH].Y<0 then aB[aH]=-1 end if aG[aH].Z>0 then aC[aH]=1 elseif aG[aH].Z +<0 then aC[aH]=-1 end aD[aH]=Vector3.new(Y[aH],aB[aH],aC[aH])if aD[aH].magnitude +<0.9 then aD[aH]=nil end end if not aG[2]then aG[2]=Vector3.new(0,0,0)end if not +aG[3]then aG[3]=Vector3.new(0,0,0)end local aH,aI=y.CurrentParts:FindFirstChild( +'WaterForceTag',true),y.CurrentParts:FindFirstChild('WaterForceDirectionTag', +true)while aE[3].magnitude*4<=aG[3].magnitude do local aJ=1 while aJ<4 do aE[2]= +Vector3.new(0,0,0)while aE[2].magnitude*4<=aG[2].magnitude do local aK=1 while +aK<4 do aE[1]=Vector3.new(0,0,0)while aE[1].magnitude*4<=aG[1].magnitude do +local aL=aE[1]+aE[2]+aE[3]local aM=Vector3int16.new(X.X+aL.X,X.Y+aL.Y,X.Z+aL.Z) +if aM.X>=Q.X and aM.Y>=Q.Y and aM.Z>=Q.Z and aM.XaG[2]. +magnitude then aK=4 end end end if aD[3]then while aJ<4 and aF[aJ]:Dot(aD[3])==0 +do aJ=aJ+1 end if aJ<4 then aE[3]=aE[3]+aF[aJ]*aF[aJ]:Dot(aD[3])end aJ=aJ+1 else +aE[3]=Vector3.new(1,0,0)aJ=4 end if aE[3].magnitude*4>aG[3].magnitude then aJ=4 +end end end end D.Start=nil D.Adorn.Parent=nil if ax then y.CurrentParts.Parent= +nil pcall(function()return game:GetService'ChangeHistoryService':SetWaypoint +'StamperMulti'end)end return ax end local aw aw=function(ax)if not ax then error +'Error: RbxStamper.DoStamperMouseUp: Mouse is nil'return false end if not ax:IsA +'Mouse'then error('Error: RbxStamper.DoStamperMouseUp: Mouse is of type',ax. +className,'should be of type Mouse')return false end if not y.Dragger then error +[[Error: RbxStamper.DoStamperMouseUp: stampData.Dragger is nil]]return false end +if not D then return false end local ay if ai then local az,aA=nil,N()if aA and +D and D.Start and D.InternalLine and D.InternalLine.magnitude>0 then az=true ay= +true else az,ay=a.CanEditRegion(y.CurrentParts,aj)end if not az then if w then +w()end return false end end if H then ao()return false end local az az,ay=a. +CanEditRegion(y.CurrentParts,aj)if not az then if w then w()end return false end +local aA,aB aA,aB=q(y.CurrentParts)local aC,aD=v(ax,y)if aC and not D.Adorn. +Parent then if h(aA+d,aB-d)then ao()return false end local aE=game.Workspace: +FindPartsInRegion3(Region3.new(aA+d,aB-d),y.CurrentParts,100)for aF=1,#aE do if +t(aE[aF])then ao()return false end end local aF={}for aG=1,#aE do if aE[aG]. +Parent and not aF[aE[aG].Parent]and aE[aG].Parent:FindFirstChild'Humanoid'and aE +[aG].Parent:FindFirstChild'Humanoid':IsA'Humanoid'then local aH=aE[aG].Parent: +FindFirstChild'Torso'aF[aE[aG].Parent]=true if aH then local aI=aB.Y+3 if u(aH, +aI,y)then aH.CFrame=aH.CFrame+Vector3.new(0,aI-aH.CFrame.p.Y,0)else ao()return +false end end end end elseif(not aC)and not(D.Start and D.Adorn.Parent)then al() +return false end if game:FindFirstChild'Players'then if game.Players[ +'LocalPlayer']then if game.Players.LocalPlayer['Character']then local aE=game. +Players.LocalPlayer.Character local aF=aE:FindFirstChild'StampTracker'if aF and +not aF.Value then aF.Value=true end end end end if D.Start and D.Adorn.Parent +and N()then if av(ay)or ay then y.CurrentParts.Parent=nil return true end end D. +Start=nil D.Adorn.Parent=nil local aE=game.Workspace.Terrain if N()then local aF +if y.CurrentParts:IsA'Model'then aF=aE:WorldToCell(y.CurrentParts: +GetModelCFrame().p)else aF=aE:WorldToCell(y.CurrentParts.CFrame.p)end local aG, +aH=game.Workspace.Terrain.MaxExtents.Max,game.Workspace.Terrain.MaxExtents.Min +if au(aF,false)then local aI,aJ,aK=y.CurrentParts:FindFirstChild( +'ClusterMaterial',true),y.CurrentParts:FindFirstChild('WaterForceTag',true),y. +CurrentParts:FindFirstChild('WaterForceDirectionTag',true)if aF.X>=aH.X and aF.Y +>=aH.Y and aF.Z>=aH.Z and aF.Xmath.abs(aL +.Y)then if math.abs(aL.X)>math.abs(aL.Z)then if aL.X>0 then aJ.RightSurface= +'Unjoinable'else aJ.LeftSurface='Unjoinable'end else if aL.Z>0 then aJ. +BackSurface='Unjoinable'else aJ.FrontSurface='Unjoinable'end end else if math. +abs(aL.Y)>math.abs(aL.Z)then if aL.Y>0 then aJ.TopSurface='Unjoinable'else aJ. +BottomSurface='Unjoinable'end else if aL.Z>0 then aJ.BackSurface='Unjoinable' +else aJ.FrontSurface='Unjoinable'end end end end end local az az=function()local +aA,aB=at(ad)if not aA or not aB then return end local aC=aA:FindFirstChild( +'UnjoinableFaces',true)if aC then for aD in string.gmatch(aC.Value,'[^,]*')do if +tonumber(aD)then if aA:IsA'Model'then ay(aA:GetModelCFrame(),aB,tonumber(aD)) +else ay(aA.CFrame,aB,tonumber(aD))end end end end y.ErrorBox=A if ai then aA. +Parent=ai else aA.Parent=game.Workspace end if aA:FindFirstChild( +'ClusterMaterial',true)then local aD=aA:FindFirstChild('ClusterMaterial',true)if +aD:IsA'Vector3Value'then M.Material=aD.Value.X M.clusterType=aD.Value.Y M. +clusterOrientation=aD.Value.Z elseif aD:IsA'IntValue'then M.Material=aD.Value +end end pcall(function()z=ae.Target end)if z and not(z.Parent:FindFirstChild +'RobloxModel'~=nil)then game.JointsService:SetJoinAfterMoveTarget(z)else game. +JointsService:SetJoinAfterMoveTarget(nil)end game.JointsService: +ShowPermissibleJoints()for aD,aE in pairs(y.DisabledScripts)do if aE.Name== +'GhostRemovalScript'then aE.Parent=y.CurrentParts end end y.Dragger=Instance.new +'Dragger'y.Dragger:MouseDown(aB[1],Vector3.new(0,0,0,aB))y.Dragger:MouseUp()P(ae +)table.insert(I,ae.Move:connect(function()if F or G then return end F=true P(ae) +F=false end))table.insert(I,ae.Button1Down:connect(function()return ap(ae)end)) +table.insert(I,ae.Button1Up:connect(function()G=true while F do wait()end K. +Value=aw(ae)al()G=false end))K.Value=false end local aA aA=function(aB)if aB +then if not aB:IsA'Model'and not aB:IsA'BasePart'then error +[[resetStamperState: newModelToStamp (first arg) is not nil, but not a model or part!]] +end ad=aB end ax()return az()end aA()E.Stamped=K E.Paused=false E.LoadNewModel= +function(aB)if aB and not aB:IsA'Model'and not aB:IsA'BasePart'then error +[[Control.LoadNewModel: newStampModel (first arg) is not a Model or Part!]] +return nil end return aA(aB)end E.ReloadModel=function()return aA()end E.Pause= +function()if not E.Paused then ax()E.Paused=true else return print +[[RbxStamper Warning: Tried to call Control.Pause! when already paused]]end end +E.Resume=function()if E.Paused then az()E.Paused=false else return print +[[RbxStamper Warning: Tried to call Control.Resume! without Pausing First]]end +end E.ResetRotation=function()end E.Destroy=function()for aB=1,#I do I[aB]: +disconnect()I[aB]=nil end if J~=nil then J:disconnect()end game.JointsService: +ClearJoinAfterMoveJoints()if C~=nil then C:Destroy()end if B~=nil then B: +Destroy()end if A~=nil then A:Destroy()end if y~=nil then do local aB=y.Dragger +if aB~=nil then aB:Destroy()end end end if y~=nil then do local aB=y. +CurrentParts if aB~=nil then aB:Destroy()end end end if E and E['Stamped']then E +.Stamped:Destroy()end E=nil end return E end a.Help=function(ad)if +'GetStampModel'==ad or a.GetStampModel==ad 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]] +elseif'SetupStamperDragger'==ad or a.SetupStamperDragger==ad 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 a \ No newline at end of file diff --git a/processed/89449008.lua b/processed/89449008.lua index 64677bc..8b8909f 100644 --- a/processed/89449008.lua +++ b/processed/89449008.lua @@ -1,864 +1,181 @@ -print("[Mercury]: Loaded corescript 89449008") -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local waitForChild -waitForChild = function(instance, name) - assert(instance) - assert(name) - while not instance:FindFirstChild(name) do - print("Waiting for ...", instance, name) - instance.ChildAdded:wait() - end - return instance:FindFirstChild(name) -end -local waitForProperty -waitForProperty = function(instance, property) - assert(instance) - assert(property) - while not instance[property] do - instance.Changed:wait() - end -end -local IsTouchDevice -IsTouchDevice = function() - local touchEnabled = 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 RbxGui, _ -RbxGui, _ = LoadLibrary("RbxGui") -if not RbxGui then - print("could not find RbxGui!") - return -end -local StaticTabName = "gear" -local backpack = script.Parent -local backpackItems = { } -local buttons = { } -local debounce = false -local browsingMenu = false -local mouseEnterCons = { } -local mouseClickCons = { } -local characterChildAddedCon -local characterChildRemovedCon -local backpackAddCon -local playerBackpack = waitForChild(player, "Backpack") -waitForChild(backpack, "Tabs") -waitForChild(backpack, "Gear") -local gearPreview = waitForChild(backpack.Gear, "GearPreview") -local scroller = waitForChild(backpack.Gear, "GearGridScrollingArea") -local currentLoadout = waitForChild(backpack.Parent, "CurrentLoadout") -local grid = waitForChild(backpack.Gear, "GearGrid") -local gearButton = waitForChild(grid, "GearButton") -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 scrollFrame, scrollUp, scrollDown, recalculateScroll -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.Parent = backpack.Gear.GearGrid -local scrollBar = New("Frame", "ScrollBar", { - BackgroundTransparency = 0.9, - BackgroundColor3 = Color3.new(1, 1, 1), - BorderSizePixel = 0, - Size = UDim2.new(0, 17, 1, -36), - Position = UDim2.new(0, 0, 0, 18), - Parent = scroller -}) -scrollDown.Position = UDim2.new(0, 0, 1, -17) -scrollUp.Parent = scroller -scrollDown.Parent = scroller -local scrollFrameLoadout, scrollUpLoadout, scrollDownLoadout, recalculateScrollLoadout -scrollFrameLoadout, scrollUpLoadout, scrollDownLoadout, recalculateScrollLoadout = RbxGui.CreateScrollingFrame() -scrollFrameLoadout.Position = UDim2.new(0, 0, 0, 0) -scrollFrameLoadout.Size = UDim2.new(1, 0, 1, 0) -scrollFrameLoadout.Parent = backpack.Gear.GearLoadouts.LoadoutsList -local LoadoutButton = New("TextButton", "LoadoutButton", { - RobloxLocked = true, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size14, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, 0, 32), - Style = Enum.ButtonStyle.RobloxButton, - Text = "Loadout #1", - TextColor3 = Color3.new(1, 1, 1), - Parent = scrollFrameLoadout -}) -do - local _with_0 = LoadoutButton:clone() - _with_0.Text = "Loadout #2" - _with_0.Parent = scrollFrameLoadout -end -do - local _with_0 = LoadoutButton:clone() - _with_0.Text = "Loadout #3" - _with_0.Parent = scrollFrameLoadout -end -do - local _with_0 = LoadoutButton:clone() - _with_0.Text = "Loadout #4" - _with_0.Parent = scrollFrameLoadout -end -New("Frame", "ScrollBarLoadout", { - BackgroundTransparency = 0.9, - BackgroundColor3 = Color3.new(1, 1, 1), - BorderSizePixel = 0, - Size = UDim2.new(0, 17, 1, -36), - Position = UDim2.new(0, 0, 0, 18), - Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea -}) -scrollDownLoadout.Position = UDim2.new(0, 0, 1, -17) -scrollUpLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea -scrollDownLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea -local removeFromMap -removeFromMap = function(map, object) - for i = 1, #map do - if map[i] == object then - table.remove(map, i) - break - end - end -end -local robloxLock -robloxLock = function(instance) - instance.RobloxLocked = true - local children = instance:GetChildren() - if children then - for _, child in ipairs(children) do - robloxLock(child) - end - end -end -local clearPreview -clearPreview = function() - gearPreview.GearImage.Image = "" - gearPreview.GearStats.GearName.Text = "" -end -local clearHighlight -clearHighlight = function(button) - button.TextColor3 = Color3.new(1, 1, 1) - button.BackgroundColor3 = Color3.new(0, 0, 0) -end -local inLoadout -inLoadout = function(gear) - local children = currentLoadout:GetChildren() - for i = 1, #children do - if children[i]:IsA("Frame") then - local button = children[i]:GetChildren() - if #button > 0 and button[1].GearReference.Value and button[1].GearReference.Value == gear then - return true - end - end - end - return false -end -local updateGridActive -updateGridActive = function() - for _, v in pairs(backpackItems) do - if buttons[v] then - local gear - 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 - end - end - end -end -local swapGearSlot -swapGearSlot = function(slot, gearButton) - if not swapSlot.Value then - swapSlot.Slot.Value = slot - swapSlot.GearButton.Value = gearButton - swapSlot.Value = true - return updateGridActive() - end -end -local unequipGear -unequipGear = function(physGear) - physGear.Parent = playerBackpack - return updateGridActive() -end -local UnequipGearMenuClick -UnequipGearMenuClick = function(element, menu) - if type(element.Action) ~= "number" then - return - end - local num = element.Action - if num == 1 then - unequipGear(menu.Parent.GearReference.Value) - local inventoryButton = menu.Parent - local gearToUnequip = inventoryButton.GearReference.Value - local loadoutChildren = currentLoadout:GetChildren() - local slot = -1 - for i = 1, #loadoutChildren do - 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 - break - end - end - end - return swapGearSlot(slot, nil) - end -end -local highlight -highlight = function(button) - button.TextColor3 = Color3.new(0, 0, 0) - button.BackgroundColor3 = Color3.new(0.8, 0.8, 0.8) -end -local getGearContextMenu -getGearContextMenu = function() - local gearContextMenu = New("Frame", "UnequipContextMenu", { - Active = true, - Size = UDim2.new(0, 115, 0, 70), - Position = UDim2.new(0, -16, 0, -16), - BackgroundTransparency = 1, - Visible = false - }) - local gearContextMenuButton = New("TextButton", "UnequipContextMenuButton", { - Text = "", - Style = Enum.ButtonStyle.RobloxButtonDefault, - ZIndex = 8, - Size = UDim2.new(1, 0, 1, -20), - Visible = true, - Parent = gearContextMenu - }) - local elementHeight = 12 - local contextMenuElements = { } - local contextMenuElementsName = { - "Remove Hotkey" - } - for i = 1, #contextMenuElementsName do - local element = { } - element.Type = "Button" - element.Text = contextMenuElementsName[i] - element.Action = i - element.DoIt = UnequipGearMenuClick - table.insert(contextMenuElements, element) - end - for i, contextElement in ipairs(contextMenuElements) do - local element = contextElement - if element.Type == "Button" then - local button = New("TextButton", "UnequipContextButton" .. tostring(i), { - BackgroundColor3 = Color3.new(0, 0, 0), - BorderSizePixel = 0, - TextXAlignment = Enum.TextXAlignment.Left, - Text = " " .. tostring(contextElement.Text), - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size14, - Size = UDim2.new(1, 8, 0, elementHeight), - Position = UDim2.new(0, 0, 0, elementHeight * i), - TextColor3 = Color3.new(1, 1, 1), - ZIndex = 9, - Parent = gearContextMenuButton - }) - if not IsTouchDevice() then - button.MouseButton1Click:connect(function() - if button.Active and not gearContextMenu.Parent.Active then -pcall(function() - return element.DoIt(element, gearContextMenu) - end) - browsingMenu = false - gearContextMenu.Visible = false - clearHighlight(button) - return clearPreview() - end - end) - button.MouseEnter:connect(function() - if button.Active and gearContextMenu.Parent.Active then - return highlight(button) - end - end) - button.MouseLeave:connect(function() - if button.Active and gearContextMenu.Parent.Active then - return clearHighlight(button) - end - end) - end - contextElement.Button = button - contextElement.Element = button - elseif element.Type == "Label" then - local frame = New("Frame", "ContextLabel" .. tostring(i), { - BackgroundTransparency = 1, - Size = UDim2.new(1, 8, 0, elementHeight), - New("TextLabel", "Text1", { - BackgroundTransparency = 1, - BackgroundColor3 = Color3.new(1, 1, 1), - BorderSizePixel = 0, - TextXAlignment = Enum.TextXAlignment.Left, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size14, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(0.5, 0, 1, 0), - TextColor3 = Color3.new(1, 1, 1), - ZIndex = 9 - }) - }) - element.Label1 = frame.Text1 - if element.GetText2 then - element.Label2 = New("TextLabel", "Text2", { - BackgroundTransparency = 1, - BackgroundColor3 = Color3.new(1, 1, 1), - BorderSizePixel = 0, - TextXAlignment = Enum.TextXAlignment.Right, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size14, - Position = UDim2.new(0.5, 0, 0, 0), - Size = UDim2.new(0.5, 0, 1, 0), - TextColor3 = Color3.new(1, 1, 1), - ZIndex = 9, - Parent = frame - }) - end - frame.Parent = gearContextMenuButton - element.Label = frame - element.Element = frame - end - end - gearContextMenu.ZIndex = 4 - gearContextMenu.MouseLeave:connect(function() - browsingMenu = false - gearContextMenu.Visible = false - return clearPreview() - end) - robloxLock(gearContextMenu) - return gearContextMenu -end -local findEmptySlot -findEmptySlot = function() - local smallestNum - 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 not smallestNum or (smallestNum > frameNum) then - smallestNum = frameNum - end - end - end - if smallestNum == 10 then - smallestNum = 0 - end - return smallestNum -end -local checkForSwap -checkForSwap = function(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) - return true - end - end - end - end - return false -end -local previewGear -previewGear = function(button) - if not browsingMenu then - gearPreview.Visible = false - gearPreview.GearImage.Image = button.Image - gearPreview.GearStats.GearName.Text = button.GearReference.Value.Name - end -end -local buttonClick -buttonClick = function(button) - if button:FindFirstChild("UnequipContextMenu" and not button.Active) then - button.UnequipContextMenu.Visible = true - browsingMenu = true - end -end -local resizeGrid -resizeGrid = function() - for _, 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 - buttonClone.Image = v.TextureId - if buttonClone.Image == "" then - buttonClone.GearText.Text = v.Name - end - buttonClone.GearReference.Value = v - buttonClone.Draggable = true - buttons[v] = buttonClone - if not IsTouchDevice() then - local unequipMenu = getGearContextMenu() - unequipMenu.Visible = false - unequipMenu.Parent = buttonClone - end - local beginPos - buttonClone.DragBegin:connect(function(value) - 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 - 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) - buttonClone.Draggable = false - return delay(0.5, function() - buttonClone.Draggable = true - end) - else - buttonClone.Position = beginPos - end - end - end) - local clickTime = tick() - mouseEnterCons[buttonClone] = buttonClone.MouseEnter:connect(function() - return 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) - end - else - buttonClick(buttonClone) - end - clickTime = newClickTime - end) - end - end - end - return recalculateScroll() -end -local resize -resize = function() - local size = 0.75 * (function() - if gearPreview.AbsoluteSize.Y > gearPreview.AbsoluteSize.X then - return gearPreview.AbsoluteSize.X - else - return gearPreview.AbsoluteSize.Y - end - 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) - return resizeGrid() -end -local addToGrid -addToGrid = function(child) - if not child:IsA("Tool") and not child:IsA("HopperBin") then - return - end - if child:FindFirstChild("RobloxBuildTool") then - return - end - for _, v in pairs(backpackItems) do - if v == child then - return - end - end - table.insert(backpackItems, child) - local changeCon = child.Changed:connect(function(prop) - if prop == "Name" and buttons[child] and buttons[child].Image == "" then - buttons[child].GearText.Text = child.Name - end - end) - local ancestryCon = child.AncestryChanged:connect(function(_, _) - local thisObject - for _, 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 - do - local _obj_0 = ancestryCon - if _obj_0 ~= nil then - _obj_0:disconnect() - end - end - if changeCon ~= nil then - changeCon:disconnect() - end - for _, v in pairs(backpackItems) do - if v == thisObject then - do - local _obj_0 = mouseEnterCons[buttons[v]] - if _obj_0 ~= nil then - _obj_0:disconnect() - end - end - do - local _obj_0 = mouseClickCons[buttons[v]] - if _obj_0 ~= nil then - _obj_0:disconnect() - end - end - buttons[v].Parent = nil - buttons[v] = nil - break - end - end - removeFromMap(backpackItems, thisObject) - resizeGrid() - else - resizeGrid() - end - return updateGridActive() - end) - return resizeGrid() -end -local showPartialGrid -showPartialGrid = function(subset) - for _, v in pairs(buttons) do - v.Parent = nil - end - if subset then - for _, v in pairs(subset) do - v.Parent = grid.ScrollingFrame - end - end - return recalculateScroll() -end -local showEntireGrid -showEntireGrid = function() - for _, v in pairs(buttons) do - v.Parent = grid.ScrollingFrame - end - return recalculateScroll() -end -local centerGear -centerGear = function(loadoutChildren) - local gearButtons = { } - local lastSlotAdd - for i = 1, #loadoutChildren do - 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) - end -end -local backpackOpenHandler -backpackOpenHandler = function(currentTab) - if currentTab and currentTab ~= StaticTabName then - backpack.Gear.Visible = false - return - end - backpack.Gear.Visible = true - updateGridActive() - resizeGrid() - resize() - return tellBackpackReadyFunc:Invoke() -end -local backpackCloseHandler -backpackCloseHandler = function(currentTab) - if currentTab and currentTab ~= StaticTabName then - backpack.Gear.Visible = false - return - end - backpack.Gear.Visible = false - resizeGrid() - resize() - return tellBackpackReadyFunc:Invoke() -end -local tabClickHandler -tabClickHandler = function(tabName) - if tabName == StaticTabName then - return backpackOpenHandler(tabName) - else - return backpackCloseHandler(tabName) - end -end -local loadoutCheck -loadoutCheck = function(child, selectState) - if not child:IsA("ImageButton") then - return - end - for _, v in pairs(backpackItems) do - if buttons[v] 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 - end - end - end - end -end -local setupCharacterConnections -setupCharacterConnections = function() - if backpackAddCon ~= nil then - backpackAddCon:disconnect() - end - backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) - return addToGrid(child) - end) - local backpackChildren = game.Players.LocalPlayer.Backpack:GetChildren() - for i = 1, #backpackChildren do - addToGrid(backpackChildren[i]) - end - if characterChildAddedCon ~= nil then - characterChildAddedCon:disconnect() - end - characterChildAddedCon = game.Players.LocalPlayer.Character.ChildAdded:connect(function(child) - addToGrid(child) - return updateGridActive() - end) - if characterChildRemovedCon ~= nil then - characterChildRemovedCon:disconnect() - end - characterChildRemovedCon = game.Players.LocalPlayer.Character.ChildRemoved:connect(function(_) - return updateGridActive() - end) - wait() - return centerGear(currentLoadout:GetChildren()) -end -local removeCharacterConnections -removeCharacterConnections = function() - if characterChildAddedCon ~= nil then - characterChildAddedCon:disconnect() - end - if characterChildRemovedCon ~= nil then - characterChildRemovedCon:disconnect() - end - if backpackAddCon ~= nil then - return backpackAddCon:disconnect() - end - return nil -end -local trim -trim = function(s) - return s:gsub("^%s*(.-)%s*$", "%1") -end -local filterGear -filterGear = function(terms) - local filteredGear = { } - for _, 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]) - break - end - end - end - end - return filteredGear -end -local splitByWhitespace -splitByWhitespace = function(text) - if type(text) ~= "string" then - return - end - local terms = { } - for token in string.gmatch(text, "[^%s]+") do - if string.len(token) > 0 then - table.insert(terms, token) - end - end - return terms -end -local showSearchGear -showSearchGear = function(searchTerms) - if not backpack.Gear.Visible then - return - end - local searchTermTable = splitByWhitespace(searchTerms) - local currSearchTerms - if searchTermTable and (#searchTermTable > 0) then - currSearchTerms = searchTermTable - else - currSearchTerms = nil - end - if not (searchTermTable ~= nil) then - showEntireGrid() - return - end - local filteredButtons = filterGear(currSearchTerms) - return showPartialGrid(filteredButtons) -end -local nukeBackpack -nukeBackpack = function() - while #buttons > 0 do - table.remove(buttons) - end - buttons = { } - while #backpackItems > 0 do - table.remove(backpackItems) - end - backpackItems = { } - local scrollingFrameChildren = grid.ScrollingFrame:GetChildren() - for i = 1, #scrollingFrameChildren do - scrollingFrameChildren[i]:remove() - end -end -local coreGuiChanged -coreGuiChanged = function(coreGuiType, enabled) - if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then - if not enabled then - backpack.Gear.Visible = false - end - end -end -local backpackChildren = player.Backpack:GetChildren() -for i = 1, #backpackChildren do - addToGrid(backpackChildren[i]) -end -resizeEvent.Event:connect(function(_) - if debounce then - return - end - debounce = true - wait() - resize() - resizeGrid() - debounce = false -end) -currentLoadout.ChildAdded:connect(function(child) - return loadoutCheck(child, false) -end) -currentLoadout.ChildRemoved:connect(function(child) - return loadoutCheck(child, true) -end) -currentLoadout.DescendantAdded:connect(function(descendant) - if not backpack.Visible and (descendant:IsA("ImageButton") or descendant:IsA("TextButton")) then - return centerGear(currentLoadout:GetChildren()) - end -end) -currentLoadout.DescendantRemoving:connect(function(descendant) - if not backpack.Visible and (descendant:IsA("ImageButton") or descendant:IsA("TextButton")) then - wait() - return centerGear(currentLoadout:GetChildren()) - end -end) -grid.MouseEnter:connect(function() - return clearPreview() -end) -grid.MouseLeave:connect(function() - return clearPreview() -end) -player.CharacterRemoving:connect(function() - removeCharacterConnections() - return nukeBackpack() -end) -player.CharacterAdded:connect(function() - return setupCharacterConnections() -end) -player.ChildAdded:connect(function(child) - if child:IsA("Backpack") then - playerBackpack = child - if backpackAddCon ~= nil then - backpackAddCon:disconnect() - end - backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) - return addToGrid(child) - end) - end -end) -swapSlot.Changed:connect(function() - if not swapSlot.Value then - return updateGridActive() - end -end) -local loadoutChildren = currentLoadout:GetChildren() -for i = 1, #loadoutChildren do - if loadoutChildren[i]:IsA("Frame") and string.find(loadoutChildren[i].Name, "Slot") then - loadoutChildren[i].ChildRemoved:connect(function() - return updateGridActive() - end) - loadoutChildren[i].ChildAdded:connect(function() - return updateGridActive() - end) - end -end -pcall(function() - coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)) - return Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) -end) -resize() -resizeGrid() -loadoutChildren = currentLoadout:GetChildren() -for i = 1, #loadoutChildren do - loadoutCheck(loadoutChildren[i], false) -end -if not backpack.Visible then - centerGear(currentLoadout:GetChildren()) -end -if not (characterChildAddedCon ~= nil) and game.Players.LocalPlayer["Character"] then - setupCharacterConnections() -end -if not backpackAddCon then - backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) - return addToGrid(child) - end) -end -backpackOpenEvent.Event:connect(backpackOpenHandler) -backpackCloseEvent.Event:connect(backpackCloseHandler) -tabClickedEvent.Event:connect(tabClickHandler) -searchRequestedEvent.Event:connect(showSearchGear) -return recalculateScrollLoadout() +print'[Mercury]: Loaded corescript 89449008'local a a=function(b,c,d)if not(d~= +nil)then d=c c=nil end local e=Instance.new(b)if c then e.Name=c end local f for +g,h in pairs(d)do if type(g)=='string'then if g=='Parent'then f=h else e[g]=h +end elseif type(g)=='number'and type(h)=='userdata'then h.Parent=e end end e. +Parent=f return e end local b b=function(c,d)assert(c)assert(d)while not c: +FindFirstChild(d)do print('Waiting for ...',c,d)c.ChildAdded:wait()end return c: +FindFirstChild(d)end local c c=function(d,e)assert(d)assert(e)while not d[e]do d +.Changed:wait()end end local d d=function()local e=false pcall(function()e=Game: +GetService'UserInputService'.TouchEnabled end)return e end b(game,'Players')c( +game.Players,'LocalPlayer')local e,f,g=game.Players.LocalPlayer,nil,nil f,g= +LoadLibrary'RbxGui'if not f then print'could not find RbxGui!'return end local h +,i,j,k,l,m,n,o,p,q,r,s='gear',script.Parent,{},{},false,false,{},{},nil,nil,nil, +b(e,'Backpack')b(i,'Tabs')b(i,'Gear')local t,u,v,w=b(i.Gear,'GearPreview'),b(i. +Gear,'GearGridScrollingArea'),b(i.Parent,'CurrentLoadout'),b(i.Gear,'GearGrid') +local x,y,z=b(w,'GearButton'),b(script.Parent,'SwapSlot'),b(script.Parent, +'CoreScripts/BackpackScripts/BackpackManager')local A,B,C,D,E,F,G,H,I,J=b(z, +'BackpackOpenEvent'),b(z,'BackpackCloseEvent'),b(z,'TabClickedEvent'),b(z, +'ResizeEvent'),b(z,'SearchRequestedEvent'),b(z,'BackpackReady'),nil,nil,nil,nil +G,H,I,J=f.CreateScrollingFrame(nil,'grid',Vector2.new(6,6))G.Position=UDim2.new( +0,0,0,30)G.Size=UDim2.new(1,0,1,-30)G.Parent=i.Gear.GearGrid local K=a('Frame', +'ScrollBar',{BackgroundTransparency=0.9,BackgroundColor3=Color3.new(1,1,1), +BorderSizePixel=0,Size=UDim2.new(0,17,1,-36),Position=UDim2.new(0,0,0,18),Parent +=u})I.Position=UDim2.new(0,0,1,-17)H.Parent=u I.Parent=u local L,M,N,O L,M,N,O=f +.CreateScrollingFrame()L.Position=UDim2.new(0,0,0,0)L.Size=UDim2.new(1,0,1,0)L. +Parent=i.Gear.GearLoadouts.LoadoutsList local P=a('TextButton','LoadoutButton',{ +RobloxLocked=true,Font=Enum.Font.ArialBold,FontSize=Enum.FontSize.Size14, +Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0,32),Style=Enum.ButtonStyle. +RobloxButton,Text='Loadout #1',TextColor3=Color3.new(1,1,1),Parent=L})do local Q +=P:clone()Q.Text='Loadout #2'Q.Parent=L end do local Q=P:clone()Q.Text= +'Loadout #3'Q.Parent=L end do local Q=P:clone()Q.Text='Loadout #4'Q.Parent=L end +a('Frame','ScrollBarLoadout',{BackgroundTransparency=0.9,BackgroundColor3=Color3 +.new(1,1,1),BorderSizePixel=0,Size=UDim2.new(0,17,1,-36),Position=UDim2.new(0,0, +0,18),Parent=i.Gear.GearLoadouts.GearLoadoutsScrollingArea})N.Position=UDim2. +new(0,0,1,-17)M.Parent=i.Gear.GearLoadouts.GearLoadoutsScrollingArea N.Parent=i. +Gear.GearLoadouts.GearLoadoutsScrollingArea local Q Q=function(R,S)for T=1,#R do +if R[T]==S then table.remove(R,T)break end end end local R R=function(S)S. +RobloxLocked=true local T=S:GetChildren()if T then for U,V in ipairs(T)do R(V) +end end end local S S=function()t.GearImage.Image=''t.GearStats.GearName.Text='' +end local T T=function(U)U.TextColor3=Color3.new(1,1,1)U.BackgroundColor3=Color3 +.new(0,0,0)end local U U=function(V)local W=v:GetChildren()for X=1,#W do if W[X] +:IsA'Frame'then local Y=W[X]:GetChildren()if#Y>0 and Y[1].GearReference.Value +and Y[1].GearReference.Value==V then return true end end end return false end +local V V=function()for W,X in pairs(j)do if k[X]then local Y,Z=nil,k[X]: +FindFirstChild'GearReference'if Z then Y=Z.Value end if(not Y)or U(Y)then k[X]. +Active=false else k[X].Active=true end end end end local W W=function(X,Y)if not +y.Value then y.Slot.Value=X y.GearButton.Value=Y y.Value=true return V()end end +local X X=function(Y)Y.Parent=s return V()end local Y Y=function(Z,_)if type(Z. +Action)~='number'then return end local aa=Z.Action if aa==1 then X(_.Parent. +GearReference.Value)local ab=_.Parent local ac,ad,ae=ab.GearReference.Value,v: +GetChildren(),-1 for af=1,#ad do if ad[af]:IsA'Frame'then local ag=ad[af]: +GetChildren()if ag[1]and ag[1].GearReference.Value==ac then ae=ag[1].SlotNumber. +Text break end end end return W(ae,nil)end end local aa aa=function(ab)ab. +TextColor3=Color3.new(0,0,0)ab.BackgroundColor3=Color3.new(0.8,0.8,0.8)end local +ab ab=function()local ac=a('Frame','UnequipContextMenu',{Active=true,Size=UDim2. +new(0,115,0,70),Position=UDim2.new(0,-16,0,-16),BackgroundTransparency=1,Visible +=false})local ad,ae,af,ag=a('TextButton','UnequipContextMenuButton',{Text='', +Style=Enum.ButtonStyle.RobloxButtonDefault,ZIndex=8,Size=UDim2.new(1,0,1,-20), +Visible=true,Parent=ac}),12,{},{'Remove Hotkey'}for Z=1,#ag do local _={}_.Type= +'Button'_.Text=ag[Z]_.Action=Z _.DoIt=Y table.insert(af,_)end for Z,_ in ipairs( +af)do local ah=_ if ah.Type=='Button'then local ai=a('TextButton', +'UnequipContextButton'..tostring(Z),{BackgroundColor3=Color3.new(0,0,0), +BorderSizePixel=0,TextXAlignment=Enum.TextXAlignment.Left,Text=' '..tostring(_. +Text),Font=Enum.Font.Arial,FontSize=Enum.FontSize.Size14,Size=UDim2.new(1,8,0,ae +),Position=UDim2.new(0,0,0,ae*Z),TextColor3=Color3.new(1,1,1),ZIndex=9,Parent=ad +})if not d()then ai.MouseButton1Click:connect(function()if ai.Active and not ac. +Parent.Active then pcall(function()return ah.DoIt(ah,ac)end)m=false ac.Visible= +false T(ai)return S()end end)ai.MouseEnter:connect(function()if ai.Active and ac +.Parent.Active then return aa(ai)end end)ai.MouseLeave:connect(function()if ai. +Active and ac.Parent.Active then return T(ai)end end)end _.Button=ai _.Element= +ai elseif ah.Type=='Label'then local ai=a('Frame','ContextLabel'..tostring(Z),{ +BackgroundTransparency=1,Size=UDim2.new(1,8,0,ae),a('TextLabel','Text1',{ +BackgroundTransparency=1,BackgroundColor3=Color3.new(1,1,1),BorderSizePixel=0, +TextXAlignment=Enum.TextXAlignment.Left,Font=Enum.Font.ArialBold,FontSize=Enum. +FontSize.Size14,Position=UDim2.new(0,0,0,0),Size=UDim2.new(0.5,0,1,0),TextColor3 +=Color3.new(1,1,1),ZIndex=9})})ah.Label1=ai.Text1 if ah.GetText2 then ah.Label2= +a('TextLabel','Text2',{BackgroundTransparency=1,BackgroundColor3=Color3.new(1,1, +1),BorderSizePixel=0,TextXAlignment=Enum.TextXAlignment.Right,Font=Enum.Font. +Arial,FontSize=Enum.FontSize.Size14,Position=UDim2.new(0.5,0,0,0),Size=UDim2. +new(0.5,0,1,0),TextColor3=Color3.new(1,1,1),ZIndex=9,Parent=ai})end ai.Parent=ad +ah.Label=ai ah.Element=ai end end ac.ZIndex=4 ac.MouseLeave:connect(function()m= +false ac.Visible=false return S()end)R(ac)return ac end local ac ac=function() +local ad,ae=nil,v:GetChildren()for af=1,#ae do if ae[af]:IsA'Frame'and#ae[af]: +GetChildren()<=0 then local ag=tonumber(string.sub(ae[af].Name,5))if ag==0 then +ag=10 end if not ad or(ad>ag)then ad=ag end end end if ad==10 then ad=0 end +return ad end local ad ad=function(ae,af,ag)local ah=v:GetChildren()for ai=1,#ah +do if ah[ai]:IsA'Frame'and string.find(ah[ai].Name,'Slot')then if af>=ah[ai]. +AbsolutePosition.x and af<=(ah[ai].AbsolutePosition.x+ah[ai].AbsoluteSize.x)then +if ag>=ah[ai].AbsolutePosition.y and ag<=(ah[ai].AbsolutePosition.y+ah[ai]. +AbsoluteSize.y)then local Z=tonumber(string.sub(ah[ai].Name,5))W(Z,ae)return +true end end end end return false end local ae ae=function(af)if not m then t. +Visible=false t.GearImage.Image=af.Image t.GearStats.GearName.Text=af. +GearReference.Value.Name end end local af af=function(ag)if ag:FindFirstChild( +not ag.Active)then ag.UnequipContextMenu.Visible=true m=true end end local ag ag +=function()for ah,ai in pairs(j)do if not ai:FindFirstChild'RobloxBuildTool'then +if not k[ai]then local Z=x:clone()Z.Parent=w.ScrollingFrame Z.Visible=true Z. +Image=ai.TextureId if Z.Image==''then Z.GearText.Text=ai.Name end Z. +GearReference.Value=ai Z.Draggable=true k[ai]=Z if not d()then local _=ab()_. +Visible=false _.Parent=Z end local _ Z.DragBegin:connect(function(aj)b(Z, +'Background')Z['Background'].ZIndex=10 Z.ZIndex=10 _=aj end)Z.DragStopped: +connect(function(aj,ak)b(Z,'Background')Z['Background'].ZIndex=1 Z.ZIndex=2 if _ +~=Z.Position then if not ad(Z,aj,ak)then Z:TweenPosition(_,Enum.EasingDirection. +Out,Enum.EasingStyle.Quad,0.5,true)Z.Draggable=false return delay(0.5,function() +Z.Draggable=true end)else Z.Position=_ end end end)local aj=tick()n[Z]=Z. +MouseEnter:connect(function()return ae(Z)end)o[Z]=Z.MouseButton1Click:connect( +function()local ak=tick()if Z.Active and(ak-aj)<0.5 then local al=ac()if al then +Z.ZIndex=1 W(al,Z)end else af(Z)end aj=ak end)end end end return J()end local ah +ah=function()local ai=0.75*(function()if t.AbsoluteSize.Y>t.AbsoluteSize.X then +return t.AbsoluteSize.X else return t.AbsoluteSize.Y end end)()b(t,'GearImage')t +.GearImage.Size=UDim2.new(0,ai,0,ai)t.GearImage.Position=UDim2.new(0,t. +AbsoluteSize.X/2-ai/2,0.75,-ai)return ag()end local ai ai=function(aj)if not aj: +IsA'Tool'and not aj:IsA'HopperBin'then return end if aj:FindFirstChild +'RobloxBuildTool'then return end for ak,al in pairs(j)do if al==aj then return +end end table.insert(j,aj)local Z=aj.Changed:connect(function(Z)if Z=='Name'and +k[aj]and k[aj].Image==''then k[aj].GearText.Text=aj.Name end end)local am=aj. +AncestryChanged:connect(function(_,am)local an for ao,ap in pairs(j)do if ap==aj +then an=ap break end end c(e,'Character')b(e,'Backpack')if aj.Parent~=e.Backpack +and aj.Parent~=e.Character then do local aq=ancestryCon if aq~=nil then aq: +disconnect()end end if Z~=nil then Z:disconnect()end for aq,ar in pairs(j)do if +ar==an then do local as=n[k[ar]]if as~=nil then as:disconnect()end end do local +as=o[k[ar]]if as~=nil then as:disconnect()end end k[ar].Parent=nil k[ar]=nil +break end end Q(j,an)ag()else ag()end return V()end)return ag()end local aj aj= +function(ak)for al,am in pairs(k)do am.Parent=nil end if ak then for an,ao in +pairs(ak)do ao.Parent=w.ScrollingFrame end end return J()end local ak ak= +function()for al,am in pairs(k)do am.Parent=w.ScrollingFrame end return J()end +local al al=function(am)local an,ao={},nil for ap=1,#am do if am[ap]:IsA'Frame' +and#am[ap]:GetChildren()>0 then if am[ap].Name=='Slot0'then ao=am[ap]else table. +insert(an,am[ap])end end end if ao then table.insert(an,ao)end local ap=(1-(#an* +0.1))/2 for aq=1,#an do an[aq]:TweenPosition(UDim2.new(ap+((aq-1)*0.1),0,0,0), +Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end end local am am= +function(an)if an and an~=h then i.Gear.Visible=false return end i.Gear.Visible= +true V()ag()ah()return F:Invoke()end local an an=function(ao)if ao and ao~=h +then i.Gear.Visible=false return end i.Gear.Visible=false ag()ah()return F: +Invoke()end local ao ao=function(ap)if ap==h then return am(ap)else return an(ap +)end end local ap ap=function(aq,ar)if not aq:IsA'ImageButton'then return end +for as,Z in pairs(j)do if k[Z]then if aq:FindFirstChild(k[Z]:FindFirstChild +'GearReference')then if k[Z].GearReference.Value==aq.GearReference.Value then k[ +Z].Active=ar break end end end end end local aq aq=function()if r~=nil then r: +disconnect()end r=game.Players.LocalPlayer.Backpack.ChildAdded:connect(function( +ar)return ai(ar)end)local ar=game.Players.LocalPlayer.Backpack:GetChildren()for +as=1,#ar do ai(ar[as])end if p~=nil then p:disconnect()end p=game.Players. +LocalPlayer.Character.ChildAdded:connect(function(as)ai(as)return V()end)if q~= +nil then q:disconnect()end q=game.Players.LocalPlayer.Character.ChildRemoved: +connect(function(as)return V()end)wait()return al(v:GetChildren())end local ar +ar=function()if p~=nil then p:disconnect()end if q~=nil then q:disconnect()end +if r~=nil then return r:disconnect()end return nil end local as as=function(Z) +return Z:gsub('^%s*(.-)%s*$','%1')end local Z Z=function(at)local au={}for av,aw +in pairs(j)do if k[aw]then local ax=string.lower(k[aw].GearReference.Value.Name) +ax=as(ax)for ay=1,#at do if string.match(ax,at[ay])then table.insert(au,k[aw]) +break end end end end return au end local at at=function(au)if type(au)~= +'string'then return end local av={}for aw in string.gmatch(au,'[^%s]+')do if +string.len(aw)>0 then table.insert(av,aw)end end return av end local au au= +function(av)if not i.Gear.Visible then return end local aw,ax=at(av),nil if aw +and(#aw>0)then ax=aw else ax=nil end if not(aw~=nil)then ak()return end local ay +=Z(ax)return aj(ay)end local av av=function()while#k>0 do table.remove(k)end k={ +}while#j>0 do table.remove(j)end j={}local aw=w.ScrollingFrame:GetChildren()for +ax=1,#aw do aw[ax]:remove()end end local aw aw=function(ax,ay)if ax==Enum. +CoreGuiType.Backpack or ax==Enum.CoreGuiType.All then if not ay then i.Gear. +Visible=false end end end local ax=e.Backpack:GetChildren()for ay=1,#ax do ai(ax +[ay])end D.Event:connect(function(ay)if l then return end l=true wait()ah()ag()l +=false end)v.ChildAdded:connect(function(ay)return ap(ay,false)end)v. +ChildRemoved:connect(function(ay)return ap(ay,true)end)v.DescendantAdded: +connect(function(ay)if not i.Visible and(ay:IsA'ImageButton'or ay:IsA +'TextButton')then return al(v:GetChildren())end end)v.DescendantRemoving: +connect(function(ay)if not i.Visible and(ay:IsA'ImageButton'or ay:IsA +'TextButton')then wait()return al(v:GetChildren())end end)w.MouseEnter:connect( +function()return S()end)w.MouseLeave:connect(function()return S()end)e. +CharacterRemoving:connect(function()ar()return av()end)e.CharacterAdded:connect( +function()return aq()end)e.ChildAdded:connect(function(ay)if ay:IsA'Backpack' +then s=ay if r~=nil then r:disconnect()end r=game.Players.LocalPlayer.Backpack. +ChildAdded:connect(function(az)return ai(az)end)end end)y.Changed:connect( +function()if not y.Value then return V()end end)local ay=v:GetChildren()for az=1 +,#ay do if ay[az]:IsA'Frame'and string.find(ay[az].Name,'Slot')then ay[az]. +ChildRemoved:connect(function()return V()end)ay[az].ChildAdded:connect(function( +)return V()end)end end pcall(function()aw(Enum.CoreGuiType.Backpack,Game. +StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))return Game.StarterGui. +CoreGuiChangedSignal:connect(aw)end)ah()ag()ay=v:GetChildren()for az=1,#ay do +ap(ay[az],false)end if not i.Visible then al(v:GetChildren())end if not(p~=nil) +and game.Players.LocalPlayer['Character']then aq()end if not r then r=game. +Players.LocalPlayer.Backpack.ChildAdded:connect(function(az)return ai(az)end)end +A.Event:connect(am)B.Event:connect(an)C.Event:connect(ao)E.Event:connect(au) +return O() \ No newline at end of file diff --git a/processed/89449093.lua b/processed/89449093.lua index a46002f..74155b3 100644 --- a/processed/89449093.lua +++ b/processed/89449093.lua @@ -1,390 +1,87 @@ -print("[Mercury]: Loaded corescript 89449093") -if game.CoreGui.Version < 7 then - return -end -local waitForChild -waitForChild = function(instance, name) - while not instance:FindFirstChild(name) do - instance.ChildAdded:wait() - end - return instance:FindFirstChild(name) -end -local waitForProperty -waitForProperty = function(instance, property) - while not instance[property] do - instance.Changed:wait() - end -end -waitForChild(game, "Players") -if #game.Players:GetChildren() < 1 then - game.Players.ChildAdded:wait() -end -waitForProperty(game.Players, "LocalPlayer") -local backpack = script.Parent -waitForChild(backpack, "Gear") -local screen = script.Parent.Parent -assert(screen:IsA("ScreenGui")) -waitForChild(backpack, "Tabs") -waitForChild(backpack.Tabs, "CloseButton") -local closeButton = backpack.Tabs.CloseButton -waitForChild(backpack.Tabs, "InventoryButton") -local inventoryButton = backpack.Tabs.InventoryButton -local wardrobeButton -if game.CoreGui.Version >= 8 then - waitForChild(backpack.Tabs, "WardrobeButton") - wardrobeButton = backpack.Tabs.WardrobeButton -end -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 robloxGui = waitForChild(Game.CoreGui, "RobloxGui") -local currentLoadout = waitForChild(robloxGui, "CurrentLoadout") -local loadoutBackground = waitForChild(currentLoadout, "Background") -local canToggle = true -local readyForNextEvent = true -local backpackIsOpen = false -local active = true -local disabledByDeveloper = false -local humanoidDiedCon -local guiTweenSpeed = 0.25 -local searchDefaultText = "Search..." -local tilde = "~" -local backquote = "`" -local backpackSize = UDim2.new(0, 600, 0, 400) -if robloxGui.AbsoluteSize.Y <= 320 then - backpackSize = UDim2.new(0, 200, 0, 140) -end -local createPublicEvent -createPublicEvent = function(eventName) - assert(eventName, "eventName is nil") - assert(tostring(eventName), "eventName is not a string") - local _with_0 = Instance.new("BindableEvent") - _with_0.Name = tostring(eventName) - _with_0.Parent = script - return _with_0 -end -local createPublicFunction -createPublicFunction = function(funcName, invokeFunc) - assert(funcName, "funcName is nil") - assert(tostring(funcName), "funcName is not a string") - assert(invokeFunc, "invokeFunc is nil") - assert(type(invokeFunc) == "function", "invokeFunc should be of type 'function'") - local _with_0 = Instance.new("BindableFunction") - _with_0.Name = tostring(funcName) - _with_0.OnInvoke = invokeFunc - _with_0.Parent = script - return _with_0 -end -local resizeEvent = createPublicEvent("ResizeEvent") -local backpackOpenEvent = createPublicEvent("BackpackOpenEvent") -local backpackCloseEvent = createPublicEvent("BackpackCloseEvent") -local tabClickedEvent = createPublicEvent("TabClickedEvent") -local searchRequestedEvent = createPublicEvent("SearchRequestedEvent") -local resetSearchBoxGui -resetSearchBoxGui = function() - resetButton.Visible = false - searchBox.Text = searchDefaultText -end -local resetSearch -resetSearch = function() - resetSearchBoxGui() - return searchRequestedEvent:Fire() -end -local deactivateBackpack -deactivateBackpack = function() - backpack.Visible = false - active = false -end -local initHumanoidDiedConnections -initHumanoidDiedConnections = function() - if humanoidDiedCon then - humanoidDiedCon:disconnect() - end - waitForProperty(game.Players.LocalPlayer, "Character") - waitForChild(game.Players.LocalPlayer.Character, "Humanoid") - humanoidDiedCon = game.Players.LocalPlayer.Character.Humanoid.Died:connect(deactivateBackpack) -end -local hideBackpack -hideBackpack = function() - backpackIsOpen = false - readyForNextEvent = false - backpackButton.Selected = false - resetSearch() - 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, function() - game.GuiService:RemoveCenterDialog(backpack) - backpack.Visible = false - backpackButton.Selected = false - end) - return delay(guiTweenSpeed, function() - game.GuiService:RemoveCenterDialog(backpack) - backpack.Visible = false - backpackButton.Selected = false - readyForNextEvent = true - canToggle = true - end) -end -local showBackpack -showBackpack = function() - 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) - return 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.Position = UDim2.new(0.5, -60, 1, -backpackSize.Y.Offset - 103) - end) -end -local toggleBackpack -toggleBackpack = function() - 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" - 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 - return showBackpack() - else - backpackButton.Position = UDim2.new(0.5, -60, 1, -44) - loadoutBackground.Visible = false - backpackButton.Selected = false - backpackButton.Image = "http://www.roblox.com/asset/?id=97617958" - 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) - 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 - backpackButton.Position = UDim2.new(0.5, -60, 1, -108) - backpackButton.Visible = true - loadoutBackground.Visible = true - if frame:GetChildren()[1]:IsA("ImageButton") then - local imgButton = frame:GetChildren()[1] - imgButton.Active = true - imgButton.Draggable = false - end - end - end - end - end -end -local activateBackpack -activateBackpack = function() - initHumanoidDiedConnections() - active = true - backpack.Visible = backpackIsOpen - if backpackIsOpen then - return toggleBackpack() - end -end -local closeBackpack -closeBackpack = function() - if backpackIsOpen then - return toggleBackpack() - end -end -local setSelected -setSelected = function(tab) - assert(tab) - assert(tab:IsA("TextButton")) - tab.BackgroundColor3 = Color3.new(1, 1, 1) - tab.TextColor3 = Color3.new(0, 0, 0) - tab.Selected = true - tab.ZIndex = 3 - return tab -end -local setUnselected -setUnselected = function(tab) - assert(tab) - assert(tab:IsA("TextButton")) - tab.BackgroundColor3 = Color3.new(0, 0, 0) - tab.TextColor3 = Color3.new(1, 1, 1) - tab.Selected = false - tab.ZIndex = 1 - return tab -end -local updateTabGui -updateTabGui = function(selectedTab) - assert(selectedTab) - if selectedTab == "gear" then - setSelected(inventoryButton) - return setUnselected(wardrobeButton) - elseif selectedTab == "wardrobe" then - setSelected(wardrobeButton) - return setUnselected(inventoryButton) - end -end -local mouseLeaveTab -mouseLeaveTab = function(button) - assert(button) - assert(button:IsA("TextButton")) - if button.Selected then - return - end - button.BackgroundColor3 = Color3.new(0, 0, 0) -end -local mouseOverTab -mouseOverTab = function(button) - assert(button) - assert(button:IsA("TextButton")) - if button.Selected then - return - end - button.BackgroundColor3 = Color3.new(39 / 255, 39 / 255, 39 / 255) -end -local newTabClicked -newTabClicked = function(tabName) - assert(tabName) - tabName = string.lower(tabName) - currentTab = tabName - updateTabGui(tabName) - tabClickedEvent:Fire(tabName) - return resetSearch() -end -local trim -trim = function(s) - return s:gsub("^%s*(.-)%s*$", "%1") -end -local doSearch -doSearch = function() - local searchText = searchBox.Text - if searchText == "" then - resetSearch() - return - end - searchText = trim(searchText) - resetButton.Visible = true - return searchRequestedEvent:Fire(searchText) -end -local backpackReady -backpackReady = function() - readyForNextEvent = true -end -local coreGuiChanged -coreGuiChanged = function(coreGuiType, enabled) - if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then - active = enabled - disabledByDeveloper = not enabled - do - local _with_0 = game:GetService("GuiService") - if disabledByDeveloper then -pcall(function() - _with_0:RemoveKey(tilde) - return _with_0:RemoveKey(backquote) - end) - else - _with_0:AddKey(tilde) - _with_0:AddKey(backquote) - end - end - resetSearch() - searchFrame.Visible = enabled and backpackIsOpen - currentLoadout.Visible = enabled - backpack.Visible = enabled - backpackButton.Visible = enabled - end -end -createPublicFunction("CloseBackpack", hideBackpack) -createPublicFunction("BackpackReady", backpackReady) -pcall(function() - coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)) - return Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) -end) -inventoryButton.MouseButton1Click:connect(function() - return newTabClicked("gear") -end) -inventoryButton.MouseEnter:connect(function() - return mouseOverTab(inventoryButton) -end) -inventoryButton.MouseLeave:connect(function() - return mouseLeaveTab(inventoryButton) -end) -if game.CoreGui.Version >= 8 then - wardrobeButton.MouseButton1Click:connect(function() - return newTabClicked("wardrobe") - end) - wardrobeButton.MouseEnter:connect(function() - return mouseOverTab(wardrobeButton) - end) - wardrobeButton.MouseLeave:connect(function() - return mouseLeaveTab(wardrobeButton) - end) -end -closeButton.MouseButton1Click:connect(closeBackpack) -screen.Changed:connect(function(prop) - if prop == "AbsoluteSize" then - return resizeEvent:Fire(screen.AbsoluteSize) - end -end) -do - local _with_0 = game:GetService("GuiService") - _with_0:AddKey(tilde) - _with_0:AddKey(backquote) - _with_0.KeyPressed:connect(function(key) - if not active or disabledByDeveloper then - return - end - if key == tilde or key == backquote then - return toggleBackpack() - end - end) -end -backpackButton.MouseButton1Click:connect(function() - if not active or disabledByDeveloper then - return - end - return toggleBackpack() -end) -if game.Players.LocalPlayer["Character"] then - activateBackpack() -end -game.Players.LocalPlayer.CharacterAdded:connect(activateBackpack) -searchBox.FocusLost:connect(function(enterPressed) - if enterPressed or searchBox.Text ~= "" then - return doSearch() - elseif searchBox.Text == "" then - return resetSearch() - end -end) -searchButton.MouseButton1Click:connect(doSearch) -resetButton.MouseButton1Click:connect(resetSearch) -if searchFrame and robloxGui.AbsoluteSize.Y <= 320 then - searchFrame.RobloxLocked = false - return searchFrame:Destroy() -end +print'[Mercury]: Loaded corescript 89449093'if game.CoreGui.Version<7 then +return end local a a=function(b,c)while not b:FindFirstChild(c)do b.ChildAdded: +wait()end return b:FindFirstChild(c)end local b b=function(c,d)while not c[d]do +c.Changed:wait()end end a(game,'Players')if#game.Players:GetChildren()<1 then +game.Players.ChildAdded:wait()end b(game.Players,'LocalPlayer')local c=script. +Parent a(c,'Gear')local d=script.Parent.Parent assert(d:IsA'ScreenGui')a(c, +'Tabs')a(c.Tabs,'CloseButton')local e=c.Tabs.CloseButton a(c.Tabs, +'InventoryButton')local f,g=c.Tabs.InventoryButton,nil if game.CoreGui.Version>= +8 then a(c.Tabs,'WardrobeButton')g=c.Tabs.WardrobeButton end a(c.Parent, +'ControlFrame')local h,i,j=a(c.Parent.ControlFrame,'BackpackButton'),'gear',a(c, +'SearchFrame')a(c.SearchFrame,'SearchBoxFrame')local k,l,m,n=a(c.SearchFrame. +SearchBoxFrame,'SearchBox'),a(c.SearchFrame,'SearchButton'),a(c.SearchFrame, +'ResetButton'),a(Game.CoreGui,'RobloxGui')local o=a(n,'CurrentLoadout')local p,q +,r,s,t,u,v,w,x,y,z,A=a(o,'Background'),true,true,false,true,false,nil,0.25, +'Search...','~','`',UDim2.new(0,600,0,400)if n.AbsoluteSize.Y<=320 then A=UDim2. +new(0,200,0,140)end local B B=function(C)assert(C,'eventName is nil')assert( +tostring(C),'eventName is not a string')local D=Instance.new'BindableEvent'D. +Name=tostring(C)D.Parent=script return D end local C C=function(D,E)assert(D, +'funcName is nil')assert(tostring(D),'funcName is not a string')assert(E, +'invokeFunc is nil')assert(type(E)=='function', +"invokeFunc should be of type 'function'")local F=Instance.new'BindableFunction' +F.Name=tostring(D)F.OnInvoke=E F.Parent=script return F end local D,E,F,G,H,I=B +'ResizeEvent',B'BackpackOpenEvent',B'BackpackCloseEvent',B'TabClickedEvent',B +'SearchRequestedEvent',nil I=function()m.Visible=false k.Text=x end local J J= +function()I()return H:Fire()end local K K=function()c.Visible=false t=false end +local L L=function()if v then v:disconnect()end b(game.Players.LocalPlayer, +'Character')a(game.Players.LocalPlayer.Character,'Humanoid')v=game.Players. +LocalPlayer.Character.Humanoid.Died:connect(K)end local M M=function()s=false r= +false h.Selected=false J()F:Fire(i)c.Tabs.Visible=false j.Visible=false c: +TweenSizeAndPosition(UDim2.new(0,A.X.Offset,0,0),UDim2.new(0.5,-A.X.Offset/2,1,- +85),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,w,true,function()game. +GuiService:RemoveCenterDialog(c)c.Visible=false h.Selected=false end)return +delay(w,function()game.GuiService:RemoveCenterDialog(c)c.Visible=false h. +Selected=false r=true q=true end)end local N N=function()game.GuiService: +AddCenterDialog(c,Enum.CenterDialogType.PlayerInitiatedDialog,function()c. +Visible=true h.Selected=true end,function()c.Visible=false h.Selected=false end) +c.Visible=true h.Selected=true c:TweenSizeAndPosition(A,UDim2.new(0.5,-A.X. +Offset/2,1,-A.Y.Offset-88),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,w,true +)return delay(w,function()c.Tabs.Visible=false j.Visible=true E:Fire(i)q=true r= +true h.Image='http://www.roblox.com/asset/?id=97644093'h.Position=UDim2.new(0.5, +-60,1,-A.Y.Offset-103)end)end local O O=function()if not game.Players. +LocalPlayer then return end if not game.Players.LocalPlayer['Character']then +return end if not q then return end if not r then return end r=false q=false s= +not s if s then p.Image='http://www.roblox.com/asset/?id=97623721'p.Position= +UDim2.new(-3E-2,0,-0.17,0)p.Size=UDim2.new(1.05,0,1.25,0)p.ZIndex=2 p.Visible= +true return N()else h.Position=UDim2.new(0.5,-60,1,-44)p.Visible=false h. +Selected=false h.Image='http://www.roblox.com/asset/?id=97617958'p.Image= +'http://www.roblox.com/asset/?id=96536002'p.Position=UDim2.new(-0.1,0,-0.1,0)p. +Size=UDim2.new(1.2,0,1.2,0)M()local P=o:GetChildren()for Q=1,#P do if P[Q]and P[ +Q]:IsA'Frame'then local R=P[Q]if#R:GetChildren()>0 then h.Position=UDim2.new(0.5 +,-60,1,-108)h.Visible=true p.Visible=true if R:GetChildren()[1]:IsA'ImageButton' +then local S=R:GetChildren()[1]S.Active=true S.Draggable=false end end end end +end end local P P=function()L()t=true c.Visible=s if s then return O()end end +local Q Q=function()if s then return O()end end local R R=function(S)assert(S) +assert(S:IsA'TextButton')S.BackgroundColor3=Color3.new(1,1,1)S.TextColor3=Color3 +.new(0,0,0)S.Selected=true S.ZIndex=3 return S end local S S=function(T)assert(T +)assert(T:IsA'TextButton')T.BackgroundColor3=Color3.new(0,0,0)T.TextColor3= +Color3.new(1,1,1)T.Selected=false T.ZIndex=1 return T end local T T=function(U) +assert(U)if U=='gear'then R(f)return S(g)elseif U=='wardrobe'then R(g)return S(f +)end end local U U=function(V)assert(V)assert(V:IsA'TextButton')if V.Selected +then return end V.BackgroundColor3=Color3.new(0,0,0)end local V V=function(W) +assert(W)assert(W:IsA'TextButton')if W.Selected then return end W. +BackgroundColor3=Color3.new(0.15294117647058825,0.15294117647058825, +0.15294117647058825)end local W W=function(X)assert(X)X=string.lower(X)i=X T(X)G +:Fire(X)return J()end local X X=function(Y)return Y:gsub('^%s*(.-)%s*$','%1')end +local Y Y=function()local Z=k.Text if Z==''then J()return end Z=X(Z)m.Visible= +true return H:Fire(Z)end local Z Z=function()r=true end local _ _=function(aa,ab +)if aa==Enum.CoreGuiType.Backpack or aa==Enum.CoreGuiType.All then t=ab u=not ab +do local ac=game:GetService'GuiService'if u then pcall(function()ac:RemoveKey(y) +return ac:RemoveKey(z)end)else ac:AddKey(y)ac:AddKey(z)end end J()j.Visible=ab +and s o.Visible=ab c.Visible=ab h.Visible=ab end end C('CloseBackpack',M)C( +'BackpackReady',Z)pcall(function()_(Enum.CoreGuiType.Backpack,Game.StarterGui: +GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))return Game.StarterGui. +CoreGuiChangedSignal:connect(_)end)f.MouseButton1Click:connect(function()return +W'gear'end)f.MouseEnter:connect(function()return V(f)end)f.MouseLeave:connect( +function()return U(f)end)if game.CoreGui.Version>=8 then g.MouseButton1Click: +connect(function()return W'wardrobe'end)g.MouseEnter:connect(function()return V( +g)end)g.MouseLeave:connect(function()return U(g)end)end e.MouseButton1Click: +connect(Q)d.Changed:connect(function(aa)if aa=='AbsoluteSize'then return D:Fire( +d.AbsoluteSize)end end)do local aa=game:GetService'GuiService'aa:AddKey(y)aa: +AddKey(z)aa.KeyPressed:connect(function(ab)if not t or u then return end if ab== +y or ab==z then return O()end end)end h.MouseButton1Click:connect(function()if +not t or u then return end return O()end)if game.Players.LocalPlayer['Character' +]then P()end game.Players.LocalPlayer.CharacterAdded:connect(P)k.FocusLost: +connect(function(aa)if aa or k.Text~=''then return Y()elseif k.Text==''then +return J()end end)l.MouseButton1Click:connect(Y)m.MouseButton1Click:connect(J)if +j and n.AbsoluteSize.Y<=320 then j.RobloxLocked=false return j:Destroy()end \ No newline at end of file diff --git a/processed/97188756.lua b/processed/97188756.lua index 4692a23..b14db08 100644 --- a/processed/97188756.lua +++ b/processed/97188756.lua @@ -1,1610 +1,361 @@ -print("[Mercury]: Loaded corescript 97188756") -local forceChatGUI = false -local WaitForChild -WaitForChild = function(parent, childName) - while not (parent:FindFirstChild(childName) ~= nil) do - parent.ChildAdded:wait(0.03) - end - return parent[childName] -end -local IsPhone -IsPhone = function() - local cGui = Game:GetService("CoreGui") - local rGui = WaitForChild(cGui, "RobloxGui") - if rGui.AbsoluteSize.Y < 600 then - return true - end - return false -end -local StringTrim -StringTrim = function(str) - return str:gsub("^%s*(.-)%s*$", "%1") -end -while not (Game.Players.LocalPlayer ~= nil) do - wait(0.03) -end -local Player = Game.Players.LocalPlayer -while not (Player.Character ~= nil) do - wait(0.03) -end -local Camera = Game.Workspace.CurrentCamera -local New -New = function(className, name, props) - if not (props ~= nil) then - props = name - name = nil - end - local obj = Instance.new(className) - if name then - obj.Name = name - end - local parent - for k, v in pairs(props) do - if type(k) == "string" then - if k == "Parent" then - parent = v - else - obj[k] = v - end - elseif type(k) == "number" and type(v) == "userdata" then - v.Parent = obj - end - end - obj.Parent = parent - return obj -end -local CoreGuiService = Game:GetService("CoreGui") -local PlayersService = Game:GetService("Players") -local GuiService = Game:GetService("GuiService") -local Enums = { } -local EnumName = { } -local CreateEnum -CreateEnum = function(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, - }, { - __call = function(self, value) - return value == self or value == self.Name or value == self.Value - end, - __tostring = function(self) - return "Enum." .. tostring(self[EnumName]) .. "." .. tostring(self.Name) - end - }) - e[i] = item - e[name] = item - e[item] = item - end - Enums[enumName] = e - return setmetatable(e, { - __call = function(self, value) - return self[value] or self[tonumber(value)] - end, - __index = { - GetEnumItems = function(self) - t = { } - 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) - return t - end - }, - __tostring = function(self) - return "Enum." .. tostring(self[EnumName]) - end - }) - end -end -local Input = { - Mouse = Player:GetMouse(), - Speed = 0, - Simulating = false, - Configuration = { - DefaultSpeed = 1 - }, - UserIsScrolling = false -} -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") - }, - Gui = nil, - Frame = nil, - RenderFrame = nil, - TapToChatLabel = nil, - ClickToChatButton = nil, - ScrollingLock = false, - EventListener = nil, - MessageQueue = { }, - Configuration = { - FontSize = Enum.FontSize.Size12, - NumFontSize = 12, - HistoryLength = 20, - 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 - }, - SlotPositions_List = { }, - CachedSpaceStrings_List = { }, - MouseOnFrame = false, - GotFocus = false, - Messages_List = { }, - MessageThread = nil, - Admins_List = { - "taskmanager", - "Heliodex", - "tako" - }, - SafeChat_List = { - ["Use the Chat menu to talk to me."] = { - "/sc0", - true - }, - ["I can only see menu chats."] = { - "/sc1", - true - }, - Hello = { - Hi = { - "/sc2_0", - true, - ["Hi there!"] = true, - ["Hi everyone"] = true - }, - Howdy = { - "/sc2_1", - true, - ["Howdy partner!"] = true - }, - Greetings = { - "/sc2_2", - true, - ["Greetings everyone"] = true, - ["Greetings Robloxians!"] = true, - ["Seasons greetings!"] = true - }, - Welcome = { - "/sc2_3", - true, - ["Welcome to my place"] = true, - ["Welcome to my barbeque"] = true, - ["Welcome to our base"] = true - }, - ["Hey there!"] = { - "/sc2_4", - true - }, - ["What's up?"] = { - "/sc2_5", - true, - ["How are you doing?"] = true, - ["How's it going?"] = true, - ["What's new?"] = true - }, - ["Good day"] = { - "/sc2_6", - true, - ["Good morning"] = true, - ["Good evening"] = true, - ["Good afternoon"] = true, - ["Good night"] = true - }, - Silly = { - "/sc2_7", - true, - ["Waaaaaaaz up?!"] = true, - ["Hullo!"] = true, - ["Behold greatness, mortals!"] = true, - ["Pardon me, is this Sparta?"] = true, - ["THIS IS SPARTAAAA!"] = true - }, - ["Happy Holidays!"] = { - "/sc2_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 Mercury Day!"] = true, - ["Happy LOL Day!"] = true - }, - "/sc2" - }, - Goodbye = { - ["Good Night"] = { - "/sc3_0", - true, - ["Sweet dreams"] = true, - ["Go to sleep!"] = true, - ["Lights out!"] = true, - Bedtime = true, - ["Going to bed now"] = true - }, - Later = { - "/sc3_1", - true, - ["See ya later"] = true, - ["Later gator!"] = true, - ["See you tomorrow"] = true - }, - Bye = { - "/sc3_2", - true, - ["Hasta la bye bye!"] = true - }, - ["I'll be right back"] = { - "/sc3_3", - true - }, - ["I have to go"] = { - "/sc3_4", - true - }, - Farewell = { - "/sc3_5", - true, - ["Take care"] = true, - ["Have a nice day"] = true, - ["Goodluck!"] = true, - ["Ta-ta for now!"] = true - }, - Peace = { - "/sc3_6", - true, - ["Peace out!"] = true, - ["Peace dudes!"] = true, - ["Rest in pieces!"] = true - }, - Silly = { - "/sc3_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 - }, - "/sc3" - }, - Friend = { - ["Wanna be friends?"] = { - "/sc4_0", - true - }, - ["Follow me"] = { - "/sc4_1", - true, - ["Come to my place!"] = true, - ["Come to my base!"] = true, - ["Follow me, team!"] = true, - ["Follow me"] = true - }, - ["Your place is cool"] = { - "/sc4_2", - true, - ["Your place is fun"] = true, - ["Your place is awesome"] = true, - ["Your place looks good"] = true, - ["This place is awesome!"] = true - }, - ["Thank you"] = { - "/sc4_3", - true, - ["Thanks for playing"] = true, - ["Thanks for visiting"] = true, - ["Thanks for everything"] = true, - ["No, thank you"] = true, - Thanx = true - }, - ["No problem"] = { - "/sc4_4", - true, - ["Don't worry"] = true, - ["That's ok"] = true, - np = true - }, - ["You are ..."] = { - "/sc4_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 ..."] = { - "/sc4_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 = { - "/sc4_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 - }, - "/sc4" - }, - Questions = { - ["Who?"] = { - "/sc5_0", - true, - ["Who wants to be my friend?"] = true, - ["Who wants to be on my team?"] = true, - ["Who made this brilliant game?"] = true - }, - ["What?"] = { - "/sc5_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?"] = { - "/sc5_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?"] = { - "/sc5_3", - true, - ["Where do you want to go?"] = true, - ["Where are you going?"] = true, - ["Where am I?!"] = true, - ["Where did you go?"] = true - }, - ["How?"] = { - "/sc5_4", - true, - ["How are you today?"] = true, - ["How did you make this cool place?"] = true, - ["LOLHOW?"] = true - }, - ["Can I..."] = { - "/sc5_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 - }, - "/sc5" - }, - Answers = { - ["You need help?"] = { - "/sc6_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 ..."] = { - "/sc6_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 ..."] = { - "/sc6_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 = { - "/sc6_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 = { - "/sc6_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 = { - "/sc6_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"] = { - "/sc6_6", - true, - ["Science Fiction"] = true, - Animated = { - Anime = true - }, - Comedy = true, - Romantic = true, - Action = true, - Fantasy = true - }, - Music = { - "/sc6_7", - true, - Country = true, - Jazz = true, - Rap = true, - ["Hip-hop"] = true, - Techno = true, - Classical = true, - Pop = true, - Rock = true - }, - Hobbies = { - "/sc6_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 = { - "/sc6_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 = { - "/sc6_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 = { - "/sc6_11", - true, - Good = true, - ["Great!"] = true, - ["Not bad"] = true, - Sad = true, - Hyper = true, - Chill = true, - Happy = true, - ["Kind of mad"] = true - }, - Boy = { - "/sc6_12", - true - }, - Girl = { - "/sc6_13", - true - }, - ["I don't want to say boy or girl. Don't ask."] = { - "/sc6_14", - true - }, - "/sc6" - }, - Game = { - ["Let's build"] = { - "/sc7_0", - true - }, - ["Let's battle"] = { - "/sc7_1", - true - }, - ["Nice one!"] = { - "/sc7_2", - true - }, - ["So far so good"] = { - "/sc7_3", - true - }, - ["Lucky shot!"] = { - "/sc7_4", - true - }, - ["Oh man!"] = { - "/sc7_5", - true - }, - ["I challenge you to a fight!"] = { - "/sc7_6", - true - }, - ["Help me with this"] = { - "/sc7_7", - true - }, - ["Let's go to your game"] = { - "/sc7_8", - true - }, - ["Can you show me how do to that?"] = { - "/sc7_9", - true - }, - ["Backflip!"] = { - "/sc7_10", - true - }, - ["Frontflip!"] = { - "/sc7_11", - true - }, - ["Dance!"] = { - "/sc7_12", - true - }, - ["I'm on your side!"] = { - "/sc7_13", - true - }, - ["Game Commands"] = { - "/sc7_14", - true, - regen = true, - reset = true, - go = true, - fix = true, - respawn = true - }, - "/sc7" - }, - 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 GetNameValue -GetNameValue = function(pName) - local value = 0 - 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 - end - if reverseIndex % 4 >= 2 then - cValue = -cValue - end - value = value + cValue - end - return value % 8 -end -Chat.ComputeChatColor = function(self, pName) - return self.ChatColors[GetNameValue(pName) + 1].Color -end -Chat.EnableScrolling = function(self, toggle) - self.MouseOnFrame = false - if self.RenderFrame then - self.RenderFrame.MouseEnter:connect(function() - local character = Player.Character - local torso = WaitForChild(character, "Torso") - local head = WaitForChild(character, "Head") - if toggle then - self.MouseOnFrame = true - Camera.CameraType = "Scriptable" - return 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 - end) - end - end) - return self.RenderFrame.MouseLeave:connect(function() - Camera.CameraType = "Custom" - self.MouseOnFrame = false - end) - end -end -Chat.IsTouchDevice = function(self) - local touchEnabled = false -pcall(function() - touchEnabled = Game:GetService("UserInputService").TouchEnabled - end) - return touchEnabled -end -Chat.UpdateQueue = function(self, field, diff) - 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) - Spawn(function() - wait(0.05) - while label.TextTransparency >= 0 do - label.TextTransparency = label.TextTransparency - 0.2 - wait(0.03) - end - if label == field["Message"] then - label.TextStrokeTransparency = 0.8 - 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 - label.Visible = false - label:Destroy() - end - end - end - end - end - end - end -end -Chat.CreateScrollBar = function(self) end -Chat.CheckIfInBounds = function(self, 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 -end -Chat.ComputeSpaceString = function(self, pLabel) - local nString = " " - if not self.TempSpaceLabel then - self.TempSpaceLabel = New("TextButton", "SpaceButton", { - Size = UDim2.new(0, pLabel.AbsoluteSize.X, 0, pLabel.AbsoluteSize.Y), - FontSize = self.Configuration.FontSize, - Parent = self.RenderFrame, - BackgroundTransparency = 1, - Text = nString - }) - else - self.TempSpaceLabel.Text = nString - end - while self.TempSpaceLabel.TextBounds.X < pLabel.TextBounds.X do - nString = nString .. " " - self.TempSpaceLabel.Text = nString - end - nString = nString .. " " - self.CachedSpaceStrings_List[pLabel.Text] = nString - self.TempSpaceLabel.Text = "" - return nString -end -Chat.UpdateChat = function(self, cPlayer, message) - local messageField = { - Player = cPlayer, - Message = message - } - if coroutine.status(Chat.MessageThread) == "dead" then - 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) - return coroutine.resume(Chat.MessageThread) - else - return table.insert(Chat.Messages_List, messageField) - end -end -Chat.CreateMessage = function(self, cPlayer, message) - local pName - if not cPlayer then - pName = "" - else - pName = cPlayer.Name - end - message = StringTrim(message) - local pLabel - local mLabel - if #self.MessageQueue > self.Configuration.HistoryLength then - self.MessageQueue[#self.MessageQueue] = nil - end - pLabel = New("TextLabel", pName, { - Text = pName .. ":", - 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 - }) - if cPlayer.Neutral then - pLabel.TextColor3 = Chat:ComputeChatColor(pName) - else - pLabel.TextColor3 = cPlayer.TeamColor.Color - end - local nString - if not self.CachedSpaceStrings_List[pName] then - nString = Chat:ComputeSpaceString(pLabel) - else - nString = self.CachedSpaceStrings_List[pName] - end - mLabel = New("TextLabel", tostring(pName) .. " - message", { - 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 = "", - Parent = self.RenderFrame, - TextWrapped = true, - BackgroundTransparency = 1, - TextTransparency = 1, - Position = UDim2.new(0, 0, 1, 0), - BorderSizePixel = 0, - TextStrokeColor3 = Color3.new(0, 0, 0) - }) - mLabel.Text = nString .. message - if not pName then - pLabel.Text = "" - mLabel.TextColor3 = Color3.new(0, 0.4, 1.0) - end - for _, adminName in pairs(self.Admins_List) do - if string.lower(adminName) == string.lower(pName) then - mLabel.TextColor3 = self.Configuration.AdminMessageColor - end - end - pLabel.Visible = true - mLabel.Visible = true - local heightField = mLabel.TextBounds.Y - mLabel.Size = UDim2.new(1, 0, heightField / self.RenderFrame.AbsoluteSize.Y, 0) - pLabel.Size = mLabel.Size - local queueField = { } - queueField["Player"] = pLabel - queueField["Message"] = mLabel - queueField["SpawnTime"] = tick() - table.insert(self.MessageQueue, 1, queueField) - return Chat:UpdateQueue(queueField) -end -Chat.ScreenSizeChanged = function(self) - wait() - while self.Frame.AbsoluteSize.Y > 120 do - self.Frame.Size = self.Frame.Size - UDim2.new(0, 0, 0.005, 0) - end -end -Chat.FindButtonTree = function(self, scButton, rootList) - local list = { } - rootList = rootList or self.SafeChatTree - for button, _ in pairs(rootList) do - if button == scButton then - list = rootList[button] - elseif type(rootList[button]) == "table" then - list = Chat:FindButtonTree(scButton, rootList[button]) - end - end - return list -end -Chat.ToggleSafeChatMenu = function(self, 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 - return true - end - return false -end -Chat.CreateSafeChatOptions = function(self, list, rootButton) - local text_List = { } - 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 = New("TextButton", 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) - end - chatText.MouseEnter:connect(function() - return Chat:ToggleSafeChatMenu(chatText) - end) - chatText.MouseLeave:connect(function() - return Chat:ToggleSafeChatMenu(chatText) - end) - chatText.MouseButton1Click:connect(function() - local lList = Chat:FindButtonTree(chatText) - return pcall(function() - return PlayersService:Chat(lList[1]) - end) - end) - end - end - return text_List -end -Chat.CreateSafeChatGui = function(self) - self.SafeChatFrame = New("Frame", "SafeChatFrame", { - Size = UDim2.new(1, 0, 1, 0), - Parent = self.Gui, - BackgroundTransparency = 1, - New("ImageButton", "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 - self.SafeChatTree[self.SafeChatButton] = Chat:CreateSafeChatOptions(self.SafeChat_List, self.SafeChatButton) - return self.SafeChatButton.MouseButton1Click:connect(function() - return Chat:ToggleSafeChatMenu(self.SafeChatButton) - end) -end -Chat.FocusOnChatBar = function(self) - if self.ClickToChatButton then - self.ClickToChatButton.Visible = false - end - self.GotFocus = true - if self.Frame["Background"] then - self.Frame.Background.Visible = false - end - return self.ChatBar:CaptureFocus() -end -Chat.CreateTouchButton = function(self) - self.ChatTouchFrame = New("Frame", "ChatTouchFrame", { - Size = UDim2.new(0, 128, 0, 32), - Position = UDim2.new(0, 88, 0, 0), - BackgroundTransparency = 1, - Parent = self.Gui, - New("ImageButton", "ChatLabel", { - Size = UDim2.new(0, 74, 0, 28), - Position = UDim2.new(0, 0, 0, 0), - BackgroundTransparency = 1, - ZIndex = 2.0 - }), - New("ImageLabel", "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 = New("TextBox", "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 - }) - return self.TapToChatLabel.MouseButton1Click:connect(function() - self.TapToChatLabel.Visible = false - self.ChatBar:CaptureFocus() - self.GotFocus = true - if self.TouchLabelBackground then - self.TouchLabelBackground.Visible = false - end - end) -end -Chat.CreateChatBar = function(self) - local status, result - status, result = pcall(function() - return GuiService.UseLuaChat - end) - if forceChatGUI or (status and result) then - self.ClickToChatButton = New("TextButton", "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 = New("TextBox", "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 - }) - local success, error - success, error = pcall(function() - return GuiService:SetGlobalGuiInset(0, 0, 0, 20) - end) - if not success then - GuiService:SetGlobalSizeOffsetPixel(0, -20) - end - GuiService:AddSpecialKey(Enum.SpecialKey.ChatHotkey) - GuiService.SpecialKeyPressed:connect(function(key) - if key == Enum.SpecialKey.ChatHotkey then - return Chat:FocusOnChatBar() - end - end) - return self.ClickToChatButton.MouseButton1Click:connect(function() - return Chat:FocusOnChatBar() - end) - end -end -Chat.CreateGui = function(self) - self.Gui = WaitForChild(CoreGuiService, "RobloxGui") - self.Frame = New("Frame", "ChatFrame", { - Size = UDim2.new(0, 500, 0, 120), - Position = UDim2.new(0, 0, 0, 5), - BackgroundTransparency = 1, - ZIndex = 0, - Parent = self.Gui, - Active = false, - New("ImageLabel", "Background", { - Image = "http://www.roblox.com/asset/?id=97120937", - Size = UDim2.new(1.3, 0, 1.64, 0), - Position = UDim2.new(0, 0, 0, 0), - BackgroundTransparency = 1, - ZIndex = 0, - Visible = false - }), - New("Frame", "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 - }), - New("Frame", "ChatRenderFrame", { - Size = UDim2.new(1.02, 0, 1.01, 0), - Position = UDim2.new(0, 0, 0, 0), - BackgroundTransparency = 1, - ZIndex = 0, - Active = false - }) - }) - Spawn(function() - wait(0.5) - 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 - return Chat:ScreenSizeChanged() - end - end) - end - if forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu then - if Chat:IsTouchDevice() then - Chat:CreateTouchButton() - else - Chat:CreateChatBar() - end - if self.ChatBar then - return self.ChatBar.FocusLost:connect(function(enterPressed) - 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 - local cText = self.ChatBar.Text - if string.sub(self.ChatBar.Text, 1, 1) == "%" then - cText = "(TEAM) " .. tostring(string.sub(cText, 2, #cText)) -pcall(function() - return PlayersService:TeamChat(cText) - end) - else -pcall(function() - return PlayersService:Chat(cText) - end) - end - if self.ClickToChatButton then - self.ClickToChatButton.Visible = true - end - self.ChatBar.Text = "" - end - return Spawn(function() - wait(5.0) - if not Chat.GotFocus then - Chat.Frame.Background.Visible = false - end - end) - end) - end - end -end -Input.OnMouseScroll = function(self) - Spawn(function() - 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 - Input.Speed = Input.Speed + 1 - wait(0.25) - end - end - wait(0.03) - end - end) - if Chat:CheckIfInBounds(Input.Speed) then - return - end - return Chat:ScrollQueue() -end -Input.ApplySpeed = function(self, value) - Input.Speed = Input.Speed + value - if not self.Simulating then - return Input:OnMouseScroll() - end -end -Input.Initialize = function(self) - self.Mouse.WheelBackward:connect(function() - return Input:ApplySpeed(self.Configuration.DefaultSpeed) - end) - return self.Mouse.WheelForward:connect(function() - return Input:ApplySpeed(self.Configuration.DefaultSpeed) - end) -end -Chat.FindMessageInSafeChat = function(self, message, list) - local foundMessage = false - for msg, _ in pairs(list) do - if msg == message then - return true - end - if type(list[msg]) == "table" then - foundMessage = Chat:FindMessageInSafeChat(message, list[msg]) - if foundMessage then - return true - end - end - end - return foundMessage -end -Chat.PlayerChatted = function(self, ...) - local args = { - ... - } - local player, message - if args[2] then - player = args[2] - end - if args[3] then - message = args[3] - if string.sub(message, 1, 1) == "%" then - message = "(TEAM) " .. tostring(string.sub(message, 2, #message)) - end - end - if PlayersService.ClassicChat then - if not (string.sub(message, 1, 3) == "/e " or string.sub(message, 1, 7) == "/emote ") and (forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu) or (Player.ChatMode == Enum.ChatMode.Menu and string.sub(message, 1, 3) == "/sc") or Chat:FindMessageInSafeChat(message, self.SafeChat_List) then - return Chat:UpdateChat(player, message) - end - end -end -Chat.CullThread = function(self) - 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 -Chat.LockAllFields = function(self, gui) - local children = gui:GetChildren() - for i = 1, #children do - children[i].RobloxLocked = true - if #children[i]:GetChildren() > 0 then - Chat:LockAllFields(children[i]) - end - end -end -Chat.CoreGuiChanged = function(self, coreGuiType, enabled) - if coreGuiType == Enum.CoreGuiType.Chat or coreGuiType == Enum.CoreGuiType.All then - if self.Frame then - self.Frame.Visible = enabled - end - if not Chat:IsTouchDevice() and self.ChatBar then - self.ChatBar.Visible = enabled - return GuiService:SetGlobalGuiInset(0, 0, 0, (function() - if enabled then - return 20 - else - return 0 - end - end)()) - end - end -end -Chat.Initialize = function(self) - Chat:CreateGui() -pcall(function() - Chat:CoreGuiChanged(Enum.CoreGuiType.Chat, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Chat)) - return Game.StarterGui.CoreGuiChangedSignal:connect(function(coreGuiType, enabled) - return Chat:CoreGuiChanged(coreGuiType, enabled) - end) - end) - self.EventListener = PlayersService.PlayerChatted:connect(function(...) - return Chat:PlayerChatted(...) - end) - self.MessageThread = coroutine.create(function() end) - coroutine.resume(self.MessageThread) - Input:Initialize() - PlayersService.ChildAdded:connect(function() - Chat.EventListener:disconnect() - self.EventListener = PlayersService.PlayerChatted:connect(function(...) - return Chat:PlayerChatted(...) - end) - end) - Spawn(function() - return Chat:CullThread() - end) - self.Frame.RobloxLocked = true - Chat:LockAllFields(self.Frame) - return self.Frame.DescendantAdded:connect(function(descendant) - return Chat:LockAllFields(descendant) - end) -end -return Chat:Initialize() +print'[Mercury]: Loaded corescript 97188756'local a,b=false,nil b=function(c,d) +while not(c:FindFirstChild(d)~=nil)do c.ChildAdded:wait(0.03)end return c[d]end +local c c=function()local d=Game:GetService'CoreGui'local e=b(d,'RobloxGui')if e +.AbsoluteSize.Y<600 then return true end return false end local d d=function(e) +return e:gsub('^%s*(.-)%s*$','%1')end while not(Game.Players.LocalPlayer~=nil)do +wait(0.03)end local e=Game.Players.LocalPlayer while not(e.Character~=nil)do +wait(0.03)end local f,g=Game.Workspace.CurrentCamera,nil g=function(h,i,j)if not +(j~=nil)then j=i i=nil end local k=Instance.new(h)if i then k.Name=i end local l +for m,n in pairs(j)do if type(m)=='string'then if m=='Parent'then l=n else k[m]= +n end elseif type(m)=='number'and type(n)=='userdata'then n.Parent=k end end k. +Parent=l return k end local h,i,j,k,l,m=Game:GetService'CoreGui',Game:GetService +'Players',Game:GetService'GuiService',{},{},nil m=function(n)return function(o) +local p={[l]=n}for q,r in pairs(o)do local s=setmetatable({Name=r,Value=q,Enum=p +,[l]=n},{__call=function(s,t)return t==s or t==s.Name or t==s.Value end, +__tostring=function(s)return'Enum.'..tostring(s[l])..'.'..tostring(s.Name)end})p +[q]=s p[r]=s p[s]=s end k[n]=p return setmetatable(p,{__call=function(s,t)return +s[t]or s[tonumber(t)]end,__index={GetEnumItems=function(s)o={}for t,u in pairs(s +)do if type(t)=='number'then o[#o+1]=u end end table.sort(o,function(v,w)return +v.Value (>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}},m'SafeChat'{'Level1','Level2','Level3'}, +SafeChatTree={},TempSpaceLabel=nil},nil p=function(q)local r=0 for s=1,#q do +local t,u=string.byte(string.sub(q,s,s)),#q-s+1 if#q%2==1 then u=u-1 end if u%4 +>=2 then t=-t end r=r+t end return r%8 end o.ComputeChatColor=function(q,r) +return q.ChatColors[p(r)+1].Color end o.EnableScrolling=function(q,r)q. +MouseOnFrame=false if q.RenderFrame then q.RenderFrame.MouseEnter:connect( +function()local s=e.Character local t,u=b(s,'Torso'),b(s,'Head')if r then q. +MouseOnFrame=true f.CameraType='Scriptable'return Spawn(function()local v=f. +CoordinateFrame.p-t.Position while o.MouseOnFrame do f.CoordinateFrame=CFrame. +new(t.Position+v,u.Position)wait(0.015)end end)end end)return q.RenderFrame. +MouseLeave:connect(function()f.CameraType='Custom'q.MouseOnFrame=false end)end +end o.IsTouchDevice=function(q)local r=false pcall(function()r=Game:GetService +'UserInputService'.TouchEnabled end)return r end o.UpdateQueue=function(q,r,s) +for t=#q.MessageQueue,1,-1 do if q.MessageQueue[t]then for u,v in pairs(q. +MessageQueue[t])do if v and type(v)~='table'and type(v)~='number'then if v:IsA +'TextLabel'or v:IsA'TextButton'then if s then v.Position=v.Position-UDim2.new(0, +0,s,0)else if r==q.MessageQueue[t]then v.Position=UDim2.new(q.Configuration. +XScale,0,v.Position.Y.Scale-r['Message'].Size.Y.Scale,0)Spawn(function()wait( +0.05)while v.TextTransparency>=0 do v.TextTransparency=v.TextTransparency-0.2 +wait(0.03)end if v==r['Message']then v.TextStrokeTransparency=0.8 else v. +TextStrokeTransparency=1 end end)else v.Position=UDim2.new(q.Configuration. +XScale,0,v.Position.Y.Scale-r['Message'].Size.Y.Scale,0)end if v.Position.Y. +Scale<-1E-2 then v.Visible=false v:Destroy()end end end end end end end end o. +CreateScrollBar=function(q)end o.CheckIfInBounds=function(q,r)if#o.MessageQueue< +3 then return true end if r>0 and o.MessageQueue[1]and o.MessageQueue[1][ +'Player']and o.MessageQueue[1]['Player'].Position.Y.Scale==0 then return true +elseif r<0 and o.MessageQueue[1]and o.MessageQueue[1]['Player']and o. +MessageQueue[1]['Player'].Position.Y.Scale<0 then return true else return false +end end o.ComputeSpaceString=function(q,r)local s=' 'if not q.TempSpaceLabel +then q.TempSpaceLabel=g('TextButton','SpaceButton',{Size=UDim2.new(0,r. +AbsoluteSize.X,0,r.AbsoluteSize.Y),FontSize=q.Configuration.FontSize,Parent=q. +RenderFrame,BackgroundTransparency=1,Text=s})else q.TempSpaceLabel.Text=s end +while q.TempSpaceLabel.TextBounds.Xq.Configuration. +HistoryLength then q.MessageQueue[#q.MessageQueue]=nil end u=g('TextLabel',t,{ +Text=t..':',FontSize=o.Configuration.FontSize,TextXAlignment=Enum.TextXAlignment +.Left,TextYAlignment=Enum.TextYAlignment.Top,Parent=q.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})if r.Neutral then u.TextColor3=o: +ComputeChatColor(t)else u.TextColor3=r.TeamColor.Color end local w if not q. +CachedSpaceStrings_List[t]then w=o:ComputeSpaceString(u)else w=q. +CachedSpaceStrings_List[t]end v=g('TextLabel',tostring(t)..' - message',{Size= +UDim2.new(1,0,0.5,0),TextColor3=o.Configuration.MessageColor,FontSize=o. +Configuration.FontSize,TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment= +Enum.TextYAlignment.Top,Text='',Parent=q.RenderFrame,TextWrapped=true, +BackgroundTransparency=1,TextTransparency=1,Position=UDim2.new(0,0,1,0), +BorderSizePixel=0,TextStrokeColor3=Color3.new(0,0,0)})v.Text=w..s if not t then +u.Text=''v.TextColor3=Color3.new(0,0.4,1)end for x,y in pairs(q.Admins_List)do +if string.lower(y)==string.lower(t)then v.TextColor3=q.Configuration. +AdminMessageColor end end u.Visible=true v.Visible=true local z=v.TextBounds.Y v +.Size=UDim2.new(1,0,z/q.RenderFrame.AbsoluteSize.Y,0)u.Size=v.Size local A={}A[ +'Player']=u A['Message']=v A['SpawnTime']=tick()table.insert(q.MessageQueue,1,A) +return o:UpdateQueue(A)end o.ScreenSizeChanged=function(q)wait()while q.Frame. +AbsoluteSize.Y>120 do q.Frame.Size=q.Frame.Size-UDim2.new(0,0,0.005,0)end end o. +FindButtonTree=function(q,r,s)local t={}s=s or q.SafeChatTree for u,v in pairs(s +)do if u==r then t=s[u]elseif type(s[u])=='table'then t=o:FindButtonTree(r,s[u]) +end end return t end o.ToggleSafeChatMenu=function(q,r)local s=o:FindButtonTree( +r,q.SafeChatTree)if s then for t,u in pairs(s)do if t:IsA'TextButton'or t:IsA +'ImageButton'then t.Visible=not t.Visible end end return true end return false +end o.CreateSafeChatOptions=function(q,r,s)local t,u={},0 t[s]={}t[s][1]=r[1]s=s +or q.SafeChatButton for v,w in pairs(r)do if type(v)=='string'then local x=g( +'TextButton',v,{Text=v,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=q.SafeChatFrame,Visible=false, +Position=UDim2.new(0,s.Position.X.Scale+105,0,s.Position.Y.Scale-(u-3)*100)})u=u ++1 if type(r[v])=='table'then t[s][x]=o:CreateSafeChatOptions(r[v],x)end x. +MouseEnter:connect(function()return o:ToggleSafeChatMenu(x)end)x.MouseLeave: +connect(function()return o:ToggleSafeChatMenu(x)end)x.MouseButton1Click:connect( +function()local y=o:FindButtonTree(x)return pcall(function()return i:Chat(y[1]) +end)end)end end return t end o.CreateSafeChatGui=function(q)q.SafeChatFrame=g( +'Frame','SafeChatFrame',{Size=UDim2.new(1,0,1,0),Parent=q.Gui, +BackgroundTransparency=1,g('ImageButton','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'})})q.SafeChatButton=q.SafeChatFrame. +SafeChatButton q.SafeChatTree[q.SafeChatButton]=o:CreateSafeChatOptions(q. +SafeChat_List,q.SafeChatButton)return q.SafeChatButton.MouseButton1Click: +connect(function()return o:ToggleSafeChatMenu(q.SafeChatButton)end)end o. +FocusOnChatBar=function(q)if q.ClickToChatButton then q.ClickToChatButton. +Visible=false end q.GotFocus=true if q.Frame['Background']then q.Frame. +Background.Visible=false end return q.ChatBar:CaptureFocus()end o. +CreateTouchButton=function(q)q.ChatTouchFrame=g('Frame','ChatTouchFrame',{Size= +UDim2.new(0,128,0,32),Position=UDim2.new(0,88,0,0),BackgroundTransparency=1, +Parent=q.Gui,g('ImageButton','ChatLabel',{Size=UDim2.new(0,74,0,28),Position= +UDim2.new(0,0,0,0),BackgroundTransparency=1,ZIndex=2}),g('ImageLabel', +'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'})})q. +TapToChatLabel=q.ChatTouchFrame.ChatLabel q.TouchLabelBackground=q. +ChatTouchFrame.Background q.ChatBar=g('TextBox','ChatBar',{Size=UDim2.new(1,0, +0.2,0),Position=UDim2.new(0,0,0.8,800),Text='',ZIndex=1,BackgroundTransparency=1 +,Parent=q.Frame,TextXAlignment=Enum.TextXAlignment.Left,TextColor3=Color3.new(1, +1,1),ClearTextOnFocus=false})return q.TapToChatLabel.MouseButton1Click:connect( +function()q.TapToChatLabel.Visible=false q.ChatBar:CaptureFocus()q.GotFocus=true +if q.TouchLabelBackground then q.TouchLabelBackground.Visible=false end end)end +o.CreateChatBar=function(q)local r,s r,s=pcall(function()return j.UseLuaChat end +)if a or(r and s)then q.ClickToChatButton=g('TextButton','ClickToChat',{Size= +UDim2.new(1,0,0,20),BackgroundTransparency=1,ZIndex=2,Parent=q.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})q.ChatBar=g('TextBox','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=q.Gui,TextXAlignment=Enum.TextXAlignment.Left +,TextColor3=Color3.new(1,1,1),FontSize=Enum.FontSize.Size12,ClearTextOnFocus= +false})local t,u t,u=pcall(function()return j:SetGlobalGuiInset(0,0,0,20)end)if +not t then j:SetGlobalSizeOffsetPixel(0,-20)end j:AddSpecialKey(Enum.SpecialKey. +ChatHotkey)j.SpecialKeyPressed:connect(function(v)if v==Enum.SpecialKey. +ChatHotkey then return o:FocusOnChatBar()end end)return q.ClickToChatButton. +MouseButton1Click:connect(function()return o:FocusOnChatBar()end)end end o. +CreateGui=function(q)q.Gui=b(h,'RobloxGui')q.Frame=g('Frame','ChatFrame',{Size= +UDim2.new(0,500,0,120),Position=UDim2.new(0,0,0,5),BackgroundTransparency=1, +ZIndex=0,Parent=q.Gui,Active=false,g('ImageLabel','Background',{Image= +'http://www.roblox.com/asset/?id=97120937',Size=UDim2.new(1.3,0,1.64,0),Position +=UDim2.new(0,0,0,0),BackgroundTransparency=1,ZIndex=0,Visible=false}),g('Frame', +'Border',{Size=UDim2.new(1,0,0,1),Position=UDim2.new(0,0,0.8,0), +BackgroundTransparency=0,BackgroundColor3=Color3.new(0.9254901960784314, +0.9254901960784314,0.9254901960784314),BorderSizePixel=0,Visible=false}),g( +'Frame','ChatRenderFrame',{Size=UDim2.new(1.02,0,1.01,0),Position=UDim2.new(0,0, +0,0),BackgroundTransparency=1,ZIndex=0,Active=false})})Spawn(function()wait(0.5) +if c()then q.Frame.Size=UDim2.new(0,280,0,120)end end)q.RenderFrame=q.Frame. +ChatRenderFrame if o:IsTouchDevice()then q.Frame.Position=q.Configuration. +Position q.RenderFrame.Size=UDim2.new(1,0,1,0)elseif q.Frame.AbsoluteSize.Y>120 +then o:ScreenSizeChanged()q.Gui.Changed:connect(function(r)if r=='AbsoluteSize' +then return o:ScreenSizeChanged()end end)end if a or e.ChatMode==Enum.ChatMode. +TextAndMenu then if o:IsTouchDevice()then o:CreateTouchButton()else o: +CreateChatBar()end if q.ChatBar then return q.ChatBar.FocusLost:connect(function +(r)o.GotFocus=false if o:IsTouchDevice()then q.ChatBar.Visible=false q. +TapToChatLabel.Visible=true if q.TouchLabelBackground then q. +TouchLabelBackground.Visible=true end end if r and q.ChatBar.Text~=''then local +s=q.ChatBar.Text if string.sub(q.ChatBar.Text,1,1)=='%'then s='(TEAM) '.. +tostring(string.sub(s,2,#s))pcall(function()return i:TeamChat(s)end)else pcall( +function()return i:Chat(s)end)end if q.ClickToChatButton then q. +ClickToChatButton.Visible=true end q.ChatBar.Text=''end return Spawn(function() +wait(5)if not o.GotFocus then o.Frame.Background.Visible=false end end)end)end +end end n.OnMouseScroll=function(q)Spawn(function()while n.Speed~=0 do if n. +Speed>1 then while n.Speed>0 do n.Speed=n.Speed-1 wait(0.25)end elseif n.Speed<0 +then while n.Speed<0 do n.Speed=n.Speed+1 wait(0.25)end end wait(0.03)end end)if +o:CheckIfInBounds(n.Speed)then return end return o:ScrollQueue()end n.ApplySpeed +=function(q,r)n.Speed=n.Speed+r if not q.Simulating then return n:OnMouseScroll( +)end end n.Initialize=function(q)q.Mouse.WheelBackward:connect(function()return +n:ApplySpeed(q.Configuration.DefaultSpeed)end)return q.Mouse.WheelForward: +connect(function()return n:ApplySpeed(q.Configuration.DefaultSpeed)end)end o. +FindMessageInSafeChat=function(q,r,s)local t=false for u,v in pairs(s)do if u==r +then return true end if type(s[u])=='table'then t=o:FindMessageInSafeChat(r,s[u] +)if t then return true end end end return t end o.PlayerChatted=function(q,...) +local r,s,t={...},nil,nil if r[2]then s=r[2]end if r[3]then t=r[3]if string.sub( +t,1,1)=='%'then t='(TEAM) '..tostring(string.sub(t,2,#t))end end if i. +ClassicChat then if not(string.sub(t,1,3)=='/e 'or string.sub(t,1,7)=='/emote ') +and(a or e.ChatMode==Enum.ChatMode.TextAndMenu)or(e.ChatMode==Enum.ChatMode.Menu +and string.sub(t,1,3)=='/sc')or o:FindMessageInSafeChat(t,q.SafeChat_List)then +return o:UpdateChat(s,t)end end end o.CullThread=function(q)while true do if#q. +MessageQueue>0 then for r,s in pairs(q.MessageQueue)do if s['SpawnTime']and s[ +'Player']and s['Message']and tick()-s['SpawnTime']>q.Configuration.LifeTime then +s['Player'].Visible=false s['Message'].Visible=false end end end wait(5)end end +o.LockAllFields=function(q,r)local s=r:GetChildren()for t=1,#s do s[t]. +RobloxLocked=true if#s[t]:GetChildren()>0 then o:LockAllFields(s[t])end end end +o.CoreGuiChanged=function(q,r,s)if r==Enum.CoreGuiType.Chat or r==Enum. +CoreGuiType.All then if q.Frame then q.Frame.Visible=s end if not o: +IsTouchDevice()and q.ChatBar then q.ChatBar.Visible=s return j: +SetGlobalGuiInset(0,0,0,(function()if s then return 20 else return 0 end end)()) +end end end o.Initialize=function(q)o:CreateGui()pcall(function()o: +CoreGuiChanged(Enum.CoreGuiType.Chat,Game.StarterGui:GetCoreGuiEnabled(Enum. +CoreGuiType.Chat))return Game.StarterGui.CoreGuiChangedSignal:connect(function(r +,s)return o:CoreGuiChanged(r,s)end)end)q.EventListener=i.PlayerChatted:connect( +function(...)return o:PlayerChatted(...)end)q.MessageThread=coroutine.create( +function()end)coroutine.resume(q.MessageThread)n:Initialize()i.ChildAdded: +connect(function()o.EventListener:disconnect()q.EventListener=i.PlayerChatted: +connect(function(...)return o:PlayerChatted(...)end)end)Spawn(function()return o +:CullThread()end)q.Frame.RobloxLocked=true o:LockAllFields(q.Frame)return q. +Frame.DescendantAdded:connect(function(r)return o:LockAllFields(r)end)end return +o:Initialize() \ No newline at end of file