Formatting and typing improvements to libraries and corescripts

This commit is contained in:
Lewin Kelly 2024-04-10 07:43:51 +01:00
parent 7c9660e0cb
commit ca31246727
32 changed files with 652 additions and 860 deletions

View File

@ -60,9 +60,9 @@ local function springCoefficients(
-- factored out of the solutions to the characteristic equation: -- factored out of the solutions to the characteristic equation:
-- α = Sqrt[1 - ζ^2] -- α = Sqrt[1 - ζ^2]
-- x[t] -> x0(e^-tζω)(α Cos[tα] + ζω Sin[tα])/α -- 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α])/α -- 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 scaledTime = time * speed
local alpha = math.sqrt(1 - damping ^ 2) local alpha = math.sqrt(1 - damping ^ 2)

View File

@ -1,7 +1,7 @@
--!strict --!strict
--[[ --[[
Abstraction layer between Fusion internals and external environments, Abstraction layer between Fusion internals and external environments,
allowing for flexible integration with schedulers and test mocks. allowing for flexible integration with schedulers and test mocks.
]] ]]
local logError = require "./Logging/logError" local logError = require "./Logging/logError"
@ -20,8 +20,8 @@ local currentScheduler: Scheduler? = nil
local lastUpdateStep = 0 local lastUpdateStep = 0
--[[ --[[
Sets the external scheduler that Fusion will use for queuing async tasks. Sets the external scheduler that Fusion will use for queuing async tasks.
Returns the previous scheduler so it can be reset later. Returns the previous scheduler so it can be reset later.
]] ]]
function External.setExternalScheduler(newScheduler: Scheduler?): Scheduler? function External.setExternalScheduler(newScheduler: Scheduler?): Scheduler?
local oldScheduler = currentScheduler local oldScheduler = currentScheduler
@ -36,7 +36,7 @@ function External.setExternalScheduler(newScheduler: Scheduler?): Scheduler?
end 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: () -> ()) function External.doTaskImmediate(resume: () -> ())
if currentScheduler == nil then if currentScheduler == nil then
@ -47,7 +47,7 @@ function External.doTaskImmediate(resume: () -> ())
end 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: () -> ()) function External.doTaskDeferred(resume: () -> ())
if currentScheduler == nil then if currentScheduler == nil then
@ -58,14 +58,14 @@ function External.doTaskDeferred(resume: () -> ())
end end
--[[ --[[
Registers a callback to the update step of the external scheduler. Registers a callback to the update step of the external scheduler.
Returns a function that can be used to disconnect later. Returns a function that can be used to disconnect later.
Callbacks are given the current number of seconds since an arbitrary epoch. Callbacks are given the current number of seconds since an arbitrary epoch.
TODO: This epoch may change between schedulers. We could investigate ways 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 of allowing schedulers to co-operate to keep the epoch the same, so that
monotonicity can be better preserved. monotonicity can be better preserved.
]] ]]
function External.bindToUpdateStep(callback: (now: number) -> ()): () -> () function External.bindToUpdateStep(callback: (now: number) -> ()): () -> ()
local uniqueIdentifier = {} local uniqueIdentifier = {}
@ -76,9 +76,9 @@ function External.bindToUpdateStep(callback: (now: number) -> ()): () -> ()
end end
--[[ --[[
Steps time-dependent systems with the current number of seconds since an 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 arbitrary epoch. This should be called as early as possible in the external
scheduler's update cycle. scheduler's update cycle.
]] ]]
function External.performUpdateStep(now: number) function External.performUpdateStep(now: number)
lastUpdateStep = now lastUpdateStep = now
@ -88,7 +88,7 @@ function External.performUpdateStep(now: number)
end end
--[[ --[[
Returns the timestamp of the last update step. Returns the timestamp of the last update step.
]] ]]
function External.lastUpdateStep() function External.lastUpdateStep()
return lastUpdateStep return lastUpdateStep

View File

@ -136,7 +136,7 @@ function Children:apply(
end end
end end
queueUpdate = function() function queueUpdate()
if not updateQueued then if not updateQueued then
updateQueued = true updateQueued = true
External.doTaskDeferred(updateChildren) External.doTaskDeferred(updateChildren)

View File

@ -1,6 +1,6 @@
--!strict --!strict
--[[ --[[
Mercury implementation for Fusion's abstract scheduler layer. Mercury implementation for Fusion's abstract scheduler layer.
]] ]]
local RunService = game:GetService "RunService" local RunService = game:GetService "RunService"
@ -10,28 +10,28 @@ local External = require "./External"
local MercuryExternal = {} 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: () -> ()) function MercuryExternal.doTaskImmediate(resume: () -> ())
Spawn(resume) Spawn(resume)
end 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: () -> ()) function MercuryExternal.doTaskDeferred(resume: () -> ())
coroutine.resume(coroutine.create(resume)) coroutine.resume(coroutine.create(resume))
end 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() local function performUpdateStep()
External.performUpdateStep(time()) External.performUpdateStep(time())
end end
--[[ --[[
Binds Fusion's update step to RunService step events. Binds Fusion's update step to RunService step events.
]] ]]
local stopSchedulerFunc: () -> ()? = nil local stopSchedulerFunc: () -> ()? = nil
function MercuryExternal.startScheduler() function MercuryExternal.startScheduler()
@ -47,23 +47,23 @@ function MercuryExternal.startScheduler()
-- Enum.RenderPriority.First.Value, -- Enum.RenderPriority.First.Value,
-- performUpdateStep -- performUpdateStep
-- ) -- )
-- stopSchedulerFunc = function() -- function stopSchedulerFunc()
-- RunService:UnbindFromRenderStep(id) -- RunService:UnbindFromRenderStep(id)
-- end -- end
local conn = RunService.RenderStepped:connect(performUpdateStep) local conn = RunService.RenderStepped:connect(performUpdateStep)
stopSchedulerFunc = function() function stopSchedulerFunc()
conn:disconnect() conn:disconnect()
end end
-- else -- else
-- local connection = RunService.Heartbeat:connect(performUpdateStep) -- local connection = RunService.Heartbeat:connect(performUpdateStep)
-- stopSchedulerFunc = function() -- function stopSchedulerFunc()
-- connection:Disconnect() -- connection:Disconnect()
-- end -- end
-- end -- end
end end
--[[ --[[
Unbinds Fusion's update step from RunService step events. Unbinds Fusion's update step from RunService step events.
]] ]]
function MercuryExternal.stopScheduler() function MercuryExternal.stopScheduler()
if stopSchedulerFunc ~= nil then if stopSchedulerFunc ~= nil then

View File

@ -1,7 +1,7 @@
--!strict --!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. the call stack.
]] ]]

View File

@ -1,7 +1,7 @@
--!strict --!strict
--[[ --[[
Returns true if A and B are 'similar' - ie. any user of A would not need Returns true if A and B are 'similar' - ie. any user of A would not need
to recompute if it changed to B. to recompute if it changed to B.
]] ]]
local function isSimilar(a: any, b: any): boolean local function isSimilar(a: any, b: any): boolean

View File

@ -1,8 +1,8 @@
--!strict --!strict
--[[ --[[
Returns true if the given value is not automatically memory managed, and Returns true if the given value is not automatically memory managed, and
requires manual cleanup. requires manual cleanup.
]] ]]
local typeof = require "../../../Modules/Polyfill/typeof" local typeof = require "../../../Modules/Polyfill/typeof"

View File

@ -29,7 +29,7 @@ return function(IsServer: boolean)
function(SingleFire, MultipleFire, IncomingCall) function(SingleFire, MultipleFire, IncomingCall)
-- debug.profilebegin "Red.Listen.Incoming" -- debug.profilebegin "Red.Listen.Incoming"
-- replace nil symbols with nil -- replace nil symbols with nil
if SingleFire.__nil then if SingleFire.__nil then
SingleFire = nil SingleFire = nil
end end
@ -166,7 +166,7 @@ return function(IsServer: boolean)
function(Player, SingleFire, MultipleFire, IncomingCall) function(Player, SingleFire, MultipleFire, IncomingCall)
-- debug.profilebegin "Red.Listen.Incoming" -- debug.profilebegin "Red.Listen.Incoming"
-- replace nil symbols with nil -- replace nil symbols with nil
if SingleFire.__nil then if SingleFire.__nil then
SingleFire = nil SingleFire = nil
end end

View File

@ -28,8 +28,8 @@ local function Red(_, Script: LuaSourceContainer)
end end
return { return {
Load = Red,
Help = function() Help = function()
return "See https://redblox.dev/ for more information." return "See https://redblox.dev/ for more information."
end, end,
Load = Red,
} }

2
Modules/BaseUrl.luau Normal file
View File

@ -0,0 +1,2 @@
local ContentProvider = game:GetService "ContentProvider"

View File

@ -1,7 +1,7 @@
local logEvent local logEvent
return function(...: string) return function(...: string)
if game.Players.LocalPlayer.Name ~= "Heliodex" then if game.Players.LocalPlayer.Name ~= "Heliodex" then -- hehuhuhuehuehe
return return
end end

View File

@ -31,7 +31,7 @@ local easing = {
Bounce = {}, Bounce = {},
} }
local linear = function(t, b, c) local function linear(t, b, c)
return c * t + b return c * t + b
end end
@ -40,15 +40,15 @@ easing.Linear.Out = linear
easing.Linear.InOut = linear easing.Linear.InOut = linear
easing.Linear.OutIn = 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 return c * pow(t, 2) + b
end end
easing.Quad.Out = function(t, b, c) function easing.Quad.Out(t, b, c)
return -c * t * (t - 2) + b return -c * t * (t - 2) + b
end end
easing.Quad.InOut = function(t, b, c) function easing.Quad.InOut(t, b, c)
t *= 2 t *= 2
if t < 1 then if t < 1 then
return c / 2 * pow(t, 2) + b 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 return -c / 2 * ((t - 1) * (t - 3) - 1) + b
end end
easing.Quad.OutIn = function(t, b, c) function easing.Quad.OutIn(t, b, c)
if t < 0.5 then if t < 0.5 then
return easing.Quad.Out(t * 2, b, c / 2) return easing.Quad.Out(t * 2, b, c / 2)
end end
return easing.Quad.In((t * 2) - 1, b + c / 2, c / 2) return easing.Quad.In((t * 2) - 1, b + c / 2, c / 2)
end end
easing.Cubic.In = function(t, b, c) function easing.Cubic.In(t, b, c)
return c * pow(t, 3) + b return c * pow(t, 3) + b
end end
easing.Cubic.Out = function(t, b, c) function easing.Cubic.Out(t, b, c)
t -= 1 t -= 1
return c * (pow(t, 3) + 1) + b return c * (pow(t, 3) + 1) + b
end end
easing.Cubic.InOut = function(t, b, c) function easing.Cubic.InOut(t, b, c)
t *= 2 t *= 2
if t < 1 then if t < 1 then
return c / 2 * t * t * t + b 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 return c / 2 * (t * t * t + 2) + b
end end
easing.Cubic.OutIn = function(t, b, c) function easing.Cubic.OutIn(t, b, c)
if t < 0.5 then if t < 0.5 then
return easing.Cubic.Out(t * 2, b, c / 2) return easing.Cubic.Out(t * 2, b, c / 2)
end end
return easing.Cubic.In((t * 2) - 1, b + c / 2, c / 2) return easing.Cubic.In((t * 2) - 1, b + c / 2, c / 2)
end end
easing.Quart.In = function(t, b, c) function easing.Quart.In(t, b, c)
return c * pow(t, 4) + b return c * pow(t, 4) + b
end end
easing.Quart.Out = function(t, b, c) function easing.Quart.Out(t, b, c)
t -= 1 t -= 1
return -c * (pow(t, 4) - 1) + b return -c * (pow(t, 4) - 1) + b
end end
easing.Quart.InOut = function(t, b, c) function easing.Quart.InOut(t, b, c)
t *= 2 t *= 2
if t < 1 then if t < 1 then
return c / 2 * pow(t, 4) + b 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 return -c / 2 * (pow(t, 4) - 2) + b
end end
easing.Quart.OutIn = function(t, b, c) function easing.Quart.OutIn(t, b, c)
if t < 0.5 then if t < 0.5 then
return easing.Quart.Out(t * 2, b, c / 2) return easing.Quart.Out(t * 2, b, c / 2)
end end
return easing.Quart.In((t * 2) - 1, b + c / 2, c / 2) return easing.Quart.In((t * 2) - 1, b + c / 2, c / 2)
end end
easing.Quint.In = function(t, b, c) function easing.Quint.In(t, b, c)
return c * pow(t, 5) + b return c * pow(t, 5) + b
end end
easing.Quint.Out = function(t, b, c) function easing.Quint.Out(t, b, c)
t -= 1 t -= 1
return c * (pow(t, 5) + 1) + b return c * (pow(t, 5) + 1) + b
end end
easing.Quint.InOut = function(t, b, c) function easing.Quint.InOut(t, b, c)
t *= 2 t *= 2
if t < 1 then if t < 1 then
return c / 2 * pow(t, 5) + b 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 return c / 2 * (pow(t, 5) + 2) + b
end end
easing.Quint.OutIn = function(t, b, c) function easing.Quint.OutIn(t, b, c)
if t < 0.5 then if t < 0.5 then
return easing.Quint.Out(t * 2, b, c / 2) return easing.Quint.Out(t * 2, b, c / 2)
end end
return easing.Quint.In((t * 2) - 1, b + c / 2, c / 2) return easing.Quint.In((t * 2) - 1, b + c / 2, c / 2)
end end
easing.Sine.In = function(t, b, c) function easing.Sine.In(t, b, c)
return -c * cos(t * (pi / 2)) + c + b return -c * cos(t * (pi / 2)) + c + b
end end
easing.Sine.Out = function(t, b, c) function easing.Sine.Out(t, b, c)
return c * sin(t * (pi / 2)) + b return c * sin(t * (pi / 2)) + b
end end
easing.Sine.InOut = function(t, b, c) function easing.Sine.InOut(t, b, c)
return -c / 2 * (cos(pi * t) - 1) + b return -c / 2 * (cos(pi * t) - 1) + b
end end
easing.Sine.OutIn = function(t, b, c) function easing.Sine.OutIn(t, b, c)
if t < 0.5 then if t < 0.5 then
return easing.Sine.Out(t * 2, b, c / 2) return easing.Sine.Out(t * 2, b, c / 2)
end end
return easing.Sine.In((t * 2) - 1, b + c / 2, c / 2) return easing.Sine.In((t * 2) - 1, b + c / 2, c / 2)
end end
easing.Exponential.In = function(t, b, c) function easing.Exponential.In(t, b, c)
if t == 0 then if t == 0 then
return b return b
end end
return c * pow(2, 10 * (t - 1)) + b - c * 0.001 return c * pow(2, 10 * (t - 1)) + b - c * 0.001
end end
easing.Exponential.Out = function(t, b, c) function easing.Exponential.Out(t, b, c)
if t == 1 then if t == 1 then
return b + c return b + c
end end
return c * 1.001 * (-pow(2, -10 * t) + 1) + b return c * 1.001 * (-pow(2, -10 * t) + 1) + b
end end
easing.Exponential.InOut = function(t, b, c) function easing.Exponential.InOut(t, b, c)
if t == 0 then if t == 0 then
return b return b
elseif t == 1 then 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 return c / 2 * 1.0005 * (-pow(2, -10 * t) + 2) + b
end end
easing.Exponential.OutIn = function(t, b, c) function easing.Exponential.OutIn(t, b, c)
if t < 0.5 then if t < 0.5 then
return t.Exponential.Out(t * 2, b, c / 2) return t.Exponential.Out(t * 2, b, c / 2)
end end
return t.Exponential.In((t * 2) - 1, b + c / 2, c / 2) return t.Exponential.In((t * 2) - 1, b + c / 2, c / 2)
end end
easing.Circular.In = function(t, b, c) function easing.Circular.In(t, b, c)
return (-c * (sqrt(1 - pow(t, 2)) - 1) + b) return (-c * (sqrt(1 - pow(t, 2)) - 1) + b)
end end
easing.Circular.Out = function(t, b, c) function easing.Circular.Out(t, b, c)
t -= 1 t -= 1
return (c * sqrt(1 - pow(t, 2)) + b) return (c * sqrt(1 - pow(t, 2)) + b)
end end
easing.Circular.InOut = function(t, b, c) function easing.Circular.InOut(t, b, c)
t *= 2 t *= 2
if t < 1 then if t < 1 then
return -c / 2 * (sqrt(1 - t * t) - 1) + b 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 return c / 2 * (sqrt(1 - t * t) + 1) + b
end end
easing.Circular.OutIn = function(t, b, c) function easing.Circular.OutIn(t, b, c)
if t < 0.5 then if t < 0.5 then
return easing.Circular.Out(t * 2, b, c / 2) return easing.Circular.Out(t * 2, b, c / 2)
end end
return easing.Circular.In((t * 2) - 1, b + c / 2, c / 2) return easing.Circular.In((t * 2) - 1, b + c / 2, c / 2)
end end
easing.Elastic.In = function(t, b, c) --, a, p) function easing.Elastic.In(t, b, c) --, a, p)
if t == 0 then if t == 0 then
return b return b
elseif t == 1 then 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 return -(c * pow(2, 10 * t) * sin((t * 1 - s) * (2 * pi) / p)) + b
end end
easing.Elastic.Out = function(t, b, c) --, a, p) function easing.Elastic.Out(t, b, c) --, a, p)
if t == 0 then if t == 0 then
return b return b
elseif t == 1 then 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 return c * pow(2, -10 * t) * sin((t - s) * (2 * pi) / p) + c + b
end end
easing.Elastic.InOut = function(t, b, c) --, a, p) function easing.Elastic.InOut(t, b, c) --, a, p)
if t == 0 then if t == 0 then
return b return b
end 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 return a * pow(2, -10 * t) * sin((t - s) * (2 * pi) / p) * 0.5 + c + b
end end
easing.Elastic.OutIn = function(t, b, c) --, a, p) function easing.Elastic.OutIn(t, b, c) --, a, p)
if t < 0.5 then if t < 0.5 then
return easing.Elastic.Out(t * 2, b, c / 2) return easing.Elastic.Out(t * 2, b, c / 2)
end end
return easing.Elastic.In((t * 2) - 1, b + c / 2, c / 2) return easing.Elastic.In((t * 2) - 1, b + c / 2, c / 2)
end end
easing.Back.In = function(t, b, c) --, s) function easing.Back.In(t, b, c) --, s)
local s = 1.70158 local s = 1.70158
return c * t * t * ((s + 1) * t - s) + b return c * t * t * ((s + 1) * t - s) + b
end end
easing.Back.Out = function(t, b, c) --, s) function easing.Back.Out(t, b, c) --, s)
local s = 1.70158 local s = 1.70158
t -= 1 t -= 1
return c * (t * t * ((s + 1) * t + s) + 1) + b return c * (t * t * ((s + 1) * t + s) + 1) + b
end end
easing.Back.InOut = function(t, b, c) --, s) function easing.Back.InOut(t, b, c) --, s)
local s = 2.5949095 local s = 2.5949095
t *= 2 t *= 2
if t < 1 then 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 return c / 2 * (t * t * ((s + 1) * t + s) + 2) + b
end end
easing.Back.OutIn = function(t, b, c) --, s) function easing.Back.OutIn(t, b, c) --, s)
if t < 0.5 then if t < 0.5 then
return easing.Back.Out(t * 2, b, c / 2) return easing.Back.Out(t * 2, b, c / 2)
end end
return easing.Back.In((t * 2) - 1, b + c / 2, c / 2) return easing.Back.In((t * 2) - 1, b + c / 2, c / 2)
end end
easing.Bounce.Out = function(t, b, c) function easing.Bounce.Out(t, b, c)
if t < 1 / 2.75 then if t < 1 / 2.75 then
return c * (7.5625 * t * t) + b return c * (7.5625 * t * t) + b
elseif t < 2 / 2.75 then 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 return c * (7.5625 * t * t + 0.984375) + b
end 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 return c - easing.Bounce.Out(1 - t, 0, c) + b
end end
easing.Bounce.InOut = function(t, b, c) function easing.Bounce.InOut(t, b, c)
if t < 0.5 then if t < 0.5 then
return easing.Bounce.In(t * 2, 0, c) * 0.5 + b return easing.Bounce.In(t * 2, 0, c) * 0.5 + b
end end
return easing.Bounce.Out(t * 2 - 1, 0, c) * 0.5 + c * 0.5 + b return easing.Bounce.Out(t * 2 - 1, 0, c) * 0.5 + c * 0.5 + b
end end
easing.Bounce.OutIn = function(t, b, c) function easing.Bounce.OutIn(t, b, c)
if t < 0.5 then if t < 0.5 then
return easing.Bounce.Out(t * 2, b, c / 2) return easing.Bounce.Out(t * 2, b, c / 2)
end end

View File

@ -1,5 +1,5 @@
--!strict --!strict
-- CoreGui.RobloxGui.CoreScripts/PurchasePromptScript -- CoreGui.MercuryGui.CoreScripts/PurchasePromptScript
print "[Mercury]: Loaded corescript 107893730" print "[Mercury]: Loaded corescript 107893730"
-- this script creates the gui and sends the web requests for in game purchase prompts -- this script creates the gui and sends the web requests for in game purchase prompts
@ -12,9 +12,6 @@ local MarketplaceService = game:GetService "MarketplaceService"
local RunService = game:GetService "RunService" local RunService = game:GetService "RunService"
-- wait for important items to appear -- wait for important items to appear
while not Game do
RunService.Heartbeat:wait()
end
while not MarketplaceService do while not MarketplaceService do
RunService.Heartbeat:wait() RunService.Heartbeat:wait()
MarketplaceService = game:GetService "MarketplaceService" MarketplaceService = game:GetService "MarketplaceService"
@ -22,7 +19,7 @@ end
while not game:FindFirstChild "CoreGui" do while not game:FindFirstChild "CoreGui" do
RunService.Heartbeat:wait() RunService.Heartbeat:wait()
end end
while not game.CoreGui:FindFirstChild "RobloxGui" do while not game.CoreGui:FindFirstChild "MercuryGui" do
RunService.Heartbeat:wait() RunService.Heartbeat:wait()
end end
@ -73,7 +70,7 @@ local takeHeaderText = "Take"
local buyFailedHeaderText = "An Error Occurred" local buyFailedHeaderText = "An Error Occurred"
local errorPurchasesDisabledText = "in-game purchases are disabled" 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 purchaseSucceededText = "Your purchase of itemName succeeded!"
local purchaseFailedText = local purchaseFailedText =
@ -492,7 +489,7 @@ local function canPurchaseItem()
if purchasingConsumable then if purchasingConsumable then
local currentProductInfoRaw local currentProductInfoRaw
ok = ypcall(function() ok = ypcall(function()
currentProductInfoRaw = Game:HttpGetAsync( currentProductInfoRaw = game:HttpGetAsync(
`{getSecureApiBaseUrl()}marketplace/productDetails?productid={currentProductId}` `{getSecureApiBaseUrl()}marketplace/productDetails?productid={currentProductId}`
) )
end) end)
@ -849,9 +846,9 @@ local function acceptPurchase()
-- consumables need to use a different url -- consumables need to use a different url
if purchasingConsumable then if purchasingConsumable then
url ..= `submitpurchase?productId={currentProductId}{currencyData}&expectedUnitPrice={currentCurrencyAmount}&placeId={Game.PlaceId}` url ..= `submitpurchase?productId={currentProductId}{currencyData}&expectedUnitPrice={currentCurrencyAmount}&placeId={game.PlaceId}`
else 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 end
local ok, reason = ypcall(function() local ok, reason = ypcall(function()
@ -859,12 +856,7 @@ local function acceptPurchase()
end) end)
-- debug output for us (found in the logs from local) -- debug output for us (found in the logs from local)
print( print("acceptPurchase success from ypcall is ", ok, "reason is", reason)
"acceptPurchase success from ypcall is ",
ok,
"reason is",
reason
)
if tick() - startTime < 1 then if tick() - startTime < 1 then
wait(1) -- allow the purchasing waiting dialog to at least be readable (otherwise it might flash, looks bad)... wait(1) -- allow the purchasing waiting dialog to at least be readable (otherwise it might flash, looks bad)...
@ -877,7 +869,7 @@ local function acceptPurchase()
currentAssetId, currentAssetId,
currentProductId currentProductId
) )
purchaseFailed() purchaseFailed(false)
return return
end end
@ -891,7 +883,7 @@ local function acceptPurchase()
currentAssetId, currentAssetId,
currentProductId currentProductId
) )
purchaseFailed((response.status == "EconomyDisabled")) purchaseFailed(response.status == "EconomyDisabled")
return return
end end
else else
@ -899,7 +891,7 @@ local function acceptPurchase()
"web return response of non parsable JSON on purchase of", "web return response of non parsable JSON on purchase of",
currentAssetId currentAssetId
) )
purchaseFailed() purchaseFailed(false)
return return
end end
@ -922,7 +914,7 @@ local function acceptPurchase()
"tried to buy productId, but no receipt returned. productId was", "tried to buy productId, but no receipt returned. productId was",
currentProductId currentProductId
) )
purchaseFailed() purchaseFailed(false)
return return
end end
MarketplaceService:SignalClientPurchaseSuccess( MarketplaceService:SignalClientPurchaseSuccess(
@ -1038,7 +1030,7 @@ local function createPurchasePromptGui()
purchaseDialog.BackgroundColor3 = purchaseDialog.BackgroundColor3 =
Color3.new(141 / 255, 141 / 255, 141 / 255) Color3.new(141 / 255, 141 / 255, 141 / 255)
purchaseDialog.BorderColor3 = Color3.new(204 / 255, 204 / 255, 204 / 255) purchaseDialog.BorderColor3 = Color3.new(204 / 255, 204 / 255, 204 / 255)
purchaseDialog.Parent = game.CoreGui.RobloxGui purchaseDialog.Parent = game.CoreGui.MercuryGui
local bodyFrame = Instance.new "Frame" local bodyFrame = Instance.new "Frame"
bodyFrame.Name = "BodyFrame" bodyFrame.Name = "BodyFrame"
@ -1248,7 +1240,7 @@ local function createPurchasePromptGui()
end end
local function doPurchasePrompt( local function doPurchasePrompt(
player, player: Player,
assetId, assetId,
equipIfPurchased, equipIfPurchased,
currencyType, currencyType,
@ -1279,7 +1271,7 @@ end
local function doProcessServerPurchaseResponse(serverResponseTable) local function doProcessServerPurchaseResponse(serverResponseTable)
if not serverResponseTable then if not serverResponseTable then
print "Server response table was nil, cancelling purchase" print "Server response table was nil, cancelling purchase"
purchaseFailed() purchaseFailed(false)
return return
end end

View File

@ -6,7 +6,7 @@ local Players = game:GetService "Players"
local RunService = game:GetService "RunService" local RunService = game:GetService "RunService"
local MaxLength = 35 local MaxLength = 35
local New = (require "../Modules/New").New local New = require("../Modules/New").New
local logEvent: BindableEvent local logEvent: BindableEvent
@ -248,7 +248,7 @@ end
function utility.exit() function utility.exit()
logEvent:Fire("Goodbye!", Color3.new(1, 1, 0.3)) logEvent:Fire("Goodbye!", Color3.new(1, 1, 0.3))
for i = 1, MaxLength do for _ = 1, MaxLength do
logEvent:Fire() logEvent:Fire()
RunService.RenderStepped:wait() RunService.RenderStepped:wait()
end end

View File

@ -1,5 +1,5 @@
--!strict --!strict
-- CoreGui.RobloxGui.CoreScripts/ToolTip -- CoreGui.MercuryGui.CoreScripts/ToolTip
print "[Mercury]: Loaded corescript 36868950" print "[Mercury]: Loaded corescript 36868950"
local News = require "../Modules/New" local News = require "../Modules/New"
@ -8,8 +8,8 @@ local Hydrate = News.Hydrate
local RunService = game:GetService "RunService" local RunService = game:GetService "RunService"
local RobloxGui = script.Parent local MercuryGui = script.Parent :: ScreenGui
local controlFrame = RobloxGui:FindFirstChild "ControlFrame" local controlFrame = MercuryGui:FindFirstChild "ControlFrame"
if not controlFrame then if not controlFrame then
return return

View File

@ -36,9 +36,10 @@ local screenGui = CoreGui:FindFirstChild "RobloxGui" :: ScreenGui & {
Backpack: Frame, Backpack: Frame,
CurrentLoadout: Frame, CurrentLoadout: Frame,
} }
screenGui.Name = "MercuryGui" -- lmao lel lol lmfao
local scripts = { local scripts = {
[36868950] = "CoreScripts/ToolTip", -- ToolTipper (creates tool tips for gui) [36868950] = "CoreScripts/ToolTip", -- ToolTipper (creates tool tips for gui)
[46295863] = "CoreScripts/Settings", -- SettingsScript [46295863] = "CoreScripts/Settings", -- SettingsScript
[39250920] = "CoreScripts/MainBotChatScript", -- MainBotChatScript [39250920] = "CoreScripts/MainBotChatScript", -- MainBotChatScript
[48488451] = "CoreScripts/PopupScript", -- Popup Script [48488451] = "CoreScripts/PopupScript", -- Popup Script

View File

@ -1,5 +1,5 @@
--!strict --!strict
-- CoreGui.RobloxGui.CoreScripts/MainBotChatScript -- CoreGui.MercuryGui.CoreScripts/MainBotChatScript
print "[Mercury]: Loaded corescript 39250920" print "[Mercury]: Loaded corescript 39250920"
local News = require "../Modules/New" local News = require "../Modules/New"
@ -42,11 +42,11 @@ local dialogConnections = {}
local gui local gui
waitForChild(game, "CoreGui") waitForChild(game, "CoreGui")
waitForChild(game.CoreGui, "RobloxGui") waitForChild(game.CoreGui, "MercuryGui")
if game.CoreGui.RobloxGui:FindFirstChild "ControlFrame" then if game.CoreGui.MercuryGui:FindFirstChild "ControlFrame" then
gui = game.CoreGui.RobloxGui.ControlFrame gui = game.CoreGui.MercuryGui.ControlFrame
else else
gui = game.CoreGui.RobloxGui gui = game.CoreGui.MercuryGui
end end
local function currentTone() local function currentTone()
@ -302,7 +302,7 @@ local function presentDialogChoices(talkingPart, dialogChoices)
end end
lastChoice.Position = UDim2.new(0, 0, 0, yPosition) 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.Size = UDim2.new(0, 350, 0, yPosition + 24 + 32)
mainFrame.Position = UDim2.new(0, 20, 0, -mainFrame.Size.Y.Offset - 20) mainFrame.Position = UDim2.new(0, 20, 0, -mainFrame.Size.Y.Offset - 20)

View File

@ -24,13 +24,11 @@ local function ScopedConnect(
--Connection on parentInstance is scoped by parentInstance (when destroyed, it goes away) --Connection on parentInstance is scoped by parentInstance (when destroyed, it goes away)
local function tryConnect() 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 --Entering the world, make sure we are connected/synced
if not eventConnection then eventConnection = instance[event]:connect(signalFunc)
eventConnection = instance[event]:connect(signalFunc) if syncFunc then
if syncFunc then syncFunc()
syncFunc()
end
end end
else else
--Probably leaving the world, so disconnect for now --Probably leaving the world, so disconnect for now
@ -375,7 +373,7 @@ function RbxGui.CreateDropDownMenu(
end end
local scrollBarPosition = 1 local scrollBarPosition = 1
local updateScroll = function() local function updateScroll()
if scrollUpButton then if scrollUpButton then
scrollUpButton.Active = scrollBarPosition > 1 scrollUpButton.Active = scrollBarPosition > 1
end end
@ -414,7 +412,7 @@ function RbxGui.CreateDropDownMenu(
end end
end end
end end
local toggleVisibility = function() local function toggleVisibility()
dropDownSelected = not dropDownSelected dropDownSelected = not dropDownSelected
areaSoak.Visible = not areaSoak.Visible areaSoak.Visible = not areaSoak.Visible
@ -431,7 +429,7 @@ function RbxGui.CreateDropDownMenu(
end end
droppedDownMenu.MouseButton1Click:connect(toggleVisibility) droppedDownMenu.MouseButton1Click:connect(toggleVisibility)
local updateSelection = function(text) local function updateSelection(text)
local foundItem = false local foundItem = false
local children = droppedDownMenu:GetChildren() local children = droppedDownMenu:GetChildren()
local childNum = 1 local childNum = 1
@ -819,7 +817,7 @@ function RbxGui.LayoutGuiObjects(frame, guiObjects, settingsTable)
child.Parent = wrapperFrame child.Parent = wrapperFrame
end end
local recalculate = function() local function recalculate()
RunService.Heartbeat:wait() RunService.Heartbeat:wait()
layoutGuiObjectsHelper(wrapperFrame, guiObjects, settingsTable) layoutGuiObjectsHelper(wrapperFrame, guiObjects, settingsTable)
end end
@ -1167,22 +1165,18 @@ function RbxGui.CreateTrueScrollingFrame()
end end
local function drillDownSetHighLow(instance: GuiObject) 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 return
end elseif (lowY and lowY > instance.AbsolutePosition.Y) or not lowY then
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
lowY = instance.AbsolutePosition.Y lowY = instance.AbsolutePosition.Y
end end
if if
( (
highY highY
@ -1508,14 +1502,11 @@ function RbxGui.CreateTrueScrollingFrame()
end end
local function descendantChanged(this, prop) local function descendantChanged(this, prop)
if internalChange then if
return not internalChange
end and this.Visible
if not this.Visible then and (prop == "Size" or prop == "Position")
return then
end
if prop == "Size" or prop == "Position" then
RunService.Heartbeat:wait() RunService.Heartbeat:wait()
highLowRecheck() highLowRecheck()
end end
@ -1524,9 +1515,7 @@ function RbxGui.CreateTrueScrollingFrame()
scrollingFrame.DescendantAdded:connect(function(instance) scrollingFrame.DescendantAdded:connect(function(instance)
if not instance:IsA "GuiObject" then if not instance:IsA "GuiObject" then
return return
end elseif instance.Visible then
if instance.Visible then
RunService.Heartbeat:wait() -- wait a heartbeat for sizes to reconfig RunService.Heartbeat:wait() -- wait a heartbeat for sizes to reconfig
highLowRecheck() highLowRecheck()
end end
@ -1541,8 +1530,7 @@ function RbxGui.CreateTrueScrollingFrame()
scrollingFrame.DescendantRemoving:connect(function(instance) scrollingFrame.DescendantRemoving:connect(function(instance)
if not instance:IsA "GuiObject" then if not instance:IsA "GuiObject" then
return return
end elseif descendantsChangeConMap[instance] then
if descendantsChangeConMap[instance] then
descendantsChangeConMap[instance]:disconnect() descendantsChangeConMap[instance]:disconnect()
descendantsChangeConMap[instance] = nil descendantsChangeConMap[instance] = nil
end end
@ -1551,11 +1539,7 @@ function RbxGui.CreateTrueScrollingFrame()
end) end)
scrollingFrame.Changed:connect(function(prop) scrollingFrame.Changed:connect(function(prop)
if prop == "AbsoluteSize" then if prop == "AbsoluteSize" and not (highY and lowY) then
if not highY or not lowY then
return
end
highLowRecheck() highLowRecheck()
setSliderSizeAndPosition() setSliderSizeAndPosition()
end end
@ -1622,7 +1606,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle)
local rowSize = 0 local rowSize = 0
local howManyDisplayed = 0 local howManyDisplayed = 0
local layoutGridScrollBar = function() local function layoutGridScrollBar()
howManyDisplayed = 0 howManyDisplayed = 0
local guiObjects = {} local guiObjects = {}
if orderList then if orderList then
@ -1805,7 +1789,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle)
scrollDrag.Visible = scrollDrag.Active scrollDrag.Visible = scrollDrag.Active
end end
local layoutSimpleScrollBar = function() local function layoutSimpleScrollBar()
local guiObjects = {} local guiObjects = {}
howManyDisplayed = 0 howManyDisplayed = 0
@ -1902,7 +1886,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle)
scrollDrag.Visible = scrollDrag.Active scrollDrag.Visible = scrollDrag.Active
end end
local moveDragger = function() local function moveDragger()
local guiObjects = 0 local guiObjects = 0
local children = frame:GetChildren() local children = frame:GetChildren()
if children then if children then
@ -1952,7 +1936,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle)
end end
local reentrancyGuard = false local reentrancyGuard = false
local recalculate = function() local function recalculate()
if reentrancyGuard then if reentrancyGuard then
return return
end end
@ -1975,7 +1959,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle)
reentrancyGuard = false reentrancyGuard = false
end end
local doScrollUp = function() local function doScrollUp()
scrollPosition -= rowSize scrollPosition -= rowSize
if scrollPosition < 1 then if scrollPosition < 1 then
scrollPosition = 1 scrollPosition = 1
@ -1983,7 +1967,7 @@ function RbxGui.CreateScrollingFrame(orderList: { GuiObject }?, scrollStyle)
recalculate() recalculate()
end end
local doScrollDown = function() local function doScrollDown()
scrollPosition += rowSize scrollPosition += rowSize
recalculate() recalculate()
end end
@ -2260,7 +2244,7 @@ function RbxGui.AutoTruncateTextObject(textLabel: TextLabel)
end end
else else
local len = string.len(text) local len = string.len(text)
textLabel.Text = `{text}~` textLabel.Text = text .. "~"
--Shrink the text --Shrink the text
local textSize = binaryGrow(0, len, function(pos) local textSize = binaryGrow(0, len, function(pos)
@ -2268,7 +2252,7 @@ function RbxGui.AutoTruncateTextObject(textLabel: TextLabel)
or string.sub(text, 1, pos) .. "~" or string.sub(text, 1, pos) .. "~"
return textLabel.TextFits return textLabel.TextFits
end) end)
shortText = `{string.sub(text, 1, textSize)}~` shortText = string.sub(text, 1, textSize) .. "~"
textLabel.Text = shortText textLabel.Text = shortText
--Make sure the fullLabel fits --Make sure the fullLabel fits
@ -2423,7 +2407,7 @@ function RbxGui.CreateTutorial(name, tutorialKey, createButtons: boolean)
return visiblePage return visiblePage
end end
local showTutorial = function(alwaysShow) local function showTutorial(alwaysShow)
if if
alwaysShow alwaysShow
or UserSettings().GameSettings:GetTutorialState(tutorialKey) or UserSettings().GameSettings:GetTutorialState(tutorialKey)
@ -2446,7 +2430,7 @@ function RbxGui.CreateTutorial(name, tutorialKey, createButtons: boolean)
end end
end end
local dismissTutorial = function() local function dismissTutorial()
local currentTutorialPage = getVisiblePageAndHideOthers() local currentTutorialPage = getVisiblePageAndHideOthers()
if currentTutorialPage then if currentTutorialPage then
@ -2461,7 +2445,7 @@ function RbxGui.CreateTutorial(name, tutorialKey, createButtons: boolean)
UserSettings().GameSettings:SetTutorialState(tutorialKey, true) UserSettings().GameSettings:SetTutorialState(tutorialKey, true)
end end
local gotoPage = function(pageNum) local function gotoPage(pageNum)
local page = pages:FindFirstChild("TutorialPage" .. pageNum) local page = pages:FindFirstChild("TutorialPage" .. pageNum)
local currentTutorialPage = getVisiblePageAndHideOthers() local currentTutorialPage = getVisiblePageAndHideOthers()
TransitionTutorialPages( TransitionTutorialPages(
@ -2647,7 +2631,7 @@ function RbxGui.CreateTextTutorialPage(name, text, skipTutorial)
return frame return frame
end end
RbxGui.CreateImageTutorialPage = function( function RbxGui.CreateImageTutorialPage(
name, name,
imageAsset, imageAsset,
x: number, x: number,
@ -2770,7 +2754,7 @@ function RbxGui.AddTutorialPage(
tutorialPage.Parent = tutorial.Pages tutorialPage.Parent = tutorial.Pages
end end
RbxGui.CreateSetPanel = function( function RbxGui.CreateSetPanel(
userIdsForSets, userIdsForSets,
objectSelected, objectSelected,
dialogClosed, dialogClosed,
@ -3662,7 +3646,7 @@ RbxGui.CreateSetPanel = function(
end end
end) end)
local setVisibilityFunction = function(visible) local function setVisibilityFunction(visible)
if visible then if visible then
setGui.SetPanel.Visible = true setGui.SetPanel.Visible = true
else else
@ -3670,7 +3654,7 @@ RbxGui.CreateSetPanel = function(
end end
end end
local getVisibilityFunction = function() local function getVisibilityFunction()
if setGui then if setGui then
if setGui:FindFirstChild "SetPanel" then if setGui:FindFirstChild "SetPanel" then
return setGui.SetPanel.Visible return setGui.SetPanel.Visible
@ -3735,7 +3719,7 @@ for k, v in pairs(EnumMaterialNames) do
StringChoices[v] = k StringChoices[v] = k
end end
RbxGui.CreateTerrainMaterialSelector = function(size, position) function RbxGui.CreateTerrainMaterialSelector(size, position)
local terrainMaterialSelectionChanged = Instance.new "BindableEvent" local terrainMaterialSelectionChanged = Instance.new "BindableEvent"
terrainMaterialSelectionChanged.Name = "TerrainMaterialSelectionChanged" terrainMaterialSelectionChanged.Name = "TerrainMaterialSelectionChanged"
@ -3898,7 +3882,7 @@ RbxGui.CreateTerrainMaterialSelector = function(size, position)
return frame, terrainMaterialSelectionChanged, forceTerrainMaterialSelection return frame, terrainMaterialSelectionChanged, forceTerrainMaterialSelection
end end
RbxGui.CreateLoadingFrame = function(name, size, position) function RbxGui.CreateLoadingFrame(name, size, position)
ContentProvider:Preload "http://banland.xyz/asset?id=35238053" ContentProvider:Preload "http://banland.xyz/asset?id=35238053"
local loadingFrame = New "Frame" { local loadingFrame = New "Frame" {
@ -4285,11 +4269,8 @@ function RbxGui.CreatePluginFrame(
Position = UDim2.new(1, 0, 0, 0), Position = UDim2.new(1, 0, 0, 0),
}, },
} }
if size then control.Size = size and UDim2.new(0, 21, size.Y.Scale, size.Y.Offset)
control.Size = UDim2.new(0, 21, size.Y.Scale, size.Y.Offset) or UDim2.new(0, 21, 0, 400)
else
control.Size = UDim2.new(0, 21, 0, 400)
end
control:FindFirstChild("ScrollDownButton").Position = control:FindFirstChild("ScrollDownButton").Position =
UDim2.new(0, 0, 1, -20) UDim2.new(0, 0, 1, -20)
@ -4419,85 +4400,85 @@ function RbxGui.CreatePluginFrame(
return dragBar, widgetContainer, helpFrame, closeEvent return dragBar, widgetContainer, helpFrame, closeEvent
end end
function RbxGui.Help(funcNameOrFunc) 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) -- input argument can be a string or a function. Should return a description (of arguments and expected side effects)
if if
funcNameOrFunc == "CreatePropertyDropDownMenu" funcNameOrFunc == "CreatePropertyDropDownMenu"
or funcNameOrFunc == RbxGui.CreatePropertyDropDownMenu or funcNameOrFunc == RbxGui.CreatePropertyDropDownMenu
then then
return "Function CreatePropertyDropDownMenu. " return [[Function CreatePropertyDropDownMenu.
.. "Arguments: (instance, propertyName, enumType). " 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'" 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 elseif
funcNameOrFunc == "CreateDropDownMenu" funcNameOrFunc == "CreateDropDownMenu"
or funcNameOrFunc == RbxGui.CreateDropDownMenu or funcNameOrFunc == RbxGui.CreateDropDownMenu
then then
return "Function CreateDropDownMenu. " return [[Function CreateDropDownMenu.
.. "Arguments: (items, onItemSelected). " 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" 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 elseif
funcNameOrFunc == "CreateMessageDialog" funcNameOrFunc == "CreateMessageDialog"
or funcNameOrFunc == RbxGui.CreateMessageDialog or funcNameOrFunc == RbxGui.CreateMessageDialog
then then
return "Function CreateMessageDialog. " return [[Function CreateMessageDialog.
.. "Arguments: (title, message, buttons). " 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" 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 elseif
funcNameOrFunc == "CreateStyledMessageDialog" funcNameOrFunc == "CreateStyledMessageDialog"
or funcNameOrFunc == RbxGui.CreateStyledMessageDialog or funcNameOrFunc == RbxGui.CreateStyledMessageDialog
then then
return "Function CreateStyledMessageDialog. " return [[Function CreateStyledMessageDialog.
.. "Arguments: (title, message, style, buttons). " 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" 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 elseif
funcNameOrFunc == "GetFontHeight" funcNameOrFunc == "GetFontHeight"
or funcNameOrFunc == RbxGui.GetFontHeight or funcNameOrFunc == RbxGui.GetFontHeight
then then
return "Function GetFontHeight. " return [[Function GetFontHeight.
.. "Arguments: (font, fontSize). " Arguments: (font, fontSize).
.. "Side effect: returns the size in pixels of the given font + fontSize" Side effect: returns the size in pixels of the given font + fontSize]]
elseif elseif
funcNameOrFunc == "CreateScrollingFrame" funcNameOrFunc == "CreateScrollingFrame"
or funcNameOrFunc == RbxGui.CreateScrollingFrame or funcNameOrFunc == RbxGui.CreateScrollingFrame
then then
return "Function CreateScrollingFrame. " return [[Function CreateScrollingFrame.
.. "Arguments: (orderList, style) " 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)" 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 elseif
funcNameOrFunc == "CreateTrueScrollingFrame" funcNameOrFunc == "CreateTrueScrollingFrame"
or funcNameOrFunc == RbxGui.CreateTrueScrollingFrame or funcNameOrFunc == RbxGui.CreateTrueScrollingFrame
then then
return "Function CreateTrueScrollingFrame. " return [[Function CreateTrueScrollingFrame.
.. "Arguments: (nil) " 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." 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 elseif
funcNameOrFunc == "AutoTruncateTextObject" funcNameOrFunc == "AutoTruncateTextObject"
or funcNameOrFunc == RbxGui.AutoTruncateTextObject or funcNameOrFunc == RbxGui.AutoTruncateTextObject
then then
return "Function AutoTruncateTextObject. " return [[Function AutoTruncateTextObject.
.. "Arguments: (textLabel) " 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" 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 elseif
funcNameOrFunc == "CreateSlider" funcNameOrFunc == "CreateSlider"
or funcNameOrFunc == RbxGui.CreateSlider or funcNameOrFunc == RbxGui.CreateSlider
then then
return "Function CreateSlider. " return [[Function CreateSlider.
.. "Arguments: (steps, width, position) " 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." 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 elseif
funcNameOrFunc == "CreateLoadingFrame" funcNameOrFunc == "CreateLoadingFrame"
or funcNameOrFunc == RbxGui.CreateLoadingFrame or funcNameOrFunc == RbxGui.CreateLoadingFrame
then then
return "Function CreateLoadingFrame. " return [[Function CreateLoadingFrame.
.. "Arguments: (name, size, position) " 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." 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 elseif
funcNameOrFunc == "CreateTerrainMaterialSelector" funcNameOrFunc == "CreateTerrainMaterialSelector"
or funcNameOrFunc == RbxGui.CreateTerrainMaterialSelector or funcNameOrFunc == RbxGui.CreateTerrainMaterialSelector
then then
return "Function CreateTerrainMaterialSelector. " return [[Function CreateTerrainMaterialSelector.
.. "Arguments: (size, position) " 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." Side effect: Size and position are UDim2 values that specifies the selector's size and position. Both size and position are optional arguments. This method returns 3 objects (terrainSelectorGui, terrainSelected, forceTerrainSelection). terrainSelectorGui is just the gui object that we generate with this function, parent it as you like. TerrainSelected is a BindableEvent that is fired whenever a new terrain type is selected in the gui. ForceTerrainSelection is a function that takes an argument of Enum.CellMaterial and will force the gui to show that material as currently selected.]]
end end
return "No help available for this function" return "No help available for this function"
end end

View File

@ -1,5 +1,5 @@
--!strict --!strict
-- CoreGui.RobloxGui.CoreScripts/Settings -- CoreGui.MercuryGui.CoreScripts/Settings
print "[Mercury]: Loaded corescript 46295863" print "[Mercury]: Loaded corescript 46295863"
local News = require "../Modules/New" local News = require "../Modules/New"
@ -310,16 +310,14 @@ end
local function setDisabledState(guiObject) local function setDisabledState(guiObject)
if not guiObject then if not guiObject then
return return
end elseif guiObject:IsA "TextLabel" then
if guiObject:IsA "TextLabel" then
guiObject.TextTransparency = 0.9 guiObject.TextTransparency = 0.9
elseif guiObject:IsA "TextButton" then elseif guiObject:IsA "TextButton" then
guiObject.TextTransparency = 0.9 guiObject.TextTransparency = 0.9
guiObject.Active = false guiObject.Active = false
elseif guiObject.ClassName then elseif guiObject.ClassName then
print( print(
"setDisabledState() got object of unsupported type. object type is ", "setDisabledState() got object of unsupported type. object type is ",
guiObject.ClassName guiObject.ClassName
) )
end end
@ -1251,10 +1249,7 @@ local function createGameSettingsMenu(baseZIndex, _)
end) end)
graphicsLevel.Changed:connect(function(_) graphicsLevel.Changed:connect(function(_)
if isAutoGraphics then if isAutoGraphics or not listenToGraphicsLevelChange then
return
end
if not listenToGraphicsLevelChange then
return return
end end
@ -1287,9 +1282,7 @@ local function createGameSettingsMenu(baseZIndex, _)
autoGraphicsButton.MouseButton1Click:connect(function() autoGraphicsButton.MouseButton1Click:connect(function()
if inStudioMode and not game.Players.LocalPlayer then if inStudioMode and not game.Players.LocalPlayer then
return return
end elseif not isAutoGraphics then
if not isAutoGraphics then
goToAutoGraphics() goToAutoGraphics()
else else
goToManualGraphics(graphicsLevel.Value) goToManualGraphics(graphicsLevel.Value)
@ -1297,11 +1290,9 @@ local function createGameSettingsMenu(baseZIndex, _)
end) end)
game.GraphicsQualityChangeRequest:connect(function(graphicsIncrease) game.GraphicsQualityChangeRequest:connect(function(graphicsIncrease)
if isAutoGraphics then if isAutoGraphics then -- only can set graphics in manual mode
return return
end -- only can set graphics in manual mode elseif graphicsIncrease then
if graphicsIncrease then
if (graphicsLevel.Value + 1) > GraphicsQualityLevels then if (graphicsLevel.Value + 1) > GraphicsQualityLevels then
return return
end end
@ -1398,9 +1389,7 @@ local function createGameSettingsMenu(baseZIndex, _)
studioCheckbox.MouseButton1Click:connect(function() studioCheckbox.MouseButton1Click:connect(function()
if not studioCheckbox.Active then if not studioCheckbox.Active then
return return
end elseif studioCheckbox.Text == "" then
if studioCheckbox.Text == "" then
studioCheckbox.Text = "X" studioCheckbox.Text = "X"
else else
studioCheckbox.Text = "" studioCheckbox.Text = ""
@ -1514,7 +1503,7 @@ local function createGameSettingsMenu(baseZIndex, _)
videoCaptureDropDown.DropDownMenuButton.ZIndex = baseZIndex + 4 videoCaptureDropDown.DropDownMenuButton.ZIndex = baseZIndex + 4
videoCaptureDropDown.DropDownMenuButton.Icon.ZIndex = baseZIndex + 4 videoCaptureDropDown.DropDownMenuButton.Icon.ZIndex = baseZIndex + 4
syncVideoCaptureSetting = function() function syncVideoCaptureSetting()
if if
UserSettings().GameSettings.VideoUploadPromptBehavior UserSettings().GameSettings.VideoUploadPromptBehavior
== Enum.UploadSetting.Never == Enum.UploadSetting.Never
@ -1547,7 +1536,7 @@ local function createGameSettingsMenu(baseZIndex, _)
Parent = gameSettingsMenuFrame, Parent = gameSettingsMenuFrame,
} }
mouseLockLabel = CoreGui.RobloxGui:FindFirstChild("MouseLockLabel", true) mouseLockLabel = CoreGui.MercuryGui:FindFirstChild("MouseLockLabel", true)
local enumItems = Enum.ControlMode:GetEnumItems() local enumItems = Enum.ControlMode:GetEnumItems()
local enumNames = {} local enumNames = {}
@ -1595,7 +1584,7 @@ GuiService:AddKey "r"
local baseZIndex = 0 local baseZIndex = 0
if UserSettings then if UserSettings then
local createSettingsDialog = function() local function createSettingsDialog()
waitForChild(gui, "BottomLeftControl") waitForChild(gui, "BottomLeftControl")
settingsButton = gui.BottomLeftControl:FindFirstChild "SettingsButton" settingsButton = gui.BottomLeftControl:FindFirstChild "SettingsButton"
@ -1674,7 +1663,7 @@ if UserSettings then
end) end)
end end
CoreGui.RobloxGui.Changed:connect( CoreGui.MercuryGui.Changed:connect(
function(prop) -- We have stopped recording when we resize function(prop) -- We have stopped recording when we resize
if prop == "AbsoluteSize" and recordingVideo then if prop == "AbsoluteSize" and recordingVideo then
recordVideoClick( recordVideoClick(
@ -1979,7 +1968,7 @@ if UserSettings then
end) end)
end --UserSettings call end --UserSettings call
local createSaveDialogs = function() local function createSaveDialogs()
local shield = New "TextButton" { local shield = New "TextButton" {
Text = "", Text = "",
AutoButtonColor = false, AutoButtonColor = false,
@ -2109,7 +2098,7 @@ local createSaveDialogs = function()
) )
end end
save = function() function save()
saveDialogMessageBox.Visible = false saveDialogMessageBox.Visible = false
--Show the spinner dialog --Show the spinner dialog
@ -2160,25 +2149,25 @@ local createSaveDialogs = function()
end end
end end
saveLocal = function() function saveLocal()
errorDialogMessageBox.Visible = false errorDialogMessageBox.Visible = false
game:FinishShutdown(true) game:FinishShutdown(true)
clearAndResetDialog() clearAndResetDialog()
end end
dontSave = function() function dontSave()
saveDialogMessageBox.Visible = false saveDialogMessageBox.Visible = false
errorDialogMessageBox.Visible = false errorDialogMessageBox.Visible = false
game:FinishShutdown(false) game:FinishShutdown(false)
clearAndResetDialog() clearAndResetDialog()
end end
cancel = function() function cancel()
saveDialogMessageBox.Visible = false saveDialogMessageBox.Visible = false
errorDialogMessageBox.Visible = false errorDialogMessageBox.Visible = false
clearAndResetDialog() clearAndResetDialog()
end end
clearAndResetDialog = function() function clearAndResetDialog()
saveDialogMessageBox.Visible = true saveDialogMessageBox.Visible = true
errorDialogMessageBox.Visible = false errorDialogMessageBox.Visible = false
spinnerDialog.Visible = false spinnerDialog.Visible = false
@ -2191,7 +2180,7 @@ local createSaveDialogs = function()
return shield return shield
end end
local createReportAbuseDialog = function() local function createReportAbuseDialog()
--Only show things if we are a NetworkClient --Only show things if we are a NetworkClient
waitForChild(game, "NetworkClient") waitForChild(game, "NetworkClient")
@ -2239,7 +2228,7 @@ local createReportAbuseDialog = function()
local calmingMessageBox = Hydrate( local calmingMessageBox = Hydrate(
RbxGui.CreateMessageDialog( RbxGui.CreateMessageDialog(
"Thanks for your report!", "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 messageBoxButtons
) )
) { ) {
@ -2322,7 +2311,7 @@ local createReportAbuseDialog = function()
}, },
New "TextLabel" { New "TextLabel" {
Name = "Description", 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), TextColor3 = Color3I(221, 221, 221),
Position = UDim2.new(0, 0, 0, 55), Position = UDim2.new(0, 0, 0, 55),
Size = UDim2.new(1, 0, 0, 40), Size = UDim2.new(1, 0, 0, 40),
@ -2492,8 +2481,8 @@ local createReportAbuseDialog = function()
Parent = reportAbuseFrame, Parent = reportAbuseFrame,
} }
closeAndResetDialog = function() function closeAndResetDialog()
--Delete old player combo box -- Delete old player combo box
local oldComboBox = reportAbuseFrame:FindFirstChild "PlayersComboBox" local oldComboBox = reportAbuseFrame:FindFirstChild "PlayersComboBox"
if oldComboBox then if oldComboBox then
oldComboBox.Parent = nil oldComboBox.Parent = nil
@ -2549,7 +2538,7 @@ if isSaveDialogSupported then
local saveDialogs = createSaveDialogs() local saveDialogs = createSaveDialogs()
saveDialogs.Parent = gui saveDialogs.Parent = gui
game.RequestShutdown = function() function game.RequestShutdown()
table.insert(centerDialogs, saveDialogs) table.insert(centerDialogs, saveDialogs)
game.GuiService:AddCenterDialog( game.GuiService:AddCenterDialog(
saveDialogs, saveDialogs,

View File

@ -1,5 +1,5 @@
--!strict --!strict
-- CoreGui.RobloxGui.CoreScripts/PlayerListScript -- CoreGui.MercuryGui.CoreScripts/PlayerListScript
print "[Mercury]: Loaded corescript 48488235" print "[Mercury]: Loaded corescript 48488235"
local RunService = game:GetService "RunService" local RunService = game:GetService "RunService"
@ -87,7 +87,7 @@ local function getMembershipTypeIcon(membershipType, playerName)
elseif membershipType == Enum.MembershipType.OutrageousBuildersClub then elseif membershipType == Enum.MembershipType.OutrageousBuildersClub then
return "rbxasset://textures/ui/TinyObcIcon.png" return "rbxasset://textures/ui/TinyObcIcon.png"
else else
error(`Unknown membershipType {membershipType}`) error("Unknown membershipType " .. membershipType)
end end
end end
@ -104,7 +104,7 @@ local function getFriendStatusIcon(friendStatus)
elseif friendStatus == Enum.FriendStatus.FriendRequestReceived then elseif friendStatus == Enum.FriendStatus.FriendRequestReceived then
return "http://banland.xyz/asset?id=99776838" return "http://banland.xyz/asset?id=99776838"
else else
error(`Unknown FriendStatus {friendStatus}`) error("Unknown FriendStatus " .. friendStatus)
end end
end end
@ -914,10 +914,11 @@ local function HighlightMyRank(
MemberButton, MemberButton,
AdminButton AdminButton
) )
BanPlayerButton.Image = `http://banland.xyz/asset?id={Images.LightPopupMid}` BanPlayerButton.Image = "http://banland.xyz/asset?id="
VisitorButton.Image = `http://banland.xyz/asset?id={Images.DarkPopupMid}` .. Images.LightPopupMid
MemberButton.Image = `http://banland.xyz/asset?id={Images.LightPopupMid}` VisitorButton.Image = "http://banland.xyz/asset?id=" .. Images.DarkPopupMid
AdminButton.Image = `http://banland.xyz/asset?id={Images.DarkPopupBottom}` MemberButton.Image = "http://banland.xyz/asset?id=" .. Images.LightPopupMid
AdminButton.Image = "http://banland.xyz/asset?id=" .. Images.DarkPopupBottom
local rank = player.PersonalServerRank local rank = player.PersonalServerRank
if rank <= PrivilegeLevel.Banned then if rank <= PrivilegeLevel.Banned then
@ -1048,7 +1049,7 @@ end
creates dropdownbox, registers all listeners for abuse dialog creates dropdownbox, registers all listeners for abuse dialog
--]] --]]
local function InitReportAbuse() local function InitReportAbuse()
UpdateAbuseFunction = function(abuseText) function UpdateAbuseFunction(abuseText)
AbuseName = abuseText AbuseName = abuseText
if AbuseName and SelectedPlayer then if AbuseName and SelectedPlayer then
SubmitReportButton.Active = true SubmitReportButton.Active = true
@ -1706,7 +1707,7 @@ local function BaseUpdate()
BaseUpdateLock = false BaseUpdateLock = false
end end
RecreateScoreColumns = function(ptable) function RecreateScoreColumns(ptable)
-- OUTLINE -- OUTLINE
local function MakeScoreEntry(entry, scoreval, panel) local function MakeScoreEntry(entry, scoreval, panel)
if not panel:FindFirstChild "PlayerScore" then if not panel:FindFirstChild "PlayerScore" then
@ -1746,8 +1747,7 @@ RecreateScoreColumns = function(ptable)
thisScore.Changed:connect(function() thisScore.Changed:connect(function()
if not thisScore.Parent then if not thisScore.Parent then
return return
end elseif scoreval.Name == ScoreNames[1]["Name"] then
if scoreval.Name == ScoreNames[1]["Name"] then
entry.Score = GetScoreValue(thisScore) entry.Score = GetScoreValue(thisScore)
if entry.Player == LocalPlayer then if entry.Player == LocalPlayer then
HeaderScore.Text = tostring(GetScoreValue(thisScore)) HeaderScore.Text = tostring(GetScoreValue(thisScore))
@ -1846,7 +1846,7 @@ end
monitors positions of the clipping frames and bottom frames monitors positions of the clipping frames and bottom frames
called from EVERYWHERE, too much probably called from EVERYWHERE, too much probably
--]] --]]
UpdateMinimize = function() function UpdateMinimize()
if IsMinimized.Value then if IsMinimized.Value then
if IsMaximized.Value then if IsMaximized.Value then
ToggleMaximize() ToggleMaximize()
@ -2555,7 +2555,7 @@ local function AddMiddleBGFrame()
UDim2.new(0.5, 0, (#MiddleFrameBackgrounds * nBGFrame.Size.Y.Scale), 0) UDim2.new(0.5, 0, (#MiddleFrameBackgrounds * nBGFrame.Size.Y.Scale), 0)
local function applyImage(id: string) local function applyImage(id: string)
nBGFrame.Background.Image = `http://banland.xyz/asset?id={id}` nBGFrame.Background.Image = "http://banland.xyz/asset?id=" .. id
end end
if (#MiddleFrameBackgrounds + 1) % 2 ~= 1 then if (#MiddleFrameBackgrounds + 1) % 2 ~= 1 then
@ -2828,18 +2828,18 @@ local function PlayerChanged(entry, property)
if property == "Neutral" then if property == "Neutral" then
-- if player changing to neutral -- if player changing to neutral
if entry.Player.Neutral and #(game.Teams:GetTeams()) > 0 then 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) FindRemovePlayerFromTeam(entry)
entry.MyTeam = nil entry.MyTeam = nil
if not NeutralTeam then if not NeutralTeam then
log(`{entry.Player.Name} creating neutral team`) log(entry.Player.Name .. " creating neutral team")
AddNeutralTeam() AddNeutralTeam()
else else
log(`{entry.Player.Name} adding to neutral team`) log(entry.Player.Name .. " adding to neutral team")
AddPlayerToTeam(NeutralTeam, entry) AddPlayerToTeam(NeutralTeam, entry)
end end
elseif #(game.Teams:GetTeams()) > 0 then -- else player switching to a team, or a weird edgecase 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) SetPlayerToTeam(entry)
end end
BaseUpdate() BaseUpdate()
@ -2848,7 +2848,7 @@ local function PlayerChanged(entry, property)
and not entry.Player.Neutral and not entry.Player.Neutral
and entry.Player ~= entry.MyTeam and entry.Player ~= entry.MyTeam
then then
log(`{entry.Player.Name} setting to new team`) log(entry.Player.Name .. " setting to new team")
SetPlayerToTeam(entry) SetPlayerToTeam(entry)
BaseUpdate() BaseUpdate()
elseif property == "Name" or property == "MembershipType" then elseif property == "Name" or property == "MembershipType" then
@ -2879,7 +2879,7 @@ end
--]] --]]
local function InsertPlayerFrame(nplayer) local function InsertPlayerFrame(nplayer)
while AddingFrameLock do while AddingFrameLock do
log(`waiting to insert {nplayer.Name}`) log("waiting to insert " .. nplayer.Name)
RunService.Heartbeat:wait() RunService.Heartbeat:wait()
end end
AddingFrameLock = true AddingFrameLock = true
@ -3067,7 +3067,7 @@ local function OnFriendshipChanged(player, friendStatus)
elseif nicon ~= "" and entry.Frame.FriendLabel.Image == "" then elseif nicon ~= "" and entry.Frame.FriendLabel.Image == "" then
entry.Frame.TitleFrame.Title.Position = entry.Frame.TitleFrame.Title.Position entry.Frame.TitleFrame.Title.Position = entry.Frame.TitleFrame.Title.Position
+ UDim2.new(0, 17, 0, 0) + UDim2.new(0, 17, 0, 0)
log(`confirmed status {player.Name}`) log("confirmed status " .. player.Name)
end end
entry.Frame.FriendLabel.Image = nicon entry.Frame.FriendLabel.Image = nicon
return return
@ -3337,9 +3337,9 @@ end
pcall(function() pcall(function()
coreGuiChanged( coreGuiChanged(
Enum.CoreGuiType.PlayerList, 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) end)
while not game:GetService "Teams" do while not game:GetService "Teams" do

View File

@ -1,4 +1,4 @@
-- CoreGui.RobloxGui.CoreScripts/NotificationScript -- CoreGui.MercuryGui.CoreScripts/NotificationScript
print "[Mercury]: Loaded corescript 48488398" print "[Mercury]: Loaded corescript 48488398"
local GuiService = game:GetService "GuiService" local GuiService = game:GetService "GuiService"
@ -53,15 +53,13 @@ end
local function makeFriend(fromPlayer, toPlayer) local function makeFriend(fromPlayer, toPlayer)
local popup = script.Parent:FindFirstChild "Popup" 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 return
end -- there is no popup! end
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!
popup.PopupText.Text = `Accept Friend Request from {fromPlayer.Name}?` popup.PopupText.Text = `Accept Friend Request from {fromPlayer.Name}?`
popup.PopupImage.Image = 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 this doesn't involve me, then do nothing
if fromPlayer ~= localPlayer and toPlayer ~= localPlayer then if fromPlayer ~= localPlayer and toPlayer ~= localPlayer then
return return
end elseif fromPlayer == localPlayer then
if fromPlayer == localPlayer then
if event == Enum.FriendRequestEvent.Accept then if event == Enum.FriendRequestEvent.Accept then
GuiService:SendNotification( GuiService:SendNotification(
"You are Friends", "You are Friends",
@ -198,7 +194,7 @@ end
if teleportEnabled then if teleportEnabled then
localPlayer.OnTeleport:connect(onTeleport) localPlayer.OnTeleport:connect(onTeleport)
TeleportService.ErrorCallback = function(message) function TeleportService.ErrorCallback(message)
local popup = script.Parent:FindFirstChild "Popup" local popup = script.Parent:FindFirstChild "Popup"
showOneButton() showOneButton()
popup.PopupText.Text = message popup.PopupText.Text = message
@ -248,7 +244,7 @@ if teleportEnabled then
end end
) )
end end
TeleportService.ConfirmationCallback = function(message, placeId, spawnName) function TeleportService.ConfirmationCallback(message, placeId, spawnName)
local popup = script.Parent:FindFirstChild "Popup" local popup = script.Parent:FindFirstChild "Popup"
popup.PopupText.Text = message popup.PopupText.Text = message
popup.PopupImage.Image = "" popup.PopupImage.Image = ""

View File

@ -1,11 +1,11 @@
-- CoreGui.RobloxGui.CoreScripts/PopupScript -- CoreGui.MercuryGui.CoreScripts/PopupScript
print "[Mercury]: Loaded corescript 48488451" print "[Mercury]: Loaded corescript 48488451"
local News = require "../Modules/New" local News = require "../Modules/New"
local New = News.New local New = News.New
local Hydrate = News.Hydrate local Hydrate = News.Hydrate
--build our gui -- build our gui
local popupFrame = New "Frame" { local popupFrame = New "Frame" {
Name = "Popup", Name = "Popup",

View File

@ -1,4 +1,4 @@
-- CoreGui.RobloxGui.CoreScripts/BackpackScripts/BackpackBuild -- CoreGui.MercuryGui.CoreScripts/BackpackScripts/BackpackBuild
print "[Mercury]: Loaded corescript 53878047" print "[Mercury]: Loaded corescript 53878047"
local News = require "../Modules/New" local News = require "../Modules/New"
@ -207,19 +207,6 @@ for i = 0, 9 do
end end
slotFrame.Parent = CurrentLoadout 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 end
-- Great, now lets make the inventory! -- Great, now lets make the inventory!

View File

@ -1,10 +1,10 @@
-- CoreGui.RobloxGui.CurrentLoadout.CoreScripts/BackpackScript -- CoreGui.MercuryGui.CurrentLoadout.CoreScripts/BackpackScript
print "[Mercury]: Loaded corescript 53878057" print "[Mercury]: Loaded corescript 53878057"
local CoreGui = game:GetService "CoreGui" local CoreGui = game:GetService "CoreGui"
local GuiService = game:GetService "GuiService" local GuiService = game:GetService "GuiService"
local RunService = game:GetService "RunService" local RunService = game:GetService "RunService"
local UserInputService = Game:GetService "UserInputService" local UserInputService = game:GetService "UserInputService"
-- A couple of necessary functions -- A couple of necessary functions
local function waitForChild(instance, name) local function waitForChild(instance, name)
@ -23,15 +23,15 @@ local currentLoadout = script.Parent
local StaticTabName = "gear" local StaticTabName = "gear"
local backpackEnabled = true local backpackEnabled = true
local robloxGui = CoreGui:FindFirstChild "RobloxGui" local mercuryGui = CoreGui:FindFirstChild "MercuryGui"
assert(robloxGui) assert(mercuryGui)
local controlFrame = waitForChild(robloxGui, "ControlFrame") local controlFrame = waitForChild(mercuryGui, "ControlFrame")
local backpackButton = waitForChild(controlFrame, "BackpackButton") local backpackButton = waitForChild(controlFrame, "BackpackButton")
local backpack = waitForChild(robloxGui, "Backpack") local backpack = waitForChild(mercuryGui, "Backpack")
waitForChild(robloxGui, "CurrentLoadout") waitForChild(mercuryGui, "CurrentLoadout")
waitForChild(robloxGui.CurrentLoadout, "TempSlot") waitForChild(mercuryGui.CurrentLoadout, "TempSlot")
waitForChild(robloxGui.CurrentLoadout.TempSlot, "SlotNumber") waitForChild(mercuryGui.CurrentLoadout.TempSlot, "SlotNumber")
waitForChild(currentLoadout, "Background") waitForChild(currentLoadout, "Background")
local clBackground = currentLoadout.Background local clBackground = currentLoadout.Background
@ -92,9 +92,6 @@ local tabClickedEvent = waitForChild(backpackManager, "TabClickedEvent")
local inGearTab = true local inGearTab = true
local maxNumLoadoutItems = 10 local maxNumLoadoutItems = 10
if robloxGui.AbsoluteSize.Y <= 320 then
maxNumLoadoutItems = 4
end
local characterChildAddedCon, backpackChildCon local characterChildAddedCon, backpackChildCon
@ -115,8 +112,6 @@ for i = 1, maxNumLoadoutItems do
gearSlots[i] = "empty" gearSlots[i] = "empty"
end end
local backpackWasOpened = false
local dragBeginPos local dragBeginPos
--- End Locals --- End Locals
@ -154,17 +149,11 @@ local function unregisterNumberKeys()
end end
local function characterInWorkspace() local function characterInWorkspace()
if game.Players.LocalPlayer then local localPlayer = game.Players.LocalPlayer
if game.Players.LocalPlayer.Character then return localPlayer
if game.Players.LocalPlayer.Character ~= nil then and localPlayer.Character
if game.Players.LocalPlayer.Character.Parent ~= nil then and localPlayer.Character ~= nil
return true and localPlayer.Character.Parent ~= nil
end
end
end
end
return false
end end
local function removeGear(gear) local function removeGear(gear)
@ -288,7 +277,7 @@ local function insertGear(gear, addToSlot)
end) end)
end end
reorganizeLoadout = function(gear, inserting, _, addToSlot) function reorganizeLoadout(gear, inserting, _, addToSlot)
if inserting then -- add in gear if inserting then -- add in gear
insertGear(gear, addToSlot) insertGear(gear, addToSlot)
else else
@ -301,7 +290,7 @@ end
local function checkToolAncestry(child, parent) local function checkToolAncestry(child, parent)
if 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") or not (child:IsA "Tool" or child:IsA "HopperBin")
then then
return return
@ -350,16 +339,12 @@ local function removeAllEquippedGear(physGear)
end end
local function normaliseButton(button, speed) local function normaliseButton(button, speed)
if not button then if
return not button
end or button.Size.Y.Scale <= 1
if button.Size.Y.Scale <= 1 then or button.Selected
return or not button.Parent
end then
if button.Selected then
return
end
if not button.Parent then
return return
end end
@ -407,9 +392,7 @@ local function enlargeButton(button)
if not enlargeOverride then if not enlargeOverride then
return return
end elseif button:FindFirstChild "Highlight" then
if button:FindFirstChild "Highlight" then
button.Highlight.Visible = true button.Highlight.Visible = true
end end
@ -510,30 +493,21 @@ local function toolSwitcher(numKey)
end end
local function activateGear(num) local function activateGear(num)
local numKey local numKey = num == "0" and 10 or tonumber(num)
if num == "0" then
numKey = 10 -- why do lua indexes have to start at 1? :(
else
numKey = tonumber(num)
end
if numKey == nil then if numKey and gearSlots[numKey] ~= "empty" then
return
end
if gearSlots[numKey] ~= "empty" then
toolSwitcher(numKey) toolSwitcher(numKey)
end end
end end
local function pointInRectangle(point, rectTopLeft, rectSize) local function pointInRectangle(point, rectTopLeft, rectSize)
if point.x > rectTopLeft.x and point.x < (rectTopLeft.x + rectSize.x) then if
if point.x > rectTopLeft.x
point.y > rectTopLeft.y and point.x < (rectTopLeft.x + rectSize.x)
and point.y < (rectTopLeft.y + rectSize.y) and point.y > rectTopLeft.y
then and point.y < (rectTopLeft.y + rectSize.y)
return true then
end return true
end end
return false return false
end end
@ -716,7 +690,7 @@ local function addingPlayerChild(
if child:FindFirstChild "RobloxBuildTool" then if child:FindFirstChild "RobloxBuildTool" then
debounce = false debounce = false
return 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 if not (child:IsA "Tool" or child:IsA "HopperBin") then
debounce = false debounce = false
return -- we don't care about anything besides tools (sigh...) return -- we don't care about anything besides tools (sigh...)
@ -783,7 +757,7 @@ local function addingPlayerChild(
end end
local slotNum = slotToMod % 10 local slotNum = slotToMod % 10
local parent = currentLoadout:FindFirstChild(`Slot{slotNum}`) local parent = currentLoadout:FindFirstChild("Slot" .. slotNum)
gearClone.Parent = parent gearClone.Parent = parent
if inventoryGearButton then if inventoryGearButton then
@ -851,30 +825,23 @@ local function addingPlayerChild(
local children = gearClone:GetChildren() local children = gearClone:GetChildren()
for i = 1, #children do for i = 1, #children do
if children[i]:IsA "TextLabel" then if children[i]:IsA "TextLabel" then
if string.find(children[i].Name, "Shadow") then children[i].ZIndex = string.find(children[i].Name, "Shadow")
children[i].ZIndex = 8 and 8
else or 9
children[i].ZIndex = 9
end
elseif children[i]:IsA "Frame" or children[i]:IsA "ImageLabel" then elseif children[i]:IsA "Frame" or children[i]:IsA "ImageLabel" then
children[i].ZIndex = 7 children[i].ZIndex = 7
end end
end end
end) end)
dragStop = gearClone.DragStopped:connect(function(x, y) dragStop = gearClone.DragStopped:connect(function(x, y)
if gearClone.Selected then gearClone.ZIndex = gearClone.Selected and 4 or 3
gearClone.ZIndex = 4
else
gearClone.ZIndex = 3
end
local children = gearClone:GetChildren() local children = gearClone:GetChildren()
for i = 1, #children do for i = 1, #children do
if children[i]:IsA "TextLabel" then if children[i]:IsA "TextLabel" then
if string.find(children[i].Name, "Shadow") then children[i].ZIndex = string.find(children[i].Name, "Shadow")
children[i].ZIndex = 3 and 3
else or 4
children[i].ZIndex = 4
end
elseif children[i]:IsA "Frame" or children[i]:IsA "ImageLabel" then elseif children[i]:IsA "Frame" or children[i]:IsA "ImageLabel" then
children[i].ZIndex = 2 children[i].ZIndex = 2
end end
@ -887,8 +854,7 @@ local function addingPlayerChild(
buttonDeleteCon = gearClone.AncestryChanged:connect(function() buttonDeleteCon = gearClone.AncestryChanged:connect(function()
if gearClone.Parent and gearClone.Parent.Parent == currentLoadout then if gearClone.Parent and gearClone.Parent.Parent == currentLoadout then
return return
end elseif clickCon then
if clickCon then
clickCon:disconnect() clickCon:disconnect()
end end
if buttonDeleteCon then if buttonDeleteCon then
@ -925,16 +891,12 @@ local function addingPlayerChild(
end) end)
childChangeCon = child.Changed:connect(function(prop) childChangeCon = child.Changed:connect(function(prop)
if prop == "Name" then if prop == "Name" and gearClone and gearClone.GearImage.Image == "" then
if gearClone and gearClone.GearImage.Image == "" then gearClone.GearText.Text = child.Name
gearClone.GearText.Text = child.Name
end
elseif prop == "Active" then elseif prop == "Active" then
if child and child:IsA "HopperBin" then if child and child:IsA "HopperBin" and not child.Active then
if not child.Active then gearClone.Selected = false
gearClone.Selected = false normaliseButton(gearClone)
normaliseButton(gearClone)
end
end end
elseif prop == "TextureId" then elseif prop == "TextureId" then
gearClone.GearImage.Image = child.TextureId gearClone.GearImage.Image = child.TextureId
@ -945,7 +907,7 @@ local function addingPlayerChild(
Spawn(function() Spawn(function()
while backpackIsOpen() do while backpackIsOpen() do
wait(0.03) wait()
end end
for i = 1, #gearSlots do for i = 1, #gearSlots do
if gearSlots[i] ~= "empty" then if gearSlots[i] ~= "empty" then
@ -968,11 +930,11 @@ local function addToInventory(child)
for i = 1, #inventory do for i = 1, #inventory do
if inventory[i] and inventory[i] == child then if inventory[i] and inventory[i] == child then
return return
end elseif not inventory[i] then
if not inventory[i] then
slot = i slot = i
end end
end end
if slot then if slot then
inventory[slot] = child inventory[slot] = child
elseif #inventory < 1 then elseif #inventory < 1 then
@ -982,7 +944,7 @@ local function addToInventory(child)
end end
end end
local spreadOutGear = function() local function spreadOutGear()
local loadoutChildren = currentLoadout:GetChildren() local loadoutChildren = currentLoadout:GetChildren()
for i = 1, #loadoutChildren do for i = 1, #loadoutChildren do
@ -992,28 +954,18 @@ local spreadOutGear = function()
if slot == 0 then if slot == 0 then
slot = 10 slot = 10
end end
if robloxGui.AbsoluteSize.Y <= 320 then loadoutChildren[i]:TweenPosition(
loadoutChildren[i]:TweenPosition( UDim2.new((slot - 1) / 10, 0, 0, 0),
UDim2.new(0, (slot - 1) * 60, 0, 0), Enum.EasingDirection.Out,
Enum.EasingDirection.Out, Enum.EasingStyle.Quad,
Enum.EasingStyle.Quad, 0.25,
0.25, true
true )
)
else
loadoutChildren[i]:TweenPosition(
UDim2.new((slot - 1) / 10, 0, 0, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Quad,
0.25,
true
)
end
end end
end end
end end
local centerGear = function() local function centerGear()
local loadoutChildren = currentLoadout:GetChildren() local loadoutChildren = currentLoadout:GetChildren()
local gearButtons = {} local gearButtons = {}
local lastSlotAdd local lastSlotAdd
@ -1036,29 +988,17 @@ local centerGear = function()
local startPos = (1 - (#gearButtons * 0.1)) / 2 local startPos = (1 - (#gearButtons * 0.1)) / 2
for i = 1, #gearButtons do for i = 1, #gearButtons do
if robloxGui.AbsoluteSize.Y <= 320 then gearButtons[i]:TweenPosition(
startPos = (0.5 - (#gearButtons * 0.333) / 2) UDim2.new(startPos + ((i - 1) * 0.1), 0, 0, 0),
gearButtons[i]:TweenPosition( Enum.EasingDirection.Out,
UDim2.new(startPos + (i - 1) * 0.33, 0, 0, 0), Enum.EasingStyle.Quad,
Enum.EasingDirection.Out, 0.25,
Enum.EasingStyle.Quad, true
0.25, )
true
)
else
gearButtons[i]:TweenPosition(
UDim2.new(startPos + ((i - 1) * 0.1), 0, 0, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Quad,
0.25,
true
)
end
end end
end end
local function editLoadout() local function editLoadout()
backpackWasOpened = true
if inGearTab then if inGearTab then
spreadOutGear() spreadOutGear()
end end
@ -1141,13 +1081,13 @@ registerNumberKeys()
pcall(function() pcall(function()
coreGuiChanged( coreGuiChanged(
Enum.CoreGuiType.Backpack, Enum.CoreGuiType.Backpack,
Game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack) game.StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack)
) )
coreGuiChanged( coreGuiChanged(
Enum.CoreGuiType.Health, 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) end)
RunService.Heartbeat:wait() -- let stuff initialize incase this is first heartbeat... 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") waitForChild(player, "Backpack")
waitForProperty(player, "Character") 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() delay(1, function()
local backpackChildren = player.Backpack:GetChildren() local backpackChildren = player.Backpack:GetChildren()
local size = math.min(10, #backpackChildren) local size = math.min(10, #backpackChildren)
@ -1169,23 +1109,6 @@ delay(1, function()
setupBackpackListener() setupBackpackListener()
end) 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) player.ChildAdded:connect(function(child)
if child:IsA "PlayerGui" then if child:IsA "PlayerGui" then
moveHealthBar(child) moveHealthBar(child)
@ -1212,7 +1135,6 @@ humanoidDiedCon = player.Character.Humanoid.Died:connect(function()
backpackChildCon:disconnect() backpackChildCon:disconnect()
backpackChildCon = nil backpackChildCon = nil
end end
backpackWasOpened = false
end) end)
player.CharacterRemoving:connect(function() player.CharacterRemoving:connect(function()
@ -1276,27 +1198,6 @@ player.CharacterAdded:connect(function()
end) end)
waitForChild(player, "PlayerGui") waitForChild(player, "PlayerGui")
moveHealthBar(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) end)
waitForChild(guiBackpack, "SwapSlot") waitForChild(guiBackpack, "SwapSlot")

View File

@ -11,12 +11,12 @@ local RbxUtility = {}
-- Fuq json -- Fuq json
RbxUtility.DecodeJSON = function() function RbxUtility.DecodeJSON()
error 'RbxUtility.DecodeJSON has been removed, please use Game:GetService("HttpService"):JSONDecode() instead.' error 'RbxUtility.DecodeJSON has been removed, please use game:GetService("HttpService"):JSONDecode() instead.'
end end
RbxUtility.EncodeJSON = function() function RbxUtility.EncodeJSON()
error 'RbxUtility.EncodeJSON has been removed, please use Game:GetService("HttpService"):JSONEncode() instead.' error 'RbxUtility.EncodeJSON has been removed, please use game:GetService("HttpService"):JSONEncode() instead.'
end end
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
@ -26,14 +26,14 @@ end
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------
--makes a wedge at location 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 -- 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 -- returns true if made a wedge, false if the cell remains a block
RbxUtility.MakeWedge = function(x, y, z, _) function RbxUtility.MakeWedge(x, y, z, _)
return Terrain:AutoWedgeCell(x, y, z) return Terrain:AutoWedgeCell(x, y, z)
end end
RbxUtility.SelectTerrainRegion = function( function RbxUtility.SelectTerrainRegion(
regionToSelect: Region3, regionToSelect: Region3,
colour: BrickColor, colour: BrickColor,
selectEmptyCells: boolean, selectEmptyCells: boolean,
@ -210,7 +210,7 @@ RbxUtility.SelectTerrainRegion = function(
adornments.SelectionPart = selectionPart adornments.SelectionPart = selectionPart
adornments.SelectionBox = selectionBox adornments.SelectionBox = selectionBox
updateSelection = function(newRegion: Region3, newColour) function updateSelection(newRegion: Region3, newColour)
if newRegion and newRegion ~= lastRegion then if newRegion and newRegion ~= lastRegion then
lastRegion = newRegion lastRegion = newRegion
selectionPart.Size = newRegion.Size selectionPart.Size = newRegion.Size
@ -222,7 +222,7 @@ RbxUtility.SelectTerrainRegion = function(
end end
else -- use individual cell adorns to represent the area selected else -- use individual cell adorns to represent the area selected
adornFullCellsInRegion(regionToSelect, colour) adornFullCellsInRegion(regionToSelect, colour)
updateSelection = function(newRegion, newColour) function updateSelection(newRegion, newColour)
if newRegion and newRegion ~= lastRegion then if newRegion and newRegion ~= lastRegion then
lastRegion = newRegion lastRegion = newRegion
adornFullCellsInRegion(newRegion, newColour) adornFullCellsInRegion(newRegion, newColour)
@ -230,7 +230,7 @@ RbxUtility.SelectTerrainRegion = function(
end end
end end
local destroyFunc = function() local function destroyFunc()
updateSelection = nil updateSelection = nil
if selectionContainer then if selectionContainer then
selectionContainer:Destroy() 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 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, 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 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 --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. --function can recognize as special.
RbxUtility.Create.E = function(eventName) function RbxUtility.Create.E(eventName)
return { __eventname = eventName } return { __eventname = eventName }
end 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) --input argument can be a string or a function. Should return a description (of arguments and expected side effects)
if if
funcNameOrFunc == "DecodeJSON" funcNameOrFunc == "DecodeJSON"
or funcNameOrFunc == RbxUtility.DecodeJSON or funcNameOrFunc == RbxUtility.DecodeJSON
then then
return "Function DecodeJSON. " return [[Function DecodeJSON.
.. "Arguments: (string). " Arguments: (string).
.. "Side effect: returns a table with all parsed JSON values" Side effect: returns a table with all parsed JSON values]]
end elseif
if
funcNameOrFunc == "EncodeJSON" funcNameOrFunc == "EncodeJSON"
or funcNameOrFunc == RbxUtility.EncodeJSON or funcNameOrFunc == RbxUtility.EncodeJSON
then then
return "Function EncodeJSON. " return [[Function EncodeJSON.
.. "Arguments: (table). " Arguments: (table).
.. "Side effect: returns a string composed of argument table in JSON data format" Side effect: returns a string composed of argument table in JSON data format]]
end elseif
if
funcNameOrFunc == "MakeWedge" funcNameOrFunc == "MakeWedge"
or funcNameOrFunc == RbxUtility.MakeWedge or funcNameOrFunc == RbxUtility.MakeWedge
then then
return "Function MakeWedge. " return [[Function MakeWedge.
.. "Arguments: (x, y, z, [default material]). " Arguments: (x, y, z, [default material]).
.. "Description: Makes a wedge at location x, y, z. Sets cell x, y, z to default material if " 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]]
.. "parameter is provided, if not sets cell x, y, z to be whatever material it previously was. " elseif
.. "Returns true if made a wedge, false if the cell remains a block "
end
if
funcNameOrFunc == "SelectTerrainRegion" funcNameOrFunc == "SelectTerrainRegion"
or funcNameOrFunc == RbxUtility.SelectTerrainRegion or funcNameOrFunc == RbxUtility.SelectTerrainRegion
then then
return "Function SelectTerrainRegion. " return [[Function SelectTerrainRegion.
.. "Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). " Arguments: (regionToSelect, color, selectEmptyCells, selectionParent).
.. "Description: Selects all terrain via a series of selection boxes within the regionToSelect " Description: Selects all terrain via a series of selection boxes within the regionToSelect (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]]
.. "(this should be a region3 value). The selection box color is detemined by the color argument " elseif
.. "(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
funcNameOrFunc == "CreateSignal" funcNameOrFunc == "CreateSignal"
or funcNameOrFunc == RbxUtility.CreateSignal or funcNameOrFunc == RbxUtility.CreateSignal
then then
return "Function CreateSignal. " return [[Function CreateSignal.
.. "Arguments: None. " Arguments: None.
.. "Returns: The newly created Signal object. This object is identical to the RBXScriptSignal class " 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".]]
.. "used for events in Objects, but is a Lua-side object so it can be used to create custom events in" elseif funcNameOrFunc == "Signal:connect" then
.. "Lua code. " return [[Method Signal:connect.
.. "Methods of the Signal object: :connect, :wait, :fire, :disconnect. " Arguments: (function handler).
.. "For more info you can pass the method name to the Help function, or view the wiki page " Return: A connection object which can be used to disconnect the connection to this handler.
.. 'for this library. EG: Help "Signal:connect".' 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: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 end
if funcNameOrFunc == "Signal:wait" then if funcNameOrFunc == "Signal:wait" then
return "Method Signal:wait. " return [[Method Signal:wait.
.. "Arguments: None. " Arguments: None.
.. "Returns: The arguments passed to the next call to |fire|. " 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 " 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.]]
.. "will return the values which were passed as arguments to that |fire| call." elseif funcNameOrFunc == "Signal:fire" then
end return [[Method Signal:fire.
if funcNameOrFunc == "Signal:fire" then Arguments: Any number of arguments of any type.
return "Method Signal:fire. " Returns: None.
.. "Arguments: Any number of arguments of any type. " 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.]]
.. "Returns: None. " elseif funcNameOrFunc == "Signal:disconnect" then
.. "Description: This call will invoke any connected handler functions, and notify any waiting code " return [[Method Signal:disconnect.
.. "attached to this Signal to continue, with the arguments passed to this function. Note: The calls " Arguments: None.
.. "to handlers are made asynchronously, so this call will return immediately regardless of how long " Returns: None.
.. "it takes the connected handler functions to complete." 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.]]
end elseif funcNameOrFunc == "Create" then
if funcNameOrFunc == "Signal:disconnect" then return [[Function Create.
return "Method Signal:disconnect. " Arguments: A table containing information about how to construct a collection of objects.
.. "Arguments: None. " Returns: The constructed objects.
.. "Returns: None. " 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.]]
.. "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."
end end
return "No help available for this function" return "No help available for this function"
end end

View File

@ -9,7 +9,7 @@ local RunService = game:GetService "RunService"
local ScriptContext local ScriptContext
for i = 1, 4 do for _ = 1, 4 do
ScriptContext = game:GetService "ScriptContext" ScriptContext = game:GetService "ScriptContext"
if ScriptContext then if ScriptContext then
break break

View File

@ -156,9 +156,7 @@ end
local function findSeatsInModel(parent, seatTable) local function findSeatsInModel(parent, seatTable)
if not parent then if not parent then
return return
end elseif parent.className == "Seat" or parent.className == "VehicleSeat" then
if parent.className == "Seat" or parent.className == "VehicleSeat" then
table.insert(seatTable, parent) table.insert(seatTable, parent)
end end
local myChildren = parent:GetChildren() local myChildren = parent:GetChildren()
@ -488,12 +486,10 @@ local function findConfigAtMouseTarget(Mouse: Mouse, stampData: Instance)
-- This can happen sometimes, return if so -- This can happen sometimes, return if so
if not Mouse then if not Mouse then
return return
end elseif not stampData then
if not stampData then
error "findConfigAtMouseTarget: stampData is nil" error "findConfigAtMouseTarget: stampData is nil"
return return
end elseif not stampData.CurrentParts then
if not stampData.CurrentParts then
return return
end end
@ -513,12 +509,10 @@ local function findConfigAtMouseTarget(Mouse: Mouse, stampData: Instance)
insertCFrame = stampData.CurrentParts.CFrame insertCFrame = stampData.CurrentParts.CFrame
end end
if Mouse then if Mouse and stampData.CurrentParts:IsA "Tool" then
if stampData.CurrentParts:IsA "Tool" then Mouse.TargetFilter = stampData.CurrentParts.Handle
Mouse.TargetFilter = stampData.CurrentParts.Handle else
else Mouse.TargetFilter = stampData.CurrentParts
Mouse.TargetFilter = stampData.CurrentParts
end
end end
local hitPlane = false local hitPlane = false
@ -739,7 +733,7 @@ local function restoreTheWelds(manualWeldTable, manualWeldParentTable)
end end
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 if not EditRegion then
return true, false return true, false
end end
@ -763,11 +757,10 @@ RbxStamper.CanEditRegion = function(partOrModel, EditRegion) -- todo: use model
return true, false return true, false
end end
RbxStamper.GetStampModel = function(assetId, terrainShape, useAssetVersionId) function RbxStamper.GetStampModel(assetId, terrainShape, useAssetVersionId)
if assetId == 0 then if assetId == 0 then
return nil, "No Asset" return nil, "No Asset"
end elseif assetId < 0 then
if assetId < 0 then
return nil, "Negative Asset" return nil, "Negative Asset"
end end
@ -976,7 +969,7 @@ RbxStamper.GetStampModel = function(assetId, terrainShape, useAssetVersionId)
return root return root
end end
RbxStamper.SetupStamperDragger = function( function RbxStamper.SetupStamperDragger(
modelToStamp, modelToStamp,
Mouse, Mouse,
StampInModel, StampInModel,
@ -1258,7 +1251,7 @@ RbxStamper.SetupStamperDragger = function(
-- There wasn't a target (no part or terrain), so check for plane intersection. -- There wasn't a target (no part or terrain), so check for plane intersection.
if not mouse.Target then if not mouse.Target then
local cellPos = GetTerrainForMouse(mouse) local cellPos = GetTerrainForMouse(mouse)
if nil == cellPos then if not cellPos then
return return
end end
end end
@ -1634,45 +1627,38 @@ RbxStamper.SetupStamperDragger = function(
if not mouse then if not mouse then
error "Error: RbxStamper.DoStamperMouseDown: Mouse is nil" error "Error: RbxStamper.DoStamperMouseDown: Mouse is nil"
return return
end elseif not mouse:IsA "Mouse" then
if not mouse:IsA "Mouse" then
error( error(
`Error: RbxStamper.DoStamperMouseDown: Mouse is of type {mouse.className}, should be of type Mouse` `Error: RbxStamper.DoStamperMouseDown: Mouse is of type {mouse.className}, should be of type Mouse`
) )
return return
end elseif
if not stampData then not (
stampData
and isMegaClusterPart()
and mouse
and HighScalabilityLine
)
then
return return
end end
if isMegaClusterPart() then local megaCube =
if mouse and HighScalabilityLine then stampData.CurrentParts:FindFirstChild("MegaClusterCube", true)
local megaCube = stampData.CurrentParts:FindFirstChild( local terrain = game.Workspace.Terrain
"MegaClusterCube", if megaCube then
true HighScalabilityLine.Dimensions = 1
) local tempCell = terrain:WorldToCell(megaCube.CFrame.p)
local terrain = game.Workspace.Terrain HighScalabilityLine.Start =
if megaCube then terrain:CellCenterToWorld(tempCell.X, tempCell.Y, tempCell.Z)
HighScalabilityLine.Dimensions = 1 return
local tempCell = terrain:WorldToCell(megaCube.CFrame.p) else
HighScalabilityLine.Start = terrain:CellCenterToWorld( HighScalabilityLine.Dimensions = 1
tempCell.X, local tempCell =
tempCell.Y, terrain:WorldToCell(stampData.CurrentParts.CFrame.p)
tempCell.Z HighScalabilityLine.Start =
) terrain:CellCenterToWorld(tempCell.X, tempCell.Y, tempCell.Z)
return return
else
HighScalabilityLine.Dimensions = 1
local tempCell =
terrain:WorldToCell(stampData.CurrentParts.CFrame.p)
HighScalabilityLine.Start = terrain:CellCenterToWorld(
tempCell.X,
tempCell.Y,
tempCell.Z
)
return
end
end
end end
end end
@ -2902,7 +2888,7 @@ RbxStamper.SetupStamperDragger = function(
control.Stamped = stamped -- BoolValue that fires when user stamps control.Stamped = stamped -- BoolValue that fires when user stamps
control.Paused = false 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 if
newStampModel newStampModel
and not newStampModel:IsA "Model" and not newStampModel:IsA "Model"
@ -2914,11 +2900,11 @@ RbxStamper.SetupStamperDragger = function(
resetStamperState(newStampModel) resetStamperState(newStampModel)
end 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() resetStamperState()
end 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 if not control.Paused then
pauseStamper() pauseStamper()
control.Paused = true control.Paused = true
@ -2927,7 +2913,7 @@ RbxStamper.SetupStamperDragger = function(
end end
end end
control.Resume = function() -- resumes stamping, if currently paused function control.Resume() -- resumes stamping, if currently paused
if control.Paused then if control.Paused then
resumeStamper() resumeStamper()
control.Paused = false control.Paused = false
@ -2936,13 +2922,13 @@ RbxStamper.SetupStamperDragger = function(
end end
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 -- 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 -- 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] -- High-Scalability and with the new model orientation setting methods (model:ResetOrientationToIdentity()) [HotThoth]
end 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 for i = 1, #mouseCons do
mouseCons[i]:disconnect() mouseCons[i]:disconnect()
mouseCons[i] = nil mouseCons[i] = nil
@ -2980,7 +2966,7 @@ RbxStamper.SetupStamperDragger = function(
return control return control
end 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) --input argument can be a string or a function. Should return a description (of arguments and expected side effects)
if if
funcNameOrFunc == "GetStampModel" funcNameOrFunc == "GetStampModel"

View File

@ -1,4 +1,4 @@
-- CoreGui.RobloxGui.Backpack.CoreScripts/BackpackScripts/Back (1?) -- CoreGui.MercuryGui.Backpack.CoreScripts/BackpackScripts/Back (1?)
print "[Mercury]: Loaded corescript 89449008" print "[Mercury]: Loaded corescript 89449008"
local UserInputService = game:GetService "UserInputService" local UserInputService = game:GetService "UserInputService"
@ -240,6 +240,214 @@ local function swapGearSlot(slot, newGearButton)
end end
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() local function resizeGrid()
for _, v in pairs(backpackItems) do for _, v in pairs(backpackItems) do
if not v:FindFirstChild "RobloxBuildTool" then if not v:FindFirstChild "RobloxBuildTool" then
@ -402,214 +610,6 @@ local function addToGrid(child: Tool | HopperBin)
resizeGrid() resizeGrid()
end 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) local function showPartialGrid(subset)
for _, v in pairs(buttons) do for _, v in pairs(buttons) do
v.Parent = nil v.Parent = nil
@ -917,12 +917,8 @@ currentLoadout.DescendantRemoving:connect(function(descendant)
end end
end) end)
grid.MouseEnter:connect(function() grid.MouseEnter:connect(clearPreview)
clearPreview() grid.MouseLeave:connect(clearPreview)
end)
grid.MouseLeave:connect(function()
clearPreview()
end)
player.CharacterRemoving:connect(function() player.CharacterRemoving:connect(function()
removeCharacterConnections() removeCharacterConnections()
@ -971,9 +967,9 @@ end
pcall(function() pcall(function()
coreGuiChanged( coreGuiChanged(
Enum.CoreGuiType.Backpack, 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) end)
resize() resize()

View File

@ -1,4 +1,4 @@
-- CoreGui.RobloxGui.Backpack.CoreScripts/BackpackScripts/Back (2?) -- CoreGui.MercuryGui.Backpack.CoreScripts/BackpackScripts/Back (2?)
print "[Mercury]: Loaded corescript 89449093" print "[Mercury]: Loaded corescript 89449093"
local News = require "../Modules/New" local News = require "../Modules/New"
@ -53,8 +53,8 @@ local searchBox = waitForChild(backpack.SearchFrame.SearchBoxFrame, "SearchBox")
local searchButton = waitForChild(backpack.SearchFrame, "SearchButton") local searchButton = waitForChild(backpack.SearchFrame, "SearchButton")
local resetButton = waitForChild(backpack.SearchFrame, "ResetButton") local resetButton = waitForChild(backpack.SearchFrame, "ResetButton")
local robloxGui = waitForChild(Game.CoreGui, "RobloxGui") local mercuryGui = waitForChild(game.CoreGui, "MercuryGui")
local currentLoadout = waitForChild(robloxGui, "CurrentLoadout") local currentLoadout = waitForChild(mercuryGui, "CurrentLoadout")
local loadoutBackground = waitForChild(currentLoadout, "Background") local loadoutBackground = waitForChild(currentLoadout, "Background")
local canToggle = true local canToggle = true
@ -73,10 +73,6 @@ local backtick = "`"
local backpackSize = UDim2.new(0, 600, 0, 400) local backpackSize = UDim2.new(0, 600, 0, 400)
if robloxGui.AbsoluteSize.Y <= 320 then
backpackSize = UDim2.new(0, 200, 0, 140)
end
------------------------ End Locals --------------------------- ------------------------ End Locals ---------------------------
---------------------------------------- Public Event Setup ---------------------------------------- ---------------------------------------- Public Event Setup ----------------------------------------
@ -357,9 +353,9 @@ publicFunction("BackpackReady", backpackReady)
pcall(function() pcall(function()
coreGuiChanged( coreGuiChanged(
Enum.CoreGuiType.Backpack, 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) end)
inventoryButton.MouseButton1Click:connect(newTabClicked) inventoryButton.MouseButton1Click:connect(newTabClicked)
@ -419,8 +415,3 @@ searchBox.FocusLost:connect(function(enterPressed)
end) end)
searchButton.MouseButton1Click:connect(doSearch) searchButton.MouseButton1Click:connect(doSearch)
resetButton.MouseButton1Click:connect(resetSearch) resetButton.MouseButton1Click:connect(resetSearch)
if searchFrame and robloxGui.AbsoluteSize.Y <= 320 then
searchFrame.RobloxLocked = false
searchFrame:Destroy()
end

View File

@ -1,11 +1,11 @@
--!strict --!strict
-- CoreGui.RobloxGui.CoreScripts/ChatScript -- CoreGui.MercuryGui.CoreScripts/ChatScript
print "[Mercury]: Loaded corescript 97188756" print "[Mercury]: Loaded corescript 97188756"
local RunService = game:GetService "RunService" local RunService = game:GetService "RunService"
local SafeChat = require "../Modules/Safechat.yml" -- THANK YOU DARKLUA local SafeChat = require "../Modules/Safechat.yml" -- THANK YOU DARKLUA
local New = (require "../Modules/New").New local New = require("../Modules/New").New
local forceChatGUI = false local forceChatGUI = false
@ -17,20 +17,20 @@ local function WaitForChild(parent: Instance, childName)
return parent[childName] return parent[childName]
end end
while not Game.Players.LocalPlayer do while not game.Players.LocalPlayer do
RunService.Heartbeat:wait() RunService.Heartbeat:wait()
end end
local Player = Game.Players.LocalPlayer local Player = game.Players.LocalPlayer
while not Player.Character do while not Player.Character do
RunService.Heartbeat:wait() RunService.Heartbeat:wait()
end end
local Camera = Game.Workspace.CurrentCamera local Camera = game.Workspace.CurrentCamera
-- Services -- Services
local CoreGui = Game:GetService "CoreGui" local CoreGui = game:GetService "CoreGui"
local Players = Game:GetService "Players" local Players = game:GetService "Players"
local GuiService = Game:GetService "GuiService" local GuiService = game:GetService "GuiService"
-- Lua Enums -- Lua Enums
local Enums = {} local Enums = {}
@ -653,7 +653,7 @@ end
-- Create the initial Chat stuff -- Create the initial Chat stuff
-- Done only once -- Done only once
function Chat:CreateGui() function Chat:CreateGui()
self.Gui = WaitForChild(CoreGui, "RobloxGui") self.Gui = WaitForChild(CoreGui, "MercuryGui")
self.Frame = New "Frame" { self.Frame = New "Frame" {
Name = "ChatFrame", Name = "ChatFrame",
--Size = self.Configuration.Size; --Size = self.Configuration.Size;
@ -754,7 +754,7 @@ function Input:OnMouseScroll()
wait(0.25) wait(0.25)
end end
end end
wait(0.03) wait()
end end
end) end)
if Chat:CheckIfInBounds(Input.Speed) then if Chat:CheckIfInBounds(Input.Speed) then
@ -883,9 +883,9 @@ function Chat:Initialize()
pcall(function() pcall(function()
Chat:CoreGuiChanged( Chat:CoreGuiChanged(
Enum.CoreGuiType.Chat, 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) function(coreGuiType, enabled)
Chat:CoreGuiChanged(coreGuiType, enabled) Chat:CoreGuiChanged(coreGuiType, enabled)
end end

View File

@ -5,7 +5,7 @@ local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
local RenderModule = require "../Modules/Render" local RenderModule = require "../Modules/Render"
local SetupAvatar = require "../Modules/Render/SetupAvatar" local SetupAvatar = require "../Modules/Render/SetupAvatar"
local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation 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( local player = SetupAvatar(
_BASE_URL, _BASE_URL,

View File

@ -4,7 +4,7 @@
local ThumbnailGenerator = game:GetService "ThumbnailGenerator" local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
local RenderModule = require "../Modules/Render" local RenderModule = require "../Modules/Render"
local Render = RenderModule(_BASE_URL, _PING_URL, _THUMBNAIL_KEY) -- avoid ambiguous syntax after compilation 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}`) print(`[{game.JobId}] Starting new render for {_RENDER_TYPE} Id {_ASSET_ID}`)