Revert changes with Fusion to corescripts and add some other improvements

This commit is contained in:
Lewin Kelly 2023-09-30 03:58:36 +01:00
parent 79408d8a57
commit c959501e61
5 changed files with 934 additions and 1261 deletions

View File

@ -4,6 +4,7 @@ print "[Mercury]: Loaded corescript 107893730"
-- this script creates the gui and sends the web requests for in game purchase prompts -- this script creates the gui and sends the web requests for in game purchase prompts
local MarketplaceService = game:GetService "MarketplaceService" local MarketplaceService = game:GetService "MarketplaceService"
local GuiService = game:GetService "GuiService"
-- wait for important items to appear -- wait for important items to appear
while not Game do while not Game do
@ -164,14 +165,13 @@ end
function signalPromptEnded(isSuccess) function signalPromptEnded(isSuccess)
closePurchasePrompt() closePurchasePrompt()
if purchasingConsumable then if purchasingConsumable then
game:GetService("MarketplaceService") MarketplaceService:SignalPromptProductPurchaseFinished(
:SignalPromptProductPurchaseFinished( game.Players.LocalPlayer.userId,
game.Players.LocalPlayer.userId, currentProductId,
currentProductId, isSuccess
isSuccess )
)
else else
game:GetService("MarketplaceService"):SignalPromptPurchaseFinished( MarketplaceService:SignalPromptPurchaseFinished(
game.Players.LocalPlayer, game.Players.LocalPlayer,
currentAssetId, currentAssetId,
isSuccess isSuccess
@ -514,7 +514,7 @@ function doAcceptPurchase(_)
purchaseFailed() purchaseFailed()
return return
end end
Game:GetService("MarketplaceService"):SignalClientPurchaseSuccess( MarketplaceService:SignalClientPurchaseSuccess(
tostring(response.receipt), tostring(response.receipt),
game.Players.LocalPlayer.userId, game.Players.LocalPlayer.userId,
currentProductId currentProductId
@ -533,14 +533,10 @@ end
---------------------------------------------- Currency Functions --------------------------------------------- ---------------------------------------------- Currency Functions ---------------------------------------------
-- enums have no implicit conversion to numbers in lua, has to have a function to do this -- enums have no implicit conversion to numbers in lua, has to have a function to do this
function currencyEnumToInt(currencyEnum: Enum.CurrencyType) function currencyEnumToInt(currencyEnum: Enum.CurrencyType)
if if currencyEnum == Enum.CurrencyType.Tix then
currencyEnum == Enum.CurrencyType.Robux
or currencyEnum == Enum.CurrencyType.Default
then
return 1
elseif currencyEnum == Enum.CurrencyType.Tix then
return 2 return 2
end end
return 1
end end
-- oi, this is ugly -- oi, this is ugly
@ -620,7 +616,7 @@ function currencyTypeToString(currencyType)
end end
-- figure out what currency to use based on the currency you can actually sell the item in and what the script specified -- figure out what currency to use based on the currency you can actually sell the item in and what the script specified
function setCurrencyAmountAndType(priceInRobux, priceInTix) local function setCurrencyAmountAndType(priceInRobux, priceInTix)
if if
currentCurrencyType == Enum.CurrencyType.Default currentCurrencyType == Enum.CurrencyType.Default
or currentCurrencyType == Enum.CurrencyType.Robux or currentCurrencyType == Enum.CurrencyType.Robux
@ -652,7 +648,7 @@ function setCurrencyAmountAndType(priceInRobux, priceInTix)
end end
-- will get the player's balance of robux and tix, return in a table -- will get the player's balance of robux and tix, return in a table
function getPlayerBalance() local function getPlayerBalance()
local playerBalance local playerBalance
local success, errorCode = ypcall(function() local success, errorCode = ypcall(function()
playerBalance = playerBalance =
@ -660,11 +656,11 @@ function getPlayerBalance()
end) end)
if not success then if not success then
print("Get player balance failed because", errorCode) print("Get player balance failed because", errorCode)
return nil return
end end
if playerBalance == "" then if playerBalance == "" then
return nil return
end end
playerBalance = getRbxUtility().DecodeJSON(playerBalance) playerBalance = getRbxUtility().DecodeJSON(playerBalance)
@ -675,13 +671,13 @@ end
-- should open an external default browser window to this url -- should open an external default browser window to this url
function openBuyCurrencyWindow() function openBuyCurrencyWindow()
checkingPlayerFunds = true checkingPlayerFunds = true
game:GetService("GuiService") GuiService:OpenBrowserWindow(baseUrl .. "Upgrades/Robux.aspx")
:OpenBrowserWindow(baseUrl .. "Upgrades/Robux.aspx")
end end
function openBCUpSellWindow() function openBCUpSellWindow()
Game:GetService("GuiService") GuiService:OpenBrowserWindow(
:OpenBrowserWindow(baseUrl .. "Upgrades/BuildersClubMemberships.aspx") baseUrl .. "Upgrades/BuildersClubMemberships.aspx"
)
end end
-- set up the gui text at the bottom of the prompt (alerts user to how much money they will have left, or if they need to buy more to buy the item) -- set up the gui text at the bottom of the prompt (alerts user to how much money they will have left, or if they need to buy more to buy the item)
@ -758,7 +754,7 @@ end
---------------------------------------------- Data Functions ----------------------------------------------------- ---------------------------------------------- Data Functions -----------------------------------------------------
-- more enum to int fun! -- more enum to int fun!
function membershipTypeToNumber(membership) local function membershipTypeToNumber(membership)
if membership == Enum.MembershipType.None then if membership == Enum.MembershipType.None then
return 0 return 0
elseif membership == Enum.MembershipType.BuildersClub then elseif membership == Enum.MembershipType.BuildersClub then
@ -795,8 +791,8 @@ function canPurchaseItem()
end end
else else
success = ypcall(function() success = ypcall(function()
currentProductInfo = game:GetService("MarketplaceService") currentProductInfo =
:GetProductInfo(currentAssetId) MarketplaceService:GetProductInfo(currentAssetId)
end) end)
end end
@ -816,7 +812,7 @@ function canPurchaseItem()
return false return false
end end
local success, errorCode = ypcall(function() local success2, errorCode = ypcall(function()
playerOwnsAsset = game:HttpGetAsync( playerOwnsAsset = game:HttpGetAsync(
getSecureApiBaseUrl() getSecureApiBaseUrl()
.. "ownership/hasAsset?userId=" .. "ownership/hasAsset?userId="
@ -826,7 +822,7 @@ function canPurchaseItem()
) )
end) end)
if not success then if not success2 then
print("could not tell if player owns asset because", errorCode) print("could not tell if player owns asset because", errorCode)
return false return false
end end
@ -1361,12 +1357,11 @@ function userPurchaseProductActionsEnded(userIsClosingDialog)
isPurchased = true isPurchased = true
end end
Game:GetService("MarketplaceService") MarketplaceService:SignalPromptProductPurchaseFinished(
:SignalPromptProductPurchaseFinished( tonumber(currentServerResponseTable.playerId),
tonumber(currentServerResponseTable.playerId), tonumber(currentServerResponseTable.productId),
tonumber(currentServerResponseTable.productId), isPurchased
isPurchased )
)
else else
print "Something went wrong, no currentServerResponseTable" print "Something went wrong, no currentServerResponseTable"
end end
@ -1406,23 +1401,26 @@ end
---------------------------------------------- Script Event start/initialization ---------------------------------------------- ---------------------------------------------- Script Event start/initialization ----------------------------------------------
preloadAssets() preloadAssets()
game:GetService("MarketplaceService").PromptProductPurchaseRequested MarketplaceService.PromptProductPurchaseRequested:connect(
:connect(function(player, productId, equipIfPurchased, currencyType) function(player, productId, equipIfPurchased, currencyType)
doPurchasePrompt(player, nil, equipIfPurchased, currencyType, productId) doPurchasePrompt(player, nil, equipIfPurchased, currencyType, productId)
end) end
)
Game:GetService("MarketplaceService").PromptPurchaseRequested MarketplaceService.PromptPurchaseRequested:connect(
:connect(function(player, assetId, equipIfPurchased, currencyType) function(player, assetId, equipIfPurchased, currencyType)
doPurchasePrompt(player, assetId, equipIfPurchased, currencyType, nil) doPurchasePrompt(player, assetId, equipIfPurchased, currencyType, nil)
end) end
)
Game:GetService("MarketplaceService").ServerPurchaseVerification MarketplaceService.ServerPurchaseVerification:connect(
:connect(function(serverResponseTable) function(serverResponseTable)
doProcessServerPurchaseResponse(serverResponseTable) doProcessServerPurchaseResponse(serverResponseTable)
end) end
)
if enableBrowserWindowClosedEvent then if enableBrowserWindowClosedEvent then
Game:GetService("GuiService").BrowserWindowClosed:connect(function() GuiService.BrowserWindowClosed:connect(function()
doPlayerFundsCheck(false) doPlayerFundsCheck(false)
end) end)
end end

File diff suppressed because it is too large Load Diff

View File

@ -1044,7 +1044,7 @@ local function TweenProperty(obj, propName, inita, enda, length)
while tick() - startTime < length do while tick() - startTime < length do
obj[propName] = ((enda - inita) * ((tick() - startTime) / length)) obj[propName] = ((enda - inita) * ((tick() - startTime) / length))
+ inita + inita
wait(1 / 30) wait()
end end
obj[propName] = enda obj[propName] = enda
end end
@ -1410,7 +1410,7 @@ function StatAdded(nchild, playerEntry)
-- dont re - add a leaderstat I alreday have -- dont re - add a leaderstat I alreday have
while AddingStatLock do while AddingStatLock do
debugprint "in stat added function lock" debugprint "in stat added function lock"
wait(1 / 30) wait()
end end
AddingStatLock = true AddingStatLock = true
if if
@ -1486,7 +1486,7 @@ end
function StatRemoved(nchild, playerEntry) function StatRemoved(nchild, playerEntry)
while AddingStatLock do while AddingStatLock do
debugprint "In Adding Stat Lock1" debugprint "In Adding Stat Lock1"
wait(1 / 30) wait()
end end
AddingStatLock = true AddingStatLock = true
if playerEntry.Frame:FindFirstChild(nchild.Name) then if playerEntry.Frame:FindFirstChild(nchild.Name) then
@ -1604,7 +1604,7 @@ end
function RecreateScoreColumns(ptable) function RecreateScoreColumns(ptable)
while AddingStatLock do while AddingStatLock do
debugprint "In Adding Stat Lock2" debugprint "In Adding Stat Lock2"
wait(1 / 30) wait()
end end
AddingStatLock = true AddingStatLock = true
local Xoffset = 5 --15 --current offset from Right local Xoffset = 5 --15 --current offset from Right
@ -2440,7 +2440,7 @@ function UpdateHeaderNameSize()
tHeader.FontSize = FONT_SIZES[fSize] tHeader.FontSize = FONT_SIZES[fSize]
Delay(0.2, function() Delay(0.2, function()
while tHeader.TextBounds.x == 0 do while tHeader.TextBounds.x == 0 do
wait(1 / 30) wait()
end end
while tHeader.TextBounds.x - NormalBounds.X.Offset > 1 do while tHeader.TextBounds.x - NormalBounds.X.Offset > 1 do
fSize -= 1 fSize -= 1
@ -2482,7 +2482,7 @@ end
function LeaderstatsRemoved(_, playerEntry) function LeaderstatsRemoved(_, playerEntry)
while AddingFrameLock do while AddingFrameLock do
debugprint("waiting to insert " .. playerEntry.Player.Name) debugprint("waiting to insert " .. playerEntry.Player.Name)
wait(1 / 30) wait()
end end
AddingFrameLock = true AddingFrameLock = true
RemoveAllStats(playerEntry) RemoveAllStats(playerEntry)
@ -2656,7 +2656,7 @@ end
@Args: @Args:
entry the player entry clicked entry the player entry clicked
--]] --]]
function OnPlayerEntrySelect(entry, startx, starty) local function OnPlayerEntrySelect(entry, startx, starty)
if not InPopupWaitForClick then if not InPopupWaitForClick then
SelectedPlayerEntry = entry SelectedPlayerEntry = entry
SelectedPlayer = entry.Player SelectedPlayer = entry.Player
@ -2678,7 +2678,7 @@ end
the basic update for the playerlist mode's state, the basic update for the playerlist mode's state,
assures the order and length of the player frames assures the order and length of the player frames
--]] --]]
function PlayerListModeUpdate() local function PlayerListModeUpdate()
RecreateScoreColumns(PlayerFrames) RecreateScoreColumns(PlayerFrames)
table.sort(PlayerFrames, PlayerSortFunction) table.sort(PlayerFrames, PlayerSortFunction)
for i, val in ipairs(PlayerFrames) do for i, val in ipairs(PlayerFrames) do
@ -2689,6 +2689,7 @@ function PlayerListModeUpdate()
end end
UpdateMinimize() UpdateMinimize()
end end
--[[ --[[
this one's a doozie, happens when a player is added to the game this one's a doozie, happens when a player is added to the game
inits their player frame and player entry, assigns them to a team if possible, inits their player frame and player entry, assigns them to a team if possible,
@ -2696,10 +2697,10 @@ end
@Args: @Args:
nplayer new player object to insert nplayer new player object to insert
--]] --]]
function InsertPlayerFrame(nplayer) local function InsertPlayerFrame(nplayer)
while AddingFrameLock do while AddingFrameLock do
debugprint("waiting to insert " .. nplayer.Name) debugprint("waiting to insert " .. nplayer.Name)
wait(1 / 30) wait()
end end
AddingFrameLock = true AddingFrameLock = true
@ -2799,7 +2800,7 @@ function InsertPlayerFrame(nplayer)
if nchild.Name == "leaderstats" then if nchild.Name == "leaderstats" then
while AddingFrameLock do while AddingFrameLock do
debugprint "in adding leaderstats lock" debugprint "in adding leaderstats lock"
wait(1 / 30) wait()
end end
AddingFrameLock = true AddingFrameLock = true
LeaderstatsAdded(nentry) LeaderstatsAdded(nentry)
@ -2834,7 +2835,7 @@ end
function RemovePlayerFrame(tplayer) function RemovePlayerFrame(tplayer)
while AddingFrameLock do while AddingFrameLock do
debugprint "in removing player frame lock" debugprint "in removing player frame lock"
wait(1 / 30) wait()
end end
AddingFrameLock = true AddingFrameLock = true
@ -2915,46 +2916,21 @@ function TeamSortFunc(a, b)
end end
return a.TeamScore < b.TeamScore return a.TeamScore < b.TeamScore
end end
--[[
consider adding lock with wait for performance
sorts each of the team's player lists induvidually, adds up the team scores.
@Args:
tentries table of team entries
--]]
function SortTeams(tentries)
for _, val in ipairs(tentries) do
table.sort(val.MyPlayers, PlayerSortFunction)
AddTeamScores(val)
end
table.sort(tentries, TeamSortFunc)
end
--[[
base update for team mode, adds up the scores of all teams, sorts them,
then unrolls them into middleframes
--]]
function TeamListModeUpdate()
RecreateScoreColumns(PlayerFrames)
SortTeams(TeamFrames)
if NeutralTeam then
AddTeamScores(NeutralTeam)
--RecreateScoreColumns(NeutralTeam['MyPlayers'])
end
UnrollTeams(TeamFrames, MiddleFrames)
end
--[[ --[[
adds up all the score of this team's players to form the team score adds up all the score of this team's players to form the team score
@Args: @Args:
team team entry to sum the scores of team team entry to sum the scores of
--]] --]]
function AddTeamScores(team) local function AddTeamScores(team)
for j = 1, #ScoreNames, 1 do for j = 1, #ScoreNames, 1 do
local i = ScoreNames[j] local i = ScoreNames[j]
local tscore = 0 local tscore = 0
for _, j in ipairs(team.MyPlayers) do for _, k in ipairs(team.MyPlayers) do
local tval = j.Player:FindFirstChild "leaderstats" local tval = k.Player:FindFirstChild "leaderstats"
and j.Player.leaderstats:FindFirstChild(i.Name) and k.Player.leaderstats:FindFirstChild(i.Name)
if tval and not tval:IsA "StringValue" then if tval and not tval:IsA "StringValue" then
tscore += GetScoreValue((j.Player.leaderstats)[i.Name]) tscore += GetScoreValue((k.Player.leaderstats)[i.Name])
end end
end end
if team.Frame:FindFirstChild(i.Name) then if team.Frame:FindFirstChild(i.Name) then
@ -2970,12 +2946,40 @@ function AddTeamScores(team)
UpdateMinimize() UpdateMinimize()
end end
--[[
consider adding lock with wait for performance
sorts each of the team's player lists induvidually, adds up the team scores.
@Args:
tentries table of team entries
--]]
local function SortTeams(tentries)
for _, val in ipairs(tentries) do
table.sort(val.MyPlayers, PlayerSortFunction)
AddTeamScores(val)
end
table.sort(tentries, TeamSortFunc)
end
--[[
base update for team mode, adds up the scores of all teams, sorts them,
then unrolls them into middleframes
--]]
local function TeamListModeUpdate()
RecreateScoreColumns(PlayerFrames)
SortTeams(TeamFrames)
if NeutralTeam then
AddTeamScores(NeutralTeam)
--RecreateScoreColumns(NeutralTeam['MyPlayers'])
end
UnrollTeams(TeamFrames, MiddleFrames)
end
--[[ --[[
finds previous team this player was on, and if it exists calls removeplayerfromteam finds previous team this player was on, and if it exists calls removeplayerfromteam
@Args @Args
entry Player entry entry Player entry
--]] --]]
function FindRemovePlayerFromTeam(entry) local function FindRemovePlayerFromTeam(entry)
if entry.MyTeam then if entry.MyTeam then
for j, oldEntry in ipairs(entry.MyTeam.MyPlayers) do for j, oldEntry in ipairs(entry.MyTeam.MyPlayers) do
if oldEntry.Player == entry.Player then if oldEntry.Player == entry.Player then
@ -2992,6 +2996,7 @@ function FindRemovePlayerFromTeam(entry)
end end
end end
end end
--[[ --[[
removes a single player from a given team (not usually called directly) removes a single player from a given team (not usually called directly)
@Args: @Args:
@ -3005,6 +3010,7 @@ function RemovePlayerFromTeam(teamEntry, index)
RemoveNeutralTeam() RemoveNeutralTeam()
end end
end end
--[[ --[[
adds player entry entry to teamentry adds player entry entry to teamentry
removes them from any previous team removes them from any previous team
@ -3023,7 +3029,7 @@ function AddPlayerToTeam(teamEntry, entry)
teamEntry.IsHidden = false teamEntry.IsHidden = false
end end
function SetPlayerToTeam(entry) local function SetPlayerToTeam(entry)
FindRemovePlayerFromTeam(entry) FindRemovePlayerFromTeam(entry)
-- check to see if team exists, if it does add to that team -- check to see if team exists, if it does add to that team
local setToTeam = false local setToTeam = false
@ -3057,7 +3063,7 @@ end
function PlayerChanged(entry, property) function PlayerChanged(entry, property)
while PlayerChangedLock do while PlayerChangedLock do
debugprint "in playerchanged lock" debugprint "in playerchanged lock"
wait(1 / 30) wait()
end end
PlayerChangedLock = true PlayerChangedLock = true
if property == "Neutral" then if property == "Neutral" then
@ -3208,7 +3214,7 @@ end
--[[ --[[
--]] --]]
function TeamScoreChanged(entry, nscore) local function TeamScoreChanged(entry, nscore)
WaitForChild(entry.Frame, "PlayerScore").Text = tostring(nscore) WaitForChild(entry.Frame, "PlayerScore").Text = tostring(nscore)
entry.TeamScore = nscore entry.TeamScore = nscore
end end
@ -3216,7 +3222,7 @@ end
called when child added to a team, used for autohide functionality called when child added to a team, used for autohide functionality
Note: still has teamscore, consiter removing Note: still has teamscore, consiter removing
--]] --]]
function TeamChildAdded(entry, nchild) local function TeamChildAdded(entry, nchild)
if nchild.Name == "AutoHide" then if nchild.Name == "AutoHide" then
entry.AutoHide = true entry.AutoHide = true
elseif nchild.Name == "TeamScore" then elseif nchild.Name == "TeamScore" then
@ -3231,7 +3237,7 @@ end
called when child added to a team, used for autohide functionality called when child added to a team, used for autohide functionality
Note: still has teamscore, consiter removing Note: still has teamscore, consiter removing
--]] --]]
function TeamChildRemoved(entry, nchild) local function TeamChildRemoved(entry, nchild)
if nchild.Name == "AutoHide" then if nchild.Name == "AutoHide" then
entry.AutoHide = false entry.AutoHide = false
elseif nchild.Name == "TeamScore" then elseif nchild.Name == "TeamScore" then
@ -3240,7 +3246,7 @@ function TeamChildRemoved(entry, nchild)
end end
end end
function TeamChanged(entry, property) local function TeamChanged(entry, property)
if property == "Name" then if property == "Name" then
WaitForChild(WaitForChild(entry.Frame, "TitleFrame"), "Title").Text = WaitForChild(WaitForChild(entry.Frame, "TitleFrame"), "Title").Text =
entry.MyTeam.Name entry.MyTeam.Name
@ -3270,10 +3276,10 @@ end
@Args: @Args:
nteam new team object added nteam new team object added
--]] --]]
function InsertTeamFrame(nteam) local function InsertTeamFrame(nteam)
while AddingFrameLock do while AddingFrameLock do
debugprint "in adding team frame lock" debugprint "in adding team frame lock"
wait(1 / 30) wait()
end end
AddingFrameLock = true AddingFrameLock = true
--for _,i in pairs(TeamFrames) do --for _,i in pairs(TeamFrames) do
@ -3364,7 +3370,7 @@ end
function RemoveTeamFrame(nteam) function RemoveTeamFrame(nteam)
while AddingFrameLock do while AddingFrameLock do
debugprint "in removing team frame lock" debugprint "in removing team frame lock"
wait(1 / 30) wait()
end end
AddingFrameLock = true AddingFrameLock = true
-- if IsMinimized.Value then -- if IsMinimized.Value then
@ -3407,7 +3413,7 @@ end
function BaseUpdate() function BaseUpdate()
while BaseUpdateLock do while BaseUpdateLock do
debugprint "in baseupdate lock" debugprint "in baseupdate lock"
wait(1 / 30) wait()
end end
BaseUpdateLock = true BaseUpdateLock = true
--print ('baseupdate') --print ('baseupdate')
@ -3491,7 +3497,7 @@ game.GuiService.KeyPressed:connect(function(key)
end end
end) end)
function PlayersChildAdded(tplayer) local function PlayersChildAdded(tplayer)
if tplayer:IsA "Player" then if tplayer:IsA "Player" then
Spawn(function() Spawn(function()
debugPlayerAdd(tplayer) debugPlayerAdd(tplayer)
@ -3501,7 +3507,7 @@ function PlayersChildAdded(tplayer)
end end
end end
function coreGuiChanged(coreGuiType, enabled) local function coreGuiChanged(coreGuiType, enabled)
if if
coreGuiType == Enum.CoreGuiType.All coreGuiType == Enum.CoreGuiType.All
or coreGuiType == Enum.CoreGuiType.PlayerList or coreGuiType == Enum.CoreGuiType.PlayerList
@ -3510,7 +3516,7 @@ function coreGuiChanged(coreGuiType, enabled)
end end
end end
function TeamsChildAdded(nteam) local function TeamsChildAdded(nteam)
if nteam:IsA "Team" then if nteam:IsA "Team" then
TeamAdded(nteam) TeamAdded(nteam)
else else
@ -3518,7 +3524,7 @@ function TeamsChildAdded(nteam)
end end
end end
function TeamsChildRemoved(nteam) local function TeamsChildRemoved(nteam)
if nteam:IsA "Team" then if nteam:IsA "Team" then
TeamRemoved(nteam) TeamRemoved(nteam)
else else
@ -3542,7 +3548,7 @@ pcall(function()
end) end)
while not game:GetService "Teams" do while not game:GetService "Teams" do
wait(1 / 30) wait()
debugprint "Waiting For Teams" debugprint "Waiting For Teams"
end end
for _, i in pairs(game.Teams:GetTeams()) do for _, i in pairs(game.Teams:GetTeams()) do
@ -3571,19 +3577,19 @@ IsPersonalServer = not not game.Workspace:FindFirstChild "PSVariable"
---------------------------- ----------------------------
--debug stuffs, will only run for 'newplayerlistisbad' --debug stuffs, will only run for 'newplayerlistisbad'
if -- if
LocalPlayer.Name == "newplayerlistisbad" -- LocalPlayer.Name == "newplayerlistisbad"
or LocalPlayer.Name == "imtotallyadmin" -- or LocalPlayer.Name == "imtotallyadmin"
then -- then
debugFrame.Parent = ScreenGui -- debugFrame.Parent = ScreenGui
Spawn(function() -- Spawn(function()
while true do -- while true do
local str_players = "" -- local str_players = ""
for _, i in pairs(game.Players:GetPlayers()) do -- for _, i in pairs(game.Players:GetPlayers()) do
str_players = str_players .. " " .. i.Name -- str_players ..= " " .. i.Name
end -- end
debugplayers.Text = str_players -- debugplayers.Text = str_players
wait(0.5) -- wait(0.5)
end -- end
end) -- end)
end -- end

View File

@ -1,8 +1,6 @@
-- RbxUtility -- RbxUtility
print "[Mercury]: Loaded corescript 60595411" print "[Mercury]: Loaded corescript 60595411"
local t = {}
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
@ -473,6 +471,8 @@ function Null()
end end
-------------------- End JSON Parser ------------------------ -------------------- End JSON Parser ------------------------
local t = {}
t.DecodeJSON = function(jsonString) t.DecodeJSON = function(jsonString)
pcall(function() pcall(function()
warn "RbxUtility.DecodeJSON is deprecated, please use Game:GetService('HttpService'):JSONDecode() instead." warn "RbxUtility.DecodeJSON is deprecated, please use Game:GetService('HttpService'):JSONDecode() instead."
@ -614,7 +614,7 @@ t.SelectTerrainRegion = function(
end end
-- iterates through all current adornments and deletes any that don't have latest tag -- iterates through all current adornments and deletes any that don't have latest tag
function cleanUpAdornments() local function cleanUpAdornments()
for cellPos, adornTable in pairs(adornments) do for cellPos, adornTable in pairs(adornments) do
if adornTable.KeepAlive ~= currentKeepAliveTag then -- old news, we should get rid of this if adornTable.KeepAlive ~= currentKeepAliveTag then -- old news, we should get rid of this
adornTable.SelectionBox.Visible = false adornTable.SelectionBox.Visible = false
@ -628,7 +628,7 @@ t.SelectTerrainRegion = function(
end end
-- helper function to update tag -- helper function to update tag
function incrementAliveCounter() local function incrementAliveCounter()
aliveCounter += 1 aliveCounter += 1
if aliveCounter > 1000000 then if aliveCounter > 1000000 then
aliveCounter = 0 aliveCounter = 0
@ -637,7 +637,7 @@ t.SelectTerrainRegion = function(
end end
-- finds full cells in region and adorns each cell with a box, with the argument color -- finds full cells in region and adorns each cell with a box, with the argument color
function adornFullCellsInRegion(region, color) local function adornFullCellsInRegion(region, color)
local regionBegin = region.CFrame.p local regionBegin = region.CFrame.p
- (region.Size / 2) - (region.Size / 2)
+ Vector3.new(2, 2, 2) + Vector3.new(2, 2, 2)
@ -1037,26 +1037,6 @@ end
-------------------------------------------------Create function End---------------------------------------------------- -------------------------------------------------Create function End----------------------------------------------------
-- Lmao time - Heliodex
function t.HttpGet(url: string)
return game:HttpGet(url)
end
function t.HttpGetAsync(url: string)
return game:HttpGetAsync(url)
end
function t.HttpPost(url: string)
return game:HttpPost(url)
end
function t.HttpPostAsync(url: string)
return game:HttpPostAsync(url)
end
-- Lmao time end
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------

View File

@ -57,11 +57,10 @@ function GetTerrainForMouse(mouse)
local cell = game.Workspace.Terrain:WorldToCellPreferSolid( local cell = game.Workspace.Terrain:WorldToCellPreferSolid(
Vector3.new(mouse.hit.x, mouse.hit.y, mouse.hit.z) Vector3.new(mouse.hit.x, mouse.hit.y, mouse.hit.z)
) )
local planeLoc
-- If nothing was hit, do the plane intersection. -- If nothing was hit, do the plane intersection.
if 0 == game.Workspace.Terrain:GetCell(cell.X, cell.Y, cell.Z).Value then if 0 == game.Workspace.Terrain:GetCell(cell.X, cell.Y, cell.Z).Value then
cell = nil cell = nil
planeLoc, hit = PlaneIntersection( local planeLoc, hit = PlaneIntersection(
Vector3.new(mouse.hit.x, mouse.hit.y, mouse.hit.z) Vector3.new(mouse.hit.x, mouse.hit.y, mouse.hit.z)
) )
if hit then if hit then
@ -110,8 +109,10 @@ local function collectParts(object, baseParts, scripts, decals)
end end
end end
local cluster
local function clusterPartsInRegion(startVector, endVector) local function clusterPartsInRegion(startVector, endVector)
local cluster = game.Workspace:FindFirstChild "Terrain" cluster = game.Workspace:FindFirstChild "Terrain"
local startCell = cluster:WorldToCell(startVector) local startCell = cluster:WorldToCell(startVector)
local endCell = cluster:WorldToCell(endVector) local endCell = cluster:WorldToCell(endVector)
@ -1009,6 +1010,8 @@ t.SetupStamperDragger = function(
return nil return nil
end end
local configFound, targetCFrame, targetSurface
local stampInModel local stampInModel
local allowedStampRegion local allowedStampRegion
local stampFailedFunc local stampFailedFunc
@ -1486,9 +1489,9 @@ t.SetupStamperDragger = function(
end end
end) end)
then then
error "Error: RbxStamper.DoStamperMouseMove Mouse is nil on second check"
game.JointsService:ClearJoinAfterMoveJoints() game.JointsService:ClearJoinAfterMoveJoints()
Mouse = nil Mouse = nil
error "Error: RbxStamper.DoStamperMouseMove Mouse is nil on second check"
return return
end end
@ -1842,7 +1845,7 @@ t.SetupStamperDragger = function(
end end
-- After rotating, update the position -- After rotating, update the position
local configFound, targetCFrame = configFound, targetCFrame =
findConfigAtMouseTarget(Mouse, stampData) findConfigAtMouseTarget(Mouse, stampData)
if configFound then if configFound then
stampData.CurrentParts = stampData.CurrentParts =
@ -1973,7 +1976,7 @@ t.SetupStamperDragger = function(
local function ResolveMegaClusterStamp(checkHighScalabilityStamp) local function ResolveMegaClusterStamp(checkHighScalabilityStamp)
local cellSet = false local cellSet = false
local cluster = game.Workspace.Terrain cluster = game.Workspace.Terrain
local line = HighScalabilityLine.InternalLine local line = HighScalabilityLine.InternalLine
local cMax = game.Workspace.Terrain.MaxExtents.Max local cMax = game.Workspace.Terrain.MaxExtents.Max
@ -2418,7 +2421,7 @@ t.SetupStamperDragger = function(
HighScalabilityLine.Start = nil HighScalabilityLine.Start = nil
HighScalabilityLine.Adorn.Parent = nil HighScalabilityLine.Adorn.Parent = nil
local cluster = game.Workspace.Terrain cluster = game.Workspace.Terrain
-- if target point is in cluster, just use cluster:SetCell -- if target point is in cluster, just use cluster:SetCell
if isMegaClusterPart() then if isMegaClusterPart() then
@ -2563,9 +2566,11 @@ t.SetupStamperDragger = function(
end end
-- if it's a model, we also want to fill in the playerID and playerName tags, if it has those (e.g. for the friend-only door) -- if it's a model, we also want to fill in the playerID and playerName tags, if it has those (e.g. for the friend-only door)
playerIdTag = stampData.CurrentParts:FindFirstChild "PlayerIdTag" local playerIdTag = stampData.CurrentParts:FindFirstChild "PlayerIdTag"
playerNameTag = local playerNameTag =
stampData.CurrentParts:FindFirstChild "PlayerNameTag" stampData.CurrentParts:FindFirstChild "PlayerNameTag"
local tempPlayerValue
if playerIdTag ~= nil then if playerIdTag ~= nil then
tempPlayerValue = getPlayer() tempPlayerValue = getPlayer()
if tempPlayerValue ~= nil then if tempPlayerValue ~= nil then
@ -2763,7 +2768,7 @@ t.SetupStamperDragger = function(
end end
local function resumeStamper() local function resumeStamper()
clone, parts = prepareModel(modelToStamp) local clone, parts = prepareModel(modelToStamp)
if not clone or not parts then if not clone or not parts then
return return
@ -2799,7 +2804,7 @@ t.SetupStamperDragger = function(
end end
if clone:FindFirstChild("ClusterMaterial", true) then -- extract all info from vector if clone:FindFirstChild("ClusterMaterial", true) then -- extract all info from vector
clusterMaterial = clone:FindFirstChild("ClusterMaterial", true) local clusterMaterial = clone:FindFirstChild("ClusterMaterial", true)
if clusterMaterial:IsA "Vector3Value" then if clusterMaterial:IsA "Vector3Value" then
cellInfo.Material = clusterMaterial.Value.X cellInfo.Material = clusterMaterial.Value.X
cellInfo.clusterType = clusterMaterial.Value.Y cellInfo.clusterType = clusterMaterial.Value.Y