Improve corescript formatting, add logging for script loading, and replace URLs with banland.xyz

This commit is contained in:
Lewin Kelly 2023-08-14 17:26:17 +01:00
parent 4ef87acda4
commit a94af66013
30 changed files with 5043 additions and 2395 deletions

View File

@ -1,4 +1,6 @@
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4"> <roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<External>null</External> <External>null</External>
<External>nil</External> <External>nil</External>
<Item class="Hat" referent="RBXFEFA1B06A7444E13896169510508F42A"> <Item class="Hat" referent="RBXFEFA1B06A7444E13896169510508F42A">
@ -94,7 +96,9 @@
<Properties> <Properties>
<token name="LODX">2</token> <token name="LODX">2</token>
<token name="LODY">2</token> <token name="LODY">2</token>
<Content name="MeshId"><url>http://banland.xyz/asset?id=19999424</url></Content> <Content name="MeshId">
<url>http://banland.xyz/asset?id=19999424</url>
</Content>
<token name="MeshType">5</token> <token name="MeshType">5</token>
<string name="Name">Mesh</string> <string name="Name">Mesh</string>
<Vector3 name="Offset"> <Vector3 name="Offset">
@ -107,7 +111,9 @@
<Y>1.07000005</Y> <Y>1.07000005</Y>
<Z>1.07000005</Z> <Z>1.07000005</Z>
</Vector3> </Vector3>
<Content name="TextureId"><url>http://banland.xyz/asset?id=20571982</url></Content> <Content name="TextureId">
<url>http://banland.xyz/asset?id=20571982</url>
</Content>
<Vector3 name="VertexColor"> <Vector3 name="VertexColor">
<X>1</X> <X>1</X>
<Y>1</Y> <Y>1</Y>

View File

@ -199,7 +199,7 @@ humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
<Color3 name="BorderColor3">4279970357</Color3> <Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int> <int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<Content name="Image"><url>http://www.roblox.com/asset/?id=34854607</url></Content> <Content name="Image"><url>http://banland.xyz/asset/?id=34854607</url></Content>
<string name="Name">hurtOverlay</string> <string name="Name">hurtOverlay</string>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>2</XS> <XS>2</XS>
@ -254,7 +254,7 @@ humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
<Color3 name="BorderColor3">4279970357</Color3> <Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int> <int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<Content name="Image"><url>http://www.roblox.com/asset/?id=35238000</url></Content> <Content name="Image"><url>http://banland.xyz/asset/?id=35238000</url></Content>
<string name="Name">bkg</string> <string name="Name">bkg</string>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0</XS> <XS>0</XS>
@ -282,7 +282,7 @@ humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
<Color3 name="BorderColor3">4279970357</Color3> <Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int> <int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<Content name="Image"><url>http://www.roblox.com/asset/?id=35238036</url></Content> <Content name="Image"><url>http://banland.xyz/asset/?id=35238036</url></Content>
<string name="Name">barRed</string> <string name="Name">barRed</string>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0.0189999994</XS> <XS>0.0189999994</XS>
@ -338,7 +338,7 @@ humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
<Color3 name="BorderColor3">4279970357</Color3> <Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">1</int> <int name="BorderSizePixel">1</int>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<Content name="Image"><url>http://www.roblox.com/asset/?id=35238053</url></Content> <Content name="Image"><url>http://banland.xyz/asset/?id=35238053</url></Content>
<string name="Name">bar</string> <string name="Name">bar</string>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0.0189999994</XS> <XS>0.0189999994</XS>
@ -366,7 +366,7 @@ humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
<Color3 name="BorderColor3">4279970357</Color3> <Color3 name="BorderColor3">4279970357</Color3>
<int name="BorderSizePixel">0</int> <int name="BorderSizePixel">0</int>
<bool name="Draggable">false</bool> <bool name="Draggable">false</bool>
<Content name="Image"><url>http://www.roblox.com/asset/?id=34816363</url></Content> <Content name="Image"><url>http://banland.xyz/asset/?id=34816363</url></Content>
<string name="Name">label</string> <string name="Name">label</string>
<UDim2 name="Position"> <UDim2 name="Position">
<XS>0.680000007</XS> <XS>0.680000007</XS>

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 107893730"
-- this script creates the gui and sends the web requests for in game purchase prompts -- this script creates the gui and sends the web requests for in game purchase prompts
-- wait for important items to appear -- wait for important items to appear
@ -16,31 +17,31 @@ end
-------------------------------- Global Variables ---------------------------------------- -------------------------------- Global Variables ----------------------------------------
-- utility variables -- utility variables
local RbxUtility = nil local RbxUtility
local baseUrl = game:GetService("ContentProvider").BaseUrl:lower() local baseUrl = game:GetService("ContentProvider").BaseUrl:lower()
-- data variables -- data variables
local currentProductInfo, currentAssetId, currentCurrencyType, currentCurrencyAmount, currentEquipOnPurchase, currentProductId, currentServerResponseTable local currentProductInfo, currentAssetId, currentCurrencyType, currentCurrencyAmount, currentEquipOnPurchase, currentProductId, currentServerResponseTable
local checkingPlayerFunds = false local checkingPlayerFunds = false
local openBCUpSellWindowConnection = nil local openBCUpSellWindowConnection
local purchasingConsumable = false local purchasingConsumable = false
local enableBrowserWindowClosedEvent = true local enableBrowserWindowClosedEvent = true
-- gui variables -- gui variables
local openBuyCurrencyWindowConnection = nil local openBuyCurrencyWindowConnection
local currentlyPrompting = false local currentlyPrompting = false
local purchaseDialog = nil local purchaseDialog
local tweenTime = 0.3 local tweenTime = 0.3
local showPosition = UDim2.new(0.5, -330, 0.5, -200) local showPosition = UDim2.new(0.5, -330, 0.5, -200)
local hidePosition = UDim2.new(0.5, -330, 1, 25) local hidePosition = UDim2.new(0.5, -330, 1, 25)
local isSmallScreen = nil local isSmallScreen
local spinning = false local spinning = false
local spinnerIcons = nil local spinnerIcons
local smallScreenThreshold = 450 local smallScreenThreshold = 450
-- user facing images -- user facing images
local assetUrls = {} local assetUrls = {}
local assetUrl = "http://www.roblox.com/Asset/?id=" local assetUrl = "http://banland.xyz/Asset/?id="
local errorImageUrl = assetUrl .. "42557901" local errorImageUrl = assetUrl .. "42557901"
table.insert(assetUrls, errorImageUrl) table.insert(assetUrls, errorImageUrl)
local buyImageUrl = assetUrl .. "104651457" local buyImageUrl = assetUrl .. "104651457"
@ -77,9 +78,12 @@ local errorPurchasesUnknownText = "Roblox is performing maintenance"
local purchaseSucceededText = "Your purchase of itemName succeeded!" local purchaseSucceededText = "Your purchase of itemName succeeded!"
local purchaseFailedText = local purchaseFailedText =
"Your purchase of itemName failed because errorReason. Your account has not been charged. Please try again soon." "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 productPurchaseText =
local freeItemPurchaseText = "Would you like to take the assetType 'itemName' for FREE?" "Would you like to buy 'itemName' for currencyType currencyAmount?"
local freeItemBalanceText = "Your balance of Robux or Tix will not be affected by this transaction." local freeItemPurchaseText =
"Would you like to take the assetType 'itemName' for FREE?"
local freeItemBalanceText =
"Your balance of Robux or Tix will not be affected by this transaction."
-------------------------------- End Global Variables ---------------------------------------- -------------------------------- End Global Variables ----------------------------------------
@ -138,9 +142,13 @@ function userPurchaseActionsEnded(isSuccess)
checkingPlayerFunds = false checkingPlayerFunds = false
if isSuccess then -- show the user we bought the item successfully, when they close this dialog we will call signalPromptEnded if isSuccess then -- show the user we bought the item successfully, when they close this dialog we will call signalPromptEnded
local newPurchasedSucceededText = local newPurchasedSucceededText = string.gsub(
string.gsub(purchaseSucceededText, "itemName", tostring(currentProductInfo["Name"])) purchaseSucceededText,
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText "itemName",
tostring(currentProductInfo["Name"])
)
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text =
newPurchasedSucceededText
setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton) setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton)
hidePurchasing() hidePurchasing()
else -- otherwise we didn't purchase, no need to show anything, just signal and close dialog else -- otherwise we didn't purchase, no need to show anything, just signal and close dialog
@ -152,10 +160,17 @@ function signalPromptEnded(isSuccess)
closePurchasePrompt() closePurchasePrompt()
if purchasingConsumable then if purchasingConsumable then
game:GetService("MarketplaceService") game:GetService("MarketplaceService")
:SignalPromptProductPurchaseFinished(game.Players.LocalPlayer.userId, currentProductId, isSuccess) :SignalPromptProductPurchaseFinished(
game.Players.LocalPlayer.userId,
currentProductId,
isSuccess
)
else else
game:GetService("MarketplaceService") game:GetService("MarketplaceService"):SignalPromptPurchaseFinished(
:SignalPromptPurchaseFinished(game.Players.LocalPlayer, currentAssetId, isSuccess) game.Players.LocalPlayer,
currentAssetId,
isSuccess
)
end end
removeCurrentPurchaseInfo() removeCurrentPurchaseInfo()
end end
@ -170,19 +185,38 @@ function updatePurchasePromptData(_)
end end
if isFreeItem() then if isFreeItem() then
newItemDescription = string.gsub(freeItemPurchaseText, "itemName", tostring(currentProductInfo["Name"])) newItemDescription = string.gsub(
newItemDescription = freeItemPurchaseText,
string.gsub(newItemDescription, "assetType", tostring(assetTypeToString(currentProductInfo["AssetTypeId"]))) "itemName",
tostring(currentProductInfo["Name"])
)
newItemDescription = string.gsub(
newItemDescription,
"assetType",
tostring(assetTypeToString(currentProductInfo["AssetTypeId"]))
)
setHeaderText(takeHeaderText) setHeaderText(takeHeaderText)
else -- otherwise item costs something, so different prompt else -- otherwise item costs something, so different prompt
newItemDescription = string.gsub(productPurchaseText, "itemName", tostring(currentProductInfo["Name"])) newItemDescription = string.gsub(
newItemDescription = productPurchaseText,
string.gsub(newItemDescription, "currencyType", tostring(currencyTypeToString(currentCurrencyType))) "itemName",
newItemDescription = string.gsub(newItemDescription, "currencyAmount", tostring(currentCurrencyAmount)) tostring(currentProductInfo["Name"])
)
newItemDescription = string.gsub(
newItemDescription,
"currencyType",
tostring(currencyTypeToString(currentCurrencyType))
)
newItemDescription = string.gsub(
newItemDescription,
"currencyAmount",
tostring(currentCurrencyAmount)
)
setHeaderText(buyHeaderText) setHeaderText(buyHeaderText)
end end
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newItemDescription purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text =
newItemDescription
if purchasingConsumable then if purchasingConsumable then
purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl purchaseDialog.BodyFrame.ItemPreview.Image = baseUrl
@ -202,7 +236,12 @@ function doPlayerFundsCheck(checkIndefinitely)
local canPurchase, insufficientFunds = canPurchaseItem() -- check again to see if we can buy item local canPurchase, insufficientFunds = canPurchaseItem() -- check again to see if we can buy item
if canPurchase and insufficientFunds then -- wait a bit and try a few more times if canPurchase and insufficientFunds then -- wait a bit and try a few more times
local retries = 1000 local retries = 1000
while (retries > 0 or checkIndefinitely) and insufficientFunds and checkingPlayerFunds and canPurchase do while
(retries > 0 or checkIndefinitely)
and insufficientFunds
and checkingPlayerFunds
and canPurchase
do
wait(1 / 10) wait(1 / 10)
canPurchase, insufficientFunds = canPurchaseItem() canPurchase, insufficientFunds = canPurchaseItem()
retries = retries - 1 retries = retries - 1
@ -220,7 +259,8 @@ function doPlayerFundsCheck(checkIndefinitely)
end end
function showPurchasePrompt() function showPurchasePrompt()
local canPurchase, insufficientFunds, notRightBC, override, descText = canPurchaseItem() local canPurchase, insufficientFunds, notRightBC, override, descText =
canPurchaseItem()
if canPurchase then if canPurchase then
updatePurchasePromptData() updatePurchasePromptData()
@ -269,9 +309,15 @@ function showPurchasePrompt()
purchaseDialog.BodyFrame.AfterBalanceButton purchaseDialog.BodyFrame.AfterBalanceButton
) )
elseif override then elseif override then
setButtonsVisible(purchaseDialog.BodyFrame.BuyDisabledButton, purchaseDialog.BodyFrame.CancelButton) -- , purchaseDialog.BodyFrame.AfterBalanceButton) setButtonsVisible(
purchaseDialog.BodyFrame.BuyDisabledButton,
purchaseDialog.BodyFrame.CancelButton
) -- , purchaseDialog.BodyFrame.AfterBalanceButton)
else else
setButtonsVisible(purchaseDialog.BodyFrame.BuyButton, purchaseDialog.BodyFrame.CancelButton) -- , purchaseDialog.BodyFrame.AfterBalanceButton) setButtonsVisible(
purchaseDialog.BodyFrame.BuyButton,
purchaseDialog.BodyFrame.CancelButton
) -- , purchaseDialog.BodyFrame.AfterBalanceButton)
end end
purchaseDialog:TweenPosition( purchaseDialog:TweenPosition(
@ -282,7 +328,11 @@ function showPurchasePrompt()
true true
) )
if canPurchase and insufficientFunds and not enableBrowserWindowClosedEvent then if
canPurchase
and insufficientFunds
and not enableBrowserWindowClosedEvent
then
checkingPlayerFunds = true checkingPlayerFunds = true
doPlayerFundsCheck(true) doPlayerFundsCheck(true)
end end
@ -325,15 +375,24 @@ function purchaseFailed(inGamePurchasesDisabled)
name = currentProductInfo["Name"] name = currentProductInfo["Name"]
end end
local newPurchasedFailedText = string.gsub(purchaseFailedText, "itemName", tostring(name)) local newPurchasedFailedText =
string.gsub(purchaseFailedText, "itemName", tostring(name))
if inGamePurchasesDisabled then if inGamePurchasesDisabled then
newPurchasedFailedText = newPurchasedFailedText = string.gsub(
string.gsub(newPurchasedFailedText, "errorReason", tostring(errorPurchasesDisabledText)) newPurchasedFailedText,
"errorReason",
tostring(errorPurchasesDisabledText)
)
else else
newPurchasedFailedText = string.gsub(newPurchasedFailedText, "errorReason", tostring(errorPurchasesUnknownText)) newPurchasedFailedText = string.gsub(
newPurchasedFailedText,
"errorReason",
tostring(errorPurchasesUnknownText)
)
end end
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedFailedText purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text =
newPurchasedFailedText
purchaseDialog.BodyFrame.ItemPreview.Image = errorImageUrl purchaseDialog.BodyFrame.ItemPreview.Image = errorImageUrl
setButtonsVisible(purchaseDialog.BodyFrame.OkButton) setButtonsVisible(purchaseDialog.BodyFrame.OkButton)
@ -351,7 +410,7 @@ function doAcceptPurchase(_)
-- http call to do the purchase -- http call to do the purchase
local response = "none" local response = "none"
local url = nil local url
-- consumables need to use a different url -- consumables need to use a different url
if purchasingConsumable then if purchasingConsumable then
@ -382,7 +441,12 @@ function doAcceptPurchase(_)
end) end)
-- debug output for us (found in the logs from local) -- debug output for us (found in the logs from local)
print("doAcceptPurchase success from ypcall is ", success, "reason is", reason) print(
"doAcceptPurchase success from ypcall is ",
success,
"reason is",
reason
)
if (tick() - startTime) < 1 then if (tick() - startTime) < 1 then
wait(1) -- allow the purchasing waiting dialog to at least be readable (otherwise it might flash, looks bad)... wait(1) -- allow the purchasing waiting dialog to at least be readable (otherwise it might flash, looks bad)...
@ -390,7 +454,11 @@ function doAcceptPurchase(_)
-- check to make sure purchase actually happened on the web end -- check to make sure purchase actually happened on the web end
if response == "none" or response == nil or response == "" then if response == "none" or response == nil or response == "" then
print("did not get a proper response from web on purchase of", currentAssetId, currentProductId) print(
"did not get a proper response from web on purchase of",
currentAssetId,
currentProductId
)
purchaseFailed() purchaseFailed()
return return
end end
@ -401,19 +469,31 @@ function doAcceptPurchase(_)
if response then if response then
if response["success"] == false then if response["success"] == false then
if response["status"] ~= "AlreadyOwned" then if response["status"] ~= "AlreadyOwned" then
print("web return response of fail on purchase of", currentAssetId, currentProductId) print(
"web return response of fail on purchase of",
currentAssetId,
currentProductId
)
purchaseFailed((response["status"] == "EconomyDisabled")) purchaseFailed((response["status"] == "EconomyDisabled"))
return return
end end
end end
else else
print("web return response of non parsable JSON on purchase of", currentAssetId) print(
"web return response of non parsable JSON on purchase of",
currentAssetId
)
purchaseFailed() purchaseFailed()
return return
end end
-- check to see if this item was bought, and if we want to equip it (also need to make sure the asset type was gear) -- check to see if this item was bought, and if we want to equip it (also need to make sure the asset type was gear)
if currentEquipOnPurchase and success and currentAssetId and tonumber(currentProductInfo["AssetTypeId"]) == 19 then if
currentEquipOnPurchase
and success
and currentAssetId
and tonumber(currentProductInfo["AssetTypeId"]) == 19
then
local tool = getToolAssetID(tonumber(currentAssetId)) local tool = getToolAssetID(tonumber(currentAssetId))
if tool then if tool then
tool.Parent = game.Players.LocalPlayer.Backpack tool.Parent = game.Players.LocalPlayer.Backpack
@ -422,16 +502,18 @@ function doAcceptPurchase(_)
if purchasingConsumable then if purchasingConsumable then
if not response["receipt"] then if not response["receipt"] then
print("tried to buy productId, but no receipt returned. productId was", currentProductId) print(
"tried to buy productId, but no receipt returned. productId was",
currentProductId
)
purchaseFailed() purchaseFailed()
return return
end end
Game:GetService("MarketplaceService") Game:GetService("MarketplaceService"):SignalClientPurchaseSuccess(
:SignalClientPurchaseSuccess( tostring(response["receipt"]),
tostring(response["receipt"]), game.Players.LocalPlayer.userId,
game.Players.LocalPlayer.userId, currentProductId
currentProductId )
)
else else
userPurchaseActionsEnded(success) userPurchaseActionsEnded(success)
end end
@ -446,7 +528,10 @@ end
---------------------------------------------- Currency Functions --------------------------------------------- ---------------------------------------------- Currency Functions ---------------------------------------------
-- enums have no implicit conversion to numbers in lua, has to have a function to do this -- enums have no implicit conversion to numbers in lua, has to have a function to do this
function currencyEnumToInt(currencyEnum) function currencyEnumToInt(currencyEnum)
if currencyEnum == Enum.CurrencyType.Robux or currencyEnum == Enum.CurrencyType.Default then if
currencyEnum == Enum.CurrencyType.Robux
or currencyEnum == Enum.CurrencyType.Default
then
return 1 return 1
elseif currencyEnum == Enum.CurrencyType.Tix then elseif currencyEnum == Enum.CurrencyType.Tix then
return 2 return 2
@ -532,7 +617,10 @@ end
-- figure out what currency to use based on the currency you can actually sell the item in and what the script specified -- figure out what currency to use based on the currency you can actually sell the item in and what the script specified
function setCurrencyAmountAndType(priceInRobux, priceInTix) function setCurrencyAmountAndType(priceInRobux, priceInTix)
if currentCurrencyType == Enum.CurrencyType.Default or currentCurrencyType == Enum.CurrencyType.Robux then -- sell for default (user doesn't care) or robux if
currentCurrencyType == Enum.CurrencyType.Default
or currentCurrencyType == Enum.CurrencyType.Robux
then -- sell for default (user doesn't care) or robux
if priceInRobux ~= nil and priceInRobux ~= 0 then -- we can sell for robux if priceInRobux ~= nil and priceInRobux ~= 0 then -- we can sell for robux
currentCurrencyAmount = priceInRobux currentCurrencyAmount = priceInRobux
currentCurrencyType = Enum.CurrencyType.Robux currentCurrencyType = Enum.CurrencyType.Robux
@ -561,9 +649,10 @@ end
-- will get the player's balance of robux and tix, return in a table -- will get the player's balance of robux and tix, return in a table
function getPlayerBalance() function getPlayerBalance()
local playerBalance = nil local playerBalance
local success, errorCode = ypcall(function() local success, errorCode = ypcall(function()
playerBalance = game:HttpGetAsync(getSecureApiBaseUrl() .. "currency/balance") playerBalance =
game:HttpGetAsync(getSecureApiBaseUrl() .. "currency/balance")
end) end)
if not success then if not success then
print("Get player balance failed because", errorCode) print("Get player balance failed because", errorCode)
@ -582,11 +671,13 @@ end
-- should open an external default browser window to this url -- should open an external default browser window to this url
function openBuyCurrencyWindow() function openBuyCurrencyWindow()
checkingPlayerFunds = true checkingPlayerFunds = true
game:GetService("GuiService"):OpenBrowserWindow(baseUrl .. "Upgrades/Robux.aspx") game:GetService("GuiService")
:OpenBrowserWindow(baseUrl .. "Upgrades/Robux.aspx")
end end
function openBCUpSellWindow() function openBCUpSellWindow()
Game:GetService("GuiService"):OpenBrowserWindow(baseUrl .. "Upgrades/BuildersClubMemberships.aspx") Game:GetService("GuiService")
:OpenBrowserWindow(baseUrl .. "Upgrades/BuildersClubMemberships.aspx")
end end
-- set up the gui text at the bottom of the prompt (alerts user to how much money they will have left, or if they need to buy more to buy the item) -- set up the gui text at the bottom of the prompt (alerts user to how much money they will have left, or if they need to buy more to buy the item)
@ -596,7 +687,7 @@ function updateAfterBalanceText(playerBalance, notRightBc)
return true, false return true, false
end end
local keyWord = nil local keyWord
if currentCurrencyType == Enum.CurrencyType.Robux then if currentCurrencyType == Enum.CurrencyType.Robux then
keyWord = "robux" keyWord = "robux"
elseif currentCurrencyType == Enum.CurrencyType.Tix then elseif currentCurrencyType == Enum.CurrencyType.Tix then
@ -619,7 +710,9 @@ function updateAfterBalanceText(playerBalance, notRightBc)
if afterBalanceNumber < 0 and keyWord == "robux" then if afterBalanceNumber < 0 and keyWord == "robux" then
if openBuyCurrencyWindowConnection == nil then if openBuyCurrencyWindowConnection == nil then
openBuyCurrencyWindowConnection = openBuyCurrencyWindowConnection =
purchaseDialog.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(openBuyCurrencyWindow) purchaseDialog.BodyFrame.AfterBalanceButton.MouseButton1Click:connect(
openBuyCurrencyWindow
)
end end
purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need " purchaseDialog.BodyFrame.AfterBalanceButton.Text = "You need "
.. currencyTypeToString(currentCurrencyType) .. currencyTypeToString(currentCurrencyType)
@ -680,27 +773,32 @@ function canPurchaseItem()
-- first we see if player already owns the asset/get the productinfo -- first we see if player already owns the asset/get the productinfo
local playerOwnsAsset = false local playerOwnsAsset = false
local notRightBc = false local notRightBc = false
local descText = nil local descText
local success = false local success = false
if purchasingConsumable then if purchasingConsumable then
local currentProductInfoRaw = nil local currentProductInfoRaw
success = ypcall(function() success = ypcall(function()
currentProductInfoRaw = Game:HttpGetAsync( currentProductInfoRaw = Game:HttpGetAsync(
getSecureApiBaseUrl() .. "marketplace/productDetails?productid=" .. tostring(currentProductId) getSecureApiBaseUrl()
.. "marketplace/productDetails?productid="
.. tostring(currentProductId)
) )
end) end)
if success then if success then
currentProductInfo = getRbxUtility().DecodeJSON(currentProductInfoRaw) currentProductInfo =
getRbxUtility().DecodeJSON(currentProductInfoRaw)
end end
else else
success = ypcall(function() success = ypcall(function()
currentProductInfo = game:GetService("MarketplaceService"):GetProductInfo(currentAssetId) currentProductInfo = game:GetService("MarketplaceService")
:GetProductInfo(currentAssetId)
end) end)
end end
if currentProductInfo == nil or not success then if currentProductInfo == nil or not success then
descText = "In-game sales are temporarily disabled. Please try again later." descText =
"In-game sales are temporarily disabled. Please try again later."
return true, nil, nil, true, descText return true, nil, nil, true, descText
end end
@ -748,7 +846,10 @@ function canPurchaseItem()
return true, nil, nil, true, descText return true, nil, nil, true, descText
end end
if currentProductInfo["IsForSale"] == false and currentProductInfo["IsPublicDomain"] == false then if
currentProductInfo["IsForSale"] == false
and currentProductInfo["IsPublicDomain"] == false
then
descText = "This item is no longer for sale." descText = "This item is no longer for sale."
return true, nil, nil, true, descText return true, nil, nil, true, descText
end end
@ -760,7 +861,8 @@ function canPurchaseItem()
tonumber(currentProductInfo["PriceInTickets"]) tonumber(currentProductInfo["PriceInTickets"])
) )
then then
descText = "We could retrieve the price of the item correctly. Please try again later." descText =
"We could retrieve the price of the item correctly. Please try again later."
return true, nil, nil, true, descText return true, nil, nil, true, descText
end end
@ -777,7 +879,8 @@ function canPurchaseItem()
notRightBc = true notRightBc = true
end end
local updatedBalance, insufficientFunds = updateAfterBalanceText(playerBalance, notRightBc) local updatedBalance, insufficientFunds =
updateAfterBalanceText(playerBalance, notRightBc)
if notRightBc then if notRightBc then
purchaseDialog.BodyFrame.AfterBalanceButton.Active = true purchaseDialog.BodyFrame.AfterBalanceButton.Active = true
@ -786,25 +889,31 @@ function canPurchaseItem()
if currentProductInfo["ContentRatingTypeId"] == 1 then if currentProductInfo["ContentRatingTypeId"] == 1 then
if game.Players.LocalPlayer:GetUnder13() then if game.Players.LocalPlayer:GetUnder13() then
descText = "Your account is under 13 so purchase of this item is not allowed." descText =
"Your account is under 13 so purchase of this item is not allowed."
return true, nil, nil, true, descText return true, nil, nil, true, descText
end end
end end
if if
(currentProductInfo["IsLimited"] == true or currentProductInfo["IsLimitedUnique"] == true) (
currentProductInfo["IsLimited"] == true
or currentProductInfo["IsLimitedUnique"] == true
)
and ( and (
currentProductInfo["Remaining"] == "" currentProductInfo["Remaining"] == ""
or currentProductInfo["Remaining"] == 0 or currentProductInfo["Remaining"] == 0
or currentProductInfo["Remaining"] == nil or currentProductInfo["Remaining"] == nil
) )
then then
descText = "All copies of this item have been sold out! Try buying from other users on the website." descText =
"All copies of this item have been sold out! Try buying from other users on the website."
return true, nil, nil, true, descText return true, nil, nil, true, descText
end end
if not updatedBalance then if not updatedBalance then
descText = "Could not update your balance. Please check back after some time." descText =
"Could not update your balance. Please check back after some time."
return true, nil, nil, true, descText return true, nil, nil, true, descText
end end
@ -844,9 +953,11 @@ function startSpinner()
while pos < 8 do while pos < 8 do
if pos == spinPos or pos == ((spinPos + 1) % 8) then if pos == spinPos or pos == ((spinPos + 1) % 8) then
spinnerIcons[pos + 1].Image = "http://www.roblox.com/Asset/?id=45880668" spinnerIcons[pos + 1].Image =
"http://banland.xyz/Asset/?id=45880668"
else else
spinnerIcons[pos + 1].Image = "http://www.roblox.com/Asset/?id=45880710" spinnerIcons[pos + 1].Image =
"http://banland.xyz/Asset/?id=45880710"
end end
pos = pos + 1 pos = pos + 1
@ -904,7 +1015,7 @@ function createSpinner(size, position, parent)
) )
spinnerImage.BackgroundTransparency = 1 spinnerImage.BackgroundTransparency = 1
spinnerImage.ZIndex = 10 spinnerImage.ZIndex = 10
spinnerImage.Image = "http://www.roblox.com/Asset/?id=45880710" spinnerImage.Image = "http://banland.xyz/Asset/?id=45880710"
spinnerImage.Parent = spinnerFrame spinnerImage.Parent = spinnerFrame
spinnerIcons[spinnerNum] = spinnerImage spinnerIcons[spinnerNum] = spinnerImage
@ -919,7 +1030,8 @@ function createPurchasePromptGui()
purchaseDialog.Size = UDim2.new(0, 660, 0, 400) purchaseDialog.Size = UDim2.new(0, 660, 0, 400)
purchaseDialog.Position = hidePosition purchaseDialog.Position = hidePosition
purchaseDialog.Visible = false purchaseDialog.Visible = false
purchaseDialog.BackgroundColor3 = Color3.new(141 / 255, 141 / 255, 141 / 255) purchaseDialog.BackgroundColor3 =
Color3.new(141 / 255, 141 / 255, 141 / 255)
purchaseDialog.BorderColor3 = Color3.new(204 / 255, 204 / 255, 204 / 255) purchaseDialog.BorderColor3 = Color3.new(204 / 255, 204 / 255, 204 / 255)
purchaseDialog.Parent = game.CoreGui.RobloxGui purchaseDialog.Parent = game.CoreGui.RobloxGui
@ -932,7 +1044,12 @@ function createPurchasePromptGui()
bodyFrame.ZIndex = 8 bodyFrame.ZIndex = 8
bodyFrame.Parent = purchaseDialog bodyFrame.Parent = purchaseDialog
local titleLabel = createTextObject("TitleLabel", "Buy Item", "TextLabel", Enum.FontSize.Size48) local titleLabel = createTextObject(
"TitleLabel",
"Buy Item",
"TextLabel",
Enum.FontSize.Size48
)
titleLabel.ZIndex = 8 titleLabel.ZIndex = 8
titleLabel.Size = UDim2.new(1, 0, 0, 60) titleLabel.Size = UDim2.new(1, 0, 0, 60)
local titleBackdrop = titleLabel:Clone() local titleBackdrop = titleLabel:Clone()
@ -948,7 +1065,8 @@ function createPurchasePromptGui()
local distanceBetweenButtons = 90 local distanceBetweenButtons = 90
local cancelButton = createImageButton "CancelButton" local cancelButton = createImageButton "CancelButton"
cancelButton.Position = UDim2.new(0.5, (distanceBetweenButtons / 2), 1, -120) cancelButton.Position =
UDim2.new(0.5, (distanceBetweenButtons / 2), 1, -120)
cancelButton.BackgroundTransparency = 1 cancelButton.BackgroundTransparency = 1
cancelButton.BorderSizePixel = 0 cancelButton.BorderSizePixel = 0
cancelButton.Parent = bodyFrame cancelButton.Parent = bodyFrame
@ -967,7 +1085,8 @@ function createPurchasePromptGui()
cancelButton.MouseButton1Click:connect(doDeclinePurchase) cancelButton.MouseButton1Click:connect(doDeclinePurchase)
local buyButton = createImageButton "BuyButton" local buyButton = createImageButton "BuyButton"
buyButton.Position = UDim2.new(0.5, -153 - (distanceBetweenButtons / 2), 1, -120) buyButton.Position =
UDim2.new(0.5, -153 - (distanceBetweenButtons / 2), 1, -120)
buyButton.BackgroundTransparency = 1 buyButton.BackgroundTransparency = 1
buyButton.BorderSizePixel = 0 buyButton.BorderSizePixel = 0
buyButton.Image = buyImageUrl buyButton.Image = buyImageUrl
@ -1103,12 +1222,21 @@ function createPurchasePromptGui()
purchasingFrame.Active = true purchasingFrame.Active = true
purchasingFrame.Parent = purchaseDialog purchasingFrame.Parent = purchaseDialog
local purchasingLabel = createTextObject("PurchasingLabel", "Purchasing...", "TextLabel", Enum.FontSize.Size48) local purchasingLabel = createTextObject(
"PurchasingLabel",
"Purchasing...",
"TextLabel",
Enum.FontSize.Size48
)
purchasingLabel.Size = UDim2.new(1, 0, 1, 0) purchasingLabel.Size = UDim2.new(1, 0, 1, 0)
purchasingLabel.ZIndex = 10 purchasingLabel.ZIndex = 10
purchasingLabel.Parent = purchasingFrame purchasingLabel.Parent = purchasingFrame
createSpinner(UDim2.new(0, 50, 0, 50), UDim2.new(0.5, -25, 0.5, 30), purchasingLabel) createSpinner(
UDim2.new(0, 50, 0, 50),
UDim2.new(0.5, -25, 0.5, 30),
purchasingLabel
)
end end
-- next two functions control the "Purchasing..." overlay -- next two functions control the "Purchasing..." overlay
@ -1186,7 +1314,13 @@ function changeGuiToScreenSize(smallScreen)
end end
end end
function doPurchasePrompt(player, assetId, equipIfPurchased, currencyType, productId) function doPurchasePrompt(
player,
assetId,
equipIfPurchased,
currencyType,
productId
)
if not purchaseDialog then if not purchaseDialog then
createPurchasePromptGui() createPurchasePromptGui()
end end
@ -1216,23 +1350,31 @@ function userPurchaseProductActionsEnded(userIsClosingDialog)
closePurchasePrompt() closePurchasePrompt()
if currentServerResponseTable then if currentServerResponseTable then
local isPurchased = false local isPurchased = false
if tostring(currentServerResponseTable["isValid"]):lower() == "true" then if
tostring(currentServerResponseTable["isValid"]):lower()
== "true"
then
isPurchased = true isPurchased = true
end end
Game:GetService("MarketplaceService"):SignalPromptProductPurchaseFinished( Game:GetService("MarketplaceService")
tonumber(currentServerResponseTable["playerId"]), :SignalPromptProductPurchaseFinished(
tonumber(currentServerResponseTable["productId"]), tonumber(currentServerResponseTable["playerId"]),
isPurchased tonumber(currentServerResponseTable["productId"]),
) isPurchased
)
else else
print "Something went wrong, no currentServerResponseTable" print "Something went wrong, no currentServerResponseTable"
end end
removeCurrentPurchaseInfo() removeCurrentPurchaseInfo()
else else
local newPurchasedSucceededText = local newPurchasedSucceededText = string.gsub(
string.gsub(purchaseSucceededText, "itemName", tostring(currentProductInfo["Name"])) purchaseSucceededText,
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text = newPurchasedSucceededText "itemName",
tostring(currentProductInfo["Name"])
)
purchaseDialog.BodyFrame.ItemPreview.ItemDescription.Text =
newPurchasedSucceededText
setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton) setButtonsVisible(purchaseDialog.BodyFrame.OkPurchasedButton)
hidePurchasing() hidePurchasing()
end end
@ -1247,7 +1389,8 @@ function doProcessServerPurchaseResponse(serverResponseTable)
if if
serverResponseTable["playerId"] serverResponseTable["playerId"]
and tonumber(serverResponseTable["playerId"]) == game.Players.LocalPlayer.userId and tonumber(serverResponseTable["playerId"])
== game.Players.LocalPlayer.userId
then then
currentServerResponseTable = serverResponseTable currentServerResponseTable = serverResponseTable
userPurchaseProductActionsEnded(false) userPurchaseProductActionsEnded(false)
@ -1269,9 +1412,10 @@ Game:GetService("MarketplaceService").PromptPurchaseRequested
doPurchasePrompt(player, assetId, equipIfPurchased, currencyType, nil) doPurchasePrompt(player, assetId, equipIfPurchased, currencyType, nil)
end) end)
Game:GetService("MarketplaceService").ServerPurchaseVerification:connect(function(serverResponseTable) Game:GetService("MarketplaceService").ServerPurchaseVerification
doProcessServerPurchaseResponse(serverResponseTable) :connect(function(serverResponseTable)
end) doProcessServerPurchaseResponse(serverResponseTable)
end)
if enableBrowserWindowClosedEvent then if enableBrowserWindowClosedEvent then
Game:GetService("GuiService").BrowserWindowClosed:connect(function() Game:GetService("GuiService").BrowserWindowClosed:connect(function()
@ -1280,7 +1424,9 @@ if enableBrowserWindowClosedEvent then
end end
Game.CoreGui.RobloxGui.Changed:connect(function() Game.CoreGui.RobloxGui.Changed:connect(function()
local nowIsSmallScreen = (game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold) local nowIsSmallScreen = (
game.CoreGui.RobloxGui.AbsoluteSize.Y <= smallScreenThreshold
)
if nowIsSmallScreen and not isSmallScreen then if nowIsSmallScreen and not isSmallScreen then
changeGuiToScreenSize(true) changeGuiToScreenSize(true)
elseif not nowIsSmallScreen and isSmallScreen then elseif not nowIsSmallScreen and isSmallScreen then

View File

@ -1,5 +1,6 @@
print "[Mercury]: Loaded corescript 152908679"
-- ContextActionTouch.lua -- ContextActionTouch.lua
-- 2014, created by Ben Tkacheff
-- this script controls ui and firing of lua functions that are bound in ContextActionService for touch inputs -- this script controls ui and firing of lua functions that are bound in ContextActionService for touch inputs
-- Essentially a user can bind a lua function to a key code, input type (mousebutton1 etc.) and this -- Essentially a user can bind a lua function to a key code, input type (mousebutton1 etc.) and this
@ -8,8 +9,8 @@ local contextActionService = Game:GetService "ContextActionService"
local isTouchDevice = Game:GetService("UserInputService").TouchEnabled local isTouchDevice = Game:GetService("UserInputService").TouchEnabled
local functionTable = {} local functionTable = {}
local buttonVector = {} local buttonVector = {}
local buttonScreenGui = nil local buttonScreenGui
local buttonFrame = nil local buttonFrame
local ContextDownImage = "http://www.banland.xyz/asset/?id=97166756" local ContextDownImage = "http://www.banland.xyz/asset/?id=97166756"
local ContextUpImage = "http://www.banland.xyz/asset/?id=97166444" local ContextUpImage = "http://www.banland.xyz/asset/?id=97166444"
@ -72,14 +73,22 @@ end
function contextButtonDown(button, inputObject, actionName) function contextButtonDown(button, inputObject, actionName)
if inputObject.UserInputType == Enum.UserInputType.Touch then if inputObject.UserInputType == Enum.UserInputType.Touch then
button.Image = ContextDownImage button.Image = ContextDownImage
contextActionService:CallFunction(actionName, Enum.UserInputState.Begin, inputObject) contextActionService:CallFunction(
actionName,
Enum.UserInputState.Begin,
inputObject
)
end end
end end
function contextButtonMoved(button, inputObject, actionName) function contextButtonMoved(button, inputObject, actionName)
if inputObject.UserInputType == Enum.UserInputType.Touch then if inputObject.UserInputType == Enum.UserInputType.Touch then
button.Image = ContextDownImage button.Image = ContextDownImage
contextActionService:CallFunction(actionName, Enum.UserInputState.Change, inputObject) contextActionService:CallFunction(
actionName,
Enum.UserInputState.Change,
inputObject
)
end end
end end
@ -89,7 +98,11 @@ function contextButtonUp(button, inputObject, actionName)
inputObject.UserInputType == Enum.UserInputType.Touch inputObject.UserInputType == Enum.UserInputType.Touch
and inputObject.UserInputState == Enum.UserInputState.End and inputObject.UserInputState == Enum.UserInputState.End
then then
contextActionService:CallFunction(actionName, Enum.UserInputState.End, inputObject) contextActionService:CallFunction(
actionName,
Enum.UserInputState.End,
inputObject
)
end end
end end
@ -109,7 +122,7 @@ function createNewButton(actionName, functionInfoTable)
contextButton.Image = ContextUpImage contextButton.Image = ContextUpImage
contextButton.Parent = buttonFrame contextButton.Parent = buttonFrame
local currentButtonTouch = nil local currentButtonTouch
Game:GetService("UserInputService").InputEnded:connect(function(inputObject) Game:GetService("UserInputService").InputEnded:connect(function(inputObject)
oldTouches[inputObject] = nil oldTouches[inputObject] = nil
@ -119,7 +132,10 @@ function createNewButton(actionName, functionInfoTable)
return return
end end
if inputObject.UserInputState == Enum.UserInputState.Begin and currentButtonTouch == nil then if
inputObject.UserInputState == Enum.UserInputState.Begin
and currentButtonTouch == nil
then
currentButtonTouch = inputObject currentButtonTouch = inputObject
contextButtonDown(contextButton, inputObject, actionName) contextButtonDown(contextButton, inputObject, actionName)
end end
@ -152,7 +168,10 @@ function createNewButton(actionName, functionInfoTable)
actionIcon.Position = UDim2.new(0.175, 0, 0.175, 0) actionIcon.Position = UDim2.new(0.175, 0, 0.175, 0)
actionIcon.Size = UDim2.new(0.65, 0, 0.65, 0) actionIcon.Size = UDim2.new(0.65, 0, 0.65, 0)
actionIcon.BackgroundTransparency = 1 actionIcon.BackgroundTransparency = 1
if functionInfoTable["image"] and type(functionInfoTable["image"]) == "string" then if
functionInfoTable["image"]
and type(functionInfoTable["image"]) == "string"
then
actionIcon.Image = functionInfoTable["image"] actionIcon.Image = functionInfoTable["image"]
end end
actionIcon.Parent = contextButton actionIcon.Parent = contextButton
@ -167,7 +186,10 @@ function createNewButton(actionName, functionInfoTable)
actionTitle.FontSize = Enum.FontSize.Size18 actionTitle.FontSize = Enum.FontSize.Size18
actionTitle.TextWrapped = true actionTitle.TextWrapped = true
actionTitle.Text = "" actionTitle.Text = ""
if functionInfoTable["title"] and type(functionInfoTable["title"]) == "string" then if
functionInfoTable["title"]
and type(functionInfoTable["title"]) == "string"
then
actionTitle.Text = functionInfoTable["title"] actionTitle.Text = functionInfoTable["title"]
end end
actionTitle.Parent = contextButton actionTitle.Parent = contextButton
@ -178,7 +200,7 @@ end
function createButton(actionName, functionInfoTable) function createButton(actionName, functionInfoTable)
local button = createNewButton(actionName, functionInfoTable) local button = createNewButton(actionName, functionInfoTable)
local position = nil local position
for i = 1, #buttonVector do for i = 1, #buttonVector do
if buttonVector[i] == "empty" then if buttonVector[i] == "empty" then
position = i position = i
@ -240,26 +262,30 @@ function addAction(actionName, createTouchButton, functionInfoTable)
end end
-- Connections -- Connections
contextActionService.BoundActionChanged:connect(function(actionName, changeName, changeTable) contextActionService.BoundActionChanged:connect(
if functionTable[actionName] and changeTable then function(actionName, changeName, changeTable)
local button = functionTable[actionName]["button"] if functionTable[actionName] and changeTable then
if button then local button = functionTable[actionName]["button"]
if changeName == "image" then if button then
button.ActionIcon.Image = changeTable[changeName] if changeName == "image" then
elseif changeName == "title" then button.ActionIcon.Image = changeTable[changeName]
button.ActionTitle.Text = changeTable[changeName] elseif changeName == "title" then
-- elseif changeName == "description" then button.ActionTitle.Text = changeTable[changeName]
-- -- todo: add description to menu -- elseif changeName == "description" then
elseif changeName == "position" then -- -- todo: add description to menu
button.Position = changeTable[changeName] elseif changeName == "position" then
button.Position = changeTable[changeName]
end
end end
end end
end end
end) )
contextActionService.BoundActionAdded:connect(function(actionName, createTouchButton, functionInfoTable) contextActionService.BoundActionAdded:connect(
addAction(actionName, createTouchButton, functionInfoTable) function(actionName, createTouchButton, functionInfoTable)
end) addAction(actionName, createTouchButton, functionInfoTable)
end
)
contextActionService.BoundActionRemoved:connect(function(actionName, _) contextActionService.BoundActionRemoved:connect(function(actionName, _)
removeAction(actionName) removeAction(actionName)
@ -267,7 +293,10 @@ end)
contextActionService.GetActionButtonEvent:connect(function(actionName) contextActionService.GetActionButtonEvent:connect(function(actionName)
if functionTable[actionName] then if functionTable[actionName] then
contextActionService:FireActionButtonFoundSignal(actionName, functionTable[actionName]["button"]) contextActionService:FireActionButtonFoundSignal(
actionName,
functionTable[actionName]["button"]
)
end end
end) end)

View File

@ -1,6 +1,7 @@
print "[Mercury]: Loaded corescript 153556783"
-- This is responsible for all touch controls we show (as of this writing, only on iOS) -- This is responsible for all touch controls we show (as of this writing, only on iOS)
-- this includes character move thumbsticks, and buttons for jump, use of items, camera, etc. -- this includes character move thumbsticks, and buttons for jump, use of items, camera, etc.
-- Written by Ben Tkacheff, 2013
-- obligatory stuff to make sure we don't access nil data -- obligatory stuff to make sure we don't access nil data
while not Game do while not Game do
@ -51,13 +52,13 @@ if isSmallScreenDevice() then
jumpButtonSize = 70 jumpButtonSize = 70
end end
local oldJumpTouches = {} local oldJumpTouches = {}
local currentJumpTouch = nil local currentJumpTouch
local CameraRotateSensitivity = 0.007 local CameraRotateSensitivity = 0.007
local CameraRotateDeadZone = CameraRotateSensitivity * 16 local CameraRotateDeadZone = CameraRotateSensitivity * 16
local CameraZoomSensitivity = 0.03 local CameraZoomSensitivity = 0.03
local PinchZoomDelay = 0.2 local PinchZoomDelay = 0.2
local cameraTouch = nil local cameraTouch
-- make sure all of our images are good to go -- make sure all of our images are good to go
Game:GetService("ContentProvider"):Preload(touchControlsSheet) Game:GetService("ContentProvider"):Preload(touchControlsSheet)
@ -88,14 +89,20 @@ function rotatePointAboutLocation(pointToRotate, pointToRotateAbout, radians)
local transformedPoint = pointToRotate local transformedPoint = pointToRotate
-- translate point back to origin: -- translate point back to origin:
transformedPoint = Vector2.new(transformedPoint.x - pointToRotateAbout.x, transformedPoint.y - pointToRotateAbout.y) transformedPoint = Vector2.new(
transformedPoint.x - pointToRotateAbout.x,
transformedPoint.y - pointToRotateAbout.y
)
-- rotate point -- rotate point
local xNew = transformedPoint.x * cosAnglePercent - transformedPoint.y * sinAnglePercent local xNew = transformedPoint.x * cosAnglePercent
local yNew = transformedPoint.x * sinAnglePercent + transformedPoint.y * cosAnglePercent - transformedPoint.y * sinAnglePercent
local yNew = transformedPoint.x * sinAnglePercent
+ transformedPoint.y * cosAnglePercent
-- translate point back: -- translate point back:
transformedPoint = Vector2.new(xNew + pointToRotateAbout.x, yNew + pointToRotateAbout.y) transformedPoint =
Vector2.new(xNew + pointToRotateAbout.x, yNew + pointToRotateAbout.y)
return transformedPoint return transformedPoint
end end
@ -104,12 +111,17 @@ function dotProduct(v1, v2)
return ((v1.x * v2.x) + (v1.y * v2.y)) return ((v1.x * v2.x) + (v1.y * v2.y))
end end
function stationaryThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLocation) function stationaryThumbstickTouchMove(
thumbstickFrame,
thumbstickOuter,
touchLocation
)
local thumbstickOuterCenterPosition = Vector2.new( local thumbstickOuterCenterPosition = Vector2.new(
thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x / 2, thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x / 2,
thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y / 2 thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y / 2
) )
local centerDiff = DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenterPosition) local centerDiff =
DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenterPosition)
-- thumbstick is moving outside our region, need to cap its distance -- thumbstick is moving outside our region, need to cap its distance
if centerDiff > (thumbstickSize / 2) then if centerDiff > (thumbstickSize / 2) then
@ -125,10 +137,15 @@ function stationaryThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLo
normal = Vector2.new(normal.x, 0) normal = Vector2.new(normal.x, 0)
end end
local newThumbstickInnerPosition = thumbstickOuterCenterPosition + (normal * (thumbstickSize / 2)) local newThumbstickInnerPosition = thumbstickOuterCenterPosition
thumbstickFrame.Position = transformFromCenterToTopLeft(newThumbstickInnerPosition, thumbstickFrame) + (normal * (thumbstickSize / 2))
thumbstickFrame.Position = transformFromCenterToTopLeft(
newThumbstickInnerPosition,
thumbstickFrame
)
else else
thumbstickFrame.Position = transformFromCenterToTopLeft(touchLocation, thumbstickFrame) thumbstickFrame.Position =
transformFromCenterToTopLeft(touchLocation, thumbstickFrame)
end end
return Vector2.new( return Vector2.new(
@ -137,44 +154,69 @@ function stationaryThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLo
) )
end end
function followThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLocation) function followThumbstickTouchMove(
thumbstickFrame,
thumbstickOuter,
touchLocation
)
local thumbstickOuterCenter = Vector2.new( local thumbstickOuterCenter = Vector2.new(
thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x / 2, thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x / 2,
thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y / 2 thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y / 2
) )
-- thumbstick is moving outside our region, need to position outer thumbstick texture carefully (to make look and feel like actual joystick controller) -- thumbstick is moving outside our region, need to position outer thumbstick texture carefully (to make look and feel like actual joystick controller)
if DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenter) > thumbstickSize / 2 then if
DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenter)
> thumbstickSize / 2
then
local thumbstickInnerCenter = Vector2.new( local thumbstickInnerCenter = Vector2.new(
thumbstickFrame.Position.X.Offset + thumbstickFrame.AbsoluteSize.x / 2, thumbstickFrame.Position.X.Offset
thumbstickFrame.Position.Y.Offset + thumbstickFrame.AbsoluteSize.y / 2 + thumbstickFrame.AbsoluteSize.x / 2,
thumbstickFrame.Position.Y.Offset
+ thumbstickFrame.AbsoluteSize.y / 2
) )
local movementVectorUnit = local movementVectorUnit = Vector2.new(
Vector2.new(touchLocation.x - thumbstickInnerCenter.x, touchLocation.y - thumbstickInnerCenter.y).unit touchLocation.x - thumbstickInnerCenter.x,
touchLocation.y - thumbstickInnerCenter.y
).unit
local outerToInnerVectorCurrent = Vector2.new( local outerToInnerVectorCurrent = Vector2.new(
thumbstickInnerCenter.x - thumbstickOuterCenter.x, thumbstickInnerCenter.x - thumbstickOuterCenter.x,
thumbstickInnerCenter.y - thumbstickOuterCenter.y thumbstickInnerCenter.y - thumbstickOuterCenter.y
) )
local outerToInnerVectorCurrentUnit = outerToInnerVectorCurrent.unit local outerToInnerVectorCurrentUnit = outerToInnerVectorCurrent.unit
local movementVector = local movementVector = Vector2.new(
Vector2.new(touchLocation.x - thumbstickInnerCenter.x, touchLocation.y - thumbstickInnerCenter.y) touchLocation.x - thumbstickInnerCenter.x,
touchLocation.y - thumbstickInnerCenter.y
)
-- First, find the angle between the new thumbstick movement vector, -- First, find the angle between the new thumbstick movement vector,
-- and the vector between thumbstick inner and thumbstick outer. -- and the vector between thumbstick inner and thumbstick outer.
-- We will use this to pivot thumbstick outer around thumbstick inner, gives a nice joystick feel -- We will use this to pivot thumbstick outer around thumbstick inner, gives a nice joystick feel
local crossOuterToInnerWithMovement = (outerToInnerVectorCurrentUnit.x * movementVectorUnit.y) local crossOuterToInnerWithMovement = (
- (outerToInnerVectorCurrentUnit.y * movementVectorUnit.x) outerToInnerVectorCurrentUnit.x * movementVectorUnit.y
local angle = ) - (outerToInnerVectorCurrentUnit.y * movementVectorUnit.x)
math.atan2(crossOuterToInnerWithMovement, dotProduct(outerToInnerVectorCurrentUnit, movementVectorUnit)) local angle = math.atan2(
local anglePercent = angle * math.min(movementVector.magnitude / outerToInnerVectorCurrent.magnitude, 1.0) crossOuterToInnerWithMovement,
dotProduct(outerToInnerVectorCurrentUnit, movementVectorUnit)
)
local anglePercent = angle
* math.min(
movementVector.magnitude / outerToInnerVectorCurrent.magnitude,
1.0
)
-- If angle is significant, rotate about the inner thumbsticks current center -- If angle is significant, rotate about the inner thumbsticks current center
if math.abs(anglePercent) > 0.00001 then if math.abs(anglePercent) > 0.00001 then
local outerThumbCenter = local outerThumbCenter = rotatePointAboutLocation(
rotatePointAboutLocation(thumbstickOuterCenter, thumbstickInnerCenter, anglePercent) thumbstickOuterCenter,
thumbstickOuter.Position = thumbstickInnerCenter,
transformFromCenterToTopLeft(Vector2.new(outerThumbCenter.x, outerThumbCenter.y), thumbstickOuter) anglePercent
)
thumbstickOuter.Position = transformFromCenterToTopLeft(
Vector2.new(outerThumbCenter.x, outerThumbCenter.y),
thumbstickOuter
)
end end
-- now just translate outer thumbstick to make sure it stays nears inner thumbstick -- now just translate outer thumbstick to make sure it stays nears inner thumbstick
@ -186,13 +228,27 @@ function followThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLocati
) )
end end
thumbstickFrame.Position = transformFromCenterToTopLeft(touchLocation, thumbstickFrame) thumbstickFrame.Position =
transformFromCenterToTopLeft(touchLocation, thumbstickFrame)
-- a bit of error checking to make sure thumbsticks stay close to eachother -- a bit of error checking to make sure thumbsticks stay close to eachother
local thumbstickFramePosition = Vector2.new(thumbstickFrame.Position.X.Offset, thumbstickFrame.Position.Y.Offset) local thumbstickFramePosition = Vector2.new(
local thumbstickOuterPosition = Vector2.new(thumbstickOuter.Position.X.Offset, thumbstickOuter.Position.Y.Offset) thumbstickFrame.Position.X.Offset,
if DistanceBetweenTwoPoints(thumbstickFramePosition, thumbstickOuterPosition) > thumbstickSize / 2 then thumbstickFrame.Position.Y.Offset
local vectorWithLength = (thumbstickOuterPosition - thumbstickFramePosition).unit * thumbstickSize / 2 )
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( thumbstickOuter.Position = UDim2.new(
0, 0,
thumbstickFramePosition.x + vectorWithLength.x, thumbstickFramePosition.x + vectorWithLength.x,
@ -208,10 +264,17 @@ function followThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLocati
end end
function movementOutsideDeadZone(movementVector) function movementOutsideDeadZone(movementVector)
return ((math.abs(movementVector.x) > ThumbstickDeadZone) or (math.abs(movementVector.y) > ThumbstickDeadZone)) return (
(math.abs(movementVector.x) > ThumbstickDeadZone)
or (math.abs(movementVector.y) > ThumbstickDeadZone)
)
end end
function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThumbstick) function constructThumbstick(
defaultThumbstickPos,
updateFunction,
stationaryThumbstick
)
local thumbstickFrame = Instance.new "Frame" local thumbstickFrame = Instance.new "Frame"
thumbstickFrame.Name = "ThumbstickFrame" thumbstickFrame.Name = "ThumbstickFrame"
thumbstickFrame.Active = true thumbstickFrame.Active = true
@ -235,7 +298,8 @@ function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThu
innerThumbstick.ImageRectOffset = Vector2.new(220, 0) innerThumbstick.ImageRectOffset = Vector2.new(220, 0)
innerThumbstick.ImageRectSize = Vector2.new(111, 111) innerThumbstick.ImageRectSize = Vector2.new(111, 111)
innerThumbstick.BackgroundTransparency = 1 innerThumbstick.BackgroundTransparency = 1
innerThumbstick.Size = UDim2.new(0, thumbstickSize / 2, 0, thumbstickSize / 2) innerThumbstick.Size =
UDim2.new(0, thumbstickSize / 2, 0, thumbstickSize / 2)
innerThumbstick.Position = UDim2.new( innerThumbstick.Position = UDim2.new(
0, 0,
thumbstickFrame.Size.X.Offset / 2 - thumbstickSize / 4, thumbstickFrame.Size.X.Offset / 2 - thumbstickSize / 4,
@ -245,9 +309,9 @@ function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThu
innerThumbstick.Parent = thumbstickFrame innerThumbstick.Parent = thumbstickFrame
innerThumbstick.ZIndex = 2 innerThumbstick.ZIndex = 2
local thumbstickTouch = nil local thumbstickTouch
local userInputServiceTouchMovedCon = nil local userInputServiceTouchMovedCon
local userInputSeviceTouchEndedCon = nil local userInputSeviceTouchEndedCon
local startInputTracking = function(inputObject) local startInputTracking = function(inputObject)
if thumbstickTouch then if thumbstickTouch then
@ -266,52 +330,68 @@ function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThu
thumbstickTouch = inputObject thumbstickTouch = inputObject
table.insert(thumbstickTouches, thumbstickTouch) table.insert(thumbstickTouches, thumbstickTouch)
thumbstickFrame.Position = transformFromCenterToTopLeft(thumbstickTouch.Position, thumbstickFrame) thumbstickFrame.Position = transformFromCenterToTopLeft(
thumbstickTouch.Position,
thumbstickFrame
)
outerThumbstick.Position = thumbstickFrame.Position outerThumbstick.Position = thumbstickFrame.Position
userInputServiceTouchMovedCon = userInputService.TouchMoved:connect(function(movedInput) userInputServiceTouchMovedCon = userInputService.TouchMoved:connect(
if movedInput == thumbstickTouch then function(movedInput)
local movementVector = nil if movedInput == thumbstickTouch then
if stationaryThumbstick then local movementVector
movementVector = stationaryThumbstickTouchMove( if stationaryThumbstick then
thumbstickFrame, movementVector = stationaryThumbstickTouchMove(
outerThumbstick, thumbstickFrame,
Vector2.new(movedInput.Position.x, movedInput.Position.y) outerThumbstick,
) Vector2.new(
else movedInput.Position.x,
movementVector = followThumbstickTouchMove( movedInput.Position.y
thumbstickFrame, )
outerThumbstick, )
Vector2.new(movedInput.Position.x, movedInput.Position.y) else
) movementVector = followThumbstickTouchMove(
end thumbstickFrame,
outerThumbstick,
Vector2.new(
movedInput.Position.x,
movedInput.Position.y
)
)
end
if updateFunction then if updateFunction then
updateFunction(movementVector, outerThumbstick.Size.X.Offset / 2) updateFunction(
end movementVector,
end outerThumbstick.Size.X.Offset / 2
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
end end
thumbstickTouch = nil
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 end
userInputService.Changed:connect(function(prop) userInputService.Changed:connect(function(prop)
@ -335,28 +415,43 @@ function setupCharacterMovement(parentFrame)
lastMaxMovement = maxMovement lastMaxMovement = maxMovement
-- sometimes rounding error will not allow us to go max speed at some -- sometimes rounding error will not allow us to go max speed at some
-- thumbstick angles, fix this with a bit of fudging near 100% throttle -- thumbstick angles, fix this with a bit of fudging near 100% throttle
if movementVector.magnitude / maxMovement > ThumbstickMaxPercentGive then if
movementVector.magnitude / maxMovement
> ThumbstickMaxPercentGive
then
maxMovement = movementVector.magnitude - 1 maxMovement = movementVector.magnitude - 1
end end
moveCharacterFunc(localPlayer, movementVector, maxMovement) moveCharacterFunc(localPlayer, movementVector, maxMovement)
else else
lastMovementVector = Vector2.new(0, 0) lastMovementVector = Vector2.new(0, 0)
lastMaxMovement = 1 lastMaxMovement = 1
moveCharacterFunc(localPlayer, lastMovementVector, lastMaxMovement) moveCharacterFunc(
localPlayer,
lastMovementVector,
lastMaxMovement
)
end end
end end
end end
local thumbstickPos = UDim2.new(0, thumbstickSize / 2, 1, -thumbstickSize * 1.75) local thumbstickPos =
UDim2.new(0, thumbstickSize / 2, 1, -thumbstickSize * 1.75)
if isSmallScreenDevice() then if isSmallScreenDevice() then
thumbstickPos = UDim2.new(0, (thumbstickSize / 2) - 10, 1, -thumbstickSize - 20) thumbstickPos =
UDim2.new(0, (thumbstickSize / 2) - 10, 1, -thumbstickSize - 20)
end end
local characterThumbstick = constructThumbstick(thumbstickPos, moveCharacterFunction, false) local characterThumbstick =
constructThumbstick(thumbstickPos, moveCharacterFunction, false)
characterThumbstick.Name = "CharacterThumbstick" characterThumbstick.Name = "CharacterThumbstick"
characterThumbstick.Parent = parentFrame characterThumbstick.Parent = parentFrame
local refreshCharacterMovement = function() local refreshCharacterMovement = function()
if localPlayer and moveCharacterFunc and lastMovementVector and lastMaxMovement then if
localPlayer
and moveCharacterFunc
and lastMovementVector
and lastMaxMovement
then
moveCharacterFunc(localPlayer, lastMovementVector, lastMaxMovement) moveCharacterFunc(localPlayer, lastMovementVector, lastMaxMovement)
end end
end end
@ -372,9 +467,11 @@ function setupJumpButton(parentFrame)
jumpButton.ImageRectSize = Vector2.new(174, 174) jumpButton.ImageRectSize = Vector2.new(174, 174)
jumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize) jumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize)
if isSmallScreenDevice() then if isSmallScreenDevice() then
jumpButton.Position = UDim2.new(1, -(jumpButtonSize * 2.25), 1, -jumpButtonSize - 20) jumpButton.Position =
UDim2.new(1, -(jumpButtonSize * 2.25), 1, -jumpButtonSize - 20)
else else
jumpButton.Position = UDim2.new(1, -(jumpButtonSize * 2.75), 1, -jumpButtonSize - 120) jumpButton.Position =
UDim2.new(1, -(jumpButtonSize * 2.75), 1, -jumpButtonSize - 120)
end end
local playerJumpFunc = localPlayer.JumpCharacter local playerJumpFunc = localPlayer.JumpCharacter
@ -464,16 +561,16 @@ function isTouchUsedByThumbstick(touch)
end end
function setupCameraControl(parentFrame, refreshCharacterMoveFunc) function setupCameraControl(parentFrame, refreshCharacterMoveFunc)
local lastPos = nil local lastPos
local hasRotatedCamera = false local hasRotatedCamera = false
local rotateCameraFunc = userInputService.RotateCamera local rotateCameraFunc = userInputService.RotateCamera
local pinchTime = -1 local pinchTime = -1
local shouldPinch = false local shouldPinch = false
local lastPinchScale = nil local lastPinchScale
local zoomCameraFunc = userInputService.ZoomCamera local zoomCameraFunc = userInputService.ZoomCamera
local pinchTouches = {} local pinchTouches = {}
local pinchFrame = nil local pinchFrame
local resetCameraRotateState = function() local resetCameraRotateState = function()
cameraTouch = nil cameraTouch = nil
@ -509,35 +606,48 @@ function setupCameraControl(parentFrame, refreshCharacterMoveFunc)
if lastPinchScale == nil then -- first pinch move, just set up scale if lastPinchScale == nil then -- first pinch move, just set up scale
if inputObject == firstTouch then if inputObject == firstTouch then
lastPinchScale = (inputObject.Position - secondTouch.Position).magnitude lastPinchScale = (
inputObject.Position - secondTouch.Position
).magnitude
firstTouch = inputObject firstTouch = inputObject
elseif inputObject == secondTouch then elseif inputObject == secondTouch then
lastPinchScale = (inputObject.Position - firstTouch.Position).magnitude lastPinchScale = (
inputObject.Position - firstTouch.Position
).magnitude
secondTouch = inputObject secondTouch = inputObject
end end
else -- we are now actually pinching, do comparison to last pinch size else -- we are now actually pinching, do comparison to last pinch size
local newPinchDistance = 0 local newPinchDistance = 0
if inputObject == firstTouch then if inputObject == firstTouch then
newPinchDistance = (inputObject.Position - secondTouch.Position).magnitude newPinchDistance = (
inputObject.Position - secondTouch.Position
).magnitude
firstTouch = inputObject firstTouch = inputObject
elseif inputObject == secondTouch then elseif inputObject == secondTouch then
newPinchDistance = (inputObject.Position - firstTouch.Position).magnitude newPinchDistance = (
inputObject.Position - firstTouch.Position
).magnitude
secondTouch = inputObject secondTouch = inputObject
end end
if newPinchDistance ~= 0 then if newPinchDistance ~= 0 then
local pinchDiff = newPinchDistance - lastPinchScale local pinchDiff = newPinchDistance - lastPinchScale
if pinchDiff ~= 0 then if pinchDiff ~= 0 then
zoomCameraFunc(userInputService, (pinchDiff * CameraZoomSensitivity)) zoomCameraFunc(
userInputService,
(pinchDiff * CameraZoomSensitivity)
)
end end
lastPinchScale = newPinchDistance lastPinchScale = newPinchDistance
end end
end end
end) end)
pinchFrame.InputEnded:connect(function(inputObject) -- pinch is over, destroy all pinchFrame.InputEnded:connect(
if inputObject == firstTouch or inputObject == secondTouch then function(inputObject) -- pinch is over, destroy all
resetPinchState() if inputObject == firstTouch or inputObject == secondTouch then
resetPinchState()
end
end end
end) )
end end
local pinchGestureReceivedTouch = function(inputObject) local pinchGestureReceivedTouch = function(inputObject)
@ -572,7 +682,8 @@ function setupCameraControl(parentFrame, refreshCharacterMoveFunc)
if cameraTouch == nil and not usedByThumbstick then if cameraTouch == nil and not usedByThumbstick then
cameraTouch = inputObject cameraTouch = inputObject
lastPos = Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y) lastPos =
Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y)
-- lastTick = tick() -- lastTick = tick()
end end
end) end)
@ -584,11 +695,15 @@ function setupCameraControl(parentFrame, refreshCharacterMoveFunc)
return return
end end
local newPos = Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y) local newPos =
Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y)
local touchDiff = (lastPos - newPos) * CameraRotateSensitivity local touchDiff = (lastPos - newPos) * CameraRotateSensitivity
-- first time rotating outside deadzone, just setup for next changed event -- first time rotating outside deadzone, just setup for next changed event
if not hasRotatedCamera and (touchDiff.magnitude > CameraRotateDeadZone) then if
not hasRotatedCamera
and (touchDiff.magnitude > CameraRotateDeadZone)
then
hasRotatedCamera = true hasRotatedCamera = true
lastPos = newPos lastPos = newPos
end end
@ -630,7 +745,10 @@ function setupTouchControls()
end end
-- kill camera pan if the touch is used by some user controls -- kill camera pan if the touch is used by some user controls
if inputObject == cameraTouch and inputObject.UserInputState == Enum.UserInputState.Begin then if
inputObject == cameraTouch
and inputObject.UserInputState == Enum.UserInputState.Begin
then
cameraTouch = nil cameraTouch = nil
end end
end) end)

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 157877000"
--Include --Include
local Create = assert(LoadLibrary "RbxUtility").Create local Create = assert(LoadLibrary "RbxUtility").Create
@ -257,7 +258,7 @@ function initializeDeveloperConsole()
Position = UDim2.new(0, 0, 0.5, -8), Position = UDim2.new(0, 0, 0.5, -8),
Rotation = 180, Rotation = 180,
Size = UDim2.new(1, 0, 0, 16), Size = UDim2.new(1, 0, 0, 16),
Image = "http://www.roblox.com/Asset?id=151205881", Image = "http://banland.xyz/Asset?id=151205881",
} }
local Dev_DownButton = Create "ImageButton" { local Dev_DownButton = Create "ImageButton" {
@ -276,7 +277,7 @@ function initializeDeveloperConsole()
Position = UDim2.new(0, 3, 0, 3), Position = UDim2.new(0, 3, 0, 3),
Size = UDim2.new(0, 14, 0, 14), Size = UDim2.new(0, 14, 0, 14),
Rotation = 180, Rotation = 180,
Image = "http://www.roblox.com/Asset?id=151205813", Image = "http://banland.xyz/Asset?id=151205813",
} }
local Dev_UpButton = Create "ImageButton" { local Dev_UpButton = Create "ImageButton" {
@ -294,7 +295,7 @@ function initializeDeveloperConsole()
BackgroundTransparency = 1, BackgroundTransparency = 1,
Position = UDim2.new(0, 3, 0, 3), Position = UDim2.new(0, 3, 0, 3),
Size = UDim2.new(0, 14, 0, 14), Size = UDim2.new(0, 14, 0, 14),
Image = "http://www.roblox.com/Asset?id=151205813", Image = "http://banland.xyz/Asset?id=151205813",
} }
local Dev_TextBox = Create "Frame" { local Dev_TextBox = Create "Frame" {
@ -331,7 +332,7 @@ function initializeDeveloperConsole()
Position = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0, 0, 0, 0),
Size = UDim2.new(1, 0, 1, 0), Size = UDim2.new(1, 0, 1, 0),
Rotation = 0, Rotation = 0,
Image = "http://www.roblox.com/Asset?id=152093917", Image = "http://banland.xyz/Asset?id=152093917",
} }
local Dev_ResizeButton = Create "ImageButton" { local Dev_ResizeButton = Create "ImageButton" {
@ -350,7 +351,7 @@ function initializeDeveloperConsole()
Position = UDim2.new(0, 6, 0, 6), Position = UDim2.new(0, 6, 0, 6),
Size = UDim2.new(0.8, 0, 0.8, 0), Size = UDim2.new(0.8, 0, 0.8, 0),
Rotation = 135, Rotation = 135,
Image = "http://www.roblox.com/Asset?id=151205813", Image = "http://banland.xyz/Asset?id=151205813",
} }
Create "TextButton" { Create "TextButton" {
@ -405,7 +406,7 @@ function initializeDeveloperConsole()
BackgroundTransparency = 1, BackgroundTransparency = 1,
Position = UDim2.new(0, 3, 0, 3), Position = UDim2.new(0, 3, 0, 3),
Size = UDim2.new(0, 14, 0, 14), Size = UDim2.new(0, 14, 0, 14),
Image = "http://www.roblox.com/Asset?id=151205852", Image = "http://banland.xyz/Asset?id=151205852",
} }
Create "TextButton" { Create "TextButton" {
@ -433,17 +434,17 @@ function initializeDeveloperConsole()
} }
---Saved Mouse Information ---Saved Mouse Information
local previousMousePos = nil local previousMousePos
local pPos = nil local pPos
local previousMousePosResize = nil local previousMousePosResize
local pSize = nil local pSize
local previousMousePosScroll = nil local previousMousePosScroll
local pScrollHandle = nil local pScrollHandle
local pOffset = nil local pOffset
local scrollUpIsDown = false local scrollUpIsDown = false
local scrollDownIsDown = false local scrollDownIsDown = false
@ -467,7 +468,8 @@ function initializeDeveloperConsole()
end end
local delta = Vector2.new(x, y) - previousMousePos local delta = Vector2.new(x, y) - previousMousePos
Dev_Container.Position = UDim2.new(0, pPos.X + delta.X, 0, pPos.Y + delta.Y) Dev_Container.Position =
UDim2.new(0, pPos.X + delta.X, 0, pPos.Y + delta.Y)
end end
Dev_TitleBar.TextButton.MouseButton1Down:connect(function(x, y) Dev_TitleBar.TextButton.MouseButton1Down:connect(function(x, y)
@ -486,8 +488,12 @@ function initializeDeveloperConsole()
end end
local delta = Vector2.new(x, y) - previousMousePosResize local delta = Vector2.new(x, y) - previousMousePosResize
Dev_Container.Size = Dev_Container.Size = UDim2.new(
UDim2.new(0, math.max(pSize.X + delta.X, minimumSize.X), 0, math.max(pSize.Y + delta.Y, minimumSize.Y)) 0,
math.max(pSize.X + delta.X, minimumSize.X),
0,
math.max(pSize.Y + delta.Y, minimumSize.Y)
)
end end
Dev_Container.Body.ResizeButton.MouseButton1Down:connect(function(x, y) Dev_Container.Body.ResizeButton.MouseButton1Down:connect(function(x, y)
previousMousePosResize = Vector2.new(x, y) previousMousePosResize = Vector2.new(x, y)
@ -526,10 +532,14 @@ function initializeDeveloperConsole()
local x = frameNumber / 5 local x = frameNumber / 5
local smoothStep = x * x * (3 - (2 * x)) local smoothStep = x * x * (3 - (2 * x))
Dev_OptionsButton.ImageLabel.Rotation = smoothStep * 5 * 9 Dev_OptionsButton.ImageLabel.Rotation = smoothStep * 5 * 9
Dev_OptionsBar.Position = UDim2.new(0, (smoothStep * 5 * 50) - 250, 0, 4) Dev_OptionsBar.Position =
UDim2.new(0, (smoothStep * 5 * 50) - 250, 0, 4)
wait() wait()
if (frameNumber <= 0 and optionsHidden) or (frameNumber >= 5 and not optionsHidden) then if
(frameNumber <= 0 and optionsHidden)
or (frameNumber >= 5 and not optionsHidden)
then
animating = false animating = false
end end
until not animating until not animating
@ -591,15 +601,23 @@ function initializeDeveloperConsole()
end end
if if
(outputToggleOn or messageList[i].Type ~= Enum.MessageType.MessageOutput) (
outputToggleOn
or messageList[i].Type ~= Enum.MessageType.MessageOutput
)
and (infoToggleOn or messageList[i].Type ~= Enum.MessageType.MessageInfo) and (infoToggleOn or messageList[i].Type ~= Enum.MessageType.MessageInfo)
and (warningToggleOn or messageList[i].Type ~= Enum.MessageType.MessageWarning) and (warningToggleOn or messageList[i].Type ~= Enum.MessageType.MessageWarning)
and (errorToggleOn or messageList[i].Type ~= Enum.MessageType.MessageError) and (
errorToggleOn
or messageList[i].Type ~= Enum.MessageType.MessageError
)
then then
message.TextWrapped = wordWrapToggleOn message.TextWrapped = wordWrapToggleOn
message.Size = UDim2.new(0.98, 0, 0, 2000) message.Size = UDim2.new(0.98, 0, 0, 2000)
message.Parent = Dev_Container message.Parent = Dev_Container
message.Text = messageList[i].Time .. " -- " .. messageList[i].Message message.Text = messageList[i].Time
.. " -- "
.. messageList[i].Message
message.Size = UDim2.new(0.98, 0, 0, message.TextBounds.Y) message.Size = UDim2.new(0.98, 0, 0, message.TextBounds.Y)
message.Position = UDim2.new(0, 5, 0, posOffset) message.Position = UDim2.new(0, 5, 0, posOffset)
@ -609,7 +627,10 @@ function initializeDeveloperConsole()
if movePosition then if movePosition then
if if
(currentConsole == LOCAL_CONSOLE and localOffset > 0) (currentConsole == LOCAL_CONSOLE and localOffset > 0)
or (currentConsole == SERVER_CONSOLE and serverOffset > 0) or (
currentConsole == SERVER_CONSOLE
and serverOffset > 0
)
then then
changeOffset(message.TextBounds.Y) changeOffset(message.TextBounds.Y)
end end
@ -621,7 +642,9 @@ function initializeDeveloperConsole()
message.TextColor3 = Color3.new(1, 0, 0) message.TextColor3 = Color3.new(1, 0, 0)
elseif messageList[i].Type == Enum.MessageType.MessageInfo then elseif messageList[i].Type == Enum.MessageType.MessageInfo then
message.TextColor3 = Color3.new(0.4, 0.5, 1) message.TextColor3 = Color3.new(0.4, 0.5, 1)
elseif messageList[i].Type == Enum.MessageType.MessageWarning then elseif
messageList[i].Type == Enum.MessageType.MessageWarning
then
message.TextColor3 = Color3.new(1, 0.6, 0.4) message.TextColor3 = Color3.new(1, 0.6, 0.4)
else else
message.TextColor3 = Color3.new(1, 1, 1) message.TextColor3 = Color3.new(1, 1, 1)
@ -708,10 +731,16 @@ function initializeDeveloperConsole()
local delta = (Vector2.new(x, y) - previousMousePosScroll).Y local delta = (Vector2.new(x, y) - previousMousePosScroll).Y
local backRatio = 1 - (Dev_Container.Body.TextBox.AbsoluteSize.Y / Dev_TextHolder.AbsoluteSize.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 movementSize = Dev_ScrollArea.AbsoluteSize.Y
local normalDelta = math.max(math.min(delta, movementSize), 0 - movementSize) - Dev_ScrollArea.Handle.AbsoluteSize.Y
local normalDelta =
math.max(math.min(delta, movementSize), 0 - movementSize)
local normalRatio = normalDelta / movementSize local normalRatio = normalDelta / movementSize
local textMovementSize = (backRatio * Dev_TextHolder.AbsoluteSize.Y) local textMovementSize = (backRatio * Dev_TextHolder.AbsoluteSize.Y)
@ -741,7 +770,12 @@ function initializeDeveloperConsole()
local function existsInsideContainer(container, x, y) local function existsInsideContainer(container, x, y)
local pos = container.AbsolutePosition local pos = container.AbsolutePosition
local size = container.AbsoluteSize 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 if
x < pos.X
or x > pos.X + size.X
or y < pos.y
or y > pos.y + size.y
then
return false return false
end end
return true return true
@ -750,21 +784,30 @@ function initializeDeveloperConsole()
--Refresh Dev-Console Message Positions --Refresh Dev-Console Message Positions
function repositionList() function repositionList()
if currentConsole == LOCAL_CONSOLE then if currentConsole == LOCAL_CONSOLE then
localOffset = math.min(math.max(localOffset, 0), textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y) localOffset = math.min(
math.max(localOffset, 0),
textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y
)
Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize) Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize)
elseif currentConsole == SERVER_CONSOLE then elseif currentConsole == SERVER_CONSOLE then
serverOffset = serverOffset = math.min(
math.min(math.max(serverOffset, 0), textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y) math.max(serverOffset, 0),
textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y
)
Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize) Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize)
end end
local ratio = Dev_Container.Body.TextBox.AbsoluteSize.Y / Dev_TextHolder.AbsoluteSize.Y local ratio = Dev_Container.Body.TextBox.AbsoluteSize.Y
/ Dev_TextHolder.AbsoluteSize.Y
if ratio >= 1 then if ratio >= 1 then
Dev_Container.Body.ScrollBar.Visible = false Dev_Container.Body.ScrollBar.Visible = false
Dev_Container.Body.TextBox.Size = UDim2.new(1, -4, 1, -28) Dev_Container.Body.TextBox.Size = UDim2.new(1, -4, 1, -28)
if currentConsole == LOCAL_CONSOLE or currentConsole == SERVER_CONSOLE then if
currentConsole == LOCAL_CONSOLE
or currentConsole == SERVER_CONSOLE
then
Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize) Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize)
end end
else else
@ -782,7 +825,8 @@ function initializeDeveloperConsole()
local topRatio = math.max(0, backRatio - offsetRatio) local topRatio = math.max(0, backRatio - offsetRatio)
local scrollHandleSize = math.max(Dev_ScrollArea.AbsoluteSize.Y * ratio, 21) local scrollHandleSize =
math.max(Dev_ScrollArea.AbsoluteSize.Y * ratio, 21)
local scrollRatio = scrollHandleSize / Dev_ScrollArea.AbsoluteSize.Y local scrollRatio = scrollHandleSize / Dev_ScrollArea.AbsoluteSize.Y
local ratioConversion = (1 - scrollRatio) / (1 - ratio) local ratioConversion = (1 - scrollRatio) / (1 - ratio)
@ -798,9 +842,11 @@ function initializeDeveloperConsole()
Dev_ScrollArea.Handle.Position = UDim2.new(0, 0, 0, sPos) Dev_ScrollArea.Handle.Position = UDim2.new(0, 0, 0, sPos)
if currentConsole == LOCAL_CONSOLE then if currentConsole == LOCAL_CONSOLE then
Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize + localOffset) Dev_TextHolder.Position =
UDim2.new(0, 0, 1, 0 - textHolderSize + localOffset)
elseif currentConsole == SERVER_CONSOLE then elseif currentConsole == SERVER_CONSOLE then
Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize + serverOffset) Dev_TextHolder.Position =
UDim2.new(0, 0, 1, 0 - textHolderSize + serverOffset)
end end
end end
end end
@ -862,15 +908,19 @@ function initializeDeveloperConsole()
Dev_OptionsBar.WordWrapToggleButton.MouseButton1Down:connect(function(_, _) Dev_OptionsBar.WordWrapToggleButton.MouseButton1Down:connect(function(_, _)
wordWrapToggleOn = not wordWrapToggleOn wordWrapToggleOn = not wordWrapToggleOn
Dev_OptionsBar.WordWrapToggleButton.CheckFrame.Visible = wordWrapToggleOn Dev_OptionsBar.WordWrapToggleButton.CheckFrame.Visible =
wordWrapToggleOn
refreshTextHolder() refreshTextHolder()
repositionList() repositionList()
end) end)
---Dev-Console Message Functionality ---Dev-Console Message Functionality
function AddLocalMessage(str, messageType, timeStamp) function AddLocalMessage(str, messageType, timeStamp)
localMessageList[#localMessageList + 1] = localMessageList[#localMessageList + 1] = {
{ Message = str, Time = ConvertTimeStamp(timeStamp), Type = messageType } Message = str,
Time = ConvertTimeStamp(timeStamp),
Type = messageType,
}
while #localMessageList > MAX_LIST_SIZE do while #localMessageList > MAX_LIST_SIZE do
table.remove(localMessageList, 1) table.remove(localMessageList, 1)
end end
@ -881,8 +931,11 @@ function initializeDeveloperConsole()
end end
function AddServerMessage(str, messageType, timeStamp) function AddServerMessage(str, messageType, timeStamp)
serverMessageList[#serverMessageList + 1] = serverMessageList[#serverMessageList + 1] = {
{ Message = str, Time = ConvertTimeStamp(timeStamp), Type = messageType } Message = str,
Time = ConvertTimeStamp(timeStamp),
Type = messageType,
}
while #serverMessageList > MAX_LIST_SIZE do while #serverMessageList > MAX_LIST_SIZE do
table.remove(serverMessageList, 1) table.remove(serverMessageList, 1)
end end
@ -904,7 +957,9 @@ function initializeDeveloperConsole()
localConsole.BackgroundTransparency = 0.6 localConsole.BackgroundTransparency = 0.6
serverConsole.BackgroundTransparency = 0.8 serverConsole.BackgroundTransparency = 0.8
if game:FindFirstChild "Players" and game.Players["LocalPlayer"] then if
game:FindFirstChild "Players" and game.Players["LocalPlayer"]
then
local mouse = game.Players.LocalPlayer:GetMouse() local mouse = game.Players.LocalPlayer:GetMouse()
refreshConsolePosition(mouse.X, mouse.Y) refreshConsolePosition(mouse.X, mouse.Y)
refreshConsoleSize(mouse.X, mouse.Y) refreshConsoleSize(mouse.X, mouse.Y)
@ -938,7 +993,9 @@ function initializeDeveloperConsole()
serverConsole.BackgroundTransparency = 0.6 serverConsole.BackgroundTransparency = 0.6
localConsole.BackgroundTransparency = 0.8 localConsole.BackgroundTransparency = 0.8
if game:FindFirstChild "Players" and game.Players["LocalPlayer"] then if
game:FindFirstChild "Players" and game.Players["LocalPlayer"]
then
local mouse = game.Players.LocalPlayer:GetMouse() local mouse = game.Players.LocalPlayer:GetMouse()
refreshConsolePosition(mouse.X, mouse.Y) refreshConsolePosition(mouse.X, mouse.Y)
refreshConsoleSize(mouse.X, mouse.Y) refreshConsoleSize(mouse.X, mouse.Y)
@ -978,7 +1035,9 @@ function initializeDeveloperConsole()
if not Dev_Container.Visible then if not Dev_Container.Visible then
return return
end end
if existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) then if
existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y)
then
changeOffset(10) changeOffset(10)
end end
end) end)
@ -987,7 +1046,9 @@ function initializeDeveloperConsole()
if not Dev_Container.Visible then if not Dev_Container.Visible then
return return
end end
if existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) then if
existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y)
then
changeOffset(-10) changeOffset(-10)
end end
end) end)
@ -1002,12 +1063,17 @@ function initializeDeveloperConsole()
local history = game:GetService("LogService"):GetLogHistory() local history = game:GetService("LogService"):GetLogHistory()
for i = 1, #history do for i = 1, #history do
AddLocalMessage(history[i].message, history[i].messageType, history[i].timestamp) AddLocalMessage(
history[i].message,
history[i].messageType,
history[i].timestamp
)
end end
game:GetService("LogService").MessageOut:connect(function(message, messageType) game:GetService("LogService").MessageOut
AddLocalMessage(message, messageType, os.time()) :connect(function(message, messageType)
end) AddLocalMessage(message, messageType, os.time())
end)
game:GetService("LogService").ServerMessageOut:connect(AddServerMessage) game:GetService("LogService").ServerMessageOut:connect(AddServerMessage)
end end

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 36868950"
local controlFrame = script.Parent:FindFirstChild "ControlFrame" local controlFrame = script.Parent:FindFirstChild "ControlFrame"
if not controlFrame then if not controlFrame then
@ -34,9 +35,14 @@ function setUpListeners(frameToListen)
frameToListen.inside.Value = true frameToListen.inside.Value = true
wait(1.2) wait(1.2)
if frameToListen.inside.Value then if frameToListen.inside.Value then
while frameToListen.inside.Value and frameToListen.BackgroundTransparency > 0 do while
frameToListen.BackgroundTransparency = frameToListen.BackgroundTransparency - fadeSpeed frameToListen.inside.Value
frameToListen.TextTransparency = frameToListen.TextTransparency - fadeSpeed and frameToListen.BackgroundTransparency > 0
do
frameToListen.BackgroundTransparency = frameToListen.BackgroundTransparency
- fadeSpeed
frameToListen.TextTransparency = frameToListen.TextTransparency
- fadeSpeed
wait() wait()
end end
end end

View File

@ -1,14 +1,20 @@
-- Creates all neccessary scripts for the gui on initial load, everything except build tools print "[Mercury]: Loaded corescript 37801172"
-- Created by Ben T. 10/29/10
-- Please note that these are loaded in a specific order to diminish errors/perceived load time by user
local scriptContext = game:GetService "ScriptContext" local scriptContext = game:GetService "ScriptContext"
-- Creates all neccessary scripts for the gui on initial load, everything except build tools
-- Please note that these are loaded in a specific order to diminish errors/perceived load time by user
local touchEnabled = false local touchEnabled = false
pcall(function() pcall(function()
touchEnabled = game:GetService("UserInputService").TouchEnabled touchEnabled = game:GetService("UserInputService").TouchEnabled
end) end)
-- library registration -- library registration
scriptContext:AddCoreScript(60595695, scriptContext, "/Libraries/LibraryRegistration/LibraryRegistration") scriptContext:AddCoreScript(
60595695,
scriptContext,
"/Libraries/LibraryRegistration/LibraryRegistration"
)
local function waitForChild(instance, name) local function waitForChild(instance, name)
while not instance:FindFirstChild(name) do while not instance:FindFirstChild(name) do
@ -22,7 +28,6 @@ end
-- end -- end
-- Responsible for tracking logging items -- Responsible for tracking logging items
local scriptContext = game:GetService "ScriptContext"
scriptContext:AddCoreScript(59002209, scriptContext, "CoreScripts/Sections") scriptContext:AddCoreScript(59002209, scriptContext, "CoreScripts/Sections")
waitForChild(game:GetService "CoreGui", "RobloxGui") waitForChild(game:GetService "CoreGui", "RobloxGui")
@ -34,36 +39,64 @@ if not touchEnabled then
-- SettingsScript -- SettingsScript
scriptContext:AddCoreScript(46295863, screenGui, "CoreScripts/Settings") scriptContext:AddCoreScript(46295863, screenGui, "CoreScripts/Settings")
else else
scriptContext:AddCoreScript(153556783, screenGui, "CoreScripts/TouchControls") scriptContext:AddCoreScript(
153556783,
screenGui,
"CoreScripts/TouchControls"
)
end end
-- MainBotChatScript -- MainBotChatScript
scriptContext:AddCoreScript(39250920, screenGui, "CoreScripts/MainBotChatScript") scriptContext:AddCoreScript(
39250920,
screenGui,
"CoreScripts/MainBotChatScript"
)
-- Popup Script -- Popup Script
scriptContext:AddCoreScript(48488451, screenGui, "CoreScripts/PopupScript") scriptContext:AddCoreScript(48488451, screenGui, "CoreScripts/PopupScript")
-- Friend Notification Script (probably can use this script to expand out to other notifications) -- Friend Notification Script (probably can use this script to expand out to other notifications)
scriptContext:AddCoreScript(48488398, screenGui, "CoreScripts/NotificationScript") scriptContext:AddCoreScript(
48488398,
screenGui,
"CoreScripts/NotificationScript"
)
-- Chat script -- Chat script
scriptContext:AddCoreScript(97188756, screenGui, "CoreScripts/ChatScript") scriptContext:AddCoreScript(97188756, screenGui, "CoreScripts/ChatScript")
-- Purchase Prompt Script -- Purchase Prompt Script
scriptContext:AddCoreScript(107893730, screenGui, "CoreScripts/PurchasePromptScript") scriptContext:AddCoreScript(
107893730,
screenGui,
"CoreScripts/PurchasePromptScript"
)
if not touchEnabled or screenGui.AbsoluteSize.Y > 600 then if not touchEnabled or screenGui.AbsoluteSize.Y > 600 then
-- New Player List -- New Player List
scriptContext:AddCoreScript(48488235, screenGui, "CoreScripts/PlayerListScript") scriptContext:AddCoreScript(
48488235,
screenGui,
"CoreScripts/PlayerListScript"
)
else else
delay(5, function() delay(5, function()
if screenGui.AbsoluteSize.Y >= 600 then if screenGui.AbsoluteSize.Y >= 600 then
-- New Player List -- New Player List
scriptContext:AddCoreScript(48488235, screenGui, "CoreScripts/PlayerListScript") scriptContext:AddCoreScript(
48488235,
screenGui,
"CoreScripts/PlayerListScript"
)
end end
end) end)
end end
if game.CoreGui.Version >= 3 and game.PlaceId ~= 130815926 then --todo: remove placeid hack for halloween if game.CoreGui.Version >= 3 and game.PlaceId ~= 130815926 then --todo: remove placeid hack for halloween
-- Backpack Builder, creates most of the backpack gui -- Backpack Builder, creates most of the backpack gui
scriptContext:AddCoreScript(53878047, screenGui, "CoreScripts/BackpackScripts/BackpackBuilder") scriptContext:AddCoreScript(
53878047,
screenGui,
"CoreScripts/BackpackScripts/BackpackBuilder"
)
waitForChild(screenGui, "CurrentLoadout") waitForChild(screenGui, "CurrentLoadout")
waitForChild(screenGui, "Backpack") waitForChild(screenGui, "Backpack")
@ -71,33 +104,59 @@ if game.CoreGui.Version >= 3 and game.PlaceId ~= 130815926 then --todo: remove p
-- Manager handles all big backpack state changes, other scripts subscribe to this and do things accordingly -- Manager handles all big backpack state changes, other scripts subscribe to this and do things accordingly
if game.CoreGui.Version >= 7 then if game.CoreGui.Version >= 7 then
scriptContext:AddCoreScript(89449093, Backpack, "CoreScripts/BackpackScripts/BackpackManager") scriptContext:AddCoreScript(
89449093,
Backpack,
"CoreScripts/BackpackScripts/BackpackManager"
)
end end
-- Backpack Gear (handles all backpack gear tab stuff) -- Backpack Gear (handles all backpack gear tab stuff)
game:GetService("ScriptContext"):AddCoreScript(89449008, Backpack, "CoreScripts/BackpackScripts/BackpackGear") game:GetService("ScriptContext"):AddCoreScript(
89449008,
Backpack,
"CoreScripts/BackpackScripts/BackpackGear"
)
-- Loadout Script, used for gear hotkeys -- Loadout Script, used for gear hotkeys
scriptContext:AddCoreScript(53878057, screenGui.CurrentLoadout, "CoreScripts/BackpackScripts/LoadoutScript") scriptContext:AddCoreScript(
53878057,
screenGui.CurrentLoadout,
"CoreScripts/BackpackScripts/LoadoutScript"
)
if game.CoreGui.Version >= 8 then if game.CoreGui.Version >= 8 then
-- Wardrobe script handles all character dressing operations -- Wardrobe script handles all character dressing operations
scriptContext:AddCoreScript(-1, Backpack, "CoreScripts/BackpackScripts/BackpackWardrobe") scriptContext:AddCoreScript(
-1,
Backpack,
"CoreScripts/BackpackScripts/BackpackWardrobe"
)
end end
end end
local IsPersonalServer = not not game.Workspace:FindFirstChild "PSVariable" local IsPersonalServer = not not game.Workspace:FindFirstChild "PSVariable"
if IsPersonalServer then if IsPersonalServer then
game:GetService("ScriptContext"):AddCoreScript(64164692, game.Players.LocalPlayer, "BuildToolManager") game:GetService("ScriptContext")
:AddCoreScript(64164692, game.Players.LocalPlayer, "BuildToolManager")
end end
game.Workspace.ChildAdded:connect(function(nchild) game.Workspace.ChildAdded:connect(function(nchild)
if nchild.Name == "PSVariable" and nchild:IsA "BoolValue" then if nchild.Name == "PSVariable" and nchild:IsA "BoolValue" then
IsPersonalServer = true IsPersonalServer = true
game:GetService("ScriptContext"):AddCoreScript(64164692, game.Players.LocalPlayer, "BuildToolManager") game:GetService("ScriptContext")
:AddCoreScript(
64164692,
game.Players.LocalPlayer,
"BuildToolManager"
)
end end
end) end)
if touchEnabled then -- touch devices don't use same control frame if touchEnabled then -- touch devices don't use same control frame
-- only used for touch device button generation -- only used for touch device button generation
scriptContext:AddCoreScript(152908679, screenGui, "CoreScripts/ContextActionTouch") scriptContext:AddCoreScript(
152908679,
screenGui,
"CoreScripts/ContextActionTouch"
)
waitForChild(screenGui, "ControlFrame") waitForChild(screenGui, "ControlFrame")
waitForChild(screenGui.ControlFrame, "BottomLeftControl") waitForChild(screenGui.ControlFrame, "BottomLeftControl")

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 38037565"
local damageGuiWidth = 5.0 local damageGuiWidth = 5.0
local damageGuiHeight = 5.0 local damageGuiHeight = 5.0
@ -133,9 +134,17 @@ while true do
if regen then if regen then
delta = delta + regen.Value.X delta = delta + regen.Value.X
if regen.Value.Y >= 0 then if regen.Value.Y >= 0 then
regen.Value = Vector3.new(regen.Value.X + regen.Value.Z, regen.Value.Y - s, regen.Value.Z) -- maybe have 3rd parameter be an increaser/decreaser? regen.Value = Vector3.new(
regen.Value.X + regen.Value.Z,
regen.Value.Y - s,
regen.Value.Z
) -- maybe have 3rd parameter be an increaser/decreaser?
elseif regen.Value.Y == -1 then elseif regen.Value.Y == -1 then
regen.Value = Vector3.new(regen.Value.X + regen.Value.Z, -1, regen.Value.Z) regen.Value = Vector3.new(
regen.Value.X + regen.Value.Z,
-1,
regen.Value.Z
)
else else
regen:remove() regen:remove()
end -- infinity is -1 end -- infinity is -1
@ -143,9 +152,17 @@ while true do
if poison then if poison then
delta = delta - poison.Value.X delta = delta - poison.Value.X
if poison.Value.Y >= 0 then if poison.Value.Y >= 0 then
poison.Value = Vector3.new(poison.Value.X + poison.Value.Z, poison.Value.Y - s, poison.Value.Z) poison.Value = Vector3.new(
poison.Value.X + poison.Value.Z,
poison.Value.Y - s,
poison.Value.Z
)
elseif poison.Value.Y == -1 then elseif poison.Value.Y == -1 then
poison.Value = Vector3.new(poison.Value.X + poison.Value.Z, -1, poison.Value.Z) poison.Value = Vector3.new(
poison.Value.X + poison.Value.Z,
-1,
poison.Value.Z
)
else else
poison:remove() poison:remove()
end -- infinity is -1 end -- infinity is -1
@ -155,7 +172,8 @@ while true do
--print("IN ICE") --print("IN ICE")
delta = delta - ice.Value.X delta = delta - ice.Value.X
if ice.Value.Y >= 0 then if ice.Value.Y >= 0 then
ice.Value = Vector3.new(ice.Value.X, ice.Value.Y - s, ice.Value.Z) ice.Value =
Vector3.new(ice.Value.X, ice.Value.Y - s, ice.Value.Z)
else else
ice:remove() ice:remove()
end end
@ -166,7 +184,11 @@ while true do
fireEffect.Parent = Figure.Torso fireEffect.Parent = Figure.Torso
delta = delta - fire.Value.X delta = delta - fire.Value.X
if fire.Value.Y >= 0 then if fire.Value.Y >= 0 then
fire.Value = Vector3.new(fire.Value.X, fire.Value.Y - s, fire.Value.Z) fire.Value = Vector3.new(
fire.Value.X,
fire.Value.Y - s,
fire.Value.Z
)
else else
fire:remove() fire:remove()
fireEffect.Enabled = false fireEffect.Enabled = false
@ -178,7 +200,9 @@ while true do
if stun.Value > 0 then if stun.Value > 0 then
Torso.Anchored = true Torso.Anchored = true
currentChildren = script.Parent:GetChildren() currentChildren = script.Parent:GetChildren()
backpackTools = game.Players:GetPlayerFromCharacter(script.Parent).Backpack:GetChildren() backpackTools = game.Players
:GetPlayerFromCharacter(script.Parent).Backpack
:GetChildren()
for i = 1, #currentChildren do for i = 1, #currentChildren do
if currentChildren[i].className == "Tool" then if currentChildren[i].className == "Tool" then
inCharTag:Clone().Parent = currentChildren[i] inCharTag:Clone().Parent = currentChildren[i]
@ -187,20 +211,25 @@ while true do
end end
end end
for i = 1, #backpackTools do for i = 1, #backpackTools do
if backpackTools[i]:FindFirstChild "RobloxBuildTool" == nil then if
backpackTools[i]:FindFirstChild "RobloxBuildTool"
== nil
then
hider:Clone().Parent = backpackTools[i] hider:Clone().Parent = backpackTools[i]
backpackTools[i].Parent = game.Lighting backpackTools[i].Parent = game.Lighting
end end
end end
wait(0.2) wait(0.2)
for i = 1, #backpackTools do for i = 1, #backpackTools do
backpackTools[i].Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack backpackTools[i].Parent =
game.Players:GetPlayerFromCharacter(script.Parent).Backpack
end end
stun.Value = stun.Value - s stun.Value = stun.Value - s
else else
Torso.Anchored = false Torso.Anchored = false
for i = 1, #backpackTools do for i = 1, #backpackTools do
local rbTool = backpackTools[i]:FindFirstChild "RobloxBuildTool" local rbTool =
backpackTools[i]:FindFirstChild "RobloxBuildTool"
if rbTool then if rbTool then
rbTool:Remove() rbTool:Remove()
end end
@ -208,12 +237,16 @@ while true do
end end
wait(0.2) wait(0.2)
for i = 1, #backpackTools do for i = 1, #backpackTools do
local wasInChar = backpackTools[i]:FindFirstChild "InCharTag" local wasInChar =
backpackTools[i]:FindFirstChild "InCharTag"
if wasInChar then if wasInChar then
wasInChar:Remove() wasInChar:Remove()
backpackTools[i].Parent = script.Parent backpackTools[i].Parent = script.Parent
else else
backpackTools[i].Parent = game.Players:GetPlayerFromCharacter(script.Parent).Backpack backpackTools[i].Parent =
game.Players:GetPlayerFromCharacter(
script.Parent
).Backpack
end end
end end
stun:Remove() stun:Remove()

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 39250920"
function waitForProperty(instance, name) function waitForProperty(instance, name)
while not instance[name] do while not instance[name] do
instance.Changed:wait() instance.Changed:wait()
@ -33,7 +34,7 @@ local reenableDialogScript
local dialogMap = {} local dialogMap = {}
local dialogConnections = {} local dialogConnections = {}
local gui = nil local gui
waitForChild(game, "CoreGui") waitForChild(game, "CoreGui")
waitForChild(game.CoreGui, "RobloxGui") waitForChild(game.CoreGui, "RobloxGui")
if game.CoreGui.RobloxGui:FindFirstChild "ControlFrame" then if game.CoreGui.RobloxGui:FindFirstChild "ControlFrame" then
@ -102,31 +103,39 @@ end
function styleMainFrame(tone) function styleMainFrame(tone)
if tone == Enum.DialogTone.Neutral then if tone == Enum.DialogTone.Neutral then
mainFrame.Style = Enum.FrameStyle.ChatBlue mainFrame.Style = Enum.FrameStyle.ChatBlue
mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botBlue_tailRight.png" mainFrame.Tail.Image =
"rbxasset://textures/chatBubble_botBlue_tailRight.png"
elseif tone == Enum.DialogTone.Friendly then elseif tone == Enum.DialogTone.Friendly then
mainFrame.Style = Enum.FrameStyle.ChatGreen mainFrame.Style = Enum.FrameStyle.ChatGreen
mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botGreen_tailRight.png" mainFrame.Tail.Image =
"rbxasset://textures/chatBubble_botGreen_tailRight.png"
elseif tone == Enum.DialogTone.Enemy then elseif tone == Enum.DialogTone.Enemy then
mainFrame.Style = Enum.FrameStyle.ChatRed mainFrame.Style = Enum.FrameStyle.ChatRed
mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botRed_tailRight.png" mainFrame.Tail.Image =
"rbxasset://textures/chatBubble_botRed_tailRight.png"
end end
styleChoices(tone) styleChoices(tone)
end end
function setChatNotificationTone(gui, purpose, tone) function setChatNotificationTone(gui, purpose, tone)
if tone == Enum.DialogTone.Neutral then if tone == Enum.DialogTone.Neutral then
gui.Image.Image = "rbxasset://textures/chatBubble_botBlue_notify_bkg.png" gui.Image.Image =
"rbxasset://textures/chatBubble_botBlue_notify_bkg.png"
elseif tone == Enum.DialogTone.Friendly then elseif tone == Enum.DialogTone.Friendly then
gui.Image.Image = "rbxasset://textures/chatBubble_botGreen_notify_bkg.png" gui.Image.Image =
"rbxasset://textures/chatBubble_botGreen_notify_bkg.png"
elseif tone == Enum.DialogTone.Enemy then elseif tone == Enum.DialogTone.Enemy then
gui.Image.Image = "rbxasset://textures/chatBubble_botRed_notify_bkg.png" gui.Image.Image = "rbxasset://textures/chatBubble_botRed_notify_bkg.png"
end end
if purpose == Enum.DialogPurpose.Quest then if purpose == Enum.DialogPurpose.Quest then
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_bang.png" gui.Image.Button.Image =
"rbxasset://textures/chatBubble_bot_notify_bang.png"
elseif purpose == Enum.DialogPurpose.Help then elseif purpose == Enum.DialogPurpose.Help then
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_question.png" gui.Image.Button.Image =
"rbxasset://textures/chatBubble_bot_notify_question.png"
elseif purpose == Enum.DialogPurpose.Shop then elseif purpose == Enum.DialogPurpose.Shop then
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_money.png" gui.Image.Button.Image =
"rbxasset://textures/chatBubble_bot_notify_money.png"
end end
end end
@ -243,7 +252,11 @@ function selectChoice(choice)
--First hide the Gui --First hide the Gui
mainFrame.Visible = false mainFrame.Visible = false
if choice == lastChoice then if choice == lastChoice then
game.Chat:Chat(game.Players.LocalPlayer.Character, "Goodbye!", getChatColor(currentTone())) game.Chat:Chat(
game.Players.LocalPlayer.Character,
"Goodbye!",
getChatColor(currentTone())
)
normalEndDialog() normalEndDialog()
else else
@ -255,7 +268,10 @@ function selectChoice(choice)
getChatColor(currentTone()) getChatColor(currentTone())
) )
wait(1) wait(1)
currentConversationDialog:SignalDialogChoiceSelected(player, dialogChoice) currentConversationDialog:SignalDialogChoiceSelected(
player,
dialogChoice
)
game.Chat:Chat( game.Chat:Chat(
currentConversationPartner, currentConversationPartner,
sanitizeMessage(dialogChoice.ResponseDialog), sanitizeMessage(dialogChoice.ResponseDialog),
@ -263,7 +279,10 @@ function selectChoice(choice)
) )
variableDelay(dialogChoice.ResponseDialog) variableDelay(dialogChoice.ResponseDialog)
presentDialogChoices(currentConversationPartner, dialogChoice:GetChildren()) presentDialogChoices(
currentConversationPartner,
dialogChoice:GetChildren()
)
end end
end end
@ -381,7 +400,8 @@ function presentDialogChoices(talkingPart, dialogChoices)
--3 lines is the maximum, set it to that temporarily --3 lines is the maximum, set it to that temporarily
choices[pos].Size = UDim2.new(1, 0, 0, 24 * 3) choices[pos].Size = UDim2.new(1, 0, 0, 24 * 3)
choices[pos].UserPrompt.Text = obj.UserDialog choices[pos].UserPrompt.Text = obj.UserDialog
local height = math.ceil(choices[pos].UserPrompt.TextBounds.Y / 24) * 24 local height = math.ceil(choices[pos].UserPrompt.TextBounds.Y / 24)
* 24
choices[pos].Position = UDim2.new(0, 0, 0, yPosition) choices[pos].Position = UDim2.new(0, 0, 0, yPosition)
choices[pos].Size = UDim2.new(1, 0, 0, height) choices[pos].Size = UDim2.new(1, 0, 0, height)
@ -417,7 +437,11 @@ function doDialog(dialog)
end end
currentConversationDialog = dialog currentConversationDialog = dialog
game.Chat:Chat(dialog.Parent, dialog.InitialPrompt, getChatColor(dialog.Tone)) game.Chat:Chat(
dialog.Parent,
dialog.InitialPrompt,
getChatColor(dialog.Tone)
)
variableDelay(dialog.InitialPrompt) variableDelay(dialog.InitialPrompt)
presentDialogChoices(dialog.Parent, dialog:GetChildren()) presentDialogChoices(dialog.Parent, dialog:GetChildren())
@ -440,8 +464,9 @@ function checkForLeaveArea()
if if
currentConversationDialog.Parent currentConversationDialog.Parent
and ( and (
player:DistanceFromCharacter(currentConversationDialog.Parent.Position) player:DistanceFromCharacter(
>= currentConversationDialog.ConversationDistance currentConversationDialog.Parent.Position
) >= currentConversationDialog.ConversationDistance
) )
then then
wanderDialog() wanderDialog()
@ -452,7 +477,10 @@ end
function startDialog(dialog) function startDialog(dialog)
if dialog.Parent and dialog.Parent:IsA "BasePart" then if dialog.Parent and dialog.Parent:IsA "BasePart" then
if player:DistanceFromCharacter(dialog.Parent.Position) >= dialog.ConversationDistance then if
player:DistanceFromCharacter(dialog.Parent.Position)
>= dialog.ConversationDistance
then
showMessage(tooFarAwayMessage, tooFarAwaySize) showMessage(tooFarAwayMessage, tooFarAwaySize)
return return
end end
@ -502,12 +530,17 @@ function addDialog(dialog)
removeDialog(dialog) removeDialog(dialog)
addDialog(dialog) addDialog(dialog)
elseif prop == "InUse" then elseif prop == "InUse" then
chatGui.Enabled = not currentConversationDialog and not dialog.InUse chatGui.Enabled = not currentConversationDialog
and not dialog.InUse
if dialog == currentConversationDialog then if dialog == currentConversationDialog then
timeoutDialog() timeoutDialog()
end end
elseif prop == "Tone" or prop == "Purpose" then elseif prop == "Tone" or prop == "Purpose" then
setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone) setChatNotificationTone(
chatGui,
dialog.Purpose,
dialog.Tone
)
end end
end) end)
else -- still need to listen to parent changes even if current parent is not a BasePart else -- still need to listen to parent changes even if current parent is not a BasePart

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 45374389"
local t = {} local t = {}
t.Foo = function() t.Foo = function()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 48488398"
function waitForProperty(instance, property) function waitForProperty(instance, property)
while not instance[property] do while not instance[property] do
instance.Changed:wait() instance.Changed:wait()
@ -15,7 +16,7 @@ waitForChild(script.Parent.Popup, "AcceptButton")
script.Parent.Popup.AcceptButton.Modal = true script.Parent.Popup.AcceptButton.Modal = true
local localPlayer = game.Players.LocalPlayer local localPlayer = game.Players.LocalPlayer
local teleportUI = nil local teleportUI
local friendRequestBlacklist = {} local friendRequestBlacklist = {}
@ -39,8 +40,10 @@ function makeFriend(fromPlayer, toPlayer)
return return
end -- previously cancelled friend request, we don't want it! end -- previously cancelled friend request, we don't want it!
popup.PopupText.Text = "Accept Friend Request from " .. tostring(fromPlayer.Name) .. "?" popup.PopupText.Text = "Accept Friend Request from "
popup.PopupImage.Image = "http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.Name)
.. "?"
popup.PopupImage.Image = "http://banland.xyz/thumbs/avatar.ashx?userId="
.. tostring(fromPlayer.userId) .. tostring(fromPlayer.userId)
.. "&x=352&y=352" .. "&x=352&y=352"
@ -48,7 +51,13 @@ function makeFriend(fromPlayer, toPlayer)
popup.Visible = true popup.Visible = true
popup.AcceptButton.Text = "Accept" popup.AcceptButton.Text = "Accept"
popup.DeclineButton.Text = "Decline" popup.DeclineButton.Text = "Decline"
popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true) popup:TweenSize(
UDim2.new(0, 330, 0, 350),
Enum.EasingDirection.Out,
Enum.EasingStyle.Quart,
1,
true
)
local yesCon, noCon local yesCon, noCon
@ -104,7 +113,9 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
game:GetService("GuiService"):SendNotification( game:GetService("GuiService"):SendNotification(
"You are Friends", "You are Friends",
"With " .. toPlayer.Name .. "!", "With " .. toPlayer.Name .. "!",
"http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(toPlayer.userId) .. "&x=48&y=48", "http://banland.xyz/thumbs/avatar.ashx?userId="
.. tostring(toPlayer.userId)
.. "&x=48&y=48",
5, 5,
function() end function() end
) )
@ -117,7 +128,9 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
game:GetService("GuiService"):SendNotification( game:GetService("GuiService"):SendNotification(
"Friend Request", "Friend Request",
"From " .. fromPlayer.Name, "From " .. fromPlayer.Name,
"http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=48&y=48", "http://banland.xyz/thumbs/avatar.ashx?userId="
.. tostring(fromPlayer.userId)
.. "&x=48&y=48",
8, 8,
function() function()
makeFriend(fromPlayer, toPlayer) makeFriend(fromPlayer, toPlayer)
@ -127,7 +140,9 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
game:GetService("GuiService"):SendNotification( game:GetService("GuiService"):SendNotification(
"You are Friends", "You are Friends",
"With " .. fromPlayer.Name .. "!", "With " .. fromPlayer.Name .. "!",
"http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=48&y=48", "http://banland.xyz/thumbs/avatar.ashx?userId="
.. tostring(fromPlayer.userId)
.. "&x=48&y=48",
5, 5,
function() end function() end
) )
@ -176,7 +191,10 @@ function onTeleport(teleportState, _, _)
elseif teleportState == Enum.TeleportState.InProgress then elseif teleportState == Enum.TeleportState.InProgress then
showTeleportUI("Teleporting...", 0) showTeleportUI("Teleporting...", 0)
elseif teleportState == Enum.TeleportState.Failed then elseif teleportState == Enum.TeleportState.Failed then
showTeleportUI("Teleport failed. Insufficient privileges or target place does not exist.", 3) showTeleportUI(
"Teleport failed. Insufficient privileges or target place does not exist.",
3
)
end end
end end
end end
@ -194,7 +212,9 @@ if teleportEnabled then
if clickCon then if clickCon then
clickCon:disconnect() clickCon:disconnect()
end end
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild "Popup") game.GuiService:RemoveCenterDialog(
script.Parent:FindFirstChild "Popup"
)
popup:TweenSize( popup:TweenSize(
UDim2.new(0, 0, 0, 0), UDim2.new(0, 0, 0, 0),
Enum.EasingDirection.Out, Enum.EasingDirection.Out,
@ -211,7 +231,13 @@ if teleportEnabled then
function() function()
showOneButton() showOneButton()
script.Parent:FindFirstChild("Popup").Visible = true script.Parent:FindFirstChild("Popup").Visible = true
popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true) popup:TweenSize(
UDim2.new(0, 330, 0, 350),
Enum.EasingDirection.Out,
Enum.EasingStyle.Quart,
1,
true
)
end, end,
--HideFunction --HideFunction
function() function()
@ -226,7 +252,11 @@ if teleportEnabled then
end end
) )
end end
game:GetService("TeleportService").ConfirmationCallback = function(message, placeId, spawnName) game:GetService("TeleportService").ConfirmationCallback = function(
message,
placeId,
spawnName
)
local popup = script.Parent:FindFirstChild "Popup" local popup = script.Parent:FindFirstChild "Popup"
popup.PopupText.Text = message popup.PopupText.Text = message
popup.PopupImage.Image = "" popup.PopupImage.Image = ""
@ -240,7 +270,9 @@ if teleportEnabled then
if noCon then if noCon then
noCon:disconnect() noCon:disconnect()
end end
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild "Popup") game.GuiService:RemoveCenterDialog(
script.Parent:FindFirstChild "Popup"
)
popup:TweenSize( popup:TweenSize(
UDim2.new(0, 0, 0, 0), UDim2.new(0, 0, 0, 0),
Enum.EasingDirection.Out, Enum.EasingDirection.Out,
@ -254,7 +286,8 @@ if teleportEnabled then
yesCon = popup.AcceptButton.MouseButton1Click:connect(function() yesCon = popup.AcceptButton.MouseButton1Click:connect(function()
killCons() killCons()
local success, err = pcall(function() local success, err = pcall(function()
game:GetService("TeleportService"):TeleportImpl(placeId, spawnName) game:GetService("TeleportService")
:TeleportImpl(placeId, spawnName)
end) end)
if not success then if not success then
showOneButton() showOneButton()
@ -264,7 +297,9 @@ if teleportEnabled then
if clickCon then if clickCon then
clickCon:disconnect() clickCon:disconnect()
end end
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild "Popup") game.GuiService:RemoveCenterDialog(
script.Parent:FindFirstChild "Popup"
)
popup:TweenSize( popup:TweenSize(
UDim2.new(0, 0, 0, 0), UDim2.new(0, 0, 0, 0),
Enum.EasingDirection.Out, Enum.EasingDirection.Out,
@ -347,7 +382,13 @@ if teleportEnabled then
script.Parent:FindFirstChild("Popup").Visible = true script.Parent:FindFirstChild("Popup").Visible = true
popup.AcceptButton.Text = "Leave" popup.AcceptButton.Text = "Leave"
popup.DeclineButton.Text = "Stay" popup.DeclineButton.Text = "Stay"
popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true) popup:TweenSize(
UDim2.new(0, 330, 0, 350),
Enum.EasingDirection.Out,
Enum.EasingStyle.Quart,
1,
true
)
end end
return true return true
end end

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 48488451"
--build our gui --build our gui
local popupFrame = Instance.new "Frame" local popupFrame = Instance.new "Frame"
@ -52,7 +53,7 @@ popupImage.Parent = popupFrame
local backing = Instance.new "ImageLabel" local backing = Instance.new "ImageLabel"
backing.BackgroundTransparency = 1 backing.BackgroundTransparency = 1
backing.Size = UDim2.new(1, 0, 1, 0) backing.Size = UDim2.new(1, 0, 1, 0)
backing.Image = "http://www.roblox.com/asset/?id=47574181" backing.Image = "http://banland.xyz/asset/?id=47574181"
backing.Name = "Backing" backing.Name = "Backing"
backing.ZIndex = 2 backing.ZIndex = 2
backing.Parent = popupImage backing.Parent = popupImage

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 53878047"
-- This script creates almost all gui elements found in the backpack (warning: there are a lot!) -- This script creates almost all gui elements found in the backpack (warning: there are a lot!)
-- TODO: automate this process -- TODO: automate this process
@ -49,7 +50,7 @@ CurrentLoadout.Parent = gui
local CLBackground = Instance.new "ImageLabel" local CLBackground = Instance.new "ImageLabel"
CLBackground.Name = "Background" CLBackground.Name = "Background"
CLBackground.Size = UDim2.new(1.2, 0, 1.2, 0) CLBackground.Size = UDim2.new(1.2, 0, 1.2, 0)
CLBackground.Image = "http://www.roblox.com/asset/?id=96536002" CLBackground.Image = "http://banland.xyz/asset/?id=96536002"
CLBackground.BackgroundTransparency = 1 CLBackground.BackgroundTransparency = 1
CLBackground.Position = UDim2.new(-0.1, 0, -0.1, 0) CLBackground.Position = UDim2.new(-0.1, 0, -0.1, 0)
CLBackground.ZIndex = 0.0 CLBackground.ZIndex = 0.0
@ -59,7 +60,7 @@ CLBackground.Visible = false
local BackgroundUp = Instance.new "ImageLabel" local BackgroundUp = Instance.new "ImageLabel"
BackgroundUp.Size = UDim2.new(1, 0, 0.025, 1) BackgroundUp.Size = UDim2.new(1, 0, 0.025, 1)
BackgroundUp.Position = UDim2.new(0, 0, 0, 0) BackgroundUp.Position = UDim2.new(0, 0, 0, 0)
BackgroundUp.Image = "http://www.roblox.com/asset/?id=97662207" BackgroundUp.Image = "http://banland.xyz/asset/?id=97662207"
BackgroundUp.BackgroundTransparency = 1 BackgroundUp.BackgroundTransparency = 1
BackgroundUp.Parent = CLBackground BackgroundUp.Parent = CLBackground
@ -73,7 +74,7 @@ BackpackButton.RobloxLocked = true
BackpackButton.Visible = false BackpackButton.Visible = false
BackpackButton.Name = "BackpackButton" BackpackButton.Name = "BackpackButton"
BackpackButton.BackgroundTransparency = 1 BackpackButton.BackgroundTransparency = 1
BackpackButton.Image = "http://www.roblox.com/asset/?id=97617958" BackpackButton.Image = "http://banland.xyz/asset/?id=97617958"
BackpackButton.Position = UDim2.new(0.5, -60, 1, -108) BackpackButton.Position = UDim2.new(0.5, -60, 1, -108)
BackpackButton.Size = UDim2.new(0, 120, 0, 18) BackpackButton.Size = UDim2.new(0, 120, 0, 18)
waitForChild(gui, "ControlFrame") waitForChild(gui, "ControlFrame")
@ -106,7 +107,12 @@ for i = 0, NumSlots do
if gui.AbsoluteSize.Y <= 320 then if gui.AbsoluteSize.Y <= 320 then
slotFrame.Position = UDim2.new(0, (i - 1) * 60, 0, -50) slotFrame.Position = UDim2.new(0, (i - 1) * 60, 0, -50)
print("Well got here", slotFrame, slotFrame.Position.X.Scale, slotFrame.Position.X.Offset) print(
"Well got here",
slotFrame,
slotFrame.Position.X.Scale,
slotFrame.Position.X.Offset
)
end end
if gui.AbsoluteSize.Y <= 320 and i == 0 then if gui.AbsoluteSize.Y <= 320 and i == 0 then
slotFrame:Destroy() slotFrame:Destroy()
@ -127,14 +133,14 @@ TempSlot.ZIndex = 3.0
local slotBackground = Instance.new "ImageLabel" local slotBackground = Instance.new "ImageLabel"
slotBackground.Name = "Background" slotBackground.Name = "Background"
slotBackground.BackgroundTransparency = 1 slotBackground.BackgroundTransparency = 1
slotBackground.Image = "http://www.roblox.com/asset/?id=97613075" slotBackground.Image = "http://banland.xyz/asset/?id=97613075"
slotBackground.Size = UDim2.new(1, 0, 1, 0) slotBackground.Size = UDim2.new(1, 0, 1, 0)
slotBackground.Parent = TempSlot slotBackground.Parent = TempSlot
local HighLight = Instance.new "ImageLabel" local HighLight = Instance.new "ImageLabel"
HighLight.Name = "Highlight" HighLight.Name = "Highlight"
HighLight.BackgroundTransparency = 1 HighLight.BackgroundTransparency = 1
HighLight.Image = "http://www.roblox.com/asset/?id=97643886" HighLight.Image = "http://banland.xyz/asset/?id=97643886"
HighLight.Size = UDim2.new(1, 0, 1, 0) HighLight.Size = UDim2.new(1, 0, 1, 0)
--HighLight.Parent = TempSlot --HighLight.Parent = TempSlot
HighLight.Visible = false HighLight.Visible = false
@ -328,8 +334,9 @@ closeButton.Modal = true
local XImage = Instance.new "ImageLabel" local XImage = Instance.new "ImageLabel"
XImage.RobloxLocked = true XImage.RobloxLocked = true
XImage.Name = "XImage" XImage.Name = "XImage"
game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75547445" game:GetService("ContentProvider")
XImage.Image = "http://www.roblox.com/asset/?id=75547445" --TODO: move to rbxasset :Preload "http://banland.xyz/asset/?id=75547445"
XImage.Image = "http://banland.xyz/asset/?id=75547445" --TODO: move to rbxasset
XImage.BackgroundTransparency = 1 XImage.BackgroundTransparency = 1
XImage.Position = UDim2.new(-0.25, -1, -0.25, -1) XImage.Position = UDim2.new(-0.25, -1, -0.25, -1)
XImage.Size = UDim2.new(1.5, 2, 1.5, 2) XImage.Size = UDim2.new(1.5, 2, 1.5, 2)
@ -431,7 +438,7 @@ GearButton.Parent = GearGrid
local slotBackground = Instance.new "ImageLabel" local slotBackground = Instance.new "ImageLabel"
slotBackground.Name = "Background" slotBackground.Name = "Background"
slotBackground.BackgroundTransparency = 1 slotBackground.BackgroundTransparency = 1
slotBackground.Image = "http://www.roblox.com/asset/?id=97613075" slotBackground.Image = "http://banland.xyz/asset/?id=97613075"
slotBackground.Size = UDim2.new(1, 0, 1, 0) slotBackground.Size = UDim2.new(1, 0, 1, 0)
slotBackground.Parent = GearButton slotBackground.Parent = GearButton
@ -760,31 +767,43 @@ CharacterPane.Parent = Wardrobe
--CharacterPane Children --CharacterPane Children
local FaceFrame = makeCharFrame("FacesFrame", CharacterPane) local FaceFrame = makeCharFrame("FacesFrame", CharacterPane)
game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75460621" game:GetService("ContentProvider")
:Preload "http://banland.xyz/asset/?id=75460621"
makeZone( makeZone(
"FaceZone", "FaceZone",
"http://www.roblox.com/asset/?id=75460621", "http://banland.xyz/asset/?id=75460621",
UDim2.new(0, 157, 0, 137), UDim2.new(0, 157, 0, 137),
UDim2.new(0.5, -78, 0.5, -68), UDim2.new(0.5, -78, 0.5, -68),
FaceFrame FaceFrame
) )
makeStyledButton("Face", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -135), FaceFrame) makeStyledButton(
"Face",
UDim2.new(0, 64, 0, 64),
UDim2.new(0.5, -32, 0.5, -135),
FaceFrame
)
local HeadFrame = makeCharFrame("HeadsFrame", CharacterPane) local HeadFrame = makeCharFrame("HeadsFrame", CharacterPane)
makeZone( makeZone(
"FaceZone", "FaceZone",
"http://www.roblox.com/asset/?id=75460621", "http://banland.xyz/asset/?id=75460621",
UDim2.new(0, 157, 0, 137), UDim2.new(0, 157, 0, 137),
UDim2.new(0.5, -78, 0.5, -68), UDim2.new(0.5, -78, 0.5, -68),
HeadFrame HeadFrame
) )
makeStyledButton("Head", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -135), HeadFrame) makeStyledButton(
"Head",
UDim2.new(0, 64, 0, 64),
UDim2.new(0.5, -32, 0.5, -135),
HeadFrame
)
local HatsFrame = makeCharFrame("HatsFrame", CharacterPane) local HatsFrame = makeCharFrame("HatsFrame", CharacterPane)
game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75457888" game:GetService("ContentProvider")
:Preload "http://banland.xyz/asset/?id=75457888"
local HatsZone = makeZone( local HatsZone = makeZone(
"HatsZone", "HatsZone",
"http://www.roblox.com/asset/?id=75457888", "http://banland.xyz/asset/?id=75457888",
UDim2.new(0, 186, 0, 184), UDim2.new(0, 186, 0, 184),
UDim2.new(0.5, -93, 0.5, -100), UDim2.new(0.5, -93, 0.5, -100),
HatsFrame HatsFrame
@ -812,10 +831,11 @@ makeStyledButton(
) )
local PantsFrame = makeCharFrame("PantsFrame", CharacterPane) local PantsFrame = makeCharFrame("PantsFrame", CharacterPane)
game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75457920" game:GetService("ContentProvider")
:Preload "http://banland.xyz/asset/?id=75457920"
makeZone( makeZone(
"PantsZone", "PantsZone",
"http://www.roblox.com/asset/?id=75457920", "http://banland.xyz/asset/?id=75457920",
UDim2.new(0, 121, 0, 99), UDim2.new(0, 121, 0, 99),
UDim2.new(0.5, -60, 0.5, -100), UDim2.new(0.5, -60, 0.5, -100),
PantsFrame PantsFrame
@ -860,7 +880,12 @@ local leftLegButton = makeStyledButton(
MeshFrame, MeshFrame,
Enum.ButtonStyle.RobloxButton Enum.ButtonStyle.RobloxButton
) )
makeTextLabel("LeftLegLabel", "Left Leg", UDim2.new(0.5, -16, 0, -25), leftLegButton) makeTextLabel(
"LeftLegLabel",
"Left Leg",
UDim2.new(0.5, -16, 0, -25),
leftLegButton
)
local rightLegButton = makeStyledButton( local rightLegButton = makeStyledButton(
"RightLegMeshButton", "RightLegMeshButton",
UDim2.new(0, 64, 0, 64), UDim2.new(0, 64, 0, 64),
@ -868,7 +893,12 @@ local rightLegButton = makeStyledButton(
MeshFrame, MeshFrame,
Enum.ButtonStyle.RobloxButton Enum.ButtonStyle.RobloxButton
) )
makeTextLabel("RightLegLabel", "Right Leg", UDim2.new(0.5, -16, 0, -25), rightLegButton) makeTextLabel(
"RightLegLabel",
"Right Leg",
UDim2.new(0.5, -16, 0, -25),
rightLegButton
)
local rightArmButton = makeStyledButton( local rightArmButton = makeStyledButton(
"RightArmMeshButton", "RightArmMeshButton",
UDim2.new(0, 64, 0, 64), UDim2.new(0, 64, 0, 64),
@ -876,7 +906,12 @@ local rightArmButton = makeStyledButton(
MeshFrame, MeshFrame,
Enum.ButtonStyle.RobloxButton Enum.ButtonStyle.RobloxButton
) )
makeTextLabel("RightArmLabel", "Right Arm", UDim2.new(0.5, -16, 0, -25), rightArmButton) makeTextLabel(
"RightArmLabel",
"Right Arm",
UDim2.new(0.5, -16, 0, -25),
rightArmButton
)
local leftArmButton = makeStyledButton( local leftArmButton = makeStyledButton(
"LeftArmMeshButton", "LeftArmMeshButton",
UDim2.new(0, 64, 0, 64), UDim2.new(0, 64, 0, 64),
@ -884,46 +919,96 @@ local leftArmButton = makeStyledButton(
MeshFrame, MeshFrame,
Enum.ButtonStyle.RobloxButton Enum.ButtonStyle.RobloxButton
) )
makeTextLabel("LeftArmLabel", "Left Arm", UDim2.new(0.5, -16, 0, -25), leftArmButton) makeTextLabel(
"LeftArmLabel",
"Left Arm",
UDim2.new(0.5, -16, 0, -25),
leftArmButton
)
local TShirtFrame = makeCharFrame("T-ShirtsFrame", CharacterPane) local TShirtFrame = makeCharFrame("T-ShirtsFrame", CharacterPane)
game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75460642" game:GetService("ContentProvider")
:Preload "http://banland.xyz/asset/?id=75460642"
makeZone( makeZone(
"TShirtZone", "TShirtZone",
"http://www.roblox.com/asset/?id=75460642", "http://banland.xyz/asset/?id=75460642",
UDim2.new(0, 121, 0, 154), UDim2.new(0, 121, 0, 154),
UDim2.new(0.5, -60, 0.5, -100), UDim2.new(0.5, -60, 0.5, -100),
TShirtFrame TShirtFrame
) )
makeStyledButton("TShirtButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -64), TShirtFrame) makeStyledButton(
"TShirtButton",
UDim2.new(0, 64, 0, 64),
UDim2.new(0.5, -32, 0.5, -64),
TShirtFrame
)
local ShirtFrame = makeCharFrame("ShirtsFrame", CharacterPane) local ShirtFrame = makeCharFrame("ShirtsFrame", CharacterPane)
makeZone( makeZone(
"ShirtZone", "ShirtZone",
"http://www.roblox.com/asset/?id=75460642", "http://banland.xyz/asset/?id=75460642",
UDim2.new(0, 121, 0, 154), UDim2.new(0, 121, 0, 154),
UDim2.new(0.5, -60, 0.5, -100), UDim2.new(0.5, -60, 0.5, -100),
ShirtFrame ShirtFrame
) )
makeStyledButton("ShirtButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -64), ShirtFrame) makeStyledButton(
"ShirtButton",
UDim2.new(0, 64, 0, 64),
UDim2.new(0.5, -32, 0.5, -64),
ShirtFrame
)
local ColorFrame = makeCharFrame("ColorFrame", CharacterPane) local ColorFrame = makeCharFrame("ColorFrame", CharacterPane)
game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=76049888" game:GetService("ContentProvider")
:Preload "http://banland.xyz/asset/?id=76049888"
local ColorZone = makeZone( local ColorZone = makeZone(
"ColorZone", "ColorZone",
"http://www.roblox.com/asset/?id=76049888", "http://banland.xyz/asset/?id=76049888",
UDim2.new(0, 120, 0, 150), UDim2.new(0, 120, 0, 150),
UDim2.new(0.5, -60, 0.5, -100), UDim2.new(0.5, -60, 0.5, -100),
ColorFrame ColorFrame
) )
makeStyledButton("Head", UDim2.new(0.26, 0, 0.19, 0), UDim2.new(0.37, 0, 0.02, 0), ColorZone).AutoButtonColor = false makeStyledButton(
makeStyledButton("LeftArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.78, 0, 0.26, 0), ColorZone).AutoButtonColor = false "Head",
makeStyledButton("RightArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.025, 0, 0.26, 0), ColorZone).AutoButtonColor = UDim2.new(0.26, 0, 0.19, 0),
UDim2.new(0.37, 0, 0.02, 0),
ColorZone
).AutoButtonColor =
false false
makeStyledButton("Torso", UDim2.new(0.43, 0, 0.36, 0), UDim2.new(0.28, 0, 0.26, 0), ColorZone).AutoButtonColor = false makeStyledButton(
makeStyledButton("RightLeg", UDim2.new(0.19, 0, 0.31, 0), UDim2.new(0.275, 0, 0.67, 0), ColorZone).AutoButtonColor = "LeftArm",
UDim2.new(0.19, 0, 0.36, 0),
UDim2.new(0.78, 0, 0.26, 0),
ColorZone
).AutoButtonColor =
false false
makeStyledButton("LeftLeg", UDim2.new(0.19, 0, 0.31, 0), UDim2.new(0.525, 0, 0.67, 0), ColorZone).AutoButtonColor = 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 false
-- Character Panel label (shows what category we are currently browsing) -- Character Panel label (shows what category we are currently browsing)

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 53878057"
if game.CoreGui.Version < 3 then if game.CoreGui.Version < 3 then
return return
end -- peace out if we aren't using the right client end -- peace out if we aren't using the right client
@ -77,7 +78,8 @@ game.LocalBackpack:SetOldSchoolBackpack(false)
waitForChild(currentLoadout.Parent, "Backpack") waitForChild(currentLoadout.Parent, "Backpack")
local guiBackpack = currentLoadout.Parent.Backpack local guiBackpack = currentLoadout.Parent.Backpack
local backpackManager = waitForChild(guiBackpack, "CoreScripts/BackpackScripts/BackpackManager") local backpackManager =
waitForChild(guiBackpack, "CoreScripts/BackpackScripts/BackpackManager")
local backpackOpenEvent = waitForChild(backpackManager, "BackpackOpenEvent") local backpackOpenEvent = waitForChild(backpackManager, "BackpackOpenEvent")
local backpackCloseEvent = waitForChild(backpackManager, "BackpackCloseEvent") local backpackCloseEvent = waitForChild(backpackManager, "BackpackCloseEvent")
local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent") local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent")
@ -90,8 +92,8 @@ if robloxGui.AbsoluteSize.Y <= 320 then
maxNumLoadoutItems = 4 maxNumLoadoutItems = 4
end end
local characterChildAddedCon = nil local characterChildAddedCon
local backpackChildCon = nil local backpackChildCon
local debounce = false local debounce = false
@ -159,7 +161,7 @@ function characterInWorkspace()
end end
function removeGear(gear) function removeGear(gear)
local emptySlot = nil local emptySlot
for i = 1, #gearSlots do for i = 1, #gearSlots do
if gearSlots[i] == gear and gear.Parent ~= nil then if gearSlots[i] == gear and gear.Parent ~= nil then
emptySlot = i emptySlot = i
@ -168,8 +170,12 @@ function removeGear(gear)
end end
if emptySlot then if emptySlot then
if gearSlots[emptySlot].GearReference.Value then if gearSlots[emptySlot].GearReference.Value then
if gearSlots[emptySlot].GearReference.Value.Parent == game.Players.LocalPlayer.Character then -- if we currently have this equipped, unequip it if
gearSlots[emptySlot].GearReference.Value.Parent = game.Players.LocalPlayer.Backpack gearSlots[emptySlot].GearReference.Value.Parent
== game.Players.LocalPlayer.Character
then -- if we currently have this equipped, unequip it
gearSlots[emptySlot].GearReference.Value.Parent =
game.Players.LocalPlayer.Backpack
end end
if if
@ -217,7 +223,7 @@ function removeGear(gear)
end end
function insertGear(gear, addToSlot) function insertGear(gear, addToSlot)
local pos = nil local pos
if not addToSlot then if not addToSlot then
for i = 1, #gearSlots do for i = 1, #gearSlots do
if gearSlots[i] == "empty" then if gearSlots[i] == "empty" then
@ -269,7 +275,7 @@ function insertGear(gear, addToSlot)
end end
gear.Visible = true gear.Visible = true
local con = nil local con
con = gear.Kill.Changed:connect(function(prop) con = gear.Kill.Changed:connect(function(prop)
kill(prop, con, gear) kill(prop, con, gear)
end) end)
@ -292,7 +298,10 @@ function checkToolAncestry(child, parent)
end -- don't show roblox build tools end -- don't show roblox build tools
if child:IsA "Tool" or child:IsA "HopperBin" then if child:IsA "Tool" or child:IsA "HopperBin" then
for i = 1, #gearSlots do for i = 1, #gearSlots do
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then if
gearSlots[i] ~= "empty"
and gearSlots[i].GearReference.Value == child
then
if parent == nil then if parent == nil then
gearSlots[i].Kill.Value = true gearSlots[i].Kill.Value = true
return false return false
@ -316,7 +325,10 @@ end
function removeAllEquippedGear(physGear) function removeAllEquippedGear(physGear)
local stuff = player.Character:GetChildren() local stuff = player.Character:GetChildren()
for i = 1, #stuff do for i = 1, #stuff do
if (stuff[i]:IsA "Tool" or stuff[i]:IsA "HopperBin") and stuff[i] ~= physGear then if
(stuff[i]:IsA "Tool" or stuff[i]:IsA "HopperBin")
and stuff[i] ~= physGear
then
if stuff[i]:IsA "Tool" then if stuff[i]:IsA "Tool" then
stuff[i].Parent = player.Backpack stuff[i].Parent = player.Backpack
end end
@ -400,7 +412,7 @@ function toolSwitcher(numKey)
end end
function activateGear(num) function activateGear(num)
local numKey = nil local numKey
if num == "0" then if num == "0" then
numKey = 10 -- why do lua indexes have to start at 1? :( numKey = 10 -- why do lua indexes have to start at 1? :(
else else
@ -446,8 +458,12 @@ enlargeButton = function(button)
if button:IsA "ImageButton" or button:IsA "TextButton" then if button:IsA "ImageButton" or button:IsA "TextButton" then
button.ZIndex = 5 button.ZIndex = 5
local centerizeX = -(buttonSizeEnlarge.X.Scale - button.Size.X.Scale) / 2 local centerizeX = -(
local centerizeY = -(buttonSizeEnlarge.Y.Scale - button.Size.Y.Scale) / 2 buttonSizeEnlarge.X.Scale - button.Size.X.Scale
) / 2
local centerizeY = -(
buttonSizeEnlarge.Y.Scale - button.Size.Y.Scale
) / 2
button:TweenSizeAndPosition( button:TweenSizeAndPosition(
buttonSizeEnlarge, buttonSizeEnlarge,
UDim2.new( UDim2.new(
@ -526,7 +542,10 @@ end
function pointInRectangle(point, rectTopLeft, rectSize) function pointInRectangle(point, rectTopLeft, rectSize)
if point.x > rectTopLeft.x and point.x < (rectTopLeft.x + rectSize.x) then if point.x > rectTopLeft.x and point.x < (rectTopLeft.x + rectSize.x) then
if point.y > rectTopLeft.y and point.y < (rectTopLeft.y + rectSize.y) then if
point.y > rectTopLeft.y
and point.y < (rectTopLeft.y + rectSize.y)
then
return true return true
end end
end end
@ -550,17 +569,28 @@ function swapGear(gearClone, toFrame)
gearSlots[gearCloneSlot] = toFrameChildren[1] gearSlots[gearCloneSlot] = toFrameChildren[1]
toFrameChildren[1].SlotNumber.Text = gearClone.SlotNumber.Text toFrameChildren[1].SlotNumber.Text = gearClone.SlotNumber.Text
toFrameChildren[1].SlotNumberDownShadow.Text = gearClone.SlotNumber.Text toFrameChildren[1].SlotNumberDownShadow.Text =
toFrameChildren[1].SlotNumberUpShadow.Text = gearClone.SlotNumber.Text gearClone.SlotNumber.Text
toFrameChildren[1].SlotNumberUpShadow.Text =
gearClone.SlotNumber.Text
local subString = string.sub(toFrame.Name, 5) local subString = string.sub(toFrame.Name, 5)
gearClone.SlotNumber.Text = subString gearClone.SlotNumber.Text = subString
gearClone.SlotNumberDownShadow.Text = subString gearClone.SlotNumberDownShadow.Text = subString
gearClone.SlotNumberUpShadow.Text = subString gearClone.SlotNumberUpShadow.Text = subString
gearClone.Position = UDim2.new(gearClone.Position.X.Scale, 0, gearClone.Position.Y.Scale, 0) gearClone.Position = UDim2.new(
toFrameChildren[1].Position = gearClone.Position.X.Scale,
UDim2.new(toFrameChildren[1].Position.X.Scale, 0, toFrameChildren[1].Position.Y.Scale, 0) 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 toFrameChildren[1].Parent = gearClone.Parent
gearClone.Parent = toFrame gearClone.Parent = toFrame
@ -582,7 +612,12 @@ function swapGear(gearClone, toFrame)
toSlotNum = 10 toSlotNum = 10
end end
gearSlots[toSlotNum] = gearClone gearSlots[toSlotNum] = gearClone
gearClone.Position = UDim2.new(gearClone.Position.X.Scale, 0, gearClone.Position.Y.Scale, 0) gearClone.Position = UDim2.new(
gearClone.Position.X.Scale,
0,
gearClone.Position.Y.Scale,
0
)
gearClone.Parent = toFrame gearClone.Parent = toFrame
end end
end end
@ -595,7 +630,13 @@ function resolveDrag(gearClone, x, y)
for i = 1, #frames do for i = 1, #frames do
if frames[i]:IsA "Frame" then if frames[i]:IsA "Frame" then
if pointInRectangle(mousePoint, frames[i].AbsolutePosition, frames[i].AbsoluteSize) then if
pointInRectangle(
mousePoint,
frames[i].AbsolutePosition,
frames[i].AbsoluteSize
)
then
swapGear(gearClone, frames[i]) swapGear(gearClone, frames[i])
return true return true
end end
@ -603,8 +644,14 @@ function resolveDrag(gearClone, x, y)
end end
if 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)) 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 then
reorganizeLoadout(gearClone, false) reorganizeLoadout(gearClone, false)
return false return false
@ -621,11 +668,15 @@ function unequipAllItems(dontEquipThis)
if gearSlots[i] == "empty" then if gearSlots[i] == "empty" then
break break
end end
if gearSlots[i].GearReference.Value and gearSlots[i].GearReference.Value ~= dontEquipThis then if
gearSlots[i].GearReference.Value
and gearSlots[i].GearReference.Value ~= dontEquipThis
then
if gearSlots[i].GearReference.Value:IsA "HopperBin" then if gearSlots[i].GearReference.Value:IsA "HopperBin" then
gearSlots[i].GearReference.Value:Disable() gearSlots[i].GearReference.Value:Disable()
elseif gearSlots[i].GearReference.Value:IsA "Tool" then elseif gearSlots[i].GearReference.Value:IsA "Tool" then
gearSlots[i].GearReference.Value.Parent = game.Players.LocalPlayer.Backpack gearSlots[i].GearReference.Value.Parent =
game.Players.LocalPlayer.Backpack
end end
gearSlots[i].Selected = false gearSlots[i].Selected = false
end end
@ -648,12 +699,21 @@ function showToolTip(button, tip)
end end
function hideToolTip(button, _) function hideToolTip(button, _)
if button and button:FindFirstChild "ToolTipLabel" and button.ToolTipLabel:IsA "TextLabel" then if
button
and button:FindFirstChild "ToolTipLabel"
and button.ToolTipLabel:IsA "TextLabel"
then
button.ToolTipLabel.Visible = false button.ToolTipLabel.Visible = false
end end
end end
local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButton) local addingPlayerChild = function(
child,
equipped,
addToSlot,
inventoryGearButton
)
waitForDebounce() waitForDebounce()
debounce = true debounce = true
@ -670,7 +730,10 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
if not addToSlot then if not addToSlot then
for i = 1, #gearSlots do for i = 1, #gearSlots do
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then -- we already have gear, do nothing if
gearSlots[i] ~= "empty"
and gearSlots[i].GearReference.Value == child
then -- we already have gear, do nothing
debounce = false debounce = false
return return
end end
@ -733,7 +796,12 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
local absolutePositionFinal = inventoryGearButton.AbsolutePosition local absolutePositionFinal = inventoryGearButton.AbsolutePosition
local currentAbsolutePosition = gearClone.AbsolutePosition local currentAbsolutePosition = gearClone.AbsolutePosition
local diff = absolutePositionFinal - currentAbsolutePosition local diff = absolutePositionFinal - currentAbsolutePosition
gearClone.Position = UDim2.new(gearClone.Position.X.Scale, diff.x, gearClone.Position.Y.Scale, diff.y) gearClone.Position = UDim2.new(
gearClone.Position.X.Scale,
diff.x,
gearClone.Position.Y.Scale,
diff.y
)
gearClone.ZIndex = 4 gearClone.ZIndex = 4
end end
@ -751,20 +819,27 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
if equipped then if equipped then
gearClone.Selected = true gearClone.Selected = true
unequipAllItems(child) unequipAllItems(child)
delay(guiTweenSpeed + 0.01, function() -- if our gear is equipped, we will want to enlarge it when done moving delay(
if guiTweenSpeed + 0.01,
gearClone:FindFirstChild "GearReference" function() -- if our gear is equipped, we will want to enlarge it when done moving
and ( if
( gearClone:FindFirstChild "GearReference"
gearClone.GearReference.Value:IsA "Tool" and (
and gearClone.GearReference.Value.Parent == player.Character (
gearClone.GearReference.Value:IsA "Tool"
and gearClone.GearReference.Value.Parent
== player.Character
)
or (
gearClone.GearReference.Value:IsA "HopperBin"
and gearClone.GearReference.Value.Active == true
)
) )
or (gearClone.GearReference.Value:IsA "HopperBin" and gearClone.GearReference.Value.Active == true) then
) enlargeButton(gearClone)
then end
enlargeButton(gearClone)
end end
end) )
end end
local dragBeginPos local dragBeginPos
@ -844,8 +919,8 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
end end
end) -- this probably isn't necessary since objects are being deleted (probably), but this might still leak just in case end) -- this probably isn't necessary since objects are being deleted (probably), but this might still leak just in case
local childCon = nil local childCon
local childChangeCon = nil local childChangeCon
childCon = child.AncestryChanged:connect(function(newChild, parent) childCon = child.AncestryChanged:connect(function(newChild, parent)
if not checkToolAncestry(newChild, parent) then if not checkToolAncestry(newChild, parent) then
if childCon then if childCon then
@ -900,7 +975,7 @@ function addToInventory(child)
return return
end end
local slot = nil local slot
for i = 1, #inventory do for i = 1, #inventory do
if inventory[i] and inventory[i] == child then if inventory[i] and inventory[i] == child then
return return
@ -961,7 +1036,7 @@ end
local centerGear = function() local centerGear = function()
loadoutChildren = currentLoadout:GetChildren() loadoutChildren = currentLoadout:GetChildren()
local gearButtons = {} local gearButtons = {}
local lastSlotAdd = nil local lastSlotAdd
for i = 1, #loadoutChildren do for i = 1, #loadoutChildren do
if loadoutChildren[i]:IsA "Frame" then if loadoutChildren[i]:IsA "Frame" then
@ -1056,7 +1131,10 @@ function tabHandler(inFocus)
end end
function coreGuiChanged(coreGuiType, enabled) function coreGuiChanged(coreGuiType, enabled)
if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then if
coreGuiType == Enum.CoreGuiType.Backpack
or coreGuiType == Enum.CoreGuiType.All
then
backpackButton.Visible = enabled backpackButton.Visible = enabled
clBackground.Visible = enabled clBackground.Visible = enabled
backpackEnabled = enabled backpackEnabled = enabled
@ -1068,7 +1146,10 @@ function coreGuiChanged(coreGuiType, enabled)
end end
end end
if coreGuiType == Enum.CoreGuiType.Health or coreGuiType == Enum.CoreGuiType.All then if
coreGuiType == Enum.CoreGuiType.Health
or coreGuiType == Enum.CoreGuiType.All
then
setHealthBarVisible(game.Players.LocalPlayer.PlayerGui, enabled) setHealthBarVisible(game.Players.LocalPlayer.PlayerGui, enabled)
end end
end end
@ -1078,8 +1159,14 @@ end
registerNumberKeys() registerNumberKeys()
pcall(function() pcall(function()
coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)) coreGuiChanged(
coreGuiChanged(Enum.CoreGuiType.Health, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health)) Enum.CoreGuiType.Backpack,
Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
)
coreGuiChanged(
Enum.CoreGuiType.Health,
Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health)
)
Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
end) end)
@ -1108,9 +1195,16 @@ delay(2, function()
if robloxGui.AbsoluteSize.Y <= 320 then if robloxGui.AbsoluteSize.Y <= 320 then
local cChildren = currentLoadout:GetChildren() local cChildren = currentLoadout:GetChildren()
for i = 1, #cChildren do for i = 1, #cChildren do
local slotNum = tonumber(string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name))) local slotNum = tonumber(
string.sub(
cChildren[i].Name,
5,
string.len(cChildren[i].Name)
)
)
if type(slotNum) == "number" then if type(slotNum) == "number" then
cChildren[i].Position = UDim2.new(0, (slotNum - 1) * 60, 0, 0) cChildren[i].Position =
UDim2.new(0, (slotNum - 1) * 60, 0, 0)
end end
end end
end end
@ -1214,9 +1308,16 @@ player.CharacterAdded:connect(function()
if robloxGui.AbsoluteSize.Y <= 320 then if robloxGui.AbsoluteSize.Y <= 320 then
local cChildren = currentLoadout:GetChildren() local cChildren = currentLoadout:GetChildren()
for i = 1, #cChildren do for i = 1, #cChildren do
local slotNum = tonumber(string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name))) local slotNum = tonumber(
string.sub(
cChildren[i].Name,
5,
string.len(cChildren[i].Name)
)
)
if type(slotNum) == "number" then if type(slotNum) == "number" then
cChildren[i].Position = UDim2.new(0, (slotNum - 1) * 60, 0, 0) cChildren[i].Position =
UDim2.new(0, (slotNum - 1) * 60, 0, 0)
end end
end end
end end
@ -1238,7 +1339,11 @@ guiBackpack.SwapSlot.Changed:connect(function()
reorganizeLoadout(gearSlots[pos], false) reorganizeLoadout(gearSlots[pos], false)
end end
if swapSlot.GearButton.Value then if swapSlot.GearButton.Value then
addingPlayerChild(swapSlot.GearButton.Value.GearReference.Value, false, pos) addingPlayerChild(
swapSlot.GearButton.Value.GearReference.Value,
false,
pos
)
end end
guiBackpack.SwapSlot.Value = false guiBackpack.SwapSlot.Value = false
end end

View File

@ -0,0 +1 @@
print "[Mercury]: Loaded corescript 59002209"

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 60595411"
local t = {} local t = {}
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
@ -273,7 +274,13 @@ end
function JsonReader:TestReservedWord(t) function JsonReader:TestReservedWord(t)
for _, v in ipairs(t) do for _, v in ipairs(t) do
if self:Next() ~= v then if self:Next() ~= v then
error(string.format("Error reading '%s': %s", table.concat(t), self:All())) error(
string.format(
"Error reading '%s': %s",
table.concat(t),
self:All()
)
)
end end
end end
end end
@ -333,7 +340,9 @@ function JsonReader:ReadBlockComment()
done = true done = true
end end
if not done and ch == "/" and self:Peek() == "*" then if not done and ch == "/" and self:Peek() == "*" then
error(string.format("Invalid comment: %s, '/*' illegal.", self:All())) error(
string.format("Invalid comment: %s, '/*' illegal.", self:All())
)
end end
end end
self:Next() self:Next()
@ -363,7 +372,13 @@ function JsonReader:ReadArray()
if not done then if not done then
local ch = self:Next() local ch = self:Next()
if ch ~= "," then if ch ~= "," then
error(string.format("Invalid array: '%s' due to: '%s'", self:All(), ch)) error(
string.format(
"Invalid array: '%s' due to: '%s'",
self:All(),
ch
)
)
end end
end end
end end
@ -386,7 +401,13 @@ function JsonReader:ReadObject()
self:SkipWhiteSpace() self:SkipWhiteSpace()
local ch = self:Next() local ch = self:Next()
if ch ~= ":" then if ch ~= ":" then
error(string.format("Invalid object: '%s' due to: '%s'", self:All(), ch)) error(
string.format(
"Invalid object: '%s' due to: '%s'",
self:All(),
ch
)
)
end end
self:SkipWhiteSpace() self:SkipWhiteSpace()
local val = self:Read() local val = self:Read()
@ -398,7 +419,13 @@ function JsonReader:ReadObject()
if not done then if not done then
ch = self:Next() ch = self:Next()
if ch ~= "," then if ch ~= "," then
error(string.format("Invalid array: '%s' near: '%s'", self:All(), ch)) error(
string.format(
"Invalid array: '%s' near: '%s'",
self:All(),
ch
)
)
end end
end end
end end
@ -479,7 +506,12 @@ t.MakeWedge = function(x, y, z, _)
return game:GetService("Terrain"):AutoWedgeCell(x, y, z) return game:GetService("Terrain"):AutoWedgeCell(x, y, z)
end end
t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, selectionParent) t.SelectTerrainRegion = function(
regionToSelect,
color,
selectEmptyCells,
selectionParent
)
local terrain = game.Workspace:FindFirstChild "Terrain" local terrain = game.Workspace:FindFirstChild "Terrain"
if not terrain then if not terrain then
return return
@ -489,10 +521,16 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select
assert(color) assert(color)
if not type(regionToSelect) == "Region3" then if not type(regionToSelect) == "Region3" then
error("regionToSelect (first arg), should be of type Region3, but is type", type(regionToSelect)) error(
"regionToSelect (first arg), should be of type Region3, but is type",
type(regionToSelect)
)
end end
if not type(color) == "BrickColor" then if not type(color) == "BrickColor" then
error("color (second arg), should be of type BrickColor, but is type", type(color)) error(
"color (second arg), should be of type BrickColor, but is type",
type(color)
)
end end
-- frequently used terrain calls (speeds up call, no lookup necessary) -- frequently used terrain calls (speeds up call, no lookup necessary)
@ -511,10 +549,10 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select
selectionContainer.Parent = game.Workspace selectionContainer.Parent = game.Workspace
end end
local updateSelection = nil -- function we return to allow user to update selection local updateSelection -- function we return to allow user to update selection
local currentKeepAliveTag = nil -- a tag that determines whether adorns should be destroyed local currentKeepAliveTag -- a tag that determines whether adorns should be destroyed
local aliveCounter = 0 -- helper for currentKeepAliveTag local aliveCounter = 0 -- helper for currentKeepAliveTag
local lastRegion = nil -- used to stop updates that do nothing local lastRegion -- used to stop updates that do nothing
local adornments = {} -- contains all adornments local adornments = {} -- contains all adornments
local reusableAdorns = {} local reusableAdorns = {}
@ -544,8 +582,8 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select
-- helper function that creates the basis for a selection box -- helper function that creates the basis for a selection box
function createAdornment(theColor) function createAdornment(theColor)
local selectionPartClone = nil local selectionPartClone
local selectionBoxClone = nil local selectionBoxClone
if #reusableAdorns > 0 then if #reusableAdorns > 0 then
selectionPartClone = reusableAdorns[1]["part"] selectionPartClone = reusableAdorns[1]["part"]
@ -580,7 +618,10 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select
for cellPos, adornTable in pairs(adornments) do for cellPos, adornTable in pairs(adornments) do
if adornTable.KeepAlive ~= currentKeepAliveTag then -- old news, we should get rid of this if adornTable.KeepAlive ~= currentKeepAliveTag then -- old news, we should get rid of this
adornTable.SelectionBox.Visible = false adornTable.SelectionBox.Visible = false
table.insert(reusableAdorns, { part = adornTable.SelectionPart, box = adornTable.SelectionBox }) table.insert(reusableAdorns, {
part = adornTable.SelectionPart,
box = adornTable.SelectionBox,
})
adornments[cellPos] = nil adornments[cellPos] = nil
end end
end end
@ -597,8 +638,12 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select
-- finds full cells in region and adorns each cell with a box, with the argument color -- finds full cells in region and adorns each cell with a box, with the argument color
function adornFullCellsInRegion(region, color) function adornFullCellsInRegion(region, color)
local regionBegin = region.CFrame.p - (region.Size / 2) + Vector3.new(2, 2, 2) local regionBegin = region.CFrame.p
local regionEnd = region.CFrame.p + (region.Size / 2) - Vector3.new(2, 2, 2) - (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 cellPosBegin = WorldToCellPreferSolid(terrain, regionBegin)
local cellPosEnd = WorldToCellPreferSolid(terrain, regionEnd) local cellPosEnd = WorldToCellPreferSolid(terrain, regionEnd)
@ -626,7 +671,8 @@ t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, select
end end
if not updated then if not updated then
local selectionPart, selectionBox = createAdornment(color) local selectionPart, selectionBox =
createAdornment(color)
selectionPart.Size = Vector3.new(4, 4, 4) selectionPart.Size = Vector3.new(4, 4, 4)
selectionPart.CFrame = CFrame.new(cframePos) selectionPart.CFrame = CFrame.new(cframePos)
local adornTable = { local adornTable = {
@ -735,7 +781,11 @@ function t.CreateSignal()
error("connect must be called with `:`, not `.`", 2) error("connect must be called with `:`, not `.`", 2)
end end
if type(func) ~= "function" then if type(func) ~= "function" then
error("Argument #1 of connect must be a function, got a " .. type(func), 2) error(
"Argument #1 of connect must be a function, got a "
.. type(func),
2
)
end end
local cn = mBindableEvent.Event:connect(func) local cn = mBindableEvent.Event:connect(func)
mAllCns[cn] = true mAllCns[cn] = true
@ -890,10 +940,10 @@ local function Create_PrivImpl(objectType)
--make the object to mutate --make the object to mutate
local obj = Instance.new(objectType) local obj = Instance.new(objectType)
local parent = nil local parent
--stored constructor function to be called after other initialization --stored constructor function to be called after other initialization
local ctor = nil local ctor
for k, v in pairs(dat) do for k, v in pairs(dat) do
--add property --add property
@ -909,7 +959,11 @@ local function Create_PrivImpl(objectType)
--add child --add child
elseif type(k) == "number" then elseif type(k) == "number" then
if type(v) ~= "userdata" then if type(v) ~= "userdata" then
error("Bad entry in Create body: Numeric keys must be paired with children, got a: " .. type(v), 2) error(
"Bad entry in Create body: Numeric keys must be paired with children, got a: "
.. type(v),
2
)
end end
v.Parent = obj v.Parent = obj
@ -936,11 +990,21 @@ local function Create_PrivImpl(objectType)
) )
elseif ctor then elseif ctor then
--ctor already exists, only one allowed --ctor already exists, only one allowed
error("Bad entry in Create body: Only one constructor function is allowed", 2) error(
"Bad entry in Create body: Only one constructor function is allowed",
2
)
end end
ctor = v ctor = v
else else
error("Bad entry (" .. tostring(k) .. " => " .. tostring(v) .. ") in Create body", 2) error(
"Bad entry ("
.. tostring(k)
.. " => "
.. tostring(v)
.. ") in Create body",
2
)
end end
end end
@ -1000,7 +1064,10 @@ t.Help = function(funcNameOrFunc)
.. "parameter is provided, if not sets cell x, y, z to be whatever material it previously was. " .. "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 " .. "Returns true if made a wedge, false if the cell remains a block "
end end
if funcNameOrFunc == "SelectTerrainRegion" or funcNameOrFunc == t.SelectTerrainRegion then if
funcNameOrFunc == "SelectTerrainRegion"
or funcNameOrFunc == t.SelectTerrainRegion
then
return "Function SelectTerrainRegion. " return "Function SelectTerrainRegion. "
.. "Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). " .. "Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). "
.. "Description: Selects all terrain via a series of selection boxes within the regionToSelect " .. "Description: Selects all terrain via a series of selection boxes within the regionToSelect "

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 60595695"
-- Library Registration Script -- Library Registration Script
-- This script is used to register RbxLua libraries on game servers, so game scripts have -- This script is used to register RbxLua libraries on game servers, so game scripts have
-- access to all of the libraries (otherwise only local scripts do) -- access to all of the libraries (otherwise only local scripts do)

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 89449008"
-- A couple of necessary functions -- A couple of necessary functions
local function waitForChild(instance, name) local function waitForChild(instance, name)
assert(instance) assert(instance)
@ -48,9 +49,9 @@ local browsingMenu = false
local mouseEnterCons = {} local mouseEnterCons = {}
local mouseClickCons = {} local mouseClickCons = {}
local characterChildAddedCon = nil local characterChildAddedCon
local characterChildRemovedCon = nil local characterChildRemovedCon
local backpackAddCon = nil local backpackAddCon
local playerBackpack = waitForChild(player, "Backpack") local playerBackpack = waitForChild(player, "Backpack")
@ -68,16 +69,19 @@ local gearButton = waitForChild(grid, "GearButton")
local swapSlot = waitForChild(script.Parent, "SwapSlot") local swapSlot = waitForChild(script.Parent, "SwapSlot")
local backpackManager = waitForChild(script.Parent, "CoreScripts/BackpackScripts/BackpackManager") local backpackManager =
waitForChild(script.Parent, "CoreScripts/BackpackScripts/BackpackManager")
local backpackOpenEvent = waitForChild(backpackManager, "BackpackOpenEvent") local backpackOpenEvent = waitForChild(backpackManager, "BackpackOpenEvent")
local backpackCloseEvent = waitForChild(backpackManager, "BackpackCloseEvent") local backpackCloseEvent = waitForChild(backpackManager, "BackpackCloseEvent")
local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent") local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent")
local resizeEvent = waitForChild(backpackManager, "ResizeEvent") local resizeEvent = waitForChild(backpackManager, "ResizeEvent")
local searchRequestedEvent = waitForChild(backpackManager, "SearchRequestedEvent") local searchRequestedEvent =
waitForChild(backpackManager, "SearchRequestedEvent")
local tellBackpackReadyFunc = waitForChild(backpackManager, "BackpackReady") local tellBackpackReadyFunc = waitForChild(backpackManager, "BackpackReady")
-- creating scroll bar early as to make sure items get placed correctly -- creating scroll bar early as to make sure items get placed correctly
local scrollFrame, scrollUp, scrollDown, recalculateScroll = RbxGui.CreateScrollingFrame(nil, "grid", Vector2.new(6, 6)) local scrollFrame, scrollUp, scrollDown, recalculateScroll =
RbxGui.CreateScrollingFrame(nil, "grid", Vector2.new(6, 6))
scrollFrame.Position = UDim2.new(0, 0, 0, 30) scrollFrame.Position = UDim2.new(0, 0, 0, 30)
scrollFrame.Size = UDim2.new(1, 0, 1, -30) scrollFrame.Size = UDim2.new(1, 0, 1, -30)
@ -97,7 +101,8 @@ scrollDown.Position = UDim2.new(0, 0, 1, -17)
scrollUp.Parent = scroller scrollUp.Parent = scroller
scrollDown.Parent = scroller scrollDown.Parent = scroller
local scrollFrameLoadout, scrollUpLoadout, scrollDownLoadout, recalculateScrollLoadout = RbxGui.CreateScrollingFrame() local scrollFrameLoadout, scrollUpLoadout, scrollDownLoadout, recalculateScrollLoadout =
RbxGui.CreateScrollingFrame()
scrollFrameLoadout.Position = UDim2.new(0, 0, 0, 0) scrollFrameLoadout.Position = UDim2.new(0, 0, 0, 0)
scrollFrameLoadout.Size = UDim2.new(1, 0, 1, 0) scrollFrameLoadout.Size = UDim2.new(1, 0, 1, 0)
@ -171,7 +176,8 @@ function resize()
waitForChild(gearPreview, "GearImage") waitForChild(gearPreview, "GearImage")
gearPreview.GearImage.Size = UDim2.new(0, size, 0, size) gearPreview.GearImage.Size = UDim2.new(0, size, 0, size)
gearPreview.GearImage.Position = UDim2.new(0, gearPreview.AbsoluteSize.X / 2 - size / 2, 0.75, -size) gearPreview.GearImage.Position =
UDim2.new(0, gearPreview.AbsoluteSize.X / 2 - size / 2, 0.75, -size)
resizeGrid() resizeGrid()
end end
@ -203,9 +209,9 @@ function addToGrid(child)
end end
end end
end) end)
local ancestryCon = nil local ancestryCon
ancestryCon = child.AncestryChanged:connect(function(_, _) ancestryCon = child.AncestryChanged:connect(function(_, _)
local thisObject = nil local thisObject
for _, v in pairs(backpackItems) do for _, v in pairs(backpackItems) do
if v == child then if v == child then
thisObject = v thisObject = v
@ -215,7 +221,10 @@ function addToGrid(child)
waitForProperty(player, "Character") waitForProperty(player, "Character")
waitForChild(player, "Backpack") waitForChild(player, "Backpack")
if child.Parent ~= player.Backpack and child.Parent ~= player.Character then if
child.Parent ~= player.Backpack
and child.Parent ~= player.Character
then
if ancestryCon then if ancestryCon then
ancestryCon:disconnect() ancestryCon:disconnect()
end end
@ -264,7 +273,7 @@ function previewGear(button)
end end
function findEmptySlot() function findEmptySlot()
local smallestNum = nil local smallestNum
local loadout = currentLoadout:GetChildren() local loadout = currentLoadout:GetChildren()
for i = 1, #loadout do for i = 1, #loadout do
if loadout[i]:IsA "Frame" and #loadout[i]:GetChildren() <= 0 then if loadout[i]:IsA "Frame" and #loadout[i]:GetChildren() <= 0 then
@ -286,16 +295,22 @@ end
function checkForSwap(button, x, y) function checkForSwap(button, x, y)
local loadoutChildren = currentLoadout:GetChildren() local loadoutChildren = currentLoadout:GetChildren()
for i = 1, #loadoutChildren do for i = 1, #loadoutChildren do
if loadoutChildren[i]:IsA "Frame" and string.find(loadoutChildren[i].Name, "Slot") then if
loadoutChildren[i]:IsA "Frame"
and string.find(loadoutChildren[i].Name, "Slot")
then
if if
x >= loadoutChildren[i].AbsolutePosition.x x >= loadoutChildren[i].AbsolutePosition.x
and x <= (loadoutChildren[i].AbsolutePosition.x + loadoutChildren[i].AbsoluteSize.x) and x
<= (loadoutChildren[i].AbsolutePosition.x + loadoutChildren[i].AbsoluteSize.x)
then then
if if
y >= loadoutChildren[i].AbsolutePosition.y y >= loadoutChildren[i].AbsolutePosition.y
and y <= (loadoutChildren[i].AbsolutePosition.y + loadoutChildren[i].AbsoluteSize.y) and y
<= (loadoutChildren[i].AbsolutePosition.y + loadoutChildren[i].AbsoluteSize.y)
then then
local slot = tonumber(string.sub(loadoutChildren[i].Name, 5)) local slot =
tonumber(string.sub(loadoutChildren[i].Name, 5))
swapGearSlot(slot, button) swapGearSlot(slot, button)
return true return true
end end
@ -328,7 +343,7 @@ function resizeGrid()
unequipMenu.Parent = buttonClone unequipMenu.Parent = buttonClone
end end
local beginPos = nil local beginPos
buttonClone.DragBegin:connect(function(value) buttonClone.DragBegin:connect(function(value)
waitForChild(buttonClone, "Background") waitForChild(buttonClone, "Background")
buttonClone["Background"].ZIndex = 10 buttonClone["Background"].ZIndex = 10
@ -358,22 +373,29 @@ function resizeGrid()
end end
end) end)
local clickTime = tick() local clickTime = tick()
mouseEnterCons[buttonClone] = buttonClone.MouseEnter:connect(function() mouseEnterCons[buttonClone] = buttonClone.MouseEnter:connect(
previewGear(buttonClone) function()
end) previewGear(buttonClone)
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 end
clickTime = newClickTime )
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 end
end end
@ -405,7 +427,10 @@ function inLoadout(gear)
if children[i]:IsA "Frame" then if children[i]:IsA "Frame" then
local button = children[i]:GetChildren() local button = children[i]:GetChildren()
if #button > 0 then if #button > 0 then
if button[1].GearReference.Value and button[1].GearReference.Value == gear then if
button[1].GearReference.Value
and button[1].GearReference.Value == gear
then
return true return true
end end
end end
@ -417,7 +442,7 @@ end
function updateGridActive() function updateGridActive()
for _, v in pairs(backpackItems) do for _, v in pairs(backpackItems) do
if buttons[v] then if buttons[v] then
local gear = nil local gear
local gearRef = buttons[v]:FindFirstChild "GearReference" local gearRef = buttons[v]:FindFirstChild "GearReference"
if gearRef then if gearRef then
@ -435,9 +460,12 @@ end
function centerGear(loadoutChildren) function centerGear(loadoutChildren)
local gearButtons = {} local gearButtons = {}
local lastSlotAdd = nil local lastSlotAdd
for i = 1, #loadoutChildren do for i = 1, #loadoutChildren do
if loadoutChildren[i]:IsA "Frame" and #loadoutChildren[i]:GetChildren() > 0 then if
loadoutChildren[i]:IsA "Frame"
and #loadoutChildren[i]:GetChildren() > 0
then
if loadoutChildren[i].Name == "Slot0" then if loadoutChildren[i].Name == "Slot0" then
lastSlotAdd = loadoutChildren[i] lastSlotAdd = loadoutChildren[i]
else else
@ -502,8 +530,13 @@ function loadoutCheck(child, selectState)
end end
for _, v in pairs(backpackItems) do for _, v in pairs(backpackItems) do
if buttons[v] then if buttons[v] then
if child:FindFirstChild "GearReference" and buttons[v]:FindFirstChild "GearReference" then if
if buttons[v].GearReference.Value == child.GearReference.Value then child:FindFirstChild "GearReference"
and buttons[v]:FindFirstChild "GearReference"
then
if
buttons[v].GearReference.Value == child.GearReference.Value
then
buttons[v].Active = selectState buttons[v].Active = selectState
break break
end end
@ -569,7 +602,10 @@ local UnequipGearMenuClick = function(element, menu)
for i = 1, #loadoutChildren do for i = 1, #loadoutChildren do
if loadoutChildren[i]:IsA "Frame" then if loadoutChildren[i]:IsA "Frame" then
local button = loadoutChildren[i]:GetChildren() local button = loadoutChildren[i]:GetChildren()
if button[1] and button[1].GearReference.Value == gearToUnequip then if
button[1]
and button[1].GearReference.Value == gearToUnequip
then
slot = button[1].SlotNumber.Text slot = button[1].SlotNumber.Text
break break
end end
@ -583,9 +619,11 @@ function setupCharacterConnections()
if backpackAddCon then if backpackAddCon then
backpackAddCon:disconnect() backpackAddCon:disconnect()
end end
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(
addToGrid(child) function(child)
end) addToGrid(child)
end
)
-- make sure we get all the children -- make sure we get all the children
local backpackChildren = game.Players.LocalPlayer.Backpack:GetChildren() local backpackChildren = game.Players.LocalPlayer.Backpack:GetChildren()
@ -596,17 +634,21 @@ function setupCharacterConnections()
if characterChildAddedCon then if characterChildAddedCon then
characterChildAddedCon:disconnect() characterChildAddedCon:disconnect()
end end
characterChildAddedCon = game.Players.LocalPlayer.Character.ChildAdded:connect(function(child) characterChildAddedCon = game.Players.LocalPlayer.Character.ChildAdded:connect(
addToGrid(child) function(child)
updateGridActive() addToGrid(child)
end) updateGridActive()
end
)
if characterChildRemovedCon then if characterChildRemovedCon then
characterChildRemovedCon:disconnect() characterChildRemovedCon:disconnect()
end end
characterChildRemovedCon = game.Players.LocalPlayer.Character.ChildRemoved:connect(function(_) characterChildRemovedCon = game.Players.LocalPlayer.Character.ChildRemoved:connect(
updateGridActive() function(_)
end) updateGridActive()
end
)
wait() wait()
centerGear(currentLoadout:GetChildren()) centerGear(currentLoadout:GetChildren())
@ -826,7 +868,10 @@ function getGearContextMenu()
end end
function coreGuiChanged(coreGuiType, enabled) function coreGuiChanged(coreGuiType, enabled)
if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then if
coreGuiType == Enum.CoreGuiType.Backpack
or coreGuiType == Enum.CoreGuiType.All
then
if not enabled then if not enabled then
backpack.Gear.Visible = false backpack.Gear.Visible = false
end end
@ -860,12 +905,18 @@ currentLoadout.ChildRemoved:connect(function(child)
end) end)
currentLoadout.DescendantAdded:connect(function(descendant) currentLoadout.DescendantAdded:connect(function(descendant)
if not backpack.Visible and (descendant:IsA "ImageButton" or descendant:IsA "TextButton") then if
not backpack.Visible
and (descendant:IsA "ImageButton" or descendant:IsA "TextButton")
then
centerGear(currentLoadout:GetChildren()) centerGear(currentLoadout:GetChildren())
end end
end) end)
currentLoadout.DescendantRemoving:connect(function(descendant) currentLoadout.DescendantRemoving:connect(function(descendant)
if not backpack.Visible and (descendant:IsA "ImageButton" or descendant:IsA "TextButton") then if
not backpack.Visible
and (descendant:IsA "ImageButton" or descendant:IsA "TextButton")
then
wait() wait()
centerGear(currentLoadout:GetChildren()) centerGear(currentLoadout:GetChildren())
end end
@ -892,9 +943,11 @@ player.ChildAdded:connect(function(child)
if backpackAddCon then if backpackAddCon then
backpackAddCon:disconnect() backpackAddCon:disconnect()
end end
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(
addToGrid(child) function(child)
end) addToGrid(child)
end
)
end end
end) end)
@ -906,7 +959,10 @@ end)
local loadoutChildren = currentLoadout:GetChildren() local loadoutChildren = currentLoadout:GetChildren()
for i = 1, #loadoutChildren do for i = 1, #loadoutChildren do
if loadoutChildren[i]:IsA "Frame" and string.find(loadoutChildren[i].Name, "Slot") then if
loadoutChildren[i]:IsA "Frame"
and string.find(loadoutChildren[i].Name, "Slot")
then
loadoutChildren[i].ChildRemoved:connect(function() loadoutChildren[i].ChildRemoved:connect(function()
updateGridActive() updateGridActive()
end) end)
@ -918,7 +974,10 @@ end
------------------------- End Lifelong Connections ----------------------- ------------------------- End Lifelong Connections -----------------------
pcall(function() pcall(function()
coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)) coreGuiChanged(
Enum.CoreGuiType.Backpack,
Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
)
Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
end) end)
@ -939,9 +998,11 @@ if characterChildAddedCon == nil and game.Players.LocalPlayer["Character"] then
setupCharacterConnections() setupCharacterConnections()
end end
if not backpackAddCon then if not backpackAddCon then
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(
addToGrid(child) function(child)
end) addToGrid(child)
end
)
end end
backpackOpenEvent.Event:connect(backpackOpenHandler) backpackOpenEvent.Event:connect(backpackOpenHandler)

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 89449093"
-- This script manages context switches in the backpack (Gear to Wardrobe, etc.) and player state changes. Also manages global functions across different tabs (currently only search) -- This script manages context switches in the backpack (Gear to Wardrobe, etc.) and player state changes. Also manages global functions across different tabs (currently only search)
if game.CoreGui.Version < 7 then if game.CoreGui.Version < 7 then
return return
@ -45,7 +46,8 @@ if game.CoreGui.Version >= 8 then
wardrobeButton = backpack.Tabs.WardrobeButton wardrobeButton = backpack.Tabs.WardrobeButton
end end
waitForChild(backpack.Parent, "ControlFrame") waitForChild(backpack.Parent, "ControlFrame")
local backpackButton = waitForChild(backpack.Parent.ControlFrame, "BackpackButton") local backpackButton =
waitForChild(backpack.Parent.ControlFrame, "BackpackButton")
local currentTab = "gear" local currentTab = "gear"
local searchFrame = waitForChild(backpack, "SearchFrame") local searchFrame = waitForChild(backpack, "SearchFrame")
@ -64,7 +66,7 @@ local backpackIsOpen = false
local active = true local active = true
local disabledByDeveloper = false local disabledByDeveloper = false
local humanoidDiedCon = nil local humanoidDiedCon
local guiTweenSpeed = 0.25 -- how quickly we open/close the backpack local guiTweenSpeed = 0.25 -- how quickly we open/close the backpack
@ -97,7 +99,10 @@ function createPublicFunction(funcName, invokeFunc)
assert(funcName, "funcName is nil") assert(funcName, "funcName is nil")
assert(tostring(funcName), "funcName is not a string") assert(tostring(funcName), "funcName is not a string")
assert(invokeFunc, "invokeFunc is nil") assert(invokeFunc, "invokeFunc is nil")
assert(type(invokeFunc) == "function", "invokeFunc should be of type 'function'") assert(
type(invokeFunc) == "function",
"invokeFunc should be of type 'function'"
)
local newFunction = Instance.new "BindableFunction" local newFunction = Instance.new "BindableFunction"
newFunction.Name = tostring(funcName) newFunction.Name = tostring(funcName)
@ -128,7 +133,9 @@ function initHumanoidDiedConnections()
end end
waitForProperty(game.Players.LocalPlayer, "Character") waitForProperty(game.Players.LocalPlayer, "Character")
waitForChild(game.Players.LocalPlayer.Character, "Humanoid") waitForChild(game.Players.LocalPlayer.Character, "Humanoid")
humanoidDiedCon = game.Players.LocalPlayer.Character.Humanoid.Died:connect(deactivateBackpack) humanoidDiedCon = game.Players.LocalPlayer.Character.Humanoid.Died:connect(
deactivateBackpack
)
end end
function activateBackpack() function activateBackpack()
@ -171,18 +178,28 @@ local hideBackpack = function()
end end
function showBackpack() function showBackpack()
game.GuiService:AddCenterDialog(backpack, Enum.CenterDialogType.PlayerInitiatedDialog, function() game.GuiService:AddCenterDialog(
backpack.Visible = true backpack,
backpackButton.Selected = true Enum.CenterDialogType.PlayerInitiatedDialog,
end, function() function()
backpack.Visible = false backpack.Visible = true
backpackButton.Selected = false backpackButton.Selected = true
end) end,
function()
backpack.Visible = false
backpackButton.Selected = false
end
)
backpack.Visible = true backpack.Visible = true
backpackButton.Selected = true backpackButton.Selected = true
backpack:TweenSizeAndPosition( backpack:TweenSizeAndPosition(
backpackSize, backpackSize,
UDim2.new(0.5, -backpackSize.X.Offset / 2, 1, -backpackSize.Y.Offset - 88), UDim2.new(
0.5,
-backpackSize.X.Offset / 2,
1,
-backpackSize.Y.Offset - 88
),
Enum.EasingDirection.Out, Enum.EasingDirection.Out,
Enum.EasingStyle.Quad, Enum.EasingStyle.Quad,
guiTweenSpeed, guiTweenSpeed,
@ -194,8 +211,9 @@ function showBackpack()
backpackOpenEvent:Fire(currentTab) backpackOpenEvent:Fire(currentTab)
canToggle = true canToggle = true
readyForNextEvent = true readyForNextEvent = true
backpackButton.Image = "http://www.roblox.com/asset/?id=97644093" backpackButton.Image = "http://banland.xyz/asset/?id=97644093"
backpackButton.Position = UDim2.new(0.5, -60, 1, -backpackSize.Y.Offset - 103) backpackButton.Position =
UDim2.new(0.5, -60, 1, -backpackSize.Y.Offset - 103)
end) end)
end end
@ -218,7 +236,7 @@ function toggleBackpack()
backpackIsOpen = not backpackIsOpen backpackIsOpen = not backpackIsOpen
if backpackIsOpen then if backpackIsOpen then
loadoutBackground.Image = "http://www.roblox.com/asset/?id=97623721" loadoutBackground.Image = "http://banland.xyz/asset/?id=97623721"
loadoutBackground.Position = UDim2.new(-0.03, 0, -0.17, 0) loadoutBackground.Position = UDim2.new(-0.03, 0, -0.17, 0)
loadoutBackground.Size = UDim2.new(1.05, 0, 1.25, 0) loadoutBackground.Size = UDim2.new(1.05, 0, 1.25, 0)
loadoutBackground.ZIndex = 2.0 loadoutBackground.ZIndex = 2.0
@ -228,8 +246,8 @@ function toggleBackpack()
backpackButton.Position = UDim2.new(0.5, -60, 1, -44) backpackButton.Position = UDim2.new(0.5, -60, 1, -44)
loadoutBackground.Visible = false loadoutBackground.Visible = false
backpackButton.Selected = false backpackButton.Selected = false
backpackButton.Image = "http://www.roblox.com/asset/?id=97617958" backpackButton.Image = "http://banland.xyz/asset/?id=97617958"
loadoutBackground.Image = "http://www.roblox.com/asset/?id=96536002" loadoutBackground.Image = "http://banland.xyz/asset/?id=96536002"
loadoutBackground.Position = UDim2.new(-0.1, 0, -0.1, 0) loadoutBackground.Position = UDim2.new(-0.1, 0, -0.1, 0)
loadoutBackground.Size = UDim2.new(1.2, 0, 1.2, 0) loadoutBackground.Size = UDim2.new(1.2, 0, 1.2, 0)
hideBackpack() hideBackpack()
@ -368,7 +386,10 @@ local backpackReady = function()
end end
function coreGuiChanged(coreGuiType, enabled) function coreGuiChanged(coreGuiType, enabled)
if coreGuiType == Enum.CoreGuiType.Backpack or coreGuiType == Enum.CoreGuiType.All then if
coreGuiType == Enum.CoreGuiType.Backpack
or coreGuiType == Enum.CoreGuiType.All
then
active = enabled active = enabled
disabledByDeveloper = not enabled disabledByDeveloper = not enabled
@ -401,7 +422,10 @@ createPublicFunction("BackpackReady", backpackReady)
------------------------ Connections/Script Main ------------------------------------------- ------------------------ Connections/Script Main -------------------------------------------
pcall(function() pcall(function()
coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)) coreGuiChanged(
Enum.CoreGuiType.Backpack,
Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
)
Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
end) end)

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 97188756"
--[[ --[[
//FileName: ChatScript.LUA //FileName: ChatScript.LUA
//Written by: Sorcus //Written by: Sorcus
@ -95,7 +96,10 @@ do
return function(t) return function(t)
local e = { [EnumName] = enumName } local e = { [EnumName] = enumName }
for i, name in pairs(t) do for i, name in pairs(t) do
local item = setmetatable({ Name = name, Value = i, Enum = e, [EnumName] = enumName }, item_mt) local item = setmetatable(
{ Name = name, Value = i, Enum = e, [EnumName] = enumName },
item_mt
)
e[i] = item e[i] = item
e[name] = item e[name] = item
e[item] = item e[item] = item
@ -184,7 +188,12 @@ local Chat = {
["Use the Chat menu to talk to me."] = { "/sc 0", true }, ["Use the Chat menu to talk to me."] = { "/sc 0", true },
["I can only see menu chats."] = { "/sc 1", true }, ["I can only see menu chats."] = { "/sc 1", true },
["Hello"] = { ["Hello"] = {
["Hi"] = { "/sc 2_0", true, ["Hi there!"] = true, ["Hi everyone"] = true }, ["Hi"] = {
"/sc 2_0",
true,
["Hi there!"] = true,
["Hi everyone"] = true,
},
["Howdy"] = { "/sc 2_1", true, ["Howdy partner!"] = true }, ["Howdy"] = { "/sc 2_1", true, ["Howdy partner!"] = true },
["Greetings"] = { ["Greetings"] = {
"/sc 2_2", "/sc 2_2",
@ -277,7 +286,13 @@ local Chat = {
["Goodluck!"] = true, ["Goodluck!"] = true,
["Ta-ta for now!"] = true, ["Ta-ta for now!"] = true,
}, },
["Peace"] = { "/sc 3_6", true, ["Peace out!"] = true, ["Peace dudes!"] = true, ["Rest in pieces!"] = true }, ["Peace"] = {
"/sc 3_6",
true,
["Peace out!"] = true,
["Peace dudes!"] = true,
["Rest in pieces!"] = true,
},
["Silly"] = { ["Silly"] = {
"/sc 3_7", "/sc 3_7",
true, true,
@ -319,7 +334,13 @@ local Chat = {
["No, thank you"] = true, ["No, thank you"] = true,
["Thanx"] = true, ["Thanx"] = true,
}, },
["No problem"] = { "/sc 4_4", true, ["Don't worry"] = true, ["That's ok"] = true, ["np"] = true }, ["No problem"] = {
"/sc 4_4",
true,
["Don't worry"] = true,
["That's ok"] = true,
["np"] = true,
},
["You are ..."] = { ["You are ..."] = {
"/sc 4_5", "/sc 4_5",
true, true,
@ -462,7 +483,12 @@ local Chat = {
["Animals"] = { ["Animals"] = {
"/sc 6_3", "/sc 6_3",
true, true,
["Cats"] = { ["Lion"] = true, ["Tiger"] = true, ["Leopard"] = true, ["Cheetah"] = true }, ["Cats"] = {
["Lion"] = true,
["Tiger"] = true,
["Leopard"] = true,
["Cheetah"] = true,
},
["Dogs"] = { ["Dogs"] = {
["Wolves"] = true, ["Wolves"] = true,
["Beagle"] = true, ["Beagle"] = true,
@ -474,8 +500,17 @@ local Chat = {
["Terrier"] = true, ["Terrier"] = true,
["Retriever"] = true, ["Retriever"] = true,
}, },
["Horses"] = { ["Ponies"] = true, ["Stallions"] = true, ["Pwnyz"] = true }, ["Horses"] = {
["Reptiles"] = { ["Dinosaurs"] = true, ["Lizards"] = true, ["Snakes"] = true, ["Turtles!"] = true }, ["Ponies"] = true,
["Stallions"] = true,
["Pwnyz"] = true,
},
["Reptiles"] = {
["Dinosaurs"] = true,
["Lizards"] = true,
["Snakes"] = true,
["Turtles!"] = true,
},
["Hamster"] = true, ["Hamster"] = true,
["Monkey"] = true, ["Monkey"] = true,
["Bears"] = true, ["Bears"] = true,
@ -545,7 +580,11 @@ local Chat = {
["Volleyball"] = true, ["Volleyball"] = true,
["Tennis"] = true, ["Tennis"] = true,
["Sports team practice"] = true, ["Sports team practice"] = true,
["Watersports"] = { ["Surfing"] = true, ["Swimming"] = true, ["Water Polo"] = true }, ["Watersports"] = {
["Surfing"] = true,
["Swimming"] = true,
["Water Polo"] = true,
},
["Winter sports"] = { ["Winter sports"] = {
["Skiing"] = true, ["Skiing"] = true,
["Snowboarding"] = true, ["Snowboarding"] = true,
@ -599,7 +638,10 @@ local Chat = {
["Coding"] = true, ["Coding"] = true,
["Hacking"] = true, ["Hacking"] = true,
}, },
["The Internet"] = { ["lol. teh internets!"] = true, ["Watching vids"] = true }, ["The Internet"] = {
["lol. teh internets!"] = true,
["Watching vids"] = true,
},
["Dance"] = true, ["Dance"] = true,
["Gymnastics"] = true, ["Gymnastics"] = true,
["Listening to music"] = true, ["Listening to music"] = true,
@ -759,7 +801,10 @@ local Chat = {
}, },
["Boy"] = { "/sc 6_12", true }, ["Boy"] = { "/sc 6_12", true },
["Girl"] = { "/sc 6_13", true }, ["Girl"] = { "/sc 6_13", true },
["I don't want to say boy or girl. Don't ask."] = { "/sc 6_14", true }, ["I don't want to say boy or girl. Don't ask."] = {
"/sc 6_14",
true,
},
[1] = "/sc 6", [1] = "/sc 6",
}, },
["Game"] = { ["Game"] = {
@ -905,9 +950,13 @@ function Chat:EnableScrolling(toggle)
Camera.CameraType = "Scriptable" Camera.CameraType = "Scriptable"
-- Get relative position of camera and keep to it -- Get relative position of camera and keep to it
Spawn(function() Spawn(function()
local currentRelativePos = Camera.CoordinateFrame.p - torso.Position local currentRelativePos = Camera.CoordinateFrame.p
- torso.Position
while Chat.MouseOnFrame do while Chat.MouseOnFrame do
Camera.CoordinateFrame = CFrame.new(torso.Position + currentRelativePos, head.Position) Camera.CoordinateFrame = CFrame.new(
torso.Position + currentRelativePos,
head.Position
)
wait(0.015) wait(0.015)
end end
end) end)
@ -962,23 +1011,30 @@ function Chat:UpdateQueue(field, diff)
for i = #self.MessageQueue, 1, -1 do for i = #self.MessageQueue, 1, -1 do
if self.MessageQueue[i] then if self.MessageQueue[i] then
for _, label in pairs(self.MessageQueue[i]) do for _, label in pairs(self.MessageQueue[i]) do
if label and type(label) ~= "table" and type(label) ~= "number" then if
label
and type(label) ~= "table"
and type(label) ~= "number"
then
if label:IsA "TextLabel" or label:IsA "TextButton" then if label:IsA "TextLabel" or label:IsA "TextButton" then
if diff then if diff then
label.Position = label.Position - UDim2.new(0, 0, diff, 0) label.Position = label.Position
- UDim2.new(0, 0, diff, 0)
else else
if field == self.MessageQueue[i] then if field == self.MessageQueue[i] then
label.Position = UDim2.new( label.Position = UDim2.new(
self.Configuration.XScale, self.Configuration.XScale,
0, 0,
label.Position.Y.Scale - field["Message"].Size.Y.Scale, label.Position.Y.Scale
- field["Message"].Size.Y.Scale,
0 0
) )
-- Just to show up popping effect for the latest message in chat -- Just to show up popping effect for the latest message in chat
Spawn(function() Spawn(function()
wait(0.05) wait(0.05)
while label.TextTransparency >= 0 do while label.TextTransparency >= 0 do
label.TextTransparency = label.TextTransparency - 0.2 label.TextTransparency = label.TextTransparency
- 0.2
wait(0.03) wait(0.03)
end end
if label == field["Message"] then if label == field["Message"] then
@ -991,7 +1047,8 @@ function Chat:UpdateQueue(field, diff)
label.Position = UDim2.new( label.Position = UDim2.new(
self.Configuration.XScale, self.Configuration.XScale,
0, 0,
label.Position.Y.Scale - field["Message"].Size.Y.Scale, label.Position.Y.Scale
- field["Message"].Size.Y.Scale,
0 0
) )
end end
@ -1045,7 +1102,12 @@ function Chat:ComputeSpaceString(pLabel)
local nString = " " local nString = " "
if not self.TempSpaceLabel then if not self.TempSpaceLabel then
self.TempSpaceLabel = Gui.Create "TextButton" { self.TempSpaceLabel = Gui.Create "TextButton" {
Size = UDim2.new(0, pLabel.AbsoluteSize.X, 0, pLabel.AbsoluteSize.Y), Size = UDim2.new(
0,
pLabel.AbsoluteSize.X,
0,
pLabel.AbsoluteSize.Y
),
FontSize = self.Configuration.FontSize, FontSize = self.Configuration.FontSize,
Parent = self.RenderFrame, Parent = self.RenderFrame,
BackgroundTransparency = 1, BackgroundTransparency = 1,
@ -1239,7 +1301,8 @@ function Chat:CreateMessage(cPlayer, message)
-- This will give beautiful multilines as well -- This will give beautiful multilines as well
local heightField = mLabel.TextBounds.Y local heightField = mLabel.TextBounds.Y
mLabel.Size = UDim2.new(1, 0, heightField / self.RenderFrame.AbsoluteSize.Y, 0) mLabel.Size =
UDim2.new(1, 0, heightField / self.RenderFrame.AbsoluteSize.Y, 0)
pLabel.Size = mLabel.Size pLabel.Size = mLabel.Size
local queueField = {} local queueField = {}
@ -1314,7 +1377,8 @@ function Chat:CreateSafeChatOptions(list, rootButton)
count = count + 1 count = count + 1
if type(list[msg]) == "table" then if type(list[msg]) == "table" then
text_List[rootButton][chatText] = Chat:CreateSafeChatOptions(list[msg], chatText) text_List[rootButton][chatText] =
Chat:CreateSafeChatOptions(list[msg], chatText)
-- else -- else
-- --table.insert(text_List[chatText], true) -- --table.insert(text_List[chatText], true)
end end
@ -1354,13 +1418,14 @@ function Chat:CreateSafeChatGui()
Size = UDim2.new(0, 44, 0, 31), Size = UDim2.new(0, 44, 0, 31),
Position = UDim2.new(0, 1, 0.35, 0), Position = UDim2.new(0, 1, 0.35, 0),
BackgroundTransparency = 1, BackgroundTransparency = 1,
Image = "http://www.roblox.com/asset/?id=97080365", Image = "http://banland.xyz/asset/?id=97080365",
}, },
} }
self.SafeChatButton = self.SafeChatFrame.SafeChatButton self.SafeChatButton = self.SafeChatFrame.SafeChatButton
-- safe chat button is the root of this tree -- safe chat button is the root of this tree
self.SafeChatTree[self.SafeChatButton] = Chat:CreateSafeChatOptions(self.SafeChat_List, self.SafeChatButton) self.SafeChatTree[self.SafeChatButton] =
Chat:CreateSafeChatOptions(self.SafeChat_List, self.SafeChatButton)
self.SafeChatButton.MouseButton1Click:connect(function() self.SafeChatButton.MouseButton1Click:connect(function()
Chat:ToggleSafeChatMenu(self.SafeChatButton) Chat:ToggleSafeChatMenu(self.SafeChatButton)
@ -1400,7 +1465,7 @@ function Chat:CreateTouchButton()
Size = UDim2.new(1, 0, 1, 0), Size = UDim2.new(1, 0, 1, 0),
Position = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0, 0, 0, 0),
BackgroundTransparency = 1, BackgroundTransparency = 1,
Image = "http://www.roblox.com/asset/?id=97078724", Image = "http://banland.xyz/asset/?id=97078724",
}, },
} }
self.TapToChatLabel = self.ChatTouchFrame.ChatLabel self.TapToChatLabel = self.ChatTouchFrame.ChatLabel
@ -1505,7 +1570,7 @@ function Chat:CreateGui()
Gui.Create "ImageLabel" { Gui.Create "ImageLabel" {
Name = "Background", Name = "Background",
Image = "http://www.roblox.com/asset/?id=97120937", --96551212'; Image = "http://banland.xyz/asset/?id=97120937", --96551212';
Size = UDim2.new(1.3, 0, 1.64, 0), Size = UDim2.new(1.3, 0, 1.64, 0),
Position = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0, 0, 0, 0),
BackgroundTransparency = 1, BackgroundTransparency = 1,
@ -1680,9 +1745,16 @@ function Chat:PlayerChatted(...)
if PlayersService.ClassicChat then if PlayersService.ClassicChat then
if if
not (string.sub(message, 1, 3) == "/e " or string.sub(message, 1, 7) == "/emote ") not (
string.sub(message, 1, 3) == "/e "
or string.sub(message, 1, 7) == "/emote "
)
and (forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu) and (forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu)
or (Player.ChatMode == Enum.ChatMode.Menu and string.sub(message, 1, 3) == "/sc") or (Player.ChatMode == Enum.ChatMode.Menu and string.sub(
message,
1,
3
) == "/sc")
or (Chat:FindMessageInSafeChat(message, self.SafeChat_List)) or (Chat:FindMessageInSafeChat(message, self.SafeChat_List))
then then
Chat:UpdateChat(player, message) Chat:UpdateChat(player, message)
@ -1701,7 +1773,8 @@ function Chat:CullThread()
field["SpawnTime"] field["SpawnTime"]
and field["Player"] and field["Player"]
and field["Message"] and field["Message"]
and tick() - field["SpawnTime"] > self.Configuration.LifeTime and tick() - field["SpawnTime"]
> self.Configuration.LifeTime
then then
field["Player"].Visible = false field["Player"].Visible = false
field["Message"].Visible = false field["Message"].Visible = false
@ -1724,7 +1797,10 @@ function Chat:LockAllFields(gui)
end end
function Chat:CoreGuiChanged(coreGuiType, enabled) function Chat:CoreGuiChanged(coreGuiType, enabled)
if coreGuiType == Enum.CoreGuiType.Chat or coreGuiType == Enum.CoreGuiType.All then if
coreGuiType == Enum.CoreGuiType.Chat
or coreGuiType == Enum.CoreGuiType.All
then
if self.Frame then if self.Frame then
self.Frame.Visible = enabled self.Frame.Visible = enabled
end end
@ -1746,10 +1822,15 @@ function Chat:Initialize()
Chat:CreateGui() Chat:CreateGui()
pcall(function() pcall(function()
Chat:CoreGuiChanged(Enum.CoreGuiType.Chat, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Chat)) Chat:CoreGuiChanged(
Game.StarterGui.CoreGuiChangedSignal:connect(function(coreGuiType, enabled) Enum.CoreGuiType.Chat,
Chat:CoreGuiChanged(coreGuiType, enabled) Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Chat)
end) )
Game.StarterGui.CoreGuiChangedSignal:connect(
function(coreGuiType, enabled)
Chat:CoreGuiChanged(coreGuiType, enabled)
end
)
end) end)
self.EventListener = PlayersService.PlayerChatted:connect(function(...) self.EventListener = PlayersService.PlayerChatted:connect(function(...)

View File

@ -1,11 +1,19 @@
print "[Mercury]: Loaded Host corescript" print "[Mercury]: Loaded Host corescript"
-- Start Game Script Arguments
local placeId, sleeptime, access, url, killID, deathID, timeout, injectScriptAssetID, servicesUrl, libraryRegistrationScriptAssetID local placeId, sleeptime, access, url, killID, deathID, timeout, injectScriptAssetID, servicesUrl, libraryRegistrationScriptAssetID
-- StartGame --
pcall(function() pcall(function()
return game:GetService("ScriptContext"):AddStarterScript(injectScriptAssetID) game:GetService("ScriptContext"):AddStarterScript(injectScriptAssetID)
end) end)
game:GetService("RunService"):Run() game:GetService("RunService"):Run()
local waitForChild
waitForChild = function(parent, childName) -- REQUIRES: StartGanmeSharedArgs.txt
-- REQUIRES: MonitorGameStatus.txt
------------------- UTILITY FUNCTIONS --------------------------
function waitForChild(parent, childName)
while true do while true do
local child = parent:findFirstChild(childName) local child = parent:findFirstChild(childName)
if child then if child then
@ -14,184 +22,265 @@ waitForChild = function(parent, childName)
parent.ChildAdded:wait() parent.ChildAdded:wait()
end end
end end
local getKillerOfHumanoidIfStillInGame
getKillerOfHumanoidIfStillInGame = function(humanoid) -- returns the player object that killed this humanoid
-- returns nil if the killer is no longer in the game
function getKillerOfHumanoidIfStillInGame(humanoid)
-- check for kill tag on humanoid - may be more than one - todo: deal with this
local tag = humanoid:findFirstChild "creator" local tag = humanoid:findFirstChild "creator"
if tag and tag.Value.Parent then
return tag.Value -- find player with name on tag
if tag then
local killer = tag.Value
if killer.Parent then -- killer still in game
return killer
end
end end
return nil
end end
local onDied
onDied = function(victim, humanoid) -- send kill and death stats when a player dies
local killer, victorId = getKillerOfHumanoidIfStillInGame(humanoid), 0 function onDied(victim, humanoid)
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
local victorId = 0
if killer then if killer then
victorId = killer.userId victorId = killer.userId
print("STAT: kill by " .. tostring(victorId) .. " of " .. tostring(victim.userId)) print("STAT: kill by " .. victorId .. " of " .. victim.userId)
game:HttpGet(tostring(url) .. "/Game/Knockouts.ashx?UserID=" .. tostring(victorId) .. "&" .. tostring(access)) game:HttpGet(
url .. "/Game/Knockouts.ashx?UserID=" .. victorId .. "&" .. access
)
end end
print("STAT: death of " .. tostring(victim.userId) .. " by " .. tostring(victorId)) print("STAT: death of " .. victim.userId .. " by " .. victorId)
return game:HttpGet( game:HttpGet(
tostring(url) .. "/Game/Wipeouts.ashx?UserID=" .. tostring(victim.userId) .. "&" .. tostring(access) url .. "/Game/Wipeouts.ashx?UserID=" .. victim.userId .. "&" .. access
) )
end end
-----------------------------------END UTILITY FUNCTIONS -------------------------
-----------------------------------"CUSTOM" SHARED CODE----------------------------------
pcall(function() pcall(function()
settings().Network.UseInstancePacketCache = true settings().Network.UseInstancePacketCache = true
end) end)
pcall(function() pcall(function()
settings().Network.UsePhysicsPacketCache = true settings().Network.UsePhysicsPacketCache = true
end) end)
--pcall(function() settings()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.FIFO end)
pcall(function() pcall(function()
settings()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.AccumulatedError settings()["Task Scheduler"].PriorityMethod =
Enum.PriorityMethod.AccumulatedError
end) end)
--settings().Network.PhysicsSend = 1 -- 1==RoundRobin
settings().Network.PhysicsSend = Enum.PhysicsSendMethod.ErrorComputation2 settings().Network.PhysicsSend = Enum.PhysicsSendMethod.ErrorComputation2
settings().Network.ExperimentalPhysicsEnabled = true settings().Network.ExperimentalPhysicsEnabled = true
settings().Network.WaitingForCharacterLogRate = 100 settings().Network.WaitingForCharacterLogRate = 100
pcall(function() pcall(function()
return settings().Diagnostics:LegacyScriptMode() settings().Diagnostics:LegacyScriptMode()
end) end)
-----------------------------------START GAME SHARED SCRIPT------------------------------
url = "_BASE_URL" url = "_BASE_URL"
local scriptContext = game:GetService "ScriptContext" local scriptContext = game:GetService "ScriptContext"
pcall(function() pcall(function()
return scriptContext:AddStarterScript(libraryRegistrationScriptAssetID) scriptContext:AddStarterScript(libraryRegistrationScriptAssetID)
end) end)
scriptContext.ScriptsDisabled = true scriptContext.ScriptsDisabled = true
-- game:SetPlaceID(nil, false)
game:GetService("ChangeHistoryService"):SetEnabled(false) game:GetService("ChangeHistoryService"):SetEnabled(false)
-- establish this peer as the Server
local ns = game:GetService "NetworkServer" local ns = game:GetService "NetworkServer"
if url ~= nil then if url ~= nil then
pcall(function() pcall(function()
return game:GetService("Players"):SetAbuseReportUrl(tostring(url) .. "/Report/Games.ashx") game:GetService("Players"):SetAbuseReportUrl(
url .. "/Report/Games.ashx"
)
end) end)
pcall(function() pcall(function()
return game:GetService("ScriptInformationProvider"):SetAssetUrl(tostring(url) .. "/Asset/") game:GetService("ScriptInformationProvider")
:SetAssetUrl(url .. "/Asset/")
end) end)
pcall(function() pcall(function()
return game:GetService("ContentProvider"):SetBaseUrl(tostring(url) .. "/") game:GetService("ContentProvider"):SetBaseUrl(url .. "/")
end) end)
-- pcall(function() game:GetService("Players"):SetChatFilterUrl(url .. "/Game/ChatFilter.ashx") end)
-- game:GetService("BadgeService"):SetPlaceId(placeId)
if access ~= nil then if access ~= nil then
do game:GetService("BadgeService"):SetAwardBadgeUrl(
local _with_0 = game:GetService "BadgeService" url
_with_0:SetAwardBadgeUrl( .. "/Game/Badge/AwardBadge.ashx?UserID=%d&BadgeID=%d&PlaceID=%d&"
tostring(url) .. "/Game/Badge/AwardBadge.ashx?UserID=%d&BadgeID=%d&PlaceID=%d&" .. tostring(access) .. access
) )
_with_0:SetHasBadgeUrl( game:GetService("BadgeService"):SetHasBadgeUrl(
tostring(url) .. "/Game/Badge/HasBadge.ashx?UserID=%d&BadgeID=%d&" .. tostring(access) url .. "/Game/Badge/HasBadge.ashx?UserID=%d&BadgeID=%d&" .. access
) )
_with_0:SetIsBadgeDisabledUrl( game:GetService("BadgeService"):SetIsBadgeDisabledUrl(
tostring(url) .. "/Game/Badge/IsBadgeDisabled.ashx?BadgeID=%d&PlaceID=%d&" .. tostring(access) url
) .. "/Game/Badge/IsBadgeDisabled.ashx?BadgeID=%d&PlaceID=%d&"
end .. access
do )
local _with_0 = game:GetService "FriendService"
_with_0:SetMakeFriendUrl( game:GetService("FriendService"):SetMakeFriendUrl(
tostring(servicesUrl) .. "/Friend/CreateFriend?firstUserId=%d&secondUserId=%d&" .. tostring(access) servicesUrl
) .. "/Friend/CreateFriend?firstUserId=%d&secondUserId=%d&"
_with_0:SetBreakFriendUrl( .. access
tostring(servicesUrl) .. "/Friend/BreakFriend?firstUserId=%d&secondUserId=%d&" .. tostring(access) )
) game:GetService("FriendService"):SetBreakFriendUrl(
_with_0:SetGetFriendsUrl(tostring(servicesUrl) .. "/Friend/AreFriends?userId=%d&" .. tostring(access)) servicesUrl
end .. "/Friend/BreakFriend?firstUserId=%d&secondUserId=%d&"
.. access
)
game:GetService("FriendService"):SetGetFriendsUrl(
servicesUrl .. "/Friend/AreFriends?userId=%d&" .. access
)
end end
game:GetService("BadgeService"):SetIsBadgeLegalUrl "" game:GetService("BadgeService"):SetIsBadgeLegalUrl ""
do game:GetService("InsertService")
local _with_0 = game:GetService "InsertService" :SetBaseSetsUrl(
_with_0:SetBaseSetsUrl(tostring(url) .. "/game/tools/insertasset?nsets=10&type=base") url .. "/Game/Tools/InsertAsset.ashx?nsets=10&type=base"
_with_0:SetUserSetsUrl(tostring(url) .. "/game/tools/insertasset?nsets=20&type=user&userid=%d") )
_with_0:SetCollectionUrl(tostring(url) .. "/game/tools/insertasset?sid=%d") game:GetService("InsertService"):SetUserSetsUrl(
_with_0:SetAssetUrl(tostring(url) .. "/Asset/?id=%d") url .. "/Game/Tools/InsertAsset.ashx?nsets=20&type=user&userid=%d"
_with_0:SetAssetVersionUrl(tostring(url) .. "/Asset/?assetversionid=%d") )
end game:GetService("InsertService")
:SetCollectionUrl(url .. "/Game/Tools/InsertAsset.ashx?sid=%d")
game:GetService("InsertService"):SetAssetUrl(url .. "/Asset/?id=%d")
game:GetService("InsertService")
:SetAssetVersionUrl(url .. "/Asset/?assetversionid=%d")
pcall(function() pcall(function()
return loadfile(tostring(url) .. "/Game/LoadPlaceInfo.ashx?PlaceId=" .. tostring(placeId))() loadfile(url .. "/Game/LoadPlaceInfo.ashx?PlaceId=" .. placeId)()
end) end)
pcall(function() pcall(function()
if access then if access then
return loadfile( loadfile(
tostring(url) url
.. "/Game/PlaceSpecificScript.ashx?PlaceId=" .. "/Game/PlaceSpecificScript.ashx?PlaceId="
.. tostring(placeId) .. placeId
.. "&" .. "&"
.. tostring(access) .. access
)() )()
end end
end) end)
end end
pcall(function() pcall(function()
return game:GetService("NetworkServer"):SetIsPlayerAuthenticationRequired(true) game:GetService("NetworkServer"):SetIsPlayerAuthenticationRequired(true)
end) end)
settings().Diagnostics.LuaRamLimit = 0 settings().Diagnostics.LuaRamLimit = 0
if (placeId ~= nil) and (killID ~= nil) and (deathID ~= nil) and (url ~= nil) then --settings().Network:SetThroughputSensitivity(0.08, 0.01)
local createDeathMonitor --settings().Network.SendRate = 35
createDeathMonitor = function(player) --settings().Network.PhysicsSend = 0 -- 1==RoundRobin
--shared["__time"] = 0
--game:GetService("RunService").Stepped:connect(function (time) shared["__time"] = time end)
if placeId ~= nil and killID ~= nil and deathID ~= nil and url ~= nil then
-- listen for the death of a Player
function createDeathMonitor(player)
-- we don't need to clean up old monitors or connections since the Character will be destroyed soon
if player.Character then if player.Character then
local humanoid = waitForChild(player.Character, "Humanoid") local humanoid = waitForChild(player.Character, "Humanoid")
return humanoid.Died:connect(function() humanoid.Died:connect(function()
return onDied(player, humanoid) onDied(player, humanoid)
end) end)
end end
end end
-- listen to all Players' Characters
game:GetService("Players").ChildAdded:connect(function(player) game:GetService("Players").ChildAdded:connect(function(player)
createDeathMonitor(player) createDeathMonitor(player)
return player.Changed:connect(function(property) player.Changed:connect(function(property)
if property == "Character" then if property == "Character" then
return createDeathMonitor(player) createDeathMonitor(player)
end end
end) end)
end) end)
end end
game:GetService("Players").PlayerAdded:connect(function(player) game:GetService("Players").PlayerAdded:connect(function(player)
print("Player " .. tostring(player.userId) .. " added") print("Player " .. player.userId .. " added")
if url and access and placeId and player and player.userId then if url and access and placeId and player and player.userId then
game:HttpGet( game:HttpGet(
tostring(url) url
.. "/Game/ClientPresence.ashx?action=connect&" .. "/Game/ClientPresence.ashx?action=connect&"
.. tostring(access) .. access
.. "&PlaceID=" .. "&PlaceID="
.. tostring(placeId) .. placeId
.. "&UserID=" .. "&UserID="
.. tostring(player.userId) .. player.userId
) )
return game:HttpGet( game:HttpGet(
tostring(url) url
.. "/Game/PlaceVisit.ashx?UserID=" .. "/Game/PlaceVisit.ashx?UserID="
.. tostring(player.userId) .. player.userId
.. "&AssociatedPlaceID=" .. "&AssociatedPlaceID="
.. tostring(placeId) .. placeId
.. "&" .. "&"
.. tostring(access) .. access
) )
end end
end) end)
game:GetService("Players").PlayerRemoving:connect(function(player) game:GetService("Players").PlayerRemoving:connect(function(player)
print("Player " .. tostring(player.userId) .. " leaving") print("Player " .. player.userId .. " leaving")
if url and access and placeId and player and player.userId then if url and access and placeId and player and player.userId then
return game:HttpGet( game:HttpGet(
tostring(url) url
.. "/Game/ClientPresence.ashx?action=disconnect&" .. "/Game/ClientPresence.ashx?action=disconnect&"
.. tostring(access) .. access
.. "&PlaceID=" .. "&PlaceID="
.. tostring(placeId) .. placeId
.. "&UserID=" .. "&UserID="
.. tostring(player.userId) .. player.userId
) )
end end
end) end)
if (placeId ~= nil) and (url ~= nil) then
if placeId ~= nil and url ~= nil then
-- yield so that file load happens in the heartbeat thread
wait() wait()
game:Load(tostring(url) .. "/asset/?id=" .. tostring(placeId))
-- load the game
game:Load(url .. "/asset/?id=" .. placeId)
end end
if _MAP_LOCATION_EXISTS then if _MAP_LOCATION_EXISTS then
-- yield so that file load happens in the heartbeat thread
wait() wait()
-- load the game
game:Load "_MAP_LOCATION" game:Load "_MAP_LOCATION"
end end
-- Now start the connection
ns:Start(_SERVER_PORT, sleeptime) ns:Start(_SERVER_PORT, sleeptime)
game:GetService("Visit"):SetPing("_SERVER_PRESENCE_URL", 30) game:GetService("Visit"):SetPing("_SERVER_PRESENCE_URL", 30)
if timeout then if timeout then
scriptContext:SetTimeout(timeout) scriptContext:SetTimeout(timeout)
end end
scriptContext.ScriptsDisabled = false scriptContext.ScriptsDisabled = false
--delay(1, function()
-- loadfile(url .. "/analytics/GamePerfMonitor.ashx")(game.JobId, placeId)
--end)
local reset = ";mc" local reset = ";mc"
return game.Players.PlayerAdded:connect(function(player) game.Players.PlayerAdded:connect(function(player)
return player.Chatted:connect(function(msg) player.Chatted:connect(function(msg)
if msg == reset then if msg == reset then
if player.Character then if player.Character then
player.Character.Humanoid.Health = 0 player.Character.Humanoid.Health = 0

View File

@ -1,9 +1,25 @@
print "[Mercury]: Loaded Join corescript" -- MultiplayerSharedScript.lua inserted here ------ Prepended to Join.lua -- print "[Mercury]: Loaded Join corescript"
local InsertService = game:GetService "InsertService"
local ChangeHistoryService = game:GetService "ChangeHistoryService"
local ContentProvider = game:GetService "ContentProvider"
local SocialService = game:GetService "SocialService"
local GamePassService = game:GetService "GamePassService"
local MarketplaceService = game:GetService "MarketplaceService"
-- local UserInputService = game:GetService "UserInputService"
local Players = game:GetService "Players"
local Client = game:GetService "NetworkClient"
local Visit = game:GetService "Visit"
-- MultiplayerSharedScript.lua inserted here ------ Prepended to Join.lua --
pcall(function() pcall(function()
return game:SetPlaceID(_PLACE_ID, false) game:SetPlaceID(_PLACE_ID, false)
end) end)
local isTouchDevice = Game:GetService("UserInputService").TouchEnabled
-- if we are on a touch device, no blocking http calls allowed! This can cause a crash on iOS
-- In general we need a long term strategy to remove blocking http calls from all platforms
-- local isTouchDevice = UserInputService.TouchEnabled
settings()["Game Options"].CollisionSoundEnabled = true settings()["Game Options"].CollisionSoundEnabled = true
pcall(function() pcall(function()
settings().Rendering.EnableFRM = true settings().Rendering.EnableFRM = true
@ -12,215 +28,268 @@ pcall(function()
settings().Physics.Is30FpsThrottleEnabled = false settings().Physics.Is30FpsThrottleEnabled = false
end) end)
pcall(function() pcall(function()
settings()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.AccumulatedError settings()["Task Scheduler"].PriorityMethod =
Enum.PriorityMethod.AccumulatedError
end) end)
pcall(function() pcall(function()
settings().Physics.PhysicsEnvironmentalThrottle = Enum.EnviromentalPhysicsThrottle.DefaultAuto settings().Physics.PhysicsEnvironmentalThrottle =
Enum.EnviromentalPhysicsThrottle.DefaultAuto
end) end)
-- arguments ---------------------------------------
local threadSleepTime = ... local threadSleepTime = ...
if threadSleepTime == nil then if threadSleepTime == nil then
threadSleepTime = 15 threadSleepTime = 15
end end
local test = _IS_STUDIO_JOIN local test = _IS_STUDIO_JOIN
print "! Joining game '_PLACE_ID' place _PLACE_ID at _SERVER_ADDRESS" print "! Joining game '_PLACE_ID' place _PLACE_ID at _SERVER_ADDRESS"
game:GetService("ChangeHistoryService"):SetEnabled(false)
game:GetService("ContentProvider"):SetThreadPool(16) ChangeHistoryService:SetEnabled(false)
do ContentProvider:SetThreadPool(16)
local _with_0 = game:GetService "InsertService" InsertService:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base"
_with_0:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base" InsertService:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d"
_with_0:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d" InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d"
_with_0:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d" InsertService:SetAssetUrl "http://banland.xyz/Asset/?id=%d"
_with_0:SetAssetUrl "http://banland.xyz/Asset/?id=%d" InsertService:SetAssetVersionUrl "http://banland.xyz/Asset/?assetversionid=%d"
_with_0:SetAssetVersionUrl "http://banland.xyz/asset/?assetversionid=%d"
end
do
local _with_0 = game:GetService "SocialService"
pcall(function()
return _with_0:SetFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsFriendsWith&playerid=%d&userid=%d"
end)
pcall(function()
return _with_0:SetBestFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsBestFriendsWith&playerid=%d&userid=%d"
end)
pcall(function()
return _with_0:SetGroupUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=%d&groupid=%d"
end)
pcall(function()
return _with_0:SetGroupRankUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=%d&groupid=%d"
end)
pcall(function()
return _with_0:SetGroupRoleUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRole&playerid=%d&groupid=%d"
end)
end
pcall(function() pcall(function()
return game:GetService("GamePassService") SocialService:SetFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsFriendsWith&playerid=%d&userid=%d"
:SetPlayerHasPassUrl "http://banland.xyz/Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d"
end) end)
pcall(function() pcall(function()
return game:GetService("MarketplaceService") SocialService:SetBestFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsBestFriendsWith&playerid=%d&userid=%d"
:SetProductInfoUrl "https://banland.xyz/marketplace/productinfo?assetId=%d"
end) end)
pcall(function() pcall(function()
return game:GetService("MarketplaceService") SocialService:SetGroupUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=%d&groupid=%d"
:SetPlayerOwnsAssetUrl "https://banland.xyz/ownership/hasasset?userId=%d&assetId=%d"
end) end)
pcall(function() pcall(function()
return game:SetCreatorID(_CREATOR_ID, Enum.CreatorType.User) SocialService:SetGroupRankUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=%d&groupid=%d"
end) end)
pcall(function() pcall(function()
return game:GetService("Players"):SetChatStyle(Enum.ChatStyle.ClassicAndBubble) SocialService:SetGroupRoleUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRole&playerid=%d&groupid=%d"
end) end)
pcall(function()
GamePassService:SetPlayerHasPassUrl "http://banland.xyz/Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d"
end)
pcall(function()
MarketplaceService:SetProductInfoUrl "https://banland.xyz/marketplace/productinfo?assetId=%d"
end)
pcall(function()
MarketplaceService:SetPlayerOwnsAssetUrl "https://banland.xyz/ownership/hasasset?userId=%d&assetId=%d"
end)
pcall(function()
game:SetCreatorID(_CREATOR_ID, Enum.CreatorType.User)
end)
-- Bubble chat. This is all-encapsulated to allow us to turn it off with a config setting
pcall(function()
Players:SetChatStyle(Enum.ChatStyle.ClassicAndBubble)
end)
local waitingForCharacter = false local waitingForCharacter = false
pcall(function() pcall(function()
if settings().Network.MtuOverride == 0 then if settings().Network.MtuOverride == 0 then
settings().Network.MtuOverride = 1400 settings().Network.MtuOverride = 1400
end end
end) end)
client = game:GetService "NetworkClient"
visit = game:GetService "Visit" -- functions ---------------------------------------
setMessage = function(message) function setMessage(message)
return game:SetMessage((function() -- todo: animated "..."
do game:SetMessage(message)
return message
end
end)())
end end
showErrorWindow = function(message, _, _)
return game:SetMessage(message) function showErrorWindow(message, _, _)
game:SetMessage(message)
end end
reportError = function(err, message)
print("***ERROR*** " .. tostring(err)) function reportError(err, message)
print("***ERROR*** " .. err)
if not test then if not test then
visit:SetUploadUrl "" Visit:SetUploadUrl ""
end end
client:disconnect() Client:Disconnect()
wait(4) wait(4)
return showErrorWindow("Error: " .. tostring(err), message, "Other") showErrorWindow("Error: " .. err, message, "Other")
end end
onDisconnection = function(_, lostConnection)
-- called when the client connection closes
function onDisconnection(_, lostConnection)
if lostConnection then if lostConnection then
return showErrorWindow("You have lost the connection to the game", "LostConnection", "LostConnection") showErrorWindow(
"You have lost the connection to the game",
"LostConnection",
"LostConnection"
)
else else
return showErrorWindow("This game has shut down", "Kick", "Kick") showErrorWindow("This game has shut down", "Kick", "Kick")
end end
end end
requestCharacter = function(replicator)
function requestCharacter(replicator)
-- prepare code for when the Character appears
local connection local connection
connection = player.Changed:connect(function(property) connection = player.Changed:connect(function(property)
if property == "Character" then if property == "Character" then
game:ClearMessage() game:ClearMessage()
waitingForCharacter = false waitingForCharacter = false
return connection:disconnect() connection:disconnect()
end end
end) end)
setMessage "Requesting character" setMessage "Requesting character"
local success, err = pcall(function() local success, err = pcall(function()
replicator:RequestCharacter() replicator:RequestCharacter()
setMessage "Waiting for character" setMessage "Waiting for character"
waitingForCharacter = true waitingForCharacter = true
end) end)
if not success then if not success then
reportError(err, "W4C") reportError(err, "W4C")
return return
end end
end end
onConnectionAccepted = function(url, replicator)
local connectResolved, waitingForMarker = true, true -- called when the client connection is established
function onConnectionAccepted(url, replicator)
connectResolved = true
local waitingForMarker = true
local success, err = pcall(function() local success, err = pcall(function()
if not test then if not test then
visit:SetPing("_PING_URL", 30) Visit:SetPing("_PING_URL", 30)
end
do
game:SetMessageBrickCount()
end end
game:SetMessageBrickCount()
replicator.Disconnection:connect(onDisconnection) replicator.Disconnection:connect(onDisconnection)
-- Wait for a marker to return before creating the Player
local marker = replicator:SendMarker() local marker = replicator:SendMarker()
return marker.Received:connect(function()
marker.Received:connect(function()
waitingForMarker = false waitingForMarker = false
return requestCharacter(replicator) requestCharacter(replicator)
end) end)
end) end)
if not success then if not success then
reportError(err, "ConnectionAccepted") reportError(err, "ConnectionAccepted")
return return
end end
-- TODO: report marker progress
while waitingForMarker do while waitingForMarker do
workspace:ZoomToExtents() workspace:ZoomToExtents()
wait(0.5) wait(0.5)
end end
end end
onConnectionFailed = function(_, err)
return showErrorWindow( -- called when the client connection fails
"Failed to connect to the Game. (ID=" .. tostring(err) .. ")", function onConnectionFailed(_, error)
"ID" .. tostring(err), showErrorWindow(
"Failed to connect to the Game. (ID=" .. error .. ")",
"ID" .. error,
"Other" "Other"
) )
end end
onConnectionRejected = function()
-- called when the client connection is rejected
function onConnectionRejected()
connectionFailed:disconnect() connectionFailed:disconnect()
return showErrorWindow("This game is not available. Please try another", "WrongVersion", "WrongVersion") showErrorWindow(
"This game is not available. Please try another",
"WrongVersion",
"WrongVersion"
)
end end
local idled = false local idled = false
onPlayerIdled = function(time) function onPlayerIdled(time)
if time > 20 * 60 then if time > 20 * 60 then
showErrorWindow(string.format("You were disconnected for being idle %d minutes", time / 60), "Idle", "Idle") showErrorWindow(
client:disconnect() string.format(
"You were disconnected for being idle %d minutes",
time / 60
),
"Idle",
"Idle"
)
Client:disconnect()
if not idled then if not idled then
idled = true idled = true
end end
end end
end end
-- main ------------------------------------------------------------
pcall(function() pcall(function()
return settings().Diagnostics:LegacyScriptMode() settings().Diagnostics:LegacyScriptMode()
end) end)
local success, err = pcall(function() local success, err = pcall(function()
game:SetRemoteBuildMode(true) game:SetRemoteBuildMode(true)
setMessage "Connecting to Server" setMessage "Connecting to Server"
client.ConnectionAccepted:connect(onConnectionAccepted) Client.ConnectionAccepted:connect(onConnectionAccepted)
client.ConnectionRejected:connect(onConnectionRejected) Client.ConnectionRejected:connect(onConnectionRejected)
connectionFailed = client.ConnectionFailed:connect(onConnectionFailed) connectionFailed = Client.ConnectionFailed:connect(onConnectionFailed)
client.Ticket = "" Client.Ticket = ""
playerConnectSucces, player = pcall(function() playerConnectSucces, player = pcall(function()
return client:PlayerConnect(_USER_ID, "_SERVER_ADDRESS", _SERVER_PORT, 0, threadSleepTime) return Client:PlayerConnect(
_USER_ID,
"_SERVER_ADDRESS",
_SERVER_PORT,
0,
threadSleepTime
)
end) end)
if not playerConnectSucces then if not playerConnectSucces then
player = game:GetService("Players"):CreateLocalPlayer(_USER_ID) --Old player connection scheme
client:Connect("_SERVER_ADDRESS", _SERVER_PORT, 0, threadSleepTime) player = Players:CreateLocalPlayer(_USER_ID)
end Client:Connect("_SERVER_ADDRESS", _SERVER_PORT, 0, threadSleepTime)
if not test then
delay(300, function() end)
end
do
local _with_0 = player
_with_0:SetSuperSafeChat(false)
pcall(function()
return _with_0:SetUnder13(false)
end)
pcall(function()
return _with_0:SetMembershipType(Enum.MembershipType._MEMBERSHIP_TYPE)
end)
pcall(function()
return _with_0:SetAccountAge(1)
end)
end end
player:SetSuperSafeChat(false)
pcall(function()
player:SetUnder13(false)
end)
pcall(function()
player:SetMembershipType(Enum.MembershipType._MEMBERSHIP_TYPE)
end)
pcall(function()
player:SetAccountAge(1)
end)
player.Idled:connect(onPlayerIdled) player.Idled:connect(onPlayerIdled)
pcall(function() pcall(function()
player.Name = [========[_USER_NAME]========] player.Name = [========[_USER_NAME]========]
end) end)
player.CharacterAppearance = "_CHAR_APPEARANCE" player.CharacterAppearance = "_CHAR_APPEARANCE"
if not test then if not test then
return visit:SetUploadUrl "" Visit:SetUploadUrl ""
end end
end) end)
if not success then if not success then
reportError(err, "CreatePlayer") reportError(err, "CreatePlayer")
end end
if not test then if not test then
-- TODO: Async get?
loadfile ""("", -1, 0) loadfile ""("", -1, 0)
end end
pcall(function() pcall(function()
return game:SetScreenshotInfo "" game:SetScreenshotInfo ""
end) end)
return pcall(function() pcall(function()
return game:SetVideoInfo '<?xml version="1.0"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"><media:group><media:title type="plain"><![CDATA[ROBLOX Place]]></media:title><media:description type="plain"><![CDATA[ For more games visit http://banland.xyz]]></media:description><media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Games</media:category><media:keywords>ROBLOX, video, free game, online virtual world</media:keywords></media:group></entry>' game:SetVideoInfo '<?xml version="1.0"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"><media:group><media:title type="plain"><![CDATA[Mercury Place]]></media:title><media:description type="plain"><![CDATA[ For more games visit http://banland.xyz]]></media:description><media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Games</media:category><media:keywords>Mercury, video, free game, online virtual world</media:keywords></media:group></entry>'
end) end)
-- use single quotes here because the video info string may have unescaped double quotes

View File

@ -1,60 +1,63 @@
print "[Mercury]: Loaded Studio corescript" print "[Mercury]: Loaded Studio corescript"
do local MarketplaceService = game:GetService "MarketplaceService"
local _with_0 = game:GetService "InsertService" local InsertService = game:GetService "InsertService"
pcall(function() local SocialService = game:GetService "SocialService"
return _with_0:SetFreeModelUrl "http://banland.xyz/game/tools/insertasset?type=fm&q=%s&pg=%d&rs=%d" local GamePassService = game:GetService "GamePassService"
end) local ScriptInformationProvider = game:GetService "ScriptInformationProvider"
pcall(function() local ScriptContext = game:GetService "ScriptContext"
return _with_0:SetFreeDecalUrl "http://banland.xyz/game/tools/insertasset?type=fd&q=%s&pg=%d&rs=%d" -- Setup studio cmd bar & load core scripts
end)
game:GetService("ScriptInformationProvider"):SetAssetUrl "http://banland.xyz/Asset/"
_with_0:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base"
_with_0:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d"
_with_0:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d"
_with_0:SetAssetUrl "http://banland.xyz/Asset/?id=%d"
_with_0:SetAssetVersionUrl "http://banland.xyz/asset/?assetversionid=%d"
_with_0:SetTrustLevel(0)
end
do
local _with_0 = game:GetService "SocialService"
pcall(function()
return _with_0:SetFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsFriendsWith&playerid=%d&userid=%d"
end)
pcall(function()
return _with_0:SetBestFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsBestFriendsWith&playerid=%d&userid=%d"
end)
pcall(function()
return _with_0:SetGroupUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=%d&groupid=%d"
end)
pcall(function()
return _with_0:SetGroupRankUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=%d&groupid=%d"
end)
pcall(function()
return _with_0:SetGroupRoleUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRole&playerid=%d&groupid=%d"
end)
end
pcall(function() pcall(function()
return game:GetService("GamePassService") InsertService:SetFreeModelUrl "http://banland.xyz/game/tools/insertasset?type=fm&q=%s&pg=%d&rs=%d"
:SetPlayerHasPassUrl "http://banland.xyz/Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d"
end) end)
do pcall(function()
local _with_0 = game:GetService "MarketplaceService" InsertService:SetFreeDecalUrl "http://banland.xyz/game/tools/insertasset?type=fd&q=%s&pg=%d&rs=%d"
pcall(function() end)
return _with_0:SetProductInfoUrl "https://banland.xyz/marketplace/productinfo?assetId=%d"
end) ScriptInformationProvider:SetAssetUrl "http://banland.xyz/Asset/"
pcall(function() InsertService:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base"
return _with_0:SetDevProductInfoUrl "https://banland.xyz/marketplace/productDetails?productId=%d" InsertService:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d"
end) InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d"
pcall(function() InsertService:SetAssetUrl "http://banland.xyz/Asset/?id=%d"
return _with_0:SetPlayerOwnsAssetUrl "https://banland.xyz/ownership/hasasset?userId=%d&assetId=%d" InsertService:SetAssetVersionUrl "http://banland.xyz/Asset/?assetversionid=%d"
end) InsertService:SetTrustLevel(0)
end
pcall(function()
SocialService:SetFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsFriendsWith&playerid=%d&userid=%d"
end)
pcall(function()
SocialService:SetBestFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsBestFriendsWith&playerid=%d&userid=%d"
end)
pcall(function()
SocialService:SetGroupUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=%d&groupid=%d"
end)
pcall(function()
SocialService:SetGroupRankUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=%d&groupid=%d"
end)
pcall(function()
SocialService:SetGroupRoleUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRole&playerid=%d&groupid=%d"
end)
pcall(function()
GamePassService:SetPlayerHasPassUrl "http://banland.xyz/Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d"
end)
pcall(function()
MarketplaceService:SetProductInfoUrl "https://banland.xyz/marketplace/productinfo?assetId=%d"
end)
pcall(function()
MarketplaceService:SetDevProductInfoUrl "https://banland.xyz/marketplace/productDetails?productId=%d"
end)
pcall(function()
MarketplaceService:SetPlayerOwnsAssetUrl "https://banland.xyz/ownership/hasasset?userId=%d&assetId=%d"
end)
local result, _ = pcall(function() local result, _ = pcall(function()
return game:GetService("ScriptContext"):AddStarterScript(37801172) ScriptContext:AddStarterScript(37801172)
end) end)
if not result then if not result then
return pcall(function() pcall(function()
return game:GetService("ScriptContext") ScriptContext:AddCoreScript(
:AddCoreScript(37801172, game:GetService("ScriptContext", "StarterScript")) 37801172,
game:GetService "ScriptContext",
"StarterScript"
)
end) end)
end end

View File

@ -1,127 +1,147 @@
print "[Mercury]: Loaded Visit corescript" print "[Mercury]: Loaded Visit corescript"
local ChangeHistoryService = game:GetService "ChangeHistoryService"
local InsertService = game:GetService "InsertService"
local Players = game:GetService "Players"
local RunService = game:GetService "RunService"
local ScriptInformationProvider = game:GetService "ScriptInformationProvider"
local SocialService = game:GetService "SocialService"
local CoreGui = game:GetService "CoreGui"
local ContentProvider = game:GetService "ContentProvider"
local GamePassService = game:GetService "GamePassService"
local Visit = game:GetService "Visit"
local ScriptContext = game:GetService "ScriptContext"
-- Prepended to Edit.lua and Visit.lua and Studio.lua and PlaySolo.lua--
do do
pcall(function() pcall(function()
return game:SetPlaceID(_PLACE_ID) return game:SetPlaceID(_PLACE_ID)
end) end)
end end
local visit, message = game:GetService "Visit", Instance.new "Message" local message = Instance.new "Message"
message.Parent = workspace message.Parent = workspace
message.archivable = false message.archivable = false
game:GetService("ScriptInformationProvider"):SetAssetUrl "http://banland.xyz/Asset/"
game:GetService("ContentProvider"):SetThreadPool(16) ScriptInformationProvider:SetAssetUrl "http://banland.xyz/Asset/"
ContentProvider:SetThreadPool(16)
pcall(function() pcall(function()
return game:GetService("InsertService") InsertService:SetFreeModelUrl "http://banland.xyz/game/tools/insertasset?type=fm&q=%s&pg=%d&rs=%d"
:SetFreeModelUrl "http://banland.xyz/game/tools/insertasset?type=fm&q=%s&pg=%d&rs=%d" end) -- Used for free model search (insert tool)
end)
pcall(function() pcall(function()
return game:GetService("InsertService") InsertService:SetFreeDecalUrl "http://banland.xyz/game/tools/insertasset?type=fd&q=%s&pg=%d&rs=%d"
:SetFreeDecalUrl "http://banland.xyz/game/tools/insertasset?type=fd&q=%s&pg=%d&rs=%d" end) -- Used for free decal search (insert tool)
end)
settings().Diagnostics:LegacyScriptMode() settings().Diagnostics:LegacyScriptMode()
do
local _with_0 = game:GetService "InsertService" InsertService:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base"
_with_0:SetBaseSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=10&type=base" InsertService:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d"
_with_0:SetUserSetsUrl "http://banland.xyz/game/tools/insertasset?nsets=20&type=user&userid=%d" InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d"
_with_0:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d" InsertService:SetAssetUrl "http://banland.xyz/Asset/?id=%d"
_with_0:SetAssetUrl "http://banland.xyz/Asset/?id=%d" InsertService:SetAssetVersionUrl "http://banland.xyz/Asset/?assetversionid=%d"
_with_0:SetAssetVersionUrl "http://banland.xyz/asset/?assetversionid=%d"
end
do
local _with_0 = game:GetService "SocialService"
pcall(function()
return _with_0:SetFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsFriendsWith&playerid=%d&userid=%d"
end)
pcall(function()
return _with_0:SetBestFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsBestFriendsWith&playerid=%d&userid=%d"
end)
pcall(function()
return _with_0:SetGroupUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=%d&groupid=%d"
end)
pcall(function()
return _with_0:SetGroupRankUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=%d&groupid=%d"
end)
pcall(function()
return _with_0:SetGroupRoleUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRole&playerid=%d&groupid=%d"
end)
end
pcall(function() pcall(function()
return game:GetService("GamePassService") SocialService:SetFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsFriendsWith&playerid=%d&userid=%d"
:SetPlayerHasPassUrl "http://banland.xyz/Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d"
end) end)
pcall(function() pcall(function()
return game:SetCreatorID(0, Enum.CreatorType.User) SocialService:SetBestFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsBestFriendsWith&playerid=%d&userid=%d"
end) end)
pcall(function() pcall(function()
return game:SetScreenshotInfo "" SocialService:SetGroupUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=%d&groupid=%d"
end) end)
pcall(function() pcall(function()
return game:SetVideoInfo "" SocialService:SetGroupRankUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=%d&groupid=%d"
end) end)
pcall(function()
SocialService:SetGroupRoleUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRole&playerid=%d&groupid=%d"
end)
pcall(function()
GamePassService:SetPlayerHasPassUrl "http://banland.xyz/Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d"
end)
pcall(function()
game:SetCreatorID(0, Enum.CreatorType.User)
end)
pcall(function()
game:SetScreenshotInfo ""
end)
pcall(function()
game:SetVideoInfo ""
end)
pcall(function() pcall(function()
settings().Rendering.EnableFRM = true settings().Rendering.EnableFRM = true
end) end)
pcall(function() pcall(function()
settings()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.AccumulatedError settings()["Task Scheduler"].PriorityMethod =
Enum.PriorityMethod.AccumulatedError
end) end)
game:GetService("ChangeHistoryService"):SetEnabled(false)
ChangeHistoryService:SetEnabled(false)
pcall(function() pcall(function()
return game:GetService("Players") Players:SetBuildUserPermissionsUrl "http://banland.xyz/Game/BuildActionPermissionCheck.ashx?assetId=0&userId=%d&isSolo=true"
:SetBuildUserPermissionsUrl "http://banland.xyz/Game/BuildActionPermissionCheck.ashx?assetId=0&userId=%d&isSolo=true"
end) end)
workspace:SetPhysicsThrottleEnabled(true) workspace:SetPhysicsThrottleEnabled(true)
local addedBuildTools, screenGui, doVisit = false, game:GetService("CoreGui"):FindFirstChild "RobloxGui", nil
doVisit = function() local addedBuildTools = false
local screenGui = CoreGui:FindFirstChild "RobloxGui"
function doVisit()
message.Text = "Loading Game" message.Text = "Loading Game"
do
pcall(function() pcall(function()
return visit:SetUploadUrl "" Visit:SetUploadUrl ""
end) end)
end
message.Text = "Running" message.Text = "Running"
game:GetService("RunService"):Run() RunService:Run()
message.Text = "Creating Player" message.Text = "Creating Player"
do
player = game:GetService("Players"):CreateLocalPlayer(0) player = game:GetService("Players"):CreateLocalPlayer(0)
end
player.CharacterAppearance = "" player.CharacterAppearance = ""
local propExists, canAutoLoadChar = false, false local propExists, canAutoLoadChar = false, false
propExists = pcall(function() propExists = pcall(function()
canAutoLoadChar = game.Players.CharacterAutoLoads canAutoLoadChar = game.Players.CharacterAutoLoads
end) end)
if (propExists and canAutoLoadChar) or not propExists then if (propExists and canAutoLoadChar) or not propExists then
player:LoadCharacter() player:LoadCharacter()
end end
message.Text = "Setting GUI" message.Text = "Setting GUI"
player:SetSuperSafeChat(true) player:SetSuperSafeChat(true)
pcall(function() pcall(function()
return player:SetMembershipType(Enum.MembershipType.None) player:SetMembershipType(Enum.MembershipType.None)
end) end)
pcall(function() pcall(function()
return player:SetAccountAge(0) player:SetAccountAge(0)
end) end)
end end
local success, err = pcall(doVisit)
success, err = pcall(doVisit)
if not addedBuildTools then if not addedBuildTools then
do local playerName = Instance.new "StringValue"
local _with_0 = Instance.new "StringValue" playerName.Name = "PlayerName"
_with_0.Name = "PlayerName" playerName.Value = player.Name
_with_0.Value = player.Name playerName.RobloxLocked = true
_with_0.RobloxLocked = true playerName.Parent = screenGui
_with_0.Parent = screenGui
end
pcall(function() pcall(function()
return game:GetService("ScriptContext"):AddCoreScript(59431535, screenGui, "BuildToolsScript") ScriptContext:AddCoreScript(59431535, screenGui, "BuildToolsScript")
end) end)
addedBuildTools = true addedBuildTools = true
end end
if success then if success then
message.Parent = nil message.Parent = nil
else else
print(err) print(err)
wait(5) wait(5)
message.Text = "Error on visit: " .. tostring(err) message.Text = "Error on visit: " .. err
end end

View File

@ -1,4 +1,4 @@
column_width = 120 column_width = 80
line_endings = "Unix" line_endings = "Unix"
indent_type = "Tabs" indent_type = "Tabs"
indent_width = 4 indent_width = 4