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>nil</External>
<Item class="Hat" referent="RBXFEFA1B06A7444E13896169510508F42A">
@ -94,7 +96,9 @@
<Properties>
<token name="LODX">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>
<string name="Name">Mesh</string>
<Vector3 name="Offset">
@ -107,7 +111,9 @@
<Y>1.07000005</Y>
<Z>1.07000005</Z>
</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">
<X>1</X>
<Y>1</Y>

View File

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

View File

@ -1,5 +1,6 @@
print "[Mercury]: Loaded corescript 152908679"
-- ContextActionTouch.lua
-- 2014, created by Ben Tkacheff
-- this script controls ui and firing of lua functions that are bound in ContextActionService for touch inputs
-- Essentially a user can bind a lua function to a key code, input type (mousebutton1 etc.) and this
@ -8,8 +9,8 @@ local contextActionService = Game:GetService "ContextActionService"
local isTouchDevice = Game:GetService("UserInputService").TouchEnabled
local functionTable = {}
local buttonVector = {}
local buttonScreenGui = nil
local buttonFrame = nil
local buttonScreenGui
local buttonFrame
local ContextDownImage = "http://www.banland.xyz/asset/?id=97166756"
local ContextUpImage = "http://www.banland.xyz/asset/?id=97166444"
@ -72,14 +73,22 @@ end
function contextButtonDown(button, inputObject, actionName)
if inputObject.UserInputType == Enum.UserInputType.Touch then
button.Image = ContextDownImage
contextActionService:CallFunction(actionName, Enum.UserInputState.Begin, inputObject)
contextActionService:CallFunction(
actionName,
Enum.UserInputState.Begin,
inputObject
)
end
end
function contextButtonMoved(button, inputObject, actionName)
if inputObject.UserInputType == Enum.UserInputType.Touch then
button.Image = ContextDownImage
contextActionService:CallFunction(actionName, Enum.UserInputState.Change, inputObject)
contextActionService:CallFunction(
actionName,
Enum.UserInputState.Change,
inputObject
)
end
end
@ -89,7 +98,11 @@ function contextButtonUp(button, inputObject, actionName)
inputObject.UserInputType == Enum.UserInputType.Touch
and inputObject.UserInputState == Enum.UserInputState.End
then
contextActionService:CallFunction(actionName, Enum.UserInputState.End, inputObject)
contextActionService:CallFunction(
actionName,
Enum.UserInputState.End,
inputObject
)
end
end
@ -109,7 +122,7 @@ function createNewButton(actionName, functionInfoTable)
contextButton.Image = ContextUpImage
contextButton.Parent = buttonFrame
local currentButtonTouch = nil
local currentButtonTouch
Game:GetService("UserInputService").InputEnded:connect(function(inputObject)
oldTouches[inputObject] = nil
@ -119,7 +132,10 @@ function createNewButton(actionName, functionInfoTable)
return
end
if inputObject.UserInputState == Enum.UserInputState.Begin and currentButtonTouch == nil then
if
inputObject.UserInputState == Enum.UserInputState.Begin
and currentButtonTouch == nil
then
currentButtonTouch = inputObject
contextButtonDown(contextButton, inputObject, actionName)
end
@ -152,7 +168,10 @@ function createNewButton(actionName, functionInfoTable)
actionIcon.Position = UDim2.new(0.175, 0, 0.175, 0)
actionIcon.Size = UDim2.new(0.65, 0, 0.65, 0)
actionIcon.BackgroundTransparency = 1
if functionInfoTable["image"] and type(functionInfoTable["image"]) == "string" then
if
functionInfoTable["image"]
and type(functionInfoTable["image"]) == "string"
then
actionIcon.Image = functionInfoTable["image"]
end
actionIcon.Parent = contextButton
@ -167,7 +186,10 @@ function createNewButton(actionName, functionInfoTable)
actionTitle.FontSize = Enum.FontSize.Size18
actionTitle.TextWrapped = true
actionTitle.Text = ""
if functionInfoTable["title"] and type(functionInfoTable["title"]) == "string" then
if
functionInfoTable["title"]
and type(functionInfoTable["title"]) == "string"
then
actionTitle.Text = functionInfoTable["title"]
end
actionTitle.Parent = contextButton
@ -178,7 +200,7 @@ end
function createButton(actionName, functionInfoTable)
local button = createNewButton(actionName, functionInfoTable)
local position = nil
local position
for i = 1, #buttonVector do
if buttonVector[i] == "empty" then
position = i
@ -240,26 +262,30 @@ function addAction(actionName, createTouchButton, functionInfoTable)
end
-- Connections
contextActionService.BoundActionChanged:connect(function(actionName, changeName, changeTable)
if functionTable[actionName] and changeTable then
local button = functionTable[actionName]["button"]
if button then
if changeName == "image" then
button.ActionIcon.Image = changeTable[changeName]
elseif changeName == "title" then
button.ActionTitle.Text = changeTable[changeName]
-- elseif changeName == "description" then
-- -- todo: add description to menu
elseif changeName == "position" then
button.Position = changeTable[changeName]
contextActionService.BoundActionChanged:connect(
function(actionName, changeName, changeTable)
if functionTable[actionName] and changeTable then
local button = functionTable[actionName]["button"]
if button then
if changeName == "image" then
button.ActionIcon.Image = changeTable[changeName]
elseif changeName == "title" then
button.ActionTitle.Text = changeTable[changeName]
-- elseif changeName == "description" then
-- -- todo: add description to menu
elseif changeName == "position" then
button.Position = changeTable[changeName]
end
end
end
end
end)
)
contextActionService.BoundActionAdded:connect(function(actionName, createTouchButton, functionInfoTable)
addAction(actionName, createTouchButton, functionInfoTable)
end)
contextActionService.BoundActionAdded:connect(
function(actionName, createTouchButton, functionInfoTable)
addAction(actionName, createTouchButton, functionInfoTable)
end
)
contextActionService.BoundActionRemoved:connect(function(actionName, _)
removeAction(actionName)
@ -267,7 +293,10 @@ end)
contextActionService.GetActionButtonEvent:connect(function(actionName)
if functionTable[actionName] then
contextActionService:FireActionButtonFoundSignal(actionName, functionTable[actionName]["button"])
contextActionService:FireActionButtonFoundSignal(
actionName,
functionTable[actionName]["button"]
)
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 includes character move thumbsticks, and buttons for jump, use of items, camera, etc.
-- Written by Ben Tkacheff, 2013
-- obligatory stuff to make sure we don't access nil data
while not Game do
@ -51,13 +52,13 @@ if isSmallScreenDevice() then
jumpButtonSize = 70
end
local oldJumpTouches = {}
local currentJumpTouch = nil
local currentJumpTouch
local CameraRotateSensitivity = 0.007
local CameraRotateDeadZone = CameraRotateSensitivity * 16
local CameraZoomSensitivity = 0.03
local PinchZoomDelay = 0.2
local cameraTouch = nil
local cameraTouch
-- make sure all of our images are good to go
Game:GetService("ContentProvider"):Preload(touchControlsSheet)
@ -88,14 +89,20 @@ function rotatePointAboutLocation(pointToRotate, pointToRotateAbout, radians)
local transformedPoint = pointToRotate
-- 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
local xNew = transformedPoint.x * cosAnglePercent - transformedPoint.y * sinAnglePercent
local yNew = transformedPoint.x * sinAnglePercent + transformedPoint.y * cosAnglePercent
local xNew = transformedPoint.x * cosAnglePercent
- transformedPoint.y * sinAnglePercent
local yNew = transformedPoint.x * sinAnglePercent
+ transformedPoint.y * cosAnglePercent
-- translate point back:
transformedPoint = Vector2.new(xNew + pointToRotateAbout.x, yNew + pointToRotateAbout.y)
transformedPoint =
Vector2.new(xNew + pointToRotateAbout.x, yNew + pointToRotateAbout.y)
return transformedPoint
end
@ -104,12 +111,17 @@ function dotProduct(v1, v2)
return ((v1.x * v2.x) + (v1.y * v2.y))
end
function stationaryThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLocation)
function stationaryThumbstickTouchMove(
thumbstickFrame,
thumbstickOuter,
touchLocation
)
local thumbstickOuterCenterPosition = Vector2.new(
thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x / 2,
thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y / 2
)
local centerDiff = DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenterPosition)
local centerDiff =
DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenterPosition)
-- thumbstick is moving outside our region, need to cap its distance
if centerDiff > (thumbstickSize / 2) then
@ -125,10 +137,15 @@ function stationaryThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLo
normal = Vector2.new(normal.x, 0)
end
local newThumbstickInnerPosition = thumbstickOuterCenterPosition + (normal * (thumbstickSize / 2))
thumbstickFrame.Position = transformFromCenterToTopLeft(newThumbstickInnerPosition, thumbstickFrame)
local newThumbstickInnerPosition = thumbstickOuterCenterPosition
+ (normal * (thumbstickSize / 2))
thumbstickFrame.Position = transformFromCenterToTopLeft(
newThumbstickInnerPosition,
thumbstickFrame
)
else
thumbstickFrame.Position = transformFromCenterToTopLeft(touchLocation, thumbstickFrame)
thumbstickFrame.Position =
transformFromCenterToTopLeft(touchLocation, thumbstickFrame)
end
return Vector2.new(
@ -137,44 +154,69 @@ function stationaryThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLo
)
end
function followThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLocation)
function followThumbstickTouchMove(
thumbstickFrame,
thumbstickOuter,
touchLocation
)
local thumbstickOuterCenter = Vector2.new(
thumbstickOuter.Position.X.Offset + thumbstickOuter.AbsoluteSize.x / 2,
thumbstickOuter.Position.Y.Offset + thumbstickOuter.AbsoluteSize.y / 2
)
-- thumbstick is moving outside our region, need to position outer thumbstick texture carefully (to make look and feel like actual joystick controller)
if DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenter) > thumbstickSize / 2 then
if
DistanceBetweenTwoPoints(touchLocation, thumbstickOuterCenter)
> thumbstickSize / 2
then
local thumbstickInnerCenter = Vector2.new(
thumbstickFrame.Position.X.Offset + thumbstickFrame.AbsoluteSize.x / 2,
thumbstickFrame.Position.Y.Offset + thumbstickFrame.AbsoluteSize.y / 2
thumbstickFrame.Position.X.Offset
+ thumbstickFrame.AbsoluteSize.x / 2,
thumbstickFrame.Position.Y.Offset
+ thumbstickFrame.AbsoluteSize.y / 2
)
local movementVectorUnit =
Vector2.new(touchLocation.x - thumbstickInnerCenter.x, touchLocation.y - thumbstickInnerCenter.y).unit
local movementVectorUnit = Vector2.new(
touchLocation.x - thumbstickInnerCenter.x,
touchLocation.y - thumbstickInnerCenter.y
).unit
local outerToInnerVectorCurrent = Vector2.new(
thumbstickInnerCenter.x - thumbstickOuterCenter.x,
thumbstickInnerCenter.y - thumbstickOuterCenter.y
)
local outerToInnerVectorCurrentUnit = outerToInnerVectorCurrent.unit
local movementVector =
Vector2.new(touchLocation.x - thumbstickInnerCenter.x, touchLocation.y - thumbstickInnerCenter.y)
local movementVector = Vector2.new(
touchLocation.x - thumbstickInnerCenter.x,
touchLocation.y - thumbstickInnerCenter.y
)
-- First, find the angle between the new thumbstick movement vector,
-- and the vector between thumbstick inner and thumbstick outer.
-- We will use this to pivot thumbstick outer around thumbstick inner, gives a nice joystick feel
local crossOuterToInnerWithMovement = (outerToInnerVectorCurrentUnit.x * movementVectorUnit.y)
- (outerToInnerVectorCurrentUnit.y * movementVectorUnit.x)
local angle =
math.atan2(crossOuterToInnerWithMovement, dotProduct(outerToInnerVectorCurrentUnit, movementVectorUnit))
local anglePercent = angle * math.min(movementVector.magnitude / outerToInnerVectorCurrent.magnitude, 1.0)
local crossOuterToInnerWithMovement = (
outerToInnerVectorCurrentUnit.x * movementVectorUnit.y
) - (outerToInnerVectorCurrentUnit.y * movementVectorUnit.x)
local angle = math.atan2(
crossOuterToInnerWithMovement,
dotProduct(outerToInnerVectorCurrentUnit, movementVectorUnit)
)
local anglePercent = angle
* math.min(
movementVector.magnitude / outerToInnerVectorCurrent.magnitude,
1.0
)
-- If angle is significant, rotate about the inner thumbsticks current center
if math.abs(anglePercent) > 0.00001 then
local outerThumbCenter =
rotatePointAboutLocation(thumbstickOuterCenter, thumbstickInnerCenter, anglePercent)
thumbstickOuter.Position =
transformFromCenterToTopLeft(Vector2.new(outerThumbCenter.x, outerThumbCenter.y), thumbstickOuter)
local outerThumbCenter = rotatePointAboutLocation(
thumbstickOuterCenter,
thumbstickInnerCenter,
anglePercent
)
thumbstickOuter.Position = transformFromCenterToTopLeft(
Vector2.new(outerThumbCenter.x, outerThumbCenter.y),
thumbstickOuter
)
end
-- now just translate outer thumbstick to make sure it stays nears inner thumbstick
@ -186,13 +228,27 @@ function followThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLocati
)
end
thumbstickFrame.Position = transformFromCenterToTopLeft(touchLocation, thumbstickFrame)
thumbstickFrame.Position =
transformFromCenterToTopLeft(touchLocation, thumbstickFrame)
-- a bit of error checking to make sure thumbsticks stay close to eachother
local thumbstickFramePosition = Vector2.new(thumbstickFrame.Position.X.Offset, thumbstickFrame.Position.Y.Offset)
local thumbstickOuterPosition = Vector2.new(thumbstickOuter.Position.X.Offset, thumbstickOuter.Position.Y.Offset)
if DistanceBetweenTwoPoints(thumbstickFramePosition, thumbstickOuterPosition) > thumbstickSize / 2 then
local vectorWithLength = (thumbstickOuterPosition - thumbstickFramePosition).unit * thumbstickSize / 2
local thumbstickFramePosition = Vector2.new(
thumbstickFrame.Position.X.Offset,
thumbstickFrame.Position.Y.Offset
)
local thumbstickOuterPosition = Vector2.new(
thumbstickOuter.Position.X.Offset,
thumbstickOuter.Position.Y.Offset
)
if
DistanceBetweenTwoPoints(
thumbstickFramePosition,
thumbstickOuterPosition
) > thumbstickSize / 2
then
local vectorWithLength = (
thumbstickOuterPosition - thumbstickFramePosition
).unit * thumbstickSize / 2
thumbstickOuter.Position = UDim2.new(
0,
thumbstickFramePosition.x + vectorWithLength.x,
@ -208,10 +264,17 @@ function followThumbstickTouchMove(thumbstickFrame, thumbstickOuter, touchLocati
end
function movementOutsideDeadZone(movementVector)
return ((math.abs(movementVector.x) > ThumbstickDeadZone) or (math.abs(movementVector.y) > ThumbstickDeadZone))
return (
(math.abs(movementVector.x) > ThumbstickDeadZone)
or (math.abs(movementVector.y) > ThumbstickDeadZone)
)
end
function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThumbstick)
function constructThumbstick(
defaultThumbstickPos,
updateFunction,
stationaryThumbstick
)
local thumbstickFrame = Instance.new "Frame"
thumbstickFrame.Name = "ThumbstickFrame"
thumbstickFrame.Active = true
@ -235,7 +298,8 @@ function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThu
innerThumbstick.ImageRectOffset = Vector2.new(220, 0)
innerThumbstick.ImageRectSize = Vector2.new(111, 111)
innerThumbstick.BackgroundTransparency = 1
innerThumbstick.Size = UDim2.new(0, thumbstickSize / 2, 0, thumbstickSize / 2)
innerThumbstick.Size =
UDim2.new(0, thumbstickSize / 2, 0, thumbstickSize / 2)
innerThumbstick.Position = UDim2.new(
0,
thumbstickFrame.Size.X.Offset / 2 - thumbstickSize / 4,
@ -245,9 +309,9 @@ function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThu
innerThumbstick.Parent = thumbstickFrame
innerThumbstick.ZIndex = 2
local thumbstickTouch = nil
local userInputServiceTouchMovedCon = nil
local userInputSeviceTouchEndedCon = nil
local thumbstickTouch
local userInputServiceTouchMovedCon
local userInputSeviceTouchEndedCon
local startInputTracking = function(inputObject)
if thumbstickTouch then
@ -266,52 +330,68 @@ function constructThumbstick(defaultThumbstickPos, updateFunction, stationaryThu
thumbstickTouch = inputObject
table.insert(thumbstickTouches, thumbstickTouch)
thumbstickFrame.Position = transformFromCenterToTopLeft(thumbstickTouch.Position, thumbstickFrame)
thumbstickFrame.Position = transformFromCenterToTopLeft(
thumbstickTouch.Position,
thumbstickFrame
)
outerThumbstick.Position = thumbstickFrame.Position
userInputServiceTouchMovedCon = userInputService.TouchMoved:connect(function(movedInput)
if movedInput == thumbstickTouch then
local movementVector = nil
if stationaryThumbstick then
movementVector = stationaryThumbstickTouchMove(
thumbstickFrame,
outerThumbstick,
Vector2.new(movedInput.Position.x, movedInput.Position.y)
)
else
movementVector = followThumbstickTouchMove(
thumbstickFrame,
outerThumbstick,
Vector2.new(movedInput.Position.x, movedInput.Position.y)
)
end
userInputServiceTouchMovedCon = userInputService.TouchMoved:connect(
function(movedInput)
if movedInput == thumbstickTouch then
local movementVector
if stationaryThumbstick then
movementVector = stationaryThumbstickTouchMove(
thumbstickFrame,
outerThumbstick,
Vector2.new(
movedInput.Position.x,
movedInput.Position.y
)
)
else
movementVector = followThumbstickTouchMove(
thumbstickFrame,
outerThumbstick,
Vector2.new(
movedInput.Position.x,
movedInput.Position.y
)
)
end
if updateFunction then
updateFunction(movementVector, outerThumbstick.Size.X.Offset / 2)
end
end
end)
userInputSeviceTouchEndedCon = userInputService.TouchEnded:connect(function(endedInput)
if endedInput == thumbstickTouch then
if updateFunction then
updateFunction(Vector2.new(0, 0), 1)
end
userInputSeviceTouchEndedCon:disconnect()
userInputServiceTouchMovedCon:disconnect()
thumbstickFrame.Position = defaultThumbstickPos
outerThumbstick.Position = defaultThumbstickPos
for i, object in pairs(thumbstickTouches) do
if object == thumbstickTouch then
table.remove(thumbstickTouches, i)
break
if updateFunction then
updateFunction(
movementVector,
outerThumbstick.Size.X.Offset / 2
)
end
end
thumbstickTouch = nil
end
end)
)
userInputSeviceTouchEndedCon = userInputService.TouchEnded:connect(
function(endedInput)
if endedInput == thumbstickTouch then
if updateFunction then
updateFunction(Vector2.new(0, 0), 1)
end
userInputSeviceTouchEndedCon:disconnect()
userInputServiceTouchMovedCon:disconnect()
thumbstickFrame.Position = defaultThumbstickPos
outerThumbstick.Position = defaultThumbstickPos
for i, object in pairs(thumbstickTouches) do
if object == thumbstickTouch then
table.remove(thumbstickTouches, i)
break
end
end
thumbstickTouch = nil
end
end
)
end
userInputService.Changed:connect(function(prop)
@ -335,28 +415,43 @@ function setupCharacterMovement(parentFrame)
lastMaxMovement = maxMovement
-- sometimes rounding error will not allow us to go max speed at some
-- thumbstick angles, fix this with a bit of fudging near 100% throttle
if movementVector.magnitude / maxMovement > ThumbstickMaxPercentGive then
if
movementVector.magnitude / maxMovement
> ThumbstickMaxPercentGive
then
maxMovement = movementVector.magnitude - 1
end
moveCharacterFunc(localPlayer, movementVector, maxMovement)
else
lastMovementVector = Vector2.new(0, 0)
lastMaxMovement = 1
moveCharacterFunc(localPlayer, lastMovementVector, lastMaxMovement)
moveCharacterFunc(
localPlayer,
lastMovementVector,
lastMaxMovement
)
end
end
end
local thumbstickPos = UDim2.new(0, thumbstickSize / 2, 1, -thumbstickSize * 1.75)
local thumbstickPos =
UDim2.new(0, thumbstickSize / 2, 1, -thumbstickSize * 1.75)
if isSmallScreenDevice() then
thumbstickPos = UDim2.new(0, (thumbstickSize / 2) - 10, 1, -thumbstickSize - 20)
thumbstickPos =
UDim2.new(0, (thumbstickSize / 2) - 10, 1, -thumbstickSize - 20)
end
local characterThumbstick = constructThumbstick(thumbstickPos, moveCharacterFunction, false)
local characterThumbstick =
constructThumbstick(thumbstickPos, moveCharacterFunction, false)
characterThumbstick.Name = "CharacterThumbstick"
characterThumbstick.Parent = parentFrame
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)
end
end
@ -372,9 +467,11 @@ function setupJumpButton(parentFrame)
jumpButton.ImageRectSize = Vector2.new(174, 174)
jumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize)
if isSmallScreenDevice() then
jumpButton.Position = UDim2.new(1, -(jumpButtonSize * 2.25), 1, -jumpButtonSize - 20)
jumpButton.Position =
UDim2.new(1, -(jumpButtonSize * 2.25), 1, -jumpButtonSize - 20)
else
jumpButton.Position = UDim2.new(1, -(jumpButtonSize * 2.75), 1, -jumpButtonSize - 120)
jumpButton.Position =
UDim2.new(1, -(jumpButtonSize * 2.75), 1, -jumpButtonSize - 120)
end
local playerJumpFunc = localPlayer.JumpCharacter
@ -464,16 +561,16 @@ function isTouchUsedByThumbstick(touch)
end
function setupCameraControl(parentFrame, refreshCharacterMoveFunc)
local lastPos = nil
local lastPos
local hasRotatedCamera = false
local rotateCameraFunc = userInputService.RotateCamera
local pinchTime = -1
local shouldPinch = false
local lastPinchScale = nil
local lastPinchScale
local zoomCameraFunc = userInputService.ZoomCamera
local pinchTouches = {}
local pinchFrame = nil
local pinchFrame
local resetCameraRotateState = function()
cameraTouch = nil
@ -509,35 +606,48 @@ function setupCameraControl(parentFrame, refreshCharacterMoveFunc)
if lastPinchScale == nil then -- first pinch move, just set up scale
if inputObject == firstTouch then
lastPinchScale = (inputObject.Position - secondTouch.Position).magnitude
lastPinchScale = (
inputObject.Position - secondTouch.Position
).magnitude
firstTouch = inputObject
elseif inputObject == secondTouch then
lastPinchScale = (inputObject.Position - firstTouch.Position).magnitude
lastPinchScale = (
inputObject.Position - firstTouch.Position
).magnitude
secondTouch = inputObject
end
else -- we are now actually pinching, do comparison to last pinch size
local newPinchDistance = 0
if inputObject == firstTouch then
newPinchDistance = (inputObject.Position - secondTouch.Position).magnitude
newPinchDistance = (
inputObject.Position - secondTouch.Position
).magnitude
firstTouch = inputObject
elseif inputObject == secondTouch then
newPinchDistance = (inputObject.Position - firstTouch.Position).magnitude
newPinchDistance = (
inputObject.Position - firstTouch.Position
).magnitude
secondTouch = inputObject
end
if newPinchDistance ~= 0 then
local pinchDiff = newPinchDistance - lastPinchScale
if pinchDiff ~= 0 then
zoomCameraFunc(userInputService, (pinchDiff * CameraZoomSensitivity))
zoomCameraFunc(
userInputService,
(pinchDiff * CameraZoomSensitivity)
)
end
lastPinchScale = newPinchDistance
end
end
end)
pinchFrame.InputEnded:connect(function(inputObject) -- pinch is over, destroy all
if inputObject == firstTouch or inputObject == secondTouch then
resetPinchState()
pinchFrame.InputEnded:connect(
function(inputObject) -- pinch is over, destroy all
if inputObject == firstTouch or inputObject == secondTouch then
resetPinchState()
end
end
end)
)
end
local pinchGestureReceivedTouch = function(inputObject)
@ -572,7 +682,8 @@ function setupCameraControl(parentFrame, refreshCharacterMoveFunc)
if cameraTouch == nil and not usedByThumbstick then
cameraTouch = inputObject
lastPos = Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y)
lastPos =
Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y)
-- lastTick = tick()
end
end)
@ -584,11 +695,15 @@ function setupCameraControl(parentFrame, refreshCharacterMoveFunc)
return
end
local newPos = Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y)
local newPos =
Vector2.new(cameraTouch.Position.x, cameraTouch.Position.y)
local touchDiff = (lastPos - newPos) * CameraRotateSensitivity
-- first time rotating outside deadzone, just setup for next changed event
if not hasRotatedCamera and (touchDiff.magnitude > CameraRotateDeadZone) then
if
not hasRotatedCamera
and (touchDiff.magnitude > CameraRotateDeadZone)
then
hasRotatedCamera = true
lastPos = newPos
end
@ -630,7 +745,10 @@ function setupTouchControls()
end
-- 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
end
end)

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 39250920"
function waitForProperty(instance, name)
while not instance[name] do
instance.Changed:wait()
@ -33,7 +34,7 @@ local reenableDialogScript
local dialogMap = {}
local dialogConnections = {}
local gui = nil
local gui
waitForChild(game, "CoreGui")
waitForChild(game.CoreGui, "RobloxGui")
if game.CoreGui.RobloxGui:FindFirstChild "ControlFrame" then
@ -102,31 +103,39 @@ end
function styleMainFrame(tone)
if tone == Enum.DialogTone.Neutral then
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
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
mainFrame.Style = Enum.FrameStyle.ChatRed
mainFrame.Tail.Image = "rbxasset://textures/chatBubble_botRed_tailRight.png"
mainFrame.Tail.Image =
"rbxasset://textures/chatBubble_botRed_tailRight.png"
end
styleChoices(tone)
end
function setChatNotificationTone(gui, purpose, tone)
if tone == Enum.DialogTone.Neutral then
gui.Image.Image = "rbxasset://textures/chatBubble_botBlue_notify_bkg.png"
gui.Image.Image =
"rbxasset://textures/chatBubble_botBlue_notify_bkg.png"
elseif tone == Enum.DialogTone.Friendly then
gui.Image.Image = "rbxasset://textures/chatBubble_botGreen_notify_bkg.png"
gui.Image.Image =
"rbxasset://textures/chatBubble_botGreen_notify_bkg.png"
elseif tone == Enum.DialogTone.Enemy then
gui.Image.Image = "rbxasset://textures/chatBubble_botRed_notify_bkg.png"
end
if purpose == Enum.DialogPurpose.Quest then
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_bang.png"
gui.Image.Button.Image =
"rbxasset://textures/chatBubble_bot_notify_bang.png"
elseif purpose == Enum.DialogPurpose.Help then
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_question.png"
gui.Image.Button.Image =
"rbxasset://textures/chatBubble_bot_notify_question.png"
elseif purpose == Enum.DialogPurpose.Shop then
gui.Image.Button.Image = "rbxasset://textures/chatBubble_bot_notify_money.png"
gui.Image.Button.Image =
"rbxasset://textures/chatBubble_bot_notify_money.png"
end
end
@ -243,7 +252,11 @@ function selectChoice(choice)
--First hide the Gui
mainFrame.Visible = false
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()
else
@ -255,7 +268,10 @@ function selectChoice(choice)
getChatColor(currentTone())
)
wait(1)
currentConversationDialog:SignalDialogChoiceSelected(player, dialogChoice)
currentConversationDialog:SignalDialogChoiceSelected(
player,
dialogChoice
)
game.Chat:Chat(
currentConversationPartner,
sanitizeMessage(dialogChoice.ResponseDialog),
@ -263,7 +279,10 @@ function selectChoice(choice)
)
variableDelay(dialogChoice.ResponseDialog)
presentDialogChoices(currentConversationPartner, dialogChoice:GetChildren())
presentDialogChoices(
currentConversationPartner,
dialogChoice:GetChildren()
)
end
end
@ -381,7 +400,8 @@ function presentDialogChoices(talkingPart, dialogChoices)
--3 lines is the maximum, set it to that temporarily
choices[pos].Size = UDim2.new(1, 0, 0, 24 * 3)
choices[pos].UserPrompt.Text = obj.UserDialog
local height = math.ceil(choices[pos].UserPrompt.TextBounds.Y / 24) * 24
local height = math.ceil(choices[pos].UserPrompt.TextBounds.Y / 24)
* 24
choices[pos].Position = UDim2.new(0, 0, 0, yPosition)
choices[pos].Size = UDim2.new(1, 0, 0, height)
@ -417,7 +437,11 @@ function doDialog(dialog)
end
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)
presentDialogChoices(dialog.Parent, dialog:GetChildren())
@ -440,8 +464,9 @@ function checkForLeaveArea()
if
currentConversationDialog.Parent
and (
player:DistanceFromCharacter(currentConversationDialog.Parent.Position)
>= currentConversationDialog.ConversationDistance
player:DistanceFromCharacter(
currentConversationDialog.Parent.Position
) >= currentConversationDialog.ConversationDistance
)
then
wanderDialog()
@ -452,7 +477,10 @@ end
function startDialog(dialog)
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)
return
end
@ -502,12 +530,17 @@ function addDialog(dialog)
removeDialog(dialog)
addDialog(dialog)
elseif prop == "InUse" then
chatGui.Enabled = not currentConversationDialog and not dialog.InUse
chatGui.Enabled = not currentConversationDialog
and not dialog.InUse
if dialog == currentConversationDialog then
timeoutDialog()
end
elseif prop == "Tone" or prop == "Purpose" then
setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone)
setChatNotificationTone(
chatGui,
dialog.Purpose,
dialog.Tone
)
end
end)
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 = {}
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)
while not instance[property] do
instance.Changed:wait()
@ -15,7 +16,7 @@ waitForChild(script.Parent.Popup, "AcceptButton")
script.Parent.Popup.AcceptButton.Modal = true
local localPlayer = game.Players.LocalPlayer
local teleportUI = nil
local teleportUI
local friendRequestBlacklist = {}
@ -39,8 +40,10 @@ function makeFriend(fromPlayer, toPlayer)
return
end -- previously cancelled friend request, we don't want it!
popup.PopupText.Text = "Accept Friend Request from " .. tostring(fromPlayer.Name) .. "?"
popup.PopupImage.Image = "http://www.roblox.com/thumbs/avatar.ashx?userId="
popup.PopupText.Text = "Accept Friend Request from "
.. tostring(fromPlayer.Name)
.. "?"
popup.PopupImage.Image = "http://banland.xyz/thumbs/avatar.ashx?userId="
.. tostring(fromPlayer.userId)
.. "&x=352&y=352"
@ -48,7 +51,13 @@ function makeFriend(fromPlayer, toPlayer)
popup.Visible = true
popup.AcceptButton.Text = "Accept"
popup.DeclineButton.Text = "Decline"
popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true)
popup:TweenSize(
UDim2.new(0, 330, 0, 350),
Enum.EasingDirection.Out,
Enum.EasingStyle.Quart,
1,
true
)
local yesCon, noCon
@ -104,7 +113,9 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
game:GetService("GuiService"):SendNotification(
"You are Friends",
"With " .. toPlayer.Name .. "!",
"http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(toPlayer.userId) .. "&x=48&y=48",
"http://banland.xyz/thumbs/avatar.ashx?userId="
.. tostring(toPlayer.userId)
.. "&x=48&y=48",
5,
function() end
)
@ -117,7 +128,9 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
game:GetService("GuiService"):SendNotification(
"Friend Request",
"From " .. fromPlayer.Name,
"http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=48&y=48",
"http://banland.xyz/thumbs/avatar.ashx?userId="
.. tostring(fromPlayer.userId)
.. "&x=48&y=48",
8,
function()
makeFriend(fromPlayer, toPlayer)
@ -127,7 +140,9 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event)
game:GetService("GuiService"):SendNotification(
"You are Friends",
"With " .. fromPlayer.Name .. "!",
"http://www.roblox.com/thumbs/avatar.ashx?userId=" .. tostring(fromPlayer.userId) .. "&x=48&y=48",
"http://banland.xyz/thumbs/avatar.ashx?userId="
.. tostring(fromPlayer.userId)
.. "&x=48&y=48",
5,
function() end
)
@ -176,7 +191,10 @@ function onTeleport(teleportState, _, _)
elseif teleportState == Enum.TeleportState.InProgress then
showTeleportUI("Teleporting...", 0)
elseif teleportState == Enum.TeleportState.Failed then
showTeleportUI("Teleport failed. Insufficient privileges or target place does not exist.", 3)
showTeleportUI(
"Teleport failed. Insufficient privileges or target place does not exist.",
3
)
end
end
end
@ -194,7 +212,9 @@ if teleportEnabled then
if clickCon then
clickCon:disconnect()
end
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild "Popup")
game.GuiService:RemoveCenterDialog(
script.Parent:FindFirstChild "Popup"
)
popup:TweenSize(
UDim2.new(0, 0, 0, 0),
Enum.EasingDirection.Out,
@ -211,7 +231,13 @@ if teleportEnabled then
function()
showOneButton()
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,
--HideFunction
function()
@ -226,7 +252,11 @@ if teleportEnabled then
end
)
end
game:GetService("TeleportService").ConfirmationCallback = function(message, placeId, spawnName)
game:GetService("TeleportService").ConfirmationCallback = function(
message,
placeId,
spawnName
)
local popup = script.Parent:FindFirstChild "Popup"
popup.PopupText.Text = message
popup.PopupImage.Image = ""
@ -240,7 +270,9 @@ if teleportEnabled then
if noCon then
noCon:disconnect()
end
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild "Popup")
game.GuiService:RemoveCenterDialog(
script.Parent:FindFirstChild "Popup"
)
popup:TweenSize(
UDim2.new(0, 0, 0, 0),
Enum.EasingDirection.Out,
@ -254,7 +286,8 @@ if teleportEnabled then
yesCon = popup.AcceptButton.MouseButton1Click:connect(function()
killCons()
local success, err = pcall(function()
game:GetService("TeleportService"):TeleportImpl(placeId, spawnName)
game:GetService("TeleportService")
:TeleportImpl(placeId, spawnName)
end)
if not success then
showOneButton()
@ -264,7 +297,9 @@ if teleportEnabled then
if clickCon then
clickCon:disconnect()
end
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild "Popup")
game.GuiService:RemoveCenterDialog(
script.Parent:FindFirstChild "Popup"
)
popup:TweenSize(
UDim2.new(0, 0, 0, 0),
Enum.EasingDirection.Out,
@ -347,7 +382,13 @@ if teleportEnabled then
script.Parent:FindFirstChild("Popup").Visible = true
popup.AcceptButton.Text = "Leave"
popup.DeclineButton.Text = "Stay"
popup:TweenSize(UDim2.new(0, 330, 0, 350), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true)
popup:TweenSize(
UDim2.new(0, 330, 0, 350),
Enum.EasingDirection.Out,
Enum.EasingStyle.Quart,
1,
true
)
end
return true
end

View File

@ -1,3 +1,4 @@
print "[Mercury]: Loaded corescript 48488451"
--build our gui
local popupFrame = Instance.new "Frame"
@ -52,7 +53,7 @@ popupImage.Parent = popupFrame
local backing = Instance.new "ImageLabel"
backing.BackgroundTransparency = 1
backing.Size = UDim2.new(1, 0, 1, 0)
backing.Image = "http://www.roblox.com/asset/?id=47574181"
backing.Image = "http://banland.xyz/asset/?id=47574181"
backing.Name = "Backing"
backing.ZIndex = 2
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!)
-- TODO: automate this process
@ -49,7 +50,7 @@ CurrentLoadout.Parent = gui
local CLBackground = Instance.new "ImageLabel"
CLBackground.Name = "Background"
CLBackground.Size = UDim2.new(1.2, 0, 1.2, 0)
CLBackground.Image = "http://www.roblox.com/asset/?id=96536002"
CLBackground.Image = "http://banland.xyz/asset/?id=96536002"
CLBackground.BackgroundTransparency = 1
CLBackground.Position = UDim2.new(-0.1, 0, -0.1, 0)
CLBackground.ZIndex = 0.0
@ -59,7 +60,7 @@ CLBackground.Visible = false
local BackgroundUp = Instance.new "ImageLabel"
BackgroundUp.Size = UDim2.new(1, 0, 0.025, 1)
BackgroundUp.Position = UDim2.new(0, 0, 0, 0)
BackgroundUp.Image = "http://www.roblox.com/asset/?id=97662207"
BackgroundUp.Image = "http://banland.xyz/asset/?id=97662207"
BackgroundUp.BackgroundTransparency = 1
BackgroundUp.Parent = CLBackground
@ -73,7 +74,7 @@ BackpackButton.RobloxLocked = true
BackpackButton.Visible = false
BackpackButton.Name = "BackpackButton"
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.Size = UDim2.new(0, 120, 0, 18)
waitForChild(gui, "ControlFrame")
@ -106,7 +107,12 @@ for i = 0, NumSlots do
if gui.AbsoluteSize.Y <= 320 then
slotFrame.Position = UDim2.new(0, (i - 1) * 60, 0, -50)
print("Well got here", slotFrame, slotFrame.Position.X.Scale, slotFrame.Position.X.Offset)
print(
"Well got here",
slotFrame,
slotFrame.Position.X.Scale,
slotFrame.Position.X.Offset
)
end
if gui.AbsoluteSize.Y <= 320 and i == 0 then
slotFrame:Destroy()
@ -127,14 +133,14 @@ TempSlot.ZIndex = 3.0
local slotBackground = Instance.new "ImageLabel"
slotBackground.Name = "Background"
slotBackground.BackgroundTransparency = 1
slotBackground.Image = "http://www.roblox.com/asset/?id=97613075"
slotBackground.Image = "http://banland.xyz/asset/?id=97613075"
slotBackground.Size = UDim2.new(1, 0, 1, 0)
slotBackground.Parent = TempSlot
local HighLight = Instance.new "ImageLabel"
HighLight.Name = "Highlight"
HighLight.BackgroundTransparency = 1
HighLight.Image = "http://www.roblox.com/asset/?id=97643886"
HighLight.Image = "http://banland.xyz/asset/?id=97643886"
HighLight.Size = UDim2.new(1, 0, 1, 0)
--HighLight.Parent = TempSlot
HighLight.Visible = false
@ -328,8 +334,9 @@ closeButton.Modal = true
local XImage = Instance.new "ImageLabel"
XImage.RobloxLocked = true
XImage.Name = "XImage"
game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75547445"
XImage.Image = "http://www.roblox.com/asset/?id=75547445" --TODO: move to rbxasset
game:GetService("ContentProvider")
:Preload "http://banland.xyz/asset/?id=75547445"
XImage.Image = "http://banland.xyz/asset/?id=75547445" --TODO: move to rbxasset
XImage.BackgroundTransparency = 1
XImage.Position = UDim2.new(-0.25, -1, -0.25, -1)
XImage.Size = UDim2.new(1.5, 2, 1.5, 2)
@ -431,7 +438,7 @@ GearButton.Parent = GearGrid
local slotBackground = Instance.new "ImageLabel"
slotBackground.Name = "Background"
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.Parent = GearButton
@ -760,31 +767,43 @@ CharacterPane.Parent = Wardrobe
--CharacterPane Children
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(
"FaceZone",
"http://www.roblox.com/asset/?id=75460621",
"http://banland.xyz/asset/?id=75460621",
UDim2.new(0, 157, 0, 137),
UDim2.new(0.5, -78, 0.5, -68),
FaceFrame
)
makeStyledButton("Face", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -135), FaceFrame)
makeStyledButton(
"Face",
UDim2.new(0, 64, 0, 64),
UDim2.new(0.5, -32, 0.5, -135),
FaceFrame
)
local HeadFrame = makeCharFrame("HeadsFrame", CharacterPane)
makeZone(
"FaceZone",
"http://www.roblox.com/asset/?id=75460621",
"http://banland.xyz/asset/?id=75460621",
UDim2.new(0, 157, 0, 137),
UDim2.new(0.5, -78, 0.5, -68),
HeadFrame
)
makeStyledButton("Head", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -135), HeadFrame)
makeStyledButton(
"Head",
UDim2.new(0, 64, 0, 64),
UDim2.new(0.5, -32, 0.5, -135),
HeadFrame
)
local HatsFrame = makeCharFrame("HatsFrame", CharacterPane)
game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75457888"
game:GetService("ContentProvider")
:Preload "http://banland.xyz/asset/?id=75457888"
local HatsZone = makeZone(
"HatsZone",
"http://www.roblox.com/asset/?id=75457888",
"http://banland.xyz/asset/?id=75457888",
UDim2.new(0, 186, 0, 184),
UDim2.new(0.5, -93, 0.5, -100),
HatsFrame
@ -812,10 +831,11 @@ makeStyledButton(
)
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(
"PantsZone",
"http://www.roblox.com/asset/?id=75457920",
"http://banland.xyz/asset/?id=75457920",
UDim2.new(0, 121, 0, 99),
UDim2.new(0.5, -60, 0.5, -100),
PantsFrame
@ -860,7 +880,12 @@ local leftLegButton = makeStyledButton(
MeshFrame,
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(
"RightLegMeshButton",
UDim2.new(0, 64, 0, 64),
@ -868,7 +893,12 @@ local rightLegButton = makeStyledButton(
MeshFrame,
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(
"RightArmMeshButton",
UDim2.new(0, 64, 0, 64),
@ -876,7 +906,12 @@ local rightArmButton = makeStyledButton(
MeshFrame,
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(
"LeftArmMeshButton",
UDim2.new(0, 64, 0, 64),
@ -884,46 +919,96 @@ local leftArmButton = makeStyledButton(
MeshFrame,
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)
game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=75460642"
game:GetService("ContentProvider")
:Preload "http://banland.xyz/asset/?id=75460642"
makeZone(
"TShirtZone",
"http://www.roblox.com/asset/?id=75460642",
"http://banland.xyz/asset/?id=75460642",
UDim2.new(0, 121, 0, 154),
UDim2.new(0.5, -60, 0.5, -100),
TShirtFrame
)
makeStyledButton("TShirtButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -64), TShirtFrame)
makeStyledButton(
"TShirtButton",
UDim2.new(0, 64, 0, 64),
UDim2.new(0.5, -32, 0.5, -64),
TShirtFrame
)
local ShirtFrame = makeCharFrame("ShirtsFrame", CharacterPane)
makeZone(
"ShirtZone",
"http://www.roblox.com/asset/?id=75460642",
"http://banland.xyz/asset/?id=75460642",
UDim2.new(0, 121, 0, 154),
UDim2.new(0.5, -60, 0.5, -100),
ShirtFrame
)
makeStyledButton("ShirtButton", UDim2.new(0, 64, 0, 64), UDim2.new(0.5, -32, 0.5, -64), ShirtFrame)
makeStyledButton(
"ShirtButton",
UDim2.new(0, 64, 0, 64),
UDim2.new(0.5, -32, 0.5, -64),
ShirtFrame
)
local ColorFrame = makeCharFrame("ColorFrame", CharacterPane)
game:GetService("ContentProvider"):Preload "http://www.roblox.com/asset/?id=76049888"
game:GetService("ContentProvider")
:Preload "http://banland.xyz/asset/?id=76049888"
local ColorZone = makeZone(
"ColorZone",
"http://www.roblox.com/asset/?id=76049888",
"http://banland.xyz/asset/?id=76049888",
UDim2.new(0, 120, 0, 150),
UDim2.new(0.5, -60, 0.5, -100),
ColorFrame
)
makeStyledButton("Head", UDim2.new(0.26, 0, 0.19, 0), UDim2.new(0.37, 0, 0.02, 0), ColorZone).AutoButtonColor = false
makeStyledButton("LeftArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.78, 0, 0.26, 0), ColorZone).AutoButtonColor = false
makeStyledButton("RightArm", UDim2.new(0.19, 0, 0.36, 0), UDim2.new(0.025, 0, 0.26, 0), ColorZone).AutoButtonColor =
makeStyledButton(
"Head",
UDim2.new(0.26, 0, 0.19, 0),
UDim2.new(0.37, 0, 0.02, 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 =
makeStyledButton(
"LeftArm",
UDim2.new(0.19, 0, 0.36, 0),
UDim2.new(0.78, 0, 0.26, 0),
ColorZone
).AutoButtonColor =
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
-- 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
return
end -- peace out if we aren't using the right client
@ -77,7 +78,8 @@ game.LocalBackpack:SetOldSchoolBackpack(false)
waitForChild(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 backpackCloseEvent = waitForChild(backpackManager, "BackpackCloseEvent")
local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent")
@ -90,8 +92,8 @@ if robloxGui.AbsoluteSize.Y <= 320 then
maxNumLoadoutItems = 4
end
local characterChildAddedCon = nil
local backpackChildCon = nil
local characterChildAddedCon
local backpackChildCon
local debounce = false
@ -159,7 +161,7 @@ function characterInWorkspace()
end
function removeGear(gear)
local emptySlot = nil
local emptySlot
for i = 1, #gearSlots do
if gearSlots[i] == gear and gear.Parent ~= nil then
emptySlot = i
@ -168,8 +170,12 @@ function removeGear(gear)
end
if emptySlot then
if gearSlots[emptySlot].GearReference.Value then
if gearSlots[emptySlot].GearReference.Value.Parent == game.Players.LocalPlayer.Character then -- if we currently have this equipped, unequip it
gearSlots[emptySlot].GearReference.Value.Parent = game.Players.LocalPlayer.Backpack
if
gearSlots[emptySlot].GearReference.Value.Parent
== game.Players.LocalPlayer.Character
then -- if we currently have this equipped, unequip it
gearSlots[emptySlot].GearReference.Value.Parent =
game.Players.LocalPlayer.Backpack
end
if
@ -217,7 +223,7 @@ function removeGear(gear)
end
function insertGear(gear, addToSlot)
local pos = nil
local pos
if not addToSlot then
for i = 1, #gearSlots do
if gearSlots[i] == "empty" then
@ -269,7 +275,7 @@ function insertGear(gear, addToSlot)
end
gear.Visible = true
local con = nil
local con
con = gear.Kill.Changed:connect(function(prop)
kill(prop, con, gear)
end)
@ -292,7 +298,10 @@ function checkToolAncestry(child, parent)
end -- don't show roblox build tools
if child:IsA "Tool" or child:IsA "HopperBin" then
for i = 1, #gearSlots do
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then
if
gearSlots[i] ~= "empty"
and gearSlots[i].GearReference.Value == child
then
if parent == nil then
gearSlots[i].Kill.Value = true
return false
@ -316,7 +325,10 @@ end
function removeAllEquippedGear(physGear)
local stuff = player.Character:GetChildren()
for i = 1, #stuff do
if (stuff[i]:IsA "Tool" or stuff[i]:IsA "HopperBin") and stuff[i] ~= physGear then
if
(stuff[i]:IsA "Tool" or stuff[i]:IsA "HopperBin")
and stuff[i] ~= physGear
then
if stuff[i]:IsA "Tool" then
stuff[i].Parent = player.Backpack
end
@ -400,7 +412,7 @@ function toolSwitcher(numKey)
end
function activateGear(num)
local numKey = nil
local numKey
if num == "0" then
numKey = 10 -- why do lua indexes have to start at 1? :(
else
@ -446,8 +458,12 @@ enlargeButton = function(button)
if button:IsA "ImageButton" or button:IsA "TextButton" then
button.ZIndex = 5
local centerizeX = -(buttonSizeEnlarge.X.Scale - button.Size.X.Scale) / 2
local centerizeY = -(buttonSizeEnlarge.Y.Scale - button.Size.Y.Scale) / 2
local centerizeX = -(
buttonSizeEnlarge.X.Scale - button.Size.X.Scale
) / 2
local centerizeY = -(
buttonSizeEnlarge.Y.Scale - button.Size.Y.Scale
) / 2
button:TweenSizeAndPosition(
buttonSizeEnlarge,
UDim2.new(
@ -526,7 +542,10 @@ end
function pointInRectangle(point, rectTopLeft, rectSize)
if point.x > rectTopLeft.x and point.x < (rectTopLeft.x + rectSize.x) then
if point.y > rectTopLeft.y and point.y < (rectTopLeft.y + rectSize.y) then
if
point.y > rectTopLeft.y
and point.y < (rectTopLeft.y + rectSize.y)
then
return true
end
end
@ -550,17 +569,28 @@ function swapGear(gearClone, toFrame)
gearSlots[gearCloneSlot] = toFrameChildren[1]
toFrameChildren[1].SlotNumber.Text = gearClone.SlotNumber.Text
toFrameChildren[1].SlotNumberDownShadow.Text = gearClone.SlotNumber.Text
toFrameChildren[1].SlotNumberUpShadow.Text = gearClone.SlotNumber.Text
toFrameChildren[1].SlotNumberDownShadow.Text =
gearClone.SlotNumber.Text
toFrameChildren[1].SlotNumberUpShadow.Text =
gearClone.SlotNumber.Text
local subString = string.sub(toFrame.Name, 5)
gearClone.SlotNumber.Text = subString
gearClone.SlotNumberDownShadow.Text = subString
gearClone.SlotNumberUpShadow.Text = subString
gearClone.Position = UDim2.new(gearClone.Position.X.Scale, 0, gearClone.Position.Y.Scale, 0)
toFrameChildren[1].Position =
UDim2.new(toFrameChildren[1].Position.X.Scale, 0, toFrameChildren[1].Position.Y.Scale, 0)
gearClone.Position = UDim2.new(
gearClone.Position.X.Scale,
0,
gearClone.Position.Y.Scale,
0
)
toFrameChildren[1].Position = UDim2.new(
toFrameChildren[1].Position.X.Scale,
0,
toFrameChildren[1].Position.Y.Scale,
0
)
toFrameChildren[1].Parent = gearClone.Parent
gearClone.Parent = toFrame
@ -582,7 +612,12 @@ function swapGear(gearClone, toFrame)
toSlotNum = 10
end
gearSlots[toSlotNum] = gearClone
gearClone.Position = UDim2.new(gearClone.Position.X.Scale, 0, gearClone.Position.Y.Scale, 0)
gearClone.Position = UDim2.new(
gearClone.Position.X.Scale,
0,
gearClone.Position.Y.Scale,
0
)
gearClone.Parent = toFrame
end
end
@ -595,7 +630,13 @@ function resolveDrag(gearClone, x, y)
for i = 1, #frames do
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])
return true
end
@ -603,8 +644,14 @@ function resolveDrag(gearClone, x, y)
end
if
(x < frame.AbsolutePosition.x or x > (frame.AbsolutePosition.x + frame.AbsoluteSize.x))
or (y < frame.AbsolutePosition.y or y > (frame.AbsolutePosition.y + frame.AbsoluteSize.y))
(
x < frame.AbsolutePosition.x
or x > (frame.AbsolutePosition.x + frame.AbsoluteSize.x)
)
or (
y < frame.AbsolutePosition.y
or y > (frame.AbsolutePosition.y + frame.AbsoluteSize.y)
)
then
reorganizeLoadout(gearClone, false)
return false
@ -621,11 +668,15 @@ function unequipAllItems(dontEquipThis)
if gearSlots[i] == "empty" then
break
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
gearSlots[i].GearReference.Value:Disable()
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
gearSlots[i].Selected = false
end
@ -648,12 +699,21 @@ function showToolTip(button, tip)
end
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
end
end
local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButton)
local addingPlayerChild = function(
child,
equipped,
addToSlot,
inventoryGearButton
)
waitForDebounce()
debounce = true
@ -670,7 +730,10 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
if not addToSlot then
for i = 1, #gearSlots do
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then -- we already have gear, do nothing
if
gearSlots[i] ~= "empty"
and gearSlots[i].GearReference.Value == child
then -- we already have gear, do nothing
debounce = false
return
end
@ -733,7 +796,12 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
local absolutePositionFinal = inventoryGearButton.AbsolutePosition
local currentAbsolutePosition = gearClone.AbsolutePosition
local diff = absolutePositionFinal - currentAbsolutePosition
gearClone.Position = UDim2.new(gearClone.Position.X.Scale, diff.x, gearClone.Position.Y.Scale, diff.y)
gearClone.Position = UDim2.new(
gearClone.Position.X.Scale,
diff.x,
gearClone.Position.Y.Scale,
diff.y
)
gearClone.ZIndex = 4
end
@ -751,20 +819,27 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
if equipped then
gearClone.Selected = true
unequipAllItems(child)
delay(guiTweenSpeed + 0.01, function() -- if our gear is equipped, we will want to enlarge it when done moving
if
gearClone:FindFirstChild "GearReference"
and (
(
gearClone.GearReference.Value:IsA "Tool"
and gearClone.GearReference.Value.Parent == player.Character
delay(
guiTweenSpeed + 0.01,
function() -- if our gear is equipped, we will want to enlarge it when done moving
if
gearClone:FindFirstChild "GearReference"
and (
(
gearClone.GearReference.Value:IsA "Tool"
and gearClone.GearReference.Value.Parent
== player.Character
)
or (
gearClone.GearReference.Value:IsA "HopperBin"
and gearClone.GearReference.Value.Active == true
)
)
or (gearClone.GearReference.Value:IsA "HopperBin" and gearClone.GearReference.Value.Active == true)
)
then
enlargeButton(gearClone)
then
enlargeButton(gearClone)
end
end
end)
)
end
local dragBeginPos
@ -844,8 +919,8 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
end
end) -- this probably isn't necessary since objects are being deleted (probably), but this might still leak just in case
local childCon = nil
local childChangeCon = nil
local childCon
local childChangeCon
childCon = child.AncestryChanged:connect(function(newChild, parent)
if not checkToolAncestry(newChild, parent) then
if childCon then
@ -900,7 +975,7 @@ function addToInventory(child)
return
end
local slot = nil
local slot
for i = 1, #inventory do
if inventory[i] and inventory[i] == child then
return
@ -961,7 +1036,7 @@ end
local centerGear = function()
loadoutChildren = currentLoadout:GetChildren()
local gearButtons = {}
local lastSlotAdd = nil
local lastSlotAdd
for i = 1, #loadoutChildren do
if loadoutChildren[i]:IsA "Frame" then
@ -1056,7 +1131,10 @@ function tabHandler(inFocus)
end
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
clBackground.Visible = enabled
backpackEnabled = enabled
@ -1068,7 +1146,10 @@ function coreGuiChanged(coreGuiType, enabled)
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)
end
end
@ -1078,8 +1159,14 @@ end
registerNumberKeys()
pcall(function()
coreGuiChanged(Enum.CoreGuiType.Backpack, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack))
coreGuiChanged(Enum.CoreGuiType.Health, Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health))
coreGuiChanged(
Enum.CoreGuiType.Backpack,
Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
)
coreGuiChanged(
Enum.CoreGuiType.Health,
Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health)
)
Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
end)
@ -1108,9 +1195,16 @@ delay(2, function()
if robloxGui.AbsoluteSize.Y <= 320 then
local cChildren = currentLoadout:GetChildren()
for i = 1, #cChildren do
local slotNum = tonumber(string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name)))
local slotNum = tonumber(
string.sub(
cChildren[i].Name,
5,
string.len(cChildren[i].Name)
)
)
if type(slotNum) == "number" then
cChildren[i].Position = UDim2.new(0, (slotNum - 1) * 60, 0, 0)
cChildren[i].Position =
UDim2.new(0, (slotNum - 1) * 60, 0, 0)
end
end
end
@ -1214,9 +1308,16 @@ player.CharacterAdded:connect(function()
if robloxGui.AbsoluteSize.Y <= 320 then
local cChildren = currentLoadout:GetChildren()
for i = 1, #cChildren do
local slotNum = tonumber(string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name)))
local slotNum = tonumber(
string.sub(
cChildren[i].Name,
5,
string.len(cChildren[i].Name)
)
)
if type(slotNum) == "number" then
cChildren[i].Position = UDim2.new(0, (slotNum - 1) * 60, 0, 0)
cChildren[i].Position =
UDim2.new(0, (slotNum - 1) * 60, 0, 0)
end
end
end
@ -1238,7 +1339,11 @@ guiBackpack.SwapSlot.Changed:connect(function()
reorganizeLoadout(gearSlots[pos], false)
end
if swapSlot.GearButton.Value then
addingPlayerChild(swapSlot.GearButton.Value.GearReference.Value, false, pos)
addingPlayerChild(
swapSlot.GearButton.Value.GearReference.Value,
false,
pos
)
end
guiBackpack.SwapSlot.Value = false
end

View File

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

View File

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

View File

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

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

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)
if game.CoreGui.Version < 7 then
return
@ -45,7 +46,8 @@ if game.CoreGui.Version >= 8 then
wardrobeButton = backpack.Tabs.WardrobeButton
end
waitForChild(backpack.Parent, "ControlFrame")
local backpackButton = waitForChild(backpack.Parent.ControlFrame, "BackpackButton")
local backpackButton =
waitForChild(backpack.Parent.ControlFrame, "BackpackButton")
local currentTab = "gear"
local searchFrame = waitForChild(backpack, "SearchFrame")
@ -64,7 +66,7 @@ local backpackIsOpen = false
local active = true
local disabledByDeveloper = false
local humanoidDiedCon = nil
local humanoidDiedCon
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(tostring(funcName), "funcName is not a string")
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"
newFunction.Name = tostring(funcName)
@ -128,7 +133,9 @@ function initHumanoidDiedConnections()
end
waitForProperty(game.Players.LocalPlayer, "Character")
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
function activateBackpack()
@ -171,18 +178,28 @@ local hideBackpack = function()
end
function showBackpack()
game.GuiService:AddCenterDialog(backpack, Enum.CenterDialogType.PlayerInitiatedDialog, function()
backpack.Visible = true
backpackButton.Selected = true
end, function()
backpack.Visible = false
backpackButton.Selected = false
end)
game.GuiService:AddCenterDialog(
backpack,
Enum.CenterDialogType.PlayerInitiatedDialog,
function()
backpack.Visible = true
backpackButton.Selected = true
end,
function()
backpack.Visible = false
backpackButton.Selected = false
end
)
backpack.Visible = true
backpackButton.Selected = true
backpack:TweenSizeAndPosition(
backpackSize,
UDim2.new(0.5, -backpackSize.X.Offset / 2, 1, -backpackSize.Y.Offset - 88),
UDim2.new(
0.5,
-backpackSize.X.Offset / 2,
1,
-backpackSize.Y.Offset - 88
),
Enum.EasingDirection.Out,
Enum.EasingStyle.Quad,
guiTweenSpeed,
@ -194,8 +211,9 @@ function showBackpack()
backpackOpenEvent:Fire(currentTab)
canToggle = true
readyForNextEvent = true
backpackButton.Image = "http://www.roblox.com/asset/?id=97644093"
backpackButton.Position = UDim2.new(0.5, -60, 1, -backpackSize.Y.Offset - 103)
backpackButton.Image = "http://banland.xyz/asset/?id=97644093"
backpackButton.Position =
UDim2.new(0.5, -60, 1, -backpackSize.Y.Offset - 103)
end)
end
@ -218,7 +236,7 @@ function toggleBackpack()
backpackIsOpen = not backpackIsOpen
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.Size = UDim2.new(1.05, 0, 1.25, 0)
loadoutBackground.ZIndex = 2.0
@ -228,8 +246,8 @@ function toggleBackpack()
backpackButton.Position = UDim2.new(0.5, -60, 1, -44)
loadoutBackground.Visible = false
backpackButton.Selected = false
backpackButton.Image = "http://www.roblox.com/asset/?id=97617958"
loadoutBackground.Image = "http://www.roblox.com/asset/?id=96536002"
backpackButton.Image = "http://banland.xyz/asset/?id=97617958"
loadoutBackground.Image = "http://banland.xyz/asset/?id=96536002"
loadoutBackground.Position = UDim2.new(-0.1, 0, -0.1, 0)
loadoutBackground.Size = UDim2.new(1.2, 0, 1.2, 0)
hideBackpack()
@ -368,7 +386,10 @@ local backpackReady = function()
end
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
disabledByDeveloper = not enabled
@ -401,7 +422,10 @@ createPublicFunction("BackpackReady", backpackReady)
------------------------ Connections/Script Main -------------------------------------------
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)
end)

View File

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

View File

@ -1,11 +1,19 @@
print "[Mercury]: Loaded Host corescript"
-- Start Game Script Arguments
local placeId, sleeptime, access, url, killID, deathID, timeout, injectScriptAssetID, servicesUrl, libraryRegistrationScriptAssetID
-- StartGame --
pcall(function()
return game:GetService("ScriptContext"):AddStarterScript(injectScriptAssetID)
game:GetService("ScriptContext"):AddStarterScript(injectScriptAssetID)
end)
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
local child = parent:findFirstChild(childName)
if child then
@ -14,184 +22,265 @@ waitForChild = function(parent, childName)
parent.ChildAdded:wait()
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"
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
return nil
end
local onDied
onDied = function(victim, humanoid)
local killer, victorId = getKillerOfHumanoidIfStillInGame(humanoid), 0
-- send kill and death stats when a player dies
function onDied(victim, humanoid)
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
local victorId = 0
if killer then
victorId = killer.userId
print("STAT: kill by " .. tostring(victorId) .. " of " .. tostring(victim.userId))
game:HttpGet(tostring(url) .. "/Game/Knockouts.ashx?UserID=" .. tostring(victorId) .. "&" .. tostring(access))
print("STAT: kill by " .. victorId .. " of " .. victim.userId)
game:HttpGet(
url .. "/Game/Knockouts.ashx?UserID=" .. victorId .. "&" .. access
)
end
print("STAT: death of " .. tostring(victim.userId) .. " by " .. tostring(victorId))
return game:HttpGet(
tostring(url) .. "/Game/Wipeouts.ashx?UserID=" .. tostring(victim.userId) .. "&" .. tostring(access)
print("STAT: death of " .. victim.userId .. " by " .. victorId)
game:HttpGet(
url .. "/Game/Wipeouts.ashx?UserID=" .. victim.userId .. "&" .. access
)
end
-----------------------------------END UTILITY FUNCTIONS -------------------------
-----------------------------------"CUSTOM" SHARED CODE----------------------------------
pcall(function()
settings().Network.UseInstancePacketCache = true
end)
pcall(function()
settings().Network.UsePhysicsPacketCache = true
end)
--pcall(function() settings()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.FIFO end)
pcall(function()
settings()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.AccumulatedError
settings()["Task Scheduler"].PriorityMethod =
Enum.PriorityMethod.AccumulatedError
end)
--settings().Network.PhysicsSend = 1 -- 1==RoundRobin
settings().Network.PhysicsSend = Enum.PhysicsSendMethod.ErrorComputation2
settings().Network.ExperimentalPhysicsEnabled = true
settings().Network.WaitingForCharacterLogRate = 100
pcall(function()
return settings().Diagnostics:LegacyScriptMode()
settings().Diagnostics:LegacyScriptMode()
end)
-----------------------------------START GAME SHARED SCRIPT------------------------------
url = "_BASE_URL"
local scriptContext = game:GetService "ScriptContext"
pcall(function()
return scriptContext:AddStarterScript(libraryRegistrationScriptAssetID)
scriptContext:AddStarterScript(libraryRegistrationScriptAssetID)
end)
scriptContext.ScriptsDisabled = true
-- game:SetPlaceID(nil, false)
game:GetService("ChangeHistoryService"):SetEnabled(false)
-- establish this peer as the Server
local ns = game:GetService "NetworkServer"
if url ~= nil then
pcall(function()
return game:GetService("Players"):SetAbuseReportUrl(tostring(url) .. "/Report/Games.ashx")
game:GetService("Players"):SetAbuseReportUrl(
url .. "/Report/Games.ashx"
)
end)
pcall(function()
return game:GetService("ScriptInformationProvider"):SetAssetUrl(tostring(url) .. "/Asset/")
game:GetService("ScriptInformationProvider")
:SetAssetUrl(url .. "/Asset/")
end)
pcall(function()
return game:GetService("ContentProvider"):SetBaseUrl(tostring(url) .. "/")
game:GetService("ContentProvider"):SetBaseUrl(url .. "/")
end)
-- pcall(function() game:GetService("Players"):SetChatFilterUrl(url .. "/Game/ChatFilter.ashx") end)
-- game:GetService("BadgeService"):SetPlaceId(placeId)
if access ~= nil then
do
local _with_0 = game:GetService "BadgeService"
_with_0:SetAwardBadgeUrl(
tostring(url) .. "/Game/Badge/AwardBadge.ashx?UserID=%d&BadgeID=%d&PlaceID=%d&" .. tostring(access)
)
_with_0:SetHasBadgeUrl(
tostring(url) .. "/Game/Badge/HasBadge.ashx?UserID=%d&BadgeID=%d&" .. tostring(access)
)
_with_0:SetIsBadgeDisabledUrl(
tostring(url) .. "/Game/Badge/IsBadgeDisabled.ashx?BadgeID=%d&PlaceID=%d&" .. tostring(access)
)
end
do
local _with_0 = game:GetService "FriendService"
_with_0:SetMakeFriendUrl(
tostring(servicesUrl) .. "/Friend/CreateFriend?firstUserId=%d&secondUserId=%d&" .. tostring(access)
)
_with_0:SetBreakFriendUrl(
tostring(servicesUrl) .. "/Friend/BreakFriend?firstUserId=%d&secondUserId=%d&" .. tostring(access)
)
_with_0:SetGetFriendsUrl(tostring(servicesUrl) .. "/Friend/AreFriends?userId=%d&" .. tostring(access))
end
game:GetService("BadgeService"):SetAwardBadgeUrl(
url
.. "/Game/Badge/AwardBadge.ashx?UserID=%d&BadgeID=%d&PlaceID=%d&"
.. access
)
game:GetService("BadgeService"):SetHasBadgeUrl(
url .. "/Game/Badge/HasBadge.ashx?UserID=%d&BadgeID=%d&" .. access
)
game:GetService("BadgeService"):SetIsBadgeDisabledUrl(
url
.. "/Game/Badge/IsBadgeDisabled.ashx?BadgeID=%d&PlaceID=%d&"
.. access
)
game:GetService("FriendService"):SetMakeFriendUrl(
servicesUrl
.. "/Friend/CreateFriend?firstUserId=%d&secondUserId=%d&"
.. access
)
game:GetService("FriendService"):SetBreakFriendUrl(
servicesUrl
.. "/Friend/BreakFriend?firstUserId=%d&secondUserId=%d&"
.. access
)
game:GetService("FriendService"):SetGetFriendsUrl(
servicesUrl .. "/Friend/AreFriends?userId=%d&" .. access
)
end
game:GetService("BadgeService"):SetIsBadgeLegalUrl ""
do
local _with_0 = game:GetService "InsertService"
_with_0:SetBaseSetsUrl(tostring(url) .. "/game/tools/insertasset?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")
_with_0:SetAssetUrl(tostring(url) .. "/Asset/?id=%d")
_with_0:SetAssetVersionUrl(tostring(url) .. "/Asset/?assetversionid=%d")
end
game:GetService("InsertService")
:SetBaseSetsUrl(
url .. "/Game/Tools/InsertAsset.ashx?nsets=10&type=base"
)
game:GetService("InsertService"):SetUserSetsUrl(
url .. "/Game/Tools/InsertAsset.ashx?nsets=20&type=user&userid=%d"
)
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()
return loadfile(tostring(url) .. "/Game/LoadPlaceInfo.ashx?PlaceId=" .. tostring(placeId))()
loadfile(url .. "/Game/LoadPlaceInfo.ashx?PlaceId=" .. placeId)()
end)
pcall(function()
if access then
return loadfile(
tostring(url)
loadfile(
url
.. "/Game/PlaceSpecificScript.ashx?PlaceId="
.. tostring(placeId)
.. placeId
.. "&"
.. tostring(access)
.. access
)()
end
end)
end
pcall(function()
return game:GetService("NetworkServer"):SetIsPlayerAuthenticationRequired(true)
game:GetService("NetworkServer"):SetIsPlayerAuthenticationRequired(true)
end)
settings().Diagnostics.LuaRamLimit = 0
if (placeId ~= nil) and (killID ~= nil) and (deathID ~= nil) and (url ~= nil) then
local createDeathMonitor
createDeathMonitor = function(player)
--settings().Network:SetThroughputSensitivity(0.08, 0.01)
--settings().Network.SendRate = 35
--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
local humanoid = waitForChild(player.Character, "Humanoid")
return humanoid.Died:connect(function()
return onDied(player, humanoid)
humanoid.Died:connect(function()
onDied(player, humanoid)
end)
end
end
-- listen to all Players' Characters
game:GetService("Players").ChildAdded:connect(function(player)
createDeathMonitor(player)
return player.Changed:connect(function(property)
player.Changed:connect(function(property)
if property == "Character" then
return createDeathMonitor(player)
createDeathMonitor(player)
end
end)
end)
end
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
game:HttpGet(
tostring(url)
url
.. "/Game/ClientPresence.ashx?action=connect&"
.. tostring(access)
.. access
.. "&PlaceID="
.. tostring(placeId)
.. placeId
.. "&UserID="
.. tostring(player.userId)
.. player.userId
)
return game:HttpGet(
tostring(url)
game:HttpGet(
url
.. "/Game/PlaceVisit.ashx?UserID="
.. tostring(player.userId)
.. player.userId
.. "&AssociatedPlaceID="
.. tostring(placeId)
.. placeId
.. "&"
.. tostring(access)
.. access
)
end
end)
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
return game:HttpGet(
tostring(url)
game:HttpGet(
url
.. "/Game/ClientPresence.ashx?action=disconnect&"
.. tostring(access)
.. access
.. "&PlaceID="
.. tostring(placeId)
.. placeId
.. "&UserID="
.. tostring(player.userId)
.. player.userId
)
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()
game:Load(tostring(url) .. "/asset/?id=" .. tostring(placeId))
-- load the game
game:Load(url .. "/asset/?id=" .. placeId)
end
if _MAP_LOCATION_EXISTS then
-- yield so that file load happens in the heartbeat thread
wait()
-- load the game
game:Load "_MAP_LOCATION"
end
-- Now start the connection
ns:Start(_SERVER_PORT, sleeptime)
game:GetService("Visit"):SetPing("_SERVER_PRESENCE_URL", 30)
if timeout then
scriptContext:SetTimeout(timeout)
end
scriptContext.ScriptsDisabled = false
--delay(1, function()
-- loadfile(url .. "/analytics/GamePerfMonitor.ashx")(game.JobId, placeId)
--end)
local reset = ";mc"
return game.Players.PlayerAdded:connect(function(player)
return player.Chatted:connect(function(msg)
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg == reset then
if player.Character then
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()
return game:SetPlaceID(_PLACE_ID, false)
game:SetPlaceID(_PLACE_ID, false)
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
pcall(function()
settings().Rendering.EnableFRM = true
@ -12,215 +28,268 @@ pcall(function()
settings().Physics.Is30FpsThrottleEnabled = false
end)
pcall(function()
settings()["Task Scheduler"].PriorityMethod = Enum.PriorityMethod.AccumulatedError
settings()["Task Scheduler"].PriorityMethod =
Enum.PriorityMethod.AccumulatedError
end)
pcall(function()
settings().Physics.PhysicsEnvironmentalThrottle = Enum.EnviromentalPhysicsThrottle.DefaultAuto
settings().Physics.PhysicsEnvironmentalThrottle =
Enum.EnviromentalPhysicsThrottle.DefaultAuto
end)
-- arguments ---------------------------------------
local threadSleepTime = ...
if threadSleepTime == nil then
threadSleepTime = 15
end
local test = _IS_STUDIO_JOIN
print "! Joining game '_PLACE_ID' place _PLACE_ID at _SERVER_ADDRESS"
game:GetService("ChangeHistoryService"):SetEnabled(false)
game:GetService("ContentProvider"):SetThreadPool(16)
do
local _with_0 = game:GetService "InsertService"
_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"
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
ChangeHistoryService:SetEnabled(false)
ContentProvider:SetThreadPool(16)
InsertService: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"
InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d"
InsertService:SetAssetUrl "http://banland.xyz/Asset/?id=%d"
InsertService:SetAssetVersionUrl "http://banland.xyz/Asset/?assetversionid=%d"
pcall(function()
return game:GetService("GamePassService")
:SetPlayerHasPassUrl "http://banland.xyz/Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d"
SocialService:SetFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsFriendsWith&playerid=%d&userid=%d"
end)
pcall(function()
return game:GetService("MarketplaceService")
:SetProductInfoUrl "https://banland.xyz/marketplace/productinfo?assetId=%d"
SocialService:SetBestFriendUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsBestFriendsWith&playerid=%d&userid=%d"
end)
pcall(function()
return game:GetService("MarketplaceService")
:SetPlayerOwnsAssetUrl "https://banland.xyz/ownership/hasasset?userId=%d&assetId=%d"
SocialService:SetGroupUrl "http://banland.xyz/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=%d&groupid=%d"
end)
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)
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)
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
pcall(function()
if settings().Network.MtuOverride == 0 then
settings().Network.MtuOverride = 1400
end
end)
client = game:GetService "NetworkClient"
visit = game:GetService "Visit"
setMessage = function(message)
return game:SetMessage((function()
do
return message
end
end)())
-- functions ---------------------------------------
function setMessage(message)
-- todo: animated "..."
game:SetMessage(message)
end
showErrorWindow = function(message, _, _)
return game:SetMessage(message)
function showErrorWindow(message, _, _)
game:SetMessage(message)
end
reportError = function(err, message)
print("***ERROR*** " .. tostring(err))
function reportError(err, message)
print("***ERROR*** " .. err)
if not test then
visit:SetUploadUrl ""
Visit:SetUploadUrl ""
end
client:disconnect()
Client:Disconnect()
wait(4)
return showErrorWindow("Error: " .. tostring(err), message, "Other")
showErrorWindow("Error: " .. err, message, "Other")
end
onDisconnection = function(_, lostConnection)
-- called when the client connection closes
function onDisconnection(_, lostConnection)
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
return showErrorWindow("This game has shut down", "Kick", "Kick")
showErrorWindow("This game has shut down", "Kick", "Kick")
end
end
requestCharacter = function(replicator)
function requestCharacter(replicator)
-- prepare code for when the Character appears
local connection
connection = player.Changed:connect(function(property)
if property == "Character" then
game:ClearMessage()
waitingForCharacter = false
return connection:disconnect()
connection:disconnect()
end
end)
setMessage "Requesting character"
local success, err = pcall(function()
replicator:RequestCharacter()
setMessage "Waiting for character"
waitingForCharacter = true
end)
if not success then
reportError(err, "W4C")
return
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()
if not test then
visit:SetPing("_PING_URL", 30)
end
do
game:SetMessageBrickCount()
Visit:SetPing("_PING_URL", 30)
end
game:SetMessageBrickCount()
replicator.Disconnection:connect(onDisconnection)
-- Wait for a marker to return before creating the Player
local marker = replicator:SendMarker()
return marker.Received:connect(function()
marker.Received:connect(function()
waitingForMarker = false
return requestCharacter(replicator)
requestCharacter(replicator)
end)
end)
if not success then
reportError(err, "ConnectionAccepted")
return
end
-- TODO: report marker progress
while waitingForMarker do
workspace:ZoomToExtents()
wait(0.5)
end
end
onConnectionFailed = function(_, err)
return showErrorWindow(
"Failed to connect to the Game. (ID=" .. tostring(err) .. ")",
"ID" .. tostring(err),
-- called when the client connection fails
function onConnectionFailed(_, error)
showErrorWindow(
"Failed to connect to the Game. (ID=" .. error .. ")",
"ID" .. error,
"Other"
)
end
onConnectionRejected = function()
-- called when the client connection is rejected
function onConnectionRejected()
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
local idled = false
onPlayerIdled = function(time)
function onPlayerIdled(time)
if time > 20 * 60 then
showErrorWindow(string.format("You were disconnected for being idle %d minutes", time / 60), "Idle", "Idle")
client:disconnect()
showErrorWindow(
string.format(
"You were disconnected for being idle %d minutes",
time / 60
),
"Idle",
"Idle"
)
Client:disconnect()
if not idled then
idled = true
end
end
end
-- main ------------------------------------------------------------
pcall(function()
return settings().Diagnostics:LegacyScriptMode()
settings().Diagnostics:LegacyScriptMode()
end)
local success, err = pcall(function()
game:SetRemoteBuildMode(true)
setMessage "Connecting to Server"
client.ConnectionAccepted:connect(onConnectionAccepted)
client.ConnectionRejected:connect(onConnectionRejected)
connectionFailed = client.ConnectionFailed:connect(onConnectionFailed)
client.Ticket = ""
Client.ConnectionAccepted:connect(onConnectionAccepted)
Client.ConnectionRejected:connect(onConnectionRejected)
connectionFailed = Client.ConnectionFailed:connect(onConnectionFailed)
Client.Ticket = ""
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)
if not playerConnectSucces then
player = game:GetService("Players"):CreateLocalPlayer(_USER_ID)
client:Connect("_SERVER_ADDRESS", _SERVER_PORT, 0, threadSleepTime)
end
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)
--Old player connection scheme
player = Players:CreateLocalPlayer(_USER_ID)
Client:Connect("_SERVER_ADDRESS", _SERVER_PORT, 0, threadSleepTime)
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)
pcall(function()
player.Name = [========[_USER_NAME]========]
end)
player.CharacterAppearance = "_CHAR_APPEARANCE"
if not test then
return visit:SetUploadUrl ""
Visit:SetUploadUrl ""
end
end)
if not success then
reportError(err, "CreatePlayer")
end
if not test then
-- TODO: Async get?
loadfile ""("", -1, 0)
end
pcall(function()
return game:SetScreenshotInfo ""
game:SetScreenshotInfo ""
end)
return 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>'
pcall(function()
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)
-- 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"
do
local _with_0 = game:GetService "InsertService"
pcall(function()
return _with_0:SetFreeModelUrl "http://banland.xyz/game/tools/insertasset?type=fm&q=%s&pg=%d&rs=%d"
end)
pcall(function()
return _with_0:SetFreeDecalUrl "http://banland.xyz/game/tools/insertasset?type=fd&q=%s&pg=%d&rs=%d"
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
local MarketplaceService = game:GetService "MarketplaceService"
local InsertService = game:GetService "InsertService"
local SocialService = game:GetService "SocialService"
local GamePassService = game:GetService "GamePassService"
local ScriptInformationProvider = game:GetService "ScriptInformationProvider"
local ScriptContext = game:GetService "ScriptContext"
-- Setup studio cmd bar & load core scripts
pcall(function()
return game:GetService("GamePassService")
:SetPlayerHasPassUrl "http://banland.xyz/Game/GamePass/GamePassHandler.ashx?Action=HasPass&UserID=%d&PassID=%d"
InsertService:SetFreeModelUrl "http://banland.xyz/game/tools/insertasset?type=fm&q=%s&pg=%d&rs=%d"
end)
do
local _with_0 = game:GetService "MarketplaceService"
pcall(function()
return _with_0:SetProductInfoUrl "https://banland.xyz/marketplace/productinfo?assetId=%d"
end)
pcall(function()
return _with_0:SetDevProductInfoUrl "https://banland.xyz/marketplace/productDetails?productId=%d"
end)
pcall(function()
return _with_0:SetPlayerOwnsAssetUrl "https://banland.xyz/ownership/hasasset?userId=%d&assetId=%d"
end)
end
pcall(function()
InsertService:SetFreeDecalUrl "http://banland.xyz/game/tools/insertasset?type=fd&q=%s&pg=%d&rs=%d"
end)
ScriptInformationProvider:SetAssetUrl "http://banland.xyz/Asset/"
InsertService: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"
InsertService:SetCollectionUrl "http://banland.xyz/game/tools/insertasset?sid=%d"
InsertService:SetAssetUrl "http://banland.xyz/Asset/?id=%d"
InsertService:SetAssetVersionUrl "http://banland.xyz/Asset/?assetversionid=%d"
InsertService:SetTrustLevel(0)
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()
return game:GetService("ScriptContext"):AddStarterScript(37801172)
ScriptContext:AddStarterScript(37801172)
end)
if not result then
return pcall(function()
return game:GetService("ScriptContext")
:AddCoreScript(37801172, game:GetService("ScriptContext", "StarterScript"))
pcall(function()
ScriptContext:AddCoreScript(
37801172,
game:GetService "ScriptContext",
"StarterScript"
)
end)
end

View File

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

View File

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