From 9546433e44bc02210f81f92b2e0270721bae149b Mon Sep 17 00:00:00 2001 From: Lewin Kelly Date: Sat, 22 Apr 2023 13:44:19 +0100 Subject: [PATCH] Replace corescripts with original files for testing --- processed/107893730.lua | 1288 +++--------- processed/152908679.lua | 298 +-- processed/153556783.lua | 639 +----- processed/157877000.lua | 1050 ++-------- processed/36868950.lua | 152 +- processed/37801172.lua | 104 +- processed/38037565.lua | 279 +-- processed/39250920.lua | 684 ++---- processed/45284430.lua | 4343 ++++++++------------------------------- processed/45374389.lua | 21 +- processed/46295863.lua | 2974 +++++---------------------- processed/48488235.lua | 2970 ++++++-------------------- processed/48488398.lua | 319 +-- processed/48488451.lua | 111 +- processed/53878047.lua | 1022 +++------ processed/53878057.lua | 1296 +++--------- processed/60595411.lua | 894 ++------ processed/60595695.lua | 29 +- processed/73157242.lua | 2464 +++++----------------- processed/89449008.lua | 1053 ++-------- processed/89449093.lua | 487 +---- processed/97188756.lua | 1987 ++++-------------- 22 files changed, 5002 insertions(+), 19462 deletions(-) diff --git a/processed/107893730.lua b/processed/107893730.lua index 923d594..1683768 100644 --- a/processed/107893730.lua +++ b/processed/107893730.lua @@ -1,996 +1,292 @@ -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 +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 a,b,c,d,e,f,g,h,i,j, +k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=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,{}, +'http://www.roblox.com/Asset/?id='local z=y..'42557901'table.insert(x,z)local A= +y..'104651457'table.insert(x,A)local B=y..'104651515'table.insert(x,B)local C=y +..'104651532'table.insert(x,C)local D=y..'104651592'table.insert(x,D)local E=y.. +'104651639'table.insert(x,E)local F=y..'104651665'table.insert(x,F)local G=y.. +'104651707'table.insert(x,G)local H=y..'104651733'table.insert(x,H)local I=y.. +'104651761'table.insert(x,I)local J=y..'102481431'table.insert(x,J)local K=y.. +'102481419'table.insert(x,K)local L,M,N,O,P,Q,R,S,T,U='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.]] +function getSecureApiBaseUrl()local V=b V=string.gsub(V,'http','https')V=string. +gsub(V,'www','api')return V end function getRbxUtility()if not a then a= +LoadLibrary'RbxUtility'end return a end function preloadAssets()for V=1,#x do +game:GetService'ContentProvider':Preload(x[V])end end function +removeCurrentPurchaseInfo()d=nil e=nil f=nil g=nil h=nil c=nil i=nil j=false end +function closePurchasePrompt()p:TweenPosition(s,Enum.EasingDirection.Out,Enum. +EasingStyle.Quad,q,true,function()game.GuiService:RemoveCenterDialog(p) +hidePurchasing()p.Visible=false o=false end)end function +userPurchaseActionsEnded(V)j=false if V then local W=string.gsub(Q,'itemName', +tostring(c['Name']))p.BodyFrame.ItemPreview.ItemDescription.Text=W +setButtonsVisible(p.BodyFrame.OkPurchasedButton)hidePurchasing()else +signalPromptEnded(V)end end function signalPromptEnded(V)closePurchasePrompt()if +l then game:GetService'MarketplaceService':SignalPromptProductPurchaseFinished( +game.Players.LocalPlayer.userId,h,V)else game:GetService'MarketplaceService': +SignalPromptPurchaseFinished(game.Players.LocalPlayer,d,V)end +removeCurrentPurchaseInfo()end function updatePurchasePromptData(V)local W=''if +not h then h=c['ProductId']end if isFreeItem()then W=string.gsub(T,'itemName', +tostring(c['Name']))W=string.gsub(W,'assetType',tostring(assetTypeToString(c[ +'AssetTypeId'])))setHeaderText(M)else W=string.gsub(S,'itemName',tostring(c[ +'Name']))W=string.gsub(W,'currencyType',tostring(currencyTypeToString(e)))W= +string.gsub(W,'currencyAmount',tostring(f))setHeaderText(L)end p.BodyFrame. +ItemPreview.ItemDescription.Text=W if l then p.BodyFrame.ItemPreview.Image=b.. +'thumbs/asset.ashx?assetid='..tostring(c['IconImageAssetId']).. +'&x=100&y=100&format=png'else p.BodyFrame.ItemPreview.Image=b.. +'thumbs/asset.ashx?assetid='..tostring(d)..'&x=100&y=100&format=png'end end +function doPlayerFundsCheck(V)if j then local W,X=canPurchaseItem()if W and X +then local Y=1000 while(Y>0 or V)and X and j and W do wait(0.1)W,X= +canPurchaseItem()Y=Y-1 end end if W and not X then setButtonsVisible(p.BodyFrame +.BuyButton,p.BodyFrame.CancelButton,p.BodyFrame.AfterBalanceButton)end end end +function showPurchasePrompt()local V,W,X,Y,Z=canPurchaseItem()if V then +updatePurchasePromptData()if Y and Z then p.BodyFrame.ItemPreview. +ItemDescription.Text=Z p.BodyFrame.AfterBalanceButton.Visible=false end game. +GuiService:AddCenterDialog(p,Enum.CenterDialogType.ModalDialog,function()p. +Visible=true if isFreeItem()then setButtonsVisible(p.BodyFrame.FreeButton,p. +BodyFrame.CancelButton,p.BodyFrame.AfterBalanceButton)elseif X then p.BodyFrame. +AfterBalanceButton.Text= +[[You require an upgrade to your Builders Club membership to purchase this item. Click here to upgrade.]] +if not k then k=p.BodyFrame.AfterBalanceButton.MouseButton1Click:connect( +function()if p.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(p.BodyFrame. +BuyDisabledButton,p.BodyFrame.CancelButton,p.BodyFrame.AfterBalanceButton)elseif +W then setButtonsVisible(p.BodyFrame.BuyDisabledButton,p.BodyFrame.CancelButton, +p.BodyFrame.AfterBalanceButton)elseif Y then setButtonsVisible(p.BodyFrame. +BuyDisabledButton,p.BodyFrame.CancelButton)else setButtonsVisible(p.BodyFrame. +BuyButton,p.BodyFrame.CancelButton)end p:TweenPosition(r,Enum.EasingDirection. +Out,Enum.EasingStyle.Quad,q,true)if V and W and not m then j=true +doPlayerFundsCheck(true)end end,function()p.Visible=false end)else +doDeclinePurchase()end end function getToolAssetID(V)local W=game:GetService +'InsertService':LoadAsset(V)if not W then return nil end if W:IsA'Tool'then +return W end local X=W:GetChildren()for Y=1,#X do if X[Y]:IsA'Tool'then return X +[Y]end end return nil end function purchaseFailed(V)local W='Item'if c then W=c[ +'Name']end local X=string.gsub(R,'itemName',tostring(W))if V then X=string.gsub( +X,'errorReason',tostring(O))else X=string.gsub(X,'errorReason',tostring(P))end p +.BodyFrame.ItemPreview.ItemDescription.Text=X p.BodyFrame.ItemPreview.Image=z +setButtonsVisible(p.BodyFrame.OkButton)setHeaderText(N)hidePurchasing()end +function doAcceptPurchase(V)showPurchasing()local W,X,Y=tick(),'none',nil if l +then Y=getSecureApiBaseUrl()..'marketplace/submitpurchase?productId='..tostring( +h)..'¤cyTypeId='..tostring(currencyEnumToInt(e))..'&expectedUnitPrice='.. +tostring(f)..'&placeId='..tostring(Game.PlaceId)else Y=getSecureApiBaseUrl().. +'marketplace/purchase?productId='..tostring(h)..'¤cyTypeId='..tostring( +currencyEnumToInt(e))..'&purchasePrice='..tostring(f)..'&locationType=Game'.. +'&locationId='..Game.PlaceId end local Z,_=ypcall(function()X=game: +HttpPostAsync(Y,'RobloxPurchaseRequest')end)print( +'doAcceptPurchase success from ypcall is ',Z,'reason is',_)if(tick()-W)<1 then +wait(1)end if X=='none'or X==nil or X==''then print( +'did not get a proper response from web on purchase of',d,h)purchaseFailed() +return end X=getRbxUtility().DecodeJSON(X)if X then if X['success']==false then +if X['status']~='AlreadyOwned'then print( +'web return response of fail on purchase of',d,h)purchaseFailed((X['status']== +'EconomyDisabled'))return end end else print( +'web return response of non parsable JSON on purchase of',d)purchaseFailed() +return end if g and Z and d and tonumber(c['AssetTypeId'])==19 then local aa= +getToolAssetID(tonumber(d))if aa then aa.Parent=game.Players.LocalPlayer. +Backpack end end if l then if not X['receipt']then print( +[[tried to buy productId, but no receipt returned. productId was]],h) +purchaseFailed()return end Game:GetService'MarketplaceService': +SignalClientPurchaseSuccess(tostring(X['receipt']),game.Players.LocalPlayer. +userId,h)else userPurchaseActionsEnded(Z)end end function doDeclinePurchase() +userPurchaseActionsEnded(false)end function currencyEnumToInt(aa)if aa==Enum. +CurrencyType.Robux or aa==Enum.CurrencyType.Default then return 1 elseif aa== +Enum.CurrencyType.Tix then return 2 end end function assetTypeToString(aa)if aa +==1 then return'Image'elseif aa==2 then return'T-Shirt'elseif aa==3 then return +'Audio'elseif aa==4 then return'Mesh'elseif aa==5 then return'Lua'elseif aa==6 +then return'HTML'elseif aa==7 then return'Text'elseif aa==8 then return'Hat' +elseif aa==9 then return'Place'elseif aa==10 then return'Model'elseif aa==11 +then return'Shirt'elseif aa==12 then return'Pants'elseif aa==13 then return +'Decal'elseif aa==16 then return'Avatar'elseif aa==17 then return'Head'elseif aa +==18 then return'Face'elseif aa==19 then return'Gear'elseif aa==21 then return +'Badge'elseif aa==22 then return'Group Emblem'elseif aa==24 then return +'Animation'elseif aa==25 then return'Arms'elseif aa==26 then return'Legs'elseif +aa==27 then return'Torso'elseif aa==28 then return'Right Arm'elseif aa==29 then +return'Left Arm'elseif aa==30 then return'Left Leg'elseif aa==31 then return +'Right Leg'elseif aa==32 then return'Package'elseif aa==33 then return +'YouTube Video'elseif aa==34 then return'Game Pass'elseif aa==0 then return +'Product'end return''end function currencyTypeToString(aa)if aa==Enum. +CurrencyType.Tix then return'Tix'else return'R$'end end function +setCurrencyAmountAndType(aa,V)if e==Enum.CurrencyType.Default or e==Enum. +CurrencyType.Robux then if aa~=nil and aa~=0 then f=aa e=Enum.CurrencyType.Robux +else f=V e=Enum.CurrencyType.Tix end elseif e==Enum.CurrencyType.Tix then if V~= +nil and V~=0 then f=V e=Enum.CurrencyType.Tix else f=aa e=Enum.CurrencyType. +Robux end else return false end if f==nil then return false end return true end +function getPlayerBalance()local aa=nil local V,W=ypcall(function()aa=game: +HttpGetAsync(getSecureApiBaseUrl()..'currency/balance')end)if not V then print( +'Get player balance failed because',W)return nil end if aa==''then return nil +end aa=getRbxUtility().DecodeJSON(aa)return aa end function +openBuyCurrencyWindow()j=true game:GetService'GuiService':OpenBrowserWindow(b.. +'Upgrades/Robux.aspx')end function openBCUpSellWindow()Game:GetService +'GuiService':OpenBrowserWindow(b..'Upgrades/BuildersClubMemberships.aspx')end +function updateAfterBalanceText(aa,V)if isFreeItem()then p.BodyFrame. +AfterBalanceButton.Text=U return true,false end local W=nil if e==Enum. +CurrencyType.Robux then W='robux'elseif e==Enum.CurrencyType.Tix then W= +'tickets'end if not W then return false end local X=tonumber(aa[W])if not X then +return false end local Y=X-f if not V then if Y<0 and W=='robux'then if n==nil +then n=p.BodyFrame.AfterBalanceButton.MouseButton1Click:connect( +openBuyCurrencyWindow)end p.BodyFrame.AfterBalanceButton.Text='You need '.. +currencyTypeToString(e)..' '..tostring(-Y).. +' more to buy this, click here to purchase more.'return true,true elseif Y<0 and +W=='tickets'then p.BodyFrame.AfterBalanceButton.Text='You need '..tostring(-Y).. +' '..currencyTypeToString(e)..' more to buy this item.'return true,true end end +if n then n:disconnect()n=nil end p.BodyFrame.AfterBalanceButton.Text= +'Your balance after this transaction will be '..currencyTypeToString(e)..' '.. +tostring(Y)..'.'return true,false end function isFreeItem()return c and c[ +'IsForSale']==true and c['IsPublicDomain']==true end function +membershipTypeToNumber(aa)if aa==Enum.MembershipType.None then return 0 elseif +aa==Enum.MembershipType.BuildersClub then return 1 elseif aa==Enum. +MembershipType.TurboBuildersClub then return 2 elseif aa==Enum.MembershipType. +OutrageousBuildersClub then return 3 end return-1 end function canPurchaseItem() +local aa,V,W,X=false,false,nil,false if l then local Y=nil X=ypcall(function()Y= +Game:HttpGetAsync(getSecureApiBaseUrl()..'marketplace/productDetails?productid=' +..tostring(h))end)if X then c=getRbxUtility().DecodeJSON(Y)end else X=ypcall( +function()c=game:GetService'MarketplaceService':GetProductInfo(d)end)end if c== +nil or not X then W= +[[In-game sales are temporarily disabled. Please try again later.]]return true, +nil,nil,true,W end if not l then if not d then print +'current asset id is nil, this should always have a value'return false end if d +<=0 then print[[current asset id is negative, this should always be positive]] +return false end local Y,Z=ypcall(function()aa=game:HttpGetAsync( +getSecureApiBaseUrl()..'ownership/hasAsset?userId='..tostring(game.Players. +LocalPlayer.userId)..'&assetId='..tostring(d))end)if not Y then print( +'could not tell if player owns asset because',Z)return false end if aa==true or +aa=='true'then W='You already own this item.'return true,nil,nil,true,W end end +p.BodyFrame.AfterBalanceButton.Visible=true if type(c)~='table'then c= +getRbxUtility().DecodeJSON(c)end if not c then W= +'Could not get product info. Please try again later.'return true,nil,nil,true,W +end if c['IsForSale']==false and c['IsPublicDomain']==false then W= +'This item is no longer for sale.'return true,nil,nil,true,W end if not +setCurrencyAmountAndType(tonumber(c['PriceInRobux']),tonumber(c['PriceInTickets' +]))then W= +[[We could retrieve the price of the item correctly. Please try again later.]] +return true,nil,nil,true,W end local Y=getPlayerBalance()if not Y then W= +'Could not retrieve your balance. Please try again later.'return true,nil,nil, +true,W end if tonumber(c['MinimumMembershipLevel'])>membershipTypeToNumber(game. +Players.LocalPlayer.MembershipType)then V=true end local Z,_= +updateAfterBalanceText(Y,V)if V then p.BodyFrame.AfterBalanceButton.Active=true +return true,_,V,false end if c['ContentRatingTypeId']==1 then if game.Players. +LocalPlayer:GetUnder13()then W= +[[Your account is under 13 so purchase of this item is not allowed.]]return true +,nil,nil,true,W end end if(c['IsLimited']==true or c['IsLimitedUnique']==true) +and(c['Remaining']==''or c['Remaining']==0 or c['Remaining']==nil)then W= +[[All copies of this item have been sold out! Try buying from other users on the website.]] +return true,nil,nil,true,W end if not Z then W= +[[Could not update your balance. Please check back after some time.]]return true +,nil,nil,true,W end p.BodyFrame.AfterBalanceButton.Active=true return true,_ end +function startSpinner()u=true Spawn(function()local aa=0 while u do local V=0 +while V<8 do if V==aa or V==((aa+1)%8)then v[V+1].Image= +'http://www.roblox.com/Asset/?id=45880668'else v[V+1].Image= +'http://www.roblox.com/Asset/?id=45880710'end V=V+1 end aa=(aa+1)%8 wait( +6.666666666666666E-2)end end)end function stopSpinner()u=false end function +setButtonsVisible(...)local aa,V,W={...},select('#',...),p.BodyFrame: +GetChildren()for X=1,#W do if W[X]:IsA'GuiButton'then W[X].Visible=false for Y=1 +,V do if W[X]==aa[Y]then W[X].Visible=true break end end end end end function +createSpinner(aa,V,W)local X=Instance.new'Frame'X.Name='Spinner'X.Size=aa X. +Position=V X.BackgroundTransparency=1 X.ZIndex=10 X.Parent=W v={}local Y=1 while +Y<=8 do local Z=Instance.new'ImageLabel'Z.Name='Spinner'..Y Z.Size=UDim2.new(0, +16,0,16)Z.Position=UDim2.new(0.5+0.3*math.cos(math.rad(45*Y)),-8,0.5+0.3*math. +sin(math.rad(45*Y)),-8)Z.BackgroundTransparency=1 Z.ZIndex=10 Z.Image= +'http://www.roblox.com/Asset/?id=45880710'Z.Parent=X v[Y]=Z Y=Y+1 end end +function createPurchasePromptGui()p=Instance.new'Frame'p.Name='PurchaseFrame'p. +Size=UDim2.new(0,660,0,400)p.Position=s p.Visible=false p.BackgroundColor3= +Color3.new(0.5529411764705883,0.5529411764705883,0.5529411764705883)p. +BorderColor3=Color3.new(0.8,0.8,0.8)p.Parent=game.CoreGui.RobloxGui local aa= +Instance.new'Frame'aa.Name='BodyFrame'aa.Size=UDim2.new(1,0,1,-60)aa.Position= +UDim2.new(0,0,0,60)aa.BackgroundColor3=Color3.new(0.2627450980392157, +0.2627450980392157,0.2627450980392157)aa.BorderSizePixel=0 aa.ZIndex=8 aa.Parent +=p local V=createTextObject('TitleLabel','Buy Item','TextLabel',Enum.FontSize. +Size48)V.ZIndex=8 V.Size=UDim2.new(1,0,0,60)local W=V:Clone()W.Name= +'TitleBackdrop'W.TextColor3=Color3.new(0.12549019607843137,0.12549019607843137, +0.12549019607843137)W.BackgroundTransparency=0 W.BackgroundColor3=Color3.new( +0.21176470588235294,0.3764705882352941,0.6705882352941176)W.Position=UDim2.new(0 +,0,0,-2)W.ZIndex=8 W.Parent=p V.Parent=p local X,Y=90,createImageButton +'CancelButton'Y.Position=UDim2.new(0.5,(X/2),1,-120)Y.BackgroundTransparency=1 Y +.BorderSizePixel=0 Y.Parent=aa Y.Modal=true Y.ZIndex=8 Y.Image=D Y. +MouseButton1Down:connect(function()Y.Image=E end)Y.MouseButton1Up:connect( +function()Y.Image=D end)Y.MouseLeave:connect(function()Y.Image=D end)Y. +MouseButton1Click:connect(doDeclinePurchase)local Z=createImageButton'BuyButton' +Z.Position=UDim2.new(0.5,-153-(X/2),1,-120)Z.BackgroundTransparency=1 Z. +BorderSizePixel=0 Z.Image=A Z.ZIndex=8 Z.MouseButton1Down:connect(function()Z. +Image=B end)Z.MouseButton1Up:connect(function()Z.Image=A end)Z.MouseLeave: +connect(function()Z.Image=A end)Z.Parent=aa local _=Z:Clone()_.Name= +'BuyDisabledButton'_.AutoButtonColor=false _.Visible=false _.Active=false _. +Image=C _.ZIndex=8 _.Parent=aa local ab=Z:Clone()ab.BackgroundTransparency=1 ab. +Name='FreeButton'ab.Visible=false ab.ZIndex=8 ab.Image=H ab.MouseButton1Down: +connect(function()ab.Image=I end)ab.MouseButton1Up:connect(function()ab.Image=H +end)ab.MouseLeave:connect(function()ab.Image=H end)ab.Parent=aa local ac=Z: +Clone()ac.Name='OkButton'ac.BackgroundTransparency=1 ac.Visible=false ac. +Position=UDim2.new(0.5,-ac.Size.X.Offset/2,1,-120)ac.Modal=true ac.Image=F ac. +ZIndex=8 ac.MouseButton1Down:connect(function()ac.Image=G end)ac.MouseButton1Up: +connect(function()ac.Image=F end)ac.MouseLeave:connect(function()ac.Image=F end) +ac.Parent=aa local ad=ac:Clone()ad.ZIndex=8 ad.Name='OkPurchasedButton'ad. +MouseButton1Down:connect(function()ad.Image=G end)ad.MouseButton1Up:connect( +function()ad.Image=F end)ad.MouseLeave:connect(function()ad.Image=F end)ad. +Parent=aa ac.MouseButton1Click:connect(function()userPurchaseActionsEnded(false) +end)ad.MouseButton1Click:connect(function()if l then +userPurchaseProductActionsEnded(true)else signalPromptEnded(true)end end)Z. +MouseButton1Click:connect(function()doAcceptPurchase(Enum.CurrencyType.Robux)end +)ab.MouseButton1Click:connect(function()doAcceptPurchase(false)end)local ae= +Instance.new'ImageLabel'ae.Name='ItemPreview'ae.BackgroundColor3=Color3.new( +0.12549019607843137,0.12549019607843137,0.12549019607843137)ae.BorderColor3= +Color3.new(0.5529411764705883,0.5529411764705883,0.5529411764705883)ae.Position= +UDim2.new(0,30,0,20)ae.Size=UDim2.new(0,180,0,180)ae.ZIndex=9 ae.Parent=aa local +af=createTextObject('ItemDescription', +[[Would you like to buy the 'itemName' for currencyType currencyAmount?]], +'TextLabel',Enum.FontSize.Size24)af.Position=UDim2.new(1,20,0,0)af.Size=UDim2. +new(0,410,1,0)af.ZIndex=8 af.Parent=ae local ag=createTextObject( +'AfterBalanceButton','Place holder text ip sum lorem dodo ashs','TextButton', +Enum.FontSize.Size24)ag.AutoButtonColor=false ag.TextColor3=Color3.new( +0.8705882352941177,0.23137254901960785,0.11764705882352941)ag.Position=UDim2. +new(0,5,1,-55)ag.Size=UDim2.new(1,-10,0,50)ag.ZIndex=8 ag.Parent=aa local ah= +Instance.new'Frame'ah.Name='PurchasingFrame'ah.Size=UDim2.new(1,0,1,0)ah. +BackgroundColor3=Color3.new(0,0,0)ah.BackgroundTransparency=0.2 ah. +BorderSizePixel=0 ah.ZIndex=9 ah.Visible=false ah.Active=true ah.Parent=p local +ai=createTextObject('PurchasingLabel','Purchasing...','TextLabel',Enum.FontSize. +Size48)ai.Size=UDim2.new(1,0,1,0)ai.ZIndex=10 ai.Parent=ah createSpinner(UDim2. +new(0,50,0,50),UDim2.new(0.5,-25,0.5,30),ai)end function showPurchasing() +startSpinner()p.PurchasingFrame.Visible=true end function hidePurchasing()p. +PurchasingFrame.Visible=false stopSpinner()end function createTextObject(aa,ab, +ac,ad)local ae=Instance.new(ac)ae.Font=Enum.Font.ArialBold ae.TextColor3=Color3. +new(0.8509803921568627,0.8509803921568627,0.8509803921568627)ae.TextWrapped=true +ae.Name=aa ae.Text=ab ae.BackgroundTransparency=1 ae.BorderSizePixel=0 ae. +FontSize=ad return ae end function createImageButton(aa)local ab=Instance.new +'ImageButton'ab.Size=UDim2.new(0,153,0,46)ab.Name=aa return ab end function +setHeaderText(aa)p.TitleLabel.Text=aa p.TitleBackdrop.Text=aa end function +cutSizeInHalfRecursive(aa)end function doubleSizeRecursive(aa)end function +modifyForSmallScreen()cutSizeInHalfRecursive(p)end function modifyForLargeScreen +()doubleSizeRecursive(p)end function changeGuiToScreenSize(aa)if aa then +modifyForSmallScreen()else modifyForLargeScreen()end end function +doPurchasePrompt(aa,ab,ac,ad,ae)if not p then createPurchasePromptGui()end if aa +==game.Players.LocalPlayer then if o then return end o=true d=ab h=ae e=ad g=ac +l=(h~=nil)showPurchasePrompt()end end function userPurchaseProductActionsEnded( +aa)j=false if aa then closePurchasePrompt()if i then local ab=false if tostring( +i['isValid']):lower()=='true'then ab=true end Game:GetService +'MarketplaceService':SignalPromptProductPurchaseFinished(tonumber(i['playerId']) +,tonumber(i['productId']),ab)else print +'Something went wrong, no currentServerResponseTable'end +removeCurrentPurchaseInfo()else local ab=string.gsub(Q,'itemName',tostring(c[ +'Name']))p.BodyFrame.ItemPreview.ItemDescription.Text=ab setButtonsVisible(p. +BodyFrame.OkPurchasedButton)hidePurchasing()end end function +doProcessServerPurchaseResponse(aa)if not aa then print +'Server response table was nil, cancelling purchase'purchaseFailed()return end +if aa['playerId']and tonumber(aa['playerId'])==game.Players.LocalPlayer.userId +then i=aa userPurchaseProductActionsEnded(false)end end preloadAssets()game: +GetService'MarketplaceService'.PromptProductPurchaseRequested:connect(function( +aa,ab,ac,ad)doPurchasePrompt(aa,nil,ac,ad,ab)end)Game:GetService +'MarketplaceService'.PromptPurchaseRequested:connect(function(aa,ab,ac,ad) +doPurchasePrompt(aa,ab,ac,ad,nil)end)Game:GetService'MarketplaceService'. +ServerPurchaseVerification:connect(function(aa)doProcessServerPurchaseResponse( +aa)end)if m then Game:GetService'GuiService'.BrowserWindowClosed:connect( +function()doPlayerFundsCheck(false)end)end Game.CoreGui.RobloxGui.Changed: +connect(function()local aa=(game.CoreGui.RobloxGui.AbsoluteSize.Y<=w)if aa and +not t then changeGuiToScreenSize(true)elseif not aa and t then +changeGuiToScreenSize(false)end t=aa end)t=(game.CoreGui.RobloxGui.AbsoluteSize. +Y<=w)if t then changeGuiToScreenSize(true)end \ No newline at end of file diff --git a/processed/152908679.lua b/processed/152908679.lua index 664c2bf..fa6e953 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 +local a,b,c,d,e,f,g,h,i,j=Game:GetService'ContextActionService',Game:GetService +'UserInputService'.TouchEnabled,{},{},nil,nil, +'http://www.banland.xyz/asset/?id=97166756', +'http://www.banland.xyz/asset/?id=97166444',{},{[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 k=#j Game:GetService'ContentProvider':Preload(g)Game:GetService +'ContentProvider':Preload(h)while not Game.Players do wait()end while not Game. +Players.LocalPlayer do wait()end function createContextActionGui()if not e and b +then e=Instance.new'ScreenGui'e.Name='ContextActionGui'f=Instance.new'Frame'f. +BackgroundTransparency=1 f.Size=UDim2.new(0.3,0,0.5,0)f.Position=UDim2.new(0.7,0 +,0.5,0)f.Name='ContextButtonFrame'f.Parent=e end end function contextButtonDown( +l,m,n)if m.UserInputType==Enum.UserInputType.Touch then l.Image=g a: +CallFunction(n,Enum.UserInputState.Begin,m)end end function contextButtonMoved(l +,m,n)if m.UserInputType==Enum.UserInputType.Touch then l.Image=g a:CallFunction( +n,Enum.UserInputState.Change,m)end end function contextButtonUp(l,m,n)l.Image=h +if m.UserInputType==Enum.UserInputType.Touch and m.UserInputState==Enum. +UserInputState.End then a:CallFunction(n,Enum.UserInputState.End,m)end end +function isSmallScreenDevice()return Game:GetService'GuiService': +GetScreenResolution().y<=320 end function createNewButton(l,m)local n=Instance. +new'ImageButton'n.Name='ContextActionButton'n.BackgroundTransparency=1 n.Size= +UDim2.new(0,90,0,90)n.Active=true if isSmallScreenDevice()then n.Size=UDim2.new( +0,70,0,70)end n.Image=h n.Parent=f local o=nil Game:GetService'UserInputService' +.InputEnded:connect(function(p)i[p]=nil end)n.InputBegan:connect(function(p)if i +[p]then return end if p.UserInputState==Enum.UserInputState.Begin and o==nil +then o=p contextButtonDown(n,p,l)end end)n.InputChanged:connect(function(p)if i[ +p]then return end if o~=p then return end contextButtonMoved(n,p,l)end)n. +InputEnded:connect(function(p)if i[p]then return end if o~=p then return end o= +nil i[p]=true contextButtonUp(n,p,l)end)local p=Instance.new'ImageLabel'p.Name= +'ActionIcon'p.Position=UDim2.new(0.175,0,0.175,0)p.Size=UDim2.new(0.65,0,0.65,0) +p.BackgroundTransparency=1 if m['image']and type(m['image'])=='string'then p. +Image=m['image']end p.Parent=n local q=Instance.new'TextLabel'q.Name= +'ActionTitle'q.Size=UDim2.new(1,0,1,0)q.BackgroundTransparency=1 q.Font=Enum. +Font.SourceSansBold q.TextColor3=Color3.new(1,1,1)q.TextStrokeTransparency=0 q. +FontSize=Enum.FontSize.Size18 q.TextWrapped=true q.Text=''if m['title']and type( +m['title'])=='string'then q.Text=m['title']end q.Parent=n return n end function +createButton(l,m)local n,o=createNewButton(l,m),nil for p=1,#d do if d[p]== +'empty'then o=p break end end if not o then o=#d+1 end if o>k then return end d[ +o]=n c[l]['button']=n n.Position=j[o]n.Parent=f if e and e.Parent==nil then e. +Parent=Game.Players.LocalPlayer.PlayerGui end end function removeAction(l)if not +c[l]then return end local m=c[l]['button']if m then m.Parent=nil for n=1,#d do +if d[n]==m then d[n]='empty'break end end m:Destroy()end c[l]=nil end function +addAction(l,m,n)if c[l]then removeAction(l)end c[l]={n}if m and b then +createContextActionGui()createButton(l,n)end end a.BoundActionChanged:connect( +function(l,m,n)if c[l]and n then local o=c[l]['button']if o then if m=='image' +then o.ActionIcon.Image=n[m]elseif m=='title'then o.ActionTitle.Text=n[m]elseif +m=='position'then o.Position=n[m]end end end end)a.BoundActionAdded:connect( +function(l,m,n)addAction(l,m,n)end)a.BoundActionRemoved:connect(function(l,m) +removeAction(l)end)a.GetActionButtonEvent:connect(function(l)if c[l]then a: +FireActionButtonFoundSignal(l,c[l]['button'])end end)local l=a: +GetAllBoundActionInfo()for m,n in pairs(l)do addAction(m,n['createTouchButton'], +n)end \ No newline at end of file diff --git a/processed/153556783.lua b/processed/153556783.lua index 8b93e53..a9d54fa 100644 --- a/processed/153556783.lua +++ b/processed/153556783.lua @@ -1,527 +1,112 @@ -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() +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 a=Game:GetService'UserInputService'local b=pcall(function()a: +IsLuaTouchControls()end)if not b then script:Destroy()end local c=Game: +GetService'GuiService':GetScreenResolution()function isSmallScreenDevice()return +c.y<=320 end local d,e=Game.Players.LocalPlayer,120 if isSmallScreenDevice()then +e=70 end local f,g,h,i,j='rbxasset://textures/ui/TouchControlsSheet.png',5,0.92, +{},90 if isSmallScreenDevice()then j=70 end local k,l,m={},nil,0.007 local n,o,p +,q=m*16,0.03,0.2,nil Game:GetService'ContentProvider':Preload(f)function +DistanceBetweenTwoPoints(r,s)local t,u=s.x-r.x,s.y-r.y return math.sqrt((t*t)+(u +*u))end function transformFromCenterToTopLeft(r,s)return UDim2.new(0,r.x-s. +AbsoluteSize.x/2,0,r.y-s.AbsoluteSize.y/2)end function rotatePointAboutLocation( +r,s,t)local u,v,w=math.sin(t),math.cos(t),r w=Vector2.new(w.x-s.x,w.y-s.y)local +x,y=w.x*v-w.y*u,w.x*u+w.y*v w=Vector2.new(x+s.x,y+s.y)return w end function +dotProduct(r,s)return((r.x*s.x)+(r.y*s.y))end function +stationaryThumbstickTouchMove(r,s,t)local u=Vector2.new(s.Position.X.Offset+s. +AbsoluteSize.x/2,s.Position.Y.Offset+s.AbsoluteSize.y/2)local v= +DistanceBetweenTwoPoints(t,u)if v>(e/2)then local w=Vector2.new(t.x-u.x,t.y-u.y) +local x=w.unit if x.x==math.nan or x.x==math.inf then x=Vector2.new(0,x.y)end if +x.y==math.nan or x.y==math.inf then x=Vector2.new(x.x,0)end local y=u+(x*(e/2))r +.Position=transformFromCenterToTopLeft(y,r)else r.Position= +transformFromCenterToTopLeft(t,r)end return Vector2.new(r.Position.X.Offset-s. +Position.X.Offset,r.Position.Y.Offset-s.Position.Y.Offset)end function +followThumbstickTouchMove(r,s,t)local u=Vector2.new(s.Position.X.Offset+s. +AbsoluteSize.x/2,s.Position.Y.Offset+s.AbsoluteSize.y/2)if +DistanceBetweenTwoPoints(t,u)>e/2 then local v=Vector2.new(r.Position.X.Offset+r +.AbsoluteSize.x/2,r.Position.Y.Offset+r.AbsoluteSize.y/2)local w,x=Vector2.new(t +.x-v.x,t.y-v.y).unit,Vector2.new(v.x-u.x,v.y-u.y)local y,z=x.unit,Vector2.new(t. +x-v.x,t.y-v.y)local A=(y.x*w.y)-(y.y*w.x)local B=math.atan2(A,dotProduct(y,w)) +local C=B*math.min(z.magnitude/x.magnitude,1)if math.abs(C)>0.00001 then local D +=rotatePointAboutLocation(u,v,C)s.Position=transformFromCenterToTopLeft(Vector2. +new(D.x,D.y),s)end s.Position=UDim2.new(0,s.Position.X.Offset+z.x,0,s.Position.Y +.Offset+z.y)end r.Position=transformFromCenterToTopLeft(t,r)local v,w=Vector2. +new(r.Position.X.Offset,r.Position.Y.Offset),Vector2.new(s.Position.X.Offset,s. +Position.Y.Offset)if DistanceBetweenTwoPoints(v,w)>e/2 then local x=(w-v).unit*e +/2 s.Position=UDim2.new(0,v.x+x.x,0,v.y+x.y)end return Vector2.new(r.Position.X. +Offset-s.Position.X.Offset,r.Position.Y.Offset-s.Position.Y.Offset)end function +movementOutsideDeadZone(r)return((math.abs(r.x)>g)or(math.abs(r.y)>g))end +function constructThumbstick(r,s,t)local u=Instance.new'Frame'u.Name= +'ThumbstickFrame'u.Active=true u.Size=UDim2.new(0,e,0,e)u.Position=r u. +BackgroundTransparency=1 local v=Instance.new'ImageLabel'v.Name= +'OuterThumbstick'v.Image=f v.ImageRectOffset=Vector2.new(0,0)v.ImageRectSize= +Vector2.new(220,220)v.BackgroundTransparency=1 v.Size=UDim2.new(0,e,0,e)v. +Position=r v.Parent=Game.CoreGui.RobloxGui local w=Instance.new'ImageLabel'w. +Name='InnerThumbstick'w.Image=f w.ImageRectOffset=Vector2.new(220,0)w. +ImageRectSize=Vector2.new(111,111)w.BackgroundTransparency=1 w.Size=UDim2.new(0, +e/2,0,e/2)w.Position=UDim2.new(0,u.Size.X.Offset/2-e/4,0,u.Size.Y.Offset/2-e/4)w +.Parent=u w.ZIndex=2 local x,y,z=nil,nil,nil local A=function(A)if x then return +end if A==q then return end if A==l then return end if A.UserInputType~=Enum. +UserInputType.Touch then return end x=A table.insert(i,x)u.Position= +transformFromCenterToTopLeft(x.Position,u)v.Position=u.Position y=a.TouchMoved: +connect(function(B)if B==x then local C=nil if t then C= +stationaryThumbstickTouchMove(u,v,Vector2.new(B.Position.x,B.Position.y))else C= +followThumbstickTouchMove(u,v,Vector2.new(B.Position.x,B.Position.y))end if s +then s(C,v.Size.X.Offset/2)end end end)z=a.TouchEnded:connect(function(B)if B==x +then if s then s(Vector2.new(0,0),1)end z:disconnect()y:disconnect()u.Position=r +v.Position=r for C,D in pairs(i)do if D==x then table.remove(i,C)break end end x +=nil end end)end a.Changed:connect(function(B)if B=='ModalEnabled'then u.Visible +=not a.ModalEnabled v.Visible=not a.ModalEnabled end end)u.InputBegan:connect(A) +return u end function setupCharacterMovement(r)local s,t=nil local u=d. +MoveCharacter local v,w=function(v,w)if d then if movementOutsideDeadZone(v)then +s=v t=w if v.magnitude/w>h then w=v.magnitude-1 end u(d,v,w)else s=Vector2.new(0 +,0)t=1 u(d,s,t)end end end,UDim2.new(0,e/2,1,-e*1.75)if isSmallScreenDevice() +then w=UDim2.new(0,(e/2)-10,1,-e-20)end local x=constructThumbstick(w,v,false)x. +Name='CharacterThumbstick'x.Parent=r local y=function()if d and u and s and t +then u(d,s,t)end end return y end function setupJumpButton(r)local s=Instance. +new'ImageButton's.Name='JumpButton's.BackgroundTransparency=1 s.Image=f s. +ImageRectOffset=Vector2.new(176,222)s.ImageRectSize=Vector2.new(174,174)s.Size= +UDim2.new(0,j,0,j)if isSmallScreenDevice()then s.Position=UDim2.new(1,-(j*2.25), +1,-j-20)else s.Position=UDim2.new(1,-(j*2.75),1,-j-120)end local t=d. +JumpCharacter local u=function()while l do if d then t(d)end wait( +1.6666666666666665E-2)end end s.InputBegan:connect(function(v)if v.UserInputType +~=Enum.UserInputType.Touch then return end if l then return end if v==q then +return end for w,x in pairs(k)do if x==v then return end end l=v s. +ImageRectOffset=Vector2.new(0,222)s.ImageRectSize=Vector2.new(174,174)u()end)s. +InputEnded:connect(function(v)if v.UserInputType~=Enum.UserInputType.Touch then +return end s.ImageRectOffset=Vector2.new(176,222)s.ImageRectSize=Vector2.new(174 +,174)if v==l then table.insert(k,l)l=nil end end)a.InputEnded:connect(function(v +)for w,x in pairs(k)do if x==v then table.remove(k,w)break end end end)a.Changed +:connect(function(v)if v=='ModalEnabled'then s.Visible=not a.ModalEnabled end +end)s.Parent=r end function isTouchUsedByJumpButton(r)if r==l then return true +end for s,t in pairs(k)do if r==t then return true end end return false end +function isTouchUsedByThumbstick(r)for s,t in pairs(i)do if r==t then return +true end end return false end function setupCameraControl(r,s)local t,u,v,w,x,y, +z,A,B=nil,false,a.RotateCamera,-1,false,nil,a.ZoomCamera,{},nil local C,D= +function()q=nil u=false t=nil end,function()A={}y=nil x=false B:Destroy()B=nil +end local E=function(E,F)if B then B:Destroy()end B=Instance.new'Frame'B.Name= +'PinchFrame'B.BackgroundTransparency=1 B.Parent=r B.Size=UDim2.new(1,0,1,0)B. +InputChanged:connect(function(G)if not x then D()return end C()if y==nil then if +G==E then y=(G.Position-F.Position).magnitude E=G elseif G==F then y=(G.Position +-E.Position).magnitude F=G end else local H=0 if G==E then H=(G.Position-F. +Position).magnitude E=G elseif G==F then H=(G.Position-E.Position).magnitude F=G +end if H~=0 then local I=H-y if I~=0 then z(a,(I*o))end y=H end end end)B. +InputEnded:connect(function(G)if G==E or G==F then D()end end)end local F= +function(F)if#A<1 then table.insert(A,F)w=tick()x=false elseif#A==1 then x=(( +tick()-w)<=p)if x then table.insert(A,F)E(A[1],A[2])else A={}end end end r. +InputBegan:connect(function(G)if G.UserInputType~=Enum.UserInputType.Touch then +return end if isTouchUsedByJumpButton(G)then return end local H= +isTouchUsedByThumbstick(G)if not H then F(G)end if q==nil and not H then q=G t= +Vector2.new(q.Position.x,q.Position.y)end end)a.InputChanged:connect(function(G) +if G.UserInputType~=Enum.UserInputType.Touch then return end if q~=G then return +end local H=Vector2.new(q.Position.x,q.Position.y)local I=(t-H)*m if not u and(I +.magnitude>n)then u=true t=H end if u and(t~=H)then v(a,I)s()t=H end end)a. +InputEnded:connect(function(G)if q==G or q==nil then C()end for H,I in pairs(A) +do if I==G then table.remove(A,H)end end end)end function setupTouchControls() +local r=Instance.new'Frame'r.Name='TouchControlFrame'r.Size=UDim2.new(1,0,1,0)r. +BackgroundTransparency=1 r.Parent=Game.CoreGui.RobloxGui local s= +setupCharacterMovement(r)setupJumpButton(r)setupCameraControl(r,s)a. +ProcessedEvent:connect(function(t,u)if not u then return end if t==q and t. +UserInputState==Enum.UserInputState.Begin then q=nil end end)end do +setupTouchControls()end \ No newline at end of file diff --git a/processed/157877000.lua b/processed/157877000.lua index 6d4b7fa..e46ea9b 100644 --- a/processed/157877000.lua +++ b/processed/157877000.lua @@ -1,835 +1,215 @@ -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 +local a,b=assert(LoadLibrary'RbxUtility').Create,nil if script.Parent: +FindFirstChild'ControlFrame'then b=script.Parent:FindFirstChild'ControlFrame' +else b=script.Parent end local c,d,e=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 function initializeDeveloperConsole()if +e then return end e=true local f,g,h,i=1,2,1000,Vector2.new(245,180)local j,k,l, +m,n,o,p,q,r,s,t,u,v=f,{},{},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 w=a'Frame'{Name= +'OptionsHolder',Parent=v,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 x=a'Frame'{Name='OptionsBar',Parent=w, +BackgroundColor3=Color3.new(0,0,0),BackgroundTransparency=1,Position=UDim2.new(0 +,-250,0,4),Size=UDim2.new(0,234,0,18)}local y=a'TextButton'{Name= +'ErrorToggleButton',Parent=x,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=y,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 z=a'TextButton'{Name='InfoToggleButton',Parent=x,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=z, +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 A=a'TextButton'{Name +='OutputToggleButton',Parent=x,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=A,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 B=a'TextButton'{Name='WarningToggleButton',Parent=x,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=B, +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 C=a'TextButton'{Name +='WordWrapToggleButton',Parent=x,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=C,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=x, +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=x,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 D=a'Frame'{Name='ScrollBar',Parent=v,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 E=a'Frame'{Name='ScrollArea',Parent=D, +BackgroundTransparency=1,Position=UDim2.new(0,0,0,23),Size=UDim2.new(1,0,1,-46)} +local F=a'ImageButton'{Name='Handle',Parent=E,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=F,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 G=a'ImageButton'{Name='Down', +Parent=D,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=G,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 H=a +'ImageButton'{Name='Up',Parent=D,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=H,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 I=a'Frame'{Name='TextBox', +Parent=v,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 J,K=a +'Frame'{Name='TextHolder',Parent=I,BackgroundTransparency=1,Position=UDim2.new(0 +,0,0,0),Size=UDim2.new(1,0,1,0)},a'ImageButton'{Name='OptionsButton',Parent=v, +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=K, +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 L=a +'ImageButton'{Name='ResizeButton',Parent=v,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=L,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=v,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=v,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 M=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 N=a'ImageButton'{Name= +'CloseButton',Parent=M,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=N,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=M,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=M,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 O,P,Q,R,S,T,U,V,W=nil,nil,nil,nil,nil,nil,nil,false, +false function clean()O=nil P=nil Q=nil R=nil S=nil T=nil U=nil V=false W=false +end function refreshConsolePosition(X,Y)if not O then return end local Z=Vector2 +.new(X,Y)-O c.Position=UDim2.new(0,P.X+Z.X,0,P.Y+Z.Y)end M.TextButton. +MouseButton1Down:connect(function(X,Y)O=Vector2.new(X,Y)P=c.AbsolutePosition end +)M.TextButton.MouseButton1Up:connect(function(X,Y)clean()end)function +refreshConsoleSize(Y,Z)if not Q then return end local _=Vector2.new(Y,Z)-Q c. +Size=UDim2.new(0,math.max(R.X+_.X,i.X),0,math.max(R.Y+_.Y,i.Y))end c.Body. +ResizeButton.MouseButton1Down:connect(function(Y,Z)Q=Vector2.new(Y,Z)R=c. +AbsoluteSize end)c.Body.ResizeButton.MouseButton1Up:connect(function(Y,Z)clean() +end)M.CloseButton.MouseButton1Down:connect(function(Z,_)c.Visible=false end)c. +TitleBar.CloseButton.MouseButton1Up:connect(function()clean()end)local _,aa=true +,false function startAnimation()if aa then return end aa=true repeat if _ then u +=u-1 else u=u+1 end local ab=u/5 local ac=ab*ab*(3-(2*ab))K.ImageLabel.Rotation= +ac*5*9 x.Position=UDim2.new(0,(ac*5*50)-250,0,4)wait()if(u<=0 and _)or(u>=5 and +not _)then aa=false end until not aa end K.MouseButton1Down:connect(function(ab, +ac)_=not _ startAnimation()end)function changeOffset(ac)if j==f then m=m+ac +elseif j==g then n=n+ac end repositionList()end function +refreshTextHolderForReal()local ac,ad=J:GetChildren(),nil if j==f then ad=k +elseif j==g then ad=l end local ae=0 for af=1,#ac do ac[af].Visible=false end +for af=1,#ad do local ag,ah=nil,false if af>#ac then ag=a'TextLabel'{Name= +'Message',Parent=J,BackgroundTransparency=1,TextXAlignment='Left',Size=UDim2. +new(1,0,0,14),FontSize='Size10',ZIndex=1}ah=true else ag=ac[af]end if(r or ad[af +].Type~=Enum.MessageType.MessageOutput)and(q or ad[af].Type~=Enum.MessageType. +MessageInfo)and(p or ad[af].Type~=Enum.MessageType.MessageWarning)and(o or ad[af +].Type~=Enum.MessageType.MessageError)then ag.TextWrapped=s ag.Size=UDim2.new( +0.98,0,0,2000)ag.Parent=c ag.Text=ad[af].Time..' -- '..ad[af].Message ag.Size= +UDim2.new(0.98,0,0,ag.TextBounds.Y)ag.Position=UDim2.new(0,5,0,ae)ag.Parent=J ae +=ae+ag.TextBounds.Y if ah then if(j==f and m>0)or(j==g and n>0)then +changeOffset(ag.TextBounds.Y)end end ag.Visible=true if ad[af].Type==Enum. +MessageType.MessageError then ag.TextColor3=Color3.new(1,0,0)elseif ad[af].Type +==Enum.MessageType.MessageInfo then ag.TextColor3=Color3.new(0.4,0.5,1)elseif ad +[af].Type==Enum.MessageType.MessageWarning then ag.TextColor3=Color3.new(1,0.6, +0.4)else ag.TextColor3=Color3.new(1,1,1)end end end t=ae end local ac=false +function refreshTextHolder()if ac then return end Delay(0.1,function()ac=false +refreshTextHolderForReal()end)ac=true end local ad=0 function holdingUpButton() +if V then return end V=true wait(0.6)ad=ad+1 while V and ad<2 do wait() +changeOffset(12)end ad=ad-1 end function holdingDownButton()if W then return end +W=true wait(0.6)ad=ad+1 while W and ad<2 do wait()changeOffset(-12)end ad=ad-1 +end c.Body.ScrollBar.Up.MouseButton1Click:connect(function()changeOffset(10)end) +c.Body.ScrollBar.Up.MouseButton1Down:connect(function()changeOffset(10) +holdingUpButton()end)c.Body.ScrollBar.Up.MouseButton1Up:connect(function()clean( +)end)c.Body.ScrollBar.Down.MouseButton1Down:connect(function()changeOffset(-10) +holdingDownButton()end)c.Body.ScrollBar.Down.MouseButton1Up:connect(function() +clean()end)function handleScroll(ae,af)if not S then return end local ag,ah,ai=( +Vector2.new(ae,af)-S).Y,1-(c.Body.TextBox.AbsoluteSize.Y/J.AbsoluteSize.Y),E. +AbsoluteSize.Y-E.Handle.AbsoluteSize.Y local aj=math.max(math.min(ag,ai),0-ai) +local ak,al=aj/ai,(ah*J.AbsoluteSize.Y)local am=al*ak if j==f then m=U-am elseif +j==g then n=U-am end end E.Handle.MouseButton1Down:connect(function(ae,af)S= +Vector2.new(ae,af)T=E.Handle.AbsolutePosition if j==f then U=m elseif j==g then +U=n end end)E.Handle.MouseButton1Up:connect(function(ae,af)clean()end) +local function existsInsideContainer(af,ag,ah)local ai,aj=af.AbsolutePosition,af +.AbsoluteSize if agai.X+aj.X or ahai.y+aj.y then return +false end return true end function repositionList()if j==f then m=math.min(math. +max(m,0),t-c.Body.TextBox.AbsoluteSize.Y)J.Size=UDim2.new(1,0,0,t)elseif j==g +then n=math.min(math.max(n,0),t-c.Body.TextBox.AbsoluteSize.Y)J.Size=UDim2.new(1 +,0,0,t)end local af=c.Body.TextBox.AbsoluteSize.Y/J.AbsoluteSize.Y if af>=1 then +c.Body.ScrollBar.Visible=false c.Body.TextBox.Size=UDim2.new(1,-4,1,-28)if j==f +or j==g then J.Position=UDim2.new(0,0,1,0-t)end else c.Body.ScrollBar.Visible= +true c.Body.TextBox.Size=UDim2.new(1,-25,1,-28)local ag,ah=1-af,nil if j==f then +ah=m/J.AbsoluteSize.Y elseif j==g then ah=n/J.AbsoluteSize.Y end local ai,aj= +math.max(0,ag-ah),math.max(E.AbsoluteSize.Y*af,21)local ak=aj/E.AbsoluteSize.Y +local al=(1-ak)/(1-af)local am=ai*al local an=math.min(E.AbsoluteSize.Y*am,E. +AbsoluteSize.Y-aj)E.Handle.Size=UDim2.new(1,0,0,aj)E.Handle.Position=UDim2.new(0 +,0,0,an)if j==f then J.Position=UDim2.new(0,0,1,0-t+m)elseif j==g then J. +Position=UDim2.new(0,0,1,0-t+n)end end end local function numberWithZero(af) +return(af<10 and'0'or'')..af end local af='%s:%s:%s'function ConvertTimeStamp(ag +)local ah=ag-os.time()+math.floor(tick())local ai=ah%86400 local aj=math.floor( +ai/3600)ai=ai-(aj*3600)local ak=math.floor(ai/60)ai=ai-(ak*60)local al,am,an= +numberWithZero(aj),numberWithZero(ak),numberWithZero(ai)return af:format(al,am, +an)end x.ErrorToggleButton.MouseButton1Down:connect(function(ag,ah)o=not o x. +ErrorToggleButton.CheckFrame.Visible=o refreshTextHolder()repositionList()end)x. +WarningToggleButton.MouseButton1Down:connect(function(ah,ai)p=not p x. +WarningToggleButton.CheckFrame.Visible=p refreshTextHolder()repositionList()end) +x.InfoToggleButton.MouseButton1Down:connect(function(ai,aj)q=not q x. +InfoToggleButton.CheckFrame.Visible=q refreshTextHolder()repositionList()end)x. +OutputToggleButton.MouseButton1Down:connect(function(aj,ak)r=not r x. +OutputToggleButton.CheckFrame.Visible=r refreshTextHolder()repositionList()end)x +.WordWrapToggleButton.MouseButton1Down:connect(function(ak,al)s=not s x. +WordWrapToggleButton.CheckFrame.Visible=s refreshTextHolder()repositionList()end +)function AddLocalMessage(al,am,an)k[#k+1]={Message=al,Time=ConvertTimeStamp(an) +,Type=am}while#k>h do table.remove(k,1)end refreshTextHolder()repositionList() +end function AddServerMessage(al,am,an)l[#l+1]={Message=al,Time= +ConvertTimeStamp(an),Type=am}while#l>h do table.remove(l,1)end +refreshTextHolder()repositionList()end c.Body.LocalConsole.MouseButton1Click: +connect(function(al,am)if j==g then j=f local an,ao=c.Body.LocalConsole,c.Body. +ServerConsole an.Size=UDim2.new(0,90,0,20)ao.Size=UDim2.new(0,90,0,17)an. +BackgroundTransparency=0.6 ao.BackgroundTransparency=0.8 if game:FindFirstChild +'Players'and game.Players['LocalPlayer']then local ap=game.Players.LocalPlayer: +GetMouse()refreshConsolePosition(ap.X,ap.Y)refreshConsoleSize(ap.X,ap.Y) +handleScroll(ap.X,ap.Y)end refreshTextHolder()repositionList()end end)c.Body. +LocalConsole.MouseButton1Up:connect(function()clean()end)local am=false c.Body. +ServerConsole.MouseButton1Click:connect(function(an,ao)if not am then am=true +game:GetService'LogService':RequestServerOutput()end if j==f then j=g local ap, +aq=c.Body.LocalConsole,c.Body.ServerConsole aq.Size=UDim2.new(0,90,0,20)ap.Size= +UDim2.new(0,90,0,17)aq.BackgroundTransparency=0.6 ap.BackgroundTransparency=0.8 +if game:FindFirstChild'Players'and game.Players['LocalPlayer']then local ar=game +.Players.LocalPlayer:GetMouse()refreshConsolePosition(ar.X,ar.Y) +refreshConsoleSize(ar.X,ar.Y)handleScroll(ar.X,ar.Y)end refreshTextHolder() +repositionList()end end)c.Body.ServerConsole.MouseButton1Up:connect(function() +clean()end)if game:FindFirstChild'Players'and game.Players['LocalPlayer']then +local ao=game.Players.LocalPlayer:GetMouse()ao.Move:connect(function()if not c. +Visible then return end local ap=game.Players.LocalPlayer:GetMouse() +refreshConsolePosition(ap.X,ap.Y)refreshConsoleSize(ap.X,ap.Y)handleScroll(ap.X, +ap.Y)refreshTextHolder()repositionList()end)ao.Button1Up:connect(function() +clean()end)ao.WheelForward:connect(function()if not c.Visible then return end if +existsInsideContainer(c,ao.X,ao.Y)then changeOffset(10)end end)ao.WheelBackward: +connect(function()if not c.Visible then return end if existsInsideContainer(c,ao +.X,ao.Y)then changeOffset(-10)end end)end E.Handle.MouseButton1Down:connect( +function()repositionList()end)local ao=game:GetService'LogService': +GetLogHistory()for ap=1,#ao do AddLocalMessage(ao[ap].message,ao[ap].messageType +,ao[ap].timestamp)end game:GetService'LogService'.MessageOut:connect(function(ap +,aq)AddLocalMessage(ap,aq,os.time())end)game:GetService'LogService'. +ServerMessageOut:connect(AddServerMessage)end local aa=false function d.OnInvoke +()if aa then return end aa=true initializeDeveloperConsole()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..137c1da 100644 --- a/processed/36868950.lua +++ b/processed/36868950.lua @@ -1,127 +1,25 @@ -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 +local a=script.Parent:FindFirstChild'ControlFrame'if not a then return end local +b,c,d=a:FindFirstChild'BottomLeftControl',a:FindFirstChild'BottomRightControl', +Instance.new'TextLabel'd.Name='ToolTip'd.Text=''d.Font=Enum.Font.ArialBold d. +FontSize=Enum.FontSize.Size12 d.TextColor3=Color3.new(1,1,1)d.BorderSizePixel=0 +d.ZIndex=10 d.Size=UDim2.new(2,0,1,0)d.Position=UDim2.new(1,0,0,0)d. +BackgroundColor3=Color3.new(0,0,0)d.BackgroundTransparency=1 d.TextTransparency= +1 d.TextWrap=true local e=Instance.new'BoolValue'e.Name='inside'e.Value=false e. +Parent=d function setUpListeners(f)local g=0.1 f.Parent.MouseEnter:connect( +function()if f:FindFirstChild'inside'then f.inside.Value=true wait(1.2)if f. +inside.Value then while f.inside.Value and f.BackgroundTransparency>0 do f. +BackgroundTransparency=f.BackgroundTransparency-g f.TextTransparency=f. +TextTransparency-g wait()end end end end)function killTip(h)h.inside.Value=false +h.BackgroundTransparency=1 h.TextTransparency=1 end f.Parent.MouseLeave:connect( +function()killTip(f)end)f.Parent.MouseButton1Click:connect(function()killTip(f) +end)end function createSettingsButtonTip(f)if f==nil then f=b:FindFirstChild +'SettingsButton'end local g=d:clone()g.RobloxLocked=true g.Text= +'Settings/Leave Game'g.Position=UDim2.new(0,0,0,-18)g.Size=UDim2.new(0,120,0,20) +g.Parent=f setUpListeners(g)end wait(5)local f=b:GetChildren()for g=1,#f do if f +[g].Name=='Exit'then local h=d:clone()h.RobloxLocked=true h.Text='Leave Place'h. +Position=UDim2.new(0,0,-1,0)h.Size=UDim2.new(1,0,1,0)h.Parent=f[g] +setUpListeners(h)elseif f[g].Name=='SettingsButton'then createSettingsButtonTip( +f[g])end end local g=c:GetChildren()for h=1,#g do if g[h].Name:find'Camera'~=nil +then local i=d:clone()i.RobloxLocked=true i.Text='Camera View'if g[h].Name:find +'Zoom'then i.Position=UDim2.new(-1,0,-1.5)else i.Position=UDim2.new(0,0,-1.5,0) +end i.Size=UDim2.new(2,0,1.25,0)i.Parent=g[h]setUpListeners(i)end end \ No newline at end of file diff --git a/processed/37801172.lua b/processed/37801172.lua index 8595044..9d7d018 100644 --- a/processed/37801172.lua +++ b/processed/37801172.lua @@ -1,69 +1,35 @@ -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 +local a,b=game:GetService'ScriptContext',false pcall(function()b=game:GetService +'UserInputService'.TouchEnabled end)a:AddCoreScript(60595695,a, +'/Libraries/LibraryRegistration/LibraryRegistration')local function waitForChild +(c,d)while not c:FindFirstChild(d)do c.ChildAdded:wait()end end local c=game: +GetService'ScriptContext'c:AddCoreScript(59002209,c,'CoreScripts/Sections') +waitForChild(game:GetService'CoreGui','RobloxGui')local d=game:GetService +'CoreGui':FindFirstChild'RobloxGui'if not b then c:AddCoreScript(36868950,d, +'CoreScripts/ToolTip')c:AddCoreScript(46295863,d,'CoreScripts/Settings')else c: +AddCoreScript(153556783,d,'CoreScripts/TouchControls')end c:AddCoreScript( +39250920,d,'CoreScripts/MainBotChatScript')c:AddCoreScript(48488451,d, +'CoreScripts/PopupScript')c:AddCoreScript(48488398,d, +'CoreScripts/NotificationScript')c:AddCoreScript(97188756,d, +'CoreScripts/ChatScript')c:AddCoreScript(107893730,d, +'CoreScripts/PurchasePromptScript')if not b or d.AbsoluteSize.Y>600 then c: +AddCoreScript(48488235,d,'CoreScripts/PlayerListScript')else delay(5,function() +if d.AbsoluteSize.Y>=600 then c:AddCoreScript(48488235,d, +'CoreScripts/PlayerListScript')end end)end if game.CoreGui.Version>=3 and game. +PlaceId~=130815926 then c:AddCoreScript(53878047,d, +'CoreScripts/BackpackScripts/BackpackBuilder')waitForChild(d,'CurrentLoadout') +waitForChild(d,'Backpack')local e=d.Backpack if game.CoreGui.Version>=7 then c: +AddCoreScript(89449093,e,'CoreScripts/BackpackScripts/BackpackManager')end game: +GetService'ScriptContext':AddCoreScript(89449008,e, +'CoreScripts/BackpackScripts/BackpackGear')c:AddCoreScript(53878057,d. +CurrentLoadout,'CoreScripts/BackpackScripts/LoadoutScript')if game.CoreGui. +Version>=8 then c:AddCoreScript(-1,e, +'CoreScripts/BackpackScripts/BackpackWardrobe')end end local e=not not game. +Workspace:FindFirstChild'PSVariable'if e then game:GetService'ScriptContext': +AddCoreScript(64164692,game.Players.LocalPlayer,'BuildToolManager')end game. +Workspace.ChildAdded:connect(function(f)if f.Name=='PSVariable'and f:IsA +'BoolValue'then e=true game:GetService'ScriptContext':AddCoreScript(64164692, +game.Players.LocalPlayer,'BuildToolManager')end end)if b then c:AddCoreScript( +152908679,d,'CoreScripts/ContextActionTouch')waitForChild(d,'ControlFrame') +waitForChild(d.ControlFrame,'BottomLeftControl')d.ControlFrame.BottomLeftControl +.Visible=false waitForChild(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..64e0644 100644 --- a/processed/38037565.lua +++ b/processed/38037565.lua @@ -1,231 +1,48 @@ -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 +local a,b=5,5 function waitForChild(c,d)local e=c:findFirstChild(d)if e then +return e end while true do e=c.ChildAdded:wait()if e.Name==d then return e end +end end local c=script.Parent local d,e,f,g=waitForChild(c,'Humanoid'), +waitForChild(c,'Torso'),c:FindFirstChild'PlayerStats',Instance.new'BoolValue'g. +Name='InCharTag'local h=Instance.new'BoolValue'h.Name='RobloxBuildTool'local i,j +if f==nil then f=Instance.new'Configuration'f.Parent=c f.Name='PlayerStats'end +local k=f:FindFirstChild'MaxHealth'if k==nil then k=Instance.new'NumberValue'k. +Parent=f k.Value=100 k.Name='MaxHealth'end d.MaxHealth=k.Value d.Health=k.Value +function onMaxHealthChange()d.MaxHealth=k.Value d.Health=k.Value end k.Changed: +connect(onMaxHealthChange)local l=game.Players:GetPlayerFromCharacter(script. +Parent)local m=l.PlayerGui:FindFirstChild'DamageOverTimeGui'if m==nil then m= +Instance.new'BillboardGui'm.Name='DamageOverTimeGui'm.Parent=l.PlayerGui m. +Adornee=script.Parent:FindFirstChild'Head'm.Active=true m.size=UDim2.new(a,0,b,0 +)m.StudsOffset=Vector3.new(0,2,0)end print'newHealth declarations finished' +function billboardHealthChange(n)local o=Instance.new'TextLabel'if n>0 then o. +Text=tostring(n)o.TextColor3=Color3.new(0,1,0)else o.Text=tostring(n)o. +TextColor3=Color3.new(1,0,1)end o.size=UDim2.new(1,0,1,0)o.Active=true o. +FontSize=6 o.BackgroundTransparency=1 o.Parent=m for p=1,10 do wait(0.1)o. +TextTransparency=p/10 o.Position=UDim2.new(0,0,0,-p*5)o.FontSize=6-p*0.6 end o: +remove()end function setMaxHealth()if k.Value>=0 then d.MaxHealth=k.Value print( +d.MaxHealth)if d.Health>d.MaxHealth then d.Health=d.MaxHealth end end end k. +Changed:connect(setMaxHealth)local n=Instance.new'Fire'n.Heat=0.1 n.Size=3 n. +Name='FireEffect'n.Enabled=false while true do local o,p=wait(1),d.Health if p>0 +then local q=0 if f then local r,s,t,u,v=f:FindFirstChild'Regen',f: +FindFirstChild'Poison',f:FindFirstChild'Ice',f:FindFirstChild'Fire',f: +FindFirstChild'Stun'if r then q=q+r.Value.X if r.Value.Y>=0 then r.Value=Vector3 +.new(r.Value.X+r.Value.Z,r.Value.Y-o,r.Value.Z)elseif r.Value.Y==-1 then r.Value +=Vector3.new(r.Value.X+r.Value.Z,-1,r.Value.Z)else r:remove()end end if s then q +=q-s.Value.X if s.Value.Y>=0 then s.Value=Vector3.new(s.Value.X+s.Value.Z,s. +Value.Y-o,s.Value.Z)elseif s.Value.Y==-1 then s.Value=Vector3.new(s.Value.X+s. +Value.Z,-1,s.Value.Z)else s:remove()end end if t then q=q-t.Value.X if t.Value.Y +>=0 then t.Value=Vector3.new(t.Value.X,t.Value.Y-o,t.Value.Z)else t:remove()end +end if u then n.Enabled=true n.Parent=c.Torso q=q-u.Value.X if u.Value.Y>=0 then +u.Value=Vector3.new(u.Value.X,u.Value.Y-o,u.Value.Z)else u:remove()n.Enabled= +false n.Parent=nil end end if v then if v.Value>0 then e.Anchored=true i=script. +Parent:GetChildren()j=game.Players:GetPlayerFromCharacter(script.Parent). +Backpack:GetChildren()for w=1,#i do if i[w].className=='Tool'then g:Clone(). +Parent=i[w]print(j)table.insert(j,i[w])end end for w=1,#j do if j[w]: +FindFirstChild'RobloxBuildTool'==nil then h:Clone().Parent=j[w]j[w].Parent=game. +Lighting end end wait(0.2)for w=1,#j do j[w].Parent=game.Players: +GetPlayerFromCharacter(script.Parent).Backpack end v.Value=v.Value-o else e. +Anchored=false for w=1,#j do local x=j[w]:FindFirstChild'RobloxBuildTool'if x +then x:Remove()end j[w].Parent=game.Lighting end wait(0.2)for w=1,#j do local x= +j[w]:FindFirstChild'InCharTag'if x then x:Remove()j[w].Parent=script.Parent else +j[w].Parent=game.Players:GetPlayerFromCharacter(script.Parent).Backpack end end +v:Remove()end end if q~=0 then coroutine.resume(coroutine.create( +billboardHealthChange),q)end end p=d.Health+q*o if p*1.010 then d.Health=d.MaxHealth end end end \ No newline at end of file diff --git a/processed/39250920.lua b/processed/39250920.lua index df12ac6..f03cd0b 100644 --- a/processed/39250920.lua +++ b/processed/39250920.lua @@ -1,542 +1,142 @@ -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() +function waitForProperty(a,b)while not a[b]do a.Changed:wait()end end function +waitForChild(a,b)while not a:FindFirstChild(b)do a.ChildAdded:wait()end end +local a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=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 +waitForChild(game,'CoreGui')waitForChild(game.CoreGui,'RobloxGui')if game. +CoreGui.RobloxGui:FindFirstChild'ControlFrame'then u=game.CoreGui.RobloxGui. +ControlFrame else u=game.CoreGui.RobloxGui end function currentTone()if e then +return e.Tone else return Enum.DialogTone.Neutral end end function +createChatNotificationGui()o=Instance.new'BillboardGui'o.Name= +'ChatNotificationGui'o.ExtentsOffset=Vector3.new(0,1,0)o.Size=UDim2.new(4,0, +5.42857122,0)o.SizeOffset=Vector2.new(0,0)o.StudsOffset=Vector3.new(0.4,4.3,0)o. +Enabled=true o.RobloxLocked=true o.Active=true local v=Instance.new'ImageLabel'v +.Name='Image'v.Active=false v.BackgroundTransparency=1 v.Position=UDim2.new(0,0, +0,0)v.Size=UDim2.new(1,0,1,0)v.Image=''v.RobloxLocked=true v.Parent=o local w= +Instance.new'ImageButton'w.Name='Button'w.AutoButtonColor=false w.Position=UDim2 +.new(0.0879999995,0,0.0529999994,0)w.Size=UDim2.new(0.829999983,0,0.460000008,0) +w.Image=''w.BackgroundTransparency=1 w.RobloxLocked=true w.Parent=v end function +getChatColor(v)if v==Enum.DialogTone.Neutral then return Enum.ChatColor.Blue +elseif v==Enum.DialogTone.Friendly then return Enum.ChatColor.Green elseif v== +Enum.DialogTone.Enemy then return Enum.ChatColor.Red end end function +styleChoices(v)for w,x in pairs(b)do resetColor(x,v)end resetColor(c,v)end +function styleMainFrame(v)if v==Enum.DialogTone.Neutral then a.Style=Enum. +FrameStyle.ChatBlue a.Tail.Image= +'rbxasset://textures/chatBubble_botBlue_tailRight.png'elseif v==Enum.DialogTone. +Friendly then a.Style=Enum.FrameStyle.ChatGreen a.Tail.Image= +'rbxasset://textures/chatBubble_botGreen_tailRight.png'elseif v==Enum.DialogTone +.Enemy then a.Style=Enum.FrameStyle.ChatRed a.Tail.Image= +'rbxasset://textures/chatBubble_botRed_tailRight.png'end styleChoices(v)end +function setChatNotificationTone(v,w,x)if x==Enum.DialogTone.Neutral then v. +Image.Image='rbxasset://textures/chatBubble_botBlue_notify_bkg.png'elseif x== +Enum.DialogTone.Friendly then v.Image.Image= +'rbxasset://textures/chatBubble_botGreen_notify_bkg.png'elseif x==Enum. +DialogTone.Enemy then v.Image.Image= +'rbxasset://textures/chatBubble_botRed_notify_bkg.png'end if w==Enum. +DialogPurpose.Quest then v.Image.Button.Image= +'rbxasset://textures/chatBubble_bot_notify_bang.png'elseif w==Enum.DialogPurpose +.Help then v.Image.Button.Image= +'rbxasset://textures/chatBubble_bot_notify_question.png'elseif w==Enum. +DialogPurpose.Shop then v.Image.Button.Image= +'rbxasset://textures/chatBubble_bot_notify_money.png'end end function +createMessageDialog()p=Instance.new'Frame'p.Name='DialogScriptMessage'p.Style= +Enum.FrameStyle.RobloxRound p.Visible=false local v=Instance.new'TextLabel'v. +Name='Text'v.Position=UDim2.new(0,0,0,-1)v.Size=UDim2.new(1,0,1,0)v.FontSize= +Enum.FontSize.Size14 v.BackgroundTransparency=1 v.TextColor3=Color3.new(1,1,1)v. +RobloxLocked=true v.Parent=p end function showMessage(v,w)p.Text.Text=v p.Size= +UDim2.new(0,w,0,40)p.Position=UDim2.new(0.5,-w/2,0.5,-40)p.Visible=true wait(2)p +.Visible=false end function variableDelay(v)local w=math.min(string.len(v),100) +wait(0.75+((w/75)*1.5))end function resetColor(v,w)if w==Enum.DialogTone.Neutral +then v.BackgroundColor3=Color3.new(0,0,0.7019607843137254)v.Number.TextColor3= +Color3.new(0.17647058823529413,0.5568627450980392,0.9607843137254902)elseif w== +Enum.DialogTone.Friendly then v.BackgroundColor3=Color3.new(0, +0.30196078431372547,0)v.Number.TextColor3=Color3.new(0,0.7450980392156863,0) +elseif w==Enum.DialogTone.Enemy then v.BackgroundColor3=Color3.new( +0.5490196078431373,0,0)v.Number.TextColor3=Color3.new(1,0.34509803921568627, +0.30980392156862746)end end function highlightColor(v,w)if w==Enum.DialogTone. +Neutral then v.BackgroundColor3=Color3.new(7.8431372549019605E-3, +0.4235294117647059,1)v.Number.TextColor3=Color3.new(1,1,1)elseif w==Enum. +DialogTone.Friendly then v.BackgroundColor3=Color3.new(0,0.5019607843137255,0)v. +Number.TextColor3=Color3.new(1,1,1)elseif w==Enum.DialogTone.Enemy then v. +BackgroundColor3=Color3.new(0.8,0,0)v.Number.TextColor3=Color3.new(1,1,1)end end +function endDialog()if g then g:Remove()g=nil end local v=e e=nil if v and v. +InUse then local w=r:Clone()w.archivable=false w.Disabled=false w.Parent=v end +for w,x in pairs(s)do if w and x then x.Enabled=not w.InUse end end f=nil end +function wanderDialog()print'Wander'a.Visible=false endDialog()showMessage(j,k) +end function timeoutDialog()print'Timeout'a.Visible=false endDialog() +showMessage(l,m)end function normalEndDialog()print'Done'endDialog()end function +sanitizeMessage(w)if string.len(w)==0 then return'...'else return w end end +function selectChoice(w)renewKillswitch(e)a.Visible=false if w==c then game.Chat +:Chat(game.Players.LocalPlayer.Character,'Goodbye!',getChatColor(currentTone())) +normalEndDialog()else local x=d[w]game.Chat:Chat(game.Players.LocalPlayer. +Character,sanitizeMessage(x.UserDialog),getChatColor(currentTone()))wait(1)e: +SignalDialogChoiceSelected(n,x)game.Chat:Chat(f,sanitizeMessage(x.ResponseDialog +),getChatColor(currentTone()))variableDelay(x.ResponseDialog) +presentDialogChoices(f,x:GetChildren())end end function newChoice(w)local x= +Instance.new'TextButton'x.BackgroundColor3=Color3.new(0,0,0.7019607843137254)x. +AutoButtonColor=false x.BorderSizePixel=0 x.Text=''x.MouseEnter:connect(function +()highlightColor(x,currentTone())end)x.MouseLeave:connect(function()resetColor(x +,currentTone())end)x.MouseButton1Click:connect(function()selectChoice(x)end)x. +RobloxLocked=true local y=Instance.new'TextLabel'y.Name='Number'y.TextColor3= +Color3.new(0.4980392156862745,0.8313725490196079,1)y.Text=w y.FontSize=Enum. +FontSize.Size14 y.BackgroundTransparency=1 y.Position=UDim2.new(0,4,0,2)y.Size= +UDim2.new(0,20,0,24)y.TextXAlignment=Enum.TextXAlignment.Left y.TextYAlignment= +Enum.TextYAlignment.Top y.RobloxLocked=true y.Parent=x local z=Instance.new +'TextLabel'z.Name='UserPrompt'z.BackgroundTransparency=1 z.TextColor3=Color3. +new(1,1,1)z.FontSize=Enum.FontSize.Size14 z.Position=UDim2.new(0,28,0,2)z.Size= +UDim2.new(1,-32,1,-4)z.TextXAlignment=Enum.TextXAlignment.Left z.TextYAlignment= +Enum.TextYAlignment.Top z.TextWrap=true z.RobloxLocked=true z.Parent=x return x +end function initialize(w)b[1]=newChoice'1)'b[2]=newChoice'2)'b[3]=newChoice'3)' +b[4]=newChoice'4)'c=newChoice'5)'c.UserPrompt.Text='Goodbye!'c.Size=UDim2.new(1, +0,0,28)a=Instance.new'Frame'a.Name='UserDialogArea'a.Size=UDim2.new(0,350,0,200) +a.Style=Enum.FrameStyle.ChatBlue a.Visible=false local x=Instance.new +'ImageLabel'x.Name='Tail'x.Size=UDim2.new(0,62,0,53)x.Position=UDim2.new(1,8, +0.25)x.Image='rbxasset://textures/chatBubble_botBlue_tailRight.png'x. +BackgroundTransparency=1 x.RobloxLocked=true x.Parent=a for y,z in pairs(b)do z. +RobloxLocked=true z.Parent=a end c.RobloxLocked=true c.Parent=a a.RobloxLocked= +true a.Parent=w end function presentDialogChoices(w,x)if not e then return end f +=w local y={}for z,A in pairs(x)do if A:IsA'DialogChoice'then table.insert(y,A) +end end table.sort(y,function(B,C)return B.Name=e.ConversationDistance)then wanderDialog()end wait(1)end end function +startDialog(w)if w.Parent and w.Parent:IsA'BasePart'then if n: +DistanceFromCharacter(w.Parent.Position)>=w.ConversationDistance then +showMessage(h,i)return end for x,y in pairs(s)do if x and y then y.Enabled=false +end end renewKillswitch(x)delay(1,checkForLeaveArea)doDialog(x)end end function +removeDialog(w)if s[w]then s[w]:Remove()s[w]=nil end if t[w]then t[w]: +disconnect()t[w]=nil end end function addDialog(w)if w.Parent then if w.Parent: +IsA'BasePart'then local x=o:clone()x.Enabled=not w.InUse x.Adornee=w.Parent x. +RobloxLocked=true x.Parent=game.CoreGui x.Image.Button.MouseButton1Click: +connect(function()startDialog(w)end)setChatNotificationTone(x,w.Purpose,w.Tone)s +[w]=x t[w]=w.Changed:connect(function(y)if y=='Parent'and w.Parent then +removeDialog(w)addDialog(w)elseif y=='InUse'then x.Enabled=not e and not w.InUse +if w==e then timeoutDialog()end elseif y=='Tone'or y=='Purpose'then +setChatNotificationTone(x,w.Purpose,w.Tone)end end)else t[w]=w.Changed:connect( +function(x)if x=='Parent'and w.Parent then removeDialog(w)addDialog(w)end end) +end end end function fetchScripts()local w=game:GetService'InsertService': +LoadAsset(39226062)if type(w)=='string'then wait(0.1)w=game:GetService +'InsertService':LoadAsset(39226062)end if type(w)=='string'then return end +waitForChild(w,'TimeoutScript')q=w.TimeoutScript waitForChild(w, +'ReenableDialogScript')r=w.ReenableDialogScript end function onLoad() +waitForProperty(game.Players,'LocalPlayer')n=game.Players.LocalPlayer +waitForProperty(n,'Character')fetchScripts()createChatNotificationGui() +createMessageDialog()p.RobloxLocked=true p.Parent=u waitForChild(u, +'BottomLeftControl')local w=Instance.new'Frame'w.Name='DialogFrame'w.Position= +UDim2.new(0,0,0,0)w.Size=UDim2.new(0,0,0,0)w.BackgroundTransparency=1 w. +RobloxLocked=true w.Parent=u.BottomLeftControl initialize(w)game. +CollectionService.ItemAdded:connect(function(x)if x:IsA'Dialog'then addDialog(x) +end end)game.CollectionService.ItemRemoved:connect(function(x)if x:IsA'Dialog' +then removeDialog(x)end end)for x,y in pairs(game.CollectionService: +GetCollection'Dialog')do if y:IsA'Dialog'then addDialog(y)end end end onLoad() \ No newline at end of file diff --git a/processed/45284430.lua b/processed/45284430.lua index f095785..eaac569 100644 --- a/processed/45284430.lua +++ b/processed/45284430.lua @@ -1,3449 +1,894 @@ -print("[Mercury]: Loaded corescript 45284430") -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 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 ~= nil then - syncFunc() - end - end - if eventConnection then - eventConnection:disconnect() - if removeFunc ~= nil then - return removeFunc() - end - return nil - 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 + buttonSize * (buttonNum - 1), 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 - local _obj_0 = areaSoakMouseMoveCon - if _obj_0 ~= nil then - return _obj_0:disconnect() - end - return nil -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("ImageLabel", "StyleImage", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 5, 0, 15) - }), - 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 = frame.StyleImage - 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 - 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, - Parent = script.Parent, - 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 itemCount = #items - local dropDownItemCount = itemCount - local useScrollButtons = false - if dropDownItemCount > 6 then - useScrollButtons = true - dropDownItemCount = 6 - end - local frame = New("Frame", "DropDownMenu", { - BackgroundTransparency = 1, - Size = UDim2.new(width, height), - 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), - ZIndex = 2 - }), - 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), - 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 dropDownMenu, droppedDownMenu = frame.DropDownMenuButton, frame.List - 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 = UDim2.new((function() - if useScrollButtons then - return 1, -13, 0.8 / ((dropDownItemCount + 1) * 0.8), 0 - else - return 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, 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), - Parent = droppedDownMenu - }) - local incScrollMouseCount - incScrollMouseCount = function() - scrollMouseCount = scrollMouseCount + 1 - end - scrollUpButton.MouseButton1Click:connect(incScrollMouseCount) - scrollUpButton.MouseLeave:connect(incScrollMouseCount) - 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) - 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(incScrollMouseCount) - scrollDownButton.MouseLeave:connect(incScrollMouseCount) - 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 not (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, updateSelection = t.CreateDropDownMenu(names, function(text) - instance[property] = nameToItem[text] - end) - local t1 - t1 = function(prop) - if prop == property then - return updateSelection(instance[property].Name) - end - end - local t2 - t2 = function() - return updateSelection(instance[property].Name) - end - ScopedConnect(frame, instance, "Changed", t1, t2) - return frame -end -t.GetFontHeight = function(font, fontSize) - if not ((font ~= nil) and (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 " .. tostring(font)) - end -end -local layoutGuiObjectsHelper -layoutGuiObjectsHelper = function(frame, guiObjects, settingsTable) - local totalPixels = frame.AbsoluteSize.Y - local pixelsRemaining = totalPixels - for _, child in ipairs(guiObjects) do - if child:IsA("TextLabel") or child:IsA("TextButton") then - local isLabel = child:IsA("TextLabel") - local settingsTableIndex = "Text" .. tostring((function() - if isLabel then - return "Label" - else - return "Button" - end - end)()) .. "PositionPadY" - pixelsRemaining = pixelsRemaining - settingsTable[settingsTableIndex] - 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 - child.Size = UDim2.new(child.Size.X.Scale, child.Size.X.Offset, 0, child.TextBounds.Y + settingsTable[settingsTableIndex]) - while not child.TextFits do - child.Size = UDim2.new(child.Size.X.Scale, child.Size.X.Offset, 0, child.AbsoluteSize.Y + 1) - end - pixelsRemaining = pixelsRemaining - child.AbsoluteSize.Y - pixelsRemaining = pixelsRemaining - settingsTable[settingsTableIndex] - 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, - New("IntValue", "SliderSteps", { - Value = steps - }), - New("IntValue", "SliderPosition", { - Value = 0 - }), - New("TextButton", "Bar", { - Text = "", - AutoButtonColor = false, - BackgroundColor3 = Color3.new(0, 0, 0), - Size = UDim2.new(0, (function() - if type(width) == "number" then - return width - else - return 200 - end - end)(), 0, 5), - BorderColor3 = Color3.new(95 / 255, 95 / 255, 95 / 255), - ZIndex = 2, - 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 - }) - }) - }) - local areaSoak = New("TextButton", "AreaSoak", { - Text = "", - BackgroundTransparency = 1, - Active = false, - Size = UDim2.new(1, 0, 1, 0), - Visible = false, - ZIndex = 4 - }) - local slider, bar, sliderPosition, sliderSteps = sliderGui.Bar.Slider, sliderGui.Bar, sliderGui.SliderPosition, sliderGui.SliderSteps - sliderGui.AncestryChanged:connect(function(_, parent) - if not (parent ~= nil) then - areaSoak.Parent = nil - else - areaSoak.Parent = getScreenGuiAncestor(sliderGui) - end - end) - 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 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 ~= nil 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 desantsChangeConMap = { } - local scrollingFrame = New("Frame", "ScrollingFrame", { - Active = true, - Size = UDim2.new(1, 0, 1, 0), - ClipsDesants = true, - New("Frame", "ControlFrame", { - BackgroundTransparency = 1, - Size = UDim2.new(0, 18, 1, 0), - Position = UDim2.new(1, -20, 0, 0), - New("BoolValue", "ScrollBottom", { - Value = false - }), - New("BoolValue", "scrollUp", { - Value = false - }), - 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 - }), - New("Frame", "ScrollTrack", { - BackgroundTransparency = 1, - Size = UDim2.new(0, 18, 1, -38), - Position = UDim2.new(0, 0, 0, 19), - 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), - 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 - }) - }) - }) - }) - }) - local controlFrame, scrollBottom, scrollUp, scrollUpButton, scrollTrack, scrollbar, scrollNub = scrollingFrame.ControlFrame, scrollingFrame.ControlFrame.ScrollBottom, scrollingFrame.ControlFrame.ScrollUp, scrollingFrame.ControlFrame.ScrollUpButton, scrollingFrame.ControlFrame.ScrollTrack, scrollingFrame.ControlFrame.ScrollTrack.ScrollBar, scrollingFrame.ControlFrame.ScrollTrack.ScrollBar.ScrollNub - 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() - do - 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 - end - 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", { - Active = false, - Size = UDim2.new(1.5, 0, 1.5, 0), - AutoButtonColor = false, - BackgroundTransparency = 1, - Name = "mouseDrag", - 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:IsDesantOf(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 ~= nil then - dragCon:disconnect() - end - dragCon = nil - if upCon ~= nil then - upCon:disconnect() - end - upCon = nil - 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 - scrollStamp = tick() - local mouseOffset = y - scrollbar.AbsolutePosition.y - if dragCon ~= nil then - dragCon:disconnect() - end - dragCon = nil - if upCon ~= nil then - upCon:disconnect() - end - upCon = nil - 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() - local 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 desantChanged - desantChanged = 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.DesantAdded:connect(function(instance) - if not instance:IsA("GuiObject") then - return - end - if instance.Visible then - wait() - highLowRecheck() - end - desantsChangeConMap[instance] = instance.Changed:connect(function(prop) - return desantChanged(instance, prop) - end) - end) - scrollingFrame.DesantRemoving:connect(function(instance) - if not instance:IsA("GuiObject") then - return - end - if desantsChangeConMap[instance] then - desantsChangeConMap[instance]:disconnect() - desantsChangeConMap[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), - New("ImageButton", "ScrollDrag", { - Image = "http://www.roblox.com/asset/?id=61367186", - Size = UDim2.new(1, 0, 0, 16), - BackgroundTransparency = 1, - Active = true - }) - }) - local scrollDrag = scrollbar.scrollDrag - 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 scrollStamp = 0 - 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 = 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 = 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() - local 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) - scrollUpButton.MouseButton1Up:connect(function() - scrollStamp = tick() - end) - scrollDownButton.MouseButton1Up:connect(function() - scrollStamp = tick() - 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.AncestryChanged:connect(function() - return recalculate(nil) - end) - frame.Changed:connect(function(prop) - if prop == "AbsoluteSize" then - return recalculate(nil) - end - 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 (not (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 (not (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 -end -t.AutoTruncateTextObject = function(textLabel) - local text = textLabel.Text - local fullLabel = textLabel:Clone() - fullLabel.Name = "Full" .. tostring(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 not (getGuiOwner(textLabel) ~= nil) then - return - end - textLabel.Text = text - if textLabel.TextFits then - if mouseEnterConnection ~= nil then - mouseEnterConnection:disconnect() - end - mouseEnterConnection = nil - if mouseLeaveConnection ~= nil then - mouseLeaveConnection:disconnect() - end - mouseLeaveConnection = nil - else - local len = string.len(text) - textLabel.Text = tostring(text) .. "~" - local textSize = binaryGrow(0, len, function(pos) - if pos == 0 then - textLabel.Text = "~" - else - textLabel.Text = tostring(string.sub(text, 1, pos)) .. "~" - end - return textLabel.TextFits - end) - shortText = tostring(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 not (mouseEnterConnection ~= nil) then - mouseEnterConnection = textLabel.MouseEnter:connect(function() - fullLabel.ZIndex = textLabel.ZIndex + 1 - fullLabel.Visible = true - end) - end - if not (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 - elseif transitionFrame.Visible == false then - transitionFrame.Size = UDim2.new(0, 50, 0, 50) - transitionFrame.Position = UDim2.new(0.5, -25, 0.5, -25) - 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("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 - }), - New("ObjectValue", "CurrentTutorialPage", { - Value = nil - }), - New("BoolValue", "Buttons", { - Value = createButtons - }), - New("Frame", "Pages", { - BackgroundTransparency = 1, - Size = UDim2.new(1, 0, 1, 0) - }) - }) - local transitionFrame, currentPageValue, pages = frame.TransitionFrame, frame.CurrentTutorialPage, frame.Pages - 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" .. tostring(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("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) - }), - 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) - }), - 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("Frame", "ContentFrame", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 25) - }) - }) - local innerFrame = frame.ContentFrame - do - local _with_0 = frame.SkipButton - _with_0.MouseButton1Click:connect(function() - return skipTutorial() - end) - _with_0.MouseEnter:connect(function() - _with_0.Image = "rbxasset://textures/ui/closeButton_dn.png" - end) - _with_0.MouseLeave:connect(function() - _with_0.Image = "rbxasset://textures/ui/closeButton.png" - end) - 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), - Parent = frame - }) - if skipTutorial then - doneButton.MouseButton1Click:connect(function() - return skipTutorial() - end) - end - end - 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() - end - parentConnection = nil - 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 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 - local contentFrame - frame, contentFrame = CreateBasicTutorialPage(name, handleResize, skipTutorialFunc) - textLabel.Parent = contentFrame - return frame -end -t.CreateImageTutorialPage = function(name, imageAsset, x, y, skipTutorialFunc, giveDoneButton) - local frame, 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, imageLabel.Position = UDim2.new(1, 0, y / x, 0), UDim2.new(0, 0, 0.5 - (y / x) / 2, 0) - else - imageLabel.Size, imageLabel.Position = UDim2.new(x / y, 0, 1, 0), 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 not (showAdminCategories ~= nil) then - showAdminCategories = false - end - local arrayPosition = 1 - local insertButtons = { } - local insertButtonCons = { } - local contents, 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, LargeThumbnailUrl - local BaseUrl = game:GetService("ContentProvider").BaseUrl:lower() - if useAssetVersionId then - LargeThumbnailUrl, SmallThumbnailUrl = tostring(BaseUrl) .. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&assetversionid=", tostring(BaseUrl) .. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=75&ht=75&assetversionid=" - else - LargeThumbnailUrl, SmallThumbnailUrl = tostring(BaseUrl) .. "Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&aid=", tostring(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 = Instance.new("ScreenGui") - setGui.Name = "SetGui" - local setPanel = New("Frame", "SetPanel", { - Active = true, - BackgroundTransparency = 1, - Position = position or UDim2.new(0.2, 29, 0.1, 24), - Size = size or UDim2.new(0.6, -58, 0.64, 0), - 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("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 - }), - 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 - }) - }) - }) - 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 = setPanel.Sets - drillDownSetZIndex(controlFrame, 7) - return setGui - end - local createSetButton - createSetButton = function(text) - local setButton = New("TextButton", { - Text = text or "", - 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 - }) - return setButton - 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 _with_0 = setGui.SetPanel.ItemPreview - _with_0.LargePreview.Size = UDim2.new(1, 0, 0, _with_0.AbsoluteSize.X) - _with_0.LargePreview.Position = UDim2.new(0.5, -_with_0.LargePreview.AbsoluteSize.X / 2, 0, 0) - _with_0.TextPanel.Position = UDim2.new(0, 0, 0, _with_0.LargePreview.AbsoluteSize.Y) - _with_0.TextPanel.Size = UDim2.new(1, 0, 0, _with_0.AbsoluteSize.Y - _with_0.LargePreview.AbsoluteSize.Y) - return _with_0 - 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 = "" - }), - 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, - New("ImageLabel", "ButtonImage", { - Image = "", - Position = UDim2.new(0, -7, 0, -7), - Size = UDim2.new(1, 14, 1, 14), - BackgroundTransparency = 1, - ZIndex = 7 - }) - }) - }) - do - local _with_0 = insertAssetButtonExample.button.ButtonImage:clone() - _with_0.Name = "ConfigIcon" - _with_0.Visible = false - _with_0.Position = UDim2.new(1, -23, 1, -24) - _with_0.Size = UDim2.new(0, 16, 0, 16) - _with_0.Image = "" - _with_0.ZIndex = 6 - _with_0.Parent = insertAssetButtonExample - end - 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", { - Name = "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 = nil - 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 - return objectSelected(name, (function() - if isWaterSelected then - return tonumber(assetId), nil - else - return tonumber(assetId) - end - 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" and Data.Category[Data.CurrentCategory].SetName == "High Scalability" then - insertButtons[index]:FindFirstChild("DropDownButton", true):Destroy() - 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 - do - local _with_0 = Data.Category[Data.CurrentCategory] - if button ~= _with_0.Button then - _with_0.Button = button - if not (SetCache[setId] ~= nil) then - SetCache[setId] = game:GetService("InsertService"):GetCollection(setId) - end - _with_0.Contents = SetCache[setId] - _with_0.SetName = setName - _with_0.SetId = setId - end - 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 not (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 - local _with_0 = Data.Category[Data.CurrentCategory] - _with_0.Button = nil - selectSet(_with_0.ButtonFrame, _with_0.SetName, _with_0.SetId, _with_0.Index) - return _with_0 - 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 - do - local _with_0 = setButtons[i] - if _with_0:IsA("TextButton") then - _with_0.Selected = false - _with_0.BackgroundTransparency = 1 - _with_0.TextColor3 = Color3.new(1, 1, 1) - _with_0.BackgroundColor3 = Color3.new(1, 1, 1) - end - end - end - end - local populateSetsFrame - populateSetsFrame = function() - local currRow = 0 - for i = 1, #userCategoryButtons do - 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 - 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.Name = "ItemsFrame" - scrollFrame.Size = UDim2.new(0.54, 0, 0.85, 0) - scrollFrame.Position = UDim2.new(0.24, 0, 0.085, 0) - 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 - local rows = math.floor(setGui.SetPanel.ItemsFrame.AbsoluteSize.Y / buttonHeight) - local columns = math.floor(setGui.SetPanel.ItemsFrame.AbsoluteSize.X / buttonWidth) - 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 - table.insert(userData, (function() - if newUserData[category].Name == "High Scalability" then - return 1, newUserData[category] - else - return newUserData[category] - end - end)()) - end - end - end - if userData then - userCategoryButtons = processCategory(userData) - end - 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) - setGui.SetPanel.Visible = not not visible - end - local getVisibilityFunction - getVisibilityFunction = function() - if (function() - if setGui ~= nil then - return setGui:FindFirstChild("SetPanel") - end - return nil - end)() 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 = size or UDim2.new(0, 245, 0, 230), - 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) - for i, v in ipairs(materialNames) do - if v == choice then - return i - end - 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=" .. tostring((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("ImageButton", tostring(name), { - AutoButtonColor = false, - BackgroundTransparency = 1, - Size = UDim2.new(0, 30, 0, 30), - Position = UDim2.new(0, 1, 0, 1), - Image = materialToImageMap[name].Regular - }), - New("NumberValue", "EnumType", { - Value = 0 - }) - }) - do - local _with_0 = buttonWrap.ImageButton - _with_0.MouseEnter:connect(function() - buttonWrap.BackgroundTransparency = 0 - end) - _with_0.MouseLeave:connect(function() - if selectedButton ~= buttonWrap then - buttonWrap.BackgroundTransparency = 1 - end - end) - _with_0.MouseButton1Click:connect(function() - if selectedButton ~= buttonWrap then - return goToNewMaterial(buttonWrap, tostring(name)) - end - 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)") or (buttons[i].Name == "Plastic (red)" and matName == "Plastic (red)") or (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 = size or UDim2.new(0, 300, 0, 160), - Position = position or UDim2.new(0.5, -150, 0.5, -80), - 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 - }), - 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 - }), - 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), - 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 - }), - 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) - }) - }) - }) - local cancelButton, loadingGreenBar, loadingPercent = loadingFrame.CancelButton, loadingFrame.LoadingBar.LoadingGreenBar, loadingFrame.LoadingBar.LoadingPercent - 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", type(percent), "instead") - end - local newSize = UDim2.new((function() - if percent < 0 then - return 0, 0, 1, 0 - elseif percent > 1 then - return 1, 0, 1, 0 - else - return percent, 0, 1, 0 - end - 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 - return loadingGreenBar:TweenSize(newSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweenLength, (function() - if newSize.X.Scale > 0 then - loadingGreenBar.Visible = true - return true - else - return true, function() - if newSize.X.Scale < 0 then - loadingGreenBar.Visible = false - end - 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 _with_0 = 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) - }) - _with_0.MouseEnter:connect(function() - if _with_0.Selected then - return - end - _with_0.BackgroundTransparency = 0 - end) - _with_0.MouseLeave:connect(function() - if _with_0.Selected then - return - end - _with_0.BackgroundTransparency = 1 - end) - _with_0.Parent = parent - return _with_0 - 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, - 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 - }), - 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 - }), - 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) - }), - 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, - 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" - }) - }) - }) - 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 - 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, separatingLine, minimizeFrame, minimizeBigButton = dragBar.HelpFrame, dragBar.SeparatingLine, dragBar.MinimizeFrame, dragBar.MinimizeFrame.MinimizeBigButton - 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 - do - local _with_0 = separatingLine:clone() - _with_0.Position = UDim2.new(1, -35, 0.5, -7) - _with_0.Parent = dragBar - end - local widgetContainer = New("Frame", "WidgetContainer", { - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 1, 0), - BorderColor3 = Color3.new(0, 0, 0), - 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 = "", - 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 - }) - }) - }) - local verticalDragger, scrubFrame = widgetContainer.VerticalDragger, widgetContainer.VerticalDragger.ScrubFrame - 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 - widgetContainer.Size = UDim2.new((function() - if scrollable then - return 0, 163, 0, 400 - else - return 0, dragBar.AbsoluteSize.X, 0, 400 - end - end)()) - end - if position then - widgetContainer.Position = position + UDim2.new(0, 0, 0, 20) - end - local frame, control - 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.BackgroundColor3 = Color3.new(72 / 255, 72 / 255, 72 / 255) - control.BorderSizePixel = 0 - control.BackgroundTransparency = 0 - control.Position = UDim2.new(1, -21, 1, 1) - control.Size = UDim2.new(0, 21, (function() - if size then - return size.Y.Scale, size.Y.Offset - else - return 0, 400 - end - end)()) - control:FindFirstChild("ScrollDownButton").Position = UDim2.new(0, 0, 1, -20) - control.Parent = dragBar - 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 - }) - for _ = 1, 2 do - do - local _with_0 = scrubFrame:clone() - _with_0.Position = UDim2.new(0.5, -5, 0.5, 2) - _with_0.Parent = verticalDragger - end - end - 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(switchMinimize) - minimizeButton.MouseButton1Click:connect(switchMinimize) - return dragBar, (function() - if scrollable then - return frame, helpFrame, closeEvent - else - return widgetContainer, helpFrame, closeEvent - end - end)() -end -t.Help = function(funcNameOrFunc) - if 'CreatePropertyDropDownMenu' == funcNameOrFunc or t.CreatePropertyDropDownMenu == funcNameOrFunc 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 'CreateDropDownMenu' == funcNameOrFunc or t.CreateDropDownMenu == funcNameOrFunc 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 'CreateMessageDialog' == funcNameOrFunc or t.CreateMessageDialog == funcNameOrFunc 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 'CreateStyledMessageDialog' == funcNameOrFunc or t.CreateStyledMessageDialog == funcNameOrFunc 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 'GetFontHeight' == funcNameOrFunc or t.GetFontHeight == funcNameOrFunc then - return 'Function GetFontHeight. ' .. 'Arguments: (font, fontSize). ' .. 'Side effect: returns the size in pixels of the given font + fontSize' - elseif 'CreateScrollingFrame' == funcNameOrFunc or t.CreateScrollingFrame == funcNameOrFunc 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\n when a relayout is needed (\n when orderList changes)' - elseif 'CreateTrueScrollingFrame' == funcNameOrFunc or t.CreateTrueScrollingFrame == funcNameOrFunc 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 'AutoTruncateTextObject' == funcNameOrFunc or t.AutoTruncateTextObject == funcNameOrFunc 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 'CreateSlider' == funcNameOrFunc or t.CreateSlider == funcNameOrFunc 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 'CreateLoadingFrame' == funcNameOrFunc or t.CreateLoadingFrame == funcNameOrFunc 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\n when fired means that someone clicked the cancel button on the dialog.' - elseif 'CreateTerrainMaterialSelector' == funcNameOrFunc or t.CreateTerrainMaterialSelector == funcNameOrFunc 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 +local a={}local function ScopedConnect(b,c,d,e,f,g)local h=nil local i=function( +)if game:IsAncestorOf(b)then if not h then h=c[d]:connect(e)if f then f()end end +else if h then h:disconnect()if g then g()end end end end local j=b. +AncestryChanged:connect(i)i()return j end local function getScreenGuiAncestor(b) +local c=b while c and not c:IsA'ScreenGui'do c=c.Parent end return c end +local function CreateButtons(b,c,d,e)local f,g=1,{}for h,i in ipairs(c)do local +j=Instance.new'TextButton'j.Name='Button'..f j.Font=Enum.Font.Arial j.FontSize= +Enum.FontSize.Size18 j.AutoButtonColor=true j.Modal=true if i['Style']then j. +Style=i.Style else j.Style=Enum.ButtonStyle.RobloxButton end j.Text=i.Text j. +TextColor3=Color3.new(1,1,1)j.MouseButton1Click:connect(i.Function)j.Parent=b g[ +f]=j f=f+1 end local j=f-1 if j==1 then b.Button1.Position=UDim2.new(0.35,0,d. +Scale,d.Offset)b.Button1.Size=UDim2.new(0.4,0,e.Scale,e.Offset)elseif j==2 then +b.Button1.Position=UDim2.new(0.1,0,d.Scale,d.Offset)b.Button1.Size=UDim2.new( +0.26666666666666666,0,e.Scale,e.Offset)b.Button2.Position=UDim2.new(0.55,0,d. +Scale,d.Offset)b.Button2.Size=UDim2.new(0.35,0,e.Scale,e.Offset)elseif j>=3 then +local k,l=0.1/j,0.9/j f=1 while f<=j do g[f].Position=UDim2.new(k*f+(f-1)*l,0,d. +Scale,d.Offset)g[f].Size=UDim2.new(l,0,e.Scale,e.Offset)f=f+1 end end end +local function setSliderPos(b,c,d,e,f)local g,h=f-1,math.min(1,math.max(0,(b-e. +AbsolutePosition.X)/e.AbsoluteSize.X))local i,j=math.modf(h*g)if j>0.5 then i=i+ +1 end h=i/g local k=math.ceil(h*g)if d.Value~=(k+1)then d.Value=k+1 c.Position= +UDim2.new(h,-c.AbsoluteSize.X/2,c.Position.Y.Scale,c.Position.Y.Offset)end end +local function cancelSlide(b)b.Visible=false if areaSoakMouseMoveCon then +areaSoakMouseMoveCon:disconnect()end end a.CreateStyledMessageDialog=function(b, +c,d,e)local f=Instance.new'Frame'f.Size=UDim2.new(0.5,0,0,165)f.Position=UDim2. +new(0.25,0,0.5,-72.5)f.Name='MessageDialog'f.Active=true f.Style=Enum.FrameStyle +.RobloxRound local g=Instance.new'ImageLabel'g.Name='StyleImage'g. +BackgroundTransparency=1 g.Position=UDim2.new(0,5,0,15)if d=='error'or d== +'Error'then g.Size=UDim2.new(0,71,0,71)g.Image= +'http://www.roblox.com/asset?id=42565285'elseif d=='notify'or d=='Notify'then g. +Size=UDim2.new(0,71,0,71)g.Image='http://www.roblox.com/asset?id=42604978'elseif +d=='confirm'or d=='Confirm'then g.Size=UDim2.new(0,74,0,76)g.Image= +'http://www.roblox.com/asset?id=42557901'else return a.CreateMessageDialog(b,c,e +)end g.Parent=f local h=Instance.new'TextLabel'h.Name='Title'h.Text=b h. +TextStrokeTransparency=0 h.BackgroundTransparency=1 h.TextColor3=Color3.new( +0.8666666666666667,0.8666666666666667,0.8666666666666667)h.Position=UDim2.new(0, +80,0,0)h.Size=UDim2.new(1,-80,0,40)h.Font=Enum.Font.ArialBold h.FontSize=Enum. +FontSize.Size36 h.TextXAlignment=Enum.TextXAlignment.Center h.TextYAlignment= +Enum.TextYAlignment.Center h.Parent=f local i=Instance.new'TextLabel'i.Name= +'Message'i.Text=c i.TextStrokeTransparency=0 i.TextColor3=Color3.new( +0.8666666666666667,0.8666666666666667,0.8666666666666667)i.Position=UDim2.new( +0.025,80,0,45)i.Size=UDim2.new(0.95,-80,0,55)i.BackgroundTransparency=1 i.Font= +Enum.Font.Arial i.FontSize=Enum.FontSize.Size18 i.TextWrap=true i.TextXAlignment +=Enum.TextXAlignment.Left i.TextYAlignment=Enum.TextYAlignment.Top i.Parent=f +CreateButtons(f,e,UDim.new(0,105),UDim.new(0,40))return f end a. +CreateMessageDialog=function(b,c,d)local e=Instance.new'Frame'e.Size=UDim2.new( +0.5,0,0.5,0)e.Position=UDim2.new(0.25,0,0.25,0)e.Name='MessageDialog'e.Active= +true e.Style=Enum.FrameStyle.RobloxRound local f=Instance.new'TextLabel'f.Name= +'Title'f.Text=b f.BackgroundTransparency=1 f.TextColor3=Color3.new( +0.8666666666666667,0.8666666666666667,0.8666666666666667)f.Position=UDim2.new(0, +0,0,0)f.Size=UDim2.new(1,0,0.15,0)f.Font=Enum.Font.ArialBold f.FontSize=Enum. +FontSize.Size36 f.TextXAlignment=Enum.TextXAlignment.Center f.TextYAlignment= +Enum.TextYAlignment.Center f.Parent=e local g=Instance.new'TextLabel'g.Name= +'Message'g.Text=c g.TextColor3=Color3.new(0.8666666666666667,0.8666666666666667, +0.8666666666666667)g.Position=UDim2.new(0.025,0,0.175,0)g.Size=UDim2.new(0.95,0, +0.55,0)g.BackgroundTransparency=1 g.Font=Enum.Font.Arial g.FontSize=Enum. +FontSize.Size18 g.TextWrap=true g.TextXAlignment=Enum.TextXAlignment.Left g. +TextYAlignment=Enum.TextYAlignment.Top g.Parent=e CreateButtons(e,d,UDim.new(0.8 +,0),UDim.new(0.15,0))return e end a.CreateDropDownMenu=function(b,c,d)local e,f, +g=UDim.new(0,100),UDim.new(0,32),Instance.new'Frame'g.Name='DropDownMenu'g. +BackgroundTransparency=1 g.Size=UDim2.new(e,f)local h=Instance.new'TextButton'h. +Name='DropDownMenuButton'h.TextWrap=true h.TextColor3=Color3.new(1,1,1)h.Text= +'Choose One'h.Font=Enum.Font.ArialBold h.FontSize=Enum.FontSize.Size18 h. +TextXAlignment=Enum.TextXAlignment.Left h.TextYAlignment=Enum.TextYAlignment. +Center h.BackgroundTransparency=1 h.AutoButtonColor=true h.Style=Enum. +ButtonStyle.RobloxButton h.Size=UDim2.new(1,0,1,0)h.Parent=g h.ZIndex=2 local i= +Instance.new'ImageLabel'i.Name='Icon'i.Active=false i.Image= +'http://www.roblox.com/asset/?id=45732894'i.BackgroundTransparency=1 i.Size= +UDim2.new(0,11,0,6)i.Position=UDim2.new(1,-11,0.5,-2)i.Parent=h i.ZIndex=2 local +j,k,l=#b,#b,false if k>6 then l=true k=6 end local m=Instance.new'TextButton'm. +Name='List'm.Text=''m.BackgroundTransparency=1 m.Style=Enum.ButtonStyle. +RobloxButton m.Visible=false m.Active=true m.Position=UDim2.new(0,0,0,0)m.Size= +UDim2.new(1,0,(1+k)*0.8,0)m.Parent=g m.ZIndex=2 local n=Instance.new'TextButton' +n.Name='ChoiceButton'n.BackgroundTransparency=1 n.BorderSizePixel=0 n.Text= +'ReplaceMe'n.TextColor3=Color3.new(1,1,1)n.TextXAlignment=Enum.TextXAlignment. +Left n.TextYAlignment=Enum.TextYAlignment.Center n.BackgroundColor3=Color3.new(1 +,1,1)n.Font=Enum.Font.Arial n.FontSize=Enum.FontSize.Size18 if l then n.Size= +UDim2.new(1,-13,0.8/((k+1)*0.8),0)else n.Size=UDim2.new(1,0,0.8/((k+1)*0.8),0) +end n.TextWrap=true n.ZIndex=2 local o=Instance.new'TextButton'o.Name='AreaSoak' +o.Text=''o.BackgroundTransparency=1 o.Active=true o.Size=UDim2.new(1,0,1,0)o. +Visible=false o.ZIndex=3 local p,q,r,s=false,nil,nil,0 local t,u=function(t)m. +ZIndex=t+1 if q then q.ZIndex=t+3 end if r then r.ZIndex=t+3 end local u=m: +GetChildren()if u then for v,w in ipairs(u)do if w.Name=='ChoiceButton'then w. +ZIndex=t+2 elseif w.Name=='ClickCaptureButton'then w.ZIndex=t end end end end,1 +local v=function()if q then q.Active=u>1 end if r then r.Active=u+k<=j end local +v=m:GetChildren()if not v then return end local w=1 for x,y in ipairs(v)do if y. +Name=='ChoiceButton'then if w=u+k then y.Visible=false else y.Position= +UDim2.new(0,0,((w-u+1)*0.8)/((k+1)*0.8),0)y.Visible=true end y.TextColor3=Color3 +.new(1,1,1)y.BackgroundTransparency=1 w=w+1 end end end local w=function()p=not +p o.Visible=not o.Visible h.Visible=not p m.Visible=p if p then t(4)else t(2)end +if l then v()end end m.MouseButton1Click:connect(w)local x=function(x)local y,z, +A=false,m:GetChildren(),1 if z then for B,C in ipairs(z)do if C.Name== +'ChoiceButton'then if C.Text==x then C.Font=Enum.Font.ArialBold y=true u=A else +C.Font=Enum.Font.Arial end A=A+1 end end end if not x then h.Text='Choose One'u= +1 else if not y then error('Invalid Selection Update -- '..x)end if u+k>j+1 then +u=j-k+1 end h.Text=x end end local function scrollDown()if u+k<=j then u=u+1 v() +return true end return false end local function scrollUp()if u>1 then u=u-1 v() +return true end return false end if l then q=Instance.new'ImageButton'q.Name= +'ScrollUpButton'q.BackgroundTransparency=1 q.Image= +'rbxasset://textures/ui/scrollbuttonUp.png'q.Size=UDim2.new(0,17,0,17)q.Position +=UDim2.new(1,-11,(0.8)/((k+1)*0.8),0)q.MouseButton1Click:connect(function()s=s+1 +end)q.MouseLeave:connect(function()s=s+1 end)q.MouseButton1Down:connect(function +()s=s+1 scrollUp()local y=s wait(0.5)while y==s do if scrollUp()==false then +break end wait(0.1)end end)q.Parent=m r=Instance.new'ImageButton'r.Name= +'ScrollDownButton'r.BackgroundTransparency=1 r.Image= +'rbxasset://textures/ui/scrollbuttonDown.png'r.Size=UDim2.new(0,17,0,17)r. +Position=UDim2.new(1,-11,1,-11)r.Parent=m r.MouseButton1Click:connect(function() +s=s+1 end)r.MouseLeave:connect(function()s=s+1 end)r.MouseButton1Down:connect( +function()s=s+1 scrollDown()local y=s wait(0.5)while y==s do if scrollDown()== +false then break end wait(0.1)end end)local y=Instance.new'ImageLabel'y.Name= +'ScrollBar'y.Image='rbxasset://textures/ui/scrollbar.png'y. +BackgroundTransparency=1 y.Size=UDim2.new(0,18,(k*0.8)/((k+1)*0.8),-32)y. +Position=UDim2.new(1,-11,(0.8)/((k+1)*0.8),19)y.Parent=m end for y,z in ipairs(b +)do local A=n:clone()if d then A.RobloxLocked=true end A.Text=z A.Parent=m A. +MouseButton1Click:connect(function()A.TextColor3=Color3.new(1,1,1)A. +BackgroundTransparency=1 x(z)c(z)w()end)A.MouseEnter:connect(function()A. +TextColor3=Color3.new(0,0,0)A.BackgroundTransparency=0 end)A.MouseLeave:connect( +function()A.TextColor3=Color3.new(1,1,1)A.BackgroundTransparency=1 end)end v()g. +AncestryChanged:connect(function(A,B)if B==nil then o.Parent=nil else o.Parent= +getScreenGuiAncestor(g)end end)h.MouseButton1Click:connect(w)o.MouseButton1Click +:connect(w)return g,x end a.CreatePropertyDropDownMenu=function(b,c,d)local e,f, +g=d:GetEnumItems(),{},{}for h,i in ipairs(e)do f[h]=i.Name g[i.Name]=i end local +j,k j,k=a.CreateDropDownMenu(f,function(l)b[c]=g[l]end)ScopedConnect(j,b, +'Changed',function(l)if l==c then k(b[c].Name)end end,function()k(b[c].Name)end) +return j end a.GetFontHeight=function(b,c)if b==nil or c==nil then error +'Font and FontSize must be non-nil'end if b==Enum.Font.Legacy then if c==Enum. +FontSize.Size8 then return 12 elseif c==Enum.FontSize.Size9 then return 14 +elseif c==Enum.FontSize.Size10 then return 15 elseif c==Enum.FontSize.Size11 +then return 17 elseif c==Enum.FontSize.Size12 then return 18 elseif c==Enum. +FontSize.Size14 then return 21 elseif c==Enum.FontSize.Size18 then return 27 +elseif c==Enum.FontSize.Size24 then return 36 elseif c==Enum.FontSize.Size36 +then return 54 elseif c==Enum.FontSize.Size48 then return 72 else error +'Unknown FontSize'end elseif b==Enum.Font.Arial or b==Enum.Font.ArialBold then +if c==Enum.FontSize.Size8 then return 8 elseif c==Enum.FontSize.Size9 then +return 9 elseif c==Enum.FontSize.Size10 then return 10 elseif c==Enum.FontSize. +Size11 then return 11 elseif c==Enum.FontSize.Size12 then return 12 elseif c== +Enum.FontSize.Size14 then return 14 elseif c==Enum.FontSize.Size18 then return +18 elseif c==Enum.FontSize.Size24 then return 24 elseif c==Enum.FontSize.Size36 +then return 36 elseif c==Enum.FontSize.Size48 then return 48 else error +'Unknown FontSize'end else error('Unknown Font '..b)end end local function +layoutGuiObjectsHelper(b,c,d)local e,f=b.AbsoluteSize.Y,b.AbsoluteSize.Y for g,h +in ipairs(c)do if h:IsA'TextLabel'or h:IsA'TextButton'then local i=h:IsA +'TextLabel'if i then f=f-d['TextLabelPositionPadY']else f=f-d[ +'TextButtonPositionPadY']end h.Position=UDim2.new(h.Position.X.Scale,h.Position. +X.Offset,0,e-f)h.Size=UDim2.new(h.Size.X.Scale,h.Size.X.Offset,0,f)if h.TextFits +and h.TextBounds.Y=0)end end end a.LayoutGuiObjects= +function(b,c,d)if not b:IsA'GuiObject'then error'Frame must be a GuiObject'end +for e,f in ipairs(c)do if not f:IsA'GuiObject'then error +'All elements that are layed out must be of type GuiObject'end end if not d then +d={}end if not d['TextLabelSizePadY']then d['TextLabelSizePadY']=0 end if not d[ +'TextLabelPositionPadY']then d['TextLabelPositionPadY']=0 end if not d[ +'TextButtonSizePadY']then d['TextButtonSizePadY']=12 end if not d[ +'TextButtonPositionPadY']then d['TextButtonPositionPadY']=2 end local g=Instance +.new'Frame'g.Name='WrapperFrame'g.BackgroundTransparency=1 g.Size=UDim2.new(1,0, +1,0)g.Parent=b for h,i in ipairs(c)do i.Parent=g end local j=function()wait() +layoutGuiObjectsHelper(g,c,d)end b.Changed:connect(function(k)if k== +'AbsoluteSize'then j(nil)end end)b.AncestryChanged:connect(j) +layoutGuiObjectsHelper(g,c,d)end a.CreateSlider=function(b,c,d)local g=Instance. +new'Frame'g.Size=UDim2.new(1,0,1,0)g.BackgroundTransparency=1 g.Name='SliderGui' +local h=Instance.new'IntValue'h.Name='SliderSteps'h.Value=b h.Parent=g local i= +Instance.new'TextButton'i.Name='AreaSoak'i.Text=''i.BackgroundTransparency=1 i. +Active=false i.Size=UDim2.new(1,0,1,0)i.Visible=false i.ZIndex=4 g. +AncestryChanged:connect(function(j,k)if k==nil then i.Parent=nil else i.Parent= +getScreenGuiAncestor(g)end end)local j=Instance.new'IntValue'j.Name= +'SliderPosition'j.Value=0 j.Parent=g local k=Instance.new'TextButton'k.Text=''k. +AutoButtonColor=false k.Name='Bar'k.BackgroundColor3=Color3.new(0,0,0)if type(c) +=='number'then k.Size=UDim2.new(0,c,0,5)else k.Size=UDim2.new(0,200,0,5)end k. +BorderColor3=Color3.new(0.37254901960784315,0.37254901960784315, +0.37254901960784315)k.ZIndex=2 k.Parent=g if d['X']and d['X']['Scale']and d['X'] +['Offset']and d['Y']and d['Y']['Scale']and d['Y']['Offset']then k.Position=d end +local l=Instance.new'ImageButton'l.Name='Slider'l.BackgroundTransparency=1 l. +Image='rbxasset://textures/ui/Slider.png'l.Position=UDim2.new(0,0,0.5,-10)l.Size +=UDim2.new(0,20,0,20)l.ZIndex=3 l.Parent=k local m=nil i.MouseLeave:connect( +function()if i.Visible then cancelSlide(i)end end)i.MouseButton1Up:connect( +function()if i.Visible then cancelSlide(i)end end)l.MouseButton1Down:connect( +function()i.Visible=true if m then m:disconnect()end m=i.MouseMoved:connect( +function(n,o)setSliderPos(n,l,j,k,b)end)end)l.MouseButton1Up:connect(function() +cancelSlide(i)end)j.Changed:connect(function(n)j.Value=math.min(b,math.max(1,j. +Value))local o=(j.Value-1)/(b-1)l.Position=UDim2.new(o,-l.AbsoluteSize.X/2,l. +Position.Y.Scale,l.Position.Y.Offset)end)k.MouseButton1Down:connect(function(n,o +)setSliderPos(n,l,j,k,b)end)return g,j,h end a.CreateTrueScrollingFrame=function +()local b,c,d,g,h,i,j=nil,nil,nil,nil,false,{},Instance.new'Frame'j.Name= +'ScrollingFrame'j.Active=true j.Size=UDim2.new(1,0,1,0)j.ClipsDescendants=true +local k=Instance.new'Frame'k.Name='ControlFrame'k.BackgroundTransparency=1 k. +Size=UDim2.new(0,18,1,0)k.Position=UDim2.new(1,-20,0,0)k.Parent=j local l= +Instance.new'BoolValue'l.Value=false l.Name='ScrollBottom'l.Parent=k local m= +Instance.new'BoolValue'm.Value=false m.Name='scrollUp'm.Parent=k local n= +Instance.new'TextButton'n.Name='ScrollUpButton'n.Text=''n.AutoButtonColor=false +n.BackgroundColor3=Color3.new(0,0,0)n.BorderColor3=Color3.new(1,1,1)n. +BackgroundTransparency=0.5 n.Size=UDim2.new(0,18,0,18)n.ZIndex=2 n.Parent=k for +o=1,6 do local p=Instance.new'Frame'p.BorderColor3=Color3.new(1,1,1)p.Name='tri' +..tostring(o)p.ZIndex=3 p.BackgroundTransparency=0.5 p.Size=UDim2.new(0,12-((o-1 +)*2),0,0)p.Position=UDim2.new(0,3+(o-1),0.5,2-(o-1))p.Parent=n end n.MouseEnter: +connect(function()n.BackgroundTransparency=0.1 local o=n:GetChildren()for p=1,#o +do o[p].BackgroundTransparency=0.1 end end)n.MouseLeave:connect(function()n. +BackgroundTransparency=0.5 local o=n:GetChildren()for p=1,#o do o[p]. +BackgroundTransparency=0.5 end end)local o=n:clone()o.Name='ScrollDownButton'o. +Position=UDim2.new(0,0,1,-18)local p=o:GetChildren()for q=1,#p do p[q].Position= +UDim2.new(0,3+(q-1),0.5,-2+(q-1))end o.MouseEnter:connect(function()o. +BackgroundTransparency=0.1 local q=o:GetChildren()for r=1,#q do q[r]. +BackgroundTransparency=0.1 end end)o.MouseLeave:connect(function()o. +BackgroundTransparency=0.5 local q=o:GetChildren()for r=1,#q do q[r]. +BackgroundTransparency=0.5 end end)o.Parent=k local q=Instance.new'Frame'q.Name= +'ScrollTrack'q.BackgroundTransparency=1 q.Size=UDim2.new(0,18,1,-38)q.Position= +UDim2.new(0,0,0,19)q.Parent=k local r=Instance.new'TextButton'r.BackgroundColor3 +=Color3.new(0,0,0)r.BorderColor3=Color3.new(1,1,1)r.BackgroundTransparency=0.5 r +.AutoButtonColor=false r.Text=''r.Active=true r.Name='ScrollBar'r.ZIndex=2 r. +BackgroundTransparency=0.5 r.Size=UDim2.new(0,18,0.1,0)r.Position=UDim2.new(0,0, +0,0)r.Parent=q local s=Instance.new'Frame's.Name='ScrollNub's.BorderColor3= +Color3.new(1,1,1)s.Size=UDim2.new(0,10,0,0)s.Position=UDim2.new(0.5,-5,0.5,0)s. +ZIndex=2 s.BackgroundTransparency=0.5 s.Parent=r local t=s:clone()t.Position= +UDim2.new(0.5,-5,0.5,-2)t.Parent=r local u=s:clone()u.Position=UDim2.new(0.5,-5, +0.5,2)u.Parent=r r.MouseEnter:connect(function()r.BackgroundTransparency=0.1 s. +BackgroundTransparency=0.1 t.BackgroundTransparency=0.1 u.BackgroundTransparency +=0.1 end)r.MouseLeave:connect(function()r.BackgroundTransparency=0.5 s. +BackgroundTransparency=0.5 t.BackgroundTransparency=0.5 u.BackgroundTransparency +=0.5 end)local v=Instance.new'ImageButton'v.Active=false v.Size=UDim2.new(1.5,0, +1.5,0)v.AutoButtonColor=false v.BackgroundTransparency=1 v.Name='mouseDrag'v. +Position=UDim2.new(-0.25,0,-0.25,0)v.ZIndex=10 local function positionScrollBar( +w,x,y)local z=r.Position if x(q.AbsolutePosition.y+q.AbsoluteSize.y)then +r.Position=UDim2.new(r.Position.X.Scale,r.Position.X.Offset,1-A,0)return(z~=r. +Position)end local B=(x-q.AbsolutePosition.y-y)/q.AbsoluteSize.y if B+A>1 then B +=1-A l.Value=true m.Value=false elseif B<=0 then B=0 m.Value=true l.Value=false +else m.Value=false l.Value=false end r.Position=UDim2.new(r.Position.X.Scale,r. +Position.X.Offset,B,0)return(z~=r.Position)end local function +drillDownSetHighLow(w)if not w or not w:IsA'GuiObject'then return end if w==k +then return end if w:IsDescendantOf(k)then return end if not w.Visible then +return end if(b and b>w.AbsolutePosition.Y)or not b then b=w.AbsolutePosition.Y +end if(c and c<(w.AbsolutePosition.Y+w.AbsoluteSize.Y))or not c then c=w. +AbsolutePosition.Y+w.AbsoluteSize.Y end local x=w:GetChildren()for y=1,#x do +drillDownSetHighLow(x[y])end end local function resetHighLow()local w=j: +GetChildren()for x=1,#w do drillDownSetHighLow(w[x])end end local function +recalculate()h=true local w=0 if r.Position.Y.Scale>0 then if r.Visible then w=r +.Position.Y.Scale/((q.AbsoluteSize.Y-r.AbsoluteSize.Y)/q.AbsoluteSize.Y)else w=0 +end end if w>0.99 then w=1 end local x,y=(j.AbsoluteSize.Y-(c-b))*w,j: +GetChildren()for z=1,#y do if y[z]~=k then y[z].Position=UDim2.new(y[z].Position +.X.Scale,y[z].Position.X.Offset,0,math.ceil(y[z].AbsolutePosition.Y)-math.ceil(b +)+x)end end b=nil c=nil resetHighLow()h=false end local function +setSliderSizeAndPosition()if not c or not b then return end local w=math.abs(c-b +)if w==0 then r.Visible=false o.Visible=false n.Visible=false if d then d: +disconnect()d=nil end if g then g:disconnect()g=nil end return end local x=j. +AbsoluteSize.Y/w if x>=1 then r.Visible=false o.Visible=false n.Visible=false +recalculate()else r.Visible=true o.Visible=true n.Visible=true r.Size=UDim2.new( +r.Size.X.Scale,r.Size.X.Offset,x,0)end local y=(j.AbsolutePosition.Y-b)/w r. +Position=UDim2.new(r.Position.X.Scale,r.Position.X.Offset,y,-r.AbsoluteSize.X/2) +if r.AbsolutePosition.y(q.AbsolutePosition.y+q.AbsoluteSize.y)then local z=r. +AbsoluteSize.Y/q.AbsoluteSize.Y r.Position=UDim2.new(r.Position.X.Scale,r. +Position.X.Offset,1-z,0)end end local w,x=7,false local function doScrollUp()if +x then return end x=true if positionScrollBar(0,r.AbsolutePosition.Y-w,0)then +recalculate()end x=false end local y=false local function doScrollDown()if y +then return end y=true if positionScrollBar(0,r.AbsolutePosition.Y+w,0)then +recalculate()end y=false end local function scrollUp(z)if n.Active then local A= +tick()local B,C=A,nil C=v.MouseButton1Up:connect(function()A=tick()v.Parent=nil +C:disconnect()end)v.Parent=getScreenGuiAncestor(r)doScrollUp()wait(0.2)local D,E +=tick(),0.1 while A==B do doScrollUp()if z and z>r.AbsolutePosition.y then break +end if not n.Active then break end if tick()-D>5 then E=0 elseif tick()-D>2 then +E=0.06 end wait(E)end end end local function scrollDown(z)if o.Active then local +A=tick()local B,C=A,nil C=v.MouseButton1Up:connect(function()A=tick()v.Parent= +nil C:disconnect()end)v.Parent=getScreenGuiAncestor(r)doScrollDown()wait(0.2) +local D,E=tick(),0.1 while A==B do doScrollDown()if z and z<(r.AbsolutePosition. +y+r.AbsoluteSize.x)then break end if not o.Active then break end if tick()-D>5 +then E=0 elseif tick()-D>2 then E=0.06 end wait(E)end end end r.MouseButton1Down +:connect(function(z,A)if r.Active then local B,C=tick(),A-r.AbsolutePosition.y +if d then d:disconnect()d=nil end if g then g:disconnect()g=nil end local D= +false d=v.MouseMoved:connect(function(E,F)if D then return end D=true if +positionScrollBar(E,F,C)then recalculate()end D=false end)g=v.MouseButton1Up: +connect(function()B=tick()v.Parent=nil d:disconnect()d=nil g:disconnect()drag= +nil end)v.Parent=getScreenGuiAncestor(r)end end)local z=0 n.MouseButton1Down: +connect(function()m()end)o.MouseButton1Down:connect(function()scrollDown()end) +local function scrollTick()scrollStamp=tick()end n.MouseButton1Up:connect( +scrollTick)o.MouseButton1Up:connect(scrollTick)r.MouseButton1Up:connect( +scrollTick)local function highLowRecheck()local A,B=b,c b=nil c=nil +resetHighLow()if(b~=A)or(c~=B)then setSliderSizeAndPosition()end end +local function descendantChanged(A,B)if h then return end if not A.Visible then +return end if B=='Size'or B=='Position'then wait()highLowRecheck()end end j. +DescendantAdded:connect(function(A)if not A:IsA'GuiObject'then return end if A. +Visible then wait()highLowRecheck()end i[A]=A.Changed:connect(function(B) +descendantChanged(A,B)end)end)j.DescendantRemoving:connect(function(A)if not A: +IsA'GuiObject'then return end if i[A]then i[A]:disconnect()i[A]=nil end wait() +highLowRecheck()end)j.Changed:connect(function(A)if A=='AbsoluteSize'then if not +c or not b then return end highLowRecheck()setSliderSizeAndPosition()end end) +return j,k end a.CreateScrollingFrame=function(b,c)local d=Instance.new'Frame'd. +Name='ScrollingFrame'd.BackgroundTransparency=1 d.Size=UDim2.new(1,0,1,0)local g +=Instance.new'ImageButton'g.Name='ScrollUpButton'g.BackgroundTransparency=1 g. +Image='rbxasset://textures/ui/scrollbuttonUp.png'g.Size=UDim2.new(0,17,0,17) +local h=Instance.new'ImageButton'h.Name='ScrollDownButton'h. +BackgroundTransparency=1 h.Image='rbxasset://textures/ui/scrollbuttonDown.png'h. +Size=UDim2.new(0,17,0,17)local i=Instance.new'ImageButton'i.Name='ScrollBar'i. +Image='rbxasset://textures/ui/scrollbar.png'i.BackgroundTransparency=1 i.Size= +UDim2.new(0,18,0,150)local j,k=0,Instance.new'ImageButton'k.Image= +'http://www.roblox.com/asset/?id=61367186'k.Size=UDim2.new(1,0,0,16)k. +BackgroundTransparency=1 k.Name='ScrollDrag'k.Active=true k.Parent=i local l= +Instance.new'ImageButton'l.Active=false l.Size=UDim2.new(1.5,0,1.5,0)l. +AutoButtonColor=false l.BackgroundTransparency=1 l.Name='mouseDrag'l.Position= +UDim2.new(-0.25,0,-0.25,0)l.ZIndex=10 local m='simple'if c and tostring(c)then m +=c end local n,o,p=1,0,0 local q,r,s,t=function()p=0 local q={}if b then for r,s +in ipairs(b)do if s.Parent==d then table.insert(q,s)end end else local r=d: +GetChildren()if r then for s,t in ipairs(r)do if t:IsA'GuiObject'then table. +insert(q,t)end end end end if#q==0 then g.Active=false h.Active=false k.Active= +false n=1 return end if n>#q then n=#q end if n<1 then n=1 end local r,s,t,u,v,w +,x,y,z=d.AbsoluteSize.Y,d.AbsoluteSize.Y,d.AbsoluteSize.X,0,0,true,0,#q,0 y=n +while y<=#q and x=t then x=x+z z=0 u=q[y]. +AbsoluteSize.X end if q[y].AbsoluteSize.Y>z then z=q[y].AbsoluteSize.Y end y=y+1 +end x=x+z z=0 y=n-1 u=0 while x+z=1 do u=u+q[y].AbsoluteSize.X v=v+1 if +u>=t then o=v-1 v=0 u=q[y].AbsoluteSize.X if x+z<=r then x=x+z if n<=o then n=1 +break else n=n-o end z=0 else break end end if q[y].AbsoluteSize.Y>z then z=q[y] +.AbsoluteSize.Y end y=y-1 end if(y==0)and(x+z<=r)then n=1 end u=0 v=0 w=true +local A,B,C=0,0 if q[1]then C=math.ceil(math.floor(math.fmod(r,q[1].AbsoluteSize +.X))/2)B=math.ceil(math.floor(math.fmod(t,q[1].AbsoluteSize.Y))/2)end for D,E in +ipairs(q)do if D=t then if w then o=v-1 w=false end u=0 s +=s-E.AbsoluteSize.Y end E.Position=UDim2.new(E.Position.X.Scale,u+B,0,r-s+C)u=u+ +E.AbsoluteSize.X E.Visible=((s-E.AbsoluteSize.Y)>=0)if E.Visible then p=p+1 end +A=E.AbsoluteSize end end end g.Active=(n>1)if A==0 then h.Active=false else h. +Active=((s-A.Y)<0)end k.Active=#q>p k.Visible=k.Active end,function()local q={}p +=0 if b then for r,s in ipairs(b)do if s.Parent==d then table.insert(q,s)end end +else local r=d:GetChildren()if r then for s,t in ipairs(r)do if t:IsA'GuiObject' +then table.insert(q,t)end end end end if#q==0 then g.Active=false h.Active=false +k.Active=false n=1 return end if n>#q then n=#q end local r,s,t,u=d.AbsoluteSize +.Y,d.AbsoluteSize.Y,0,#q while t=1 do if u>=n then t=t+q[u]. +AbsoluteSize.Y else if t+q[u].AbsoluteSize.Y<=r then t=t+q[u].AbsoluteSize.Y if +n<=1 then n=1 break else n=n-1 end else break end end u=u-1 end u=n for v,w in +ipairs(q)do if v=0 then w.Visible=true p=p+1 else w.Visible=false end end +end end g.Active=(n>1)h.Active=(s<0)k.Active=#q>p k.Visible=k.Active end, +function()local q,r=0,d:GetChildren()if r then for s,t in ipairs(r)do if t:IsA +'GuiObject'then q=q+1 end end end if not k.Parent then return end local s=k. +Parent.AbsoluteSize.y*(1/(q-p+1))if s<16 then s=16 end k.Size=UDim2.new(k.Size.X +.Scale,k.Size.X.Offset,k.Size.Y.Scale,s)local t=(n-1)/(q-p)if t>1 then t=1 +elseif t<0 then t=0 end local u=0 if t~=0 then u=(t*i.AbsoluteSize.y)-(t*k. +AbsoluteSize.y)end k.Position=UDim2.new(k.Position.X.Scale,k.Position.X.Offset,k +.Position.Y.Scale,u)end,false local u=function()if t then return end t=true +wait()local u,v=nil if m=='grid'then u,v=pcall(function()q()end)elseif m== +'simple'then u,v=pcall(function()r()end)end if not u then print(v)end s()t=false +end local v,w=function()n=n-o if n<1 then n=1 end u(nil)end,function()n=n+o u( +nil)end local x,y=function(x)if g.Active then j=tick()local y,z=j,nil z=l. +MouseButton1Up:connect(function()j=tick()l.Parent=nil z:disconnect()end)l.Parent +=getScreenGuiAncestor(i)v()wait(0.2)local A,B=tick(),0.1 while j==y do v()if x +and x>k.AbsolutePosition.y then break end if not g.Active then break end if +tick()-A>5 then B=0 elseif tick()-A>2 then B=0.06 end wait(B)end end end, +function(x)if h.Active then j=tick()local y,z=j,nil z=l.MouseButton1Up:connect( +function()j=tick()l.Parent=nil z:disconnect()end)l.Parent=getScreenGuiAncestor(i +)w()wait(0.2)local A,B=tick(),0.1 while j==y do w()if x and x<(k. +AbsolutePosition.y+k.AbsoluteSize.x)then break end if not h.Active then break +end if tick()-A>5 then B=0 elseif tick()-A>2 then B=0.06 end wait(B)end end end +k.MouseButton1Down:connect(function(z,A)if k.Active then j=tick()local B,C,D=A-k +.AbsolutePosition.y,nil,nil C=l.MouseMoved:connect(function(E,F)local G,H,I=i. +AbsolutePosition.y,i.AbsoluteSize.y,k.AbsoluteSize.y local J=G+H-I F=F-B F=FJ and J or F F=F-G local K,L=0,d:GetChildren()if L then for M,N in +ipairs(L)do if N:IsA'GuiObject'then K=K+1 end end end local M,N,O=F/(H-I),o,K-(p +-1)local P=math.floor((M*O)+0.5)+N if P(k.AbsoluteSize.y+k. +AbsolutePosition.y)then y(B)elseif Bc then return b end local g=b while b<=c do local h=b+math +.floor((c-b)/2)if d(h)and(g==nil or gc then return b end local g=c while +b<=c do local h=b+math.floor((c-b)/2)if d(h)and(g==nil or g>h)then g=h c=h-1 +else b=h+1 end end return g end local function getGuiOwner(b)while b~=nil do if +b:IsA'ScreenGui'or b:IsA'BillboardGui'then return b end b=b.Parent end return +nil end a.AutoTruncateTextObject=function(b)local c,d=b.Text,b:Clone()d.Name= +'Full'..b.Name d.BorderSizePixel=0 d.BackgroundTransparency=0 d.Text=c d. +TextXAlignment=Enum.TextXAlignment.Center d.Position=UDim2.new(0,-3,0,0)d.Size= +UDim2.new(0,100,1,0)d.Visible=false d.Parent=b local g,h,i=nil,nil,nil local j= +function()if getGuiOwner(b)==nil then return end b.Text=c if b.TextFits then if +h then h:disconnect()h=nil end if i then i:disconnect()i=nil end else local j= +string.len(c)b.Text=c..'~'local k=binaryGrow(0,j,function(k)if k==0 then b.Text= +'~'else b.Text=string.sub(c,1,k)..'~'end return b.TextFits end)g=string.sub(c,1, +k)..'~'b.Text=g if not d.TextFits then d.Size=UDim2.new(0,10000,1,0)end local l= +binaryShrink(b.AbsoluteSize.X,d.AbsoluteSize.X,function(l)d.Size=UDim2.new(0,l,1 +,0)return d.TextFits end)d.Size=UDim2.new(0,l+6,1,0)if h==nil then h=b. +MouseEnter:connect(function()d.ZIndex=b.ZIndex+1 d.Visible=true end)end if i== +nil then i=b.MouseLeave:connect(function()d.Visible=false end)end end end b. +AncestryChanged:connect(j)b.Changed:connect(function(k)if k=='AbsoluteSize'then +j()end end)j()local function changeText(k)c=k d.Text=c j()end return b, +changeText end local function TransitionTutorialPages(b,c,d,g)if b then b. +Visible=false if d.Visible==false then d.Size=b.Size d.Position=b.Position end +else if d.Visible==false then d.Size=UDim2.new(0,50,0,50)d.Position=UDim2.new( +0.5,-25,0.5,-25)end end d.Visible=true g.Value=nil local h,i if c then c.Visible +=true h=c.Size i=c.Position c.Visible=false else h=UDim2.new(0,50,0,50)i=UDim2. +new(0.5,-25,0.5,-25)end d:TweenSizeAndPosition(h,i,Enum.EasingDirection.InOut, +Enum.EasingStyle.Quad,0.3,true,function(j)if j==Enum.TweenStatus.Completed then +d.Visible=false if c then c.Visible=true g.Value=c end end end)end a. +CreateTutorial=function(b,c,d)local g=Instance.new'Frame'g.Name='Tutorial-'..b g +.BackgroundTransparency=1 g.Size=UDim2.new(0.6,0,0.6,0)g.Position=UDim2.new(0.2, +0,0.2,0)local h=Instance.new'Frame'h.Name='TransitionFrame'h.Style=Enum. +FrameStyle.RobloxRound h.Size=UDim2.new(0.6,0,0.6,0)h.Position=UDim2.new(0.2,0, +0.2,0)h.Visible=false h.Parent=g local i=Instance.new'ObjectValue'i.Name= +'CurrentTutorialPage'i.Value=nil i.Parent=g local j=Instance.new'BoolValue'j. +Name='Buttons'j.Value=d j.Parent=g local k=Instance.new'Frame'k.Name='Pages'k. +BackgroundTransparency=1 k.Size=UDim2.new(1,0,1,0)k.Parent=g local function +getVisiblePageAndHideOthers()local l,m=nil,k:GetChildren()if m then for n,o in +ipairs(m)do if o.Visible then if l then o.Visible=false else l=o end end end end +return l end local l,m,n=function(l)if l or UserSettings().GameSettings: +GetTutorialState(c)==false then print('Showing tutorial-',c)local m,n= +getVisiblePageAndHideOthers(),k:FindFirstChild'TutorialPage1'if n then +TransitionTutorialPages(m,n,h,i)else error'Could not find TutorialPage1'end end +end,function()local l=getVisiblePageAndHideOthers()if l then +TransitionTutorialPages(l,nil,h,i)end UserSettings().GameSettings: +SetTutorialState(c,true)end,function(l)local m,n=k:FindFirstChild('TutorialPage' +..l),getVisiblePageAndHideOthers()TransitionTutorialPages(n,m,h,i)end return g,l +,m,n end local function CreateBasicTutorialPage(b,c,d,g)local h=Instance.new +'Frame'h.Name='TutorialPage'h.Style=Enum.FrameStyle.RobloxRound h.Size=UDim2. +new(0.6,0,0.6,0)h.Position=UDim2.new(0.2,0,0.2,0)h.Visible=false local i= +Instance.new'TextLabel'i.Name='Header'i.Text=b i.BackgroundTransparency=1 i. +FontSize=Enum.FontSize.Size24 i.Font=Enum.Font.ArialBold i.TextColor3=Color3. +new(1,1,1)i.TextXAlignment=Enum.TextXAlignment.Center i.TextWrap=true i.Size= +UDim2.new(1,-55,0,22)i.Position=UDim2.new(0,0,0,0)i.Parent=h local j=Instance. +new'ImageButton'j.Name='SkipButton'j.AutoButtonColor=false j. +BackgroundTransparency=1 j.Image='rbxasset://textures/ui/closeButton.png'j. +MouseButton1Click:connect(function()d()end)j.MouseEnter:connect(function()j. +Image='rbxasset://textures/ui/closeButton_dn.png'end)j.MouseLeave:connect( +function()j.Image='rbxasset://textures/ui/closeButton.png'end)j.Size=UDim2.new(0 +,25,0,25)j.Position=UDim2.new(1,-25,0,0)j.Parent=h if g then local k=Instance. +new'TextButton'k.Name='DoneButton'k.Style=Enum.ButtonStyle.RobloxButtonDefault k +.Text='Done'k.TextColor3=Color3.new(1,1,1)k.Font=Enum.Font.ArialBold k.FontSize= +Enum.FontSize.Size18 k.Size=UDim2.new(0,100,0,50)k.Position=UDim2.new(0.5,-50,1, +-50)if d then k.MouseButton1Click:connect(function()d()end)end k.Parent=h end +local k=Instance.new'Frame'k.Name='ContentFrame'k.BackgroundTransparency=1 k. +Position=UDim2.new(0,0,0,25)k.Parent=h local l=Instance.new'TextButton'l.Name= +'NextButton'l.Text='Next'l.TextColor3=Color3.new(1,1,1)l.Font=Enum.Font.Arial l. +FontSize=Enum.FontSize.Size18 l.Style=Enum.ButtonStyle.RobloxButtonDefault l. +Size=UDim2.new(0,80,0,32)l.Position=UDim2.new(0.5,5,1,-32)l.Active=false l. +Visible=false l.Parent=h local m=Instance.new'TextButton'm.Name='PrevButton'm. +Text='Previous'm.TextColor3=Color3.new(1,1,1)m.Font=Enum.Font.Arial m.FontSize= +Enum.FontSize.Size18 m.Style=Enum.ButtonStyle.RobloxButton m.Size=UDim2.new(0,80 +,0,32)m.Position=UDim2.new(0.5,-85,1,-32)m.Active=false m.Visible=false m.Parent +=h if g then k.Size=UDim2.new(1,0,1,-75)else k.Size=UDim2.new(1,0,1,-22)end +local n=nil local function basicHandleResize()if h.Visible and h.Parent then +local o=math.min(h.Parent.AbsoluteSize.X,h.Parent.AbsoluteSize.Y)c(200,o)end end +h.Changed:connect(function(o)if o=='Parent'then if n~=nil then n:disconnect()n= +nil end if h.Parent and h.Parent:IsA'GuiObject'then n=h.Parent.Changed:connect( +function(p)if p=='AbsoluteSize'then wait()basicHandleResize()end end) +basicHandleResize()end end if o=='Visible'then basicHandleResize()end end)return +h,k end a.CreateTextTutorialPage=function(b,c,d)local g,h,i=nil,nil,Instance.new +'TextLabel'i.BackgroundTransparency=1 i.TextColor3=Color3.new(1,1,1)i.Text=c i. +TextWrap=true i.TextXAlignment=Enum.TextXAlignment.Left i.TextYAlignment=Enum. +TextYAlignment.Center i.Font=Enum.Font.Arial i.FontSize=Enum.FontSize.Size14 i. +Size=UDim2.new(1,0,1,0)local function handleResize(j,k)local l=binaryShrink(j,k, +function(l)g.Size=UDim2.new(0,l,0,l)return i.TextFits end)g.Size=UDim2.new(0,l,0 +,l)g.Position=UDim2.new(0.5,-l/2,0.5,-l/2)end g,h=CreateBasicTutorialPage(b, +handleResize,d)i.Parent=h return g end a.CreateImageTutorialPage=function(b,c,d, +g,h,i)local j,k,l=nil,nil,Instance.new'ImageLabel'l.BackgroundTransparency=1 l. +Image=c l.Size=UDim2.new(0,d,0,g)l.Position=UDim2.new(0.5,-d/2,0.5,-g/2) +local function handleResize(m,n)local o=binaryShrink(m,n,function(o)return o>=d +and o>=g end)if o>=d and o>=g then l.Size=UDim2.new(0,d,0,g)l.Position=UDim2. +new(0.5,-d/2,0.5,-g/2)else if d>g then l.Size=UDim2.new(1,0,g/d,0)l.Position= +UDim2.new(0,0,0.5-(g/d)/2,0)else l.Size=UDim2.new(d/g,0,1,0)l.Position=UDim2. +new(0.5-(d/g)/2,0,0,0)end end o=o+50 j.Size=UDim2.new(0,o,0,o)j.Position=UDim2. +new(0.5,-o/2,0.5,-o/2)end j,k=CreateBasicTutorialPage(b,handleResize,h,i)l. +Parent=k return j end a.AddTutorialPage=function(b,c)local d,g=b.TransitionFrame +,b.CurrentTutorialPage if not b.Buttons.Value then c.NextButton.Parent=nil c. +PrevButton.Parent=nil end local h=b.Pages:GetChildren()if h and#h>0 then c.Name= +'TutorialPage'..(#h+1)local i=h[#h]if not i:IsA'GuiObject'then error +'All elements under Pages must be GuiObjects'end if b.Buttons.Value then if i. +NextButton.Active then error +[[NextButton already Active on previousPage, please only add pages with RbxGui.AddTutorialPage function]] +end i.NextButton.MouseButton1Click:connect(function()TransitionTutorialPages(i,c +,d,g)end)i.NextButton.Active=true i.NextButton.Visible=true if c.PrevButton. +Active then error +[[PrevButton already Active on tutorialPage, please only add pages with RbxGui.AddTutorialPage function]] +end c.PrevButton.MouseButton1Click:connect(function()TransitionTutorialPages(c,i +,d,g)end)c.PrevButton.Active=true c.PrevButton.Visible=true end c.Parent=b.Pages +else c.Name='TutorialPage1'c.Parent=b.Pages end end a.CreateSetPanel=function(b, +c,d,g,h,i,j)if not b then error +[[CreateSetPanel: userIdsForSets (first arg) is nil, should be a table of number ids]] +end if type(b)~='table'and type(b)~='userdata'then error( +'CreateSetPanel: userIdsForSets (first arg) is of type '..type(b).. +', should be of type table or userdata')end if not c then error +[[CreateSetPanel: objectSelected (second arg) is nil, should be a callback function!]] +end if type(c)~='function'then error( +'CreateSetPanel: objectSelected (second arg) is of type '..type(c).. +', should be of type function!')end if d and type(d)~='function'then error( +'CreateSetPanel: dialogClosed (third arg) is of type '..type(d).. +', should be of type function!')end if i==nil then i=false end local k,l,m,n,o,p +,q,r,s=1,{},{},nil,nil,'NegX','None',nil local t={}t.CurrentCategory=nil t. +Category={}local u,v,w={},nil,64 local x,y,z,A=w,nil,nil,game:GetService +'ContentProvider'.BaseUrl:lower()if j then z=A.. +[[Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&assetversionid=]]y=A.. +[[Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=75&ht=75&assetversionid=]]else z=A.. +'Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=420&ht=420&aid='y=A.. +'Game/Tools/ThumbnailAsset.ashx?fmt=png&wd=75&ht=75&aid='end local function +drillDownSetZIndex(B,C)local D=B:GetChildren()for E=1,#D do if D[E]:IsA +'GuiObject'then D[E].ZIndex=C end drillDownSetZIndex(D[E],C)end end local B,C,D= +nil,{'Block','Vertical Ramp','Corner Wedge','Inverse Corner Wedge', +'Horizontal Ramp','Auto-Wedge'},{}for E=1,#C do D[C[E]]=E-1 end D[C[#C]]=6 +local function createWaterGui()local E,F,G={'NegX','X','NegY','Y','NegZ','Z'},{ +'None','Small','Medium','Strong','Max'},Instance.new'Frame'G.Name='WaterFrame'G. +Style=Enum.FrameStyle.RobloxSquare G.Size=UDim2.new(0,150,0,110)G.Visible=false +local H=Instance.new'TextLabel'H.Name='WaterForceLabel'H.BackgroundTransparency= +1 H.Size=UDim2.new(1,0,0,12)H.Font=Enum.Font.ArialBold H.FontSize=Enum.FontSize. +Size12 H.TextColor3=Color3.new(1,1,1)H.TextXAlignment=Enum.TextXAlignment.Left H +.Text='Water Force'H.Parent=G local I=H:Clone()I.Name='WaterForceDirectionLabel' +I.Text='Water Force Direction'I.Position=UDim2.new(0,0,0,50)I.Parent=G local J= +Instance.new'BindableEvent'J.Name='WaterTypeChangedEvent'J.Parent=G local K,L= +function(K)p=K J:Fire{q,p}end,function(K)q=K J:Fire{q,p}end local M,N=a. +CreateDropDownMenu(E,K)M.Size=UDim2.new(1,0,0,25)M.Position=UDim2.new(0,0,1,3)N +'NegX'M.Parent=I local O,P=a.CreateDropDownMenu(F,L)P'None'O.Size=UDim2.new(1,0, +0,25)O.Position=UDim2.new(0,0,1,3)O.Parent=H return G,J end local function +createSetGui()local E=Instance.new'ScreenGui'E.Name='SetGui'local F=Instance.new +'Frame'F.Name='SetPanel'F.Active=true F.BackgroundTransparency=1 if h then F. +Position=h else F.Position=UDim2.new(0.2,29,0.1,24)end if g then F.Size=g else F +.Size=UDim2.new(0.6,-58,0.64,0)end F.Style=Enum.FrameStyle.RobloxRound F.ZIndex= +6 F.Parent=E local G=Instance.new'Frame'G.Name='ItemPreview'G. +BackgroundTransparency=1 G.Position=UDim2.new(0.8,5,0.085,0)G.Size=UDim2.new( +0.21,0,0.9,0)G.ZIndex=6 G.Parent=F local H=Instance.new'Frame'H.Name='TextPanel' +H.BackgroundTransparency=1 H.Position=UDim2.new(0,0,0.45,0)H.Size=UDim2.new(1,0, +0.55,0)H.ZIndex=6 H.Parent=G local I=Instance.new'TextLabel'I.Name= +'RolloverText'I.BackgroundTransparency=1 I.Size=UDim2.new(1,0,0,48)I.ZIndex=6 I. +Font=Enum.Font.ArialBold I.FontSize=Enum.FontSize.Size24 I.Text=''I.TextColor3= +Color3.new(1,1,1)I.TextWrap=true I.TextXAlignment=Enum.TextXAlignment.Left I. +TextYAlignment=Enum.TextYAlignment.Top I.Parent=H local J=Instance.new +'ImageLabel'J.Name='LargePreview'J.BackgroundTransparency=1 J.Image=''J.Size= +UDim2.new(1,0,0,170)J.ZIndex=6 J.Parent=G local K=Instance.new'Frame'K.Name= +'Sets'K.BackgroundTransparency=1 K.Position=UDim2.new(0,0,0,5)K.Size=UDim2.new( +0.23,0,1,-5)K.ZIndex=6 K.Parent=F local L=Instance.new'Frame'L.Name='Line'L. +BackgroundColor3=Color3.new(1,1,1)L.BackgroundTransparency=0.7 L.BorderSizePixel +=0 L.Position=UDim2.new(1,-3,0.06,0)L.Size=UDim2.new(0,3,0.9,0)L.ZIndex=6 L. +Parent=K local M,N=a.CreateTrueScrollingFrame()M.Size=UDim2.new(1,-6,0.94,0)M. +Position=UDim2.new(0,0,0.06,0)M.BackgroundTransparency=1 M.Name='SetsLists'M. +ZIndex=6 M.Parent=K drillDownSetZIndex(N,7)local O=Instance.new'TextLabel'O.Name +='SetsHeader'O.BackgroundTransparency=1 O.Size=UDim2.new(0,47,0,24)O.ZIndex=6 O. +Font=Enum.Font.ArialBold O.FontSize=Enum.FontSize.Size24 O.Text='Sets'O. +TextColor3=Color3.new(1,1,1)O.TextXAlignment=Enum.TextXAlignment.Left O. +TextYAlignment=Enum.TextYAlignment.Top O.Parent=K local P=Instance.new +'TextButton'P.Name='CancelButton'P.Position=UDim2.new(1,-32,0,-2)P.Size=UDim2. +new(0,34,0,34)P.Style=Enum.ButtonStyle.RobloxButtonDefault P.ZIndex=6 P.Text=''P +.Modal=true P.Parent=F local Q=Instance.new'ImageLabel'Q.Name='CancelImage'Q. +BackgroundTransparency=1 Q.Image='http://www.roblox.com/asset?id=54135717'Q. +Position=UDim2.new(0,-2,0,-2)Q.Size=UDim2.new(0,16,0,16)Q.ZIndex=6 Q.Parent=P +return E end local function createSetButton(E)local F=Instance.new'TextButton'if +E then F.Text=E else F.Text=''end F.AutoButtonColor=false F. +BackgroundTransparency=1 F.BackgroundColor3=Color3.new(1,1,1)F.BorderSizePixel=0 +F.Size=UDim2.new(1,-5,0,18)F.ZIndex=6 F.Visible=false F.Font=Enum.Font.Arial F. +FontSize=Enum.FontSize.Size18 F.TextColor3=Color3.new(1,1,1)F.TextXAlignment= +Enum.TextXAlignment.Left return F end local function buildSetButton(E,F,G,H,I) +local J=createSetButton(E)J.Text=E J.Name='SetButton'J.Visible=true local K= +Instance.new'IntValue'K.Name='SetId'K.Value=F K.Parent=J local L=Instance.new +'StringValue'L.Name='SetName'L.Value=E L.Parent=J return J end local function +processCategory(E)local F,I={},0 for J=1,#E do if not i and E[J].Name=='Beta' +then I=I+1 else F[J-I]=buildSetButton(E[J].Name,E[J].CategoryId,E[J]. +ImageAssetId,J-I,#E)end end return F end local function handleResize()wait() +local E=o.SetPanel.ItemPreview E.LargePreview.Size=UDim2.new(1,0,0,E. +AbsoluteSize.X)E.LargePreview.Position=UDim2.new(0.5,-E.LargePreview. +AbsoluteSize.X/2,0,0)E.TextPanel.Position=UDim2.new(0,0,0,E.LargePreview. +AbsoluteSize.Y)E.TextPanel.Size=UDim2.new(1,0,0,E.AbsoluteSize.Y-E.LargePreview. +AbsoluteSize.Y)end local function makeInsertAssetButton()local E=Instance.new +'Frame'E.Name='InsertAssetButtonExample'E.Position=UDim2.new(0,128,0,64)E.Size= +UDim2.new(0,64,0,64)E.BackgroundTransparency=1 E.ZIndex=6 E.Visible=false local +F=Instance.new'IntValue'F.Name='AssetId'F.Value=0 F.Parent=E local I=Instance. +new'StringValue'I.Name='AssetName'I.Value=''I.Parent=E local J=Instance.new +'TextButton'J.Name='Button'J.Text=''J.Style=Enum.ButtonStyle.RobloxButton J. +Position=UDim2.new(0.025,0,0.025,0)J.Size=UDim2.new(0.95,0,0.95,0)J.ZIndex=6 J. +Parent=E local K=Instance.new'ImageLabel'K.Name='ButtonImage'K.Image=''K. +Position=UDim2.new(0,-7,0,-7)K.Size=UDim2.new(1,14,1,14)K.BackgroundTransparency +=1 K.ZIndex=7 K.Parent=J local L=K:clone()L.Name='ConfigIcon'L.Visible=false L. +Position=UDim2.new(1,-23,1,-24)L.Size=UDim2.new(0,16,0,16)L.Image=''L.ZIndex=6 L +.Parent=E return E end local function showLargePreview(E)if E:FindFirstChild +'AssetId'then delay(0,function()game:GetService'ContentProvider':Preload(z.. +tostring(E.AssetId.Value))o.SetPanel.ItemPreview.LargePreview.Image=z..tostring( +E.AssetId.Value)end)end if E:FindFirstChild'AssetName'then o.SetPanel. +ItemPreview.TextPanel.RolloverText.Text=E.AssetName.Value end end local function +selectTerrainShape(E)if B then c(tostring(B.AssetName.Value),tonumber(B.AssetId. +Value),E)end end local function createTerrainTypeButton(E,F)local I=Instance.new +'TextButton'I.Name=E..'Button'I.Font=Enum.Font.ArialBold I.FontSize=Enum. +FontSize.Size14 I.BorderSizePixel=0 I.TextColor3=Color3.new(1,1,1)I.Text=E I. +TextXAlignment=Enum.TextXAlignment.Left I.BackgroundTransparency=1 I.ZIndex=F. +ZIndex+1 I.Size=UDim2.new(0,F.Size.X.Offset-2,0,16)I.Position=UDim2.new(0,1,0,0) +I.MouseEnter:connect(function()I.BackgroundTransparency=0 I.TextColor3=Color3. +new(0,0,0)end)I.MouseLeave:connect(function()I.BackgroundTransparency=1 I. +TextColor3=Color3.new(1,1,1)end)I.MouseButton1Click:connect(function()I. +BackgroundTransparency=1 I.TextColor3=Color3.new(1,1,1)if I.Parent and I.Parent: +IsA'GuiObject'then I.Parent.Visible=false end selectTerrainShape(D[I.Text])end) +return I end local function createTerrainDropDownMenu(E)local F=Instance.new +'Frame'F.Name='TerrainDropDown'F.BackgroundColor3=Color3.new(0,0,0)F. +BorderColor3=Color3.new(1,0,0)F.Size=UDim2.new(0,200,0,0)F.Visible=false F. +ZIndex=E F.Parent=o for I=1,#C do local J=createTerrainTypeButton(C[I],F)J. +Position=UDim2.new(0,1,0,(I-1)*J.Size.Y.Offset)J.Parent=F F.Size=UDim2.new(0,200 +,0,F.Size.Y.Offset+J.Size.Y.Offset)end F.MouseLeave:connect(function()F.Visible= +false end)end local function createDropDownMenuButton(E)local F=Instance.new +'ImageButton'F.Name='DropDownButton'F.Image= +'http://www.roblox.com/asset/?id=67581509'F.BackgroundTransparency=1 F.Size= +UDim2.new(0,16,0,16)F.Position=UDim2.new(1,-24,0,6)F.ZIndex=E.ZIndex+2 F.Parent= +E if not o:FindFirstChild'TerrainDropDown'then createTerrainDropDownMenu(8)end F +.MouseButton1Click:connect(function()o.TerrainDropDown.Visible=true o. +TerrainDropDown.Position=UDim2.new(0,E.AbsolutePosition.X,0,E.AbsolutePosition.Y +)B=E end)end local function buildInsertButton()local E=makeInsertAssetButton()E. +Name='InsertAssetButton'E.Visible=true if t.Category[t.CurrentCategory].SetName +=='High Scalability'then createDropDownMenuButton(E)end local F=nil local I=E. +MouseEnter:connect(function()F=E delay(0.1,function()if F==E then +showLargePreview(E)end end)end)return E,I end local function realignButtonGrid(E +)local F,I=0,0 for J=1,#l do l[J].Position=UDim2.new(0,w*F,0,x*I)F=F+1 if F>=E +then F=0 I=I+1 end end end local function setInsertButtonImageBehavior(E,F,I,J) +if F then E.AssetName.Value=I E.AssetId.Value=J local K=y..J if K~=E.Button. +ButtonImage.Image then delay(0,function()game:GetService'ContentProvider': +Preload(y..J)E.Button.ButtonImage.Image=y..J end)end table.insert(m,E.Button. +MouseButton1Click:connect(function()local L=(I=='Water')and(t.Category[t. +CurrentCategory].SetName=='High Scalability')r.Visible=L if L then c(I,tonumber( +J),nil)else c(I,tonumber(J))end end))E.Visible=true else E.Visible=false end end +local function loadSectionOfItems(E,F,I)local J=F*I if k>#n then return end +local K=k for L=1,J+1 do if k>=#n+1 then break end local M l[k],M= +buildInsertButton()table.insert(m,M)l[k].Parent=E.SetPanel.ItemsFrame k=k+1 end +realignButtonGrid(I)for L=K,k do if l[L]then if n[L]then if n[L].Name=='Water' +then if t.Category[t.CurrentCategory].SetName=='High Scalability'then l[L]: +FindFirstChild('DropDownButton',true):Destroy()end end local M if j then M=n[L]. +AssetVersionId else M=n[L].AssetId end setInsertButtonImageBehavior(l[L],true,n[ +L].Name,M)else break end else break end end end local function setSetIndex()t. +Category[t.CurrentCategory].Index=0 local E,F=7,math.floor(o.SetPanel.ItemsFrame +.AbsoluteSize.X/w)n=t.Category[t.CurrentCategory].Contents if n then for I=1,#l +do l[I]:remove()end for I=1,#m do if m[I]then m[I]:disconnect()end end m={}l={}k +=1 loadSectionOfItems(o,E,F)end end local function selectSet(E,F,I,J)if E and t. +Category[t.CurrentCategory]~=nil then if E~=t.Category[t.CurrentCategory].Button +then t.Category[t.CurrentCategory].Button=E if u[I]==nil then u[I]=game: +GetService'InsertService':GetCollection(I)end t.Category[t.CurrentCategory]. +Contents=u[I]t.Category[t.CurrentCategory].SetName=F t.Category[t. +CurrentCategory].SetId=I end setSetIndex()end end local function +selectCategoryPage(E,F)if E~=t.CurrentCategory then if t.CurrentCategory then +for I,J in pairs(t.CurrentCategory)do J.Visible=false end end t.CurrentCategory= +E if t.Category[t.CurrentCategory]==nil then t.Category[t.CurrentCategory]={}if# +E>0 then selectSet(E[1],E[1].SetName.Value,E[1].SetId.Value,0)end else t. +Category[t.CurrentCategory].Button=nil selectSet(t.Category[t.CurrentCategory]. +ButtonFrame,t.Category[t.CurrentCategory].SetName,t.Category[t.CurrentCategory]. +SetId,t.Category[t.CurrentCategory].Index)end end end local function +selectCategory(E)selectCategoryPage(E,0)end local function +resetAllSetButtonSelection()local E=o.SetPanel.Sets.SetsLists:GetChildren()for F +=1,#E do if E[F]:IsA'TextButton'then E[F].Selected=false E[F]. +BackgroundTransparency=1 E[F].TextColor3=Color3.new(1,1,1)E[F].BackgroundColor3= +Color3.new(1,1,1)end end end local function populateSetsFrame()local E=0 for F=1 +,#v do local I=v[F]I.Visible=true I.Position=UDim2.new(0,5,0,E*I.Size.Y.Offset)I +.Parent=o.SetPanel.Sets.SetsLists if F==1 then I.Selected=true I. +BackgroundColor3=Color3.new(0,0.8,0)I.TextColor3=Color3.new(0,0,0)I. +BackgroundTransparency=0 end I.MouseEnter:connect(function()if not I.Selected +then I.BackgroundTransparency=0 I.TextColor3=Color3.new(0,0,0)end end)I. +MouseLeave:connect(function()if not I.Selected then I.BackgroundTransparency=1 I +.TextColor3=Color3.new(1,1,1)end end)I.MouseButton1Click:connect(function() +resetAllSetButtonSelection()I.Selected=not I.Selected I.BackgroundColor3=Color3. +new(0,0.8,0)I.TextColor3=Color3.new(0,0,0)I.BackgroundTransparency=0 selectSet(I +,I.Text,v[F].SetId.Value,0)end)E=E+1 end local F=o.SetPanel.Sets.SetsLists: +GetChildren()if F then for I=1,#F do if F[I]:IsA'TextButton'then selectSet(F[I], +F[I].Text,v[I].SetId.Value,0)selectCategory(v)break end end end end o= +createSetGui()r,s=createWaterGui()r.Position=UDim2.new(0,55,0,0)r.Parent=o o. +Changed:connect(function(E)if E=='AbsoluteSize'then handleResize()setSetIndex() +end end)local E,F=a.CreateTrueScrollingFrame()E.Size=UDim2.new(0.54,0,0.85,0)E. +Position=UDim2.new(0.24,0,0.085,0)E.Name='ItemsFrame'E.ZIndex=6 E.Parent=o. +SetPanel E.BackgroundTransparency=1 drillDownSetZIndex(F,7)F.Parent=o.SetPanel F +.Position=UDim2.new(0.76,5,0,0)local I=false F.ScrollBottom.Changed:connect( +function(J)if F.ScrollBottom.Value==true then if I then return end I=true +loadSectionOfItems(o,rows,columns)I=false end end)local J={}for K=1,#b do local +L=game:GetService'InsertService':GetUserSets(b[K])if L and#L>2 then for M=3,#L +do if L[M].Name=='High Scalability'then table.insert(J,1,L[M])else table.insert( +J,L[M])end end end end if J then v=processCategory(J)end rows=math.floor(o. +SetPanel.ItemsFrame.AbsoluteSize.Y/x)columns=math.floor(o.SetPanel.ItemsFrame. +AbsoluteSize.X/w)populateSetsFrame()o.SetPanel.CancelButton.MouseButton1Click: +connect(function()o.SetPanel.Visible=false if d then d()end end)local K,L= +function(K)if K then o.SetPanel.Visible=true else o.SetPanel.Visible=false end +end,function()if o then if o:FindFirstChild'SetPanel'then return o.SetPanel. +Visible end end return false end return o,K,L,s end a. +CreateTerrainMaterialSelector=function(b,c)local d=Instance.new'BindableEvent'd. +Name='TerrainMaterialSelectionChanged'local g,h=nil,Instance.new'Frame'h.Name= +'TerrainMaterialSelector'if b then h.Size=b else h.Size=UDim2.new(0,245,0,230) +end if c then h.Position=c end h.BorderSizePixel=0 h.BackgroundColor3=Color3. +new(0,0,0)h.Active=true d.Parent=h local i,j,k=true,{},{'Grass','Sand','Brick', +'Granite','Asphalt','Iron','Aluminum','Gold','Plank','Log','Gravel', +'Cinder Block','Stone Wall','Concrete','Plastic (red)','Plastic (blue)'}if i +then table.insert(k,'Water')end local l=1 function getEnumFromName(m)if m== +'Grass'then return 1 end if m=='Sand'then return 2 end if m=='Erase'then return +0 end if m=='Brick'then return 3 end if m=='Granite'then return 4 end if m== +'Asphalt'then return 5 end if m=='Iron'then return 6 end if m=='Aluminum'then +return 7 end if m=='Gold'then return 8 end if m=='Plank'then return 9 end if m== +'Log'then return 10 end if m=='Gravel'then return 11 end if m=='Cinder Block' +then return 12 end if m=='Stone Wall'then return 13 end if m=='Concrete'then +return 14 end if m=='Plastic (red)'then return 15 end if m=='Plastic (blue)'then +return 16 end if m=='Water'then return 17 end end function getNameFromEnum(m)if +m==Enum.CellMaterial.Grass or m==1 then return'Grass'elseif m==Enum.CellMaterial +.Sand or m==2 then return'Sand'elseif m==Enum.CellMaterial.Empty or m==0 then +return'Erase'elseif m==Enum.CellMaterial.Brick or m==3 then return'Brick'elseif +m==Enum.CellMaterial.Granite or m==4 then return'Granite'elseif m==Enum. +CellMaterial.Asphalt or m==5 then return'Asphalt'elseif m==Enum.CellMaterial. +Iron or m==6 then return'Iron'elseif m==Enum.CellMaterial.Aluminum or m==7 then +return'Aluminum'elseif m==Enum.CellMaterial.Gold or m==8 then return'Gold'elseif +m==Enum.CellMaterial.WoodPlank or m==9 then return'Plank'elseif m==Enum. +CellMaterial.WoodLog or m==10 then return'Log'elseif m==Enum.CellMaterial.Gravel +or m==11 then return'Gravel'elseif m==Enum.CellMaterial.CinderBlock or m==12 +then return'Cinder Block'elseif m==Enum.CellMaterial.MossyStone or m==13 then +return'Stone Wall'elseif m==Enum.CellMaterial.Cement or m==14 then return +'Concrete'elseif m==Enum.CellMaterial.RedPlastic or m==15 then return +'Plastic (red)'elseif m==Enum.CellMaterial.BluePlastic or m==16 then return +'Plastic (blue)'end if i then if m==Enum.CellMaterial.Water or m==17 then return +'Water'end end end local function updateMaterialChoice(m)l=getEnumFromName(m)d: +Fire(l)end for m,n in pairs(k)do j[n]={}if n=='Grass'then j[n].Regular= +'http://www.roblox.com/asset/?id=56563112'elseif n=='Sand'then j[n].Regular= +'http://www.roblox.com/asset/?id=62356652'elseif n=='Brick'then j[n].Regular= +'http://www.roblox.com/asset/?id=65961537'elseif n=='Granite'then j[n].Regular= +'http://www.roblox.com/asset/?id=67532153'elseif n=='Asphalt'then j[n].Regular= +'http://www.roblox.com/asset/?id=67532038'elseif n=='Iron'then j[n].Regular= +'http://www.roblox.com/asset/?id=67532093'elseif n=='Aluminum'then j[n].Regular= +'http://www.roblox.com/asset/?id=67531995'elseif n=='Gold'then j[n].Regular= +'http://www.roblox.com/asset/?id=67532118'elseif n=='Plastic (red)'then j[n]. +Regular='http://www.roblox.com/asset/?id=67531848'elseif n=='Plastic (blue)'then +j[n].Regular='http://www.roblox.com/asset/?id=67531924'elseif n=='Plank'then j[n +].Regular='http://www.roblox.com/asset/?id=67532015'elseif n=='Log'then j[n]. +Regular='http://www.roblox.com/asset/?id=67532051'elseif n=='Gravel'then j[n]. +Regular='http://www.roblox.com/asset/?id=67532206'elseif n=='Cinder Block'then j +[n].Regular='http://www.roblox.com/asset/?id=67532103'elseif n=='Stone Wall'then +j[n].Regular='http://www.roblox.com/asset/?id=67531804'elseif n=='Concrete'then +j[n].Regular='http://www.roblox.com/asset/?id=67532059'elseif n=='Water'then j[n +].Regular='http://www.roblox.com/asset/?id=81407474'else j[n].Regular= +'http://www.roblox.com/asset/?id=66887593'end end local o,p,q,r=a. +CreateScrollingFrame(nil,'grid')o.Size=UDim2.new(0.85,0,1,0)o.Position=UDim2. +new(0,0,0,0)o.Parent=h p.Parent=h p.Visible=true p.Position=UDim2.new(1,-19,0,0) +q.Parent=h q.Visible=true q.Position=UDim2.new(1,-19,1,-17)local function +goToNewMaterial(s,t)updateMaterialChoice(t)s.BackgroundTransparency=0 g. +BackgroundTransparency=1 g=s end local function createMaterialButton(s)local t= +Instance.new'TextButton't.Text=''t.Size=UDim2.new(0,32,0,32)t.BackgroundColor3= +Color3.new(1,1,1)t.BorderSizePixel=0 t.BackgroundTransparency=1 t. +AutoButtonColor=false t.Name=tostring(s)local u=Instance.new'ImageButton'u. +AutoButtonColor=false u.BackgroundTransparency=1 u.Size=UDim2.new(0,30,0,30)u. +Position=UDim2.new(0,1,0,1)u.Name=tostring(s)u.Parent=t u.Image=j[s].Regular +local v=Instance.new'NumberValue'v.Name='EnumType'v.Parent=t v.Value=0 u. +MouseEnter:connect(function()t.BackgroundTransparency=0 end)u.MouseLeave: +connect(function()if g~=t then t.BackgroundTransparency=1 end end)u. +MouseButton1Click:connect(function()if g~=t then goToNewMaterial(t,tostring(s)) +end end)return t end for s=1,#k do local t=createMaterialButton(k[s])if k[s]== +'Grass'then g=t t.BackgroundTransparency=0 end t.Parent=o end local s=function(s +)if not s then return end if l==s then return end local t,u=getNameFromEnum(s),o +:GetChildren()for v=1,#u do if u[v].Name=='Plastic (blue)'and t== +'Plastic (blue)'then goToNewMaterial(u[v],t)return end if u[v].Name== +'Plastic (red)'and t=='Plastic (red)'then goToNewMaterial(u[v],t)return end if +string.find(u[v].Name,t)then goToNewMaterial(u[v],t)return end end end h.Changed +:connect(function(t)if t=='AbsoluteSize'then r()end end)r()return h,d,s end a. +CreateLoadingFrame=function(b,c,d)game:GetService'ContentProvider':Preload +'http://www.roblox.com/asset/?id=35238053'local g=Instance.new'Frame'g.Name= +'LoadingFrame'g.Style=Enum.FrameStyle.RobloxRound if c then g.Size=c else g.Size +=UDim2.new(0,300,0,160)end if d then g.Position=d else g.Position=UDim2.new(0.5, +-150,0.5,-80)end local h=Instance.new'Frame'h.Name='LoadingBar'h. +BackgroundColor3=Color3.new(0,0,0)h.BorderColor3=Color3.new(0.30980392156862746, +0.30980392156862746,0.30980392156862746)h.Position=UDim2.new(0,0,0,41)h.Size= +UDim2.new(1,0,0,30)h.Parent=g local i=Instance.new'ImageLabel'i.Name= +'LoadingGreenBar'i.Image='http://www.roblox.com/asset/?id=35238053'i.Position= +UDim2.new(0,0,0,0)i.Size=UDim2.new(0,0,1,0)i.Visible=false i.Parent=h local j= +Instance.new'TextLabel'j.Name='LoadingPercent'j.BackgroundTransparency=1 j. +Position=UDim2.new(0,0,1,0)j.Size=UDim2.new(1,0,0,14)j.Font=Enum.Font.Arial j. +Text='0%'j.FontSize=Enum.FontSize.Size14 j.TextColor3=Color3.new(1,1,1)j.Parent= +h local k=Instance.new'TextButton'k.Name='CancelButton'k.Position=UDim2.new(0.5, +-60,1,-40)k.Size=UDim2.new(0,120,0,40)k.Font=Enum.Font.Arial k.FontSize=Enum. +FontSize.Size18 k.TextColor3=Color3.new(1,1,1)k.Text='Cancel'k.Style=Enum. +ButtonStyle.RobloxButton k.Parent=g local l=Instance.new'TextLabel'l.Name= +'loadingName'l.BackgroundTransparency=1 l.Size=UDim2.new(1,0,0,18)l.Position= +UDim2.new(0,0,0,2)l.Font=Enum.Font.Arial l.Text=b l.TextColor3=Color3.new(1,1,1) +l.TextStrokeTransparency=1 l.FontSize=Enum.FontSize.Size18 l.Parent=g local m= +Instance.new'BindableEvent'm.Name='CancelButtonClicked'm.Parent=k k. +MouseButton1Click:connect(function()m:Fire()end)local n=function(n,o,p)if n and +type(n)~='number'then error( +'updateLoadingGuiPercent expects number as argument, got',type(n),'instead')end +local q=nil if n<0 then q=UDim2.new(0,0,1,0)elseif n>1 then q=UDim2.new(1,0,1,0) +else q=UDim2.new(n,0,1,0)end if o then if not p then error +[[updateLoadingGuiPercent is set to tween new percentage, but got no tween time length! Please pass this in as third argument]] +end if q.X.Scale>0 then i.Visible=true i:TweenSize(q,Enum.EasingDirection.Out, +Enum.EasingStyle.Quad,p,true)else i:TweenSize(q,Enum.EasingDirection.Out,Enum. +EasingStyle.Quad,p,true,function()if q.X.Scale<0 then i.Visible=false end end) +end else i.Size=q i.Visible=(q.X.Scale>0)end end i.Changed:connect(function(o)if +o=='Size'then j.Text=tostring(math.ceil(i.Size.X.Scale*100))..'%'end end)return +g,n,m end a.CreatePluginFrame=function(b,c,d,g,h)function createMenuButton(i,j,k +,l,m,n)local o=Instance.new'TextButton'o.AutoButtonColor=false o.Name=m o. +BackgroundTransparency=1 o.Position=j o.Size=i o.Font=Enum.Font.ArialBold o. +FontSize=l o.Text=k o.TextColor3=Color3.new(1,1,1)o.BorderSizePixel=0 o. +BackgroundColor3=Color3.new(7.8431372549019605E-2,7.8431372549019605E-2, +7.8431372549019605E-2)o.MouseEnter:connect(function()if o.Selected then return +end o.BackgroundTransparency=0 end)o.MouseLeave:connect(function()if o.Selected +then return end o.BackgroundTransparency=1 end)o.Parent=n return o end local i= +Instance.new'Frame'i.Name=tostring(b)..'DragBar'i.BackgroundColor3=Color3.new( +0.15294117647058825,0.15294117647058825,0.15294117647058825)i.BorderColor3= +Color3.new(0,0,0)if c then i.Size=UDim2.new(c.X.Scale,c.X.Offset,0,20)+UDim2. +new(0,20,0,0)else i.Size=UDim2.new(0,183,0,20)end if d then i.Position=d end i. +Active=true i.Draggable=true i.MouseEnter:connect(function()i.BackgroundColor3= +Color3.new(0.19215686274509805,0.19215686274509805,0.19215686274509805)end)i. +MouseLeave:connect(function()i.BackgroundColor3=Color3.new(0.15294117647058825, +0.15294117647058825,0.15294117647058825)end)i.Parent=h local j=Instance.new +'TextLabel'j.Name='BarNameLabel'j.Text=' '..tostring(b)j.TextColor3=Color3.new(1 +,1,1)j.TextStrokeTransparency=0 j.Size=UDim2.new(1,0,1,0)j.Font=Enum.Font. +ArialBold j.FontSize=Enum.FontSize.Size18 j.TextXAlignment=Enum.TextXAlignment. +Left j.BackgroundTransparency=1 j.Parent=i local k,l=createMenuButton(UDim2.new( +0,15,0,17),UDim2.new(1,-16,0.5,-8),'X',Enum.FontSize.Size14,'CloseButton',i), +Instance.new'BindableEvent'l.Name='CloseEvent'l.Parent=k k.MouseButton1Click: +connect(function()l:Fire()k.BackgroundTransparency=1 end)local m,n= +createMenuButton(UDim2.new(0,15,0,17),UDim2.new(1,-51,0.5,-8),'?',Enum.FontSize. +Size14,'HelpButton',i),Instance.new'Frame'n.Name='HelpFrame'n.BackgroundColor3= +Color3.new(0,0,0)n.Size=UDim2.new(0,300,0,552)n.Position=UDim2.new(1,5,0,0)n. +Active=true n.BorderSizePixel=0 n.Visible=false n.Parent=i m.MouseButton1Click: +connect(function()n.Visible=not n.Visible if n.Visible then m.Selected=true m. +BackgroundTransparency=0 local o=getScreenGuiAncestor(n)if o then if n. +AbsolutePosition.X+n.AbsoluteSize.X>o.AbsoluteSize.X then n.Position=UDim2.new(0 +,-5-n.AbsoluteSize.X,0,0)else n.Position=UDim2.new(1,5,0,0)end else n.Position= +UDim2.new(1,5,0,0)end else m.Selected=false m.BackgroundTransparency=1 end end) +local o=createMenuButton(UDim2.new(0,16,0,17),UDim2.new(1,-34,0.5,-8),'-',Enum. +FontSize.Size14,'MinimizeButton',i)o.TextYAlignment=Enum.TextYAlignment.Top +local p=Instance.new'Frame'p.Name='MinimizeFrame'p.BackgroundColor3=Color3.new( +0.28627450980392155,0.28627450980392155,0.28627450980392155)p.BorderColor3= +Color3.new(0,0,0)p.Position=UDim2.new(0,0,1,0)if c then p.Size=UDim2.new(c.X. +Scale,c.X.Offset,0,50)+UDim2.new(0,20,0,0)else p.Size=UDim2.new(0,183,0,50)end p +.Visible=false p.Parent=i local q=Instance.new'TextButton'q.Position=UDim2.new( +0.5,-50,0.5,-20)q.Name='MinimizeButton'q.Size=UDim2.new(0,100,0,40)q.Style=Enum. +ButtonStyle.RobloxButton q.Font=Enum.Font.ArialBold q.FontSize=Enum.FontSize. +Size18 q.TextColor3=Color3.new(1,1,1)q.Text='Show'q.Parent=p local r=Instance. +new'Frame'r.Name='SeparatingLine'r.BackgroundColor3=Color3.new( +0.45098039215686275,0.45098039215686275,0.45098039215686275)r.BorderSizePixel=0 +r.Position=UDim2.new(1,-18,0.5,-7)r.Size=UDim2.new(0,1,0,14)r.Parent=i local s=r +:clone()s.Position=UDim2.new(1,-35,0.5,-7)s.Parent=i local t=Instance.new'Frame' +t.Name='WidgetContainer't.BackgroundTransparency=1 t.Position=UDim2.new(0,0,1,0) +t.BorderColor3=Color3.new(0,0,0)if not g then t.BackgroundTransparency=0 t. +BackgroundColor3=Color3.new(0.2823529411764706,0.2823529411764706, +0.2823529411764706)end t.Parent=i if c then if g then t.Size=c else t.Size=UDim2 +.new(0,i.AbsoluteSize.X,c.Y.Scale,c.Y.Offset)end else if g then t.Size=UDim2. +new(0,163,0,400)else t.Size=UDim2.new(0,i.AbsoluteSize.X,0,400)end end if d then +t.Position=d+UDim2.new(0,0,0,20)end local u,v,w=nil if g then u,v=a. +CreateTrueScrollingFrame()u.Size=UDim2.new(1,0,1,0)u.BackgroundColor3=Color3. +new(0.2823529411764706,0.2823529411764706,0.2823529411764706)u.BorderColor3= +Color3.new(0,0,0)u.Active=true u.Parent=t v.Parent=i v.BackgroundColor3=Color3. +new(0.2823529411764706,0.2823529411764706,0.2823529411764706)v.BorderSizePixel=0 +v.BackgroundTransparency=0 v.Position=UDim2.new(1,-21,1,1)if c then v.Size=UDim2 +.new(0,21,c.Y.Scale,c.Y.Offset)else v.Size=UDim2.new(0,21,0,400)end v: +FindFirstChild'ScrollDownButton'.Position=UDim2.new(0,0,1,-20)local x=Instance. +new'Frame'x.Name='FakeLine'x.BorderSizePixel=0 x.BackgroundColor3=Color3.new(0,0 +,0)x.Size=UDim2.new(0,1,1,1)x.Position=UDim2.new(1,0,0,0)x.Parent=v w=Instance. +new'TextButton'w.ZIndex=2 w.AutoButtonColor=false w.Name='VerticalDragger'w. +BackgroundColor3=Color3.new(0.19607843137254902,0.19607843137254902, +0.19607843137254902)w.BorderColor3=Color3.new(0,0,0)w.Size=UDim2.new(1,20,0,20)w +.Position=UDim2.new(0,0,1,0)w.Active=true w.Text=''w.Parent=t local y=Instance. +new'Frame'y.Name='ScrubFrame'y.BackgroundColor3=Color3.new(1,1,1)y. +BorderSizePixel=0 y.Position=UDim2.new(0.5,-5,0.5,0)y.Size=UDim2.new(0,10,0,1)y. +ZIndex=5 y.Parent=w local z=y:clone()z.Position=UDim2.new(0.5,-5,0.5,-2)z.Parent +=w local A=y:clone()A.Position=UDim2.new(0.5,-5,0.5,2)A.Parent=w local B= +Instance.new'TextButton'B.Name='AreaSoak'B.Size=UDim2.new(1,0,1,0)B. +BackgroundTransparency=1 B.BorderSizePixel=0 B.Text=''B.ZIndex=10 B.Visible= +false B.Active=true B.Parent=getScreenGuiAncestor(h)local C,D=false,nil w. +MouseEnter:connect(function()w.BackgroundColor3=Color3.new(0.23529411764705882, +0.23529411764705882,0.23529411764705882)end)w.MouseLeave:connect(function()w. +BackgroundColor3=Color3.new(0.19607843137254902,0.19607843137254902, +0.19607843137254902)end)w.MouseButton1Down:connect(function(E,F)C=true B.Visible +=true D=F end)B.MouseButton1Up:connect(function()C=false B.Visible=false end)B. +MouseMoved:connect(function(E,F)if not C then return end local I=F-D if not v. +ScrollDownButton.Visible and I>0 then return end if(t.Size.Y.Offset+I)<150 then +t.Size=UDim2.new(t.Size.X.Scale,t.Size.X.Offset,t.Size.Y.Scale,150)v.Size=UDim2. +new(0,21,0,150)return end D=F if t.Size.Y.Offset+I>=0 then t.Size=UDim2.new(t. +Size.X.Scale,t.Size.X.Offset,t.Size.Y.Scale,t.Size.Y.Offset+I)v.Size=UDim2.new(0 +,21,0,v.Size.Y.Offset+I)end end)end local function switchMinimize()p.Visible=not +p.Visible if g then u.Visible=not u.Visible w.Visible=not w.Visible v.Visible= +not v.Visible else t.Visible=not t.Visible end if p.Visible then o.Text='+'else +o.Text='-'end end q.MouseButton1Click:connect(function()switchMinimize()end)o. +MouseButton1Click:connect(function()switchMinimize()end)if g then return i,u,n,l +else return i,t,n,l end end a.Help=function(b)if b=='CreatePropertyDropDownMenu' +or b==a.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 b=='CreateDropDownMenu'or b==a.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 b=='CreateMessageDialog'or b==a.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 b=='CreateStyledMessageDialog'or b==a.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 b=='GetFontHeight'or b==a.GetFontHeight then return +[[Function GetFontHeight. Arguments: (font, fontSize). Side effect: returns the size in pixels of the given font + fontSize]] +end if b=='CreateScrollingFrame'or b==a.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 b=='CreateTrueScrollingFrame'or b==a.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 b=='AutoTruncateTextObject'or b==a.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 b=='CreateSlider'or b==a.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 b=='CreateLoadingFrame'or b==a.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 b=='CreateTerrainMaterialSelector'or b==a.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 a \ No newline at end of file diff --git a/processed/45374389.lua b/processed/45374389.lua index 72fff34..c8083f2 100644 --- a/processed/45374389.lua +++ b/processed/45374389.lua @@ -1,16 +1,5 @@ -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 +local a={}a.Foo=function()print'foo'end a.Bar=function()print'bar'end a.Help= +function(b)if b=='Foo'or b==a.Foo then return +'Function Foo. Arguments: None. Side effect: prints foo'elseif b=='Bar'or b==a +.Bar 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 a13a343..211f065 100644 --- a/processed/46295863.lua +++ b/processed/46295863.lua @@ -1,2417 +1,557 @@ -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 +local function waitForChild(a,b)while not a:FindFirstChild(b)do a.ChildAdded: +wait()end end local function waitForProperty(a,b)while not a[b]do a.Changed: +wait()end end local a if script.Parent:FindFirstChild'ControlFrame'then a=script +.Parent:FindFirstChild'ControlFrame'else a=script.Parent end local b,c,d,e,f,g,h +,i,j,k,l,m,n,o,p,q,r=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,pcall( +function()return not game.GuiService.IsWindows end)p=q and r local function +Color3I(s,t,u)return Color3.new(s/255,t/255,u/255)end local function robloxLock( +s)s.RobloxLocked=true local t=s:GetChildren()if t then for u,v in ipairs(t)do +robloxLock(v)end end end function resumeGameFunction(s)s.Settings:TweenPosition( +UDim2.new(0.5,-262,-0.5,-200),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,e +,true)delay(e,function()s.Visible=false for t=1,#m do m[t].Visible=false game. +GuiService:RemoveCenterDialog(m[t])end game.GuiService:RemoveCenterDialog(s) +settingsButton.Active=true k=nil l={}end)end function goToMenu(s,t,u,v,w)if +type(t)~='string'then return end table.insert(l,k)if t=='GameMainMenu'then l={} +end local x=s:GetChildren()for y=1,#x do if x[y].Name==t then x[y].Visible=true +k={container=s,name=t,direction=u,lastSize=v}if v and w then x[y]: +TweenSizeAndPosition(v,w,Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,e,true +)elseif v then x[y]:TweenSizeAndPosition(v,UDim2.new(0.5,-v.X.Offset/2,0.5,-v.Y. +Offset/2),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,e,true)else x[y]: +TweenPosition(UDim2.new(0,0,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle. +Sine,e,true)end else if u=='left'then x[y]:TweenPosition(UDim2.new(-1,-525,0,0), +Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,e,true)elseif u=='right'then x[ +y]:TweenPosition(UDim2.new(1,525,0,0),Enum.EasingDirection.InOut,Enum. +EasingStyle.Sine,e,true)elseif u=='up'then x[y]:TweenPosition(UDim2.new(0,0,-1,- +400),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,e,true)elseif u=='down' +then x[y]:TweenPosition(UDim2.new(0,0,1,400),Enum.EasingDirection.InOut,Enum. +EasingStyle.Sine,e,true)end delay(e,function()x[y].Visible=false end)end end end +function resetLocalCharacter()local s=game.Players.LocalPlayer if s then if s. +Character and s.Character:FindFirstChild'Humanoid'then s.Character.Humanoid. +Health=0 end end end local function createTextButton(s,t,u,v,w)local x=Instance. +new'TextButton'x.Font=Enum.Font.Arial x.FontSize=u x.Size=v x.Position=w x.Style +=t x.TextColor3=Color3.new(1,1,1)x.Text=s return x end local function +CreateTextButtons(s,t,u,v)if#t<1 then error'Must have more than one button'end +local w,x=1,{}local function toggleSelection(y)for z,A in ipairs(x)do if A==y +then A.Style=Enum.ButtonStyle.RobloxButtonDefault else A.Style=Enum.ButtonStyle. +RobloxButton end end end for y,z in ipairs(t)do local A=Instance.new'TextButton' +A.Name='Button'..w A.Font=Enum.Font.Arial A.FontSize=Enum.FontSize.Size18 A. +AutoButtonColor=true A.Style=Enum.ButtonStyle.RobloxButton A.Text=z.Text A. +TextColor3=Color3.new(1,1,1)A.MouseButton1Click:connect(function() +toggleSelection(A)z.Function()end)A.Parent=s x[w]=A w=w+1 end toggleSelection(x[ +1])local A=w-1 if A==1 then s.Button1.Position=UDim2.new(0.35,0,u.Scale,u.Offset +)s.Button1.Size=UDim2.new(0.4,0,v.Scale,v.Offset)elseif A==2 then s.Button1. +Position=UDim2.new(0.1,0,u.Scale,u.Offset)s.Button1.Size=UDim2.new(0.35,0,v. +Scale,v.Offset)s.Button2.Position=UDim2.new(0.55,0,u.Scale,u.Offset)s.Button2. +Size=UDim2.new(0.35,0,v.Scale,v.Offset)elseif A>=3 then local B,C=0.1/A,0.9/A w= +1 while w<=A do x[w].Position=UDim2.new(B*w+(w-1)*C,0,u.Scale,u.Offset)x[w].Size +=UDim2.new(C,0,v.Scale,v.Offset)w=w+1 end end end function setRecordGui(s,t,u)if +s then t.Visible=true u.Text='Stop Recording'else t.Visible=false u.Text= +'Record Video'end end function recordVideoClick(s,t)j=not j setRecordGui(j,t,s) +end function backToGame(s,t,u)s.Parent.Parent.Parent.Parent.Visible=false t. +Visible=false for v=1,#m do game.GuiService:RemoveCenterDialog(m[v])m[v].Visible +=false end m={}game.GuiService:RemoveCenterDialog(t)u.Active=true end function +setDisabledState(s)if not s then return end if s:IsA'TextLabel'then s. +TextTransparency=0.9 elseif s:IsA'TextButton'then s.TextTransparency=0.9 s. +Active=false else if s['ClassName']then print( +[[setDisabledState() got object of unsupported type. object type is ]],s. +ClassName)end end end local function createHelpDialog(s)if b==nil then if a: +FindFirstChild'TopLeftControl'and a.TopLeftControl:FindFirstChild'Help'then b=a. +TopLeftControl.Help elseif a:FindFirstChild'BottomRightControl'and a. +BottomRightControl:FindFirstChild'Help'then b=a.BottomRightControl.Help end end +local t=Instance.new'Frame't.Name='HelpDialogShield't.Active=true t.Visible= +false t.Size=UDim2.new(1,0,1,0)t.BackgroundColor3=Color3I(51,51,51)t. +BorderColor3=Color3I(27,42,53)t.BackgroundTransparency=0.4 t.ZIndex=s+1 local u= +Instance.new'Frame'u.Name='HelpDialog'u.Style=Enum.FrameStyle.RobloxRound u. +Position=UDim2.new(0.2,0,0.2,0)u.Size=UDim2.new(0.6,0,0.6,0)u.Active=true u. +Parent=t local v=Instance.new'TextLabel'v.Name='Title'v.Text= +'Keyboard & Mouse Controls'v.Font=Enum.Font.ArialBold v.FontSize=Enum.FontSize. +Size36 v.Position=UDim2.new(0,0,0.025,0)v.Size=UDim2.new(1,0,0,40)v.TextColor3= +Color3.new(1,1,1)v.BackgroundTransparency=1 v.Parent=u local w=Instance.new +'Frame'w.Name='Buttons'w.Position=UDim2.new(0.1,0,0.07,40)w.Size=UDim2.new(0.8,0 +,0,45)w.BackgroundTransparency=1 w.Parent=u local x=Instance.new'Frame'x.Name= +'ImageFrame'x.Position=UDim2.new(0.05,0,0.075,80)x.Size=UDim2.new(0.9,0,0.9,-120 +)x.BackgroundTransparency=1 x.Parent=u local y=Instance.new'Frame'y.Name= +'LayoutFrame'y.Position=UDim2.new(0.5,0,0,0)y.Size=UDim2.new(1.5,0,1,0)y. +BackgroundTransparency=1 y.SizeConstraint=Enum.SizeConstraint.RelativeYY y. +Parent=x local z=Instance.new'ImageLabel'z.Name='Image'if UserSettings(). +GameSettings.ControlMode==Enum.ControlMode['Mouse Lock Switch']then z.Image=f +else z.Image=g end z.Position=UDim2.new(-0.5,0,0,0)z.Size=UDim2.new(1,0,1,0)z. +BackgroundTransparency=1 z.Parent=y local A={}A[1]={}A[1].Text='Look'A[1]. +Function=function()if UserSettings().GameSettings.ControlMode==Enum.ControlMode[ +'Mouse Lock Switch']then z.Image=f else z.Image=g end end A[2]={}A[2].Text= +'Move'A[2].Function=function()z.Image='http://www.roblox.com/Asset?id=45915811' +end A[3]={}A[3].Text='Gear'A[3].Function=function()z.Image= +'http://www.roblox.com/Asset?id=45917596'end A[4]={}A[4].Text='Zoom'A[4]. +Function=function()z.Image='http://www.roblox.com/Asset?id=45915825'end +CreateTextButtons(w,A,UDim.new(0,0),UDim.new(1,0))delay(0,function() +waitForChild(a,'UserSettingsShield')waitForChild(a.UserSettingsShield,'Settings' +)waitForChild(a.UserSettingsShield.Settings,'SettingsStyle')waitForChild(a. +UserSettingsShield.Settings.SettingsStyle,'GameSettingsMenu')waitForChild(a. +UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu,'CameraField') +waitForChild(a.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu. +CameraField,'DropDownMenuButton')a.UserSettingsShield.Settings.SettingsStyle. +GameSettingsMenu.CameraField.DropDownMenuButton.Changed:connect(function(B)if B +~='Text'then return end if w.Button1.Style==Enum.ButtonStyle.RobloxButtonDefault +then if a.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField +.DropDownMenuButton.Text=='Classic'then z.Image=g else z.Image=f end end end)end +)local B=Instance.new'TextButton'B.Name='OkBtn'B.Text='OK'B.Modal=true B.Size= +UDim2.new(0.3,0,0,45)B.Position=UDim2.new(0.35,0,0.975,-50)B.Font=Enum.Font. +Arial B.FontSize=Enum.FontSize.Size18 B.BackgroundTransparency=1 B.TextColor3= +Color3.new(1,1,1)B.Style=Enum.ButtonStyle.RobloxButtonDefault B. +MouseButton1Click:connect(function()t.Visible=false game.GuiService: +RemoveCenterDialog(t)end)B.Parent=u robloxLock(t)return t end local function +createLeaveConfirmationMenu(s,t)local u=Instance.new'Frame'u.Name= +'LeaveConfirmationMenu'u.BackgroundTransparency=1 u.Size=UDim2.new(1,0,1,0)u. +Position=UDim2.new(0,0,2,400)u.ZIndex=s+4 local v=createTextButton('Leave',Enum. +ButtonStyle.RobloxButton,Enum.FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0, +313,0.8,0))v.Name='YesButton'v.ZIndex=s+4 v.Parent=u v.Modal=true v:SetVerb +'Exit'local w=createTextButton('Stay',Enum.ButtonStyle.RobloxButtonDefault,Enum. +FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0,90,0.8,0))w.Name='NoButton'w. +Parent=u w.ZIndex=s+4 w.MouseButton1Click:connect(function()goToMenu(t.Settings. +SettingsStyle,'GameMainMenu','down',UDim2.new(0,525,0,430))t.Settings:TweenSize( +UDim2.new(0,525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,e,true) +end)local x=Instance.new'TextLabel'x.Name='LeaveText'x.Text='Leave this game?'x. +Size=UDim2.new(1,0,0.8,0)x.TextWrap=true x.TextColor3=Color3.new(1,1,1)x.Font= +Enum.Font.ArialBold x.FontSize=Enum.FontSize.Size36 x.BackgroundTransparency=1 x +.ZIndex=s+4 x.Parent=u return u end local function createResetConfirmationMenu(s +,t)local u=Instance.new'Frame'u.Name='ResetConfirmationMenu'u. +BackgroundTransparency=1 u.Size=UDim2.new(1,0,1,0)u.Position=UDim2.new(0,0,2,400 +)u.ZIndex=s+4 local v=createTextButton('Reset',Enum.ButtonStyle. +RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,128,0,50),UDim2.new(0,313,0 +,299))v.Name='YesButton'v.ZIndex=s+4 v.Parent=u v.Modal=true v.MouseButton1Click +:connect(function()resumeGameFunction(t)resetLocalCharacter()end)local w= +createTextButton('Cancel',Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size24, +UDim2.new(0,128,0,50),UDim2.new(0,90,0,299))w.Name='NoButton'w.Parent=u w.ZIndex +=s+4 w.MouseButton1Click:connect(function()goToMenu(t.Settings.SettingsStyle, +'GameMainMenu','down',UDim2.new(0,525,0,430))t.Settings:TweenSize(UDim2.new(0, +525,0,430),Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,e,true)end)local x= +Instance.new'TextLabel'x.Name='ResetCharacterText'x.Text= +'Are you sure you want to reset your character?'x.Size=UDim2.new(1,0,0.8,0)x. +TextWrap=true x.TextColor3=Color3.new(1,1,1)x.Font=Enum.Font.ArialBold x. +FontSize=Enum.FontSize.Size36 x.BackgroundTransparency=1 x.ZIndex=s+4 x.Parent=u +local y=x:Clone()y.Name='FineResetCharacterText'y.Text= +'You will be put back on a spawn point'y.Size=UDim2.new(0,303,0,18)y.Position= +UDim2.new(0,109,0,215)y.FontSize=Enum.FontSize.Size18 y.Parent=u return u end +local function createGameMainMenu(s,t)local u=Instance.new'Frame'u.Name= +'GameMainMenu'u.BackgroundTransparency=1 u.Size=UDim2.new(1,0,1,0)u.ZIndex=s+4 u +.Parent=settingsFrame local v=Instance.new'TextLabel'v.Name='Title'v.Text= +'Game Menu'v.BackgroundTransparency=1 v.TextStrokeTransparency=0 v.Font=Enum. +Font.ArialBold v.FontSize=Enum.FontSize.Size36 v.Size=UDim2.new(1,0,0,36)v. +Position=UDim2.new(0,0,0,4)v.TextColor3=Color3.new(1,1,1)v.ZIndex=s+4 v.Parent=u +local w=createTextButton('Help',Enum.ButtonStyle.RobloxButton,Enum.FontSize. +Size18,UDim2.new(0,164,0,50),UDim2.new(0,82,0,256))w.Name='HelpButton'w.ZIndex=s ++4 w.Parent=u b=w local x=createHelpDialog(s)x.Parent=a b.MouseButton1Click: +connect(function()table.insert(m,x)game.GuiService:AddCenterDialog(x,Enum. +CenterDialogType.ModalDialog,function()x.Visible=true n.Visible=false end, +function()x.Visible=false end)end)b.Active=true local y=Instance.new'TextLabel'y +.Name='HelpShortcutText'y.Text='F1'y.Visible=false y.BackgroundTransparency=1 y. +Font=Enum.Font.Arial y.FontSize=Enum.FontSize.Size12 y.Position=UDim2.new(0,85,0 +,0)y.Size=UDim2.new(0,30,0,30)y.TextColor3=Color3.new(0,1,0)y.ZIndex=s+4 y. +Parent=w local z=createTextButton('Screenshot',Enum.ButtonStyle.RobloxButton, +Enum.FontSize.Size18,UDim2.new(0,168,0,50),UDim2.new(0,254,0,256))z.Name= +'ScreenshotButton'z.ZIndex=s+4 z.Parent=u z.Visible=not p z:SetVerb'Screenshot' +local A=y:clone()A.Name='ScreenshotShortcutText'A.Text='PrintSc'A.Position=UDim2 +.new(0,118,0,0)A.Visible=true A.Parent=z local B=createTextButton('Record Video' +,Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0,168,0,50),UDim2. +new(0,254,0,306))B.Name='RecordVideoButton'B.ZIndex=s+4 B.Parent=u B.Visible=not +p B:SetVerb'RecordToggle'local C=y:clone()C.Visible=h C.Name= +'RecordVideoShortcutText'C.Text='F12'C.Position=UDim2.new(0,120,0,0)C.Parent=B +local D=Instance.new'ImageButton'D.Name='StopRecordButton'D. +BackgroundTransparency=1 D.Image='rbxasset://textures/ui/RecordStop.png'D.Size= +UDim2.new(0,59,0,27)D:SetVerb'RecordToggle'D.MouseButton1Click:connect(function( +)recordVideoClick(B,D)end)D.Visible=false D.Parent=a local E=createTextButton( +'Report Abuse',Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2.new(0, +164,0,50),UDim2.new(0,82,0,306))E.Name='ReportAbuseButton'E.ZIndex=s+4 E.Parent= +u local F=createTextButton('Leave Game',Enum.ButtonStyle.RobloxButton,Enum. +FontSize.Size24,UDim2.new(0,340,0,50),UDim2.new(0,82,0,358))F.Name= +'LeaveGameButton'F.ZIndex=s+4 F.Parent=u local G=createTextButton('Resume Game', +Enum.ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,340,0,50), +UDim2.new(0,82,0,54))G.Name='resumeGameButton'G.ZIndex=s+4 G.Parent=u G.Modal= +true G.MouseButton1Click:connect(function()resumeGameFunction(t)end)local H= +createTextButton('Game Settings',Enum.ButtonStyle.RobloxButton,Enum.FontSize. +Size24,UDim2.new(0,340,0,50),UDim2.new(0,82,0,156))H.Name='SettingsButton'H. +ZIndex=s+4 H.Parent=u if game:FindFirstChild'LoadingGuiService'and#game. +LoadingGuiService:GetChildren()>0 then local I=createTextButton( +'Game Instructions',Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size24,UDim2. +new(0,340,0,50),UDim2.new(0,82,0,207))I.Name='GameInstructions'I.ZIndex=s+4 I. +Parent=u I.MouseButton1Click:connect(function()if game:FindFirstChild'Players' +and game.Players['LocalPlayer']then local J=game.Players.LocalPlayer: +FindFirstChild'PlayerLoadingGui'if J then J.Visible=true end end end)end local I +=createTextButton('Reset Character',Enum.ButtonStyle.RobloxButton,Enum.FontSize. +Size24,UDim2.new(0,340,0,50),UDim2.new(0,82,0,105))I.Name='ResetButton'I.ZIndex= +s+4 I.Parent=u return u end local function createGameSettingsMenu(s,t)local u= +Instance.new'Frame'u.Name='GameSettingsMenu'u.BackgroundTransparency=1 u.Size= +UDim2.new(1,0,1,0)u.ZIndex=s+4 local v=Instance.new'TextLabel'v.Name='Title'v. +Text='Settings'v.Size=UDim2.new(1,0,0,48)v.Position=UDim2.new(0,9,0,-9)v.Font= +Enum.Font.ArialBold v.FontSize=Enum.FontSize.Size36 v.TextColor3=Color3.new(1,1, +1)v.ZIndex=s+4 v.BackgroundTransparency=1 v.Parent=u local w=Instance.new +'TextLabel'w.Name='FullscreenText'w.Text='Fullscreen Mode'w.Size=UDim2.new(0,124 +,0,18)w.Position=UDim2.new(0,62,0,145)w.Font=Enum.Font.Arial w.FontSize=Enum. +FontSize.Size18 w.TextColor3=Color3.new(1,1,1)w.ZIndex=s+4 w. +BackgroundTransparency=1 w.Parent=u local x=Instance.new'TextLabel'x.Visible=h x +.Name='FullscreenShortcutText'x.Text='F11'x.BackgroundTransparency=1 x.Font=Enum +.Font.Arial x.FontSize=Enum.FontSize.Size12 x.Position=UDim2.new(0,186,0,141)x. +Size=UDim2.new(0,30,0,30)x.TextColor3=Color3.new(0,1,0)x.ZIndex=s+4 x.Parent=u +local y=Instance.new'TextLabel'y.Visible=false y.Name='StudioText'y.Text= +'Studio Mode'y.Size=UDim2.new(0,95,0,18)y.Position=UDim2.new(0,62,0,179)y.Font= +Enum.Font.Arial y.FontSize=Enum.FontSize.Size18 y.TextColor3=Color3.new(1,1,1)y. +ZIndex=s+4 y.BackgroundTransparency=1 y.Parent=u local z=x:clone()z.Name= +'StudioShortcutText'z.Visible=false z.Text='F2'z.Position=UDim2.new(0,154,0,175) +z.Parent=u local A=nil if h then local B=Instance.new'TextLabel'B.Name= +'QualityText'B.Text='Graphics Quality'B.Size=UDim2.new(0,128,0,18)B.Position= +UDim2.new(0,30,0,239)B.Font=Enum.Font.Arial B.FontSize=Enum.FontSize.Size18 B. +TextColor3=Color3.new(1,1,1)B.ZIndex=s+4 B.BackgroundTransparency=1 B.Parent=u B +.Visible=not o local C=B:clone()C.Name='AutoText'C.Text='Auto'C.Position=UDim2. +new(0,183,0,214)C.TextColor3=Color3.new(0.5019607843137255,0.5019607843137255, +0.5019607843137255)C.Size=UDim2.new(0,34,0,18)C.Parent=u C.Visible=not o local D +=C:clone()D.Name='FasterText'D.Text='Faster'D.Position=UDim2.new(0,185,0,274)D. +TextColor3=Color3.new(95,95,95)D.FontSize=Enum.FontSize.Size14 D.Parent=u D. +Visible=not o local E=x:clone()E.Name='FasterShortcutText'E.Text='F10 + Shift'E. +Position=UDim2.new(0,185,0,283)E.Parent=u E.Visible=not o local F=C:clone()F. +Name='BetterQualityText'F.Text='Better Quality'F.TextWrap=true F.Size=UDim2.new( +0,41,0,28)F.Position=UDim2.new(0,390,0,269)F.TextColor3=Color3.new(95,95,95)F. +FontSize=Enum.FontSize.Size14 F.Parent=u F.Visible=not o local G=x:clone()G.Name +='BetterQualityShortcut'G.Text='F10'G.Position=UDim2.new(0,394,0,288)G.Parent=u +G.Visible=not o local H=createTextButton('X',Enum.ButtonStyle.RobloxButton,Enum. +FontSize.Size18,UDim2.new(0,25,0,25),UDim2.new(0,187,0,239))H.Name= +'AutoGraphicsButton'H.ZIndex=s+4 H.Parent=u H.Visible=not o local I,J=RbxGui. +CreateSlider(i,150,UDim2.new(0,230,0,280))I.Parent=u I.Bar.ZIndex=s+4 I.Bar. +Slider.ZIndex=s+5 I.Visible=not o J.Value=math.floor((settings().Rendering: +GetMaxQualityLevel()-1)/2)local K=Instance.new'TextBox'K.Name='GraphicsSetter'K. +BackgroundColor3=Color3.new(0,0,0)K.BorderColor3=Color3.new(0.5019607843137255, +0.5019607843137255,0.5019607843137255)K.Size=UDim2.new(0,50,0,25)K.Position= +UDim2.new(0,450,0,269)K.TextColor3=Color3.new(1,1,1)K.Font=Enum.Font.Arial K. +FontSize=Enum.FontSize.Size18 K.Text='Auto'K.ZIndex=1 K.TextWrap=true K.Parent=u +K.Visible=not o local L=true if not o then L=(UserSettings().GameSettings. +SavedQualityLevel==Enum.SavedQualitySetting.Automatic)else settings().Rendering. +EnableFRM=false end local M=true local function setAutoGraphicsGui(N)L=N if N +then H.Text='X'F.ZIndex=1 G.ZIndex=1 E.ZIndex=1 D.ZIndex=1 I.Bar.ZIndex=1 I.Bar. +Slider.ZIndex=1 K.ZIndex=1 K.Text='Auto'else H.Text=''I.Bar.ZIndex=s+4 I.Bar. +Slider.ZIndex=s+5 G.ZIndex=s+4 E.ZIndex=s+4 F.ZIndex=s+4 D.ZIndex=s+4 K.ZIndex=s ++4 end end local function goToAutoGraphics()setAutoGraphicsGui(true) +UserSettings().GameSettings.SavedQualityLevel=Enum.SavedQualitySetting.Automatic +settings().Rendering.QualityLevel=Enum.QualityLevel.Automatic end local function +setGraphicsQualityLevel(N)local O=N/i local P=math.floor((settings().Rendering: +GetMaxQualityLevel()-1)*O)if P==20 then P=21 elseif N==1 then P=1 elseif P> +settings().Rendering:GetMaxQualityLevel()then P=settings().Rendering: +GetMaxQualityLevel()-1 end UserSettings().GameSettings.SavedQualityLevel=N +settings().Rendering.QualityLevel=P end local function goToManualGraphics(N) +setAutoGraphicsGui(false)if N then J.Value=N else J.Value=math.floor((settings() +.Rendering.AutoFRMLevel/(settings().Rendering:GetMaxQualityLevel()-1))*i)end if +N==J.Value then setGraphicsQualityLevel(J.Value)end if not N then UserSettings() +.GameSettings.SavedQualityLevel=J.Value end K.Text=tostring(J.Value)end +local function showAutoGraphics()C.ZIndex=s+4 H.ZIndex=s+4 end local function +hideAutoGraphics()C.ZIndex=1 H.ZIndex=1 end local function showManualGraphics()I +.Bar.ZIndex=s+4 I.Bar.Slider.ZIndex=s+5 G.ZIndex=s+4 E.ZIndex=s+4 F.ZIndex=s+4 D +.ZIndex=s+4 K.ZIndex=s+4 end local function hideManualGraphics()F.ZIndex=1 G. +ZIndex=1 E.ZIndex=1 D.ZIndex=1 I.Bar.ZIndex=1 I.Bar.Slider.ZIndex=1 K.ZIndex=1 +end local function translateSavedQualityLevelToInt(N)if N==Enum. +SavedQualitySetting.Automatic then return 0 elseif N==Enum.SavedQualitySetting. +QualityLevel1 then return 1 elseif N==Enum.SavedQualitySetting.QualityLevel2 +then return 2 elseif N==Enum.SavedQualitySetting.QualityLevel3 then return 3 +elseif N==Enum.SavedQualitySetting.QualityLevel4 then return 4 elseif N==Enum. +SavedQualitySetting.QualityLevel5 then return 5 elseif N==Enum. +SavedQualitySetting.QualityLevel6 then return 6 elseif N==Enum. +SavedQualitySetting.QualityLevel7 then return 7 elseif N==Enum. +SavedQualitySetting.QualityLevel8 then return 8 elseif N==Enum. +SavedQualitySetting.QualityLevel9 then return 9 elseif N==Enum. +SavedQualitySetting.QualityLevel10 then return 10 end end local function +enableGraphicsWidget()settings().Rendering.EnableFRM=true L=(UserSettings(). +GameSettings.SavedQualityLevel==Enum.SavedQualitySetting.Automatic)if L then +showAutoGraphics()goToAutoGraphics()else showAutoGraphics()showManualGraphics() +goToManualGraphics(translateSavedQualityLevelToInt(UserSettings().GameSettings. +SavedQualityLevel))end end local function disableGraphicsWidget() +hideManualGraphics()hideAutoGraphics()settings().Rendering.EnableFRM=false end K +.FocusLost:connect(function()if L then K.Text=tostring(J.Value)return end local +N=tonumber(K.Text)if N==nil then K.Text=tostring(J.Value)return end if N<1 then +N=1 elseif N>=settings().Rendering:GetMaxQualityLevel()then N=settings(). +Rendering:GetMaxQualityLevel()-1 end J.Value=N setGraphicsQualityLevel(J.Value)K +.Text=tostring(J.Value)end)J.Changed:connect(function(N)if L then return end if +not M then return end K.Text=tostring(J.Value)setGraphicsQualityLevel(J.Value) +end)if o or UserSettings().GameSettings.SavedQualityLevel==Enum. +SavedQualitySetting.Automatic then if o then settings().Rendering.EnableFRM= +false disableGraphicsWidget()else settings().Rendering.EnableFRM=true +goToAutoGraphics()end else settings().Rendering.EnableFRM=true +goToManualGraphics(translateSavedQualityLevelToInt(UserSettings().GameSettings. +SavedQualityLevel))end H.MouseButton1Click:connect(function()if o and not game. +Players.LocalPlayer then return end if not L then goToAutoGraphics()else +goToManualGraphics(J.Value)end end)game.GraphicsQualityChangeRequest:connect( +function(N)if L then return end if N then if(J.Value+1)>i then return end J. +Value=J.Value+1 K.Text=tostring(J.Value)setGraphicsQualityLevel(J.Value)game: +GetService'GuiService':SendNotification('Graphics Quality','Increased to ('..K. +Text..')','',2,function()end)else if(J.Value-1)<=0 then return end J.Value=J. +Value-1 K.Text=tostring(J.Value)setGraphicsQualityLevel(J.Value)game:GetService +'GuiService':SendNotification('Graphics Quality','Decreased to ('..K.Text..')', +'',2,function()end)end end)game.Players.PlayerAdded:connect(function(N)if N== +game.Players.LocalPlayer and o then enableGraphicsWidget()end end)game.Players. +PlayerRemoving:connect(function(N)if N==game.Players.LocalPlayer and o then +disableGraphicsWidget()end end)A=createTextButton('',Enum.ButtonStyle. +RobloxButton,Enum.FontSize.Size18,UDim2.new(0,25,0,25),UDim2.new(0,30,0,176))A. +Name='StudioCheckbox'A.ZIndex=s+4 A:SetVerb'TogglePlayMode'A.Visible=false local +N=(settings().Rendering.QualityLevel~=Enum.QualityLevel.Automatic)if o and not +game.Players.LocalPlayer then A.Text='X'disableGraphicsWidget()elseif o then A. +Text='X'enableGraphicsWidget()end if h then UserSettings().GameSettings. +StudioModeChanged:connect(function(O)o=O if O then N=(settings().Rendering. +QualityLevel~=Enum.QualityLevel.Automatic)goToAutoGraphics()A.Text='X'H.ZIndex=1 +C.ZIndex=1 else if N then goToManualGraphics()end A.Text=''H.ZIndex=s+4 C.ZIndex +=s+4 end end)else A.MouseButton1Click:connect(function()if not A.Active then +return end if A.Text==''then A.Text='X'else A.Text=''end end)end end local B= +createTextButton('',Enum.ButtonStyle.RobloxButton,Enum.FontSize.Size18,UDim2. +new(0,25,0,25),UDim2.new(0,30,0,144))B.Name='FullscreenCheckbox'B.ZIndex=s+4 B. +Parent=u B:SetVerb'ToggleFullScreen'if UserSettings().GameSettings:InFullScreen( +)then B.Text='X'end if h then UserSettings().GameSettings.FullscreenChanged: +connect(function(C)if C then B.Text='X'else B.Text=''end end)else B. +MouseButton1Click:connect(function()if B.Text==''then B.Text='X'else B.Text='' +end end)end if game:FindFirstChild'NetworkClient'then setDisabledState(y) +setDisabledState(z)setDisabledState(A)end local C if h then C=createTextButton( +'OK',Enum.ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,180,0 +,50),UDim2.new(0,170,0,330))C.Modal=true else C=createTextButton('OK',Enum. +ButtonStyle.RobloxButtonDefault,Enum.FontSize.Size24,UDim2.new(0,180,0,50),UDim2 +.new(0,170,0,270))C.Modal=true end C.Name='BackButton'C.ZIndex=s+4 C.Parent=u +syncVideoCaptureSetting=nil if not p then local D=Instance.new'TextLabel'D.Name= +'VideoCaptureLabel'D.Text='After Capturing Video'D.Font=Enum.Font.Arial D. +FontSize=Enum.FontSize.Size18 D.Position=UDim2.new(0,32,0,100)D.Size=UDim2.new(0 +,164,0,18)D.BackgroundTransparency=1 D.TextColor3=Color3I(255,255,255)D. +TextXAlignment=Enum.TextXAlignment.Left D.ZIndex=s+4 D.Parent=u local E,F={},{}E +[1]='Just Save to Disk'F[E[1]]=Enum.UploadSetting['Never']E[2]= +'Upload to YouTube'F[E[2]]=Enum.UploadSetting['Ask me first']local G=nil G,d= +RbxGui.CreateDropDownMenu(E,function(H)UserSettings().GameSettings. +VideoUploadPromptBehavior=F[H]end)G.Name='VideoCaptureField'G.ZIndex=s+4 G. +DropDownMenuButton.ZIndex=s+4 G.DropDownMenuButton.Icon.ZIndex=s+4 G.Position= +UDim2.new(0,270,0,94)G.Size=UDim2.new(0,200,0,32)G.Parent=u +syncVideoCaptureSetting=function()if UserSettings().GameSettings. +VideoUploadPromptBehavior==Enum.UploadSetting['Never']then d(E[1])elseif +UserSettings().GameSettings.VideoUploadPromptBehavior==Enum.UploadSetting[ +'Ask me first']then d(E[2])else UserSettings().GameSettings. +VideoUploadPromptBehavior=Enum.UploadSetting['Ask me first']d(E[2])end end end +local D=Instance.new'TextLabel'D.Name='CameraLabel'D.Text= +'Character & Camera Controls'D.Font=Enum.Font.Arial D.FontSize=Enum.FontSize. +Size18 D.Position=UDim2.new(0,31,0,58)D.Size=UDim2.new(0,224,0,18)D.TextColor3= +Color3I(255,255,255)D.TextXAlignment=Enum.TextXAlignment.Left D. +BackgroundTransparency=1 D.ZIndex=s+4 D.Parent=u local E,F,G,H=game.CoreGui. +RobloxGui:FindFirstChild('MouseLockLabel',true),Enum.ControlMode:GetEnumItems(), +{},{}for I,J in ipairs(F)do G[I]=J.Name H[J.Name]=J end local K K,c=RbxGui. +CreateDropDownMenu(G,function(L)UserSettings().GameSettings.ControlMode=H[L] +pcall(function()if E and UserSettings().GameSettings.ControlMode==Enum. +ControlMode['Mouse Lock Switch']then E.Visible=true elseif E then E.Visible= +false end end)end)K.Name='CameraField'K.ZIndex=s+4 K.DropDownMenuButton.ZIndex=s ++4 K.DropDownMenuButton.Icon.ZIndex=s+4 K.Position=UDim2.new(0,270,0,52)K.Size= +UDim2.new(0,200,0,32)K.Parent=u return u end if LoadLibrary then RbxGui= +LoadLibrary'RbxGui'local s=0 if UserSettings then local t=function() +waitForChild(a,'BottomLeftControl')settingsButton=a.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=a +.BottomLeftControl end local t=Instance.new'TextButton't.Text=''t.Name= +'UserSettingsShield't.Active=true t.AutoButtonColor=false t.Visible=false t.Size +=UDim2.new(1,0,1,0)t.BackgroundColor3=Color3I(51,51,51)t.BorderColor3=Color3I(27 +,42,53)t.BackgroundTransparency=0.4 t.ZIndex=s+2 n=t local u=Instance.new'Frame' +u.Name='Settings'u.Position=UDim2.new(0.5,-262,-0.5,-200)u.Size=UDim2.new(0,525, +0,430)u.BackgroundTransparency=1 u.Active=true u.Parent=t local v=Instance.new +'Frame'v.Name='SettingsStyle'v.Size=UDim2.new(1,0,1,0)v.Style=Enum.FrameStyle. +RobloxRound v.Active=true v.ZIndex=s+3 v.Parent=u local w=createGameMainMenu(s,t +)w.Parent=v w.ScreenshotButton.MouseButton1Click:connect(function()backToGame(w. +ScreenshotButton,t,settingsButton)end)w.RecordVideoButton.MouseButton1Click: +connect(function()recordVideoClick(w.RecordVideoButton,a.StopRecordButton) +backToGame(w.RecordVideoButton,t,settingsButton)end)if settings():FindFirstChild +'Game Options'then pcall(function()settings():FindFirstChild'Game Options'. +VideoRecordingChangeRequest:connect(function(x)j=x setRecordGui(x,a. +StopRecordButton,w.RecordVideoButton)end)end)end game.CoreGui.RobloxGui.Changed: +connect(function(x)if x=='AbsoluteSize'and j then recordVideoClick(w. +RecordVideoButton,a.StopRecordButton)end end)function localPlayerChange()w. +ResetButton.Visible=game.Players.LocalPlayer if game.Players.LocalPlayer then +settings().Rendering.EnableFRM=true elseif o then settings().Rendering.EnableFRM +=false end end w.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')w.ResetButton.Visible=game.Players.LocalPlayer game.Players. +LocalPlayer.Changed:connect(function()localPlayerChange()end)end)end w. +ReportAbuseButton.Visible=game:FindFirstChild'NetworkClient'if not w. +ReportAbuseButton.Visible then game.ChildAdded:connect(function(x)if x:IsA +'NetworkClient'then w.ReportAbuseButton.Visible=game:FindFirstChild +'NetworkClient'end end)end w.ResetButton.MouseButton1Click:connect(function() +goToMenu(v,'ResetConfirmationMenu','up',UDim2.new(0,525,0,370))end)w. +LeaveGameButton.MouseButton1Click:connect(function()goToMenu(v, +'LeaveConfirmationMenu','down',UDim2.new(0,525,0,300))end)if game.CoreGui. +Version>=4 then game:GetService'GuiService'.EscapeKeyPressed:connect(function() +if k==nil then game.GuiService:AddCenterDialog(t,Enum.CenterDialogType. +ModalDialog,function()settingsButton.Active=false c(UserSettings().GameSettings. +ControlMode.Name)if syncVideoCaptureSetting then syncVideoCaptureSetting()end +goToMenu(v,'GameMainMenu','right',UDim2.new(0,525,0,430))t.Visible=true t.Active +=true v.Parent:TweenPosition(UDim2.new(0.5,-262,0.5,-200),Enum.EasingDirection. +InOut,Enum.EasingStyle.Sine,e,true)v.Parent:TweenSize(UDim2.new(0,525,0,430), +Enum.EasingDirection.InOut,Enum.EasingStyle.Sine,e,true)end,function()v.Parent: +TweenPosition(UDim2.new(0.5,-262,-0.5,-200),Enum.EasingDirection.InOut,Enum. +EasingStyle.Sine,e,true)v.Parent:TweenSize(UDim2.new(0,525,0,430),Enum. +EasingDirection.InOut,Enum.EasingStyle.Sine,e,true)t.Visible=false +settingsButton.Active=true end)elseif#l>0 then if#m>0 then for x=1,#m do game. +GuiService:RemoveCenterDialog(m[x])m[x].Visible=false end m={}end goToMenu(l[#l] +['container'],l[#l]['name'],l[#l]['direction'],l[#l]['lastSize'])table.remove(l, +#l)if#l==1 then l={}end else resumeGameFunction(t)end end)end local x= +createGameSettingsMenu(s,t)x.Visible=false x.Parent=v w.SettingsButton. +MouseButton1Click:connect(function()goToMenu(v,'GameSettingsMenu','left',UDim2. +new(0,525,0,350))end)x.BackButton.MouseButton1Click:connect(function()goToMenu(v +,'GameMainMenu','right',UDim2.new(0,525,0,430))end)local y= +createResetConfirmationMenu(s,t)y.Visible=false y.Parent=v local z= +createLeaveConfirmationMenu(s,t)z.Visible=false z.Parent=v robloxLock(t) +settingsButton.MouseButton1Click:connect(function()game.GuiService: +AddCenterDialog(t,Enum.CenterDialogType.ModalDialog,function()settingsButton. +Active=false c(UserSettings().GameSettings.ControlMode.Name)if +syncVideoCaptureSetting then syncVideoCaptureSetting()end goToMenu(v, +'GameMainMenu','right',UDim2.new(0,525,0,430))t.Visible=true v.Parent: +TweenPosition(UDim2.new(0.5,-262,0.5,-200),Enum.EasingDirection.InOut,Enum. +EasingStyle.Sine,e,true)v.Parent:TweenSize(UDim2.new(0,525,0,430),Enum. +EasingDirection.InOut,Enum.EasingStyle.Sine,e,true)end,function()v.Parent: +TweenPosition(UDim2.new(0.5,-262,-0.5,-200),Enum.EasingDirection.InOut,Enum. +EasingStyle.Sine,e,true)v.Parent:TweenSize(UDim2.new(0,525,0,430),Enum. +EasingDirection.InOut,Enum.EasingStyle.Sine,e,true)t.Visible=false +settingsButton.Active=true end)end)return t end delay(0,function()t().Parent=a a +.BottomLeftControl.SettingsButton.Active=true a.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 u=a. +BottomLeftControl:FindFirstChild'Exit'if u then u:Remove()end local v=a: +FindFirstChild'TopLeftControl'if v then u=v:FindFirstChild'Exit'if u then u: +Remove()end v:Remove()end end)end local t,u,v=function()local t=Instance.new +'TextButton't.Text=''t.AutoButtonColor=false t.Name='SaveDialogShield't.Active= +true t.Visible=false t.Size=UDim2.new(1,0,1,0)t.BackgroundColor3=Color3I(51,51, +51)t.BorderColor3=Color3I(27,42,53)t.BackgroundTransparency=0.4 t.ZIndex=s+1 +local u,v,w,x,y,z=nil,nil,nil,nil,nil,{}z[1]={}z[1].Text='Save'z[1].Style=Enum. +ButtonStyle.RobloxButtonDefault z[1].Function=function()v()end z[2]={}z[2].Text= +'Cancel'z[2].Function=function()y()end z[3]={}z[3].Text="Don't Save"z[3]. +Function=function()x()end local A=RbxGui.CreateStyledMessageDialog( +'Unsaved Changes','Save your changes to Mercury before leaving?','Confirm',z)A. +Visible=true A.Parent=t local B,C={},1 if game.LocalSaveEnabled then B[C]={}B[C] +.Text='Save to Disk'B[C].Function=function()w()end C=C+1 end B[C]={}B[C].Text= +'Keep Playing'B[C].Function=function()y()end B[C+1]={}B[C+1].Text="Don't Save"B[ +C+1].Function=function()x()end local D=RbxGui.CreateStyledMessageDialog( +'Upload Failed','Sorry, we could not save your changes to Mercury.','Error',B)D. +Visible=false D.Parent=t local E=Instance.new'Frame'E.Name='SpinnerDialog'E. +Style=Enum.FrameStyle.RobloxRound E.Size=UDim2.new(0,350,0,150)E.Position=UDim2. +new(0.5,-175,0.5,-75)E.Visible=false E.Active=true E.Parent=t local F=Instance. +new'TextLabel'F.Name='WaitingLabel'F.Text='Saving to Mercury...'F.Font=Enum.Font +.ArialBold F.FontSize=Enum.FontSize.Size18 F.Position=UDim2.new(0.5,25,0.5,0)F. +TextColor3=Color3.new(1,1,1)F.Parent=E local G=Instance.new'Frame'G.Name= +'Spinner'G.Size=UDim2.new(0,80,0,80)G.Position=UDim2.new(0.5,-150,0.5,-40)G. +BackgroundTransparency=1 G.Parent=E local H,I={},1 while I<=8 do local J= +Instance.new'ImageLabel'J.Name='Spinner'..I J.Size=UDim2.new(0,16,0,16)J. +Position=UDim2.new(0.5+0.3*math.cos(math.rad(45*I)),-8,0.5+0.3*math.sin(math. +rad(45*I)),-8)J.BackgroundTransparency=1 J.Image= +'http://www.roblox.com/Asset?id=45880710'J.Parent=G H[I]=J I=I+1 end v=function( +)A.Visible=false E.Visible=true local J=true delay(0,function()local K=0 while J +do local L=0 while L<8 do if L==K or L==((K+1)%8)then H[L+1].Image= +'http://www.roblox.com/Asset?id=45880668'else H[L+1].Image= +'http://www.roblox.com/Asset?id=45880710'end L=L+1 end K=(K+1)%8 wait(0.2)end +end)local K=game:SaveToRoblox()if not K then K=game:SaveToRoblox()end E.Visible= +false J=false if K then game:FinishShutdown(false)u()else D.Visible=true end end +w=function()D.Visible=false game:FinishShutdown(true)u()end x=function()A. +Visible=false D.Visible=false game:FinishShutdown(false)u()end y=function()A. +Visible=false D.Visible=false u()end u=function()A.Visible=true D.Visible=false +E.Visible=false t.Visible=false game.GuiService:RemoveCenterDialog(t)end +robloxLock(t)t.Visible=false return t end,function()waitForChild(game, +'NetworkClient')waitForChild(game,'Players')waitForProperty(game.Players, +'LocalPlayer')local t,u=game.Players.LocalPlayer,nil waitForChild(a, +'UserSettingsShield')waitForChild(a.UserSettingsShield,'Settings')waitForChild(a +.UserSettingsShield.Settings,'SettingsStyle')waitForChild(a.UserSettingsShield. +Settings.SettingsStyle,'GameMainMenu')waitForChild(a.UserSettingsShield.Settings +.SettingsStyle.GameMainMenu,'ReportAbuseButton')u=a.UserSettingsShield.Settings. +SettingsStyle.GameMainMenu.ReportAbuseButton local v=Instance.new'TextButton'v. +Name='ReportAbuseShield'v.Text=''v.AutoButtonColor=false v.Active=true v.Visible +=false v.Size=UDim2.new(1,0,1,0)v.BackgroundColor3=Color3I(51,51,51)v. +BorderColor3=Color3I(27,42,53)v.BackgroundTransparency=0.4 v.ZIndex=s+1 local w, +x=nil,{}x[1]={}x[1].Text='Ok'x[1].Modal=true x[1].Function=function()w()end +local y=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]] +,x)y.Visible=false y.Parent=v local z=RbxGui.CreateMessageDialog( +'Thanks for your report!',"We've recorded your report for evaluation.",x)z. +Visible=false z.Parent=v local A=RbxGui.CreateMessageDialog( +'Thanks for your report!', +[[Our moderators will review the chat logs and determine what happened.]],x)A. +Visible=false A.Parent=v local B=Instance.new'Frame'B.Name='Settings'B.Position= +UDim2.new(0.5,-250,0.5,-200)B.Size=UDim2.new(0,500,0,400)B. +BackgroundTransparency=1 B.Active=true B.Parent=v local C=Instance.new'Frame'C. +Name='ReportAbuseStyle'C.Size=UDim2.new(1,0,1,0)C.Style=Enum.FrameStyle. +RobloxRound C.Active=true C.ZIndex=s+1 C.Parent=B local D=Instance.new +'TextLabel'D.Name='Title'D.Text='Report Abuse'D.TextColor3=Color3I(221,221,221)D +.Position=UDim2.new(0.5,0,0,30)D.Font=Enum.Font.ArialBold D.FontSize=Enum. +FontSize.Size36 D.ZIndex=s+2 D.Parent=C local E=Instance.new'TextLabel'E.Name= +'Description'E.Text= +[[This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action.]] +E.TextColor3=Color3I(221,221,221)E.Position=UDim2.new(0,0,0,55)E.Size=UDim2.new( +1,0,0,40)E.BackgroundTransparency=1 E.Font=Enum.Font.Arial E.FontSize=Enum. +FontSize.Size18 E.TextWrap=true E.ZIndex=s+2 E.TextXAlignment=Enum. +TextXAlignment.Left E.TextYAlignment=Enum.TextYAlignment.Top E.Parent=C local F= +Instance.new'TextLabel'F.Name='PlayerLabel'F.Text='Which player?'F. +BackgroundTransparency=1 F.Font=Enum.Font.Arial F.FontSize=Enum.FontSize.Size18 +F.Position=UDim2.new(0.025,0,0,100)F.Size=UDim2.new(0.4,0,0,36)F.TextColor3= +Color3I(255,255,255)F.TextXAlignment=Enum.TextXAlignment.Left F.ZIndex=s+2 F. +Parent=C local G,H,I,J=nil,nil,nil,nil local K,L=function()local K,L,M=game: +GetService'Players',{},{}local N,O=K:GetChildren(),1 if N then for P,Q in +ipairs(N)do if Q:IsA'Player'and Q~=t then L[O]=Q.Name M[Q.Name]=Q O=O+1 end end +end local P=nil P,J=RbxGui.CreateDropDownMenu(L,function(Q)G=M[Q]if H and G then +I.Active=true end end)P.Name='PlayersComboBox'P.ZIndex=s+2 P.Position=UDim2.new( +0.425,0,0,102)P.Size=UDim2.new(0.55,0,0,32)return P end,Instance.new'TextLabel'L +.Name='AbuseLabel'L.Text='Type of Abuse:'L.Font=Enum.Font.Arial L. +BackgroundTransparency=1 L.FontSize=Enum.FontSize.Size18 L.Position=UDim2.new( +0.025,0,0,140)L.Size=UDim2.new(0.4,0,0,36)L.TextColor3=Color3I(255,255,255)L. +TextXAlignment=Enum.TextXAlignment.Left L.ZIndex=s+2 L.Parent=C local M={ +'Swearing','Bullying','Scamming','Dating','Cheating/Exploiting', +'Personal Questions','Offsite Links','Bad Model or Script','Bad Username'}local +N,O=RbxGui.CreateDropDownMenu(M,function(N)H=N if H and G then I.Active=true end +end,true)N.Name='AbuseComboBox'N.ZIndex=s+2 N.Position=UDim2.new(0.425,0,0,142)N +.Size=UDim2.new(0.55,0,0,32)N.Parent=C local P=Instance.new'TextLabel'P.Name= +'ShortDescriptionLabel'P.Text='Short Description: (optional)'P.Font=Enum.Font. +Arial P.FontSize=Enum.FontSize.Size18 P.Position=UDim2.new(0.025,0,0,180)P.Size= +UDim2.new(0.95,0,0,36)P.TextColor3=Color3I(255,255,255)P.TextXAlignment=Enum. +TextXAlignment.Left P.BackgroundTransparency=1 P.ZIndex=s+2 P.Parent=C local Q= +Instance.new'Frame'Q.Name='ShortDescriptionWrapper'Q.Position=UDim2.new(0.025,0, +0,220)Q.Size=UDim2.new(0.95,0,1,-310)Q.BackgroundColor3=Color3I(0,0,0)Q. +BorderSizePixel=0 Q.ZIndex=s+2 Q.Parent=C local R=Instance.new'TextBox'R.Name= +'TextBox'R.Text=''R.ClearTextOnFocus=false R.Font=Enum.Font.Arial R.FontSize= +Enum.FontSize.Size18 R.Position=UDim2.new(0,3,0,3)R.Size=UDim2.new(1,-6,1,-6)R. +TextColor3=Color3I(255,255,255)R.TextXAlignment=Enum.TextXAlignment.Left R. +TextYAlignment=Enum.TextYAlignment.Top R.TextWrap=true R.BackgroundColor3= +Color3I(0,0,0)R.BorderSizePixel=0 R.ZIndex=s+2 R.Parent=Q I=Instance.new +'TextButton'I.Name='SubmitReportBtn'I.Active=false I.Modal=true I.Font=Enum.Font +.Arial I.FontSize=Enum.FontSize.Size18 I.Position=UDim2.new(0.1,0,1,-80)I.Size= +UDim2.new(0.35,0,0,50)I.AutoButtonColor=true I.Style=Enum.ButtonStyle. +RobloxButtonDefault I.Text='Submit Report'I.TextColor3=Color3I(255,255,255)I. +ZIndex=s+2 I.Parent=C I.MouseButton1Click:connect(function()if I.Active then if +H and G then B.Visible=false game.Players:ReportAbuse(G,H,R.Text)if H== +'Cheating/Exploiting'then z.Visible=true elseif H=='Bullying'or H=='Swearing' +then y.Visible=true else A.Visible=true end else w()end end end)local S=Instance +.new'TextButton'S.Name='CancelBtn'S.Font=Enum.Font.Arial S.FontSize=Enum. +FontSize.Size18 S.Position=UDim2.new(0.55,0,1,-80)S.Size=UDim2.new(0.35,0,0,50)S +.AutoButtonColor=true S.Style=Enum.ButtonStyle.RobloxButtonDefault S.Text= +'Cancel'S.TextColor3=Color3I(255,255,255)S.ZIndex=s+2 S.Parent=C w=function() +local T=C:FindFirstChild'PlayersComboBox'if T then T.Parent=nil end G=nil J(nil) +H=nil O(nil)I.Active=false R.Text=''B.Visible=true y.Visible=false z.Visible= +false A.Visible=false v.Visible=false u.Active=true game.GuiService: +RemoveCenterDialog(v)end S.MouseButton1Click:connect(w)u.MouseButton1Click: +connect(function()K().Parent=C table.insert(m,v)game.GuiService:AddCenterDialog( +v,Enum.CenterDialogType.ModalDialog,function()u.Active=false v.Visible=true n. +Visible=false end,function()u.Active=true v.Visible=false end)end)robloxLock(v) +return v end,pcall(function()end)if v then delay(0,function()local w=t()w.Parent +=a game.RequestShutdown=function()table.insert(m,w)game.GuiService: +AddCenterDialog(w,Enum.CenterDialogType.QuitDialog,function()w.Visible=true end, +function()w.Visible=false end)return true end end)end delay(0,function()u(). +Parent=a waitForChild(a,'UserSettingsShield')waitForChild(a.UserSettingsShield, +'Settings')waitForChild(a.UserSettingsShield.Settings,'SettingsStyle') +waitForChild(a.UserSettingsShield.Settings.SettingsStyle,'GameMainMenu') +waitForChild(a.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, +'ReportAbuseButton')a.UserSettingsShield.Settings.SettingsStyle.GameMainMenu. +ReportAbuseButton.Active=true end)pcall(function()return game.GuiService. +UseLuaChat end)local w=41324860 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==w then game.Players.LocalPlayer.Character.Humanoid: +SetClickToWalkEnabled(false)game.Players.LocalPlayer.CharacterAdded:connect( +function(x)waitForChild(x,'Humanoid')x.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..53a71de 100644 --- a/processed/48488235.lua +++ b/processed/48488235.lua @@ -1,2305 +1,665 @@ -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 +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,{}function e.Create(f)return +function(g)local h=Instance.new(f)for i,j in pairs(g)do if type(i)=='number'then +j.Parent=h else h[i]=j end end return h end end function MakeBackgroundGuiObj(f) +return e.Create'ImageLabel'{Name='Background',BackgroundTransparency=1,Image=f, +Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,1,0)}end function Color3I(f,g,h) +return Color3.new(f/255,g/255,h/255)end function getMembershipTypeIcon(f,g)if a[ +string.lower(g)]~=nil then if a[string.lower(g)]==1 then return +'http://www.roblox.com/asset/?id=6923330951'else return a[string.lower(g)]end +elseif f==Enum.MembershipType.None then return''elseif f==Enum.MembershipType. +BuildersClub then return'rbxasset://textures/ui/TinyBcIcon.png'elseif f==Enum. +MembershipType.TurboBuildersClub then return +'rbxasset://textures/ui/TinyTbcIcon.png'elseif f==Enum.MembershipType. +OutrageousBuildersClub then return'rbxasset://textures/ui/TinyObcIcon.png'else +error('Unknown membershipType'..f)end end local function getFriendStatusIcon(f) +if f==Enum.FriendStatus.Unknown or f==Enum.FriendStatus.NotFriend then return'' +elseif f==Enum.FriendStatus.Friend then return +'http://www.roblox.com/asset/?id=99749771'elseif f==Enum.FriendStatus. +FriendRequestSent then return'http://www.roblox.com/asset/?id=99776888'elseif f +==Enum.FriendStatus.FriendRequestReceived then return +'http://www.roblox.com/asset/?id=99776838'else error('Unknown FriendStatus: '..f +)end end function MakePopupButton(f,g,h,i)local j=e.Create'ImageButton'{Name= +'ReportButton',BackgroundTransparency=1,Position=UDim2.new(0,0,1*h,0),Size=UDim2 +.new(1,0,1,0),ZIndex=7,e.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=g,FontSize='Size14',TextScaled +=true,TextColor3=Color3.new(1,1,1),TextStrokeTransparency=1,ZIndex=7},Parent=f} +if h==0 then j.Image='http://www.roblox.com/asset/?id=97108784'elseif i then if +h%2==1 then j.Image='http://www.roblox.com/asset/?id='..b['LightPopupBottom'] +else j.Image='http://www.roblox.com/asset/?id='..b['DarkPopupBottom']end else if +h%2==1 then j.Image='http://www.roblox.com/asset/?id=97112126'else j.Image= +'http://www.roblox.com/asset/?id=97109338'end end return j end function +WaitForChild(f,g)while not f:FindFirstChild(g)do wait()debugprint(' child '..f. +Name..' waiting for '..g)end return f[g]end local f=game:GetService'Players' +while not f.LocalPlayer do f.Changed:wait()end local g=f.LocalPlayer local h,i=g +:GetMouse(),e.Create'Frame'{Name='PlayerListScreen',Size=UDim2.new(1,0,1,0), +BackgroundTransparency=1,Parent=script.Parent}local j=e.Create'Frame'{Name= +'LeaderBoardFrame',Position=UDim2.new(1,-150,0.005,0),Size=UDim2.new(0,150,0,800 +),BackgroundTransparency=1,Parent=i}local k,l=e.Create'Frame'{Name='FocusFrame', +Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0,100),BackgroundTransparency=1, +Active=true,Parent=j},e.Create'Frame'{Name='Header',BackgroundTransparency=1, +Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,0.07,0),Parent=j, +MakeBackgroundGuiObj'http://www.roblox.com/asset/?id=94692054'}local m,n,o,p=l. +Size.Y.Scale,e.Create'ImageButton'{Name='MaximizeButton',Active=true, +BackgroundTransparency=1,Position=UDim2.new(0,0,0,0),Size=UDim2.new(1,0,1,0), +Parent=l},e.Create'TextLabel'{Name='PlayerName',BackgroundTransparency=1, +Position=UDim2.new(0,0,0.01,0),Size=UDim2.new(0.98,0,0.38,0),Parent=l,Font= +'ArialBold',Text=g.Name,FontSize='Size24',TextColor3=Color3.new(1,1,1), +TextStrokeColor3=Color3.new(0,0,0),TextStrokeTransparency=0,TextXAlignment= +'Right',TextYAlignment='Center'},e.Create'TextLabel'{Name='PlayerScore', +BackgroundTransparency=1,Position=UDim2.new(0,0,0.4,0),Size=UDim2.new(0.98,0,0, +30),Parent=l,Font='ArialBold',Text='',FontSize='Size24',TextYAlignment='Top', +TextColor3=Color3.new(1,1,1),TextStrokeTransparency=1,TextXAlignment='Right'} +local q=e.Create'Frame'{Name='BottomShiftFrame',BackgroundTransparency=1, +Position=UDim2.new(0,0,m,0),Size=UDim2.new(1,0,1,0),Parent=j}local r=e.Create +'Frame'{Name='Bottom',BackgroundTransparency=1,Position=UDim2.new(0,0,0.07,0), +Size=UDim2.new(1,0,0.03,0),Parent=q,MakeBackgroundGuiObj +'http://www.roblox.com/asset/?id=94754966'}local s,t,u=e.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=r},e.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=r},e.Create'Frame'{Name='ListFrame', +BackgroundTransparency=1,Position=UDim2.new(-1,0,0.07,0),Size=UDim2.new(2,0,1,0) +,Parent=j,ClipsDescendants=true}local v=e.Create'Frame'{Name='BottomFrame', +BackgroundTransparency=1,Position=UDim2.new(0,0,-0.8,0),Size=UDim2.new(1,0,1,0), +Parent=u,ClipsDescendants=true}local w=e.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=v}local x,y,z,A=e.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=w},e.Create'Frame'{Name= +'SubFrame',BackgroundTransparency=1,Position=UDim2.new(0,0,0.8,0),Size=UDim2. +new(1,0,1,0),Parent=v},e.Create'Frame'{Name='PopUpFrame',BackgroundTransparency= +1,SizeConstraint='RelativeXX',Position=j.Position+UDim2.new(0,-150,0,0),Size= +UDim2.new(0,150,0,800),Parent=j,ClipsDescendants=true,ZIndex=7},nil local B,C,D, +E,F,G,H,I,J=e.Create'Frame'{Name='Panel',BackgroundTransparency=1,Position=UDim2 +.new(1,0,0,0),Size=UDim2.new(1,0,0.032,0),Parent=z},e.Create'Frame'{Name= +'StatTitles',BackgroundTransparency=1,Position=UDim2.new(0,0,1,-10),Size=UDim2. +new(1,0,0,0),Parent=l},Instance.new'BoolValue',Instance.new'BoolValue',Instance. +new'BoolValue',Instance.new'BoolValue',e.Create'Frame'{Name='MidTemplate', +BackgroundTransparency=1,Position=UDim2.new(100,0,0.07,0),Size=UDim2.new(0.5,0, +0.025,0),e.Create'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.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},e.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},e.Create'Frame'{Name= +'TitleFrame',BackgroundTransparency=1,Position=UDim2.new(0.01,0,0,0),Size=UDim2. +new(0,140,1,0),ClipsDescendants=true,e.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}},e.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},ZIndex=3},e.Create +'Frame'{Name='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'},e.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 K=e.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=J}local L=e.Create'Frame'{Name='ReportAbuseStyle',Size= +UDim2.new(1,0,1,0),Active=true,BackgroundTransparency=1,MakeBackgroundGuiObj +'http://www.roblox.com/asset/?id=96488767',e.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},e.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},e.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},e. +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},e.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=K}local M,N,O,P,Q,R,S,T,U=e.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=L},e.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', +Parent=L},e.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=L},e.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=L},nil,e. +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},e.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',e.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'},e.Create +'TextLabel'{Name='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.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'}},e. +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',e.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'}, +e.Create'TextLabel'{Name='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.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'}}, +Instance.new'ImageButton'U.Size=UDim2.new(1,0,1,0)U.BackgroundTransparency=1 U. +ZIndex=8 U.Visible=false U.Parent=i local V=e.Create'Frame'{Name='debugframe', +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 W,X,Y=e.Create'TextLabel'{ +BackgroundTransparency=0.8,Position=UDim2.new(0,0,0.01,0),Size=UDim2.new(1,0,0.5 +,0),Parent=V,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'},e. +Create'TextLabel'{BackgroundTransparency=0.8,Position=UDim2.new(0,0,0.5,0),Size= +UDim2.new(1,0,0.5,0),Parent=V,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'},true +function debugprint(Z)if Y then X.Text=Z end end local Z,_=assert(LoadLibrary +'RbxGui'),8 for aa,ab in pairs(b)do Game:GetService'ContentProvider':Preload( +'http://www.roblox.com/asset/?id='..ab)end local ac,ad,ae,af,ag,ah,ai,aj,ak,al={ +},0,{},{},nil,{},{},0,0.25,false pcall(function()al=Game:GetService +'UserInputService'.TouchEnabled end)local am,an,ao,ap=150,10,UDim2.new(0.5,0,1,0 +),UDim2.new(0.25,0,0.1,0)local aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE= +UDim2.new(0,am,0,800),UDim2.new(1,-am,0.005,0),-4E-2,v.Position.Y.Scale,nil,nil, +false,false,false,false,false,false,false,{},8 if not al then aE=12 end local aF +,aG,aH,aI,aJ,aK,aL=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(aM)if aM.Name== +'PSVariable'and aM:IsA'BoolValue'then aL=true end end)function +AreAllEntriesOnScreen()return#ai*H.Size.Y.Scale<=1+at end function GetMaxScroll( +)return at*-1 end function GetMinScroll()if AreAllEntriesOnScreen()then return +GetMaxScroll()else return(GetMaxScroll()-(#ai*H.Size.Y.Scale))+(1+at)end end +function AbsoluteToPercent(aM,aN)return Vector2.new(aM,aN)/i.AbsoluteSize end +function TweenProperty(aM,aN,aO,aP,aQ)local aR=tick()while tick()-aRaN +do game:GetService'PersonalServerService':Demote(aM)end end function +OnPrivilegeLevelSelect(aM,aN,aO,aP,aQ,aR)debugprint'setting privilege level' +SetPrivilegeRank(aM,aN)HighlightMyRank(aM,aO,aP,aQ,aR)end function +HighlightMyRank(aM,aN,aO,aP,aQ)aN.Image='http://www.roblox.com/asset/?id='..b[ +'LightPopupMid']aO.Image='http://www.roblox.com/asset/?id='..b['DarkPopupMid']aP +.Image='http://www.roblox.com/asset/?id='..b['LightPopupMid']aQ.Image= +'http://www.roblox.com/asset/?id='..b['DarkPopupBottom']local aR=aM. +PersonalServerRank if aR<=aK['Banned']then aN.Image= +'http://www.roblox.com/asset/?id='..b['LightBluePopupMid']elseif aR<=aK[ +'Visitor']then aO.Image='http://www.roblox.com/asset/?id='..b['DarkBluePopupMid' +]elseif aR<=aK['Member']then aP.Image='http://www.roblox.com/asset/?id='..b[ +'LightBluePopupMid']elseif aR<=aK['Admin']then aQ.Image= +'http://www.roblox.com/asset/?id='..b['DarkBluePopupBottom']end end function +OnSubmitAbuse()if N.Active then if aG and av then L.Visible=false game.Players: +ReportAbuse(av,aG,Q.Text)if aG=='Rude or Mean Behavior'or aG== +'False Reporting Me'then S.Parent=J else debugprint'opening abuse box'T.Parent=J +end else CloseAbuseDialog()end end end function OpenAbuseDialog()debugprint +'adding report dialog'M.Text=av.Name A:TweenPosition(UDim2.new(1,0,0,0),'Out', +'Linear',c,true)Q=R:Clone()Q.Parent=P J.Parent=i ClosePopUpPanel()end function +CloseAbuseDialog()aG=nil N.Active=false N.Image= +'http://www.roblox.com/asset/?id=96502438'Q:Destroy()S.Parent=nil T.Parent=nil J +.Parent=nil L.Visible=true end function InitReportAbuse()aI=function(aM)aG=aM if +aG and av then N.Active=true N.Image='http://www.roblox.com/asset/?id=96501119' +end end aJ,aa=Z.CreateDropDownMenu(aH,aI,true)aJ.Name='AbuseComboBox'aJ.Position +=UDim2.new(0.425,0,0,142)aJ.Size=UDim2.new(0.55,0,0,32)aJ.Parent=L O. +MouseButton1Click:connect(CloseAbuseDialog)N.MouseButton1Click:connect( +OnSubmitAbuse)S:FindFirstChild'OkButton'.MouseButton1Down:connect( +CloseAbuseDialog)T:FindFirstChild'OkButton'.MouseButton1Down:connect( +CloseAbuseDialog)end local function GetFriendStatus(aM)if aM==game.Players. +LocalPlayer then return Enum.FriendStatus.NotFriend else local aN,aO=pcall( +function()return game.Players.LocalPlayer:GetFriendStatus(aM)end)if aN then +return aO else return Enum.FriendStatus.NotFriend end end end function +OnFriendButtonSelect()local aM=GetFriendStatus(av)if aM==Enum.FriendStatus. +Friend then g:RevokeFriendship(av)elseif aM==Enum.FriendStatus.Unknown or aM== +Enum.FriendStatus.NotFriend or aM==Enum.FriendStatus.FriendRequestSent or aM== +Enum.FriendStatus.FriendRequestReceived then g:RequestFriendship(av)end +ClosePopUpPanel()end function OnFriendRefuseButtonSelect()g:RevokeFriendship(av) +ClosePopUpPanel()A:TweenPosition(UDim2.new(1,0,0,0),'Out','Linear',c,true)end +function PlayerSortFunction(aM,aN)if aM['Score']==aN['Score']then return aM[ +'Player'].Name:upper()1 and g.userId>1 then +ActivatePlayerEntryPanel(aN)end end local aZ,a_=nil,y.Position local function +dragpoll(a0,a1)if not aZ then aZ=AbsoluteToPercent(a0,a1).Y end local a2= +AbsoluteToPercent(a0,a1).Y debugprint('drag dist:'..Vector2.new(aU-a0,aX-a1). +magnitude)if Vector2.new(aU-a0,aX-a1).magnitude>d then aY=false end local a3= +math.max(math.min(a_.Y.Scale+(a2-aZ),GetMaxScroll()),GetMinScroll())y.Position= +UDim2.new(a_.X.Scale,a_.X.Offset,a3,a_.Y.Offset)UpdateScrollPosition()end +WaitForClick(i,dragpoll,dragExit)end function StartMinimizeDrag()Delay(0, +function()local aN=tick()debugprint'Got Click2'local function dragExit()if tick( +)-aN<0.25 then ToggleMinimize()else aF=true if D.Value then ToggleMinimize()end +end end local aU,aX=nil,at local function dragpoll(aY,aZ)if not D.Value then if +not aU then aU=AbsoluteToPercent(aY,aZ).Y end local a_,a0=AbsoluteToPercent(aY, +aZ).Y,nil a0=math.min(math.max(aX+(a_-aU),-1),-1+(#ai*I.Size.Y.Scale))at=a0 +UpdateMinimize()w.Size=UDim2.new(w.Size.X.Scale,0,(at+v.Size.Y.Scale),0)w. +Position=UDim2.new(w.Position.X.Scale,0,1-w.Size.Y.Scale,0)UpdateScrollBarSize() +UpdateScrollPosition()UpdateScrollBarVisibility()end end Spawn(function() +WaitForClick(i,dragpoll,dragExit)end)end)end E.Value=false D.Value=false E. +Changed:connect(UpdateMaximize)D.Changed:connect(UpdateMinimize)s. +MouseButton1Down:connect(function()if(time()-aj1 do aX +=aX-1 aU.FontSize=aN[aX]wait(0.2)end o.FontSize=aU.FontSize aU:Destroy()end)end +i.Changed:connect(UpdateHeaderNameSize)function LeaderstatsAdded(aU)local aX=aU[ +'Player']for aY,aZ in pairs(aX.leaderstats:GetChildren())do StatAdded(aZ,aU)end +aX.leaderstats.ChildAdded:connect(function(a_)StatAdded(a_,aU)end)aX.leaderstats +.ChildRemoved:connect(function(a_)StatRemoved(a_,aU)end)end function +LeaderstatsRemoved(aU,aX)while aw do debugprint('waiting to insert '..aX[ +'Player'].Name)wait(3.333333333333333E-2)end aw=true RemoveAllStats(aX)aw=false +end function ClosePopUpPanel()if au then local aU=au['Frame']Spawn(function() +TweenProperty(aU,'BackgroundTransparency',0.5,1,c)end)end A:TweenPosition(UDim2. +new(1,0,0,0),'Out','Linear',c,true)wait(0.1)aA=false au=nil end function +InitMovingPanel(aU,aX)z.Parent=i if A then A:Destroy()end A=B:Clone()A.Parent=z +local aY,aZ=2,GetFriendStatus(aX)debugprint(tostring(aZ))local a_,a0=aL and g. +PersonalServerRank>=aK['Admin']and g.PersonalServerRank>av.PersonalServerRank, +MakePopupButton(A,'Report Player',0)a0.MouseButton1Click:connect(function() +OpenAbuseDialog()end)local a1=MakePopupButton(A,'Friend',1,not a_ and aZ~=Enum. +FriendStatus.FriendRequestReceived)a1.MouseButton1Click:connect( +OnFriendButtonSelect)if aZ==Enum.FriendStatus.Friend then a1:FindFirstChild +'ButtonText'.Text='UnFriend Player'elseif aZ==Enum.FriendStatus.Unknown or aZ== +Enum.FriendStatus.NotFriend then a1:FindFirstChild'ButtonText'.Text= +'Send Request'elseif aZ==Enum.FriendStatus.FriendRequestSent then a1: +FindFirstChild'ButtonText'.Text='Revoke Request'elseif aZ==Enum.FriendStatus. +FriendRequestReceived then a1:FindFirstChild'ButtonText'.Text='Accept Friend' +local a2=MakePopupButton(A,'Decline Friend',2,not a_)a2.MouseButton1Click: +connect(OnFriendRefuseButtonSelect)aY=aY+1 end if a_ then local a2,a3,a4,a5= +MakePopupButton(A,'Ban',aY),MakePopupButton(A,'Visitor',aY+1),MakePopupButton(A, +'Member',aY+2),MakePopupButton(A,'Admin',aY+3,true)a2.MouseButton1Click:connect( +function()OnPrivilegeLevelSelect(aX,aK['Banned'],a2,a3,a4,a5)end)a3. +MouseButton1Click:connect(function()OnPrivilegeLevelSelect(aX,aK['Visitor'],a2, +a3,a4,a5)end)a4.MouseButton1Click:connect(function()OnPrivilegeLevelSelect(aX,aK +['Member'],a2,a3,a4,a5)end)a5.MouseButton1Click:connect(function() +OnPrivilegeLevelSelect(aX,aK['Admin'],a2,a3,a4,a5)end)HighlightMyRank(av,a2,a3, +a4,a5)end A:TweenPosition(UDim2.new(0,0,0,0),'Out','Linear',c,true)Delay(0, +function()local a2 a2=h.Button1Down:connect(function()a2:disconnect() +ClosePopUpPanel()end)end)local a2=aU['Frame']Spawn(function()while aA do z. +Position=UDim2.new(0,a2.AbsolutePosition.X-z.Size.X.Offset,0,a2.AbsolutePosition +.Y)wait()end end)end function OnPlayerEntrySelect(aU,aX,aY)if not aA then au=aU +av=aU['Player']StartDrag(aU,aX,aY)end end function ActivatePlayerEntryPanel(aU) +aU['Frame'].BackgroundColor3=Color3.new(0,1,1)Spawn(function()TweenProperty(aU[ +'Frame'],'BackgroundTransparency',1,0.5,0.5)end)aA=true InitMovingPanel(aU,aU[ +'Player'])end function PlayerListModeUpdate()RecreateScoreColumns(ae)table.sort( +ae,PlayerSortFunction)for aU,aX in ipairs(ae)do ah[aU]=aX['Frame']end for aY=#ae ++1,#ah,1 do ah[aY]=nil end UpdateMinimize()end function InsertPlayerFrame(aU) +while aw do debugprint('waiting to insert '..aU.Name)wait(3.333333333333333E-2) +end aw=true local aX=H:Clone()WaitForChild(WaitForChild(aX,'TitleFrame'),'Title' +).Text=aU.Name aX.Position=UDim2.new(1,0,(#ah*aX.Size.Y.Scale),0)local aY= +GetFriendStatus(aU)aX:FindFirstChild'BCLabel'.Image=getMembershipTypeIcon(aU. +MembershipType,aU.Name)aX:FindFirstChild'FriendLabel'.Image=getFriendStatusIcon( +aY)aX.Name=aU.Name WaitForChild(WaitForChild(aX,'TitleFrame'),'Title').Text=aU. +Name aX.FriendLabel.Position=aX.FriendLabel.Position+UDim2.new(0,17,0,0)aX. +TitleFrame.Title.Position=aX.TitleFrame.Title.Position+UDim2.new(0,17,0,0)if aX: +FindFirstChild'FriendLabel'.Image~=''then aX.TitleFrame.Title.Position=aX. +TitleFrame.Title.Position+UDim2.new(0,17,0,0)end if aU.Name==g.Name then aX. +TitleFrame.Title.Font='ArialBold'aX.PlayerScore.Font='ArialBold' +ChangeHeaderName(aU.Name)local aZ=aX.TitleFrame.Title:Clone()aZ.TextColor3= +Color3.new(0,0,0)aZ.TextTransparency=0 aZ.ZIndex=2 aZ.Position=aX.TitleFrame. +Title.Position+UDim2.new(0,1,0,1)aZ.Name='DropShadow'aZ.Parent=aX.TitleFrame end +aX.TitleFrame.Title.Font='ArialBold'aX.Parent=y aX:TweenPosition(UDim2.new(0.5,0 +,(#ah*aX.Size.Y.Scale),0),'Out','Linear',c,true)UpdateMinimize()local aZ={}aZ[ +'Frame']=aX aZ['Player']=aU aZ['ID']=ad ad=ad+1 table.insert(ae,aZ)if#af~=0 then +if aU.Neutral then aZ['MyTeam']=nil if not ag then AddNeutralTeam()else +AddPlayerToTeam(ag,aZ)end else local a_=false for a0,a1 in ipairs(af)do if a1[ +'MyTeam'].TeamColor==aU.TeamColor then AddPlayerToTeam(a1,aZ)aZ['MyTeam']=a1 a_= +true end end if not a_ then aZ['MyTeam']=nil if not ag then AddNeutralTeam()else +AddPlayerToTeam(ag,aZ)end aZ['MyTeam']=ag end end end if aU:FindFirstChild +'leaderstats'then LeaderstatsAdded(aZ)end aU.ChildAdded:connect(function(a_)if +a_.Name=='leaderstats'then while aw do debugprint'in adding leaderstats lock' +wait(3.333333333333333E-2)end aw=true LeaderstatsAdded(aZ)aw=false end end)aU. +ChildRemoved:connect(function(a_)if aU==g and a_.Name=='leaderstats'then +LeaderstatsRemoved(a_,aZ)end end)aU.Changed:connect(function(a_)PlayerChanged(aZ +,a_)end)local a_=WaitForChild(aX,'ClickListener')a_.Active=true a_. +MouseButton1Down:connect(function(a0,a1)OnPlayerEntrySelect(aZ,a0,a1)end) +AddMiddleBGFrame()BaseUpdate()aw=false end function RemovePlayerFrame(aU)while +aw do debugprint'in removing player frame lock'wait(3.333333333333333E-2)end aw= +true local aX for aY,aZ in ipairs(ae)do if aU==aZ['Player']then if z.Parent==aZ[ +'Frame']then z.Parent=nil end aZ['Frame']:Destroy()aX=aZ['MyTeam']table.remove( +ae,aY)end end if aX then for a_,a0 in ipairs(aX['MyPlayers'])do if a0['Player'] +==aU then RemovePlayerFromTeam(aX,a_)end end end RemoveMiddleBGFrame() +UpdateMinimize()BaseUpdate()aw=false end f.ChildRemoved:connect( +RemovePlayerFrame)function UnrollTeams(aU,aX)local aY=0 if ag and not ag[ +'IsHidden']then for aZ,a_ in ipairs(ag['MyPlayers'])do aY=aY+1 aX[aY]=a_['Frame' +]end aY=aY+1 aX[aY]=ag['Frame']end for aZ,a_ in ipairs(aU)do if not a_[ +'IsHidden']then for a0,a1 in ipairs(a_.MyPlayers)do aY=aY+1 aX[aY]=a1['Frame'] +end aY=aY+1 aX[aY]=a_['Frame']end end for a0=aY+1,#aX,1 do aX[a0]=nil end end +function TeamSortFunc(aU,aX)if aU['TeamScore']==aX['TeamScore']then return aU[ +'ID']0 +then debugprint(aU['Player'].Name..'could not find team')aU['MyTeam']=nil if not +ag then AddNeutralTeam()else AddPlayerToTeam(ag,aU)end end end function +PlayerChanged(aU,aX)while aB do debugprint'in playerchanged lock'wait( +3.333333333333333E-2)end aB=true if aX=='Neutral'then if aU['Player'].Neutral +and#(game.Teams:GetTeams())>0 then debugprint(aU['Player'].Name.. +'setting to neutral')FindRemovePlayerFromTeam(aU)aU['MyTeam']=nil if not ag then +debugprint(aU['Player'].Name..'creating neutral team')AddNeutralTeam()else +debugprint(aU['Player'].Name..'adding to neutral team')AddPlayerToTeam(ag,aU)end +elseif#(game.Teams:GetTeams())>0 then debugprint(aU['Player'].Name.. +'has been set non-neutral')SetPlayerToTeam(aU)end BaseUpdate()elseif aX== +'TeamColor'and not aU['Player'].Neutral and aU['Player']~=aU['MyTeam']then +debugprint(aU['Player'].Name..'setting to new team')SetPlayerToTeam(aU) +BaseUpdate()elseif aX=='Name'or aX=='MembershipType'then aU['Frame']: +FindFirstChild'BCLabel'.Image=getMembershipTypeIcon(aU['Player'].MembershipType, +aU['Player'].Name)aU['Frame'].Name=aU['Player'].Name aU['Frame'].TitleFrame. +Title.Text=aU['Player'].Name if aU['Frame'].BCLabel.Image~=''then aU['Frame']. +TitleFrame.Title.Position=UDim2.new(0.01,30,0.1,0)end if aU['Player']==g then aU +['Frame'].TitleFrame.DropShadow.Text=aU['Player'].Name ChangeHeaderName(aU[ +'Player'].Name)end BaseUpdate()end aB=false end function OnFriendshipChanged(aU, +aX)Delay(0.5,function()debugprint('friend status changed for:'..aU.Name..' '.. +tostring(aX)..' vs '..tostring(GetFriendStatus(aU)))for aY,aZ in ipairs(ae)do if +aZ['Player']==aU then local a_=getFriendStatusIcon(aX)if a_==''and aZ['Frame']. +FriendLabel.Image~=''then aZ['Frame'].TitleFrame.Title.Position=aZ['Frame']. +TitleFrame.Title.Position-UDim2.new(0,17,0,0)elseif a_~=''and aZ['Frame']. +FriendLabel.Image==''then aZ['Frame'].TitleFrame.Title.Position=aZ['Frame']. +TitleFrame.Title.Position+UDim2.new(0,17,0,0)debugprint('confirmed status:'..aU. +Name)end aZ['Frame'].FriendLabel.Image=a_ return end end end)end g. +FriendStatusChanged:connect(OnFriendshipChanged)function AddNeutralTeam()while +aC do debugprint'in neutral team 2 lock'wait()end aC=true local aU=Instance.new +'Team'aU.TeamColor=BrickColor.new'White'aU.Name='Neutral'local aX={}aX['MyTeam'] +=aU aX['MyPlayers']={}aX['Frame']=H:Clone()WaitForChild(WaitForChild(aX['Frame'] +,'TitleFrame'),'Title').Text=aU.Name aX['Frame'].TitleFrame.Position=UDim2.new( +aX['Frame'].TitleFrame.Position.X.Scale,aX['Frame'].TitleFrame.Position.X.Offset +,0.1,0)aX['Frame'].TitleFrame.Size=UDim2.new(aX['Frame'].TitleFrame.Size.X.Scale +,aX['Frame'].TitleFrame.Size.X.Offset,0.8,0)aX['Frame'].TitleFrame.Title.Font= +'ArialBold'aX['Frame'].Position=UDim2.new(1,0,(#ah*aX['Frame'].Size.Y.Scale),0) +WaitForChild(aX['Frame'],'ClickListener').MouseButton1Down:connect(function(aY, +aZ)StartDrag(aX,aY,aZ)end)aX['Frame'].ClickListener.BackgroundColor3=Color3.new( +1,1,1)aX['Frame'].ClickListener.BackgroundTransparency=0.7 aX['Frame']. +ClickListener.AutoButtonColor=false aX['AutoHide']=true aX['IsHidden']=true for +aY,aZ in pairs(ae)do if aZ['Player'].Neutral or not aZ['MyTeam']then +AddPlayerToTeam(aX,aZ)end end if#aX['MyPlayers']>0 then ag=aX UpdateMinimize() +BaseUpdate()end aC=false end function RemoveNeutralTeam()while aC do debugprint +'in neutral team lock'wait()end aC=true ag['Frame']:Destroy()ag=nil +RemoveMiddleBGFrame()aC=false end function TeamScoreChanged(aU,aX)WaitForChild( +aU['Frame'],'PlayerScore').Text=tostring(aX)aU['TeamScore']=aX end function +TeamChildAdded(aU,aX)if aX.Name=='AutoHide'then aU['AutoHide']=true elseif aX. +Name=='TeamScore'then WaitForChild(aU['Frame'],'PlayerScore').Text=tostring(aX. +Value)aU['TeamScore']=aX.Value aX.Changed:connect(function()TeamScoreChanged(aU, +aX.Value)end)end end function TeamChildRemoved(aU,aX)if aX.Name=='AutoHide'then +aU['AutoHide']=false elseif aX.Name=='TeamScore'then WaitForChild(aU['Frame'], +'PlayerScore').Text=''aU['TeamScore']=nil end end function TeamChanged(aU,aX)if +aX=='Name'then WaitForChild(WaitForChild(aU['Frame'],'TitleFrame'),'Title').Text +=aU['MyTeam'].Name elseif aX=='TeamColor'then aU['Frame'].ClickListener. +BackgroundColor3=aU['MyTeam'].TeamColor.Color for aY,aZ in pairs(af)do if aZ[ +'MyTeam'].TeamColor==aU['MyTeam']then RemoveTeamFrame(aU['MyTeam'])end end aU[ +'MyPlayers']={}for a_,a0 in pairs(ae)do SetPlayerToTeam(a0)end BaseUpdate()end +end function InsertTeamFrame(aU)while aw do debugprint +'in adding team frame lock'wait(3.333333333333333E-2)end aw=true local aX={}aX[ +'MyTeam']=aU aX['MyPlayers']={}aX['Frame']=H:Clone()WaitForChild(WaitForChild(aX +['Frame'],'TitleFrame'),'Title').Text=aU.Name aX['Frame'].TitleFrame.Title.Font= +'ArialBold'aX['Frame'].TitleFrame.Title.FontSize='Size18'aX['Frame'].TitleFrame. +Position=UDim2.new(aX['Frame'].TitleFrame.Position.X.Scale,aX['Frame']. +TitleFrame.Position.X.Offset,0.1,0)aX['Frame'].TitleFrame.Size=UDim2.new(aX[ +'Frame'].TitleFrame.Size.X.Scale,aX['Frame'].TitleFrame.Size.X.Offset,0.8,0)aX[ +'Frame'].Position=UDim2.new(1,0,(#ah*aX['Frame'].Size.Y.Scale),0)WaitForChild(aX +['Frame'],'ClickListener').MouseButton1Down:connect(function(a_,a0)StartDrag(aX, +a_,a0)end)aX['Frame'].ClickListener.BackgroundColor3=aU.TeamColor.Color aX[ +'Frame'].ClickListener.BackgroundTransparency=0.7 aX['Frame'].ClickListener. +AutoButtonColor=false ad=ad+1 aX['ID']=ad aX['AutoHide']=false if aU: +FindFirstChild'AutoHide'then aX['AutoHide']=true end if aU:FindFirstChild +'TeamScore'then TeamChildAdded(aX,aU.TeamScore)end aU.ChildAdded:connect( +function(a_)TeamChildAdded(aX,a_)end)aU.ChildRemoved:connect(function(a_) +TeamChildRemoved(aX,a_)end)aU.Changed:connect(function(a_)TeamChanged(aX,a_)end) +for a_,a0 in pairs(ae)do if not a0['Player'].Neutral and a0['Player'].TeamColor +==aU.TeamColor then AddPlayerToTeam(aX,a0)end end aX['IsHidden']=false if not aX +['AutoHide']or#aX['MyPlayers']>0 then aX['Frame'].Parent=y aX['Frame']: +TweenPosition(UDim2.new(0.5,0,(#ah*aX['Frame'].Size.Y.Scale),0),'Out','Linear',c +,true)AddMiddleBGFrame()else aX['IsHidden']=true aX['Frame'].Parent=nil end +table.insert(af,aX)UpdateMinimize()BaseUpdate()if#af==1 and not ag then +AddNeutralTeam()end aw=false end function RemoveTeamFrame(aU)while aw do +debugprint'in removing team frame lock'wait(3.333333333333333E-2)end aw=true +local aX for a_,a0 in ipairs(af)do if aU==a0['MyTeam']then aX=a0 a0['Frame']: +Destroy()table.remove(af,a_)end end if#af==0 then debugprint +'removeteamframe, remove neutral'if ag then RemoveNeutralTeam()end end for a1,a2 +in ipairs(aX['MyPlayers'])do RemovePlayerFromTeam(aX,a1)PlayerChanged(a2, +'TeamColor')end RemoveMiddleBGFrame()BaseUpdate()aw=false end function TeamAdded +(aU)InsertTeamFrame(aU)end function TeamRemoved(aU)RemoveTeamFrame(aU)end +function BaseUpdate()while ay do debugprint'in baseupdate lock'wait( +3.333333333333333E-2)end ay=true UpdateStatNames()if#af==0 and not ag then +PlayerListModeUpdate()else TeamListModeUpdate()end for aU,aX in ipairs(ah)do if +aX.Parent~=nil then aX:TweenPosition(UDim2.new(0.5,0,((#ah-aU)*aX.Size.Y.Scale), +0),'Out','Linear',c,true)end end if not D.Value and#ah>_ then +UpdateScrollPosition()end UpdateMinimize()UpdateScrollBarSize() +UpdateScrollPosition()UpdateScrollBarVisibility()ay=false end game.GuiService: +AddKey'\t'local aU=time()game.GuiService.KeyPressed:connect(function(aX)if aX== +'\t'then debugprint'caught tab key'local a1,a2=pcall(function()return game. +GuiService.IsModalDialog end)if a1==false or(a1 and a2==false)then if time()-aU> +0.4 then aU=time()if F.Value then if not E.Value then i:TweenPosition(UDim2.new( +0,0,0,0),'Out','Linear',c*1.2,true)E.Value=true else i:TweenPosition(UDim2.new( +aq.X.Scale,aq.X.Offset-10,0,0),'Out','Linear',c*1.2,true)E.Value=false D.Value= +true end else ToggleMaximize()end end end end end)function PlayersChildAdded(aX) +if aX:IsA'Player'then Spawn(function()debugPlayerAdd(aX)end)else +BlowThisPopsicleStand()end end function coreGuiChanged(aX,a1)if aX==Enum. +CoreGuiType.All or aX==Enum.CoreGuiType.PlayerList then j.Visible=a1 end end +function TeamsChildAdded(aX)if aX:IsA'Team'then TeamAdded(aX)else +BlowThisPopsicleStand()end end function TeamsChildRemoved(aX)if aX:IsA'Team'then +TeamRemoved(aX)else BlowThisPopsicleStand()end end function debugPlayerAdd(aX) +InsertPlayerFrame(aX)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(3.333333333333333E-2)debugprint'Waiting For Teams'end +for aX,a1 in pairs(game.Teams:GetTeams())do TeamAdded(a1)end for a2,a3 in pairs( +f:GetPlayers())do Spawn(function()debugPlayerAdd(a3)end)end game.Teams. +ChildAdded:connect(TeamsChildAdded)game.Teams.ChildRemoved:connect( +TeamsChildRemoved)f.ChildAdded:connect(PlayersChildAdded)InitReportAbuse()G. +Value=true BaseUpdate()wait(2)aL=not not game.Workspace:FindFirstChild +'PSVariable'if g.Name=='newplayerlistisbad'or g.Name=='imtotallyadmin'then V. +Parent=i Spawn(function()while true do local a4=''for a5,a6 in pairs(game. +Players:GetPlayers())do a4=a4..' '..a6.Name end W.Text=a4 wait(0.5)end end)end \ No newline at end of file diff --git a/processed/48488398.lua b/processed/48488398.lua index 44ebb8a..b2ca654 100644 --- a/processed/48488398.lua +++ b/processed/48488398.lua @@ -1,235 +1,84 @@ -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 +function waitForProperty(a,b)while not a[b]do a.Changed:wait()end end function +waitForChild(a,b)while not a:FindFirstChild(b)do a.ChildAdded:wait()end end +waitForProperty(game.Players,'LocalPlayer')waitForChild(script.Parent,'Popup') +waitForChild(script.Parent.Popup,'AcceptButton')script.Parent.Popup.AcceptButton +.Modal=true local a,b,c,d,e=game.Players.LocalPlayer,nil,{},true,function()if +script.Parent.Popup then script.Parent.Popup.Visible=false end end function +makeFriend(f,g)local h=script.Parent:FindFirstChild'Popup'if h==nil then return +end if h.Visible then return end if c[f]then return end h.PopupText.Text= +'Accept Friend Request from '..tostring(f.Name)..'?'h.PopupImage.Image= +'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(f.userId).. +'&x=352&y=352'showTwoButtons()h.Visible=true h.AcceptButton.Text='Accept'h. +DeclineButton.Text='Decline'h:TweenSize(UDim2.new(0,330,0,350),Enum. +EasingDirection.Out,Enum.EasingStyle.Quart,1,true)local i,j i=h.AcceptButton. +MouseButton1Click:connect(function()h.Visible=false g:RequestFriendship(f)if i +then i:disconnect()end if j then j:disconnect()end h:TweenSize(UDim2.new(0,0,0,0 +),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,e())end)j=h. +DeclineButton.MouseButton1Click:connect(function()h.Visible=false g: +RevokeFriendship(f)c[f]=true print'pop up blacklist'if i then i:disconnect()end +if j then j:disconnect()end h:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection. +Out,Enum.EasingStyle.Quart,1,true,e())end)end game.Players.FriendRequestEvent: +connect(function(f,g,h)if f~=a and g~=a then return end if f==a then if h==Enum. +FriendRequestEvent.Accept then game:GetService'GuiService':SendNotification( +'You are Friends','With '..g.Name..'!', +'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(g.userId).. +'&x=48&y=48',5,function()end)end elseif g==a then if h==Enum.FriendRequestEvent. +Issue then if c[f]then return end game:GetService'GuiService':SendNotification( +'Friend Request','From '..f.Name, +'http://www.roblox.com/thumbs/avatar.ashx?userId='..tostring(f.userId).. +'&x=48&y=48',8,function()makeFriend(f,g)end)elseif h==Enum.FriendRequestEvent. +Accept then game:GetService'GuiService':SendNotification('You are Friends', +'With '..f.Name..'!','http://www.roblox.com/thumbs/avatar.ashx?userId='.. +tostring(f.userId)..'&x=48&y=48',5,function()end)end end end)function +showOneButton()local f=script.Parent:FindFirstChild'Popup'if f then f.OKButton. +Visible=true f.DeclineButton.Visible=false f.AcceptButton.Visible=false end end +function showTwoButtons()local f=script.Parent:FindFirstChild'Popup'if f then f. +OKButton.Visible=false f.DeclineButton.Visible=true f.AcceptButton.Visible=true +end end function showTeleportUI(f,g)if b~=nil then b:Remove()end waitForChild(a, +'PlayerGui')b=Instance.new'Message'b.Text=f b.Parent=a.PlayerGui if g>0 then +wait(g)b:Remove()end end function onTeleport(f,g,h)if game:GetService +'TeleportService'.CustomizedTeleportUI==false then if f==Enum.TeleportState. +Started then showTeleportUI('Teleport started...',0)elseif f==Enum.TeleportState +.WaitingForServer then showTeleportUI('Requesting server...',0)elseif f==Enum. +TeleportState.InProgress then showTeleportUI('Teleporting...',0)elseif f==Enum. +TeleportState.Failed then showTeleportUI( +[[Teleport failed. Insufficient privileges or target place does not exist.]],3) +end end end if d then a.OnTeleport:connect(onTeleport)game:GetService +'TeleportService'.ErrorCallback=function(f)local h=script.Parent:FindFirstChild +'Popup'showOneButton()h.PopupText.Text=f local i i=h.OKButton.MouseButton1Click: +connect(function()game:GetService'TeleportService':TeleportCancel()if i then i: +disconnect()end game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild +'Popup')h:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle +.Quart,1,true,e())end)game.GuiService:AddCenterDialog(script.Parent: +FindFirstChild'Popup',Enum.CenterDialogType.QuitDialog,function()showOneButton() +script.Parent:FindFirstChild'Popup'.Visible=true h:TweenSize(UDim2.new(0,330,0, +350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()h: +TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1, +true,e())end)end game:GetService'TeleportService'.ConfirmationCallback=function( +f,h,i)local j=script.Parent:FindFirstChild'Popup'j.PopupText.Text=f j.PopupImage +.Image=''local k,l local function killCons()if k then k:disconnect()end if l +then l:disconnect()end game.GuiService:RemoveCenterDialog(script.Parent: +FindFirstChild'Popup')j:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out, +Enum.EasingStyle.Quart,1,true,e())end k=j.AcceptButton.MouseButton1Click: +connect(function()killCons()local m,n=pcall(function()game:GetService +'TeleportService':TeleportImpl(h,i)end)if not m then showOneButton()j.PopupText. +Text=n local o o=j.OKButton.MouseButton1Click:connect(function()if o then o: +disconnect()end game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild +'Popup')j:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle +.Quart,1,true,e())end)game.GuiService:AddCenterDialog(script.Parent: +FindFirstChild'Popup',Enum.CenterDialogType.QuitDialog,function()showOneButton() +script.Parent:FindFirstChild'Popup'.Visible=true j:TweenSize(UDim2.new(0,330,0, +350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()j: +TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1, +true,e())end)end end)l=j.DeclineButton.MouseButton1Click:connect(function() +killCons()pcall(function()game:GetService'TeleportService':TeleportCancel()end) +end)local m=pcall(function()game.GuiService:AddCenterDialog(script.Parent: +FindFirstChild'Popup',Enum.CenterDialogType.QuitDialog,function()showTwoButtons( +)j.AcceptButton.Text='Leave'j.DeclineButton.Text='Stay'script.Parent: +FindFirstChild'Popup'.Visible=true j:TweenSize(UDim2.new(0,330,0,350),Enum. +EasingDirection.Out,Enum.EasingStyle.Quart,1,true)end,function()j:TweenSize( +UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,e()) +end)end)if m==false then script.Parent:FindFirstChild'Popup'.Visible=true j. +AcceptButton.Text='Leave'j.DeclineButton.Text='Stay'j: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..a31c879 100644 --- a/processed/48488451.lua +++ b/processed/48488451.lua @@ -1,91 +1,20 @@ -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() +local a=Instance.new'Frame'a.Position=UDim2.new(0.5,-165,0.5,-175)a.Size=UDim2. +new(0,330,0,350)a.Style=Enum.FrameStyle.RobloxRound a.ZIndex=4 a.Name='Popup'a. +Visible=false a.Parent=script.Parent local b=a:clone()b.Size=UDim2.new(1,16,1,16 +)b.Position=UDim2.new(0,-8,0,-8)b.Name='Darken'b.ZIndex=1 b.Parent=a local c= +Instance.new'TextButton'c.Position=UDim2.new(0,20,0,270)c.Size=UDim2.new(0,100,0 +,50)c.Font=Enum.Font.ArialBold c.FontSize=Enum.FontSize.Size24 c.Style=Enum. +ButtonStyle.RobloxButton c.TextColor3=Color3.new(0.9725490196078431, +0.9725490196078431,0.9725490196078431)c.Text='Yes'c.ZIndex=5 c.Name= +'AcceptButton'c.Parent=a local d=c:clone()d.Position=UDim2.new(1,-120,0,270)d. +Text='No'd.Name='DeclineButton'd.Parent=a local e=c:clone()e.Name='OKButton'e. +Text='OK'e.Position=UDim2.new(0.5,-50,0,270)e.Visible=false e.Parent=a local f= +Instance.new'ImageLabel'f.BackgroundTransparency=1 f.Position=UDim2.new(0.5,-140 +,0,0)f.Size=UDim2.new(0,280,0,280)f.ZIndex=3 f.Name='PopupImage'f.Parent=a local +g=Instance.new'ImageLabel'g.BackgroundTransparency=1 g.Size=UDim2.new(1,0,1,0)g. +Image='http://www.roblox.com/asset/?id=47574181'g.Name='Backing'g.ZIndex=2 g. +Parent=f local h=Instance.new'TextLabel'h.Name='PopupText'h.Size=UDim2.new(1,0, +0.8,0)h.Font=Enum.Font.ArialBold h.FontSize=Enum.FontSize.Size36 h. +BackgroundTransparency=1 h.Text="Hello I'm a popup"h.TextColor3=Color3.new( +0.9725490196078431,0.9725490196078431,0.9725490196078431)h.TextWrap=true h. +ZIndex=5 h.Parent=a script:remove() \ No newline at end of file diff --git a/processed/53878047.lua b/processed/53878047.lua index 2c87031..521412b 100644 --- a/processed/53878047.lua +++ b/processed/53878047.lua @@ -1,758 +1,264 @@ -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() +if game.CoreGui.Version<3 then return end local a=script.Parent local function +waitForChild(b,c)while not b:FindFirstChild(c)do b.ChildAdded:wait()end end +local function waitForProperty(b,c)while not b[c]do b.Changed:wait()end end +local function IsTouchDevice()local b=false pcall(function()b=Game:GetService +'UserInputService'.TouchEnabled end)return b end local function IsPhone()if a. +AbsoluteSize.Y<=320 then return true end return false end waitForChild(game, +'Players')waitForProperty(game.Players,'LocalPlayer')local b=Instance.new'Frame' +b.Name='CurrentLoadout'b.Position=UDim2.new(0.5,-300,1,-85)b.Size=UDim2.new(0, +600,0,54)b.BackgroundTransparency=1 b.RobloxLocked=true b.Parent=a local c= +Instance.new'ImageLabel'c.Name='Background'c.Size=UDim2.new(1.2,0,1.2,0)c.Image= +'http://www.roblox.com/asset/?id=96536002'c.BackgroundTransparency=1 c.Position= +UDim2.new(-0.1,0,-0.1,0)c.ZIndex=0 c.Parent=b c.Visible=false local d=Instance. +new'ImageLabel'd.Size=UDim2.new(1,0,0.025,1)d.Position=UDim2.new(0,0,0,0)d.Image +='http://www.roblox.com/asset/?id=97662207'd.BackgroundTransparency=1 d.Parent=c +local e=Instance.new'BoolValue'e.Name='Debounce'e.RobloxLocked=true e.Parent=b +local f=Instance.new'ImageButton'f.RobloxLocked=true f.Visible=false f.Name= +'BackpackButton'f.BackgroundTransparency=1 f.Image= +'http://www.roblox.com/asset/?id=97617958'f.Position=UDim2.new(0.5,-60,1,-108)f. +Size=UDim2.new(0,120,0,18)waitForChild(a,'ControlFrame')f.Parent=a.ControlFrame +local g=9 if IsPhone()then g=3 b.Size=UDim2.new(0,180,0,54)b.Position=UDim2.new( +0.5,-90,1,-85)end for h=0,g do local i=Instance.new'Frame'i.RobloxLocked=true i. +BackgroundColor3=Color3.new(0,0,0)i.BackgroundTransparency=1 i.BorderColor3= +Color3.new(1,1,1)i.Name='Slot'..tostring(h)i.ZIndex=4 if h==0 then i.Position= +UDim2.new(0.9,0,0,0)else i.Position=UDim2.new((h-1)*0.1,(h-1)*6,0,0)end i.Size= +UDim2.new(0,54,1,0)i.Parent=b if a.AbsoluteSize.Y<=320 then i.Position=UDim2. +new(0,(h-1)*60,0,-50)print('Well got here',i,i.Position.X.Scale,i.Position.X. +Offset)end if a.AbsoluteSize.Y<=320 and h==0 then i:Destroy()end end local h= +Instance.new'ImageButton'h.Name='TempSlot'h.Active=true h.Size=UDim2.new(1,0,1,0 +)h.BackgroundTransparency=1 h.Style='Custom'h.Visible=false h.RobloxLocked=true +h.Parent=b h.ZIndex=3 local i=Instance.new'ImageLabel'i.Name='Background'i. +BackgroundTransparency=1 i.Image='http://www.roblox.com/asset/?id=97613075'i. +Size=UDim2.new(1,0,1,0)i.Parent=h local j=Instance.new'ImageLabel'j.Name= +'Highlight'j.BackgroundTransparency=1 j.Image= +'http://www.roblox.com/asset/?id=97643886'j.Size=UDim2.new(1,0,1,0)j.Visible= +false local k=Instance.new'ObjectValue'k.Name='GearReference'k.RobloxLocked=true +k.Parent=h local l=Instance.new'TextLabel'l.Name='ToolTipLabel'l.RobloxLocked= +true l.Text=''l.BackgroundTransparency=0.5 l.BorderSizePixel=0 l.Visible=false l +.TextColor3=Color3.new(1,1,1)l.BackgroundColor3=Color3.new(0,0,0)l. +TextStrokeTransparency=0 l.Font=Enum.Font.ArialBold l.FontSize=Enum.FontSize. +Size14 l.Size=UDim2.new(1,60,0,20)l.Position=UDim2.new(0,-30,0,-30)l.Parent=h +local m=Instance.new'BoolValue'm.Name='Kill'm.RobloxLocked=true m.Parent=h local +n=Instance.new'ImageLabel'n.Name='GearImage'n.BackgroundTransparency=1 n. +Position=UDim2.new(0,0,0,0)n.Size=UDim2.new(1,0,1,0)n.ZIndex=5 n.RobloxLocked= +true n.Parent=h local o=Instance.new'TextLabel'o.Name='SlotNumber'o. +BackgroundTransparency=1 o.BorderSizePixel=0 o.Font=Enum.Font.ArialBold o. +FontSize=Enum.FontSize.Size18 o.Position=UDim2.new(0,0,0,0)o.Size=UDim2.new(0,10 +,0,15)o.TextColor3=Color3.new(1,1,1)o.TextTransparency=0 o.TextXAlignment=Enum. +TextXAlignment.Left o.TextYAlignment=Enum.TextYAlignment.Bottom o.RobloxLocked= +true o.Parent=h o.ZIndex=5 if IsTouchDevice()then o.Visible=false end local p=o: +Clone()p.Name='SlotNumberDownShadow'p.TextColor3=Color3.new(0,0,0)p.Position= +UDim2.new(0,1,0,-1)p.Parent=h p.ZIndex=2 local q=p:Clone()q.Name= +'SlotNumberUpShadow'q.Position=UDim2.new(0,-1,0,-1)q.Parent=h local r=Instance. +new'TextLabel'r.RobloxLocked=true r.Name='GearText'r.BackgroundTransparency=1 r. +Font=Enum.Font.Arial r.FontSize=Enum.FontSize.Size14 r.Position=UDim2.new(0,-8,0 +,-8)r.Size=UDim2.new(1,16,1,16)r.Text=''r.TextColor3=Color3.new(1,1,1)r.TextWrap +=true r.Parent=h r.ZIndex=5 local s=Instance.new'Frame's.RobloxLocked=true s. +Visible=false s.Name='Backpack's.Position=UDim2.new(0.5,0,0.5,0)s. +BackgroundColor3=Color3.new(0.12549019607843137,0.12549019607843137, +0.12549019607843137)s.BackgroundTransparency=0 s.BorderSizePixel=0 s.Parent=a s. +Active=true local t=Instance.new'BoolValue't.RobloxLocked=true t.Name='SwapSlot' +t.Parent=s local u=Instance.new'IntValue'u.RobloxLocked=true u.Name='Slot'u. +Parent=t local v=Instance.new'ObjectValue'v.RobloxLocked=true v.Name= +'GearButton'v.Parent=t local w=Instance.new'Frame'w.Name='Tabs'w.Visible=false w +.Active=false w.RobloxLocked=true w.BackgroundColor3=Color3.new(0,0,0)w. +BackgroundTransparency=0.08 w.BorderSizePixel=0 w.Position=UDim2.new(0,0,-0.1,-4 +)w.Size=UDim2.new(1,0,0.1,4)w.Parent=s local x=Instance.new'Frame'x.RobloxLocked +=true x.Name='TabLine'x.BackgroundColor3=Color3.new(0.20784313725490197, +0.20784313725490197,0.20784313725490197)x.BorderSizePixel=0 x.Position=UDim2. +new(0,5,1,-4)x.Size=UDim2.new(1,-10,0,4)x.ZIndex=2 x.Parent=w local y=Instance. +new'TextButton'y.RobloxLocked=true y.Name='InventoryButton'y.Size=UDim2.new(0,60 +,0,30)y.Position=UDim2.new(0,7,1,-31)y.BackgroundColor3=Color3.new(1,1,1)y. +BorderColor3=Color3.new(1,1,1)y.Font=Enum.Font.ArialBold y.FontSize=Enum. +FontSize.Size18 y.Text='Gear'y.AutoButtonColor=false y.TextColor3=Color3.new(0,0 +,0)y.Selected=true y.Active=true y.ZIndex=3 y.Parent=w if game.CoreGui.Version>= +8 then local z=Instance.new'TextButton'z.RobloxLocked=true z.Name= +'WardrobeButton'z.Size=UDim2.new(0,90,0,30)z.Position=UDim2.new(0,77,1,-31)z. +BackgroundColor3=Color3.new(0,0,0)z.BorderColor3=Color3.new(1,1,1)z.Font=Enum. +Font.ArialBold z.FontSize=Enum.FontSize.Size18 z.Text='Wardrobe'z. +AutoButtonColor=false z.TextColor3=Color3.new(1,1,1)z.Selected=false z.Active= +true z.Parent=w end local z=Instance.new'TextButton'z.RobloxLocked=true z.Name= +'CloseButton'z.Font=Enum.Font.ArialBold z.FontSize=Enum.FontSize.Size24 z. +Position=UDim2.new(1,-33,0,4)z.Size=UDim2.new(0,30,0,30)z.Style=Enum.ButtonStyle +.RobloxButton z.Text=''z.TextColor3=Color3.new(1,1,1)z.Parent=w z.Modal=true +local A=Instance.new'ImageLabel'A.RobloxLocked=true A.Name='XImage'game: +GetService'ContentProvider':Preload'http://www.roblox.com/asset/?id=75547445'A. +Image='http://www.roblox.com/asset/?id=75547445'A.BackgroundTransparency=1 A. +Position=UDim2.new(-0.25,-1,-0.25,-1)A.Size=UDim2.new(1.5,2,1.5,2)A.ZIndex=2 A. +Parent=z local B=Instance.new'Frame'B.RobloxLocked=true B.Name='SearchFrame'B. +BackgroundTransparency=1 B.Position=UDim2.new(1,-220,0,2)B.Size=UDim2.new(0,220, +0,24)B.Parent=s local C=Instance.new'ImageButton'C.RobloxLocked=true C.Name= +'SearchButton'C.Size=UDim2.new(0,25,0,25)C.BackgroundTransparency=1 C.Image= +'rbxasset://textures/ui/SearchIcon.png'C.Parent=B local D=Instance.new +'TextButton'D.RobloxLocked=true D.Position=UDim2.new(0,25,0,0)D.Size=UDim2.new(1 +,-28,0,26)D.Name='SearchBoxFrame'D.Text=''D.Style=Enum.ButtonStyle.RobloxButton +D.Parent=B local E=Instance.new'TextBox'E.RobloxLocked=true E.Name='SearchBox'E. +BackgroundTransparency=1 E.Font=Enum.Font.ArialBold E.FontSize=Enum.FontSize. +Size12 E.Position=UDim2.new(0,-5,0,-5)E.Size=UDim2.new(1,10,1,10)E.TextColor3= +Color3.new(1,1,1)E.TextXAlignment=Enum.TextXAlignment.Left E.ZIndex=2 E.TextWrap +=true E.Text='Search...'E.Parent=D local F=Instance.new'TextButton'F. +RobloxLocked=true F.Visible=false F.Name='ResetButton'F.Position=UDim2.new(1,-26 +,0,3)F.Size=UDim2.new(0,20,0,20)F.Style=Enum.ButtonStyle.RobloxButtonDefault F. +Text='X'F.TextColor3=Color3.new(1,1,1)F.Font=Enum.Font.ArialBold F.FontSize=Enum +.FontSize.Size18 F.ZIndex=3 F.Parent=B local G=Instance.new'Frame'G.Name='Gear'G +.RobloxLocked=true G.BackgroundTransparency=1 G.Size=UDim2.new(1,0,1,0)G. +ClipsDescendants=true G.Parent=s local H=Instance.new'Frame'H.RobloxLocked=true +H.Name='AssetsList'H.BackgroundTransparency=1 H.Size=UDim2.new(0.2,0,1,0)H.Style +=Enum.FrameStyle.RobloxSquare H.Visible=false H.Parent=G local I=Instance.new +'Frame'I.RobloxLocked=true I.Name='GearGrid'I.Size=UDim2.new(0.95,0,1,0)I. +BackgroundTransparency=1 I.Parent=G local J=Instance.new'ImageButton'J. +RobloxLocked=true J.Visible=false J.Name='GearButton'J.Size=UDim2.new(0,54,0,54) +J.Style='Custom'J.BackgroundTransparency=1 J.Parent=I local K=Instance.new +'ImageLabel'K.Name='Background'K.BackgroundTransparency=1 K.Image= +'http://www.roblox.com/asset/?id=97613075'K.Size=UDim2.new(1,0,1,0)K.Parent=J +local L=Instance.new'ObjectValue'L.RobloxLocked=true L.Name='GearReference'L. +Parent=J local M=Instance.new'Frame'M.RobloxLocked=true M.Name='GreyOutButton'M. +BackgroundTransparency=0.5 M.Size=UDim2.new(1,0,1,0)M.Active=true M.Visible= +false M.ZIndex=3 M.Parent=J local N=Instance.new'TextLabel'N.RobloxLocked=true N +.Name='GearText'N.BackgroundTransparency=1 N.Font=Enum.Font.Arial N.FontSize= +Enum.FontSize.Size14 N.Position=UDim2.new(0,-8,0,-8)N.Size=UDim2.new(1,16,1,16)N +.Text=''N.ZIndex=2 N.TextColor3=Color3.new(1,1,1)N.TextWrap=true N.Parent=J +local O=Instance.new'Frame'O.RobloxLocked=true O.Name='GearGridScrollingArea'O. +Position=UDim2.new(1,-19,0,35)O.Size=UDim2.new(0,17,1,-45)O. +BackgroundTransparency=1 O.Parent=G local P=Instance.new'Frame'P.RobloxLocked= +true P.Name='GearLoadouts'P.BackgroundTransparency=1 P.Position=UDim2.new(0.7,23 +,0.5,1)P.Size=UDim2.new(0.3,-23,0.5,-1)P.Parent=G P.Visible=false local Q= +Instance.new'Frame'Q.RobloxLocked=true Q.Name='GearLoadoutsHeader'Q. +BackgroundColor3=Color3.new(0,0,0)Q.BackgroundTransparency=0.2 Q.BorderColor3= +Color3.new(1,0,0)Q.Size=UDim2.new(1,2,0.15,-1)Q.Parent=P local R=Instance.new +'TextLabel'R.RobloxLocked=true R.Name='LoadoutsHeaderText'R. +BackgroundTransparency=1 R.Font=Enum.Font.ArialBold R.FontSize=Enum.FontSize. +Size18 R.Size=UDim2.new(1,0,1,0)R.Text='Loadouts'R.TextColor3=Color3.new(1,1,1)R +.Parent=Q local S=O:clone()S.RobloxLocked=true S.Name= +'GearLoadoutsScrollingArea'S.Position=UDim2.new(1,-15,0.15,2)S.Size=UDim2.new(0, +17,0.85,-2)S.Parent=P local T=Instance.new'Frame'T.RobloxLocked=true T.Name= +'LoadoutsList'T.Position=UDim2.new(0,0,0.15,2)T.Size=UDim2.new(1,-17,0.85,-2)T. +Style=Enum.FrameStyle.RobloxSquare T.Parent=P local U=Instance.new'Frame'U. +RobloxLocked=true U.Name='GearPreview'U.Position=UDim2.new(0.7,23,0,0)U.Size= +UDim2.new(0.3,-28,0.5,-1)U.BackgroundTransparency=1 U.ZIndex=7 U.Parent=G local +V=Instance.new'Frame'V.RobloxLocked=true V.Name='GearStats'V. +BackgroundTransparency=1 V.Position=UDim2.new(0,0,0.75,0)V.Size=UDim2.new(1,0, +0.25,0)V.ZIndex=8 V.Parent=U local W=Instance.new'TextLabel'W.RobloxLocked=true +W.Name='GearName'W.BackgroundTransparency=1 W.Font=Enum.Font.ArialBold W. +FontSize=Enum.FontSize.Size18 W.Position=UDim2.new(0,-3,0,0)W.Size=UDim2.new(1,6 +,1,5)W.Text=''W.TextColor3=Color3.new(1,1,1)W.TextWrap=true W.ZIndex=9 W.Parent= +V local X=Instance.new'ImageLabel'X.RobloxLocked=true X.Name='GearImage'X.Image= +''X.BackgroundTransparency=1 X.Position=UDim2.new(0.125,0,0,0)X.Size=UDim2.new( +0.75,0,0.75,0)X.ZIndex=8 X.Parent=U local Y=Instance.new'Frame'Y. +BackgroundColor3=Color3.new(0,0,0)Y.BackgroundTransparency=0.5 Y.BorderSizePixel +=0 Y.RobloxLocked=true Y.Name='GearIcons'Y.Position=UDim2.new(0.4,2,0.85,-2)Y. +Size=UDim2.new(0.6,0,0.15,0)Y.Visible=false Y.ZIndex=9 Y.Parent=X local Z= +Instance.new'ImageLabel'Z.RobloxLocked=true Z.Name='GenreImage'Z. +BackgroundColor3=Color3.new(0.4,0.6,1)Z.BackgroundTransparency=0.5 Z. +BorderSizePixel=0 Z.Size=UDim2.new(0.25,0,1,0)Z.Parent=Y local _=Z:clone()_. +RobloxLocked=true _.Name='AttributeOneImage'_.BackgroundColor3=Color3.new(1,0.2, +0)_.Position=UDim2.new(0.25,0,0,0)_.Parent=Y local aa=Z:clone()aa.RobloxLocked= +true aa.Name='AttributeTwoImage'aa.BackgroundColor3=Color3.new(0.6,1,0.6)aa. +Position=UDim2.new(0.5,0,0,0)aa.Parent=Y local ab=Z:clone()ab.RobloxLocked=true +ab.Name='AttributeThreeImage'ab.BackgroundColor3=Color3.new(0,0.5,0.5)ab. +Position=UDim2.new(0.75,0,0,0)ab.Parent=Y if game.CoreGui.Version<8 then script: +remove()return end local function makeCharFrame(ac,ad)local ae=Instance.new +'Frame'ae.RobloxLocked=true ae.Size=UDim2.new(1,0,1,-70)ae.Position=UDim2.new(0, +0,0,20)ae.Name=ac ae.BackgroundTransparency=1 ae.Parent=ad ae.Visible=false +return ae end local function makeZone(ac,ad,ae,af,ag)local ah=Instance.new +'ImageLabel'ah.RobloxLocked=true ah.Name=ac ah.Image=ad ah.Size=ae ah. +BackgroundTransparency=1 ah.Position=af ah.Parent=ag return ah end +local function makeStyledButton(ac,ad,ae,af,ag)local ah=Instance.new +'ImageButton'ah.RobloxLocked=true ah.Name=ac ah.Size=ad ah.Position=ae if ag +then ah.Style=ag else ah.BackgroundColor3=Color3.new(0,0,0)ah.BorderColor3= +Color3.new(1,1,1)end ah.Parent=af return ah end local function makeTextLabel(ac, +ad,ae,af)local ag=Instance.new'TextLabel'ag.RobloxLocked=true ag. +BackgroundTransparency=1 ag.Size=UDim2.new(0,32,0,14)ag.Name=ac ag.Font=Enum. +Font.Arial ag.TextColor3=Color3.new(1,1,1)ag.FontSize=Enum.FontSize.Size14 ag. +Text=ad ag.Position=ae ag.Parent=af end local ac=Instance.new'Frame'ac.Name= +'Wardrobe'ac.RobloxLocked=true ac.BackgroundTransparency=1 ac.Visible=false ac. +Size=UDim2.new(1,0,1,0)ac.Parent=s local ad=Instance.new'Frame'ad.RobloxLocked= +true ad.Name='AssetList'ad.Position=UDim2.new(0,4,0,5)ad.Size=UDim2.new(0,85,1,- +5)ad.BackgroundTransparency=1 ad.Visible=true ad.Parent=ac local ae=Instance.new +'Frame'ae.RobloxLocked=true ae.Name='PreviewAssetFrame'ae.BackgroundTransparency +=1 ae.Position=UDim2.new(1,-240,0,30)ae.Size=UDim2.new(0,250,0,250)ae.Parent=ac +local af=Instance.new'TextButton'af.RobloxLocked=true af.Name= +'PreviewAssetBacking'af.Active=false af.Text=''af.AutoButtonColor=false af.Size= +UDim2.new(1,0,1,0)af.Style=Enum.ButtonStyle.RobloxButton af.Visible=false af. +ZIndex=9 af.Parent=ae local ag=Instance.new'ImageLabel'ag.RobloxLocked=true ag. +Name='PreviewAssetImage'ag.BackgroundTransparency=0.8 ag.Position=UDim2.new(0.5, +-100,0,0)ag.Size=UDim2.new(0,200,0,200)ag.BorderSizePixel=0 ag.ZIndex=10 ag. +Parent=af local ah=Instance.new'TextLabel'ah.Name='AssetNameLabel'ah. +RobloxLocked=true ah.BackgroundTransparency=1 ah.Position=UDim2.new(0,0,1,-20)ah +.Size=UDim2.new(0.5,0,0,24)ah.ZIndex=10 ah.Font=Enum.Font.Arial ah.Text=''ah. +TextColor3=Color3.new(1,1,1)ah.TextScaled=true ah.Parent=af local ai=ah:clone() +ai.RobloxLocked=true ai.Name='AssetTypeLabel'ai.TextScaled=false ai.FontSize= +Enum.FontSize.Size18 ai.Position=UDim2.new(0.5,3,1,-20)ai.Parent=af local aj= +Instance.new'TextButton'aj.RobloxLocked=true aj.Name='PreviewButton'aj.Text= +'Rotate'aj.BackgroundColor3=Color3.new(0,0,0)aj.BackgroundTransparency=0.5 aj. +BorderColor3=Color3.new(1,1,1)aj.Position=UDim2.new(1.2,-62,1,-50)aj.Size=UDim2. +new(0,125,0,50)aj.Font=Enum.Font.ArialBold aj.FontSize=Enum.FontSize.Size24 aj. +TextColor3=Color3.new(1,1,1)aj.TextWrapped=true aj.TextStrokeTransparency=0 aj. +Parent=ac local ak=Instance.new'Frame'ak.RobloxLocked=true ak.Name= +'CharacterPane'ak.Position=UDim2.new(1,-220,0,32)ak.Size=UDim2.new(0,220,1,-40) +ak.BackgroundTransparency=1 ak.Visible=true ak.Parent=ac local al=makeCharFrame( +'FacesFrame',ak)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),al)makeStyledButton('Face',UDim2.new(0,64,0,64),UDim2.new(0.5,-32, +0.5,-135),al)local am=makeCharFrame('HeadsFrame',ak)makeZone('FaceZone', +'http://www.roblox.com/asset/?id=75460621',UDim2.new(0,157,0,137),UDim2.new(0.5, +-78,0.5,-68),am)makeStyledButton('Head',UDim2.new(0,64,0,64),UDim2.new(0.5,-32, +0.5,-135),am)local an=makeCharFrame('HatsFrame',ak)game:GetService +'ContentProvider':Preload'http://www.roblox.com/asset/?id=75457888'local ao= +makeZone('HatsZone','http://www.roblox.com/asset/?id=75457888',UDim2.new(0,186,0 +,184),UDim2.new(0.5,-93,0.5,-100),an)makeStyledButton('Hat1Button',UDim2.new(0, +64,0,64),UDim2.new(0,-1,0,-1),ao,Enum.ButtonStyle.RobloxButton)makeStyledButton( +'Hat2Button',UDim2.new(0,64,0,64),UDim2.new(0,63,0,-1),ao,Enum.ButtonStyle. +RobloxButton)makeStyledButton('Hat3Button',UDim2.new(0,64,0,64),UDim2.new(0,127, +0,-1),ao,Enum.ButtonStyle.RobloxButton)local ap=makeCharFrame('PantsFrame',ak) +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),ap)local aq=Instance.new'Frame'aq.RobloxLocked=true aq.Size=UDim2. +new(0,25,0,56)aq.Position=UDim2.new(0.5,-26,0.5,0)aq.BackgroundColor3=Color3. +new(0,0,0)aq.BorderColor3=Color3.new(1,1,1)aq.Name='PantFrame'aq.Parent=ap local +ar=aq:clone()ar.Position=UDim2.new(0.5,3,0.5,0)ar.RobloxLocked=true ar.Parent=ap +local as=Instance.new'ImageButton'as.RobloxLocked=true as.BackgroundTransparency +=1 as.ZIndex=2 as.Name='CurrentPants'as.Position=UDim2.new(0.5,-31,0.5,-4)as. +Size=UDim2.new(0,54,0,59)as.Parent=ap local at=makeCharFrame('PackagesFrame',ak) +local au=makeStyledButton('TorsoMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5,- +32,0.5,-110),at,Enum.ButtonStyle.RobloxButton)makeTextLabel('TorsoLabel','Torso' +,UDim2.new(0.5,-16,0,-25),au)local av=makeStyledButton('LeftLegMeshButton',UDim2 +.new(0,64,0,64),UDim2.new(0.5,0,0.5,-25),at,Enum.ButtonStyle.RobloxButton) +makeTextLabel('LeftLegLabel','Left Leg',UDim2.new(0.5,-16,0,-25),av)local aw= +makeStyledButton('RightLegMeshButton',UDim2.new(0,64,0,64),UDim2.new(0.5,-64,0.5 +,-25),at,Enum.ButtonStyle.RobloxButton)makeTextLabel('RightLegLabel','Right Leg' +,UDim2.new(0.5,-16,0,-25),aw)local ax=makeStyledButton('RightArmMeshButton', +UDim2.new(0,64,0,64),UDim2.new(0.5,-96,0.5,-110),at,Enum.ButtonStyle. +RobloxButton)makeTextLabel('RightArmLabel','Right Arm',UDim2.new(0.5,-16,0,-25), +ax)local ay=makeStyledButton('LeftArmMeshButton',UDim2.new(0,64,0,64),UDim2.new( +0.5,32,0.5,-110),at,Enum.ButtonStyle.RobloxButton)makeTextLabel('LeftArmLabel', +'Left Arm',UDim2.new(0.5,-16,0,-25),ay)local az=makeCharFrame('T-ShirtsFrame',ak +)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),az)makeStyledButton('TShirtButton',UDim2.new(0,64,0,64),UDim2.new( +0.5,-32,0.5,-64),az)local aA=makeCharFrame('ShirtsFrame',ak)makeZone('ShirtZone' +,'http://www.roblox.com/asset/?id=75460642',UDim2.new(0,121,0,154),UDim2.new(0.5 +,-60,0.5,-100),aA)makeStyledButton('ShirtButton',UDim2.new(0,64,0,64),UDim2.new( +0.5,-32,0.5,-64),aA)local aB=makeCharFrame('ColorFrame',ak)game:GetService +'ContentProvider':Preload'http://www.roblox.com/asset/?id=76049888'local aC= +makeZone('ColorZone','http://www.roblox.com/asset/?id=76049888',UDim2.new(0,120, +0,150),UDim2.new(0.5,-60,0.5,-100),aB)makeStyledButton('Head',UDim2.new(0.26,0, +0.19,0),UDim2.new(0.37,0,0.02,0),aC).AutoButtonColor=false makeStyledButton( +'LeftArm',UDim2.new(0.19,0,0.36,0),UDim2.new(0.78,0,0.26,0),aC).AutoButtonColor= +false makeStyledButton('RightArm',UDim2.new(0.19,0,0.36,0),UDim2.new(0.025,0, +0.26,0),aC).AutoButtonColor=false makeStyledButton('Torso',UDim2.new(0.43,0,0.36 +,0),UDim2.new(0.28,0,0.26,0),aC).AutoButtonColor=false makeStyledButton( +'RightLeg',UDim2.new(0.19,0,0.31,0),UDim2.new(0.275,0,0.67,0),aC). +AutoButtonColor=false makeStyledButton('LeftLeg',UDim2.new(0.19,0,0.31,0),UDim2. +new(0.525,0,0.67,0),aC).AutoButtonColor=false local aD=Instance.new'TextLabel'aD +.RobloxLocked=true aD.Name='CategoryLabel'aD.BackgroundTransparency=1 aD.Font= +Enum.Font.ArialBold aD.FontSize=Enum.FontSize.Size18 aD.Position=UDim2.new(0,0,0 +,-7)aD.Size=UDim2.new(1,0,0,20)aD.TextXAlignment=Enum.TextXAlignment.Center aD. +Text='All'aD.TextColor3=Color3.new(1,1,1)aD.Parent=ak local aE=Instance.new +'TextButton'aE.RobloxLocked=true aE.Name='SaveButton'aE.Size=UDim2.new(0.6,0,0, +50)aE.Position=UDim2.new(0.2,0,1,-50)aE.Style=Enum.ButtonStyle.RobloxButton aE. +Selected=false aE.Font=Enum.Font.ArialBold aE.FontSize=Enum.FontSize.Size18 aE. +Text='Save'aE.TextColor3=Color3.new(1,1,1)aE.Parent=ak script:Destroy() \ No newline at end of file diff --git a/processed/53878057.lua b/processed/53878057.lua index ddb1207..d39e604 100644 --- a/processed/53878057.lua +++ b/processed/53878057.lua @@ -1,1056 +1,240 @@ -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) +if game.CoreGui.Version<3 then return end local function waitForChild(a,b)while +not a:FindFirstChild(b)do a.ChildAdded:wait()end return a:FindFirstChild(b)end +local function waitForProperty(a,b)while not a[b]do a.Changed:wait()end end +local a,b,c,d=script.Parent,'gear',true,game:GetService'CoreGui':FindFirstChild +'RobloxGui'assert(d)local e=waitForChild(d,'ControlFrame')local f,g= +waitForChild(e,'BackpackButton'),waitForChild(d,'Backpack')waitForChild(d, +'CurrentLoadout')waitForChild(d.CurrentLoadout,'TempSlot')waitForChild(d. +CurrentLoadout.TempSlot,'SlotNumber')waitForChild(a,'Background')local h=a. +Background local function IsTouchDevice()local i=false pcall(function()i=Game: +GetService'UserInputService'.TouchEnabled end)return i end local function +moveHealthBar(i)waitForChild(i,'HealthGUI')waitForChild(i['HealthGUI'],'tray') +local j=i['HealthGUI']['tray']j.Position=UDim2.new(0.5,-85,1,-26)end +local function setHealthBarVisible(i,j)waitForChild(i,'HealthGUI')waitForChild(i +['HealthGUI'],'tray')local k=i['HealthGUI']['tray']k.Visible=j end waitForChild( +game,'Players')waitForProperty(game.Players,'LocalPlayer')local i=game.Players. +LocalPlayer waitForChild(i,'PlayerGui')Spawn(function()moveHealthBar(i.PlayerGui +)end)while i.Character==nil do wait(0.03)end local j=waitForChild(i.Character, +'Humanoid')j.Died:connect(function()f.Visible=false end)waitForChild(game, +'LocalBackpack')game.LocalBackpack:SetOldSchoolBackpack(false)waitForChild(a. +Parent,'Backpack')local k=a.Parent.Backpack local l=waitForChild(k, +'CoreScripts/BackpackScripts/BackpackManager')local m,n,o,p,q=waitForChild(l, +'BackpackOpenEvent'),waitForChild(l,'BackpackCloseEvent'),waitForChild(l, +'TabClickedEvent'),true,10 if d.AbsoluteSize.Y<=320 then q=4 end local r,s,t,u= +nil,nil,false,1.18 local v,w,x,y,z,A,B=UDim2.new(1*u,0,1*u,0),UDim2.new(1,0,1,0) +,true,0.5,false,{},{}for C=1,q do B[C]='empty'end local C=false local function +backpackIsOpen()if k then return k.Visible end return false end local function +kill(D,E,F)if E then E:disconnect()end if D==true and F then reorganizeLoadout(F +,false)end end function registerNumberKeys()for D=0,9 do game:GetService +'GuiService':AddKey(tostring(D))end end function unregisterNumberKeys()pcall( +function()for D=0,9 do game:GetService'GuiService':RemoveKey(tostring(D))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(D)local E=nil for F=1,#B do if B[F] +==D and D.Parent~=nil then E=F break end end if E then if B[E].GearReference. +Value then if B[E].GearReference.Value.Parent==game.Players.LocalPlayer. +Character then B[E].GearReference.Value.Parent=game.Players.LocalPlayer.Backpack +end if B[E].GearReference.Value:IsA'HopperBin'and B[E].GearReference.Value. +Active then B[E].GearReference.Value:Disable()B[E].GearReference.Value.Active= +false end end B[E]='empty'delay(0,function()D:remove()end)Spawn(function()while +backpackIsOpen()do wait(0.03)end waitForChild(i,'Backpack')local F=true for G=1, +#B do if B[G]~='empty'then F=false end end if F then if#i.Backpack:GetChildren() +<1 then f.Visible=false else f.Position=UDim2.new(0.5,-60,1,-44)end h.Visible= +false end end)end end function insertGear(D,E)local F=nil if not E then for G=1, +#B do if B[G]=='empty'then F=G break end end if F==1 and B[1]~='empty'then D: +remove()return end else F=E local G=1 for H=1,#B do if B[H]=='empty'then G=H +break end end for H=G,F+1,-1 do B[H]=B[H-1]if H==10 then B[H].SlotNumber.Text= +'0'B[H].SlotNumberDownShadow.Text='0'B[H].SlotNumberUpShadow.Text='0'else B[H]. +SlotNumber.Text=H B[H].SlotNumberDownShadow.Text=H B[H].SlotNumberUpShadow.Text= +H end end end B[F]=D if F~=q then if type(tostring(F))=='string'then local G= +tostring(F)D.SlotNumber.Text=G D.SlotNumberDownShadow.Text=G D. +SlotNumberUpShadow.Text=G end else D.SlotNumber.Text='0'D.SlotNumberDownShadow. +Text='0'D.SlotNumberUpShadow.Text='0'end D.Visible=true local G=nil G=D.Kill. +Changed:connect(function(H)kill(H,G,D)end)end function reorganizeLoadout(D,E,F,G +)if E then insertGear(D,G)else removeGear(D)end if D~='empty'then D.ZIndex=1 end +end function checkToolAncestry(D,E)if D:FindFirstChild'RobloxBuildTool'then +return end if D:IsA'Tool'or D:IsA'HopperBin'then for F=1,#B do if B[F]~='empty' +and B[F].GearReference.Value==D then if E==nil then B[F].Kill.Value=true return +false elseif D.Parent==i.Character then B[F].Selected=true return true elseif D. +Parent==i.Backpack then if D:IsA'Tool'or D:IsA'HopperBin'then B[F].Selected= +false end return true end B[F].Kill.Value=true return false end end end end +function removeAllEquippedGear(D)local E=i.Character:GetChildren()for F=1,#E do +if(E[F]:IsA'Tool'or E[F]:IsA'HopperBin')and E[F]~=D then if E[F]:IsA'Tool'then E +[F].Parent=i.Backpack end if E[F]:IsA'HopperBin'then E[F]:Disable()end end end +end function hopperBinSwitcher(D,E)if not E then return end E:ToggleSelect()if B +[D]=='empty'then return end if not E.Active then B[D].Selected=false +normalizeButton(B[D])else B[D].Selected=true enlargeButton(B[D])end end function +toolSwitcher(D)if not B[D]then return end local E=B[D].GearReference.Value if E +==nil then return end removeAllEquippedGear(E)local F=D if D==0 then F=10 end +for G=1,#B do if B[G]and B[G]~='empty'and G~=F then normalizeButton(B[G])B[G]. +Selected=false if B[G].GearReference and B[G].GearReference.Value and B[G]. +GearReference.Value:IsA'HopperBin'and B[G].GearReference.Value.Active then B[G]. +GearReference.Value:ToggleSelect()end end end if E:IsA'HopperBin'then +hopperBinSwitcher(D,E)else if E.Parent==i.Character then E.Parent=i.Backpack if +B[D]~='empty'then B[D].Selected=false normalizeButton(B[D])end else E.Parent=i. +Character B[D].Selected=true enlargeButton(B[D])end end end function +activateGear(D)local E=nil if D=='0'then E=10 else E=tonumber(D)end if E==nil +then return end if B[E]~='empty'then toolSwitcher(E)end end enlargeButton= +function(D)if D.Size.Y.Scale>1 then return end if not D.Parent then return end +if not D.Selected then return end for E=1,#B do if B[E]=='empty'then break end +if B[E]~=D then normalizeButton(B[E])end end if not x then return end if D: +FindFirstChild'Highlight'then D.Highlight.Visible=true end if D:IsA'ImageButton' +or D:IsA'TextButton'then D.ZIndex=5 local E,F=-(v.X.Scale-D.Size.X.Scale)/2,-(v. +Y.Scale-D.Size.Y.Scale)/2 D:TweenSizeAndPosition(v,UDim2.new(D.Position.X.Scale+ +E,D.Position.X.Offset,D.Position.Y.Scale+F,D.Position.Y.Offset),Enum. +EasingDirection.Out,Enum.EasingStyle.Quad,y/5,x)end end normalizeAllButtons= +function()for D=1,#B do if B[D]=='empty'then break end if B[D]~=button then +normalizeButton(B[D],0.1)end end end normalizeButton=function(D,E)if not D then +return end if D.Size.Y.Scale<=1 then return end if D.Selected then return end if +not D.Parent then return end local F=E if F==nil or type(F)~='number'then F=y/5 +end if D:FindFirstChild'Highlight'then D.Highlight.Visible=false end if D:IsA +'ImageButton'or D:IsA'TextButton'then D.ZIndex=1 local G,H=-(w.X.Scale-D.Size.X. +Scale)/2,-(w.Y.Scale-D.Size.Y.Scale)/2 D:TweenSizeAndPosition(w,UDim2.new(D. +Position.X.Scale+G,D.Position.X.Offset,D.Position.Y.Scale+H,D.Position.Y.Offset) +,Enum.EasingDirection.Out,Enum.EasingStyle.Quad,F,x)end end local D=function() +while t do wait()end end function pointInRectangle(E,F,G)if E.x>F.x and E.x<(F.x ++G.x)then if E.y>F.y and E.y<(F.y+G.y)then return true end end return false end +function swapGear(E,F)local G=F:GetChildren()if#G==1 then if G[1]:FindFirstChild +'SlotNumber'then local H,I=tonumber(G[1].SlotNumber.Text),tonumber(E.SlotNumber. +Text)if H==0 then H=10 end if I==0 then I=10 end B[H]=E B[I]=G[1]G[1].SlotNumber +.Text=E.SlotNumber.Text G[1].SlotNumberDownShadow.Text=E.SlotNumber.Text G[1]. +SlotNumberUpShadow.Text=E.SlotNumber.Text local J=string.sub(F.Name,5)E. +SlotNumber.Text=J E.SlotNumberDownShadow.Text=J E.SlotNumberUpShadow.Text=J E. +Position=UDim2.new(E.Position.X.Scale,0,E.Position.Y.Scale,0)G[1].Position=UDim2 +.new(G[1].Position.X.Scale,0,G[1].Position.Y.Scale,0)G[1].Parent=E.Parent E. +Parent=F end else local H=tonumber(E.SlotNumber.Text)if H==0 then H=10 end B[H]= +'empty'local I=string.sub(F.Name,5)E.SlotNumber.Text=I E.SlotNumberDownShadow. +Text=I E.SlotNumberUpShadow.Text=I local J=tonumber(E.SlotNumber.Text)if J==0 +then J=10 end B[J]=E E.Position=UDim2.new(E.Position.X.Scale,0,E.Position.Y. +Scale,0)E.Parent=F end end function resolveDrag(E,F,G)local H,I=Vector2.new(F,G) +,E.Parent local J=I.Parent:GetChildren()for K=1,#J do if J[K]:IsA'Frame'then if +pointInRectangle(H,J[K].AbsolutePosition,J[K].AbsoluteSize)then swapGear(E,J[K]) +return true end end end if(F(I.AbsolutePosition.x+I. +AbsoluteSize.x))or(G(I.AbsolutePosition.y+I. +AbsoluteSize.y))then reorganizeLoadout(E,false)return false else if dragBeginPos +then E.Position=dragBeginPos end return-1 end end function unequipAllItems(E)for +F=1,#B do if B[F]=='empty'then break end if B[F].GearReference.Value and B[F]. +GearReference.Value~=E then if B[F].GearReference.Value:IsA'HopperBin'then B[F]. +GearReference.Value:Disable()elseif B[F].GearReference.Value:IsA'Tool'then B[F]. +GearReference.Value.Parent=game.Players.LocalPlayer.Backpack end B[F].Selected= +false end end end function showToolTip(E,F)if E and E:FindFirstChild +'ToolTipLabel'and E.ToolTipLabel:IsA'TextLabel'and not IsTouchDevice()then E. +ToolTipLabel.Text=tostring(F)local G=E.ToolTipLabel.TextBounds.X+6 E. +ToolTipLabel.Size=UDim2.new(0,G,0,20)E.ToolTipLabel.Position=UDim2.new(0.5,-G/2, +0,-30)E.ToolTipLabel.Visible=true end end function hideToolTip(E,F)if E and E: +FindFirstChild'ToolTipLabel'and E.ToolTipLabel:IsA'TextLabel'then E.ToolTipLabel +.Visible=false end end local E=function(E,F,G,H)D()t=true if E:FindFirstChild +'RobloxBuildTool'then t=false return end if not E:IsA'Tool'then if not E:IsA +'HopperBin'then t=false return end end if not G then for I=1,#B do if B[I]~= +'empty'and B[I].GearReference.Value==E then t=false return end end end local I=a +.TempSlot:clone()I.Name=E.Name I.GearImage.Image=E.TextureId if I.GearImage. +Image==''then I.GearText.Text=E.Name end I.GearReference.Value=E I.MouseEnter: +connect(function()if I.GearReference and I.GearReference.Value['ToolTip']and I. +GearReference.Value.ToolTip~=''then showToolTip(I,I.GearReference.Value.ToolTip) +end end)I.MouseLeave:connect(function()if I.GearReference and I.GearReference. +Value['ToolTip']and I.GearReference.Value.ToolTip~=''then hideToolTip(I,I. +GearReference.Value.ToolTip)end end)I.RobloxLocked=true local J=-1 if not G then +for K=1,#B do if B[K]=='empty'then J=K break end end else J=G end if J==-1 then +t=false return end local K=J%10 local L=a:FindFirstChild('Slot'..tostring(K))I. +Parent=L if H then local M,N=H.AbsolutePosition,I.AbsolutePosition local O=M-N I +.Position=UDim2.new(I.Position.X.Scale,O.x,I.Position.Y.Scale,O.y)I.ZIndex=4 end +if G then reorganizeLoadout(I,true,F,G)else reorganizeLoadout(I,true)end if I. +Parent==nil then t=false return end if F then I.Selected=true unequipAllItems(E) +delay(y+0.01,function()if I:FindFirstChild'GearReference'and((I.GearReference. +Value:IsA'Tool'and I.GearReference.Value.Parent==i.Character)or(I.GearReference. +Value:IsA'HopperBin'and I.GearReference.Value.Active==true))then enlargeButton(I +)end end)end local M,N,O,P,Q,R,S N=I.MouseButton1Click:connect(function()if +characterInWorkspace()then if not I.Draggable then activateGear(I.SlotNumber. +Text)end end end)P=I.MouseEnter:connect(function()if k.Visible then I.Draggable= +true end end)S=I.DragBegin:connect(function(T)M=T I.ZIndex=7 local U=I: +GetChildren()for V=1,#U do if U[V]:IsA'TextLabel'then if string.find(U[V].Name, +'Shadow')then U[V].ZIndex=8 else U[V].ZIndex=9 end elseif U[V]:IsA'Frame'or U[V] +:IsA'ImageLabel'then U[V].ZIndex=7 end end end)R=I.DragStopped:connect(function( +T,U)if I.Selected then I.ZIndex=4 else I.ZIndex=3 end local V=I:GetChildren()for +W=1,#V do if V[W]:IsA'TextLabel'then if string.find(V[W].Name,'Shadow')then V[W] +.ZIndex=3 else V[W].ZIndex=4 end elseif V[W]:IsA'Frame'or V[W]:IsA'ImageLabel' +then V[W].ZIndex=2 end end resolveDrag(I,T,U)end)Q=I.MouseLeave:connect(function +()I.Draggable=false end)O=I.AncestryChanged:connect(function()if I.Parent and I. +Parent.Parent==a then return end if N then N:disconnect()end if O then O: +disconnect()end if P then P:disconnect()end if Q then Q:disconnect()end if R +then R:disconnect()end if S then S:disconnect()end end)local T,U=nil,nil T=E. +AncestryChanged:connect(function(V,W)if not checkToolAncestry(V,W)then if T then +T:disconnect()end if U then U:disconnect()end removeFromInventory(E)elseif W== +game.Players.LocalPlayer.Backpack then normalizeButton(I)end end)U=E.Changed: +connect(function(V)if V=='Name'then if I and I.GearImage.Image==''then I. +GearText.Text=E.Name end elseif V=='Active'then if E and E:IsA'HopperBin'then if +not E.Active then I.Selected=false normalizeButton(I)end end elseif V== +'TextureId'then I.GearImage.Image=E.TextureId end end)t=false Spawn(function() +while backpackIsOpen()do wait(0.03)end for V=1,#B do if B[V]~='empty'then f. +Position=UDim2.new(0.5,-60,1,-108)if c then f.Visible=true h.Visible=true end +end end end)end function addToInventory(F)if not F:IsA'Tool'or not F:IsA +'HopperBin'then return end local G=nil for H=1,#A do if A[H]and A[H]==F then +return end if not A[H]then G=H end end if G then A[G]=F elseif#A<1 then A[1]=F +else A[#A+1]=F end end function removeFromInventory(F)for G=1,#A do if A[G]==F +then table.remove(A,G)A[G]=nil end end end local F,G=function()loadoutChildren=a +:GetChildren()for F=1,#loadoutChildren do if loadoutChildren[F]:IsA'Frame'then +loadoutChildren[F].BackgroundTransparency=0.5 local G=tonumber(string.sub( +loadoutChildren[F].Name,5))if G==0 then G=10 end if d.AbsoluteSize.Y<=320 then +loadoutChildren[F]:TweenPosition(UDim2.new(0,(G-1)*60,0,0),Enum.EasingDirection. +Out,Enum.EasingStyle.Quad,0.25,true)else loadoutChildren[F]:TweenPosition(UDim2. +new((G-1)/10,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end +end end end,function()loadoutChildren=a:GetChildren()local F,G={},nil for H=1,# +loadoutChildren do if loadoutChildren[H]:IsA'Frame'then if#loadoutChildren[H]: +GetChildren()>0 then if loadoutChildren[H].Name=='Slot0'then G=loadoutChildren[H +]else table.insert(F,loadoutChildren[H])end end loadoutChildren[H]. +BackgroundTransparency=1 end end if G then table.insert(F,G)end local H=(1-(#F* +0.1))/2 for I=1,#F do if d.AbsoluteSize.Y<=320 then H=(0.5-(#F*0.333)/2)F[I]: +TweenPosition(UDim2.new(H+(I-1)*0.33,0,0,0),Enum.EasingDirection.Out,Enum. +EasingStyle.Quad,0.25,true)else F[I]:TweenPosition(UDim2.new(H+((I-1)*0.1),0,0,0 +),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end end end function +editLoadout()C=true if p then F()end end function readonlyLoadout()if not p then +G()end end function setupBackpackListener()if s then s:disconnect()s=nil end s=i +.Backpack.ChildAdded:connect(function(H)if not z then z=true if c then f.Visible +=true h.Visible=true end end E(H)addToInventory(H)end)end function +playerCharacterChildAdded(H)E(H,true)addToInventory(H)end function +activateLoadout()a.Visible=true end function deactivateLoadout()a.Visible=false +end function tabHandler(H)p=H if H then editLoadout()else readonlyLoadout()end +end function coreGuiChanged(H,I)if H==Enum.CoreGuiType.Backpack or H==Enum. +CoreGuiType.All then f.Visible=I h.Visible=I c=I if I then registerNumberKeys() +else unregisterNumberKeys()end end if H==Enum.CoreGuiType.Health or H==Enum. +CoreGuiType.All then setHealthBarVisible(game.Players.LocalPlayer.PlayerGui,I) +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))Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) +end)wait()waitForChild(i,'Backpack')waitForProperty(i,'Character')delay(1, +function()local H=i.Backpack:GetChildren()local I=math.min(10,#H)for J=1,I do if +c then f.Visible=true h.Visible=true end E(H[J],false)end setupBackpackListener( +)end)delay(2,function()if not C then if d.AbsoluteSize.Y<=320 then local H=a: +GetChildren()for I=1,#H do local J=tonumber(string.sub(H[I].Name,5,string.len(H[ +I].Name)))if type(J)=='number'then H[I].Position=UDim2.new(0,(J-1)*60,0,0)end +end end end wait(0.25)end)i.ChildAdded:connect(function(H)if H:IsA'PlayerGui' +then moveHealthBar(H)end end)waitForProperty(i,'Character')for H,I in ipairs(i. +Character:GetChildren())do playerCharacterChildAdded(I)end r=i.Character. +ChildAdded:connect(function(J)playerCharacterChildAdded(J)end)waitForChild(i. +Character,'Humanoid')humanoidDiedCon=i.Character.Humanoid.Died:connect(function( +)if humanoidDiedCon then humanoidDiedCon:disconnect()humanoidDiedCon=nil end +deactivateLoadout()if s then s:disconnect()s=nil end C=false end)i. +CharacterRemoving:connect(function()for J=1,#B do if B[J]~='empty'then B[J]. +Parent=nil B[J]='empty'end end end)i.CharacterAdded:connect(function() +waitForProperty(game.Players,'LocalPlayer')i=game.Players.LocalPlayer +waitForChild(i,'Backpack')delay(1,function()local J=i.Backpack:GetChildren() +local K=math.min(10,#J)for L=1,K do if c then f.Visible=true h.Visible=true end +E(J[L],false)end setupBackpackListener()end)activateLoadout()if r then r: +disconnect()r=nil end r=i.Character.ChildAdded:connect(function(J)E(J,true)end) +waitForChild(i.Character,'Humanoid')if g.Visible then m:Fire()end +humanoidDiedCon=i.Character.Humanoid.Died:connect(function()if c then f.Visible= +false h.Visible=false end z=false deactivateLoadout()if humanoidDiedCon then +humanoidDiedCon:disconnect()humanoidDiedCon=nil end if s then s:disconnect()s= +nil end end)waitForChild(i,'PlayerGui')moveHealthBar(i.PlayerGui)delay(2, +function()if not C then if d.AbsoluteSize.Y<=320 then local J=a:GetChildren()for +K=1,#J do local L=tonumber(string.sub(J[K].Name,5,string.len(J[K].Name)))if +type(L)=='number'then J[K].Position=UDim2.new(0,(L-1)*60,0,0)end end end end +wait(0.25)end)end)waitForChild(k,'SwapSlot')k.SwapSlot.Changed:connect(function( +)if k.SwapSlot.Value then local J=k.SwapSlot local K=J.Slot.Value if K==0 then K +=10 end if B[K]then reorganizeLoadout(B[K],false)end if J.GearButton.Value then +E(J.GearButton.Value.GearReference.Value,false,K)end k.SwapSlot.Value=false end +end)game:GetService'GuiService'.KeyPressed:connect(function(J)if +characterInWorkspace()then activateGear(J)end end)m.Event:connect(editLoadout)n. +Event:connect(G)o.Event:connect(function(J)tabHandler(J==b)end) \ No newline at end of file diff --git a/processed/60595411.lua b/processed/60595411.lua index 7faa3bb..47a45ea 100644 --- a/processed/60595411.lua +++ b/processed/60595411.lua @@ -1,731 +1,163 @@ -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 +local a,b,c={},assert,{buffer={}}function c:New()local d={}setmetatable(d,self) +self.__index=self d.buffer={}return d end function c:Append(d)self.buffer[#self. +buffer+1]=d end function c:ToString()return table.concat(self.buffer)end local d +={backslashes={['\b']='\\b',['\t']='\\t',['\n']='\\n',['\f']='\\f',['\r']='\\r', +['"']='\\"',['\\']='\\\\',['/']='\\/'}}function d:New()local e={}e.writer=c:New( +)setmetatable(e,self)self.__index=self return e end function d:Append(e)self. +writer:Append(e)end function d:ToString()return self.writer:ToString()end +function d:Write(e)local f=type(e)if f=='nil'then self:WriteNil()elseif f== +'boolean'or f=='number'then self:WriteString(e)elseif f=='string'then self: +ParseString(e)elseif f=='table'then self:WriteTable(e)elseif f=='function'then +self:WriteFunction(e)elseif f=='thread'or f=='userdata'then self:WriteError(e) +end end function d:WriteNil()self:Append'null'end function d:WriteString(e)self: +Append(tostring(e))end function d:ParseString(e)self:Append'"'self:Append(string +.gsub(e,'[%z%c\\"/]',function(f)local g=self.backslashes[f]if g then return g +end return string.format('\\u%.4X',string.byte(f))end))self:Append'"'end +function d:IsArray(e)local f,g=0,function(f)if type(f)=='number'and f>0 then if +math.floor(f)==f then return true end end return false end for h,i in pairs(e)do +if not g(h)then return false,'{','}'else f=math.max(f,h)end end return true,'[', +']',f end function d:WriteTable(e)local f,g,h,i=self:IsArray(e)self:Append(g)if +f then for j=1,i do self:Write(e[j])if j0 then z=v[1]['part']A=v[1]['box']table.remove(v,1)A.Visible=true else z=w: +Clone()z.Archivable=false A=x:Clone()A.Archivable=false A.Adornee=z A.Parent=p A +.Adornee=z A.Parent=p end if y then A.Color=y end return z,A end function +cleanUpAdornments()for y,z in pairs(u)do if z.KeepAlive~=r then z.SelectionBox. +Visible=false table.insert(v,{part=z.SelectionPart,box=z.SelectionBox})u[y]=nil +end end end function incrementAliveCounter()s=s+1 if s>1000000 then s=0 end +return s end function adornFullCellsInRegion(y,z)local A,B=y.CFrame.p-(y.Size/2) ++Vector3.new(2,2,2),y.CFrame.p+(y.Size/2)-Vector3.new(2,2,2)local C,D=m(k,A),m(k +,B)r=incrementAliveCounter()for E=C.y,D.y do for F=C.z,D.z do for G=C.x,D.x do +local H=l(k,G,E,F)if H~=o then local I,J,K=n(k,G,E,F),Vector3int16.new(G,E,F), +false for L,M in pairs(u)do if L==J then M.KeepAlive=r if z then M.SelectionBox. +Color=z end K=true break end end if not K then local N,O=createAdornment(z)N. +Size=Vector3.new(4,4,4)N.CFrame=CFrame.new(I)local P={SelectionPart=N, +SelectionBox=O,KeepAlive=r}u[J]=P end end end end end cleanUpAdornments()end t=g +if i then local y,z=createAdornment(h)y.Size=g.Size y.CFrame=g.CFrame u. +SelectionPart=y u.SelectionBox=z q=function(A,B)if A and A~=t then t=A y.Size=A. +Size y.CFrame=A.CFrame end if B then z.Color=B end end else +adornFullCellsInRegion(g,h)q=function(y,z)if y and y~=t then t=y +adornFullCellsInRegion(y,z)end end end local y=function()q=nil if p then p: +Destroy()end u=nil end return q,y end function a.CreateSignal()local g,h,i={}, +Instance.new'BindableEvent',{}function g:connect(j)if self~=g then error( +'connect must be called with `:`, not `.`',2)end if type(j)~='function'then +error('Argument #1 of connect must be a function, got a '..type(j),2)end local k +=h.Event:connect(j)i[k]=true local l={}function l:disconnect()k:disconnect()i[k] +=nil end l.Disconnect=l.disconnect return l end function g:disconnect()if self~= +g then error('disconnect must be called with `:`, not `.`',2)end for j,k in +pairs(i)do j:disconnect()i[j]=nil end end function g:wait()if self~=g then +error('wait must be called with `:`, not `.`',2)end return h.Event:wait()end +function g:fire(...)if self~=g then error( +'fire must be called with `:`, not `.`',2)end h:Fire(...)end g.Connect=g.connect +g.Disconnect=g.disconnect g.Wait=g.wait g.Fire=g.fire return g end +local function Create_PrivImpl(g)if type(g)~='string'then error( +'Argument of Create must be a string',2)end return function(h)h=h or{}local i,j, +k=Instance.new(g),nil,nil for l,m in pairs(h)do if type(l)=='string'then if l== +'Parent'then j=m else i[l]=m end elseif type(l)=='number'then if type(m)~= +'userdata'then error( +[[Bad entry in Create body: Numeric keys must be paired with children, got a: ]] +..type(m),2)end m.Parent=i elseif type(l)=='table'and l.__eventname then if +type(m)~='function'then error("Bad entry in Create body: Key `[Create.E'"..l. +__eventname.."']` must have a function value, got: "..tostring(m),2)end i[l. +__eventname]:connect(m)elseif l==a.Create then if type(m)~='function'then error( +[[Bad entry in Create body: Key `[Create]` should be paired with a constructor function, got: ]] +..tostring(m),2)elseif k then error( +[[Bad entry in Create body: Only one constructor function is allowed]],2)end k=m +else error('Bad entry ('..tostring(l)..' => '..tostring(m)..') in Create body',2 +)end end if k then k(i)end if j then i.Parent=j end return i end end a.Create= +setmetatable({},{__call=function(g,...)return Create_PrivImpl(...)end})a.Create. +E=function(g)return{__eventname=g}end a.Help=function(g)if g=='DecodeJSON'or g== +a.DecodeJSON then return +[[Function DecodeJSON. Arguments: (string). Side effect: returns a table with all parsed JSON values]] +end if g=='EncodeJSON'or g==a.EncodeJSON then return +[[Function EncodeJSON. Arguments: (table). Side effect: returns a string composed of argument table in JSON data format]] +end if g=='MakeWedge'or g==a.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 g=='SelectTerrainRegion'or g==a.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 g=='CreateSignal'or g==a.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 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').]] +end if g=='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 g=='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 g=='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 g=='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 g=='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 return a \ No newline at end of file diff --git a/processed/60595695.lua b/processed/60595695.lua index fe34147..cbccc0d 100644 --- a/processed/60595695.lua +++ b/processed/60595695.lua @@ -1,22 +1,7 @@ -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 +local a,b,c=3569749,game:GetService'ScriptContext',0 while not b and c<3 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 \ No newline at end of file diff --git a/processed/73157242.lua b/processed/73157242.lua index 8a6fce3..6721612 100644 --- a/processed/73157242.lua +++ b/processed/73157242.lua @@ -1,1945 +1,519 @@ -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 +local a={}function PlaneIntersection(b)local c,d=false,game.Workspace. +CurrentCamera local e,f,g,h=Vector3.new(d.CoordinateFrame.p.X,d.CoordinateFrame. +p.Y,d.CoordinateFrame.p.Z),Vector3.new(b.X,b.Y,b.Z),Vector3.new(0,1,0),Vector3. +new(0,0,0)local i,j=g:Dot(f-e),b if i~=0 then local k=g:Dot(h-e)/i if k>=0 and k +<=1 then local l=((f-e)*k)+e j=game.Workspace.Terrain:WorldToCell(l)c=true end +end return j,c end function GetTerrainForMouse(b)local c,d=game.Workspace. +Terrain:WorldToCellPreferSolid(Vector3.new(b.hit.x,b.hit.y,b.hit.z)),nil if 0== +game.Workspace.Terrain:GetCell(c.X,c.Y,c.Z).Value then c=nil d,hit= +PlaneIntersection(Vector3.new(b.hit.x,b.hit.y,b.hit.z))if hit then c=d end end +return c end local b=Vector3.new(0.3,0.3,0.3)local function +rotatePartAndChildren(c,d,e)if c:IsA'BasePart'then c.CFrame=(d*(c.CFrame-e))+e +end local f=c:GetChildren()for g=1,#f do rotatePartAndChildren(f[g],d,e)end end +local function modelRotate(c,d)local e,f=CFrame.Angles(0,d,0),c:GetModelCFrame() +.p rotatePartAndChildren(c,e,f)end local function collectParts(c,d,e,f)if c:IsA +'BasePart'then d[#d+1]=c elseif c:IsA'Script'then e[#e+1]=c elseif c:IsA'Decal' +then f[#f+1]=c end for g,h in pairs(c:GetChildren())do collectParts(h,d,e,f)end +end local function clusterPartsInRegion(c,d)local e=game.Workspace: +FindFirstChild'Terrain'local f,g=e:WorldToCell(c),e:WorldToCell(d)local h,i,j,k, +l,m=f.X,f.Y,f.Z,g.X,g.Y,g.Z if he.MaxExtents.Max.X then k=e.MaxExtents.Max. +X end if l>e.MaxExtents.Max.Y then l=e.MaxExtents.Max.Y end if m>e.MaxExtents. +Max.Z then m=e.MaxExtents.Max.Z end for n=h,k do for o=i,l do for p=j,m do if e: +GetCell(n,o,p).Value>0 then return true end end end end return false end +local function findSeatsInModel(c,d)if not c then return end if c.className== +'Seat'or c.className=='VehicleSeat'then table.insert(d,c)end local e=c: +GetChildren()for f=1,#e do findSeatsInModel(e[f],d)end end local function +setSeatEnabledStatus(c,d)local e={}findSeatsInModel(c,e)if d then for f=1,#e do +local g=e[f]:FindFirstChild'SeatWeld'while g do g:Remove()g=e[f]:FindFirstChild +'SeatWeld'end end else for f=1,#e do local g=Instance.new'Weld'g.Name='SeatWeld' +g.Parent=e[f]end end end local function autoAlignToFace(c)local d=c: +FindFirstChild'AutoAlignToFace'if d then return d.Value else return false end +end local function getClosestAlignedWorldDirection(c)local d,e,f=Vector3.new(1,0 +,0),Vector3.new(0,1,0),Vector3.new(0,0,1)local g,h,i=c.x*d.x+c.y*d.y+c.z*d.z,c.x +*e.x+c.y*e.y+c.z*e.z,c.x*f.x+c.y*f.y+c.z*f.z if math.abs(g)>math.abs(h)and math. +abs(g)>math.abs(i)then if g>0 then return 0 else return 3 end elseif math.abs(h) +>math.abs(g)and math.abs(h)>math.abs(i)then if h>0 then return 1 else return 4 +end else if i>0 then return 2 else return 5 end end end local function +positionPartsAtCFrame3(c,d)local e=nil if not d then return d end if d and(d:IsA +'Model'or d:IsA'Tool')then e=d:GetModelCFrame()d:TranslateBy(c.p-e.p)else d. +CFrame=c end return d end local function calcRayHitTime(c,d,e)if math.abs(d)< +0.01 then return 0 end return(e-c)/d end local function modelTargetSurface(c,d,e +)if not c then return 0 end local f,g=nil,nil if c:IsA'Model'then f=c: +GetModelCFrame()g=c:GetModelSize()else f=c.CFrame g=c.Size end local h,i=f: +pointToObjectSpace(d),f:pointToObjectSpace(e)local j,k,l,m=i-h,1,1,1 if j.X>0 +then k=-1 end if j.Y>0 then l=-1 end if j.Z>0 then m=-1 end local n,o,p,q= +calcRayHitTime(h.X,j.X,g.X/2*k),calcRayHitTime(h.Y,j.Y,g.Y/2*l),calcRayHitTime(h +.Z,j.Z,g.Z/2*m),0 if n>o then if n>p then q=1*k else q=3*m end else if o>p then +q=2*l else q=3*m end end return q end local function getBoundingBox2(c)local d,e +=Vector3.new(math.huge,math.huge,math.huge),Vector3.new(-math.huge,-math.huge,- +math.huge)if c:IsA'Terrain'then d=Vector3.new(-2,-2,-2)e=Vector3.new(2,2,2) +elseif c:IsA'BasePart'then d=-0.5*c.Size e=-d else e=c:GetModelSize()*0.5 d=-e +end local f=c:FindFirstChild'Justification'if f~=nil then local g,h,i=f.Value, +Vector3.new(2,2,2),e-d-Vector3.new(0.01,0.01,0.01)local j=Vector3.new(4*math. +ceil(i.x/4),4*math.ceil(i.y/4),4*math.ceil(i.z/4))local k=j-i d=d-0.5*k*g e=e+ +0.5*k*(h-g)end return d,e end local function getBoundingBoxInWorldCoordinates(c) +local d,e=Vector3.new(math.huge,math.huge,math.huge),Vector3.new(-math.huge,- +math.huge,-math.huge)if c:IsA'BasePart'and not c:IsA'Terrain'then local f,g=c. +CFrame:pointToWorldSpace(-0.5*c.Size),c.CFrame:pointToWorldSpace(0.5*c.Size)d= +Vector3.new(math.min(f.X,g.X),math.min(f.Y,g.Y),math.min(f.Z,g.Z))e=Vector3.new( +math.max(f.X,g.X),math.max(f.Y,g.Y),math.max(f.Z,g.Z))elseif not c:IsA'Terrain' +then local f,g=c:GetModelCFrame():pointToWorldSpace(-0.5*c:GetModelSize()),c: +GetModelCFrame():pointToWorldSpace(0.5*c:GetModelSize())d=Vector3.new(math.min(f +.X,g.X),math.min(f.Y,g.Y),math.min(f.Z,g.Z))e=Vector3.new(math.max(f.X,g.X),math +.max(f.Y,g.Y),math.max(f.Z,g.Z))end return d,e end local function +getTargetPartBoundingBox(c)if c.Parent:FindFirstChild'RobloxModel'~=nil then +return getBoundingBox2(c.Parent)else return getBoundingBox2(c)end end +local function getMouseTargetCFrame(c)if c.Parent:FindFirstChild'RobloxModel'~= +nil then if c.Parent:IsA'Tool'then return c.Parent.Handle.CFrame else return c. +Parent:GetModelCFrame()end else return c.CFrame end end local function isBlocker +(c)if not c then return false end if not c.Parent then return false end if c: +FindFirstChild'Humanoid'then return false end if c:FindFirstChild'RobloxStamper' +or c:FindFirstChild'RobloxModel'then return true end if c:IsA'Part'and not c. +CanCollide then return false end if c==game.Lighting then return false end +return isBlocker(c.Parent)end local function spaceAboveCharacter(c,d,e)local f= +game.Workspace:FindPartsInRegion3(Region3.new(Vector3.new(c.Position.X,d,c. +Position.Z)-Vector3.new(0.75,2.75,0.75),Vector3.new(c.Position.X,d,c.Position.Z) ++Vector3.new(0.75,1.75,0.75)),c.Parent,100)for g=1,#f do if f[g].CanCollide and +not f[g]:IsDescendantOf(e.CurrentParts)then return false end end if +clusterPartsInRegion(Vector3.new(c.Position.X,d,c.Position.Z)-Vector3.new(0.75, +2.75,0.75),Vector3.new(c.Position.X,d,c.Position.Z)+Vector3.new(0.75,1.75,0.75)) +then return false end return true end local function findConfigAtMouseTarget(c,d +)if not c then return nil end if not d then error +'findConfigAtMouseTarget: stampData is nil'return nil end if not d[ +'CurrentParts']then return nil end local e,f,g,h,i=4,false,CFrame.new(0,0,0), +getBoundingBox2(d.CurrentParts)local j,k=i-h,nil if d.CurrentParts:IsA'Model'or +d.CurrentParts:IsA'Tool'then k=d.CurrentParts:GetModelCFrame()else k=d. +CurrentParts.CFrame end if c then if d.CurrentParts:IsA'Tool'then c.TargetFilter +=d.CurrentParts.Handle else c.TargetFilter=d.CurrentParts end end local l,m= +false,nil local n=pcall(function()m=c.Target end)if not n then return f,g end +local o=Vector3.new(0,0,0)if c then o=Vector3.new(c.Hit.x,c.Hit.y,c.Hit.z)end +local p=nil if nil==m then p=GetTerrainForMouse(c)if nil==p then l=false return +f,g else m=game.Workspace.Terrain l=true p=Vector3.new(p.X-1,p.Y,p.Z)o=game. +Workspace.Terrain:CellCenterToWorld(p.x,p.y,p.z)end end local q,r= +getTargetPartBoundingBox(m)local s,t=r-q,getMouseTargetCFrame(m)if m:IsA +'Terrain'then if not cluster then cluster=game.Workspace:FindFirstChild'Terrain' +end local u=cluster:WorldToCellPreferSolid(o)if l then u=p end t=CFrame.new(game +.Workspace.Terrain:CellCenterToWorld(u.x,u.y,u.z))end local u,v=t: +pointToObjectSpace(o),Vector3.new(0,0,0)if c then v=m.CFrame:vectorToWorldSpace( +Vector3.FromNormalId(c.TargetSurface))end local w,x,y if +getClosestAlignedWorldDirection(v)==0 then w=t:vectorToObjectSpace(Vector3.new(1 +,-1,1))x=k:vectorToObjectSpace(Vector3.new(-1,-1,1))y=Vector3.new(0,1,1)elseif +getClosestAlignedWorldDirection(v)==3 then w=t:vectorToObjectSpace(Vector3.new(- +1,-1,-1))x=k:vectorToObjectSpace(Vector3.new(1,-1,-1))y=Vector3.new(0,1,1)elseif +getClosestAlignedWorldDirection(v)==1 then w=t:vectorToObjectSpace(Vector3.new(- +1,1,1))x=k:vectorToObjectSpace(Vector3.new(-1,-1,1))y=Vector3.new(1,0,1)elseif +getClosestAlignedWorldDirection(v)==4 then w=t:vectorToObjectSpace(Vector3.new(- +1,-1,1))x=k:vectorToObjectSpace(Vector3.new(-1,1,1))y=Vector3.new(1,0,1)elseif +getClosestAlignedWorldDirection(v)==2 then w=t:vectorToObjectSpace(Vector3.new(- +1,-1,1))x=k:vectorToObjectSpace(Vector3.new(-1,-1,-1))y=Vector3.new(1,1,0)else w +=t:vectorToObjectSpace(Vector3.new(1,-1,-1))x=k:vectorToObjectSpace(Vector3.new( +1,-1,1))y=Vector3.new(1,1,0)end w=w*(0.5*s)+0.5*(r+q)x=x*(0.5*j)+0.5*(i+h)local +z=u-w local A=Vector3.new(e*math.modf(z.x/e),e*math.modf(z.y/e),e*math.modf(z.z/ +e))A=A*y local B=A+w local C,D=t:pointToWorldSpace(B),k:vectorToWorldSpace(x) +local E,F,G,H,I,J,K,L,M,N,O,P,Q=C-D,k:components()g=CFrame.new(E.x,E.y,E.z,I,J,K +,L,M,N,O,P,Q)f=true return f,g,getClosestAlignedWorldDirection(v)end +local function truncateToCircleEighth(c,d)local e,f=math.abs(c),math.abs(d)local +g=math.sqrt(e*e+f*f)local h,i,j=f/g,1,1 if c<0 then i=-1 end if d<0 then j=-1 +end if h>0.382683432 then return 0.707106781*g*i,0.707106781*g*j else return g*i +,0 end end local function saveTheWelds(c,d,e)if c:IsA'ManualWeld'or c:IsA +'Rotate'then table.insert(d,c)table.insert(e,c.Parent)else local f=c: +GetChildren()for g=1,#f do saveTheWelds(f[g],d,e)end end end local function +restoreTheWelds(c,d)for e=1,#c do c[e].Parent=d[e]end end a.CanEditRegion= +function(c,d)if not d then return true,false end local e,f= +getBoundingBoxInWorldCoordinates(c)if e.Xd.CFrame.p.X+d.Size.X/2 or f.Y>d.CFrame.p.Y+d.Size.Y/2 or f.Z>d.CFrame.p. +Z+d.Size.Z/2 then return false,false end return true,false end a.GetStampModel= +function(c,d,e)if c==0 then return nil,'No Asset'end if c<0 then return nil, +'Negative Asset'end local function UnlockInstances(f)if f:IsA'BasePart'then f. +Locked=false end for g,h in pairs(f:GetChildren())do UnlockInstances(h)end end +local function getClosestColorToTerrainMaterial(f)if f==1 then return BrickColor +.new'Bright green'elseif f==2 then return BrickColor.new'Bright yellow'elseif f +==3 then return BrickColor.new'Bright red'elseif f==4 then return BrickColor.new +'Sand red'elseif f==5 then return BrickColor.new'Black'elseif f==6 then return +BrickColor.new'Dark stone grey'elseif f==7 then return BrickColor.new'Sand blue' +elseif f==8 then return BrickColor.new'Deep orange'elseif f==9 then return +BrickColor.new'Dark orange'elseif f==10 then return BrickColor.new +'Reddish brown'elseif f==11 then return BrickColor.new'Light orange'elseif f==12 +then return BrickColor.new'Light stone grey'elseif f==13 then return BrickColor. +new'Sand green'elseif f==14 then return BrickColor.new'Medium stone grey'elseif +f==15 then return BrickColor.new'Really red'elseif f==16 then return BrickColor. +new'Really blue'elseif f==17 then return BrickColor.new'Bright blue'else return +BrickColor.new'Bright green'end end local function setupFakeTerrainPart(f,g,h) +local i=nil if g==1 or g==4 then i=Instance.new'WedgePart'i.formFactor='Custom' +elseif g==2 then i=Instance.new'CornerWedgePart'else i=Instance.new'Part'i. +formFactor='Custom'end i.Name='MegaClusterCube'i.Size=Vector3.new(4,4,4)i. +BottomSurface='Smooth'i.TopSurface='Smooth'i.BrickColor= +getClosestColorToTerrainMaterial(f)local j,k=0,math.pi if g==4 then j=-math.pi/2 +end if g==2 or g==3 then k=0 end i.CFrame=CFrame.Angles(0,math.pi/2*h+k,j)if g== +3 then local l=Instance.new'SpecialMesh'l.MeshType='FileMesh'l.MeshId= +'http://www.roblox.com/asset?id=66832495'l.Scale=Vector3.new(2,2,2)l.Parent=i +end local l=Instance.new'Vector3Value'l.Value=Vector3.new(f,g,h)l.Name= +'ClusterMaterial'l.Parent=i return i end local f,g,h=nil,nil,true if e then g= +coroutine.create(function()f=game:GetService'InsertService':LoadAssetVersion(c)h +=false end)coroutine.resume(g)else g=coroutine.create(function()f=game: +GetService'InsertService':LoadAsset(c)h=false end)coroutine.resume(g)end local i +,j,k=0,0,8 while h and j=k +then return nil,'Load Time Fail'end if f==nil then return nil,'Load Asset Fail' +end if not f:IsA'Model'then return nil,'Load Type Fail'end local l=f: +GetChildren()if#l==0 then return nil,'Empty Model Fail'end UnlockInstances(f)f=f +:GetChildren()[1]for m,n in pairs(l)do if n:IsA'Team'then n.Parent=game: +GetService'Teams'elseif n:IsA'Sky'then local o=game:GetService'Lighting'for p,q +in pairs(o:GetChildren())do if q:IsA'Sky'then q:Remove()end end n.Parent=o +return end end if f:FindFirstChild'RobloxModel'==nil then local o=Instance.new +'BoolValue'o.Name='RobloxModel'o.Parent=f if f:FindFirstChild'RobloxStamper'== +nil then local p=Instance.new'BoolValue'p.Name='RobloxStamper'p.Parent=f end end +if d then if f.Name=='MegaClusterCube'then if d==6 then local o=Instance.new +'BoolValue'o.Name='AutoWedge'o.Parent=f else local o=f:FindFirstChild +'ClusterMaterial'if o then if o:IsA'Vector3Value'then f=setupFakeTerrainPart(o. +Value.X,d,o.Value.Z)else f=setupFakeTerrainPart(o.Value,d,0)end else f= +setupFakeTerrainPart(1,d,0)end end end end return f end a.SetupStamperDragger= +function(c,d,e,f,g)if not c then error +[[SetupStamperDragger: modelToStamp (first arg) is nil! Should be a stamper model]] +return nil end if not c:IsA'Model'and not c:IsA'BasePart'then error +[[SetupStamperDragger: modelToStamp (first arg) is neither a Model or Part!]] +return nil end if not d then error +[[SetupStamperDragger: Mouse (second arg) is nil! Should be a mouse object]] +return nil end if not d:IsA'Mouse'then error +[[SetupStamperDragger: Mouse (second arg) is not of type Mouse!]]return nil end +local h,i,j=nil,nil,nil if e then if not e:IsA'Model'then error +[[SetupStamperDragger: StampInModel (optional third arg) is not of type 'Model']] +return nil end if not f then error +[[SetupStamperDragger: AllowedStampRegion (optional fourth arg) is nil when StampInModel (optional third arg) is defined]] +return nil end j=g h=e i=f end local k,l,m,n=0,nil,nil,Instance.new +'SelectionBox'n.Color=BrickColor.new'Bright red'n.Transparency=0 n.Archivable= +false local o=Instance.new'Part'o.Parent=nil o.formFactor='Custom'o.Size=Vector3 +.new(4,4,4)o.CFrame=CFrame.new()o.Archivable=false local p=Instance.new +'SelectionBox'p.Color=BrickColor.new'Toothpaste'p.Adornee=o p.Visible=true p. +Transparency=0 p.Name='HighScalabilityStamperLine'p.Archivable=false local q={}q +.Start=nil q.End=nil q.Adorn=p q.AdornPart=o q.InternalLine=nil q.NewHint=true q +.MorePoints={nil,nil}q.MoreLines={nil,nil}q.Dimensions=1 local r,s,t,u,v,w,x={}, +false,false,false,{},nil,Instance.new'BoolValue'x.Archivable=false x.Value=false +local y={}y.TerrainOrientation=0 y.CFrame=0 local z={}z.Material=1 z.clusterType +=0 z.clusterOrientation=0 local function isMegaClusterPart()if not l then return +false end if not l.CurrentParts then return false end return(l.CurrentParts: +FindFirstChild('ClusterMaterial',true)or(l.CurrentParts.Name=='MegaClusterCube') +)end local function DoHighScalabilityRegionSelect()local A=l.CurrentParts: +FindFirstChild'MegaClusterCube'if not A then if not l.CurrentParts.Name== +'MegaClusterCube'then return else A=l.CurrentParts end end q.End=A.CFrame.p +local B,C,D=nil,Vector3.new(0,0,0),Vector3.new(0,0,0)if q.Dimensions==1 then B=( +q.End-q.Start)if math.abs(B.X)math.abs(B.Z)then E,H=truncateToCircleEighth(B.Y +,B.Z)else H,E=truncateToCircleEighth(B.Z,B.Y)end B=Vector3.new(0,E,H)else local +E,H=truncateToCircleEighth(B.Y,B.X)B=Vector3.new(H,E,0)end else if math.abs(B.Y) +math.abs(B.Z)then E,H= +truncateToCircleEighth(B.X,B.Z)else H,E=truncateToCircleEighth(B.Z,B.X)end B= +Vector3.new(E,0,H)else local E,H=truncateToCircleEighth(B.X,B.Y)B=Vector3.new(E, +H,0)end end q.InternalLine=B elseif q.Dimensions==2 then B=q.MoreLines[1]C=q.End +-q.MorePoints[1]C=C-B.unit*B.unit:Dot(C)tempCFrame=CFrame.new(q.Start,q.Start+B) +local E,H=tempCFrame:vectorToWorldSpace(Vector3.new(0,1,0)),tempCFrame: +vectorToWorldSpace(Vector3.new(1,0,0))local I,J=H:Dot(C),E:Dot(C)if math.abs(J)> +math.abs(I)then C=C-H*I else C=C-E*J end q.InternalLine=C elseif q.Dimensions==3 +then B=q.MoreLines[1]C=q.MoreLines[2]D=q.End-q.MorePoints[2]D=D-B.unit*B.unit: +Dot(D)D=D-C.unit*C.unit:Dot(D)q.InternalLine=D end tempCFrame=CFrame.new(q.Start +,q.Start+B)if q.Dimensions==1 then q.AdornPart.Size=Vector3.new(4,4,B.magnitude+ +4)q.AdornPart.CFrame=tempCFrame+tempCFrame:vectorToWorldSpace(Vector3.new(2,2,2) +-q.AdornPart.Size/2)else local E=tempCFrame:vectorToObjectSpace(B+C+D)q. +AdornPart.Size=Vector3.new(4,4,4)+Vector3.new(math.abs(E.X),math.abs(E.Y),math. +abs(E.Z))q.AdornPart.CFrame=tempCFrame+tempCFrame:vectorToWorldSpace(E/2)end +local E=nil if game.Players['LocalPlayer']then E=game.Players.LocalPlayer: +FindFirstChild'PlayerGui'if E and E:IsA'PlayerGui'then if(q.Dimensions==1 and B. +magnitude>3)or q.Dimensions>1 then q.Adorn.Parent=E end end end if E==nil then E +=game:GetService'CoreGui'if(q.Dimensions==1 and B.magnitude>3)or q.Dimensions>1 +then q.Adorn.Parent=E end end end local function DoStamperMouseMove(A)if not A +then error'Error: RbxStamper.DoStamperMouseMove: Mouse is nil'return end if not +A:IsA'Mouse'then error('Error: RbxStamper.DoStamperMouseMove: Mouse is of type', +A.className,'should be of type Mouse')return end if not A.Target then local B= +GetTerrainForMouse(A)if nil==B then return end end if not l then return end +configFound,targetCFrame,targetSurface=findConfigAtMouseTarget(A,l)if not +configFound then error'RbxStamper.DoStamperMouseMove No configFound, returning' +return end local B=0 if autoAlignToFace(l.CurrentParts)and targetSurface~=1 and +targetSurface~=4 then if targetSurface==3 then B=0-k+autoAlignToFace(l. +CurrentParts)elseif targetSurface==0 then B=2-k+autoAlignToFace(l.CurrentParts) +elseif targetSurface==5 then B=3-k+autoAlignToFace(l.CurrentParts)elseif +targetSurface==2 then B=1-k+autoAlignToFace(l.CurrentParts)end end local C=math. +pi/2 k=k+B if l.CurrentParts:IsA'Model'or l.CurrentParts:IsA'Tool'then +modelRotate(l.CurrentParts,C*B)else l.CurrentParts.CFrame=CFrame. +fromEulerAnglesXYZ(0,C*B,0)*l.CurrentParts.CFrame end local D,E= +getBoundingBoxInWorldCoordinates(l.CurrentParts)local H=nil if l.CurrentParts: +IsA'Model'then H=l.CurrentParts:GetModelCFrame()else H=l.CurrentParts.CFrame end +D=D+targetCFrame.p-H.p E=E+targetCFrame.p-H.p if clusterPartsInRegion(D+b,E-b) +then if y.CFrame then if l.CurrentParts:FindFirstChild('ClusterMaterial',true) +then local I=l.CurrentParts:FindFirstChild('ClusterMaterial',true)if I:IsA +'Vector3Value'then local J=l.CurrentParts:FindFirstChild('ClusterMaterial',true) +if J then J=clusterMat end end end end return end if isMegaClusterPart()then +local I=game.Workspace.Terrain:WorldToCell(targetCFrame.p)local J,K,L,M,N,O,P,Q, +R,S,T,U,V=game.Workspace.Terrain:CellCenterToWorld(I.X,I.Y,I.Z),targetCFrame: +components()targetCFrame=CFrame.new(J.X,J.Y,J.Z,N,O,P,Q,R,S,T,U,V)end +positionPartsAtCFrame3(targetCFrame,l.CurrentParts)y.CFrame=targetCFrame if l. +CurrentParts:FindFirstChild('ClusterMaterial',true)then local I=l.CurrentParts: +FindFirstChild('ClusterMaterial',true)if I:IsA'Vector3Value'then y. +TerrainOrientation=I.Value.Z end end if A and A.Target and A.Target.Parent then +local I=A.Target:FindFirstChild'RobloxModel'if not I then I=A.Target.Parent: +FindFirstChild'RobloxModel'end local J=l.CurrentParts:FindFirstChild +'UnstampableFaces'do local M,N='',''if I and I.Parent:FindFirstChild +'UnstampableFaces'then M=I.Parent.UnstampableFaces.Value end if J then N=J.Value +end local O=0 if I then O=modelTargetSurface(I.Parent,game.Workspace. +CurrentCamera.CoordinateFrame.p,A.Hit.p)end for P in string.gmatch(M,'[^,]+')do +if O==tonumber(P)then u=true game.JointsService:ClearJoinAfterMoveJoints()return +end end O=modelTargetSurface(l.CurrentParts,A.Hit.p,game.Workspace.CurrentCamera +.CoordinateFrame.p)for Q in string.gmatch(N,'[^,]+')do if O==tonumber(Q)then u= +true game.JointsService:ClearJoinAfterMoveJoints()return end end end end u=false +game.JointsService:SetJoinAfterMoveInstance(l.CurrentParts)if not pcall(function +()if A and A.Target and A.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()A=nil return end if A and A.Target and A +.Target.Parent:FindFirstChild'RobloxModel'==nil then game.JointsService: +SetJoinAfterMoveTarget(A.Target)else game.JointsService:SetJoinAfterMoveTarget( +nil)end game.JointsService:ShowPermissibleJoints()if isMegaClusterPart()and q +and q.Start then DoHighScalabilityRegionSelect()end end local function +setupKeyListener(A,B)if r and r['Paused']then return end A=string.lower(A)if A== +'r'and not autoAlignToFace(l.CurrentParts)then k=k+1 local C=l.CurrentParts: +FindFirstChild('ClusterMaterial',true)if C and C:IsA'Vector3Value'then C.Value= +Vector3.new(C.Value.X,C.Value.Y,(C.Value.Z+1)%4)end local D=math.pi/2 if l. +CurrentParts:IsA'Model'or l.CurrentParts:IsA'Tool'then modelRotate(l. +CurrentParts,D)else l.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,D,0)*l. +CurrentParts.CFrame end configFound,targetCFrame=findConfigAtMouseTarget(B,l)if +configFound then positionPartsAtCFrame3(targetCFrame,l.CurrentParts) +DoStamperMouseMove(B)end elseif A=='c'then if q.InternalLine and q.InternalLine. +magnitude>0 and q.Dimensions<3 then q.MorePoints[q.Dimensions]=q.End q.MoreLines +[q.Dimensions]=q.InternalLine q.Dimensions=q.Dimensions+1 q.NewHint=true end end +end w=d.KeyDown:connect(function(A)setupKeyListener(A,d)end)local function +resetHighScalabilityLine()if q then q.Start=nil q.End=nil q.InternalLine=nil q. +NewHint=true end end local function flashRedBox()local A=game.CoreGui if game: +FindFirstChild'Players'then if game.Players['LocalPlayer']then if game.Players. +LocalPlayer:FindFirstChild'PlayerGui'then A=game.Players.LocalPlayer.PlayerGui +end end end if not l['ErrorBox']then return end l.ErrorBox.Parent=A if l. +CurrentParts:IsA'Tool'then l.ErrorBox.Adornee=l.CurrentParts.Handle else l. +ErrorBox.Adornee=l.CurrentParts end delay(0,function()for B=1,3 do if l[ +'ErrorBox']then l.ErrorBox.Visible=true end wait(0.13)if l['ErrorBox']then l. +ErrorBox.Visible=false end wait(0.13)end if l['ErrorBox']then l.ErrorBox.Adornee +=nil l.ErrorBox.Parent=Tool end end)end local function DoStamperMouseDown(A)if +not A then error'Error: RbxStamper.DoStamperMouseDown: Mouse is nil'return end +if not A:IsA'Mouse'then error( +'Error: RbxStamper.DoStamperMouseDown: Mouse is of type',A.className, +'should be of type Mouse')return end if not l then return end if +isMegaClusterPart()then if A and q then local B,C=l.CurrentParts:FindFirstChild( +'MegaClusterCube',true),game.Workspace.Terrain if B then q.Dimensions=1 local D= +C:WorldToCell(B.CFrame.p)q.Start=C:CellCenterToWorld(D.X,D.Y,D.Z)return else q. +Dimensions=1 local D=C:WorldToCell(l.CurrentParts.CFrame.p)q.Start=C: +CellCenterToWorld(D.X,D.Y,D.Z)return end end end end local function +loadSurfaceTypes(A,B)A.TopSurface=B[1]A.BottomSurface=B[2]A.LeftSurface=B[3]A. +RightSurface=B[4]A.FrontSurface=B[5]A.BackSurface=B[6]end local function +saveSurfaceTypes(A,B)local C={}C[1]=A.TopSurface C[2]=A.BottomSurface C[3]=A. +LeftSurface C[4]=A.RightSurface C[5]=A.FrontSurface C[6]=A.BackSurface B[A]=C +end local function prepareModel(A)if not A then return nil end local B,C,D,E,H,I +=0.7,1,A:Clone(),{},{},{}l={}l.DisabledScripts={}l.TransparencyTable={}l. +MaterialTable={}l.CanCollideTable={}l.AnchoredTable={}l.ArchivableTable={}l. +DecalTransparencyTable={}l.SurfaceTypeTable={}collectParts(D,H,E,I)if#H<=0 then +return nil,'no parts found in modelToStamp'end for J,M in pairs(E)do if not M. +Disabled then M.Disabled=true l.DisabledScripts[#l.DisabledScripts+1]=M end end +for N,O in pairs(H)do l.TransparencyTable[O]=O.Transparency O.Transparency=C+(1- +C)*O.Transparency l.MaterialTable[O]=O.Material O.Material=Enum.Material.Plastic +l.CanCollideTable[O]=O.CanCollide O.CanCollide=false l.AnchoredTable[O]=O. +Anchored O.Anchored=true l.ArchivableTable[O]=O.Archivable O.Archivable=false +saveSurfaceTypes(O,l.SurfaceTypeTable)local Q,R=0.5,0.5 delay(0,function()wait(Q +)local S=tick()local T=S while(T-S)B do local U=1-(((T-S)/R)*(C-B))if l['TransparencyTable']and l. +TransparencyTable[O]then O.Transparency=U+(1-U)*l.TransparencyTable[O]end wait( +0.03)T=tick()end if O and O:IsA'BasePart'then if l['TransparencyTable']and l. +TransparencyTable[O]then O.Transparency=B+(1-B)*l.TransparencyTable[O]end end +end)end for Q,R in pairs(I)do l.DecalTransparencyTable[R]=R.Transparency R. +Transparency=B+(1-B)*R.Transparency end setSeatEnabledStatus(D,true) +setSeatEnabledStatus(D,false)l.CurrentParts=D if autoAlignToFace(D)then l. +CurrentParts:ResetOrientationToIdentity()k=0 else local S=k*math.pi/2 if l. +CurrentParts:IsA'Model'or l.CurrentParts:IsA'Tool'then modelRotate(l. +CurrentParts,S)else l.CurrentParts.CFrame=CFrame.fromEulerAnglesXYZ(0,S,0)*l. +CurrentParts.CFrame end end local S=l.CurrentParts:FindFirstChild( +'ClusterMaterial',true)if S and S:IsA'Vector3Value'then S.Value=Vector3.new(S. +Value.X,S.Value.Y,(S.Value.Z+k)%4)end local T,U=findConfigAtMouseTarget(d,l)if T +then l.CurrentParts=positionPartsAtCFrame3(U,l.CurrentParts)end game. +JointsService:SetJoinAfterMoveInstance(l.CurrentParts)return D,H end +local function checkTerrainBlockCollisions(A,B)local C=game.Workspace.Terrain. +CellCenterToWorld local D=C(game.Workspace.Terrain,A.X,A.Y,A.Z)local E,H=game. +Workspace:FindPartsInRegion3(Region3.new(D-Vector3.new(2,2,2)+b,D+Vector3.new(2, +2,2)-b),l.CurrentParts,100),false for I=1,#E do if isBlocker(E[I])then H=true +break end end if not H then local I={}for M=1,#E do if E[M].Parent and not I[E[M +].Parent]and E[M].Parent:FindFirstChild'Humanoid'and E[M].Parent:FindFirstChild +'Humanoid':IsA'Humanoid'then local O=E[M].Parent:FindFirstChild'Torso'I[E[M]. +Parent]=true if O then local Q=D.Y+5 if spaceAboveCharacter(O,Q,l)then O.CFrame= +O.CFrame+Vector3.new(0,Q-O.CFrame.p.Y,0)else H=true break end end end end end if +not H then local I=true if B then if i then local M=C(game.Workspace.Terrain,A.X +,A.Y,A.Z)if(M.X+2>i.CFrame.p.X+i.Size.X/2)or(M.X-2i.CFrame.p.Y+i.Size.Y/2)or(M.Y-2i.CFrame.p +.Z+i.Size.Z/2)or(M.Z-21)or(D and D.magnitude>0))then local R,S,T,U,V,W,X,Y= +game.Workspace.Terrain:WorldToCell(q.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 q.Dimensions>1 then table.insert(Y, +q.MoreLines[1])end if D and D.magnitude>0 then table.insert(Y,D)end if q. +Dimensions>2 then table.insert(Y,q.MoreLines[2])end for Z=1,#Y do Y[Z]=Vector3. +new(math.floor(Y[Z].X+0.5),math.floor(Y[Z].Y+0.5),math.floor(Y[Z].Z+0.5))if Y[Z] +.X>0 then S[Z]=1 elseif Y[Z].X<0 then S[Z]=-1 end if Y[Z].Y>0 then T[Z]=1 elseif +Y[Z].Y<0 then T[Z]=-1 end if Y[Z].Z>0 then U[Z]=1 elseif Y[Z].Z<0 then U[Z]=-1 +end V[Z]=Vector3.new(S[Z],T[Z],U[Z])if V[Z].magnitude<0.9 then V[Z]=nil end end +if not Y[2]then Y[2]=Vector3.new(0,0,0)end if not Y[3]then Y[3]=Vector3.new(0,0, +0)end local Z,_=l.CurrentParts:FindFirstChild('WaterForceTag',true),l. +CurrentParts:FindFirstChild('WaterForceDirectionTag',true)while W[3].magnitude*4 +<=Y[3].magnitude do local aa=1 while aa<4 do W[2]=Vector3.new(0,0,0)while W[2]. +magnitude*4<=Y[2].magnitude do local ab=1 while ab<4 do W[1]=Vector3.new(0,0,0) +while W[1].magnitude*4<=Y[1].magnitude do local ac=W[1]+W[2]+W[3]local ad= +Vector3int16.new(R.X+ac.X,R.Y+ac.Y,R.Z+ac.Z)if ad.X>=H.X and ad.Y>=H.Y and ad.Z +>=H.Z and ad.XY[2].magnitude +then ab=4 end end end if V[3]then while aa<4 and X[aa]:Dot(V[3])==0 do aa=aa+1 +end if aa<4 then W[3]=W[3]+X[aa]*X[aa]:Dot(V[3])end aa=aa+1 else W[3]=Vector3. +new(1,0,0)aa=4 end if W[3].magnitude*4>Y[3].magnitude then aa=4 end end end end +q.Start=nil q.Adorn.Parent=nil if B then l.CurrentParts.Parent=nil pcall( +function()game:GetService'ChangeHistoryService':SetWaypoint'StamperMulti'end)end +return B end local function DoStamperMouseUp(aa)if not aa then error +'Error: RbxStamper.DoStamperMouseUp: Mouse is nil'return false end if not aa:IsA +'Mouse'then error('Error: RbxStamper.DoStamperMouseUp: Mouse is of type',aa. +className,'should be of type Mouse')return false end if not l.Dragger then error +[[Error: RbxStamper.DoStamperMouseUp: stampData.Dragger is nil]]return false end +if not q then return false end local ab=nil if h then local ac,ad=nil, +isMegaClusterPart()if ad and q and q.Start and q.InternalLine and q.InternalLine +.magnitude>0 then ac=true ab=true else ac,ab=a.CanEditRegion(l.CurrentParts,i) +end if not ac then if j then j()end return false end end if u then flashRedBox() +return false end canStamp,ab=a.CanEditRegion(l.CurrentParts,i)if not canStamp +then if j then j()end return false end local ac,ad= +getBoundingBoxInWorldCoordinates(l.CurrentParts)configFound,targetCFrame= +findConfigAtMouseTarget(aa,l)if configFound and not q.Adorn.Parent then if +clusterPartsInRegion(ac+b,ad-b)then flashRedBox()return false end local ae=game. +Workspace:FindPartsInRegion3(Region3.new(ac+b,ad-b),l.CurrentParts,100)for A=1,# +ae do if isBlocker(ae[A])then flashRedBox()return false end end local A={}for B= +1,#ae do if ae[B].Parent and not A[ae[B].Parent]and ae[B].Parent:FindFirstChild +'Humanoid'and ae[B].Parent:FindFirstChild'Humanoid':IsA'Humanoid'then local C=ae +[B].Parent:FindFirstChild'Torso'A[ae[B].Parent]=true if C then local D=ad.Y+3 if +spaceAboveCharacter(C,D,l)then C.CFrame=C.CFrame+Vector3.new(0,D-C.CFrame.p.Y,0) +else flashRedBox()return false end end end end elseif(not configFound)and not(q. +Start and q.Adorn.Parent)then resetHighScalabilityLine()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 A +=ae:FindFirstChild'StampTracker'if A and not A.Value then A.Value=true end end +end end if q.Start and q.Adorn.Parent and isMegaClusterPart()then if +ResolveMegaClusterStamp(ab)or ab then l.CurrentParts.Parent=nil return true end +end q.Start=nil q.Adorn.Parent=nil local ae=game.Workspace.Terrain if +isMegaClusterPart()then local A if l.CurrentParts:IsA'Model'then A=ae: +WorldToCell(l.CurrentParts:GetModelCFrame().p)else A=ae:WorldToCell(l. +CurrentParts.CFrame.p)end local B,C=game.Workspace.Terrain.MaxExtents.Max,game. +Workspace.Terrain.MaxExtents.Min if checkTerrainBlockCollisions(A,false)then +local D,E,H=l.CurrentParts:FindFirstChild('ClusterMaterial',true),l.CurrentParts +:FindFirstChild('WaterForceTag',true),l.CurrentParts:FindFirstChild( +'WaterForceDirectionTag',true)if A.X>=C.X and A.Y>=C.Y and A.Z>=C.Z and A.Xmath.abs(Q.Y)then if math.abs(Q.X)>math. +abs(Q.Z)then if Q.X>0 then M.RightSurface='Unjoinable'else M.LeftSurface= +'Unjoinable'end else if Q.Z>0 then M.BackSurface='Unjoinable'else M.FrontSurface +='Unjoinable'end end else if math.abs(Q.Y)>math.abs(Q.Z)then if Q.Y>0 then M. +TopSurface='Unjoinable'else M.BottomSurface='Unjoinable'end else if Q.Z>0 then M +.BackSurface='Unjoinable'else M.FrontSurface='Unjoinable'end end end end end +local function resumeStamper()clone,parts=prepareModel(c)if not clone or not +parts then return end local aa=clone:FindFirstChild('UnjoinableFaces',true)if aa +then for ab in string.gmatch(aa.Value,'[^,]*')do if tonumber(ab)then if clone: +IsA'Model'then prepareUnjoinableSurfaces(clone:GetModelCFrame(),parts,tonumber( +ab))else prepareUnjoinableSurfaces(clone.CFrame,parts,tonumber(ab))end end end +end l.ErrorBox=n if h then clone.Parent=h else clone.Parent=game.Workspace end +if clone:FindFirstChild('ClusterMaterial',true)then clusterMaterial=clone: +FindFirstChild('ClusterMaterial',true)if clusterMaterial:IsA'Vector3Value'then z +.Material=clusterMaterial.Value.X z.clusterType=clusterMaterial.Value.Y z. +clusterOrientation=clusterMaterial.Value.Z elseif clusterMaterial:IsA'IntValue' +then z.Material=clusterMaterial.Value end end pcall(function()m=d.Target end)if +m and m.Parent:FindFirstChild'RobloxModel'==nil then game.JointsService: +SetJoinAfterMoveTarget(m)else game.JointsService:SetJoinAfterMoveTarget(nil)end +game.JointsService:ShowPermissibleJoints()for ab,ac in pairs(l.DisabledScripts) +do if ac.Name=='GhostRemovalScript'then ac.Parent=l.CurrentParts end end l. +Dragger=Instance.new'Dragger'l.Dragger:MouseDown(parts[1],Vector3.new(0,0,0), +parts)l.Dragger:MouseUp()DoStamperMouseMove(d)table.insert(v,d.Move:connect( +function()if s or t then return end s=true DoStamperMouseMove(d)s=false end)) +table.insert(v,d.Button1Down:connect(function()DoStamperMouseDown(d)end))table. +insert(v,d.Button1Up:connect(function()t=true while s do wait()end x.Value= +DoStamperMouseUp(d)resetHighScalabilityLine()t=false end))x.Value=false end +local function resetStamperState(aa)if aa then if not aa:IsA'Model'and not aa: +IsA'BasePart'then error +[[resetStamperState: newModelToStamp (first arg) is not nil, but not a model or part!]] +end c=aa end pauseStamper()resumeStamper()end resetStamperState()r.Stamped=x r. +Paused=false r.LoadNewModel=function(aa)if aa and not aa:IsA'Model'and not aa: +IsA'BasePart'then error +[[Control.LoadNewModel: newStampModel (first arg) is not a Model or Part!]] +return nil end resetStamperState(aa)end r.ReloadModel=function() +resetStamperState()end r.Pause=function()if not r.Paused then pauseStamper()r. +Paused=true else print +[[RbxStamper Warning: Tried to call Control.Pause() when already paused]]end end +r.Resume=function()if r.Paused then resumeStamper()r.Paused=false else print +[[RbxStamper Warning: Tried to call Control.Resume() without Pausing First]]end +end r.ResetRotation=function()end r.Destroy=function()for aa=1,#v do v[aa]: +disconnect()v[aa]=nil end if w then w:disconnect()end game.JointsService: +ClearJoinAfterMoveJoints()if p then p:Destroy()end if o then o:Destroy()end if n +then n:Destroy()end if l then if l['Dragger']then l.Dragger:Destroy()end if l. +CurrentParts then l.CurrentParts:Destroy()end end if r and r['Stamped']then r. +Stamped:Destroy()end r=nil end return r end a.Help=function(aa)if aa== +'GetStampModel'or aa==a.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 aa=='SetupStamperDragger'or aa==a.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 a \ No newline at end of file diff --git a/processed/89449008.lua b/processed/89449008.lua index 64677bc..32c7a4c 100644 --- a/processed/89449008.lua +++ b/processed/89449008.lua @@ -1,864 +1,189 @@ -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() +local function waitForChild(a,b)assert(a)assert(b)while not a:FindFirstChild(b) +do print('Waiting for ...',a,b)a.ChildAdded:wait()end return a:FindFirstChild(b) +end local function waitForProperty(a,b)assert(a)assert(b)while not a[b]do a. +Changed:wait()end end local function IsTouchDevice()local a=false pcall(function +()a=Game:GetService'UserInputService'.TouchEnabled end)return a end +waitForChild(game,'Players')waitForProperty(game.Players,'LocalPlayer')local a,b +,c=game.Players.LocalPlayer,LoadLibrary'RbxGui'if not b then print +'could not find RbxGui!'return end local d,e,f,g,h,i,j,k,l,m,n,o='gear',script. +Parent,{},{},false,false,{},{},nil,nil,nil,waitForChild(a,'Backpack') +waitForChild(e,'Tabs')waitForChild(e,'Gear')local p,q,r,s=waitForChild(e.Gear, +'GearPreview'),waitForChild(e.Gear,'GearGridScrollingArea'),waitForChild(e. +Parent,'CurrentLoadout'),waitForChild(e.Gear,'GearGrid')local t,u,v= +waitForChild(s,'GearButton'),waitForChild(script.Parent,'SwapSlot'), +waitForChild(script.Parent,'CoreScripts/BackpackScripts/BackpackManager')local w +,x,y,z,A,B,C,D,E,F=waitForChild(v,'BackpackOpenEvent'),waitForChild(v, +'BackpackCloseEvent'),waitForChild(v,'TabClickedEvent'),waitForChild(v, +'ResizeEvent'),waitForChild(v,'SearchRequestedEvent'),waitForChild(v, +'BackpackReady'),b.CreateScrollingFrame(nil,'grid',Vector2.new(6,6))C.Position= +UDim2.new(0,0,0,30)C.Size=UDim2.new(1,0,1,-30)C.Parent=e.Gear.GearGrid local G= +Instance.new'Frame'G.Name='ScrollBar'G.BackgroundTransparency=0.9 G. +BackgroundColor3=Color3.new(1,1,1)G.BorderSizePixel=0 G.Size=UDim2.new(0,17,1,- +36)G.Position=UDim2.new(0,0,0,18)G.Parent=q E.Position=UDim2.new(0,0,1,-17)D. +Parent=q E.Parent=q local H,I,J,K=b.CreateScrollingFrame()H.Position=UDim2.new(0 +,0,0,0)H.Size=UDim2.new(1,0,1,0)H.Parent=e.Gear.GearLoadouts.LoadoutsList local +L=Instance.new'TextButton'L.RobloxLocked=true L.Name='LoadoutButton'L.Font=Enum. +Font.ArialBold L.FontSize=Enum.FontSize.Size14 L.Position=UDim2.new(0,0,0,0)L. +Size=UDim2.new(1,0,0,32)L.Style=Enum.ButtonStyle.RobloxButton L.Text= +'Loadout #1'L.TextColor3=Color3.new(1,1,1)L.Parent=H local M=L:clone()M.Text= +'Loadout #2'M.Parent=H local N=L:clone()N.Text='Loadout #3'N.Parent=H local O=L: +clone()O.Text='Loadout #4'O.Parent=H local P=Instance.new'Frame'P.Name= +'ScrollBarLoadout'P.BackgroundTransparency=0.9 P.BackgroundColor3=Color3.new(1,1 +,1)P.BorderSizePixel=0 P.Size=UDim2.new(0,17,1,-36)P.Position=UDim2.new(0,0,0,18 +)P.Parent=e.Gear.GearLoadouts.GearLoadoutsScrollingArea J.Position=UDim2.new(0,0 +,1,-17)I.Parent=e.Gear.GearLoadouts.GearLoadoutsScrollingArea J.Parent=e.Gear. +GearLoadouts.GearLoadoutsScrollingArea function removeFromMap(Q,R)for S=1,#Q do +if Q[S]==R then table.remove(Q,S)break end end end function robloxLock(Q)Q. +RobloxLocked=true children=Q:GetChildren()if children then for R,S in ipairs( +children)do robloxLock(S)end end end function resize()local Q=0 if p. +AbsoluteSize.Y>p.AbsoluteSize.X then Q=p.AbsoluteSize.X*0.75 else Q=p. +AbsoluteSize.Y*0.75 end waitForChild(p,'GearImage')p.GearImage.Size=UDim2.new(0, +Q,0,Q)p.GearImage.Position=UDim2.new(0,p.AbsoluteSize.X/2-Q/2,0.75,-Q) +resizeGrid()end function addToGrid(Q)if not Q:IsA'Tool'then if not Q:IsA +'HopperBin'then return end end if Q:FindFirstChild'RobloxBuildTool'then return +end for R,S in pairs(f)do if S==Q then return end end table.insert(f,Q)local T,U +=Q.Changed:connect(function(T)if T=='Name'then if g[Q]then if g[Q].Image==''then +g[Q].GearText.Text=Q.Name end end end end),nil U=Q.AncestryChanged:connect( +function(V,W)local X=nil for Y,Z in pairs(f)do if Z==Q then X=Z break end end +waitForProperty(a,'Character')waitForChild(a,'Backpack')if Q.Parent~=a.Backpack +and Q.Parent~=a.Character then if U then U:disconnect()end if T then T: +disconnect()end for _,aa in pairs(f)do if aa==X then if j[g[aa]]then j[g[aa]]: +disconnect()end if k[g[aa]]then k[g[aa]]:disconnect()end g[aa].Parent=nil g[aa]= +nil break end end removeFromMap(f,X)resizeGrid()else resizeGrid()end +updateGridActive()end)resizeGrid()end function buttonClick(aa)if aa: +FindFirstChild'UnequipContextMenu'and not aa.Active then aa.UnequipContextMenu. +Visible=true i=true end end function previewGear(aa)if not i then p.Visible= +false p.GearImage.Image=aa.Image p.GearStats.GearName.Text=aa.GearReference. +Value.Name end end function findEmptySlot()local aa,Q=nil,r:GetChildren()for R=1 +,#Q do if Q[R]:IsA'Frame'and#Q[R]:GetChildren()<=0 then local S=tonumber(string. +sub(Q[R].Name,5))if S==0 then S=10 end if not aa or(aa>S)then aa=S end end end +if aa==10 then aa=0 end return aa end function checkForSwap(aa,Q,R)local S=r: +GetChildren()for T=1,#S do if S[T]:IsA'Frame'and string.find(S[T].Name,'Slot') +then if Q>=S[T].AbsolutePosition.x and Q<=(S[T].AbsolutePosition.x+S[T]. +AbsoluteSize.x)then if R>=S[T].AbsolutePosition.y and R<=(S[T].AbsolutePosition. +y+S[T].AbsoluteSize.y)then local U=tonumber(string.sub(S[T].Name,5)) +swapGearSlot(U,aa)return true end end end end return false end function +resizeGrid()for aa,Q in pairs(f)do if not Q:FindFirstChild'RobloxBuildTool'then +if not g[Q]then local R=t:clone()R.Parent=s.ScrollingFrame R.Visible=true R. +Image=Q.TextureId if R.Image==''then R.GearText.Text=Q.Name end R.GearReference. +Value=Q R.Draggable=true g[Q]=R if not IsTouchDevice()then local S= +getGearContextMenu()S.Visible=false S.Parent=R end local S=nil R.DragBegin: +connect(function(T)waitForChild(R,'Background')R['Background'].ZIndex=10 R. +ZIndex=10 S=T end)R.DragStopped:connect(function(T,U)waitForChild(R,'Background' +)R['Background'].ZIndex=1 R.ZIndex=2 if S~=R.Position then if not checkForSwap(R +,T,U)then R:TweenPosition(S,Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.5, +true)R.Draggable=false delay(0.5,function()R.Draggable=true end)else R.Position= +S end end end)local T=tick()j[R]=R.MouseEnter:connect(function()previewGear(R) +end)k[R]=R.MouseButton1Click:connect(function()local U=tick()if R.Active and(U-T +)<0.5 then local W=findEmptySlot()if W then R.ZIndex=1 swapGearSlot(W,R)end else +buttonClick(R)end T=U end)end end end F()end function showPartialGrid(aa)for Q,R +in pairs(g)do R.Parent=nil end if aa then for S,T in pairs(aa)do T.Parent=s. +ScrollingFrame end end F()end function showEntireGrid()for aa,Q in pairs(g)do Q. +Parent=s.ScrollingFrame end F()end function inLoadout(aa)local Q=r:GetChildren() +for R=1,#Q do if Q[R]:IsA'Frame'then local S=Q[R]:GetChildren()if#S>0 then if S[ +1].GearReference.Value and S[1].GearReference.Value==aa then return true end end +end end return false end function updateGridActive()for aa,Q in pairs(f)do if g[ +Q]then local R,S=nil,g[Q]:FindFirstChild'GearReference'if S then R=S.Value end +if(not R)or inLoadout(R)then g[Q].Active=false else g[Q].Active=true end end end +end function centerGear(aa)local Q,R={},nil for S=1,#aa do if aa[S]:IsA'Frame' +and#aa[S]:GetChildren()>0 then if aa[S].Name=='Slot0'then R=aa[S]else table. +insert(Q,aa[S])end end end if R then table.insert(Q,R)end local S=(1-(#Q*0.1))/2 +for T=1,#Q do Q[T]:TweenPosition(UDim2.new(S+((T-1)*0.1),0,0,0),Enum. +EasingDirection.Out,Enum.EasingStyle.Quad,0.25,true)end end function +tabClickHandler(aa)if aa==d then backpackOpenHandler(aa)else +backpackCloseHandler(aa)end end function backpackOpenHandler(aa)if aa and aa~=d +then e.Gear.Visible=false return end e.Gear.Visible=true updateGridActive() +resizeGrid()resize()B:Invoke()end function backpackCloseHandler(aa)if aa and aa +~=d then e.Gear.Visible=false return end e.Gear.Visible=false resizeGrid() +resize()B:Invoke()end function loadoutCheck(aa,Q)if not aa:IsA'ImageButton'then +return end for R,S in pairs(f)do if g[S]then if aa:FindFirstChild'GearReference' +and g[S]:FindFirstChild'GearReference'then if g[S].GearReference.Value==aa. +GearReference.Value then g[S].Active=Q break end end end end end function +clearPreview()p.GearImage.Image=''p.GearStats.GearName.Text=''end function +unequipGear(aa)aa.Parent=o updateGridActive()end function highlight(aa)aa. +TextColor3=Color3.new(0,0,0)aa.BackgroundColor3=Color3.new(0.8,0.8,0.8)end +function clearHighlight(aa)aa.TextColor3=Color3.new(1,1,1)aa.BackgroundColor3= +Color3.new(0,0,0)end function swapGearSlot(aa,Q)if not u.Value then u.Slot.Value +=aa u.GearButton.Value=Q u.Value=true updateGridActive()end end local aa= +function(aa,Q)if type(aa.Action)~='number'then return end local R=aa.Action if R +==1 then unequipGear(Q.Parent.GearReference.Value)local S=Q.Parent local T,U,W=S +.GearReference.Value,r:GetChildren(),-1 for X=1,#U do if U[X]:IsA'Frame'then +local Y=U[X]:GetChildren()if Y[1]and Y[1].GearReference.Value==T then W=Y[1]. +SlotNumber.Text break end end end swapGearSlot(W,nil)end end function +setupCharacterConnections()if n then n:disconnect()end n=game.Players. +LocalPlayer.Backpack.ChildAdded:connect(function(Q)addToGrid(Q)end)local Q=game. +Players.LocalPlayer.Backpack:GetChildren()for R=1,#Q do addToGrid(Q[R])end if l +then l:disconnect()end l=game.Players.LocalPlayer.Character.ChildAdded:connect( +function(R)addToGrid(R)updateGridActive()end)if m then m:disconnect()end m=game. +Players.LocalPlayer.Character.ChildRemoved:connect(function(R)updateGridActive() +end)wait()centerGear(r:GetChildren())end function removeCharacterConnections()if +l then l:disconnect()end if m then m:disconnect()end if n then n:disconnect()end +end function trim(Q)return(Q:gsub('^%s*(.-)%s*$','%1'))end function filterGear(Q +)local R={}for S,T in pairs(f)do if g[T]then local U=string.lower(g[T]. +GearReference.Value.Name)U=trim(U)for W=1,#Q do if string.match(U,Q[W])then +table.insert(R,g[T])break end end end end return R end function +splitByWhitespace(Q)if type(Q)~='string'then return nil end local R={}for S in +string.gmatch(Q,'[^%s]+')do if string.len(S)>0 then table.insert(R,S)end end +return R end function showSearchGear(Q)if not e.Gear.Visible then return end +local R,S=splitByWhitespace(Q),nil if R and(#R>0)then S=R else S=nil end if R== +nil then showEntireGrid()return end local T=filterGear(S)showPartialGrid(T)end +function nukeBackpack()while#g>0 do table.remove(g)end g={}while#f>0 do table. +remove(f)end f={}local Q=s.ScrollingFrame:GetChildren()for R=1,#Q do Q[R]: +remove()end end function getGearContextMenu()local Q=Instance.new'Frame'Q.Active +=true Q.Name='UnequipContextMenu'Q.Size=UDim2.new(0,115,0,70)Q.Position=UDim2. +new(0,-16,0,-16)Q.BackgroundTransparency=1 Q.Visible=false local R=Instance.new +'TextButton'R.Name='UnequipContextMenuButton'R.Text=''R.Style=Enum.ButtonStyle. +RobloxButtonDefault R.ZIndex=8 R.Size=UDim2.new(1,0,1,-20)R.Visible=true R. +Parent=Q local S,T,U=12,{},{'Remove Hotkey'}for W=1,#U do local X={}X.Type= +'Button'X.Text=U[W]X.Action=W X.DoIt=aa table.insert(T,X)end for W,X in ipairs(T +)do local Y=X if Y.Type=='Button'then local Z=Instance.new'TextButton'Z.Name= +'UnequipContextButton'..W Z.BackgroundColor3=Color3.new(0,0,0)Z.BorderSizePixel= +0 Z.TextXAlignment=Enum.TextXAlignment.Left Z.Text=' '..X.Text Z.Font=Enum.Font. +Arial Z.FontSize=Enum.FontSize.Size14 Z.Size=UDim2.new(1,8,0,S)Z.Position=UDim2. +new(0,0,0,S*W)Z.TextColor3=Color3.new(1,1,1)Z.ZIndex=9 Z.Parent=R if not +IsTouchDevice()then Z.MouseButton1Click:connect(function()if Z.Active and not Q. +Parent.Active then pcall(function()Y.DoIt(Y,Q)end)i=false Q.Visible=false +clearHighlight(Z)clearPreview()end end)Z.MouseEnter:connect(function()if Z. +Active and Q.Parent.Active then highlight(Z)end end)Z.MouseLeave:connect( +function()if Z.Active and Q.Parent.Active then clearHighlight(Z)end end)end X. +Button=Z X.Element=Z elseif Y.Type=='Label'then local Z=Instance.new'Frame'Z. +Name='ContextLabel'..W Z.BackgroundTransparency=1 Z.Size=UDim2.new(1,8,0,S)local +_=Instance.new'TextLabel'_.Name='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 _.Parent=Z Y.Label1=_ if Y.GetText2 then _=Instance.new +'TextLabel'_.Name='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=Z Y. +Label2=_ end Z.Parent=R Y.Label=Z Y.Element=Z end end Q.ZIndex=4 Q.MouseLeave: +connect(function()i=false Q.Visible=false clearPreview()end)robloxLock(Q)return +Q end function coreGuiChanged(Q,R)if Q==Enum.CoreGuiType.Backpack or Q==Enum. +CoreGuiType.All then if not R then e.Gear.Visible=false end end end local Q=a. +Backpack:GetChildren()for R=1,#Q do addToGrid(Q[R])end z.Event:connect(function( +R)if h then return end h=true wait()resize()resizeGrid()h=false end)r.ChildAdded +:connect(function(R)loadoutCheck(R,false)end)r.ChildRemoved:connect(function(R) +loadoutCheck(R,true)end)r.DescendantAdded:connect(function(R)if not e.Visible +and(R:IsA'ImageButton'or R:IsA'TextButton')then centerGear(r:GetChildren())end +end)r.DescendantRemoving:connect(function(R)if not e.Visible and(R:IsA +'ImageButton'or R:IsA'TextButton')then wait()centerGear(r:GetChildren())end end) +s.MouseEnter:connect(function()clearPreview()end)s.MouseLeave:connect(function() +clearPreview()end)a.CharacterRemoving:connect(function() +removeCharacterConnections()nukeBackpack()end)a.CharacterAdded:connect(function( +)setupCharacterConnections()end)a.ChildAdded:connect(function(R)if R:IsA +'Backpack'then o=R if n then n:disconnect()end n=game.Players.LocalPlayer. +Backpack.ChildAdded:connect(function(S)addToGrid(S)end)end end)u.Changed: +connect(function()if not u.Value then updateGridActive()end end)local R=r: +GetChildren()for S=1,#R do if R[S]:IsA'Frame'and string.find(R[S].Name,'Slot') +then R[S].ChildRemoved:connect(function()updateGridActive()end)R[S].ChildAdded: +connect(function()updateGridActive()end)end end pcall(function()coreGuiChanged( +Enum.CoreGuiType.Backpack,Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType. +Backpack))Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)end) +resize()resizeGrid()local S=r:GetChildren()for T=1,#S do loadoutCheck(S[T],false +)end if not e.Visible then centerGear(r:GetChildren())end if l==nil and game. +Players.LocalPlayer['Character']then setupCharacterConnections()end if not n +then n=game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(T) +addToGrid(T)end)end w.Event:connect(backpackOpenHandler)x.Event:connect( +backpackCloseHandler)y.Event:connect(tabClickHandler)A.Event:connect( +showSearchGear)K() \ No newline at end of file diff --git a/processed/89449093.lua b/processed/89449093.lua index a46002f..cd9ad76 100644 --- a/processed/89449093.lua +++ b/processed/89449093.lua @@ -1,390 +1,97 @@ -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 +if game.CoreGui.Version<7 then return end local function waitForChild(a,b)while +not a:FindFirstChild(b)do a.ChildAdded:wait()end return a:FindFirstChild(b)end +local function waitForProperty(a,b)while not a[b]do a.Changed:wait()end end +waitForChild(game,'Players')if#game.Players:GetChildren()<1 then game.Players. +ChildAdded:wait()end waitForProperty(game.Players,'LocalPlayer')local a=script. +Parent waitForChild(a,'Gear')local b=script.Parent.Parent assert(b:IsA +'ScreenGui')waitForChild(a,'Tabs')waitForChild(a.Tabs,'CloseButton')local c=a. +Tabs.CloseButton waitForChild(a.Tabs,'InventoryButton')local d,e=a.Tabs. +InventoryButton,nil if game.CoreGui.Version>=8 then waitForChild(a.Tabs, +'WardrobeButton')e=a.Tabs.WardrobeButton end waitForChild(a.Parent, +'ControlFrame')local f,g,h=waitForChild(a.Parent.ControlFrame,'BackpackButton'), +'gear',waitForChild(a,'SearchFrame')waitForChild(a.SearchFrame,'SearchBoxFrame') +local i,j,k,l=waitForChild(a.SearchFrame.SearchBoxFrame,'SearchBox'), +waitForChild(a.SearchFrame,'SearchButton'),waitForChild(a.SearchFrame, +'ResetButton'),waitForChild(Game.CoreGui,'RobloxGui')local m=waitForChild(l, +'CurrentLoadout')local n,o,p,q,r,s,t,u,v,w,x,y=waitForChild(m,'Background'),true +,true,false,true,false,nil,0.25,'Search...','~','`',UDim2.new(0,600,0,400)if l. +AbsoluteSize.Y<=320 then y=UDim2.new(0,200,0,140)end function createPublicEvent( +z)assert(z,'eventName is nil')assert(tostring(z),'eventName is not a string') +local A=Instance.new'BindableEvent'A.Name=tostring(z)A.Parent=script return A +end function createPublicFunction(z,A)assert(z,'funcName is nil')assert( +tostring(z),'funcName is not a string')assert(A,'invokeFunc is nil')assert(type( +A)=='function',"invokeFunc should be of type 'function'")local B=Instance.new +'BindableFunction'B.Name=tostring(z)B.OnInvoke=A B.Parent=script return B end +local z,A,B,C,D=createPublicEvent'ResizeEvent',createPublicEvent +'BackpackOpenEvent',createPublicEvent'BackpackCloseEvent',createPublicEvent +'TabClickedEvent',createPublicEvent'SearchRequestedEvent'function +deactivateBackpack()a.Visible=false r=false end function +initHumanoidDiedConnections()if t then t:disconnect()end waitForProperty(game. +Players.LocalPlayer,'Character')waitForChild(game.Players.LocalPlayer.Character, +'Humanoid')t=game.Players.LocalPlayer.Character.Humanoid.Died:connect( +deactivateBackpack)end function activateBackpack()initHumanoidDiedConnections()r +=true a.Visible=q if q then toggleBackpack()end end local E=function()q=false p= +false f.Selected=false resetSearch()B:Fire(g)a.Tabs.Visible=false h.Visible= +false a:TweenSizeAndPosition(UDim2.new(0,y.X.Offset,0,0),UDim2.new(0.5,-y.X. +Offset/2,1,-85),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,u,true,function() +game.GuiService:RemoveCenterDialog(a)a.Visible=false f.Selected=false end)delay( +u,function()game.GuiService:RemoveCenterDialog(a)a.Visible=false f.Selected= +false p=true o=true end)end function showBackpack()game.GuiService: +AddCenterDialog(a,Enum.CenterDialogType.PlayerInitiatedDialog,function()a. +Visible=true f.Selected=true end,function()a.Visible=false f.Selected=false end) +a.Visible=true f.Selected=true a:TweenSizeAndPosition(y,UDim2.new(0.5,-y.X. +Offset/2,1,-y.Y.Offset-88),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,u,true +)delay(u,function()a.Tabs.Visible=false h.Visible=true A:Fire(g)o=true p=true f. +Image='http://www.roblox.com/asset/?id=97644093'f.Position=UDim2.new(0.5,-60,1,- +y.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 o then return end if not p then return end p=false o=false q=not q if q then +n.Image='http://www.roblox.com/asset/?id=97623721'n.Position=UDim2.new(-3E-2,0,- +0.17,0)n.Size=UDim2.new(1.05,0,1.25,0)n.ZIndex=2 n.Visible=true showBackpack() +else f.Position=UDim2.new(0.5,-60,1,-44)n.Visible=false f.Selected=false f.Image +='http://www.roblox.com/asset/?id=97617958'n.Image= +'http://www.roblox.com/asset/?id=96536002'n.Position=UDim2.new(-0.1,0,-0.1,0)n. +Size=UDim2.new(1.2,0,1.2,0)E()local F=m:GetChildren()for G=1,#F do if F[G]and F[ +G]:IsA'Frame'then local H=F[G]if#H:GetChildren()>0 then f.Position=UDim2.new(0.5 +,-60,1,-108)f.Visible=true n.Visible=true if H:GetChildren()[1]:IsA'ImageButton' +then local I=H:GetChildren()[1]I.Active=true I.Draggable=false end end end end +end end function closeBackpack()if q then toggleBackpack()end end function +setSelected(F)assert(F)assert(F:IsA'TextButton')F.BackgroundColor3=Color3.new(1, +1,1)F.TextColor3=Color3.new(0,0,0)F.Selected=true F.ZIndex=3 end function +setUnselected(F)assert(F)assert(F:IsA'TextButton')F.BackgroundColor3=Color3.new( +0,0,0)F.TextColor3=Color3.new(1,1,1)F.Selected=false F.ZIndex=1 end function +updateTabGui(F)assert(F)if F=='gear'then setSelected(d)setUnselected(e)elseif F +=='wardrobe'then setSelected(e)setUnselected(d)end end function mouseLeaveTab(F) +assert(F)assert(F:IsA'TextButton')if F.Selected then return end F. +BackgroundColor3=Color3.new(0,0,0)end function mouseOverTab(F)assert(F)assert(F: +IsA'TextButton')if F.Selected then return end F.BackgroundColor3=Color3.new( +0.15294117647058825,0.15294117647058825,0.15294117647058825)end function +newTabClicked(F)assert(F)F=string.lower(F)g=F updateTabGui(F)C:Fire(F) +resetSearch()end function trim(F)return(F:gsub('^%s*(.-)%s*$','%1'))end function +resetSearchBoxGui()k.Visible=false i.Text=v end function doSearch()local F=i. +Text if F==''then resetSearch()return end F=trim(F)k.Visible=true D:Fire(F)end +function resetSearch()resetSearchBoxGui()D:Fire()end local F=function()p=true +end function coreGuiChanged(G,H)if G==Enum.CoreGuiType.Backpack or G==Enum. +CoreGuiType.All then r=H s=not H if s then pcall(function()game:GetService +'GuiService':RemoveKey(w)game:GetService'GuiService':RemoveKey(x)end)else game: +GetService'GuiService':AddKey(w)game:GetService'GuiService':AddKey(x)end +resetSearch()h.Visible=H and q m.Visible=H a.Visible=H f.Visible=H end end +createPublicFunction('CloseBackpack',E)createPublicFunction('BackpackReady',F) +pcall(function()coreGuiChanged(Enum.CoreGuiType.Backpack,Game.StarterGui: +GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))Game.StarterGui. +CoreGuiChangedSignal:connect(coreGuiChanged)end)d.MouseButton1Click:connect( +function()newTabClicked'gear'end)d.MouseEnter:connect(function()mouseOverTab(d) +end)d.MouseLeave:connect(function()mouseLeaveTab(d)end)if game.CoreGui.Version>= +8 then e.MouseButton1Click:connect(function()newTabClicked'wardrobe'end)e. +MouseEnter:connect(function()mouseOverTab(e)end)e.MouseLeave:connect(function() +mouseLeaveTab(e)end)end c.MouseButton1Click:connect(closeBackpack)b.Changed: +connect(function(G)if G=='AbsoluteSize'then z:Fire(b.AbsoluteSize)end end)game: +GetService'GuiService':AddKey(w)game:GetService'GuiService':AddKey(x)game: +GetService'GuiService'.KeyPressed:connect(function(G)if not r or s then return +end if G==w or G==x then toggleBackpack()end end)f.MouseButton1Click:connect( +function()if not r or s then return end toggleBackpack()end)if game.Players. +LocalPlayer['Character']then activateBackpack()end game.Players.LocalPlayer. +CharacterAdded:connect(activateBackpack)i.FocusLost:connect(function(G)if G or i +.Text~=''then doSearch()elseif i.Text==''then resetSearch()end end)j. +MouseButton1Click:connect(doSearch)k.MouseButton1Click:connect(resetSearch)if h +and l.AbsoluteSize.Y<=320 then h.RobloxLocked=false h:Destroy()end \ No newline at end of file diff --git a/processed/97188756.lua b/processed/97188756.lua index 4692a23..d9e2fb5 100644 --- a/processed/97188756.lua +++ b/processed/97188756.lua @@ -1,1610 +1,377 @@ -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() +local a=false local function WaitForChild(b,c)while b:FindFirstChild(c)==nil do +b.ChildAdded:wait(0.03)end return b[c]end local function typedef(b)return b end +local function IsPhone()local b=Game:GetService'CoreGui'local c=WaitForChild(b, +'RobloxGui')if c.AbsoluteSize.Y<600 then return true end return false end +local function StringTrim(b)return(b:gsub('^%s*(.-)%s*$','%1'))end while Game. +Players.LocalPlayer==nil do wait(0.03)end local b=Game.Players.LocalPlayer while +b.Character==nil do wait(0.03)end local c=LoadLibrary'RbxUtility'local d,e,f,g,h +,i,j=typedef(c),Game.Workspace.CurrentCamera,Game:GetService'CoreGui',Game: +GetService'Players',Game:GetService'GuiService',nil,nil do i={}local k={}local l +,m={__call=function(l,m)return l[m]or l[tonumber(m)]end,__index={GetEnumItems= +function(l)local m={}for n,o in pairs(l)do if type(n)=='number'then m[#m+1]=o +end end table.sort(m,function(p,q)return p.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}},j'SafeChat'{'Level1','Level2','Level3'}, +SafeChatTree={},TempSpaceLabel=nil}local function GetNameValue(m)local n=0 for o +=1,#m do local p,q=string.byte(string.sub(m,o,o)),#m-o+1 if#m%2==1 then q=q-1 +end if q%4>=2 then p=-p end n=n+p end return n%8 end function l:ComputeChatColor +(m)return self.ChatColors[GetNameValue(m)+1].Color end function l: +EnableScrolling(m)self.MouseOnFrame=false if self.RenderFrame then self. +RenderFrame.MouseEnter:connect(function()local n=b.Character local o,p= +WaitForChild(n,'Torso'),WaitForChild(n,'Head')if m then self.MouseOnFrame=true e +.CameraType='Scriptable'Spawn(function()local q=e.CoordinateFrame.p-o.Position +while l.MouseOnFrame do e.CoordinateFrame=CFrame.new(o.Position+q,p.Position) +wait(0.015)end end)end end)self.RenderFrame.MouseLeave:connect(function()e. +CameraType='Custom'self.MouseOnFrame=false end)end end function l:IsTouchDevice( +)local m=false pcall(function()m=Game:GetService'UserInputService'.TouchEnabled +end)return m end function l:UpdateQueue(m,n)for o=#self.MessageQueue,1,-1 do if +self.MessageQueue[o]then for p,q in pairs(self.MessageQueue[o])do if q and type( +q)~='table'and type(q)~='number'then if q:IsA'TextLabel'or q:IsA'TextButton'then +if n then q.Position=q.Position-UDim2.new(0,0,n,0)else if m==self.MessageQueue[o +]then q.Position=UDim2.new(self.Configuration.XScale,0,q.Position.Y.Scale-m[ +'Message'].Size.Y.Scale,0)Spawn(function()wait(0.05)while q.TextTransparency>=0 +do q.TextTransparency=q.TextTransparency-0.2 wait(0.03)end if q==m['Message'] +then q.TextStrokeTransparency=0.8 else q.TextStrokeTransparency=1 end end)else q +.Position=UDim2.new(self.Configuration.XScale,0,q.Position.Y.Scale-m['Message']. +Size.Y.Scale,0)end if q.Position.Y.Scale<-1E-2 then q.Visible=false q:Destroy() +end end end end end end end end function l:CreateScrollBar()end function l: +CheckIfInBounds(m)if#l.MessageQueue<3 then return true end if m>0 and l. +MessageQueue[1]and l.MessageQueue[1]['Player']and l.MessageQueue[1]['Player']. +Position.Y.Scale==0 then return true elseif m<0 and l.MessageQueue[1]and l. +MessageQueue[1]['Player']and l.MessageQueue[1]['Player'].Position.Y.Scale<0 then +return true else return false end return false end function l:ComputeSpaceString +(m)local n=' 'if not self.TempSpaceLabel then self.TempSpaceLabel=d.Create +'TextButton'{Size=UDim2.new(0,m.AbsoluteSize.X,0,m.AbsoluteSize.Y),FontSize=self +.Configuration.FontSize,Parent=self.RenderFrame,BackgroundTransparency=1,Text=n, +Name='SpaceButton'}else self.TempSpaceLabel.Text=n end while self.TempSpaceLabel +.TextBounds.Xself. +Configuration.HistoryLength then self.MessageQueue[#self.MessageQueue]=nil end p +=d.Create'TextLabel'{Name=o,Text=o..':',FontSize=l.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 m.Neutral then p.TextColor3=l:ComputeChatColor(o) +else p.TextColor3=m.TeamColor.Color end local r if not self. +CachedSpaceStrings_List[o]then r=l:ComputeSpaceString(p)else r=self. +CachedSpaceStrings_List[o]end q=d.Create'TextLabel'{Name=o..' - message',Size= +UDim2.new(1,0,0.5,0),TextColor3=l.Configuration.MessageColor,FontSize=l. +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)}q.Text=r..n if not o then p +.Text=''q.TextColor3=Color3.new(0,0.4,1)end for s,t in pairs(self.Admins_List)do +if string.lower(t)==string.lower(o)then q.TextColor3=self.Configuration. +AdminMessageColor end end p.Visible=true q.Visible=true local u=q.TextBounds.Y q +.Size=UDim2.new(1,0,u/self.RenderFrame.AbsoluteSize.Y,0)p.Size=q.Size local v={} +v['Player']=p v['Message']=q v['SpawnTime']=tick()table.insert(self.MessageQueue +,1,v)l:UpdateQueue(v)end function l:ScreenSizeChanged()wait()while self.Frame. +AbsoluteSize.Y>120 do self.Frame.Size=self.Frame.Size-UDim2.new(0,0,0.005,0)end +l:RecalculateSpacing()end function l:FindButtonTree(m,n)local o={}n=n or self. +SafeChatTree for p,q in pairs(n)do if p==m then o=n[p]elseif type(n[p])=='table' +then o=l:FindButtonTree(m,n[p])end end return o end function l: +ToggleSafeChatMenu(m)local n=l:FindButtonTree(m,self.SafeChatTree)if n then for +o,p in pairs(n)do if o:IsA'TextButton'or o:IsA'ImageButton'then o.Visible=not o. +Visible end end return true end return false end function l: +CreateSafeChatOptions(m,n)local o,p={},0 o[n]={}o[n][1]=m[1]n=n or self. +SafeChatButton for q,r in pairs(m)do if type(q)=='string'then local s=d.Create +'TextButton'{Name=q,Text=q,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,n.Position.X.Scale+105,0,n.Position.Y.Scale-((p-3)*100))}p= +p+1 if type(m[q])=='table'then o[n][s]=l:CreateSafeChatOptions(m[q],s)end s. +MouseEnter:connect(function()l:ToggleSafeChatMenu(s)end)s.MouseLeave:connect( +function()l:ToggleSafeChatMenu(s)end)s.MouseButton1Click:connect(function()local +t=l:FindButtonTree(s)pcall(function()g:Chat(t[1])end)end)end end return o end +function l:CreateSafeChatGui()self.SafeChatFrame=d.Create'Frame'{Name= +'SafeChatFrame',Size=UDim2.new(1,0,1,0),Parent=self.Gui,BackgroundTransparency=1 +,d.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 self.SafeChatTree[self.SafeChatButton]=l: +CreateSafeChatOptions(self.SafeChat_List,self.SafeChatButton)self.SafeChatButton +.MouseButton1Click:connect(function()l:ToggleSafeChatMenu(self.SafeChatButton) +end)end function l: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 function l:CreateTouchButton()self.ChatTouchFrame=d.Create +'Frame'{Name='ChatTouchFrame',Size=UDim2.new(0,128,0,32),Position=UDim2.new(0,88 +,0,0),BackgroundTransparency=1,Parent=self.Gui,d.Create'ImageButton'{Name= +'ChatLabel',Size=UDim2.new(0,74,0,28),Position=UDim2.new(0,0,0,0), +BackgroundTransparency=1,ZIndex=2},d.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=d.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:CaptureFocus()self. +GotFocus=true if self.TouchLabelBackground then self.TouchLabelBackground. +Visible=false end end)end function l:CreateChatBar()local m,n=pcall(function() +return h.UseLuaChat end)if a or(m and n)then self.ClickToChatButton=d.Create +'TextButton'{Name='ClickToChat',Size=UDim2.new(1,0,0,20),BackgroundTransparency= +1,ZIndex=2,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=d.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}local o,p=pcall(function()h +:SetGlobalGuiInset(0,0,0,20)end)if not o then h:SetGlobalSizeOffsetPixel(0,-20) +end h:AddSpecialKey(Enum.SpecialKey.ChatHotkey)h.SpecialKeyPressed:connect( +function(q)if q==Enum.SpecialKey.ChatHotkey then l:FocusOnChatBar()end end)self. +ClickToChatButton.MouseButton1Click:connect(function()l:FocusOnChatBar()end)end +end function l:CreateGui()self.Gui=WaitForChild(f,'RobloxGui')self.Frame=d. +Create'Frame'{Name='ChatFrame',Size=UDim2.new(0,500,0,120),Position=UDim2.new(0, +0,0,5),BackgroundTransparency=1,ZIndex=0,Parent=self.Gui,Active=false,d.Create +'ImageLabel'{Name='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},d.Create'Frame'{Name='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},d.Create'Frame'{Name='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 l:IsTouchDevice()then +self.Frame.Position=self.Configuration.Position self.RenderFrame.Size=UDim2.new( +1,0,1,0)elseif self.Frame.AbsoluteSize.Y>120 then l:ScreenSizeChanged()self.Gui. +Changed:connect(function(m)if m=='AbsoluteSize'then l:ScreenSizeChanged()end end +)end if a or b.ChatMode==Enum.ChatMode.TextAndMenu then if l:IsTouchDevice()then +l:CreateTouchButton()else l:CreateChatBar()end if self.ChatBar then self.ChatBar +.FocusLost:connect(function(m)l.GotFocus=false if l:IsTouchDevice()then self. +ChatBar.Visible=false self.TapToChatLabel.Visible=true if self. +TouchLabelBackground then self.TouchLabelBackground.Visible=true end end if m +and self.ChatBar.Text~=''then local n=self.ChatBar.Text if string.sub(self. +ChatBar.Text,1,1)=='%'then n='(TEAM) '..string.sub(n,2,#n)pcall(function()g: +TeamChat(n)end)else pcall(function()g:Chat(n)end)end if self.ClickToChatButton +then self.ClickToChatButton.Visible=true end self.ChatBar.Text=''end Spawn( +function()wait(5)if not l.GotFocus then l.Frame.Background.Visible=false end end +)end)end end end function k:OnMouseScroll()Spawn(function()while k.Speed~=0 do +if k.Speed>1 then while k.Speed>0 do k.Speed=k.Speed-1 wait(0.25)end elseif k. +Speed<0 then while k.Speed<0 do k.Speed=k.Speed+1 wait(0.25)end end wait(0.03) +end end)if l:CheckIfInBounds(k.Speed)then return end l:ScrollQueue()end function +k:ApplySpeed(m)k.Speed=k.Speed+m if not self.Simulating then k:OnMouseScroll() +end end function k:Initialize()self.Mouse.WheelBackward:connect(function()k: +ApplySpeed(self.Configuration.DefaultSpeed)end)self.Mouse.WheelForward:connect( +function()k:ApplySpeed(self.Configuration.DefaultSpeed)end)end function l: +FindMessageInSafeChat(m,n)local o=false for p,q in pairs(n)do if p==m then +return true end if type(n[p])=='table'then o=l:FindMessageInSafeChat(m,n[p])if o +then return true end end end return o end function l:PlayerChatted(...)local m,n +,o={...},nil,nil if m[2]then n=m[2]end if m[3]then o=m[3]if string.sub(o,1,1)== +'%'then o='(TEAM) '..string.sub(o,2,#o)end end if g.ClassicChat then if not( +string.sub(o,1,3)=='/e 'or string.sub(o,1,7)=='/emote ')and(a or b.ChatMode== +Enum.ChatMode.TextAndMenu)or(b.ChatMode==Enum.ChatMode.Menu and string.sub(o,1,3 +)=='/sc')or(l:FindMessageInSafeChat(o,self.SafeChat_List))then l:UpdateChat(n,o) +end end end function l:CullThread()while true do if#self.MessageQueue>0 then for +m,n in pairs(self.MessageQueue)do if n['SpawnTime']and n['Player']and n[ +'Message']and tick()-n['SpawnTime']>self.Configuration.LifeTime then n['Player'] +.Visible=false n['Message'].Visible=false end end end wait(5)end end function l: +LockAllFields(m)local n=m:GetChildren()for o=1,#n do n[o].RobloxLocked=true if#n +[o]:GetChildren()>0 then l:LockAllFields(n[o])end end end function l: +CoreGuiChanged(m,n)if m==Enum.CoreGuiType.Chat or m==Enum.CoreGuiType.All then +if self.Frame then self.Frame.Visible=n end if not l:IsTouchDevice()and self. +ChatBar then self.ChatBar.Visible=n if n then h:SetGlobalGuiInset(0,0,0,20)else +h:SetGlobalGuiInset(0,0,0,0)end end end end function l:Initialize()l:CreateGui() +pcall(function()l:CoreGuiChanged(Enum.CoreGuiType.Chat,Game.StarterGui: +GetCoreGuiEnabled(Enum.CoreGuiType.Chat))Game.StarterGui.CoreGuiChangedSignal: +connect(function(m,n)l:CoreGuiChanged(m,n)end)end)self.EventListener=g. +PlayerChatted:connect(function(...)l:PlayerChatted(...)end)self.MessageThread= +coroutine.create(function()end)coroutine.resume(self.MessageThread)k:Initialize( +)g.ChildAdded:connect(function()l.EventListener:disconnect()self.EventListener=g +.PlayerChatted:connect(function(...)l:PlayerChatted(...)end)end)Spawn(function() +l:CullThread()end)self.Frame.RobloxLocked=true l:LockAllFields(self.Frame)self. +Frame.DescendantAdded:connect(function(m)l:LockAllFields(m)end)end l:Initialize( +) \ No newline at end of file