diff --git a/Libraries/Fusion/Animation/springCoefficients.luau b/Libraries/Fusion/Animation/springCoefficients.luau index e49b60c..0572f59 100644 --- a/Libraries/Fusion/Animation/springCoefficients.luau +++ b/Libraries/Fusion/Animation/springCoefficients.luau @@ -60,9 +60,9 @@ local function springCoefficients( -- factored out of the solutions to the characteristic equation: -- α = Sqrt[1 - ζ^2] -- x[t] -> x0(e^-tζω)(α Cos[tα] + ζω Sin[tα])/α - -- + v0(e^-tζω)(Sin[tα])/α + -- + v0(e^-tζω)(Sin[tα])/α -- v[t] -> x0(-e^-tζω)(α^2 + ζ^2 ω^2)(Sin[tα])/α - -- + v0(e^-tζω)(α Cos[tα] - ζω Sin[tα])/α + -- + v0(e^-tζω)(α Cos[tα] - ζω Sin[tα])/α local scaledTime = time * speed local alpha = math.sqrt(1 - damping ^ 2) diff --git a/Libraries/Fusion/External.luau b/Libraries/Fusion/External.luau index d620f8c..7a8cdb1 100644 --- a/Libraries/Fusion/External.luau +++ b/Libraries/Fusion/External.luau @@ -1,7 +1,7 @@ --!strict --[[ - Abstraction layer between Fusion internals and external environments, - allowing for flexible integration with schedulers and test mocks. + Abstraction layer between Fusion internals and external environments, + allowing for flexible integration with schedulers and test mocks. ]] local logError = require "./Logging/logError" @@ -20,8 +20,8 @@ local currentScheduler: Scheduler? = nil local lastUpdateStep = 0 --[[ - Sets the external scheduler that Fusion will use for queuing async tasks. - Returns the previous scheduler so it can be reset later. + Sets the external scheduler that Fusion will use for queuing async tasks. + Returns the previous scheduler so it can be reset later. ]] function External.setExternalScheduler(newScheduler: Scheduler?): Scheduler? local oldScheduler = currentScheduler @@ -36,7 +36,7 @@ function External.setExternalScheduler(newScheduler: Scheduler?): Scheduler? end --[[ - Sends an immediate task to the external scheduler. Throws if none is set. + Sends an immediate task to the external scheduler. Throws if none is set. ]] function External.doTaskImmediate(resume: () -> ()) if currentScheduler == nil then @@ -47,7 +47,7 @@ function External.doTaskImmediate(resume: () -> ()) end --[[ - Sends a deferred task to the external scheduler. Throws if none is set. + Sends a deferred task to the external scheduler. Throws if none is set. ]] function External.doTaskDeferred(resume: () -> ()) if currentScheduler == nil then @@ -58,14 +58,14 @@ function External.doTaskDeferred(resume: () -> ()) end --[[ - Registers a callback to the update step of the external scheduler. - Returns a function that can be used to disconnect later. + Registers a callback to the update step of the external scheduler. + Returns a function that can be used to disconnect later. - Callbacks are given the current number of seconds since an arbitrary epoch. - - TODO: This epoch may change between schedulers. We could investigate ways - of allowing schedulers to co-operate to keep the epoch the same, so that - monotonicity can be better preserved. + Callbacks are given the current number of seconds since an arbitrary epoch. + + TODO: This epoch may change between schedulers. We could investigate ways + of allowing schedulers to co-operate to keep the epoch the same, so that + monotonicity can be better preserved. ]] function External.bindToUpdateStep(callback: (now: number) -> ()): () -> () local uniqueIdentifier = {} @@ -76,9 +76,9 @@ function External.bindToUpdateStep(callback: (now: number) -> ()): () -> () end --[[ - Steps time-dependent systems with the current number of seconds since an - arbitrary epoch. This should be called as early as possible in the external - scheduler's update cycle. + Steps time-dependent systems with the current number of seconds since an + arbitrary epoch. This should be called as early as possible in the external + scheduler's update cycle. ]] function External.performUpdateStep(now: number) lastUpdateStep = now @@ -88,7 +88,7 @@ function External.performUpdateStep(now: number) end --[[ - Returns the timestamp of the last update step. + Returns the timestamp of the last update step. ]] function External.lastUpdateStep() return lastUpdateStep diff --git a/Libraries/Fusion/Instances/Children.luau b/Libraries/Fusion/Instances/Children.luau index 8cf161b..0b5503f 100644 --- a/Libraries/Fusion/Instances/Children.luau +++ b/Libraries/Fusion/Instances/Children.luau @@ -136,7 +136,7 @@ function Children:apply( end end - queueUpdate = function() + function queueUpdate() if not updateQueued then updateQueued = true External.doTaskDeferred(updateChildren) diff --git a/Libraries/Fusion/MercuryExternal.luau b/Libraries/Fusion/MercuryExternal.luau index 4a9c412..e65f94e 100644 --- a/Libraries/Fusion/MercuryExternal.luau +++ b/Libraries/Fusion/MercuryExternal.luau @@ -1,6 +1,6 @@ --!strict --[[ - Mercury implementation for Fusion's abstract scheduler layer. + Mercury implementation for Fusion's abstract scheduler layer. ]] local RunService = game:GetService "RunService" @@ -10,28 +10,28 @@ local External = require "./External" local MercuryExternal = {} --[[ - Sends an immediate task to the external scheduler. Throws if none is set. + Sends an immediate task to the external scheduler. Throws if none is set. ]] function MercuryExternal.doTaskImmediate(resume: () -> ()) Spawn(resume) end --[[ - Sends a deferred task to the external scheduler. Throws if none is set. + Sends a deferred task to the external scheduler. Throws if none is set. ]] function MercuryExternal.doTaskDeferred(resume: () -> ()) coroutine.resume(coroutine.create(resume)) end --[[ - Sends an update step to Fusion using the Mercury clock time. + Sends an update step to Fusion using the Mercury clock time. ]] local function performUpdateStep() External.performUpdateStep(time()) end --[[ - Binds Fusion's update step to RunService step events. + Binds Fusion's update step to RunService step events. ]] local stopSchedulerFunc: () -> ()? = nil function MercuryExternal.startScheduler() @@ -47,23 +47,23 @@ function MercuryExternal.startScheduler() -- Enum.RenderPriority.First.Value, -- performUpdateStep -- ) - -- stopSchedulerFunc = function() + -- function stopSchedulerFunc() -- RunService:UnbindFromRenderStep(id) -- end local conn = RunService.RenderStepped:connect(performUpdateStep) - stopSchedulerFunc = function() + function stopSchedulerFunc() conn:disconnect() end -- else -- local connection = RunService.Heartbeat:connect(performUpdateStep) - -- stopSchedulerFunc = function() + -- function stopSchedulerFunc() -- connection:Disconnect() -- end -- end end --[[ - Unbinds Fusion's update step from RunService step events. + Unbinds Fusion's update step from RunService step events. ]] function MercuryExternal.stopScheduler() if stopSchedulerFunc ~= nil then diff --git a/Libraries/Fusion/Utility/Contextual.luau b/Libraries/Fusion/Utility/Contextual.luau index a991647..a853c10 100644 --- a/Libraries/Fusion/Utility/Contextual.luau +++ b/Libraries/Fusion/Utility/Contextual.luau @@ -1,7 +1,7 @@ --!strict --[[ - Time-based contextual values, to allow for transparently passing values down + Time-based contextual values, to allow for transparently passing values down the call stack. ]] diff --git a/Libraries/Fusion/Utility/isSimilar.luau b/Libraries/Fusion/Utility/isSimilar.luau index 7767369..07ced13 100644 --- a/Libraries/Fusion/Utility/isSimilar.luau +++ b/Libraries/Fusion/Utility/isSimilar.luau @@ -1,7 +1,7 @@ --!strict --[[ - Returns true if A and B are 'similar' - ie. any user of A would not need - to recompute if it changed to B. + Returns true if A and B are 'similar' - ie. any user of A would not need + to recompute if it changed to B. ]] local function isSimilar(a: any, b: any): boolean diff --git a/Libraries/Fusion/Utility/needsDestruction.luau b/Libraries/Fusion/Utility/needsDestruction.luau index 6e265b7..72f7905 100644 --- a/Libraries/Fusion/Utility/needsDestruction.luau +++ b/Libraries/Fusion/Utility/needsDestruction.luau @@ -1,8 +1,8 @@ --!strict --[[ - Returns true if the given value is not automatically memory managed, and - requires manual cleanup. + Returns true if the given value is not automatically memory managed, and + requires manual cleanup. ]] local typeof = require "../../../Modules/Polyfill/typeof" diff --git a/Libraries/Red/Net/Event.luau b/Libraries/Red/Net/Event.luau index bc325ea..2210292 100644 --- a/Libraries/Red/Net/Event.luau +++ b/Libraries/Red/Net/Event.luau @@ -29,7 +29,7 @@ return function(IsServer: boolean) function(SingleFire, MultipleFire, IncomingCall) -- debug.profilebegin "Red.Listen.Incoming" - -- replace nil symbols with nil + -- replace nil symbols with nil if SingleFire.__nil then SingleFire = nil end @@ -166,7 +166,7 @@ return function(IsServer: boolean) function(Player, SingleFire, MultipleFire, IncomingCall) -- debug.profilebegin "Red.Listen.Incoming" - -- replace nil symbols with nil + -- replace nil symbols with nil if SingleFire.__nil then SingleFire = nil end diff --git a/Libraries/Red/init.luau b/Libraries/Red/init.luau index 2526cb4..a6c8262 100644 --- a/Libraries/Red/init.luau +++ b/Libraries/Red/init.luau @@ -28,8 +28,8 @@ local function Red(_, Script: LuaSourceContainer) end return { + Load = Red, Help = function() return "See https://redblox.dev/ for more information." end, - Load = Red, } diff --git a/Modules/BaseUrl.luau b/Modules/BaseUrl.luau new file mode 100644 index 0000000..7018912 --- /dev/null +++ b/Modules/BaseUrl.luau @@ -0,0 +1,2 @@ +local ContentProvider = game:GetService "ContentProvider" + diff --git a/Modules/Logger.luau b/Modules/Logger.luau index 1ef6b9d..02c8a5f 100644 --- a/Modules/Logger.luau +++ b/Modules/Logger.luau @@ -1,7 +1,7 @@ local logEvent return function(...: string) - if game.Players.LocalPlayer.Name ~= "Heliodex" then + if game.Players.LocalPlayer.Name ~= "Heliodex" then -- hehuhuhuehuehe return end diff --git a/Modules/Polyfill/easing.luau b/Modules/Polyfill/easing.luau index 33a1ce7..7b83c41 100644 --- a/Modules/Polyfill/easing.luau +++ b/Modules/Polyfill/easing.luau @@ -31,7 +31,7 @@ local easing = { Bounce = {}, } -local linear = function(t, b, c) +local function linear(t, b, c) return c * t + b end @@ -40,15 +40,15 @@ easing.Linear.Out = linear easing.Linear.InOut = linear easing.Linear.OutIn = linear -easing.Quad.In = function(t, b, c) +function easing.Quad.In(t, b, c) return c * pow(t, 2) + b end -easing.Quad.Out = function(t, b, c) +function easing.Quad.Out(t, b, c) return -c * t * (t - 2) + b end -easing.Quad.InOut = function(t, b, c) +function easing.Quad.InOut(t, b, c) t *= 2 if t < 1 then return c / 2 * pow(t, 2) + b @@ -56,23 +56,23 @@ easing.Quad.InOut = function(t, b, c) return -c / 2 * ((t - 1) * (t - 3) - 1) + b end -easing.Quad.OutIn = function(t, b, c) +function easing.Quad.OutIn(t, b, c) if t < 0.5 then return easing.Quad.Out(t * 2, b, c / 2) end return easing.Quad.In((t * 2) - 1, b + c / 2, c / 2) end -easing.Cubic.In = function(t, b, c) +function easing.Cubic.In(t, b, c) return c * pow(t, 3) + b end -easing.Cubic.Out = function(t, b, c) +function easing.Cubic.Out(t, b, c) t -= 1 return c * (pow(t, 3) + 1) + b end -easing.Cubic.InOut = function(t, b, c) +function easing.Cubic.InOut(t, b, c) t *= 2 if t < 1 then return c / 2 * t * t * t + b @@ -81,23 +81,23 @@ easing.Cubic.InOut = function(t, b, c) return c / 2 * (t * t * t + 2) + b end -easing.Cubic.OutIn = function(t, b, c) +function easing.Cubic.OutIn(t, b, c) if t < 0.5 then return easing.Cubic.Out(t * 2, b, c / 2) end return easing.Cubic.In((t * 2) - 1, b + c / 2, c / 2) end -easing.Quart.In = function(t, b, c) +function easing.Quart.In(t, b, c) return c * pow(t, 4) + b end -easing.Quart.Out = function(t, b, c) +function easing.Quart.Out(t, b, c) t -= 1 return -c * (pow(t, 4) - 1) + b end -easing.Quart.InOut = function(t, b, c) +function easing.Quart.InOut(t, b, c) t *= 2 if t < 1 then return c / 2 * pow(t, 4) + b @@ -106,23 +106,23 @@ easing.Quart.InOut = function(t, b, c) return -c / 2 * (pow(t, 4) - 2) + b end -easing.Quart.OutIn = function(t, b, c) +function easing.Quart.OutIn(t, b, c) if t < 0.5 then return easing.Quart.Out(t * 2, b, c / 2) end return easing.Quart.In((t * 2) - 1, b + c / 2, c / 2) end -easing.Quint.In = function(t, b, c) +function easing.Quint.In(t, b, c) return c * pow(t, 5) + b end -easing.Quint.Out = function(t, b, c) +function easing.Quint.Out(t, b, c) t -= 1 return c * (pow(t, 5) + 1) + b end -easing.Quint.InOut = function(t, b, c) +function easing.Quint.InOut(t, b, c) t *= 2 if t < 1 then return c / 2 * pow(t, 5) + b @@ -131,47 +131,47 @@ easing.Quint.InOut = function(t, b, c) return c / 2 * (pow(t, 5) + 2) + b end -easing.Quint.OutIn = function(t, b, c) +function easing.Quint.OutIn(t, b, c) if t < 0.5 then return easing.Quint.Out(t * 2, b, c / 2) end return easing.Quint.In((t * 2) - 1, b + c / 2, c / 2) end -easing.Sine.In = function(t, b, c) +function easing.Sine.In(t, b, c) return -c * cos(t * (pi / 2)) + c + b end -easing.Sine.Out = function(t, b, c) +function easing.Sine.Out(t, b, c) return c * sin(t * (pi / 2)) + b end -easing.Sine.InOut = function(t, b, c) +function easing.Sine.InOut(t, b, c) return -c / 2 * (cos(pi * t) - 1) + b end -easing.Sine.OutIn = function(t, b, c) +function easing.Sine.OutIn(t, b, c) if t < 0.5 then return easing.Sine.Out(t * 2, b, c / 2) end return easing.Sine.In((t * 2) - 1, b + c / 2, c / 2) end -easing.Exponential.In = function(t, b, c) +function easing.Exponential.In(t, b, c) if t == 0 then return b end return c * pow(2, 10 * (t - 1)) + b - c * 0.001 end -easing.Exponential.Out = function(t, b, c) +function easing.Exponential.Out(t, b, c) if t == 1 then return b + c end return c * 1.001 * (-pow(2, -10 * t) + 1) + b end -easing.Exponential.InOut = function(t, b, c) +function easing.Exponential.InOut(t, b, c) if t == 0 then return b elseif t == 1 then @@ -185,23 +185,23 @@ easing.Exponential.InOut = function(t, b, c) return c / 2 * 1.0005 * (-pow(2, -10 * t) + 2) + b end -easing.Exponential.OutIn = function(t, b, c) +function easing.Exponential.OutIn(t, b, c) if t < 0.5 then return t.Exponential.Out(t * 2, b, c / 2) end return t.Exponential.In((t * 2) - 1, b + c / 2, c / 2) end -easing.Circular.In = function(t, b, c) +function easing.Circular.In(t, b, c) return (-c * (sqrt(1 - pow(t, 2)) - 1) + b) end -easing.Circular.Out = function(t, b, c) +function easing.Circular.Out(t, b, c) t -= 1 return (c * sqrt(1 - pow(t, 2)) + b) end -easing.Circular.InOut = function(t, b, c) +function easing.Circular.InOut(t, b, c) t *= 2 if t < 1 then return -c / 2 * (sqrt(1 - t * t) - 1) + b @@ -210,14 +210,14 @@ easing.Circular.InOut = function(t, b, c) return c / 2 * (sqrt(1 - t * t) + 1) + b end -easing.Circular.OutIn = function(t, b, c) +function easing.Circular.OutIn(t, b, c) if t < 0.5 then return easing.Circular.Out(t * 2, b, c / 2) end return easing.Circular.In((t * 2) - 1, b + c / 2, c / 2) end -easing.Elastic.In = function(t, b, c) --, a, p) +function easing.Elastic.In(t, b, c) --, a, p) if t == 0 then return b elseif t == 1 then @@ -234,7 +234,7 @@ easing.Elastic.In = function(t, b, c) --, a, p) return -(c * pow(2, 10 * t) * sin((t * 1 - s) * (2 * pi) / p)) + b end -easing.Elastic.Out = function(t, b, c) --, a, p) +function easing.Elastic.Out(t, b, c) --, a, p) if t == 0 then return b elseif t == 1 then @@ -248,7 +248,7 @@ easing.Elastic.Out = function(t, b, c) --, a, p) return c * pow(2, -10 * t) * sin((t - s) * (2 * pi) / p) + c + b end -easing.Elastic.InOut = function(t, b, c) --, a, p) +function easing.Elastic.InOut(t, b, c) --, a, p) if t == 0 then return b end @@ -277,25 +277,25 @@ easing.Elastic.InOut = function(t, b, c) --, a, p) return a * pow(2, -10 * t) * sin((t - s) * (2 * pi) / p) * 0.5 + c + b end -easing.Elastic.OutIn = function(t, b, c) --, a, p) +function easing.Elastic.OutIn(t, b, c) --, a, p) if t < 0.5 then return easing.Elastic.Out(t * 2, b, c / 2) end return easing.Elastic.In((t * 2) - 1, b + c / 2, c / 2) end -easing.Back.In = function(t, b, c) --, s) +function easing.Back.In(t, b, c) --, s) local s = 1.70158 return c * t * t * ((s + 1) * t - s) + b end -easing.Back.Out = function(t, b, c) --, s) +function easing.Back.Out(t, b, c) --, s) local s = 1.70158 t -= 1 return c * (t * t * ((s + 1) * t + s) + 1) + b end -easing.Back.InOut = function(t, b, c) --, s) +function easing.Back.InOut(t, b, c) --, s) local s = 2.5949095 t *= 2 if t < 1 then @@ -305,14 +305,14 @@ easing.Back.InOut = function(t, b, c) --, s) return c / 2 * (t * t * ((s + 1) * t + s) + 2) + b end -easing.Back.OutIn = function(t, b, c) --, s) +function easing.Back.OutIn(t, b, c) --, s) if t < 0.5 then return easing.Back.Out(t * 2, b, c / 2) end return easing.Back.In((t * 2) - 1, b + c / 2, c / 2) end -easing.Bounce.Out = function(t, b, c) +function easing.Bounce.Out(t, b, c) if t < 1 / 2.75 then return c * (7.5625 * t * t) + b elseif t < 2 / 2.75 then @@ -326,18 +326,18 @@ easing.Bounce.Out = function(t, b, c) return c * (7.5625 * t * t + 0.984375) + b end -easing.Bounce.In = function(t, b, c) +function easing.Bounce.In(t, b, c) return c - easing.Bounce.Out(1 - t, 0, c) + b end -easing.Bounce.InOut = function(t, b, c) +function easing.Bounce.InOut(t, b, c) if t < 0.5 then return easing.Bounce.In(t * 2, 0, c) * 0.5 + b end return easing.Bounce.Out(t * 2 - 1, 0, c) * 0.5 + c * 0.5 + b end -easing.Bounce.OutIn = function(t, b, c) +function easing.Bounce.OutIn(t, b, c) if t < 0.5 then return easing.Bounce.Out(t * 2, b, c / 2) end diff --git a/luau/107893730.luau b/luau/107893730.luau index 303dc1a..1be481f 100644 --- a/luau/107893730.luau +++ b/luau/107893730.luau @@ -1,5 +1,5 @@ --!strict --- CoreGui.RobloxGui.CoreScripts/PurchasePromptScript +-- CoreGui.MercuryGui.CoreScripts/PurchasePromptScript print "[Mercury]: Loaded corescript 107893730" -- this script creates the gui and sends the web requests for in game purchase prompts @@ -12,9 +12,6 @@ local MarketplaceService = game:GetService "MarketplaceService" local RunService = game:GetService "RunService" -- wait for important items to appear -while not Game do - RunService.Heartbeat:wait() -end while not MarketplaceService do RunService.Heartbeat:wait() MarketplaceService = game:GetService "MarketplaceService" @@ -22,7 +19,7 @@ end while not game:FindFirstChild "CoreGui" do RunService.Heartbeat:wait() end -while not game.CoreGui:FindFirstChild "RobloxGui" do +while not game.CoreGui:FindFirstChild "MercuryGui" do RunService.Heartbeat:wait() end @@ -73,7 +70,7 @@ local takeHeaderText = "Take" local buyFailedHeaderText = "An Error Occurred" local errorPurchasesDisabledText = "in-game purchases are disabled" -local errorPurchasesUnknownText = "Roblox is performing maintenance" +local errorPurchasesUnknownText = "Mercury is performing maintenance" local purchaseSucceededText = "Your purchase of itemName succeeded!" local purchaseFailedText = @@ -492,7 +489,7 @@ local function canPurchaseItem() if purchasingConsumable then local currentProductInfoRaw ok = ypcall(function() - currentProductInfoRaw = Game:HttpGetAsync( + currentProductInfoRaw = game:HttpGetAsync( `{getSecureApiBaseUrl()}marketplace/productDetails?productid={currentProductId}` ) end) @@ -849,9 +846,9 @@ local function acceptPurchase() -- consumables need to use a different url if purchasingConsumable then - url ..= `submitpurchase?productId={currentProductId}{currencyData}&expectedUnitPrice={currentCurrencyAmount}&placeId={Game.PlaceId}` + url ..= `submitpurchase?productId={currentProductId}{currencyData}&expectedUnitPrice={currentCurrencyAmount}&placeId={game.PlaceId}` else - url ..= `purchase?productId={currentProductId}{currencyData}&purchasePrice={currentCurrencyAmount}&locationType=Game&locationId={Game.PlaceId}` + url ..= `purchase?productId={currentProductId}{currencyData}&purchasePrice={currentCurrencyAmount}&locationType=Game&locationId={game.PlaceId}` end local ok, reason = ypcall(function() @@ -859,12 +856,7 @@ local function acceptPurchase() end) -- debug output for us (found in the logs from local) - print( - "acceptPurchase success from ypcall is ", - ok, - "reason is", - reason - ) + print("acceptPurchase success from ypcall is ", ok, "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)... @@ -877,7 +869,7 @@ local function acceptPurchase() currentAssetId, currentProductId ) - purchaseFailed() + purchaseFailed(false) return end @@ -891,7 +883,7 @@ local function acceptPurchase() currentAssetId, currentProductId ) - purchaseFailed((response.status == "EconomyDisabled")) + purchaseFailed(response.status == "EconomyDisabled") return end else @@ -899,7 +891,7 @@ local function acceptPurchase() "web return response of non parsable JSON on purchase of", currentAssetId ) - purchaseFailed() + purchaseFailed(false) return end @@ -922,7 +914,7 @@ local function acceptPurchase() "tried to buy productId, but no receipt returned. productId was", currentProductId ) - purchaseFailed() + purchaseFailed(false) return end MarketplaceService:SignalClientPurchaseSuccess( @@ -1038,7 +1030,7 @@ local function createPurchasePromptGui() 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 + purchaseDialog.Parent = game.CoreGui.MercuryGui local bodyFrame = Instance.new "Frame" bodyFrame.Name = "BodyFrame" @@ -1248,7 +1240,7 @@ local function createPurchasePromptGui() end local function doPurchasePrompt( - player, + player: Player, assetId, equipIfPurchased, currencyType, @@ -1279,7 +1271,7 @@ end local function doProcessServerPurchaseResponse(serverResponseTable) if not serverResponseTable then print "Server response table was nil, cancelling purchase" - purchaseFailed() + purchaseFailed(false) return end diff --git a/luau/20000001.luau b/luau/20000001.luau index 3b6a7c9..67d0273 100644 --- a/luau/20000001.luau +++ b/luau/20000001.luau @@ -6,7 +6,7 @@ local Players = game:GetService "Players" local RunService = game:GetService "RunService" local MaxLength = 35 -local New = (require "../Modules/New").New +local New = require("../Modules/New").New local logEvent: BindableEvent @@ -248,7 +248,7 @@ end function utility.exit() logEvent:Fire("Goodbye!", Color3.new(1, 1, 0.3)) - for i = 1, MaxLength do + for _ = 1, MaxLength do logEvent:Fire() RunService.RenderStepped:wait() end diff --git a/luau/36868950.luau b/luau/36868950.luau index 5c49f32..90ef392 100644 --- a/luau/36868950.luau +++ b/luau/36868950.luau @@ -1,5 +1,5 @@ --!strict --- CoreGui.RobloxGui.CoreScripts/ToolTip +-- CoreGui.MercuryGui.CoreScripts/ToolTip print "[Mercury]: Loaded corescript 36868950" local News = require "../Modules/New" @@ -8,8 +8,8 @@ local Hydrate = News.Hydrate local RunService = game:GetService "RunService" -local RobloxGui = script.Parent -local controlFrame = RobloxGui:FindFirstChild "ControlFrame" +local MercuryGui = script.Parent :: ScreenGui +local controlFrame = MercuryGui:FindFirstChild "ControlFrame" if not controlFrame then return diff --git a/luau/37801172.luau b/luau/37801172.luau index 0c0dac8..37493da 100644 --- a/luau/37801172.luau +++ b/luau/37801172.luau @@ -36,9 +36,10 @@ local screenGui = CoreGui:FindFirstChild "RobloxGui" :: ScreenGui & { Backpack: Frame, CurrentLoadout: Frame, } +screenGui.Name = "MercuryGui" -- lmao lel lol lmfao local scripts = { - [36868950] = "CoreScripts/ToolTip", -- ToolTipper (creates tool tips for gui) + [36868950] = "CoreScripts/ToolTip", -- ToolTipper (creates tool tips for gui) [46295863] = "CoreScripts/Settings", -- SettingsScript [39250920] = "CoreScripts/MainBotChatScript", -- MainBotChatScript [48488451] = "CoreScripts/PopupScript", -- Popup Script diff --git a/luau/39250920.luau b/luau/39250920.luau index 4379041..88d1b83 100644 --- a/luau/39250920.luau +++ b/luau/39250920.luau @@ -1,5 +1,5 @@ --!strict --- CoreGui.RobloxGui.CoreScripts/MainBotChatScript +-- CoreGui.MercuryGui.CoreScripts/MainBotChatScript print "[Mercury]: Loaded corescript 39250920" local News = require "../Modules/New" @@ -42,11 +42,11 @@ local dialogConnections = {} local gui waitForChild(game, "CoreGui") -waitForChild(game.CoreGui, "RobloxGui") -if game.CoreGui.RobloxGui:FindFirstChild "ControlFrame" then - gui = game.CoreGui.RobloxGui.ControlFrame +waitForChild(game.CoreGui, "MercuryGui") +if game.CoreGui.MercuryGui:FindFirstChild "ControlFrame" then + gui = game.CoreGui.MercuryGui.ControlFrame else - gui = game.CoreGui.RobloxGui + gui = game.CoreGui.MercuryGui end local function currentTone() @@ -302,7 +302,7 @@ local function presentDialogChoices(talkingPart, dialogChoices) end lastChoice.Position = UDim2.new(0, 0, 0, yPosition) - lastChoice.Number.Text = `{pos})` + lastChoice.Number.Text = pos .. ")" mainFrame.Size = UDim2.new(0, 350, 0, yPosition + 24 + 32) mainFrame.Position = UDim2.new(0, 20, 0, -mainFrame.Size.Y.Offset - 20) diff --git a/luau/45284430.luau b/luau/45284430.luau index 63579fe..ed4151b 100644 --- a/luau/45284430.luau +++ b/luau/45284430.luau @@ -24,13 +24,11 @@ local function ScopedConnect( --Connection on parentInstance is scoped by parentInstance (when destroyed, it goes away) local function tryConnect() - if game:IsAncestorOf(parentInstance) then + if game:IsAncestorOf(parentInstance) and not eventConnection then --Entering the world, make sure we are connected/synced - if not eventConnection then - eventConnection = instance[event]:connect(signalFunc) - if syncFunc then - syncFunc() - end + eventConnection = instance[event]:connect(signalFunc) + if syncFunc then + syncFunc() end else --Probably leaving the world, so disconnect for now @@ -375,7 +373,7 @@ function RbxGui.CreateDropDownMenu( end local scrollBarPosition = 1 - local updateScroll = function() + local function updateScroll() if scrollUpButton then scrollUpButton.Active = scrollBarPosition > 1 end @@ -414,7 +412,7 @@ function RbxGui.CreateDropDownMenu( end end end - local toggleVisibility = function() + local function toggleVisibility() dropDownSelected = not dropDownSelected areaSoak.Visible = not areaSoak.Visible @@ -431,7 +429,7 @@ function RbxGui.CreateDropDownMenu( end droppedDownMenu.MouseButton1Click:connect(toggleVisibility) - local updateSelection = function(text) + local function updateSelection(text) local foundItem = false local children = droppedDownMenu:GetChildren() local childNum = 1 @@ -819,7 +817,7 @@ function RbxGui.LayoutGuiObjects(frame, guiObjects, settingsTable) child.Parent = wrapperFrame end - local recalculate = function() + local function recalculate() RunService.Heartbeat:wait() layoutGuiObjectsHelper(wrapperFrame, guiObjects, settingsTable) end @@ -1167,22 +1165,18 @@ function RbxGui.CreateTrueScrollingFrame() end local function drillDownSetHighLow(instance: GuiObject) - if not instance or not instance:IsA "GuiObject" then + if + not instance + or not instance:IsA "GuiObject" + or instance == controlFrame + or instance:IsDescendantOf(controlFrame) + or not instance.Visible + then return - end - if instance == controlFrame then - return - end - if instance:IsDescendantOf(controlFrame) then - return - end - if not instance.Visible then - return - end - - if (lowY and lowY > instance.AbsolutePosition.Y) or not lowY then + elseif (lowY and lowY > instance.AbsolutePosition.Y) or not lowY then lowY = instance.AbsolutePosition.Y end + if ( highY @@ -1508,14 +1502,11 @@ function RbxGui.CreateTrueScrollingFrame() end local function descendantChanged(this, prop) - if internalChange then - return - end - if not this.Visible then - return - end - - if prop == "Size" or prop == "Position" then + if + not internalChange + and this.Visible + and (prop == "Size" or prop == "Position") + then RunService.Heartbeat:wait() highLowRecheck() end @@ -1524,9 +1515,7 @@ function RbxGui.CreateTrueScrollingFrame() scrollingFrame.DescendantAdded:connect(function(instance) if not instance:IsA "GuiObject" then return - end - - if instance.Visible then + elseif instance.Visible then RunService.Heartbeat:wait() -- wait a heartbeat for sizes to reconfig highLowRecheck() end @@ -1541,8 +1530,7 @@ function RbxGui.CreateTrueScrollingFrame() scrollingFrame.DescendantRemoving:connect(function(instance) if not instance:IsA "GuiObject" then return - end - if descendantsChangeConMap[instance] then + elseif descendantsChangeConMap[instance] then descendantsChangeConMap[instance]:disconnect() descendantsChangeConMap[instance] = nil end @@ -1551,11 +1539,7 @@ function RbxGui.CreateTrueScrollingFrame() end) scrollingFrame.Changed:connect(function(prop) - if prop == "AbsoluteSize" then - if not highY or not lowY then - return - end - + if prop == "AbsoluteSize" and not (highY and lowY) then highLowRecheck() setSliderSizeAndPosition() end @@ -1622,7 +1606,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle) local rowSize = 0 local howManyDisplayed = 0 - local layoutGridScrollBar = function() + local function layoutGridScrollBar() howManyDisplayed = 0 local guiObjects = {} if orderList then @@ -1805,7 +1789,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle) scrollDrag.Visible = scrollDrag.Active end - local layoutSimpleScrollBar = function() + local function layoutSimpleScrollBar() local guiObjects = {} howManyDisplayed = 0 @@ -1902,7 +1886,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle) scrollDrag.Visible = scrollDrag.Active end - local moveDragger = function() + local function moveDragger() local guiObjects = 0 local children = frame:GetChildren() if children then @@ -1952,7 +1936,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle) end local reentrancyGuard = false - local recalculate = function() + local function recalculate() if reentrancyGuard then return end @@ -1975,7 +1959,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle) reentrancyGuard = false end - local doScrollUp = function() + local function doScrollUp() scrollPosition -= rowSize if scrollPosition < 1 then scrollPosition = 1 @@ -1983,7 +1967,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle) recalculate() end - local doScrollDown = function() + local function doScrollDown() scrollPosition += rowSize recalculate() end @@ -2260,7 +2244,7 @@ function RbxGui.AutoTruncateTextObject(textLabel: TextLabel) end else local len = string.len(text) - textLabel.Text = `{text}~` + textLabel.Text = text .. "~" --Shrink the text local textSize = binaryGrow(0, len, function(pos) @@ -2268,7 +2252,7 @@ function RbxGui.AutoTruncateTextObject(textLabel: TextLabel) or string.sub(text, 1, pos) .. "~" return textLabel.TextFits end) - shortText = `{string.sub(text, 1, textSize)}~` + shortText = string.sub(text, 1, textSize) .. "~" textLabel.Text = shortText --Make sure the fullLabel fits @@ -2423,7 +2407,7 @@ function RbxGui.CreateTutorial(name, tutorialKey, createButtons: boolean) return visiblePage end - local showTutorial = function(alwaysShow) + local function showTutorial(alwaysShow) if alwaysShow or UserSettings().GameSettings:GetTutorialState(tutorialKey) @@ -2446,7 +2430,7 @@ function RbxGui.CreateTutorial(name, tutorialKey, createButtons: boolean) end end - local dismissTutorial = function() + local function dismissTutorial() local currentTutorialPage = getVisiblePageAndHideOthers() if currentTutorialPage then @@ -2461,7 +2445,7 @@ function RbxGui.CreateTutorial(name, tutorialKey, createButtons: boolean) UserSettings().GameSettings:SetTutorialState(tutorialKey, true) end - local gotoPage = function(pageNum) + local function gotoPage(pageNum) local page = pages:FindFirstChild("TutorialPage" .. pageNum) local currentTutorialPage = getVisiblePageAndHideOthers() TransitionTutorialPages( @@ -2647,7 +2631,7 @@ function RbxGui.CreateTextTutorialPage(name, text, skipTutorial) return frame end -RbxGui.CreateImageTutorialPage = function( +function RbxGui.CreateImageTutorialPage( name, imageAsset, x: number, @@ -2770,7 +2754,7 @@ function RbxGui.AddTutorialPage( tutorialPage.Parent = tutorial.Pages end -RbxGui.CreateSetPanel = function( +function RbxGui.CreateSetPanel( userIdsForSets, objectSelected, dialogClosed, @@ -3662,7 +3646,7 @@ RbxGui.CreateSetPanel = function( end end) - local setVisibilityFunction = function(visible) + local function setVisibilityFunction(visible) if visible then setGui.SetPanel.Visible = true else @@ -3670,7 +3654,7 @@ RbxGui.CreateSetPanel = function( end end - local getVisibilityFunction = function() + local function getVisibilityFunction() if setGui then if setGui:FindFirstChild "SetPanel" then return setGui.SetPanel.Visible @@ -3735,7 +3719,7 @@ for k, v in pairs(EnumMaterialNames) do StringChoices[v] = k end -RbxGui.CreateTerrainMaterialSelector = function(size, position) +function RbxGui.CreateTerrainMaterialSelector(size, position) local terrainMaterialSelectionChanged = Instance.new "BindableEvent" terrainMaterialSelectionChanged.Name = "TerrainMaterialSelectionChanged" @@ -3898,7 +3882,7 @@ RbxGui.CreateTerrainMaterialSelector = function(size, position) return frame, terrainMaterialSelectionChanged, forceTerrainMaterialSelection end -RbxGui.CreateLoadingFrame = function(name, size, position) +function RbxGui.CreateLoadingFrame(name, size, position) ContentProvider:Preload "http://banland.xyz/asset?id=35238053" local loadingFrame = New "Frame" { @@ -4285,11 +4269,8 @@ function RbxGui.CreatePluginFrame( Position = UDim2.new(1, 0, 0, 0), }, } - if size then - control.Size = UDim2.new(0, 21, size.Y.Scale, size.Y.Offset) - else - control.Size = UDim2.new(0, 21, 0, 400) - end + control.Size = size and UDim2.new(0, 21, size.Y.Scale, size.Y.Offset) + or UDim2.new(0, 21, 0, 400) control:FindFirstChild("ScrollDownButton").Position = UDim2.new(0, 0, 1, -20) @@ -4419,85 +4400,85 @@ function RbxGui.CreatePluginFrame( return dragBar, widgetContainer, helpFrame, closeEvent end -function RbxGui.Help(funcNameOrFunc) - --input argument can be a string or a function. Should return a description (of arguments and expected side effects) +function RbxGui.Help(funcNameOrFunc: string | (any) -> any) + -- input argument can be a string or a function. Should return a description (of arguments and expected side effects) if funcNameOrFunc == "CreatePropertyDropDownMenu" or funcNameOrFunc == RbxGui.CreatePropertyDropDownMenu then - return "Function CreatePropertyDropDownMenu. " - .. "Arguments: (instance, propertyName, enumType). " - .. "Side effect: returns a container with a drop-down-box that is linked to the 'property' field of 'instance' which is of type 'enumType'" + return [[Function CreatePropertyDropDownMenu. +Arguments: (instance, propertyName, enumType). +Side effect: returns a container with a drop-down-box that is linked to the 'property' field of 'instance' which is of type 'enumType']] elseif funcNameOrFunc == "CreateDropDownMenu" or funcNameOrFunc == RbxGui.CreateDropDownMenu then - return "Function CreateDropDownMenu. " - .. "Arguments: (items, onItemSelected). " - .. "Side effect: Returns 2 results, a container to the gui object and a 'updateSelection' function for external updating. The container is a drop-down-box created around a list of items" + return [[Function CreateDropDownMenu. +Arguments: (items, onItemSelected). +Side effect: Returns 2 results, a container to the gui object and a 'updateSelection' function for external updating. The container is a drop-down-box created around a list of items]] elseif funcNameOrFunc == "CreateMessageDialog" or funcNameOrFunc == RbxGui.CreateMessageDialog then - return "Function CreateMessageDialog. " - .. "Arguments: (title, message, buttons). " - .. "Side effect: Returns a gui object of a message box with 'title' and 'message' as passed in. 'buttons' input is an array of Tables contains a 'Text' and 'Function' field for the text/callback of each button" + return [[Function CreateMessageDialog. +Arguments: (title, message, buttons). +Side effect: Returns a gui object of a message box with 'title' and 'message' as passed in. 'buttons' input is an array of Tables contains a 'Text' and 'Function' field for the text/callback of each button]] elseif funcNameOrFunc == "CreateStyledMessageDialog" or funcNameOrFunc == RbxGui.CreateStyledMessageDialog then - return "Function CreateStyledMessageDialog. " - .. "Arguments: (title, message, style, buttons). " - .. "Side effect: Returns a gui object of a message box with 'title' and 'message' as passed in. 'buttons' input is an array of Tables contains a 'Text' and 'Function' field for the text/callback of each button, 'style' is a string, either Error, Notify or Confirm" + return [[Function CreateStyledMessageDialog. +Arguments: (title, message, style, buttons). +Side effect: Returns a gui object of a message box with 'title' and 'message' as passed in. 'buttons' input is an array of Tables contains a 'Text' and 'Function' field for the text/callback of each button, 'style' is a string, either Error, Notify or Confirm]] elseif funcNameOrFunc == "GetFontHeight" or funcNameOrFunc == RbxGui.GetFontHeight then - return "Function GetFontHeight. " - .. "Arguments: (font, fontSize). " - .. "Side effect: returns the size in pixels of the given font + fontSize" + return [[Function GetFontHeight. +Arguments: (font, fontSize). +Side effect: returns the size in pixels of the given font + fontSize]] elseif funcNameOrFunc == "CreateScrollingFrame" or funcNameOrFunc == RbxGui.CreateScrollingFrame then - return "Function CreateScrollingFrame. " - .. "Arguments: (orderList, style) " - .. "Side effect: returns 4 objects, (scrollFrame, scrollUpButton, scrollDownButton, recalculateFunction). 'scrollFrame' can be filled with GuiObjects. It will lay them out and allow scrollUpButton/scrollDownButton to interact with them. Orderlist is optional (and specifies the order to layout the children. Without orderlist, it uses the children order. style is also optional, and allows for a 'grid' styling if style is passed 'grid' as a string. recalculateFunction can be called when a relayout is needed (when orderList changes)" + return [[Function CreateScrollingFrame. +Arguments: (orderList, style) +Side effect: returns 4 objects, (scrollFrame, scrollUpButton, scrollDownButton, recalculateFunction). 'scrollFrame' can be filled with GuiObjects. It will lay them out and allow scrollUpButton/scrollDownButton to interact with them. Orderlist is optional (and specifies the order to layout the children. Without orderlist, it uses the children order. style is also optional, and allows for a 'grid' styling if style is passed 'grid' as a string. recalculateFunction can be called when a relayout is needed (when orderList changes)]] elseif funcNameOrFunc == "CreateTrueScrollingFrame" or funcNameOrFunc == RbxGui.CreateTrueScrollingFrame then - return "Function CreateTrueScrollingFrame. " - .. "Arguments: (nil) " - .. "Side effect: returns 2 objects, (scrollFrame, controlFrame). 'scrollFrame' can be filled with GuiObjects, and they will be clipped if not inside the frame's bounds. controlFrame has children scrollup and scrolldown, as well as a slider. controlFrame can be parented to any guiobject and it will readjust itself to fit." + return [[Function CreateTrueScrollingFrame. +Arguments: (nil) +Side effect: returns 2 objects, (scrollFrame, controlFrame). 'scrollFrame' can be filled with GuiObjects, and they will be clipped if not inside the frame's bounds. controlFrame has children scrollup and scrolldown, as well as a slider. controlFrame can be parented to any guiobject and it will readjust itself to fit.]] elseif funcNameOrFunc == "AutoTruncateTextObject" or funcNameOrFunc == RbxGui.AutoTruncateTextObject then - return "Function AutoTruncateTextObject. " - .. "Arguments: (textLabel) " - .. "Side effect: returns 2 objects, (textLabel, changeText). The 'textLabel' input is modified to automatically truncate text (with ellipsis), if it gets too small to fit. 'changeText' is a function that can be used to change the text, it takes 1 string as an argument" + return [[Function AutoTruncateTextObject. +Arguments: (textLabel) +Side effect: returns 2 objects, (textLabel, changeText). The 'textLabel' input is modified to automatically truncate text (with ellipsis), if it gets too small to fit. 'changeText' is a function that can be used to change the text, it takes 1 string as an argument]] elseif funcNameOrFunc == "CreateSlider" or funcNameOrFunc == RbxGui.CreateSlider then - return "Function CreateSlider. " - .. "Arguments: (steps, width, position) " - .. "Side effect: returns 2 objects, (sliderGui, sliderPosition). The 'steps' argument specifies how many different positions the slider can hold along the bar. 'width' specifies in pixels how wide the bar should be (modifiable afterwards if desired). 'position' argument should be a UDim2 for slider positioning. 'sliderPosition' is an IntValue whose current .Value specifies the specific step the slider is currently on." + return [[Function CreateSlider. +Arguments: (steps, width, position) +Side effect: returns 2 objects, (sliderGui, sliderPosition). The 'steps' argument specifies how many different positions the slider can hold along the bar. 'width' specifies in pixels how wide the bar should be (modifiable afterwards if desired). 'position' argument should be a UDim2 for slider positioning. 'sliderPosition' is an IntValue whose current .Value specifies the specific step the slider is currently on.]] elseif funcNameOrFunc == "CreateLoadingFrame" or funcNameOrFunc == RbxGui.CreateLoadingFrame then - return "Function CreateLoadingFrame. " - .. "Arguments: (name, size, position) " - .. "Side effect: Creates a gui that can be manipulated to show progress for a particular action. Name appears above the loading bar, and size and position are udim2 values (both size and position are optional arguments). Returns 3 arguments, the first being the gui created. The second being updateLoadingGuiPercent, which is a bindable function. This function takes one argument (two optionally), which should be a number between 0 and 1, representing the percentage the loading gui should be at. The second argument to this function is a boolean value that if set to true will tween the current percentage value to the new percentage value, therefore our third argument is how long this tween should take. Our third returned argument is a BindableEvent, that when fired means that someone clicked the cancel button on the dialog." + return [[Function CreateLoadingFrame. +Arguments: (name, size, position) +Side effect: Creates a gui that can be manipulated to show progress for a particular action. Name appears above the loading bar, and size and position are udim2 values (both size and position are optional arguments). Returns 3 arguments, the first being the gui created. The second being updateLoadingGuiPercent, which is a bindable function. This function takes one argument (two optionally), which should be a number between 0 and 1, representing the percentage the loading gui should be at. The second argument to this function is a boolean value that if set to true will tween the current percentage value to the new percentage value, therefore our third argument is how long this tween should take. Our third returned argument is a BindableEvent, that when fired means that someone clicked the cancel button on the dialog.]] elseif funcNameOrFunc == "CreateTerrainMaterialSelector" or funcNameOrFunc == RbxGui.CreateTerrainMaterialSelector then - return "Function CreateTerrainMaterialSelector. " - .. "Arguments: (size, position) " - .. "Side effect: Size and position are UDim2 values that specifies the selector's size and position. Both size and position are optional arguments. This method returns 3 objects (terrainSelectorGui, terrainSelected, forceTerrainSelection). terrainSelectorGui is just the gui object that we generate with this function, parent it as you like. TerrainSelected is a BindableEvent that is fired whenever a new terrain type is selected in the gui. ForceTerrainSelection is a function that takes an argument of Enum.CellMaterial and will force the gui to show that material as currently selected." + return [[Function CreateTerrainMaterialSelector. +Arguments: (size, position) +Side effect: Size and position are UDim2 values that specifies the selector's size and position. Both size and position are optional arguments. This method returns 3 objects (terrainSelectorGui, terrainSelected, forceTerrainSelection). terrainSelectorGui is just the gui object that we generate with this function, parent it as you like. TerrainSelected is a BindableEvent that is fired whenever a new terrain type is selected in the gui. ForceTerrainSelection is a function that takes an argument of Enum.CellMaterial and will force the gui to show that material as currently selected.]] end return "No help available for this function" end diff --git a/luau/46295863.luau b/luau/46295863.luau index 05e3a59..ac7d3ee 100644 --- a/luau/46295863.luau +++ b/luau/46295863.luau @@ -1,5 +1,5 @@ --!strict --- CoreGui.RobloxGui.CoreScripts/Settings +-- CoreGui.MercuryGui.CoreScripts/Settings print "[Mercury]: Loaded corescript 46295863" local News = require "../Modules/New" @@ -310,16 +310,14 @@ end local function setDisabledState(guiObject) if not guiObject then return - end - - if guiObject:IsA "TextLabel" then + elseif guiObject:IsA "TextLabel" then guiObject.TextTransparency = 0.9 elseif guiObject:IsA "TextButton" then guiObject.TextTransparency = 0.9 guiObject.Active = false elseif guiObject.ClassName then print( - "setDisabledState() got object of unsupported type. object type is ", + "setDisabledState() got object of unsupported type. object type is ", guiObject.ClassName ) end @@ -1251,10 +1249,7 @@ local function createGameSettingsMenu(baseZIndex, _) end) graphicsLevel.Changed:connect(function(_) - if isAutoGraphics then - return - end - if not listenToGraphicsLevelChange then + if isAutoGraphics or not listenToGraphicsLevelChange then return end @@ -1287,9 +1282,7 @@ local function createGameSettingsMenu(baseZIndex, _) autoGraphicsButton.MouseButton1Click:connect(function() if inStudioMode and not game.Players.LocalPlayer then return - end - - if not isAutoGraphics then + elseif not isAutoGraphics then goToAutoGraphics() else goToManualGraphics(graphicsLevel.Value) @@ -1297,11 +1290,9 @@ local function createGameSettingsMenu(baseZIndex, _) end) game.GraphicsQualityChangeRequest:connect(function(graphicsIncrease) - if isAutoGraphics then + if isAutoGraphics then -- only can set graphics in manual mode return - end -- only can set graphics in manual mode - - if graphicsIncrease then + elseif graphicsIncrease then if (graphicsLevel.Value + 1) > GraphicsQualityLevels then return end @@ -1398,9 +1389,7 @@ local function createGameSettingsMenu(baseZIndex, _) studioCheckbox.MouseButton1Click:connect(function() if not studioCheckbox.Active then return - end - - if studioCheckbox.Text == "" then + elseif studioCheckbox.Text == "" then studioCheckbox.Text = "X" else studioCheckbox.Text = "" @@ -1514,7 +1503,7 @@ local function createGameSettingsMenu(baseZIndex, _) videoCaptureDropDown.DropDownMenuButton.ZIndex = baseZIndex + 4 videoCaptureDropDown.DropDownMenuButton.Icon.ZIndex = baseZIndex + 4 - syncVideoCaptureSetting = function() + function syncVideoCaptureSetting() if UserSettings().GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting.Never @@ -1547,7 +1536,7 @@ local function createGameSettingsMenu(baseZIndex, _) Parent = gameSettingsMenuFrame, } - mouseLockLabel = CoreGui.RobloxGui:FindFirstChild("MouseLockLabel", true) + mouseLockLabel = CoreGui.MercuryGui:FindFirstChild("MouseLockLabel", true) local enumItems = Enum.ControlMode:GetEnumItems() local enumNames = {} @@ -1595,7 +1584,7 @@ GuiService:AddKey "r" local baseZIndex = 0 if UserSettings then - local createSettingsDialog = function() + local function createSettingsDialog() waitForChild(gui, "BottomLeftControl") settingsButton = gui.BottomLeftControl:FindFirstChild "SettingsButton" @@ -1674,7 +1663,7 @@ if UserSettings then end) end - CoreGui.RobloxGui.Changed:connect( + CoreGui.MercuryGui.Changed:connect( function(prop) -- We have stopped recording when we resize if prop == "AbsoluteSize" and recordingVideo then recordVideoClick( @@ -1979,7 +1968,7 @@ if UserSettings then end) end --UserSettings call -local createSaveDialogs = function() +local function createSaveDialogs() local shield = New "TextButton" { Text = "", AutoButtonColor = false, @@ -2109,7 +2098,7 @@ local createSaveDialogs = function() ) end - save = function() + function save() saveDialogMessageBox.Visible = false --Show the spinner dialog @@ -2160,25 +2149,25 @@ local createSaveDialogs = function() end end - saveLocal = function() + function saveLocal() errorDialogMessageBox.Visible = false game:FinishShutdown(true) clearAndResetDialog() end - dontSave = function() + function dontSave() saveDialogMessageBox.Visible = false errorDialogMessageBox.Visible = false game:FinishShutdown(false) clearAndResetDialog() end - cancel = function() + function cancel() saveDialogMessageBox.Visible = false errorDialogMessageBox.Visible = false clearAndResetDialog() end - clearAndResetDialog = function() + function clearAndResetDialog() saveDialogMessageBox.Visible = true errorDialogMessageBox.Visible = false spinnerDialog.Visible = false @@ -2191,7 +2180,7 @@ local createSaveDialogs = function() return shield end -local createReportAbuseDialog = function() +local function createReportAbuseDialog() --Only show things if we are a NetworkClient waitForChild(game, "NetworkClient") @@ -2239,7 +2228,7 @@ local createReportAbuseDialog = function() local calmingMessageBox = Hydrate( RbxGui.CreateMessageDialog( "Thanks for your report!", - "Our moderators will review the chat logs and determine what happened. The other user is probably just trying to make you mad.\n\nIf anyone used swear words, inappropriate language, or threatened you in real life, please report them for Bad Words or Threats", + "Our moderators will review the chat logs and determine what happened. The other user is probably just trying to make you mad.\n\nIf anyone used swear words, inappropriate language, or threatened you in real life, please report them for Bad Words or Threats", messageBoxButtons ) ) { @@ -2322,7 +2311,7 @@ local createReportAbuseDialog = function() }, New "TextLabel" { Name = "Description", - Text = "This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action.", + Text = "This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action.", TextColor3 = Color3I(221, 221, 221), Position = UDim2.new(0, 0, 0, 55), Size = UDim2.new(1, 0, 0, 40), @@ -2492,8 +2481,8 @@ local createReportAbuseDialog = function() Parent = reportAbuseFrame, } - closeAndResetDialog = function() - --Delete old player combo box + function closeAndResetDialog() + -- Delete old player combo box local oldComboBox = reportAbuseFrame:FindFirstChild "PlayersComboBox" if oldComboBox then oldComboBox.Parent = nil @@ -2549,7 +2538,7 @@ if isSaveDialogSupported then local saveDialogs = createSaveDialogs() saveDialogs.Parent = gui - game.RequestShutdown = function() + function game.RequestShutdown() table.insert(centerDialogs, saveDialogs) game.GuiService:AddCenterDialog( saveDialogs, diff --git a/luau/48488235.luau b/luau/48488235.luau index 96ea32f..8e7ae5a 100644 --- a/luau/48488235.luau +++ b/luau/48488235.luau @@ -1,5 +1,5 @@ --!strict --- CoreGui.RobloxGui.CoreScripts/PlayerListScript +-- CoreGui.MercuryGui.CoreScripts/PlayerListScript print "[Mercury]: Loaded corescript 48488235" local RunService = game:GetService "RunService" @@ -87,7 +87,7 @@ local function getMembershipTypeIcon(membershipType, playerName) elseif membershipType == Enum.MembershipType.OutrageousBuildersClub then return "rbxasset://textures/ui/TinyObcIcon.png" else - error(`Unknown membershipType {membershipType}`) + error("Unknown membershipType " .. membershipType) end end @@ -104,7 +104,7 @@ local function getFriendStatusIcon(friendStatus) elseif friendStatus == Enum.FriendStatus.FriendRequestReceived then return "http://banland.xyz/asset?id=99776838" else - error(`Unknown FriendStatus {friendStatus}`) + error("Unknown FriendStatus " .. friendStatus) end end @@ -914,10 +914,11 @@ local function HighlightMyRank( MemberButton, AdminButton ) - BanPlayerButton.Image = `http://banland.xyz/asset?id={Images.LightPopupMid}` - VisitorButton.Image = `http://banland.xyz/asset?id={Images.DarkPopupMid}` - MemberButton.Image = `http://banland.xyz/asset?id={Images.LightPopupMid}` - AdminButton.Image = `http://banland.xyz/asset?id={Images.DarkPopupBottom}` + BanPlayerButton.Image = "http://banland.xyz/asset?id=" + .. Images.LightPopupMid + VisitorButton.Image = "http://banland.xyz/asset?id=" .. Images.DarkPopupMid + MemberButton.Image = "http://banland.xyz/asset?id=" .. Images.LightPopupMid + AdminButton.Image = "http://banland.xyz/asset?id=" .. Images.DarkPopupBottom local rank = player.PersonalServerRank if rank <= PrivilegeLevel.Banned then @@ -1048,7 +1049,7 @@ end creates dropdownbox, registers all listeners for abuse dialog --]] local function InitReportAbuse() - UpdateAbuseFunction = function(abuseText) + function UpdateAbuseFunction(abuseText) AbuseName = abuseText if AbuseName and SelectedPlayer then SubmitReportButton.Active = true @@ -1706,7 +1707,7 @@ local function BaseUpdate() BaseUpdateLock = false end -RecreateScoreColumns = function(ptable) +function RecreateScoreColumns(ptable) -- OUTLINE local function MakeScoreEntry(entry, scoreval, panel) if not panel:FindFirstChild "PlayerScore" then @@ -1746,8 +1747,7 @@ RecreateScoreColumns = function(ptable) thisScore.Changed:connect(function() if not thisScore.Parent then return - end - if scoreval.Name == ScoreNames[1]["Name"] then + elseif scoreval.Name == ScoreNames[1]["Name"] then entry.Score = GetScoreValue(thisScore) if entry.Player == LocalPlayer then HeaderScore.Text = tostring(GetScoreValue(thisScore)) @@ -1846,7 +1846,7 @@ end monitors positions of the clipping frames and bottom frames called from EVERYWHERE, too much probably --]] -UpdateMinimize = function() +function UpdateMinimize() if IsMinimized.Value then if IsMaximized.Value then ToggleMaximize() @@ -2555,7 +2555,7 @@ local function AddMiddleBGFrame() UDim2.new(0.5, 0, (#MiddleFrameBackgrounds * nBGFrame.Size.Y.Scale), 0) local function applyImage(id: string) - nBGFrame.Background.Image = `http://banland.xyz/asset?id={id}` + nBGFrame.Background.Image = "http://banland.xyz/asset?id=" .. id end if (#MiddleFrameBackgrounds + 1) % 2 ~= 1 then @@ -2828,18 +2828,18 @@ local function PlayerChanged(entry, property) if property == "Neutral" then -- if player changing to neutral if entry.Player.Neutral and #(game.Teams:GetTeams()) > 0 then - log(`{entry.Player.Name} setting to neutral`) + log(entry.Player.Name .. " setting to neutral") FindRemovePlayerFromTeam(entry) entry.MyTeam = nil if not NeutralTeam then - log(`{entry.Player.Name} creating neutral team`) + log(entry.Player.Name .. " creating neutral team") AddNeutralTeam() else - log(`{entry.Player.Name} adding to neutral team`) + log(entry.Player.Name .. " adding to neutral team") AddPlayerToTeam(NeutralTeam, entry) end elseif #(game.Teams:GetTeams()) > 0 then -- else player switching to a team, or a weird edgecase - log(`{entry.Player.Name} has been set non-neutral`) + log(entry.Player.Name .. " has been set non-neutral") SetPlayerToTeam(entry) end BaseUpdate() @@ -2848,7 +2848,7 @@ local function PlayerChanged(entry, property) and not entry.Player.Neutral and entry.Player ~= entry.MyTeam then - log(`{entry.Player.Name} setting to new team`) + log(entry.Player.Name .. " setting to new team") SetPlayerToTeam(entry) BaseUpdate() elseif property == "Name" or property == "MembershipType" then @@ -2879,7 +2879,7 @@ end --]] local function InsertPlayerFrame(nplayer) while AddingFrameLock do - log(`waiting to insert {nplayer.Name}`) + log("waiting to insert " .. nplayer.Name) RunService.Heartbeat:wait() end AddingFrameLock = true @@ -3067,7 +3067,7 @@ local function OnFriendshipChanged(player, friendStatus) elseif nicon ~= "" and entry.Frame.FriendLabel.Image == "" then entry.Frame.TitleFrame.Title.Position = entry.Frame.TitleFrame.Title.Position + UDim2.new(0, 17, 0, 0) - log(`confirmed status {player.Name}`) + log("confirmed status " .. player.Name) end entry.Frame.FriendLabel.Image = nicon return @@ -3337,9 +3337,9 @@ end pcall(function() coreGuiChanged( Enum.CoreGuiType.PlayerList, - Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) + game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) ) - Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) + game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) end) while not game:GetService "Teams" do diff --git a/luau/48488398.luau b/luau/48488398.luau index bf31617..a10eb30 100644 --- a/luau/48488398.luau +++ b/luau/48488398.luau @@ -1,4 +1,4 @@ --- CoreGui.RobloxGui.CoreScripts/NotificationScript +-- CoreGui.MercuryGui.CoreScripts/NotificationScript print "[Mercury]: Loaded corescript 48488398" local GuiService = game:GetService "GuiService" @@ -53,15 +53,13 @@ end local function makeFriend(fromPlayer, toPlayer) local popup = script.Parent:FindFirstChild "Popup" - if popup == nil then + if + popup == nil -- there is no popup! + or popup.Visible -- currently popping something, abort! + or friendRequestBlacklist[fromPlayer] -- previously cancelled friend request, we don't want it! + then return - end -- there is no popup! - if popup.Visible then - return - end -- currently popping something, abort! - if friendRequestBlacklist[fromPlayer] then - return - end -- previously cancelled friend request, we don't want it! + end popup.PopupText.Text = `Accept Friend Request from {fromPlayer.Name}?` popup.PopupImage.Image = @@ -126,9 +124,7 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event) -- if this doesn't involve me, then do nothing if fromPlayer ~= localPlayer and toPlayer ~= localPlayer then return - end - - if fromPlayer == localPlayer then + elseif fromPlayer == localPlayer then if event == Enum.FriendRequestEvent.Accept then GuiService:SendNotification( "You are Friends", @@ -198,7 +194,7 @@ end if teleportEnabled then localPlayer.OnTeleport:connect(onTeleport) - TeleportService.ErrorCallback = function(message) + function TeleportService.ErrorCallback(message) local popup = script.Parent:FindFirstChild "Popup" showOneButton() popup.PopupText.Text = message @@ -248,7 +244,7 @@ if teleportEnabled then end ) end - TeleportService.ConfirmationCallback = function(message, placeId, spawnName) + function TeleportService.ConfirmationCallback(message, placeId, spawnName) local popup = script.Parent:FindFirstChild "Popup" popup.PopupText.Text = message popup.PopupImage.Image = "" diff --git a/luau/48488451.luau b/luau/48488451.luau index b058468..9402de0 100644 --- a/luau/48488451.luau +++ b/luau/48488451.luau @@ -1,11 +1,11 @@ --- CoreGui.RobloxGui.CoreScripts/PopupScript +-- CoreGui.MercuryGui.CoreScripts/PopupScript print "[Mercury]: Loaded corescript 48488451" local News = require "../Modules/New" local New = News.New local Hydrate = News.Hydrate ---build our gui +-- build our gui local popupFrame = New "Frame" { Name = "Popup", diff --git a/luau/53878047.luau b/luau/53878047.luau index b073066..0c6b57f 100644 --- a/luau/53878047.luau +++ b/luau/53878047.luau @@ -1,4 +1,4 @@ --- CoreGui.RobloxGui.CoreScripts/BackpackScripts/BackpackBuild +-- CoreGui.MercuryGui.CoreScripts/BackpackScripts/BackpackBuild print "[Mercury]: Loaded corescript 53878047" local News = require "../Modules/New" @@ -207,19 +207,6 @@ for i = 0, 9 do end slotFrame.Parent = CurrentLoadout - - if gui.AbsoluteSize.Y <= 320 then - slotFrame.Position = UDim2.new(0, (i - 1) * 60, 0, -50) - -- print( - -- "Well got here", - -- slotFrame, - -- slotFrame.Position.X.Scale, - -- slotFrame.Position.X.Offset - -- ) - end - if gui.AbsoluteSize.Y <= 320 and i == 0 then - slotFrame:Destroy() - end end -- Great, now lets make the inventory! diff --git a/luau/53878057.luau b/luau/53878057.luau index 3a2bbb6..f063237 100644 --- a/luau/53878057.luau +++ b/luau/53878057.luau @@ -1,10 +1,10 @@ --- CoreGui.RobloxGui.CurrentLoadout.CoreScripts/BackpackScript +-- CoreGui.MercuryGui.CurrentLoadout.CoreScripts/BackpackScript print "[Mercury]: Loaded corescript 53878057" local CoreGui = game:GetService "CoreGui" local GuiService = game:GetService "GuiService" local RunService = game:GetService "RunService" -local UserInputService = Game:GetService "UserInputService" +local UserInputService = game:GetService "UserInputService" -- A couple of necessary functions local function waitForChild(instance, name) @@ -23,15 +23,15 @@ local currentLoadout = script.Parent local StaticTabName = "gear" local backpackEnabled = true -local robloxGui = CoreGui:FindFirstChild "RobloxGui" -assert(robloxGui) +local mercuryGui = CoreGui:FindFirstChild "MercuryGui" +assert(mercuryGui) -local controlFrame = waitForChild(robloxGui, "ControlFrame") +local controlFrame = waitForChild(mercuryGui, "ControlFrame") local backpackButton = waitForChild(controlFrame, "BackpackButton") -local backpack = waitForChild(robloxGui, "Backpack") -waitForChild(robloxGui, "CurrentLoadout") -waitForChild(robloxGui.CurrentLoadout, "TempSlot") -waitForChild(robloxGui.CurrentLoadout.TempSlot, "SlotNumber") +local backpack = waitForChild(mercuryGui, "Backpack") +waitForChild(mercuryGui, "CurrentLoadout") +waitForChild(mercuryGui.CurrentLoadout, "TempSlot") +waitForChild(mercuryGui.CurrentLoadout.TempSlot, "SlotNumber") waitForChild(currentLoadout, "Background") local clBackground = currentLoadout.Background @@ -92,9 +92,6 @@ local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent") local inGearTab = true local maxNumLoadoutItems = 10 -if robloxGui.AbsoluteSize.Y <= 320 then - maxNumLoadoutItems = 4 -end local characterChildAddedCon, backpackChildCon @@ -115,8 +112,6 @@ for i = 1, maxNumLoadoutItems do gearSlots[i] = "empty" end -local backpackWasOpened = false - local dragBeginPos --- End Locals @@ -154,17 +149,11 @@ local function unregisterNumberKeys() end local function characterInWorkspace() - if game.Players.LocalPlayer then - if game.Players.LocalPlayer.Character then - if game.Players.LocalPlayer.Character ~= nil then - if game.Players.LocalPlayer.Character.Parent ~= nil then - return true - end - end - end - end - - return false + local localPlayer = game.Players.LocalPlayer + return localPlayer + and localPlayer.Character + and localPlayer.Character ~= nil + and localPlayer.Character.Parent ~= nil end local function removeGear(gear) @@ -288,7 +277,7 @@ local function insertGear(gear, addToSlot) end) end -reorganizeLoadout = function(gear, inserting, _, addToSlot) +function reorganizeLoadout(gear, inserting, _, addToSlot) if inserting then -- add in gear insertGear(gear, addToSlot) else @@ -301,7 +290,7 @@ end local function checkToolAncestry(child, parent) if - child:FindFirstChild "RobloxBuildTool" -- don't show roblox build tools + child:FindFirstChild "RobloxBuildTool" -- don't show mercury build tools or not (child:IsA "Tool" or child:IsA "HopperBin") then return @@ -350,16 +339,12 @@ local function removeAllEquippedGear(physGear) end local function normaliseButton(button, speed) - if not button then - return - end - if button.Size.Y.Scale <= 1 then - return - end - if button.Selected then - return - end - if not button.Parent then + if + not button + or button.Size.Y.Scale <= 1 + or button.Selected + or not button.Parent + then return end @@ -407,9 +392,7 @@ local function enlargeButton(button) if not enlargeOverride then return - end - - if button:FindFirstChild "Highlight" then + elseif button:FindFirstChild "Highlight" then button.Highlight.Visible = true end @@ -510,30 +493,21 @@ local function toolSwitcher(numKey) end local function activateGear(num) - local numKey - if num == "0" then - numKey = 10 -- why do lua indexes have to start at 1? :( - else - numKey = tonumber(num) - end + local numKey = num == "0" and 10 or tonumber(num) - if numKey == nil then - return - end - - if gearSlots[numKey] ~= "empty" then + if numKey and gearSlots[numKey] ~= "empty" then toolSwitcher(numKey) end end local function pointInRectangle(point, rectTopLeft, rectSize) - if point.x > rectTopLeft.x and point.x < (rectTopLeft.x + rectSize.x) then - if - point.y > rectTopLeft.y - and point.y < (rectTopLeft.y + rectSize.y) - then - return true - end + if + point.x > rectTopLeft.x + and point.x < (rectTopLeft.x + rectSize.x) + and point.y > rectTopLeft.y + and point.y < (rectTopLeft.y + rectSize.y) + then + return true end return false end @@ -716,7 +690,7 @@ local function addingPlayerChild( if child:FindFirstChild "RobloxBuildTool" then debounce = false return - end -- don't show roblox build tools + end -- don't show mercury build tools if not (child:IsA "Tool" or child:IsA "HopperBin") then debounce = false return -- we don't care about anything besides tools (sigh...) @@ -783,7 +757,7 @@ local function addingPlayerChild( end local slotNum = slotToMod % 10 - local parent = currentLoadout:FindFirstChild(`Slot{slotNum}`) + local parent = currentLoadout:FindFirstChild("Slot" .. slotNum) gearClone.Parent = parent if inventoryGearButton then @@ -851,30 +825,23 @@ local function addingPlayerChild( local children = gearClone:GetChildren() for i = 1, #children do if children[i]:IsA "TextLabel" then - if string.find(children[i].Name, "Shadow") then - children[i].ZIndex = 8 - else - children[i].ZIndex = 9 - end + children[i].ZIndex = string.find(children[i].Name, "Shadow") + and 8 + or 9 elseif children[i]:IsA "Frame" or children[i]:IsA "ImageLabel" then children[i].ZIndex = 7 end end end) dragStop = gearClone.DragStopped:connect(function(x, y) - if gearClone.Selected then - gearClone.ZIndex = 4 - else - gearClone.ZIndex = 3 - end + gearClone.ZIndex = gearClone.Selected and 4 or 3 + local children = gearClone:GetChildren() for i = 1, #children do if children[i]:IsA "TextLabel" then - if string.find(children[i].Name, "Shadow") then - children[i].ZIndex = 3 - else - children[i].ZIndex = 4 - end + children[i].ZIndex = string.find(children[i].Name, "Shadow") + and 3 + or 4 elseif children[i]:IsA "Frame" or children[i]:IsA "ImageLabel" then children[i].ZIndex = 2 end @@ -887,8 +854,7 @@ local function addingPlayerChild( buttonDeleteCon = gearClone.AncestryChanged:connect(function() if gearClone.Parent and gearClone.Parent.Parent == currentLoadout then return - end - if clickCon then + elseif clickCon then clickCon:disconnect() end if buttonDeleteCon then @@ -925,16 +891,12 @@ local function addingPlayerChild( end) childChangeCon = child.Changed:connect(function(prop) - if prop == "Name" then - if gearClone and gearClone.GearImage.Image == "" then - gearClone.GearText.Text = child.Name - end + if prop == "Name" and gearClone and gearClone.GearImage.Image == "" then + gearClone.GearText.Text = child.Name elseif prop == "Active" then - if child and child:IsA "HopperBin" then - if not child.Active then - gearClone.Selected = false - normaliseButton(gearClone) - end + if child and child:IsA "HopperBin" and not child.Active then + gearClone.Selected = false + normaliseButton(gearClone) end elseif prop == "TextureId" then gearClone.GearImage.Image = child.TextureId @@ -945,7 +907,7 @@ local function addingPlayerChild( Spawn(function() while backpackIsOpen() do - wait(0.03) + wait() end for i = 1, #gearSlots do if gearSlots[i] ~= "empty" then @@ -968,11 +930,11 @@ local function addToInventory(child) for i = 1, #inventory do if inventory[i] and inventory[i] == child then return - end - if not inventory[i] then + elseif not inventory[i] then slot = i end end + if slot then inventory[slot] = child elseif #inventory < 1 then @@ -982,7 +944,7 @@ local function addToInventory(child) end end -local spreadOutGear = function() +local function spreadOutGear() local loadoutChildren = currentLoadout:GetChildren() for i = 1, #loadoutChildren do @@ -992,28 +954,18 @@ local spreadOutGear = function() if slot == 0 then slot = 10 end - if robloxGui.AbsoluteSize.Y <= 320 then - loadoutChildren[i]:TweenPosition( - UDim2.new(0, (slot - 1) * 60, 0, 0), - Enum.EasingDirection.Out, - Enum.EasingStyle.Quad, - 0.25, - true - ) - else - loadoutChildren[i]:TweenPosition( - UDim2.new((slot - 1) / 10, 0, 0, 0), - Enum.EasingDirection.Out, - Enum.EasingStyle.Quad, - 0.25, - true - ) - end + loadoutChildren[i]:TweenPosition( + UDim2.new((slot - 1) / 10, 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + 0.25, + true + ) end end end -local centerGear = function() +local function centerGear() local loadoutChildren = currentLoadout:GetChildren() local gearButtons = {} local lastSlotAdd @@ -1036,29 +988,17 @@ local centerGear = function() local startPos = (1 - (#gearButtons * 0.1)) / 2 for i = 1, #gearButtons do - if robloxGui.AbsoluteSize.Y <= 320 then - startPos = (0.5 - (#gearButtons * 0.333) / 2) - gearButtons[i]:TweenPosition( - UDim2.new(startPos + (i - 1) * 0.33, 0, 0, 0), - Enum.EasingDirection.Out, - Enum.EasingStyle.Quad, - 0.25, - true - ) - else - gearButtons[i]:TweenPosition( - UDim2.new(startPos + ((i - 1) * 0.1), 0, 0, 0), - Enum.EasingDirection.Out, - Enum.EasingStyle.Quad, - 0.25, - true - ) - end + gearButtons[i]:TweenPosition( + UDim2.new(startPos + ((i - 1) * 0.1), 0, 0, 0), + Enum.EasingDirection.Out, + Enum.EasingStyle.Quad, + 0.25, + true + ) end end local function editLoadout() - backpackWasOpened = true if inGearTab then spreadOutGear() end @@ -1141,13 +1081,13 @@ registerNumberKeys() pcall(function() coreGuiChanged( Enum.CoreGuiType.Backpack, - Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack) + game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack) ) coreGuiChanged( Enum.CoreGuiType.Health, - Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health) + game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health) ) - Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) + game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) end) RunService.Heartbeat:wait() -- let stuff initialize incase this is first heartbeat... @@ -1155,7 +1095,7 @@ RunService.Heartbeat:wait() -- let stuff initialize incase this is first heartbe waitForChild(player, "Backpack") waitForProperty(player, "Character") --- not sure why this had no delay but the player.CharacterAdded one had one... this type of error would be easier to avoid with function reusage +-- not sure why this had no delay but the player.CharacterAdded one had one... this type of error would be easier to avoid with function reusage delay(1, function() local backpackChildren = player.Backpack:GetChildren() local size = math.min(10, #backpackChildren) @@ -1169,23 +1109,6 @@ delay(1, function() setupBackpackListener() end) -delay(2, function() - -- while true do - if not backpackWasOpened and robloxGui.AbsoluteSize.Y <= 320 then - local cChildren = currentLoadout:GetChildren() - for i = 1, #cChildren do - local slotNum = tonumber( - string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name)) - ) - if type(slotNum) == "number" then - cChildren[i].Position = UDim2.new(0, (slotNum - 1) * 60, 0, 0) - end - end - end - wait(0.25) - -- end -end) - player.ChildAdded:connect(function(child) if child:IsA "PlayerGui" then moveHealthBar(child) @@ -1212,7 +1135,6 @@ humanoidDiedCon = player.Character.Humanoid.Died:connect(function() backpackChildCon:disconnect() backpackChildCon = nil end - backpackWasOpened = false end) player.CharacterRemoving:connect(function() @@ -1276,27 +1198,6 @@ player.CharacterAdded:connect(function() end) waitForChild(player, "PlayerGui") moveHealthBar(player.PlayerGui) - delay(2, function() - -- while true do - if not backpackWasOpened and robloxGui.AbsoluteSize.Y <= 320 then - local cChildren = currentLoadout:GetChildren() - for i = 1, #cChildren do - local slotNum = tonumber( - string.sub( - cChildren[i].Name, - 5, - string.len(cChildren[i].Name) - ) - ) - if type(slotNum) == "number" then - cChildren[i].Position = - UDim2.new(0, (slotNum - 1) * 60, 0, 0) - end - end - end - wait(0.25) - -- end - end) end) waitForChild(guiBackpack, "SwapSlot") diff --git a/luau/60595411.luau b/luau/60595411.luau index c420dae..958bf99 100644 --- a/luau/60595411.luau +++ b/luau/60595411.luau @@ -11,12 +11,12 @@ local RbxUtility = {} -- Fuq json -RbxUtility.DecodeJSON = function() - error 'RbxUtility.DecodeJSON has been removed, please use Game:GetService("HttpService"):JSONDecode() instead.' +function RbxUtility.DecodeJSON() + error 'RbxUtility.DecodeJSON has been removed, please use game:GetService("HttpService"):JSONDecode() instead.' end -RbxUtility.EncodeJSON = function() - error 'RbxUtility.EncodeJSON has been removed, please use Game:GetService("HttpService"):JSONEncode() instead.' +function RbxUtility.EncodeJSON() + error 'RbxUtility.EncodeJSON has been removed, please use game:GetService("HttpService"):JSONEncode() instead.' end ------------------------------------------------------------------------------------------------------------------------ @@ -26,14 +26,14 @@ end ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ ---makes a wedge at location x, y, z ---sets cell x, y, z to default material if parameter is provided, if not sets cell x, y, z to be whatever material it previously w ---returns true if made a wedge, false if the cell remains a block -RbxUtility.MakeWedge = function(x, y, z, _) +-- makes a wedge at location x, y, z +-- sets cell x, y, z to default material if parameter is provided, if not sets cell x, y, z to be whatever material it previously w +-- returns true if made a wedge, false if the cell remains a block +function RbxUtility.MakeWedge(x, y, z, _) return Terrain:AutoWedgeCell(x, y, z) end -RbxUtility.SelectTerrainRegion = function( +function RbxUtility.SelectTerrainRegion( regionToSelect: Region3, colour: BrickColor, selectEmptyCells: boolean, @@ -210,7 +210,7 @@ RbxUtility.SelectTerrainRegion = function( adornments.SelectionPart = selectionPart adornments.SelectionBox = selectionBox - updateSelection = function(newRegion: Region3, newColour) + function updateSelection(newRegion: Region3, newColour) if newRegion and newRegion ~= lastRegion then lastRegion = newRegion selectionPart.Size = newRegion.Size @@ -222,7 +222,7 @@ RbxUtility.SelectTerrainRegion = function( end else -- use individual cell adorns to represent the area selected adornFullCellsInRegion(regionToSelect, colour) - updateSelection = function(newRegion, newColour) + function updateSelection(newRegion, newColour) if newRegion and newRegion ~= lastRegion then lastRegion = newRegion adornFullCellsInRegion(newRegion, newColour) @@ -230,7 +230,7 @@ RbxUtility.SelectTerrainRegion = function( end end - local destroyFunc = function() + local function destroyFunc() updateSelection = nil if selectionContainer then selectionContainer:Destroy() @@ -350,7 +350,7 @@ end ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ --[[ -A "Create" function for easy creation of Roblox instances. The function accepts a string which is the classname of +A "Create" function for easy creation of Mercury instances. The function accepts a string which is the classname of the object to be created. The function then returns another function which either accepts accepts no arguments, in which case it simply creates an object of the given type, or a table argument that may contain several types of data, in which case it mutates the object in varying ways depending on the nature of the aggregate data. These are the @@ -527,7 +527,7 @@ RbxUtility.Create = setmetatable({}, { --and create the "Event.E" syntax stub. Really it's just a stub to construct a table which our Create --function can recognize as special. -RbxUtility.Create.E = function(eventName) +function RbxUtility.Create.E(eventName) return { __eventname = eventName } end @@ -541,99 +541,69 @@ end ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ -RbxUtility.Help = function(funcNameOrFunc) +function RbxUtility.Help(funcNameOrFunc) --input argument can be a string or a function. Should return a description (of arguments and expected side effects) if funcNameOrFunc == "DecodeJSON" or funcNameOrFunc == RbxUtility.DecodeJSON then - return "Function DecodeJSON. " - .. "Arguments: (string). " - .. "Side effect: returns a table with all parsed JSON values" - end - if + return [[Function DecodeJSON. +Arguments: (string). +Side effect: returns a table with all parsed JSON values]] + elseif funcNameOrFunc == "EncodeJSON" or funcNameOrFunc == RbxUtility.EncodeJSON then - return "Function EncodeJSON. " - .. "Arguments: (table). " - .. "Side effect: returns a string composed of argument table in JSON data format" - end - if + return [[Function EncodeJSON. +Arguments: (table). +Side effect: returns a string composed of argument table in JSON data format]] + elseif funcNameOrFunc == "MakeWedge" or funcNameOrFunc == RbxUtility.MakeWedge then - return "Function MakeWedge. " - .. "Arguments: (x, y, z, [default material]). " - .. "Description: Makes a wedge at location x, y, z. Sets cell x, y, z to default material if " - .. "parameter is provided, if not sets cell x, y, z to be whatever material it previously was. " - .. "Returns true if made a wedge, false if the cell remains a block " - end - if + return [[Function MakeWedge. +Arguments: (x, y, z, [default material]). +Description: Makes a wedge at location x, y, z. Sets cell x, y, z to default material if parameter is provided, if not sets cell x, y, z to be whatever material it previously was. Returns true if made a wedge, false if the cell remains a block]] + elseif funcNameOrFunc == "SelectTerrainRegion" or funcNameOrFunc == RbxUtility.SelectTerrainRegion then - return "Function SelectTerrainRegion. " - .. "Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). " - .. "Description: Selects all terrain via a series of selection boxes within the regionToSelect " - .. "(this should be a region3 value). The selection box color is detemined by the color argument " - .. "(should be a brickcolor value). SelectionParent is the parent that the selection model gets placed to (optional)." - .. "SelectEmptyCells is bool, when true will select all cells in the " - .. "region, otherwise we only select non-empty cells. Returns a function that can update the selection," - .. "arguments to said function are a new region3 to select, and the adornment color (color arg is optional). " - .. "Also returns a second function that takes no arguments and destroys the selection" - end - if + return [[Function SelectTerrainRegion. +Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). +Description: Selects all terrain via a series of selection boxes within the regionToSelect (this should be a region3 value). The selection box color is detemined by the color argument (should be a brickcolor value). SelectionParent is the parent that the selection model gets placed to (optional).SelectEmptyCells is bool, when true will select all cells in the region, otherwise we only select non-empty cells. Returns a function that can update the selection, arguments to said function are a new region3 to select, and the adornment color (color arg is optional). Also returns a second function that takes no arguments and destroys the selection]] + elseif funcNameOrFunc == "CreateSignal" or funcNameOrFunc == RbxUtility.CreateSignal then - return "Function CreateSignal. " - .. "Arguments: None. " - .. "Returns: The newly created Signal object. This object is identical to the RBXScriptSignal class " - .. "used for events in Objects, but is a Lua-side object so it can be used to create custom events in" - .. "Lua code. " - .. "Methods of the Signal object: :connect, :wait, :fire, :disconnect. " - .. "For more info you can pass the method name to the Help function, or view the wiki page " - .. 'for this library. EG: Help "Signal:connect".' - end - if funcNameOrFunc == "Signal:connect" then - return "Method Signal:connect. " - .. "Arguments: (function handler). " - .. "Return: A connection object which can be used to disconnect the connection to this handler. " - .. "Description: Connectes a handler function to this Signal, so that when |fire| is called the " - .. "handler function will be called with the arguments passed to |fire|." + return [[Function CreateSignal. +Arguments: None. +Returns: The newly created Signal object. This object is identical to the RBXScriptSignal class used for events in Objects, but is a Lua-side object so it can be used to create custom events in Lua code. Methods of the Signal object: :connect, :wait, :fire, :disconnect. For more info you can pass the method name to the Help function, or view the wiki page 'for this library. EG: Help "Signal:connect".]] + elseif funcNameOrFunc == "Signal:connect" then + return [[Method Signal:connect. +Arguments: (function handler). +Return: A connection object which can be used to disconnect the connection to this handler. +Description: Connectes a handler function to this Signal, so that when |fire| is called the handler function will be called with the arguments passed to |fire|.]] end if funcNameOrFunc == "Signal:wait" then - return "Method Signal:wait. " - .. "Arguments: None. " - .. "Returns: The arguments passed to the next call to |fire|. " - .. "Description: This call does not return until the next call to |fire| is made, at which point it " - .. "will return the values which were passed as arguments to that |fire| call." - end - if funcNameOrFunc == "Signal:fire" then - return "Method Signal:fire. " - .. "Arguments: Any number of arguments of any type. " - .. "Returns: None. " - .. "Description: This call will invoke any connected handler functions, and notify any waiting code " - .. "attached to this Signal to continue, with the arguments passed to this function. Note: The calls " - .. "to handlers are made asynchronously, so this call will return immediately regardless of how long " - .. "it takes the connected handler functions to complete." - end - if funcNameOrFunc == "Signal:disconnect" then - return "Method Signal:disconnect. " - .. "Arguments: None. " - .. "Returns: None. " - .. "Description: This call disconnects all handlers attacched to this function, note however, it " - .. "does NOT make waiting code continue, as is the behavior of normal Roblox events. This method " - .. "can also be called on the connection object which is returned from Signal:connect to only " - .. "disconnect a single handler, as opposed to this method, which will disconnect all handlers." - end - if funcNameOrFunc == "Create" then - return "Function Create. " - .. "Arguments: A table containing information about how to construct a collection of objects. " - .. "Returns: The constructed objects. " - .. "Descrition: Create is a very powerful function, whose description is too long to fit here, and " - .. "is best described via example, please see the wiki page for a description of how to use it." + return [[Method Signal:wait. +Arguments: None. +Returns: The arguments passed to the next call to |fire|. +Description: This call does not return until the next call to |fire| is made, at which point it will return the values which were passed as arguments to that |fire| call.]] + elseif funcNameOrFunc == "Signal:fire" then + return [[Method Signal:fire. +Arguments: Any number of arguments of any type. +Returns: None. +Description: This call will invoke any connected handler functions, and notify any waiting code attached to this Signal to continue, with the arguments passed to this function. Note: The calls to handlers are made asynchronously, so this call will return immediately regardless of how long it takes the connected handler functions to complete.]] + elseif funcNameOrFunc == "Signal:disconnect" then + return [[Method Signal:disconnect. +Arguments: None. +Returns: None. +Description: This call disconnects all handlers attacched to this function, note however, it does NOT make waiting code continue, as is the behavior of normal Mercury events. This method can also be called on the connection object which is returned from Signal:connect to only disconnect a single handler, as opposed to this method, which will disconnect all handlers.]] + elseif funcNameOrFunc == "Create" then + return [[Function Create. +Arguments: A table containing information about how to construct a collection of objects. +Returns: The constructed objects. +Descrition: Create is a very powerful function, whose description is too long to fit here, and is best described via example, please see the wiki page for a description of how to use it.]] end return "No help available for this function" end diff --git a/luau/60595695.luau b/luau/60595695.luau index be3dc9c..f292771 100644 --- a/luau/60595695.luau +++ b/luau/60595695.luau @@ -9,7 +9,7 @@ local RunService = game:GetService "RunService" local ScriptContext -for i = 1, 4 do +for _ = 1, 4 do ScriptContext = game:GetService "ScriptContext" if ScriptContext then break diff --git a/luau/73157242.luau b/luau/73157242.luau index 6019bcb..f86d604 100644 --- a/luau/73157242.luau +++ b/luau/73157242.luau @@ -156,9 +156,7 @@ end local function findSeatsInModel(parent, seatTable) if not parent then return - end - - if parent.className == "Seat" or parent.className == "VehicleSeat" then + elseif parent.className == "Seat" or parent.className == "VehicleSeat" then table.insert(seatTable, parent) end local myChildren = parent:GetChildren() @@ -488,12 +486,10 @@ local function findConfigAtMouseTarget(Mouse: Mouse, stampData: Instance) -- This can happen sometimes, return if so if not Mouse then return - end - if not stampData then + elseif not stampData then error "findConfigAtMouseTarget: stampData is nil" return - end - if not stampData.CurrentParts then + elseif not stampData.CurrentParts then return end @@ -513,12 +509,10 @@ local function findConfigAtMouseTarget(Mouse: Mouse, stampData: Instance) insertCFrame = stampData.CurrentParts.CFrame end - if Mouse then - if stampData.CurrentParts:IsA "Tool" then - Mouse.TargetFilter = stampData.CurrentParts.Handle - else - Mouse.TargetFilter = stampData.CurrentParts - end + if Mouse and stampData.CurrentParts:IsA "Tool" then + Mouse.TargetFilter = stampData.CurrentParts.Handle + else + Mouse.TargetFilter = stampData.CurrentParts end local hitPlane = false @@ -739,7 +733,7 @@ local function restoreTheWelds(manualWeldTable, manualWeldParentTable) end end -RbxStamper.CanEditRegion = function(partOrModel, EditRegion) -- todo: use model and stamper metadata +function RbxStamper.CanEditRegion(partOrModel, EditRegion) -- todo: use model and stamper metadata if not EditRegion then return true, false end @@ -763,11 +757,10 @@ RbxStamper.CanEditRegion = function(partOrModel, EditRegion) -- todo: use model return true, false end -RbxStamper.GetStampModel = function(assetId, terrainShape, useAssetVersionId) +function RbxStamper.GetStampModel(assetId, terrainShape, useAssetVersionId) if assetId == 0 then return nil, "No Asset" - end - if assetId < 0 then + elseif assetId < 0 then return nil, "Negative Asset" end @@ -976,7 +969,7 @@ RbxStamper.GetStampModel = function(assetId, terrainShape, useAssetVersionId) return root end -RbxStamper.SetupStamperDragger = function( +function RbxStamper.SetupStamperDragger( modelToStamp, Mouse, StampInModel, @@ -1258,7 +1251,7 @@ RbxStamper.SetupStamperDragger = function( -- There wasn't a target (no part or terrain), so check for plane intersection. if not mouse.Target then local cellPos = GetTerrainForMouse(mouse) - if nil == cellPos then + if not cellPos then return end end @@ -1634,45 +1627,38 @@ RbxStamper.SetupStamperDragger = function( if not mouse then error "Error: RbxStamper.DoStamperMouseDown: Mouse is nil" return - end - if not mouse:IsA "Mouse" then + elseif not mouse:IsA "Mouse" then error( `Error: RbxStamper.DoStamperMouseDown: Mouse is of type {mouse.className}, should be of type Mouse` ) return - end - if not stampData then + elseif + not ( + stampData + and isMegaClusterPart() + and mouse + and HighScalabilityLine + ) + then return end - if isMegaClusterPart() then - if mouse and HighScalabilityLine then - local megaCube = stampData.CurrentParts:FindFirstChild( - "MegaClusterCube", - true - ) - local terrain = game.Workspace.Terrain - if megaCube then - HighScalabilityLine.Dimensions = 1 - local tempCell = terrain:WorldToCell(megaCube.CFrame.p) - HighScalabilityLine.Start = terrain:CellCenterToWorld( - tempCell.X, - tempCell.Y, - tempCell.Z - ) - return - else - HighScalabilityLine.Dimensions = 1 - local tempCell = - terrain:WorldToCell(stampData.CurrentParts.CFrame.p) - HighScalabilityLine.Start = terrain:CellCenterToWorld( - tempCell.X, - tempCell.Y, - tempCell.Z - ) - return - end - end + local megaCube = + stampData.CurrentParts:FindFirstChild("MegaClusterCube", true) + local terrain = game.Workspace.Terrain + if megaCube then + HighScalabilityLine.Dimensions = 1 + local tempCell = terrain:WorldToCell(megaCube.CFrame.p) + HighScalabilityLine.Start = + terrain:CellCenterToWorld(tempCell.X, tempCell.Y, tempCell.Z) + return + else + HighScalabilityLine.Dimensions = 1 + local tempCell = + terrain:WorldToCell(stampData.CurrentParts.CFrame.p) + HighScalabilityLine.Start = + terrain:CellCenterToWorld(tempCell.X, tempCell.Y, tempCell.Z) + return end end @@ -2902,7 +2888,7 @@ RbxStamper.SetupStamperDragger = function( control.Stamped = stamped -- BoolValue that fires when user stamps control.Paused = false - control.LoadNewModel = function(newStampModel) -- allows us to specify a new stamper model to be used with this stamper + function control.LoadNewModel(newStampModel) -- allows us to specify a new stamper model to be used with this stamper if newStampModel and not newStampModel:IsA "Model" @@ -2914,11 +2900,11 @@ RbxStamper.SetupStamperDragger = function( resetStamperState(newStampModel) end - control.ReloadModel = function() -- will automatically set stamper to get a new model of current model and start stamping with new model + function control.ReloadModel() -- will automatically set stamper to get a new model of current model and start stamping with new model resetStamperState() end - control.Pause = function() -- temporarily stops stamping, use resume to start up again + function control.Pause() -- temporarily stops stamping, use resume to start up again if not control.Paused then pauseStamper() control.Paused = true @@ -2927,7 +2913,7 @@ RbxStamper.SetupStamperDragger = function( end end - control.Resume = function() -- resumes stamping, if currently paused + function control.Resume() -- resumes stamping, if currently paused if control.Paused then resumeStamper() control.Paused = false @@ -2936,13 +2922,13 @@ RbxStamper.SetupStamperDragger = function( end end - control.ResetRotation = function() -- resets the model rotation so new models are at default orientation + function control.ResetRotation() -- resets the model rotation so new models are at default orientation -- gInitial90DegreeRotations = 0 -- Note: This function will not always work quite the way we want it to; we will have to build this out further so it works with -- High-Scalability and with the new model orientation setting methods (model:ResetOrientationToIdentity()) [HotThoth] end - control.Destroy = function() -- Stops current Stamp operation and destroys control construct + function control.Destroy() -- Stops current Stamp operation and destroys control construct for i = 1, #mouseCons do mouseCons[i]:disconnect() mouseCons[i] = nil @@ -2980,7 +2966,7 @@ RbxStamper.SetupStamperDragger = function( return control end -RbxStamper.Help = function(funcNameOrFunc) +function RbxStamper.Help(funcNameOrFunc) --input argument can be a string or a function. Should return a description (of arguments and expected side effects) if funcNameOrFunc == "GetStampModel" diff --git a/luau/89449008.luau b/luau/89449008.luau index bcabcab..ba4b367 100644 --- a/luau/89449008.luau +++ b/luau/89449008.luau @@ -1,4 +1,4 @@ --- CoreGui.RobloxGui.Backpack.CoreScripts/BackpackScripts/Back (1?) +-- CoreGui.MercuryGui.Backpack.CoreScripts/BackpackScripts/Back (1?) print "[Mercury]: Loaded corescript 89449008" local UserInputService = game:GetService "UserInputService" @@ -240,6 +240,214 @@ local function swapGearSlot(slot, newGearButton) end end +local function checkForSwap(button, x, y) + local loadoutChildren = currentLoadout:GetChildren() + for i = 1, #loadoutChildren do + if + loadoutChildren[i]:IsA "Frame" + and string.find(loadoutChildren[i].Name, "Slot") + then + if + x >= loadoutChildren[i].AbsolutePosition.x + and x + <= (loadoutChildren[i].AbsolutePosition.x + loadoutChildren[i].AbsoluteSize.x) + then + if + y >= loadoutChildren[i].AbsolutePosition.y + and y + <= (loadoutChildren[i].AbsolutePosition.y + loadoutChildren[i].AbsoluteSize.y) + then + local slot = + tonumber(string.sub(loadoutChildren[i].Name, 5)) + swapGearSlot(slot, button) + return true + end + end + end + end + return false +end + +local function unequipGear(physGear) + physGear.Parent = playerBackpack + updateGridActive() +end + +local function highlight(button) + button.TextColor3 = Color3.new(0, 0, 0) + button.BackgroundColor3 = Color3.new(0.8, 0.8, 0.8) +end + +local function clearHighlight(button) + button.TextColor3 = Color3.new(1, 1, 1) + button.BackgroundColor3 = Color3.new(0, 0, 0) +end + +local function UnequipGearMenuClick(element, menu) + if type(element.Action) ~= "number" then + return + end + local num = element.Action + if num == 1 then -- remove from loadout + unequipGear(menu.Parent.GearReference.Value) + local inventoryButton = menu.Parent + local gearToUnequip = inventoryButton.GearReference.Value + local loadoutChildren = currentLoadout:GetChildren() + local slot = -1 + for i = 1, #loadoutChildren do + if loadoutChildren[i]:IsA "Frame" then + local button = loadoutChildren[i]:GetChildren() + if + button[1] + and button[1].GearReference.Value == gearToUnequip + then + slot = button[1].SlotNumber.Text + break + end + end + end + swapGearSlot(slot, nil) + end +end + +local function clearPreview() + gearPreview.GearImage.Image = "" + gearPreview.GearStats.GearName.Text = "" +end + +local function getGearContextMenu() + local gearContextMenu = New "Frame" { + Active = true, + Name = "UnequipContextMenu", + Size = UDim2.new(0, 115, 0, 70), + Position = UDim2.new(0, -16, 0, -16), + BackgroundTransparency = 1, + Visible = false, + } + + local gearContextMenuButton = New "TextButton" { + Name = "UnequipContextMenuButton", + Text = "", + Style = Enum.ButtonStyle.RobloxButtonDefault, + ZIndex = 8, + Size = UDim2.new(1, 0, 1, -20), + Visible = true, + Parent = gearContextMenu, + } + + local elementHeight = 12 + + local contextMenuElements = {} + local contextMenuElementsName = { "Remove Hotkey" } + + for i = 1, #contextMenuElementsName do + local element = {} + element.Type = "Button" + element.Text = contextMenuElementsName[i] + element.Action = i + element.DoIt = UnequipGearMenuClick + table.insert(contextMenuElements, element) + end + + for i, contextElement in ipairs(contextMenuElements) do + local element = contextElement + if element.Type == "Button" then + local button = New "TextButton" { + Name = "UnequipContextButton" .. i, + BackgroundColor3 = Color3.new(0, 0, 0), + BorderSizePixel = 0, + TextXAlignment = Enum.TextXAlignment.Left, + Text = " " .. contextElement.Text, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size14, + Size = UDim2.new(1, 8, 0, elementHeight), + Position = UDim2.new(0, 0, 0, elementHeight * i), + TextColor3 = Color3.new(1, 1, 1), + ZIndex = 9, + Parent = gearContextMenuButton, + } + + if not IsTouchDevice() then + button.MouseButton1Click:connect(function() + if button.Active and not gearContextMenu.Parent.Active then + pcall(function() + element.DoIt(element, gearContextMenu) + end) + browsingMenu = false + gearContextMenu.Visible = false + clearHighlight(button) + clearPreview() + end + end) + + button.MouseEnter:connect(function() + if button.Active and gearContextMenu.Parent.Active then + highlight(button) + end + end) + button.MouseLeave:connect(function() + if button.Active and gearContextMenu.Parent.Active then + clearHighlight(button) + end + end) + end + + contextElement.Button = button + contextElement.Element = button + elseif element.Type == "Label" then + local frame = Instance.new "Frame" + frame.Name = "ContextLabel" .. i + frame.BackgroundTransparency = 1 + frame.Size = UDim2.new(1, 8, 0, elementHeight) + + element.Label1 = New "TextLabel" { + Name = "Text1", + BackgroundTransparency = 1, + BackgroundColor3 = Color3.new(1, 1, 1), + BorderSizePixel = 0, + TextXAlignment = Enum.TextXAlignment.Left, + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size14, + Position = UDim2.new(0, 0, 0, 0), + Size = UDim2.new(0.5, 0, 1, 0), + TextColor3 = Color3.new(1, 1, 1), + ZIndex = 9, + Parent = frame, + } + + if element.GetText2 then + element.Label2 = New "TextLabel" { + Name = "Text2", + BackgroundTransparency = 1, + BackgroundColor3 = Color3.new(1, 1, 1), + BorderSizePixel = 0, + TextXAlignment = Enum.TextXAlignment.Right, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size14, + Position = UDim2.new(0.5, 0, 0, 0), + Size = UDim2.new(0.5, 0, 1, 0), + TextColor3 = Color3.new(1, 1, 1), + ZIndex = 9, + Parent = frame, + } + end + frame.Parent = gearContextMenuButton + element.Label = frame + element.Element = frame + end + end + + gearContextMenu.ZIndex = 4 + gearContextMenu.MouseLeave:connect(function() + browsingMenu = false + gearContextMenu.Visible = false + clearPreview() + end) + robloxLock(gearContextMenu) + + return gearContextMenu +end + local function resizeGrid() for _, v in pairs(backpackItems) do if not v:FindFirstChild "RobloxBuildTool" then @@ -402,214 +610,6 @@ local function addToGrid(child: Tool | HopperBin) resizeGrid() end -local function unequipGear(physGear) - physGear.Parent = playerBackpack - updateGridActive() -end - -local function highlight(button) - button.TextColor3 = Color3.new(0, 0, 0) - button.BackgroundColor3 = Color3.new(0.8, 0.8, 0.8) -end - -local function clearHighlight(button) - button.TextColor3 = Color3.new(1, 1, 1) - button.BackgroundColor3 = Color3.new(0, 0, 0) -end - -function checkForSwap(button, x, y) - local loadoutChildren = currentLoadout:GetChildren() - for i = 1, #loadoutChildren do - if - loadoutChildren[i]:IsA "Frame" - and string.find(loadoutChildren[i].Name, "Slot") - then - if - x >= loadoutChildren[i].AbsolutePosition.x - and x - <= (loadoutChildren[i].AbsolutePosition.x + loadoutChildren[i].AbsoluteSize.x) - then - if - y >= loadoutChildren[i].AbsolutePosition.y - and y - <= (loadoutChildren[i].AbsolutePosition.y + loadoutChildren[i].AbsoluteSize.y) - then - local slot = - tonumber(string.sub(loadoutChildren[i].Name, 5)) - swapGearSlot(slot, button) - return true - end - end - end - end - return false -end - -local UnequipGearMenuClick = function(element, menu) - if type(element.Action) ~= "number" then - return - end - local num = element.Action - if num == 1 then -- remove from loadout - unequipGear(menu.Parent.GearReference.Value) - local inventoryButton = menu.Parent - local gearToUnequip = inventoryButton.GearReference.Value - local loadoutChildren = currentLoadout:GetChildren() - local slot = -1 - for i = 1, #loadoutChildren do - if loadoutChildren[i]:IsA "Frame" then - local button = loadoutChildren[i]:GetChildren() - if - button[1] - and button[1].GearReference.Value == gearToUnequip - then - slot = button[1].SlotNumber.Text - break - end - end - end - swapGearSlot(slot, nil) - end -end - -local function clearPreview() - gearPreview.GearImage.Image = "" - gearPreview.GearStats.GearName.Text = "" -end - -function getGearContextMenu() - local gearContextMenu = New "Frame" { - Active = true, - Name = "UnequipContextMenu", - Size = UDim2.new(0, 115, 0, 70), - Position = UDim2.new(0, -16, 0, -16), - BackgroundTransparency = 1, - Visible = false, - } - - local gearContextMenuButton = New "TextButton" { - Name = "UnequipContextMenuButton", - Text = "", - Style = Enum.ButtonStyle.RobloxButtonDefault, - ZIndex = 8, - Size = UDim2.new(1, 0, 1, -20), - Visible = true, - Parent = gearContextMenu, - } - - local elementHeight = 12 - - local contextMenuElements = {} - local contextMenuElementsName = { "Remove Hotkey" } - - for i = 1, #contextMenuElementsName do - local element = {} - element.Type = "Button" - element.Text = contextMenuElementsName[i] - element.Action = i - element.DoIt = UnequipGearMenuClick - table.insert(contextMenuElements, element) - end - - for i, contextElement in ipairs(contextMenuElements) do - local element = contextElement - if element.Type == "Button" then - local button = New "TextButton" { - Name = "UnequipContextButton" .. i, - BackgroundColor3 = Color3.new(0, 0, 0), - BorderSizePixel = 0, - TextXAlignment = Enum.TextXAlignment.Left, - Text = ` {contextElement.Text}`, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size14, - Size = UDim2.new(1, 8, 0, elementHeight), - Position = UDim2.new(0, 0, 0, elementHeight * i), - TextColor3 = Color3.new(1, 1, 1), - ZIndex = 9, - Parent = gearContextMenuButton, - } - - if not IsTouchDevice() then - button.MouseButton1Click:connect(function() - if button.Active and not gearContextMenu.Parent.Active then - pcall(function() - element.DoIt(element, gearContextMenu) - end) - browsingMenu = false - gearContextMenu.Visible = false - clearHighlight(button) - clearPreview() - end - end) - - button.MouseEnter:connect(function() - if button.Active and gearContextMenu.Parent.Active then - highlight(button) - end - end) - button.MouseLeave:connect(function() - if button.Active and gearContextMenu.Parent.Active then - clearHighlight(button) - end - end) - end - - contextElement.Button = button - contextElement.Element = button - elseif element.Type == "Label" then - local frame = Instance.new "Frame" - frame.Name = `ContextLabel{i}` - frame.BackgroundTransparency = 1 - frame.Size = UDim2.new(1, 8, 0, elementHeight) - - element.Label1 = New "TextLabel" { - Name = "Text1", - BackgroundTransparency = 1, - BackgroundColor3 = Color3.new(1, 1, 1), - BorderSizePixel = 0, - TextXAlignment = Enum.TextXAlignment.Left, - Font = Enum.Font.ArialBold, - FontSize = Enum.FontSize.Size14, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(0.5, 0, 1, 0), - TextColor3 = Color3.new(1, 1, 1), - ZIndex = 9, - Parent = frame, - } - - if element.GetText2 then - element.Label2 = New "TextLabel" { - Name = "Text2", - BackgroundTransparency = 1, - BackgroundColor3 = Color3.new(1, 1, 1), - BorderSizePixel = 0, - TextXAlignment = Enum.TextXAlignment.Right, - Font = Enum.Font.Arial, - FontSize = Enum.FontSize.Size14, - Position = UDim2.new(0.5, 0, 0, 0), - Size = UDim2.new(0.5, 0, 1, 0), - TextColor3 = Color3.new(1, 1, 1), - ZIndex = 9, - Parent = frame, - } - end - frame.Parent = gearContextMenuButton - element.Label = frame - element.Element = frame - end - end - - gearContextMenu.ZIndex = 4 - gearContextMenu.MouseLeave:connect(function() - browsingMenu = false - gearContextMenu.Visible = false - clearPreview() - end) - robloxLock(gearContextMenu) - - return gearContextMenu -end - local function showPartialGrid(subset) for _, v in pairs(buttons) do v.Parent = nil @@ -917,12 +917,8 @@ currentLoadout.DescendantRemoving:connect(function(descendant) end end) -grid.MouseEnter:connect(function() - clearPreview() -end) -grid.MouseLeave:connect(function() - clearPreview() -end) +grid.MouseEnter:connect(clearPreview) +grid.MouseLeave:connect(clearPreview) player.CharacterRemoving:connect(function() removeCharacterConnections() @@ -971,9 +967,9 @@ end pcall(function() coreGuiChanged( Enum.CoreGuiType.Backpack, - Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack) + game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack) ) - Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) + game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) end) resize() diff --git a/luau/89449093.luau b/luau/89449093.luau index 9ac5c75..c6bab00 100644 --- a/luau/89449093.luau +++ b/luau/89449093.luau @@ -1,4 +1,4 @@ --- CoreGui.RobloxGui.Backpack.CoreScripts/BackpackScripts/Back (2?) +-- CoreGui.MercuryGui.Backpack.CoreScripts/BackpackScripts/Back (2?) print "[Mercury]: Loaded corescript 89449093" local News = require "../Modules/New" @@ -53,8 +53,8 @@ local searchBox = waitForChild(backpack.SearchFrame.SearchBoxFrame, "SearchBox") local searchButton = waitForChild(backpack.SearchFrame, "SearchButton") local resetButton = waitForChild(backpack.SearchFrame, "ResetButton") -local robloxGui = waitForChild(Game.CoreGui, "RobloxGui") -local currentLoadout = waitForChild(robloxGui, "CurrentLoadout") +local mercuryGui = waitForChild(game.CoreGui, "MercuryGui") +local currentLoadout = waitForChild(mercuryGui, "CurrentLoadout") local loadoutBackground = waitForChild(currentLoadout, "Background") local canToggle = true @@ -73,10 +73,6 @@ local backtick = "`" local backpackSize = UDim2.new(0, 600, 0, 400) -if robloxGui.AbsoluteSize.Y <= 320 then - backpackSize = UDim2.new(0, 200, 0, 140) -end - ------------------------ End Locals --------------------------- ---------------------------------------- Public Event Setup ---------------------------------------- @@ -357,9 +353,9 @@ publicFunction("BackpackReady", backpackReady) pcall(function() coreGuiChanged( Enum.CoreGuiType.Backpack, - Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack) + game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack) ) - Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) + game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) end) inventoryButton.MouseButton1Click:connect(newTabClicked) @@ -419,8 +415,3 @@ searchBox.FocusLost:connect(function(enterPressed) end) searchButton.MouseButton1Click:connect(doSearch) resetButton.MouseButton1Click:connect(resetSearch) - -if searchFrame and robloxGui.AbsoluteSize.Y <= 320 then - searchFrame.RobloxLocked = false - searchFrame:Destroy() -end diff --git a/luau/97188756.luau b/luau/97188756.luau index e8a3f7a..d391e7b 100644 --- a/luau/97188756.luau +++ b/luau/97188756.luau @@ -1,11 +1,11 @@ --!strict --- CoreGui.RobloxGui.CoreScripts/ChatScript +-- CoreGui.MercuryGui.CoreScripts/ChatScript print "[Mercury]: Loaded corescript 97188756" local RunService = game:GetService "RunService" local SafeChat = require "../Modules/Safechat.yml" -- THANK YOU DARKLUA -local New = (require "../Modules/New").New +local New = require("../Modules/New").New local forceChatGUI = false @@ -17,20 +17,20 @@ local function WaitForChild(parent: Instance, childName) return parent[childName] end -while not Game.Players.LocalPlayer do +while not game.Players.LocalPlayer do RunService.Heartbeat:wait() end -local Player = Game.Players.LocalPlayer +local Player = game.Players.LocalPlayer while not Player.Character do RunService.Heartbeat:wait() end -local Camera = Game.Workspace.CurrentCamera +local Camera = game.Workspace.CurrentCamera -- Services -local CoreGui = Game:GetService "CoreGui" -local Players = Game:GetService "Players" -local GuiService = Game:GetService "GuiService" +local CoreGui = game:GetService "CoreGui" +local Players = game:GetService "Players" +local GuiService = game:GetService "GuiService" -- Lua Enums local Enums = {} @@ -653,7 +653,7 @@ end -- Create the initial Chat stuff -- Done only once function Chat:CreateGui() - self.Gui = WaitForChild(CoreGui, "RobloxGui") + self.Gui = WaitForChild(CoreGui, "MercuryGui") self.Frame = New "Frame" { Name = "ChatFrame", --Size = self.Configuration.Size; @@ -754,7 +754,7 @@ function Input:OnMouseScroll() wait(0.25) end end - wait(0.03) + wait() end end) if Chat:CheckIfInBounds(Input.Speed) then @@ -883,9 +883,9 @@ function Chat:Initialize() pcall(function() Chat:CoreGuiChanged( Enum.CoreGuiType.Chat, - Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Chat) + game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Chat) ) - Game.StarterGui.CoreGuiChangedSignal:connect( + game.StarterGui.CoreGuiChangedSignal:connect( function(coreGuiType, enabled) Chat:CoreGuiChanged(coreGuiType, enabled) end diff --git a/luau/renderAvatar.luau b/luau/renderAvatar.luau index 8c63d8d..63330ef 100644 --- a/luau/renderAvatar.luau +++ b/luau/renderAvatar.luau @@ -5,7 +5,7 @@ local ThumbnailGenerator = game:GetService "ThumbnailGenerator" local RenderModule = require "../Modules/Render" local SetupAvatar = require "../Modules/Render/SetupAvatar" local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation -local New = (require "../Modules/New").New +local New = require("../Modules/New").New local player = SetupAvatar( _BASE_URL, diff --git a/luau/renderMesh.luau b/luau/renderMesh.luau index 535218c..d278048 100644 --- a/luau/renderMesh.luau +++ b/luau/renderMesh.luau @@ -4,7 +4,7 @@ local ThumbnailGenerator = game:GetService "ThumbnailGenerator" local RenderModule = require "../Modules/Render" local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation -local New = (require "../Modules/New").New +local New = require("../Modules/New").New print(`[{game.JobId}] Starting new render for {_RENDER_TYPE} Id {_ASSET_ID}`)