Corescript improvements, playerlist fixes, and improvements to debug console

This commit is contained in:
Lewin Kelly 2024-03-24 18:23:13 +00:00
parent 615fbc465c
commit 67e8f51ca4
50 changed files with 1559 additions and 1611 deletions

View File

@ -136,7 +136,7 @@ function AnimateBars(x, y, lastX, height)
end end
tray.bar2.BackgroundColor3 = Color3.new(1, GBchannels, GBchannels) tray.bar2.BackgroundColor3 = Color3.new(1, GBchannels, GBchannels)
wait(0.02) wait()
end end
end end
@ -159,12 +159,12 @@ function AnimateHurtOverlay()
for i=1,i_total do for i=1,i_total do
overlay.Position = UDim2.new( (-2 + (2 * (i/i_total)) + wiggle_total/2), 0, (-2 + (2 * (i/i_total)) + wiggle_total/2), -22 ) overlay.Position = UDim2.new( (-2 + (2 * (i/i_total)) + wiggle_total/2), 0, (-2 + (2 * (i/i_total)) + wiggle_total/2), -22 )
overlay.Size = UDim2.new( (4.5 - (3.5 * (i/i_total)) + wiggle_total), 0, (4.65 - (3.5 * (i/i_total)) + wiggle_total), 30 ) overlay.Size = UDim2.new( (4.5 - (3.5 * (i/i_total)) + wiggle_total), 0, (4.65 - (3.5 * (i/i_total)) + wiggle_total), 30 )
wait(0.01) wait()
end end
i_total = 30 i_total = 30
wait(0.03) wait()
-- Animate Out, slow -- Animate Out, slow
for i=1,i_total do for i=1,i_total do
@ -174,7 +174,7 @@ function AnimateHurtOverlay()
wiggle_total = wiggle_total + wiggle_i wiggle_total = wiggle_total + wiggle_i
overlay.Position = UDim2.new( (0 - (2 * (i/i_total)) + wiggle_total/2), 0, (0 - (2 * (i/i_total)) + wiggle_total/2), -22 ) overlay.Position = UDim2.new( (0 - (2 * (i/i_total)) + wiggle_total/2), 0, (0 - (2 * (i/i_total)) + wiggle_total/2), -22 )
overlay.Size = UDim2.new( (1 + (3.5 * (i/i_total)) + wiggle_total), 0, (1.15 + (3.5 * (i/i_total)) + wiggle_total), 30 ) overlay.Size = UDim2.new( (1 + (3.5 * (i/i_total)) + wiggle_total), 0, (1.15 + (3.5 * (i/i_total)) + wiggle_total), 30 )
wait(0.01) wait()
end end
-- Hide after we're done -- Hide after we're done

View File

@ -1,4 +1,4 @@
--!nonstrict --!strict
--[[ --[[
Constructs a new computed state object, which follows the value of another Constructs a new computed state object, which follows the value of another

View File

@ -1,4 +1,4 @@
--!nonstrict --!strict
--[[ --[[
Constructs and returns objects which can be used to model derived reactive Constructs and returns objects which can be used to model derived reactive

View File

@ -1,4 +1,4 @@
--!nonstrict --!strict
--[[ --[[
Constructs a new ForKeys state object which maps keys of an array using Constructs a new ForKeys state object which maps keys of an array using

View File

@ -1,4 +1,4 @@
--!nonstrict --!strict
--[[ --[[
Constructs a new ForPairs object which maps pairs of a table using Constructs a new ForPairs object which maps pairs of a table using

View File

@ -1,4 +1,4 @@
--!nonstrict --!strict
--[[ --[[
Constructs a new ForValues object which maps values of a table using Constructs a new ForValues object which maps values of a table using

View File

@ -1,4 +1,4 @@
--!nonstrict --!strict
--[[ --[[
Constructs a new state object which can listen for updates on another state Constructs a new state object which can listen for updates on another state

View File

@ -1,4 +1,4 @@
--!nonstrict --!strict
--[[ --[[
Constructs and returns objects which can be used to model independent Constructs and returns objects which can be used to model independent

View File

@ -1,5 +1,4 @@
--!strict --!strict
--!nolint LocalShadow
--[[ --[[
Time-based contextual values, to allow for transparently passing values down Time-based contextual values, to allow for transparently passing values down

View File

@ -1,3 +1,4 @@
--!strict
local Load = {} local Load = {}
function Load.Help() function Load.Help()

View File

@ -1,3 +1,5 @@
--!strict
return function(IsServer: boolean) return function(IsServer: boolean)
local RunService = game:GetService "RunService" local RunService = game:GetService "RunService"

View File

@ -1,3 +1,5 @@
--!strict
return function(IsServer: boolean) return function(IsServer: boolean)
local RedEvent = require "../RedEvent"(IsServer) local RedEvent = require "../RedEvent"(IsServer)
local Event = RedEvent.Remote local Event = RedEvent.Remote

View File

@ -1,3 +1,5 @@
--!strict
return function(IsServer: boolean) return function(IsServer: boolean)
local Players = game:GetService "Players" local Players = game:GetService "Players"

View File

@ -1,3 +1,5 @@
--!strict
return function(IsServer: boolean) return function(IsServer: boolean)
local ReplicatedStorage = game:GetService "ReplicatedStorage" local ReplicatedStorage = game:GetService "ReplicatedStorage"
local Players = game:GetService "Players" local Players = game:GetService "Players"

View File

@ -1,3 +1,5 @@
--!strict
local Spawn = require "./Spawn" local Spawn = require "./Spawn"
local typeof = require "../../../Modules/Polyfill/typeof" local typeof = require "../../../Modules/Polyfill/typeof"

View File

@ -1,4 +1,5 @@
-- local ReplicatedStorage = game:GetService "ReplicatedStorage" --!strict
local RunService = game:GetService "RunService" local RunService = game:GetService "RunService"
local function MakeHeartbeatFunction(Clock: Clock) local function MakeHeartbeatFunction(Clock: Clock)

View File

@ -1,3 +1,5 @@
--!strict
local CollectionService = game:GetService "CollectionService" local CollectionService = game:GetService "CollectionService"
local Spawn = require "./Spawn" local Spawn = require "./Spawn"

View File

@ -1,3 +1,5 @@
--!strict
local RunService = game:GetService "RunService" local RunService = game:GetService "RunService"
local Spawn = require "./Spawn" local Spawn = require "./Spawn"

View File

@ -1,3 +1,5 @@
--!strict
return function<T>(Limit: number, Interval: number) return function<T>(Limit: number, Interval: number)
assert(Limit > 0, "Limit must be greater than 0") assert(Limit > 0, "Limit must be greater than 0")

View File

@ -1,3 +1,5 @@
--!strict
local Promise = require "./Promise" local Promise = require "./Promise"
local Spawn = require "./Spawn" local Spawn = require "./Spawn"

View File

@ -1,4 +1,6 @@
local FreeThread: thread? = nil --!strict
local FreeThread: thread?
local function FunctionPasser(fn, ...) local function FunctionPasser(fn, ...)
local AquiredThread = FreeThread local AquiredThread = FreeThread

View File

@ -1,3 +1,5 @@
--!strict
local function Red(_, Script: LuaSourceContainer) local function Red(_, Script: LuaSourceContainer)
local _SERVER local _SERVER

View File

@ -1,181 +0,0 @@
-- A basic polyfill for the typeof function
return function(value)
local basicType = type(value)
if
basicType == "nil"
or basicType == "boolean"
or basicType == "number"
or basicType == "string"
or basicType == "function"
or basicType == "thread"
or basicType == "table"
then
return basicType
end
-- Will short-circuit
--[[
{
name of type to check,
{ list of required properties },
}
]]
local tests = {
{
"Instance",
{ "ClassName" },
},
{
"EnumItem",
{ "EnumType", "Name", "Value" },
},
{
"Enum",
{ "GetEnumItems" },
},
{
"Enums",
{ "MembershipType" }, -- lmao
},
{
"RBXScriptSignal",
{
"connect",
-- "connected",
-- "connectFirst",
-- "connectLast",
"wait",
},
},
{
"RBXScriptConnection",
{
"connected",
"disconnect",
},
},
{
"TweenInfo",
{
"EasingDirection",
-- "Time",
-- "DelayTime",
"RepeatCount",
"EasingStyle",
-- "Reverses",
},
},
{
"CFrame",
{
"p",
"x",
"y",
"z",
"lookVector",
},
},
{
"Vector3",
{
"Lerp",
-- "Cross",
-- "Dot",
"unit",
"magnitude",
"x",
"y",
"z",
},
},
{
"Vector3int16",
{ "z", "x", "y" },
},
{
"Vector2",
{ "unit", "magnitude", "x", "y" },
},
{
"Vector2int16",
{ "x", "y" },
},
{
"Region3",
{ "CFrame", "Size" },
},
{
"Region3int16",
{ "Min", "Max" },
},
{
"Ray",
{
"Origin",
"Direction",
"Unit",
"ClosestPoint",
"Distance",
},
},
{
"UDim",
{ "Scale", "Offset" },
},
{
"Axes",
{ "Z", "X", "Y" },
},
{
"UDim2",
{ "X", "Y" },
},
{
"BrickColor",
{
"Number",
"Name",
"Color",
"r",
"g",
"b",
},
},
{
"Color3",
{ "r", "g", "b" },
},
{
"Faces",
{
"Right",
"Top",
"Back",
-- "Left",
-- "Bottom",
-- "Front",
},
},
}
for _, v in ipairs(tests) do
local t, test = v[1], v[2]
local ok, result = pcall(function()
for _, prop in ipairs(test) do
if value[prop] == nil then
return false
end
-- Cannot throw if the property does not exist,
-- as userdatas may allow nil indexing
end
return true
end)
if ok and result then
return t
end
end
end

View File

@ -1,17 +1,71 @@
--!strict
local Players = game:GetService "Players" local Players = game:GetService "Players"
local MaxLength = 35
local New = (require "../Modules/New").New local New = (require "../Modules/New").New
return function(parent: Instance) local logEvent: BindableEvent
local username = Players.LocalPlayer.Name
if username ~= "Heliodex" then -- Don't show the debug console for anyone but me local docs: { [string]: { string } } = {
help = {
"help()",
"You've already found this command!",
},
printTable = {
"printTable(t: { [any]: any }, max: number?)",
"Prints the contents of a table to the console.",
"`max` is the maximum number of entries to print. If not provided, all",
"entries are printed.",
},
exit = {
"exit()",
"Exits the debug console.",
},
}
local utility = {
help = function()
for _, doc in pairs(docs) do
logEvent:Fire(doc[1], Color3.new(1, 1, 0.3))
for i = 2, #doc do
logEvent:Fire("\t" .. doc[i], Color3.new(1, 1, 1))
end
end
end,
printTable = function(t: { [any]: any }, max: number?)
assert(type(t) == "table", "Expected table, got " .. type(t))
local num = max or math.huge
local len = 0
for k, v in pairs(t) do
len += 1
if len < num then
logEvent:Fire(tostring(k) .. " = " .. tostring(v))
end
end
if len >= num then
logEvent:Fire("... and " .. tostring(len - num) .. " more")
end
end,
exit = function()
logEvent:Fire("Goodbye!", Color3.new(1, 1, 0.3))
wait(0.5)
local debug = game.CoreGui:FindFirstChild "Debug console" :: ScreenGui
debug:Destroy()
end,
}
return function(parent: CoreGui)
if not Players.LocalPlayer or Players.LocalPlayer.Name ~= "Heliodex" then -- Don't show the debug console for anyone but me
return return
end end
local logEvent = New "BindableEvent" { logEvent = logEvent
Name = "Log", or New "BindableEvent" {
Parent = parent, Name = "Log",
} Parent = game,
}
local screen = New "ScreenGui" { local screen = New "ScreenGui" {
Name = "Debug console", Name = "Debug console",
@ -21,34 +75,159 @@ return function(parent: Instance)
local frame = New "Frame" { local frame = New "Frame" {
Name = "Frame", Name = "Frame",
BackgroundTransparency = 1, BackgroundTransparency = 1,
Position = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0, 0, 0.2, 0),
Size = UDim2.new(0.5, 0, 1, 0), Size = UDim2.new(0.25, 0, 0.7, 0),
Parent = screen Parent = screen,
New "TextBox" {
Name = "Input",
BackgroundColor3 = Color3.new(0, 0, 0),
BackgroundTransparency = 0.5,
BorderSizePixel = 0,
Position = UDim2.new(0, 0, 1, -30),
Size = UDim2.new(1, 0, 0, 30),
Font = Enum.Font.SourceSans,
FontSize = Enum.FontSize.Size14,
TextColor3 = Color3.new(1, 1, 1),
TextXAlignment = Enum.TextXAlignment.Left,
},
} }
local console = New "TextBox" { local console = New "Frame" {
Name = "Console", Name = "Console",
BackgroundColor3 = Color3.new(0, 0, 0), BackgroundColor3 = Color3.new(0, 0, 0),
BackgroundTransparency = 0.5, BackgroundTransparency = 0.5,
BorderSizePixel = 0, BorderSizePixel = 0,
Position = UDim2.new(0, 0, 0, 0),
Size = UDim2.new(1, 0, 1, -30),
Parent = frame,
}
local logLines = {}
local logLineInstances: { TextLabel } = {}
for i = 1, MaxLength do
table.insert(logLines, {
Text = "",
Colour = Color3.new(1, 1, 1),
})
table.insert(
logLineInstances,
New "TextLabel" {
Name = "LogLine",
BackgroundTransparency = 1,
Font = Enum.Font.SourceSans,
FontSize = Enum.FontSize.Size18,
Position = UDim2.new(0, 0, 0, (i - 1) * 18),
Size = UDim2.new(1, 0, 0, 18),
Text = "",
TextColor3 = Color3.new(1, 1, 1),
TextXAlignment = Enum.TextXAlignment.Left,
Parent = console,
}
)
end
local function recomputeLogLines()
for i, line in ipairs(logLines) do
logLineInstances[i].Text = line.Text
logLineInstances[i].TextColor3 = line.Colour or Color3.new(1, 1, 1)
end
end
logEvent.Event:connect(function(text: string, colour: Color3?)
table.insert(logLines, {
Text = text,
Colour = colour or Color3.new(1, 1, 1),
})
if #logLines > MaxLength then
table.remove(logLines, 1)
end
recomputeLogLines()
end)
local input = New "TextBox" {
Name = "Input",
BackgroundColor3 = Color3.new(0.2, 0.2, 0.2),
BackgroundTransparency = 0.2,
BorderSizePixel = 0,
Position = UDim2.new(0, 0, 1, -30), Position = UDim2.new(0, 0, 1, -30),
Size = UDim2.new(1, 0, 0, 30), Size = UDim2.new(1, -30, 0, 30),
Font = Enum.Font.SourceSans, Font = Enum.Font.SourceSans,
FontSize = Enum.FontSize.Size14, FontSize = Enum.FontSize.Size18,
Text = "",
TextColor3 = Color3.new(1, 1, 1), TextColor3 = Color3.new(1, 1, 1),
TextXAlignment = Enum.TextXAlignment.Left, TextXAlignment = Enum.TextXAlignment.Left,
Parent = frame ClearTextOnFocus = false,
Parent = frame,
} }
local upButton = New "TextButton" {
Name = "UpButton",
BackgroundColor3 = Color3.new(0.2, 0.2, 0.2),
BackgroundTransparency = 0.2,
BorderSizePixel = 0,
Position = UDim2.new(1, -30, 1, -30),
Size = UDim2.new(0, 30, 0, 30),
Font = Enum.Font.SourceSans,
FontSize = Enum.FontSize.Size24,
Text = "^",
TextColor3 = Color3.new(1, 1, 1),
Parent = frame,
}
local history = {}
local historyPos = 1
-- on upButton pressed, go back in history
upButton.MouseButton1Click:connect(function()
if historyPos > #history then
return
end
input.Text = history[historyPos]
historyPos += 1
end)
input.FocusLost:connect(function(enterPressed)
if enterPressed then
historyPos = 1
local text = input.Text
table.insert(history, 1, text)
logEvent:Fire("> " .. text)
-- run the command
local fn = loadstring(text)
if fn then
local env = getfenv(fn)
for k, v in pairs(utility) do
env[k] = v
end
setfenv(fn, env)
local success, output = ypcall(fn)
if success then
logEvent:Fire(
"= " .. tostring(output),
Color3.new(0.5, 1, 0.5)
)
else
logEvent:Fire(
"! " .. tostring(output),
Color3.new(1, 0.5, 0.5)
)
end
else
logEvent:Fire("Invalid command", Color3.new(1, 0.3, 0.3))
end
input.Text = ""
input.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
end
end)
input.Changed:connect(function(property)
if property ~= "Text" or input.Text == "" then
return
end
input.BackgroundColor3 = Color3.new(0, 0, 0)
end)
logEvent:Fire("[Reading access...]", Color3.new(0.5, 0.5, 0.5)) -- haxor text
logEvent:Fire("[Access granted.]", Color3.new(0.5, 1, 0.5))
logEvent:Fire(
"Welcome to the Mercury Debug Console!",
Color3.new(1, 1, 0.3)
)
logEvent:Fire("Type `help()` for a list of commands.", Color3.new(1, 1, 1))
logEvent:Fire("")
end end

15
Modules/Logger.luau Normal file
View File

@ -0,0 +1,15 @@
local logEvent
return function(...: string)
if game.Players.LocalPlayer.Name ~= "Heliodex" then
return
end
logEvent = logEvent or game:WaitForChild "Log"
local message = ""
for _, v in ipairs { ... } do
message ..= tostring(v) .. " "
end
print(message)
logEvent:Fire(message)
end

View File

@ -1,3 +1,4 @@
--!strict
-- A basic polyfill for the typeof function -- A basic polyfill for the typeof function
return function(value) return function(value)
@ -16,32 +17,26 @@ return function(value)
end end
-- Will short-circuit -- Will short-circuit
--[[
{
name of type to check,
{ list of required properties },
}
]]
local tests = { local tests = {
{ {
"Instance", Type = "Instance",
{ "ClassName" }, Props = { "ClassName" },
}, },
{ {
"EnumItem", Type = "EnumItem",
{ "EnumType", "Name", "Value" }, Props = { "EnumType", "Name", "Value" },
}, },
{ {
"Enum", Type = "Enum",
{ "GetEnumItems" }, Props = { "GetEnumItems" },
}, },
{ {
"Enums", Type = "Enums",
{ "MembershipType" }, -- lmao Props = { "MembershipType" }, -- lmao
}, },
{ {
"RBXScriptSignal", Type = "RBXScriptSignal",
{ Props = {
"connect", "connect",
-- "connected", -- "connected",
-- "connectFirst", -- "connectFirst",
@ -50,15 +45,15 @@ return function(value)
}, },
}, },
{ {
"RBXScriptConnection", Type = "RBXScriptConnection",
{ Props = {
"connected", "connected",
"disconnect", "disconnect",
}, },
}, },
{ {
"TweenInfo", Type = "TweenInfo",
{ Props = {
"EasingDirection", "EasingDirection",
-- "Time", -- "Time",
-- "DelayTime", -- "DelayTime",
@ -68,8 +63,8 @@ return function(value)
}, },
}, },
{ {
"CFrame", Type = "CFrame",
{ Props = {
"p", "p",
"x", "x",
"y", "y",
@ -78,8 +73,8 @@ return function(value)
}, },
}, },
{ {
"Vector3", Type = "Vector3",
{ Props = {
"Lerp", "Lerp",
-- "Cross", -- "Cross",
-- "Dot", -- "Dot",
@ -91,28 +86,28 @@ return function(value)
}, },
}, },
{ {
"Vector3int16", Type = "Vector3int16",
{ "z", "x", "y" }, Props = { "z", "x", "y" },
}, },
{ {
"Vector2", Type = "Vector2",
{ "unit", "magnitude", "x", "y" }, Props = { "unit", "magnitude", "x", "y" },
}, },
{ {
"Vector2int16", Type = "Vector2int16",
{ "x", "y" }, Props = { "x", "y" },
}, },
{ {
"Region3", Type = "Region3",
{ "CFrame", "Size" }, Props = { "CFrame", "Size" },
}, },
{ {
"Region3int16", Type = "Region3int16",
{ "Min", "Max" }, Props = { "Min", "Max" },
}, },
{ {
"Ray", Type = "Ray",
{ Props = {
"Origin", "Origin",
"Direction", "Direction",
"Unit", "Unit",
@ -121,20 +116,20 @@ return function(value)
}, },
}, },
{ {
"UDim", Type = "UDim",
{ "Scale", "Offset" }, Props = { "Scale", "Offset" },
}, },
{ {
"Axes", Type = "Axes",
{ "Z", "X", "Y" }, Props = { "Z", "X", "Y" },
}, },
{ {
"UDim2", Type = "UDim2",
{ "X", "Y" }, Props = { "X", "Y" },
}, },
{ {
"BrickColor", Type = "BrickColor",
{ Props = {
"Number", "Number",
"Name", "Name",
"Color", "Color",
@ -144,12 +139,12 @@ return function(value)
}, },
}, },
{ {
"Color3", Type = "Color3",
{ "r", "g", "b" }, Props = { "r", "g", "b" },
}, },
{ {
"Faces", Type = "Faces",
{ Props = {
"Right", "Right",
"Top", "Top",
"Back", "Back",
@ -161,7 +156,7 @@ return function(value)
} }
for _, v in ipairs(tests) do for _, v in ipairs(tests) do
local t, test = v[1], v[2] local t, test = v.Type, v.Props
local ok, result = pcall(function() local ok, result = pcall(function()
for _, prop in ipairs(test) do for _, prop in ipairs(test) do
@ -178,5 +173,6 @@ return function(value)
return t return t
end end
end end
return basicType return basicType
end end

View File

@ -4024,19 +4024,9 @@ declare class ClusterPacketCache extends Instance
end end
declare class CollectionService extends Instance declare class CollectionService extends Instance
TagAdded: RBXScriptSignal<string> ItemAdded: RBXScriptSignal<Instance>
ItemAdded: RBXScriptSignal<string> ItemRemoved: RBXScriptSignal<Instance>
TagRemoved: RBXScriptSignal<string>
ItemRemoved: RBXScriptSignal<string>
function AddTag(self, instance: Instance, tag: string): nil
function GetAllTags(self): { string }
function GetInstanceAddedSignal(self, tag: string): RBXScriptSignal<Instance>
function GetInstanceRemovedSignal(self, tag: string): RBXScriptSignal<Instance>
function GetCollection(self, tag: string): { Instance } function GetCollection(self, tag: string): { Instance }
function GetTagged(self, tag: string): { Instance }
function GetTags(self, instance: Instance): { string }
function HasTag(self, instance: Instance, tag: string): boolean
function RemoveTag(self, instance: Instance, tag: string): nil
end end
declare class CommandInstance extends Instance declare class CommandInstance extends Instance
@ -5037,12 +5027,8 @@ end
declare class TextBox extends GuiObject declare class TextBox extends GuiObject
ClearTextOnFocus: boolean ClearTextOnFocus: boolean
ContentText: string
CursorPosition: number
FocusLost: RBXScriptSignal<boolean, InputObject> FocusLost: RBXScriptSignal<boolean, InputObject>
Focused: RBXScriptSignal<>
Font: EnumFont Font: EnumFont
FontFace: Font
LineHeight: number LineHeight: number
ManualFocusRelease: boolean ManualFocusRelease: boolean
MaxVisibleGraphemes: number MaxVisibleGraphemes: number
@ -9142,4 +9128,4 @@ declare LoadLibrary: ((libraryName: "RbxFusion") -> Fusion) & ((libraryName: "Rb
declare function settings(): GlobalSettings declare function settings(): GlobalSettings
declare function UserSettings(): UserSettings declare function UserSettings(): UserSettings
declare function PluginManager(): PluginManager declare function PluginManager(): PluginManager
declare function ypcall(f: (() -> any) | (() -> ()), ...: any): (boolean, any) declare function ypcall(f: (() -> any) | (() -> ()) | ((...any) -> (), (...any) -> ()) -> (), ...: any): (boolean, any)

View File

@ -8,20 +8,21 @@ local MarketplaceService = game:GetService "MarketplaceService"
local GuiService = game:GetService "GuiService" local GuiService = game:GetService "GuiService"
local ContentProvider = game:GetService "ContentProvider" local ContentProvider = game:GetService "ContentProvider"
local HttpService = game:GetService "HttpService" local HttpService = game:GetService "HttpService"
local RunService = game:GetService "RunService"
-- wait for important items to appear -- wait for important items to appear
while not Game do while not Game do
wait(0.1) RunService.Heartbeat:wait()
end end
while not MarketplaceService do while not MarketplaceService do
wait(0.1) RunService.Heartbeat:wait()
MarketplaceService = game:GetService "MarketplaceService" MarketplaceService = game:GetService "MarketplaceService"
end end
while not game:FindFirstChild "CoreGui" do while not game:FindFirstChild "CoreGui" do
wait(0.1) RunService.Heartbeat:wait()
end end
while not game.CoreGui:FindFirstChild "RobloxGui" do while not game.CoreGui:FindFirstChild "RobloxGui" do
wait(0.1) RunService.Heartbeat:wait()
end end
-------------------------------- Global Variables ---------------------------------------- -------------------------------- Global Variables ----------------------------------------

View File

@ -1,3 +1,4 @@
--!strict
-- CoreGui.RobloxGui.CoreScripts/ToolTip -- CoreGui.RobloxGui.CoreScripts/ToolTip
print "[Mercury]: Loaded corescript 36868950" print "[Mercury]: Loaded corescript 36868950"
@ -5,7 +6,10 @@ local News = require "../Modules/New"
local New = News.New local New = News.New
local Hydrate = News.Hydrate local Hydrate = News.Hydrate
local controlFrame = script.Parent:FindFirstChild "ControlFrame" local RunService = game:GetService "RunService"
local RobloxGui = script.Parent
local controlFrame = RobloxGui:FindFirstChild "ControlFrame"
if not controlFrame then if not controlFrame then
return return
@ -49,7 +53,7 @@ local function setUpListeners(frameToListen)
- fadeSpeed - fadeSpeed
frameToListen.TextTransparency = frameToListen.TextTransparency frameToListen.TextTransparency = frameToListen.TextTransparency
- fadeSpeed - fadeSpeed
wait() RunService.Heartbeat:wait()
end end
end end
end end

View File

@ -5,7 +5,8 @@ print "[Mercury]: Loaded corescript 37801172"
local ScriptContext = game:GetService "ScriptContext" local ScriptContext = game:GetService "ScriptContext"
local CoreGui = game:GetService "CoreGui" local CoreGui = game:GetService "CoreGui"
require "../Modules/DebugConsole"(CoreGui) local Debug = require "../Modules/DebugConsole"
Debug(CoreGui)
-- Creates all neccessary scripts for the gui on initial load, everything except build tools -- Creates all neccessary scripts for the gui on initial load, everything except build tools
-- Please note that these are loaded in a specific order to diminish errors/perceived load time by user -- Please note that these are loaded in a specific order to diminish errors/perceived load time by user
@ -24,7 +25,10 @@ local function waitForChild(instance, name)
end end
waitForChild(CoreGui, "RobloxGui") waitForChild(CoreGui, "RobloxGui")
local screenGui = CoreGui:FindFirstChild "RobloxGui" local screenGui = CoreGui:FindFirstChild "RobloxGui" :: ScreenGui & {
Backpack: Frame,
CurrentLoadout: Frame,
}
local scripts = { local scripts = {
[36868950] = "CoreScripts/ToolTip", -- ToolTipper (creates tool tips for gui) [36868950] = "CoreScripts/ToolTip", -- ToolTipper (creates tool tips for gui)
@ -40,25 +44,8 @@ for id, path in pairs(scripts) do
ScriptContext:AddCoreScript(id, screenGui, path) ScriptContext:AddCoreScript(id, screenGui, path)
end end
if screenGui.AbsoluteSize.Y >= 600 then -- New Player List
-- New Player List ScriptContext:AddCoreScript(48488235, screenGui, "CoreScripts/PlayerListScript")
ScriptContext:AddCoreScript(
48488235,
screenGui,
"CoreScripts/PlayerListScript"
)
else
delay(5, function()
if screenGui.AbsoluteSize.Y >= 600 then
-- New Player List
ScriptContext:AddCoreScript(
48488235,
screenGui,
"CoreScripts/PlayerListScript"
)
end
end)
end
-- Backpack Builder, creates most of the backpack gui -- Backpack Builder, creates most of the backpack gui
ScriptContext:AddCoreScript( ScriptContext:AddCoreScript(
@ -69,7 +56,7 @@ ScriptContext:AddCoreScript(
waitForChild(screenGui, "CurrentLoadout") waitForChild(screenGui, "CurrentLoadout")
waitForChild(screenGui, "Backpack") waitForChild(screenGui, "Backpack")
local Backpack = screenGui.Backpack local Backpack = screenGui.Backpack :: Frame
-- Manager handles all big backpack state changes, other scripts subscribe to this and do things accordingly -- Manager handles all big backpack state changes, other scripts subscribe to this and do things accordingly
ScriptContext:AddCoreScript( ScriptContext:AddCoreScript(

View File

@ -1,3 +1,4 @@
--!strict
-- CoreGui.RobloxGui.CoreScripts/MainBotChatScript -- CoreGui.RobloxGui.CoreScripts/MainBotChatScript
print "[Mercury]: Loaded corescript 39250920" print "[Mercury]: Loaded corescript 39250920"
@ -6,6 +7,7 @@ local New = News.New
local Hydrate = News.Hydrate local Hydrate = News.Hydrate
local InsertService = game:GetService "InsertService" local InsertService = game:GetService "InsertService"
local RunService = game:GetService "RunService"
local function waitForProperty(instance, name) local function waitForProperty(instance, name)
while not instance[name] do while not instance[name] do
@ -173,11 +175,13 @@ local function createMessageDialog()
} }
end end
local function showMessage(msg, size) local function showMessage(msg: string, size: number)
Hydrate(messageDialog) {
Size = UDim2.new(0, size, 0, 40),
Position = UDim2.new(0.5, -size / 2, 0.5, -40),
Visible = true,
}
messageDialog.Text.Text = msg messageDialog.Text.Text = msg
messageDialog.Size = UDim2.new(0, size, 0, 40)
messageDialog.Position = UDim2.new(0.5, -size / 2, 0.5, -40)
messageDialog.Visible = true
wait(2) wait(2)
messageDialog.Visible = false messageDialog.Visible = false
end end
@ -243,7 +247,7 @@ local function normalEndDialog()
endDialog() endDialog()
end end
local function sanitizeMessage(msg) local function sanitiseMessage(msg)
if string.len(msg) == 0 then if string.len(msg) == 0 then
return "..." return "..."
end end
@ -256,7 +260,7 @@ local function presentDialogChoices(talkingPart, dialogChoices)
end end
currentConversationPartner = talkingPart currentConversationPartner = talkingPart
local sortedDialogChoices = {} local sortedDialogChoices: { DialogChoice } = {}
for _, obj in pairs(dialogChoices) do for _, obj in pairs(dialogChoices) do
if obj:IsA "DialogChoice" then if obj:IsA "DialogChoice" then
table.insert(sortedDialogChoices, obj) table.insert(sortedDialogChoices, obj)
@ -313,7 +317,6 @@ local function renewKillswitch(dialog)
end end
currentAbortDialogScript = Hydrate(timeoutScript:Clone()) { currentAbortDialogScript = Hydrate(timeoutScript:Clone()) {
archivable = false, archivable = false,
Disabled = false, Disabled = false,
Parent = dialog, Parent = dialog,
@ -323,11 +326,13 @@ end
local function selectChoice(choice) local function selectChoice(choice)
renewKillswitch(currentConversationDialog) renewKillswitch(currentConversationDialog)
local localPlayer = game.Players.LocalPlayer
--First hide the Gui --First hide the Gui
mainFrame.Visible = false mainFrame.Visible = false
if choice == lastChoice then if choice == lastChoice then
game.Chat:Chat( game.Chat:Chat(
game.Players.LocalPlayer.Character, localPlayer.Character,
"Goodbye!", "Goodbye!",
getChatColor(currentTone()) getChatColor(currentTone())
) )
@ -337,8 +342,8 @@ local function selectChoice(choice)
local dialogChoice = choiceMap[choice] local dialogChoice = choiceMap[choice]
game.Chat:Chat( game.Chat:Chat(
game.Players.LocalPlayer.Character, localPlayer.Character,
sanitizeMessage(dialogChoice.UserDialog), sanitiseMessage(dialogChoice.UserDialog),
getChatColor(currentTone()) getChatColor(currentTone())
) )
wait(1) wait(1)
@ -348,7 +353,7 @@ local function selectChoice(choice)
) )
game.Chat:Chat( game.Chat:Chat(
currentConversationPartner, currentConversationPartner,
sanitizeMessage(dialogChoice.ResponseDialog), sanitiseMessage(dialogChoice.ResponseDialog),
getChatColor(currentTone()) getChatColor(currentTone())
) )
@ -444,7 +449,7 @@ local function doDialog(dialog)
local il = Instance.Lock(dialog, player) local il = Instance.Lock(dialog, player)
print("for instance", il) print("for instance", il)
while not il do while not il do
wait() RunService.Heartbeat:wait()
il = Instance.Lock(dialog, player) il = Instance.Lock(dialog, player)
print("for instance", il) print("for instance", il)
end end
@ -486,7 +491,7 @@ local function checkForLeaveArea()
end end
end end
local function startDialog(dialog) local function startDialog(dialog: Dialog)
if dialog.Parent and dialog.Parent:IsA "BasePart" then if dialog.Parent and dialog.Parent:IsA "BasePart" then
if if
player:DistanceFromCharacter(dialog.Parent.Position) player:DistanceFromCharacter(dialog.Parent.Position)
@ -509,7 +514,7 @@ local function startDialog(dialog)
end end
end end
local function removeDialog(dialog) local function removeDialog(dialog: Dialog)
if dialogMap[dialog] then if dialogMap[dialog] then
dialogMap[dialog]:Remove() dialogMap[dialog]:Remove()
dialogMap[dialog] = nil dialogMap[dialog] = nil
@ -520,7 +525,7 @@ local function removeDialog(dialog)
end end
end end
local function addDialog(dialog) local function addDialog(dialog: Dialog)
if dialog.Parent then if dialog.Parent then
if dialog.Parent:IsA "BasePart" then if dialog.Parent:IsA "BasePart" then
local chatGui = Hydrate(chatNotificationGui:Clone()) { local chatGui = Hydrate(chatNotificationGui:Clone()) {

View File

@ -8,6 +8,7 @@ local Hydrate = News.Hydrate
local ContentProvider = game:GetService "ContentProvider" local ContentProvider = game:GetService "ContentProvider"
local InsertService = game:GetService "InsertService" local InsertService = game:GetService "InsertService"
local RunService = game:GetService "RunService"
local RbxGui = {} local RbxGui = {}
@ -111,7 +112,13 @@ local function CreateButtons(frame, buttons, yPos, ySize)
end end
end end
local function setSliderPos(newAbsPosX, slider, sliderPosition, bar, steps) local function setSliderPos(
newAbsPosX: number,
slider: ImageButton,
sliderPosition: IntValue,
bar,
steps: number
)
local newStep = steps - 1 --otherwise we really get one more step than we want local newStep = steps - 1 --otherwise we really get one more step than we want
local relativePosX = math.min( local relativePosX = math.min(
1, 1,
@ -245,7 +252,7 @@ function RbxGui.CreateStyledMessageDialog(title, message, style, buttons)
end end
local scrollMouseCount local scrollMouseCount
function RbxGui.CreateDropDownMenu(items, onSelect, forRoblox) function RbxGui.CreateDropDownMenu(items, onSelect, forRoblox: boolean?)
local width = UDim.new(0, 100) local width = UDim.new(0, 100)
local height = UDim.new(0, 32) local height = UDim.new(0, 32)
@ -342,7 +349,7 @@ function RbxGui.CreateDropDownMenu(items, onSelect, forRoblox)
local scrollDownButton local scrollDownButton
scrollMouseCount = 0 scrollMouseCount = 0
local setZIndex = function(baseZIndex) local function setZIndex(baseZIndex: number)
droppedDownMenu.ZIndex = baseZIndex + 1 droppedDownMenu.ZIndex = baseZIndex + 1
if scrollUpButton then if scrollUpButton then
scrollUpButton.ZIndex = baseZIndex + 3 scrollUpButton.ZIndex = baseZIndex + 3
@ -686,11 +693,12 @@ function RbxGui.GetFontHeight(font, fontSize)
end end
end end
local function layoutGuiObjectsHelper(frame, guiObjects, settingsTable) local function layoutGuiObjectsHelper(frame: Frame, guiObjects, settingsTable)
local totalPixels = frame.AbsoluteSize.Y local totalPixels = frame.AbsoluteSize.Y
local pixelsRemaining = frame.AbsoluteSize.Y local pixelsRemaining = frame.AbsoluteSize.Y
for _, child in ipairs(guiObjects) do for _, ch in ipairs(guiObjects) do
if child:IsA "TextLabel" or child:IsA "TextButton" then if ch:IsA "TextLabel" or ch:IsA "TextButton" then
local child = ch :: TextLabel & TextButton -- luau moment
local isLabel = child:IsA "TextLabel" local isLabel = child:IsA "TextLabel"
if isLabel then if isLabel then
pixelsRemaining = pixelsRemaining pixelsRemaining = pixelsRemaining
@ -712,7 +720,10 @@ local function layoutGuiObjectsHelper(frame, guiObjects, settingsTable)
pixelsRemaining pixelsRemaining
) )
if child.TextFits and child.TextBounds.Y < pixelsRemaining then if
child.TextFits
and (child.TextBounds.Y :: number) < pixelsRemaining
then
child.Visible = true child.Visible = true
if isLabel then if isLabel then
child.Size = UDim2.new( child.Size = UDim2.new(
@ -752,7 +763,8 @@ local function layoutGuiObjectsHelper(frame, guiObjects, settingsTable)
pixelsRemaining = -1 pixelsRemaining = -1
end end
else else
--GuiObject local child = ch :: GuiObject
-- GuiObject
child.Position = UDim2.new( child.Position = UDim2.new(
child.Position.X.Scale, child.Position.X.Scale,
child.Position.X.Offset, child.Position.X.Offset,
@ -804,7 +816,7 @@ function RbxGui.LayoutGuiObjects(frame, guiObjects, settingsTable)
end end
local recalculate = function() local recalculate = function()
wait() RunService.Heartbeat:wait()
layoutGuiObjectsHelper(wrapperFrame, guiObjects, settingsTable) layoutGuiObjectsHelper(wrapperFrame, guiObjects, settingsTable)
end end
@ -819,7 +831,7 @@ function RbxGui.LayoutGuiObjects(frame, guiObjects, settingsTable)
layoutGuiObjectsHelper(wrapperFrame, guiObjects, settingsTable) layoutGuiObjectsHelper(wrapperFrame, guiObjects, settingsTable)
end end
function RbxGui.CreateSlider(steps, width, position) function RbxGui.CreateSlider(steps: number, width: number, position)
local sliderGui = New "Frame" { local sliderGui = New "Frame" {
Size = UDim2.new(1, 0, 1, 0), Size = UDim2.new(1, 0, 1, 0),
BackgroundTransparency = 1, BackgroundTransparency = 1,
@ -937,8 +949,8 @@ function RbxGui.CreateTrueScrollingFrame()
local lowY local lowY
local highY local highY
local dragCon local dragCon: RBXScriptConnection?
local upCon local upCon: RBXScriptConnection?
local internalChange = false local internalChange = false
@ -1060,18 +1072,20 @@ function RbxGui.CreateTrueScrollingFrame()
Size = UDim2.new(0, 10, 0, 0), Size = UDim2.new(0, 10, 0, 0),
ZIndex = 2, ZIndex = 2,
BackgroundTransparency = 0.5, BackgroundTransparency = 0.5,
Parent = scrollbar,
} }
end end
local scrollNub = Hydrate(nub()) { local scrollNub = Hydrate(nub()) {
Position = UDim2.new(0.5, -5, 0.5, 0), Position = UDim2.new(0.5, -5, 0.5, 0),
Parent = scrollbar,
} }
local newNub = Hydrate(nub()) { local newNub = Hydrate(nub()) {
Position = UDim2.new(0.5, -5, 0.5, -2), Position = UDim2.new(0.5, -5, 0.5, -2),
Parent = scrollbar,
} }
local lastNub = Hydrate(nub()) { local lastNub = Hydrate(nub()) {
Position = UDim2.new(0.5, -5, 0.5, 2), Position = UDim2.new(0.5, -5, 0.5, 2),
Parent = scrollbar,
} }
scrollbar.MouseEnter:connect(function() scrollbar.MouseEnter:connect(function()
@ -1148,7 +1162,7 @@ function RbxGui.CreateTrueScrollingFrame()
return (oldPos ~= scrollbar.Position) return (oldPos ~= scrollbar.Position)
end end
local function drillDownSetHighLow(instance) local function drillDownSetHighLow(instance: GuiObject)
if not instance or not instance:IsA "GuiObject" then if not instance or not instance:IsA "GuiObject" then
return return
end end
@ -1176,7 +1190,7 @@ function RbxGui.CreateTrueScrollingFrame()
end end
local children = instance:GetChildren() local children = instance:GetChildren()
for i = 1, #children do for i = 1, #children do
drillDownSetHighLow(children[i]) drillDownSetHighLow(children[i] :: GuiObject)
end end
end end
@ -1184,7 +1198,7 @@ function RbxGui.CreateTrueScrollingFrame()
local firstChildren = scrollingFrame:GetChildren() local firstChildren = scrollingFrame:GetChildren()
for i = 1, #firstChildren do for i = 1, #firstChildren do
drillDownSetHighLow(firstChildren[i]) drillDownSetHighLow(firstChildren[i]) -- y no type annotation here, luau?
end end
end end
@ -1352,24 +1366,27 @@ function RbxGui.CreateTrueScrollingFrame()
upCon = mouseDrag.MouseButton1Up:connect(function() upCon = mouseDrag.MouseButton1Up:connect(function()
scrollStamp = tick() scrollStamp = tick()
mouseDrag.Parent = nil mouseDrag.Parent = nil
upCon:disconnect() if upCon then
-- what's upcon
-- nothing much, you?
upCon:disconnect()
end
end) end)
mouseDrag.Parent = getScreenGuiAncestor(scrollbar) mouseDrag.Parent = getScreenGuiAncestor(scrollbar)
doScrollUp() doScrollUp()
wait(0.2) wait(0.2)
local t = tick() local t = tick()
local w = 0.1
while scrollStamp == current do while scrollStamp == current do
doScrollUp() doScrollUp()
if not scrollUpButton.Active then if not scrollUpButton.Active then
break break
end elseif tick() - t > 5 then
if tick() - t > 5 then wait()
w = 0
elseif tick() - t > 2 then elseif tick() - t > 2 then
w = 0.06 wait(0.06)
else
wait(0.1)
end end
wait(w)
end end
end end
end end
@ -1462,7 +1479,13 @@ function RbxGui.CreateTrueScrollingFrame()
scrollbar.MouseButton1Up:connect(scrollTick) scrollbar.MouseButton1Up:connect(scrollTick)
-- local function heightCheck(instance) -- local function heightCheck(instance)
-- if (highY and (instance.AbsolutePosition.Y + instance.AbsoluteSize.Y) > highY) or not highY then -- if
-- (
-- highY
-- and (instance.AbsolutePosition.Y + instance.AbsoluteSize.Y)
-- > highY
-- ) or not highY
-- then
-- highY = instance.AbsolutePosition.Y + instance.AbsoluteSize.Y -- highY = instance.AbsolutePosition.Y + instance.AbsoluteSize.Y
-- end -- end
-- setSliderSizeAndPosition() -- setSliderSizeAndPosition()
@ -1489,7 +1512,7 @@ function RbxGui.CreateTrueScrollingFrame()
end end
if prop == "Size" or prop == "Position" then if prop == "Size" or prop == "Position" then
wait() RunService.Heartbeat:wait()
highLowRecheck() highLowRecheck()
end end
end end
@ -1500,7 +1523,7 @@ function RbxGui.CreateTrueScrollingFrame()
end end
if instance.Visible then if instance.Visible then
wait() -- wait a heartbeat for sizes to reconfig RunService.Heartbeat:wait() -- wait a heartbeat for sizes to reconfig
highLowRecheck() highLowRecheck()
end end
@ -1519,7 +1542,7 @@ function RbxGui.CreateTrueScrollingFrame()
descendantsChangeConMap[instance]:disconnect() descendantsChangeConMap[instance]:disconnect()
descendantsChangeConMap[instance] = nil descendantsChangeConMap[instance] = nil
end end
wait() -- wait a heartbeat for sizes to reconfig RunService.Heartbeat:wait() -- wait a heartbeat for sizes to reconfig
highLowRecheck() highLowRecheck()
end) end)
@ -1930,7 +1953,7 @@ function RbxGui.CreateScrollingFrame(orderList, scrollStyle)
return return
end end
reentrancyGuard = true reentrancyGuard = true
wait() RunService.Heartbeat:wait()
local success, err local success, err
if style == "grid" then if style == "grid" then
success, err = pcall(function() success, err = pcall(function()
@ -2136,7 +2159,11 @@ function RbxGui.CreateScrollingFrame(orderList, scrollStyle)
return frame, scrollUpButton, scrollDownButton, recalculate, scrollbar return frame, scrollUpButton, scrollDownButton, recalculate, scrollbar
end end
local function binaryGrow(min, max, fits) local function binaryGrow(
min: number,
max: number,
fits: (number) -> boolean
): number
if min > max then if min > max then
return min return min
end end
@ -2147,17 +2174,21 @@ local function binaryGrow(min, max, fits)
if fits(mid) and (biggestLegal == nil or biggestLegal < mid) then if fits(mid) and (biggestLegal == nil or biggestLegal < mid) then
biggestLegal = mid biggestLegal = mid
--Try growing -- Try growing
min = mid + 1 min = mid + 1
else else
--Doesn't fit, shrink -- Doesn't fit, shrink
max = mid - 1 max = mid - 1
end end
end end
return biggestLegal return biggestLegal
end end
local function binaryShrink(min, max, fits) local function binaryShrink(
min: number,
max: number,
fits: (number) -> boolean
): number
if min > max then if min > max then
return min return min
end end
@ -2168,27 +2199,28 @@ local function binaryShrink(min, max, fits)
if fits(mid) and (smallestLegal == nil or smallestLegal > mid) then if fits(mid) and (smallestLegal == nil or smallestLegal > mid) then
smallestLegal = mid smallestLegal = mid
--It fits, shrink -- It fits, shrink
max = mid - 1 max = mid - 1
else else
--Doesn't fit, grow -- Doesn't fit, grow
min = mid + 1 min = mid + 1
end end
end end
return smallestLegal return smallestLegal
end end
local function getGuiOwner(instance) local function hasGuiOwner(instance: Instance)
while instance ~= nil do local obj: Instance? = instance
if instance:IsA "ScreenGui" or instance:IsA "BillboardGui" then while obj do
return instance if obj:IsA "ScreenGui" or obj:IsA "BillboardGui" then
return true
end end
instance = instance.Parent obj = obj.Parent
end end
return nil return false
end end
function RbxGui.AutoTruncateTextObject(textLabel) function RbxGui.AutoTruncateTextObject(textLabel: TextLabel)
local text = textLabel.Text local text = textLabel.Text
local fullLabel = Hydrate(textLabel:Clone()) { local fullLabel = Hydrate(textLabel:Clone()) {
@ -2204,11 +2236,11 @@ function RbxGui.AutoTruncateTextObject(textLabel)
} }
local shortText local shortText
local mouseEnterConnection local mouseEnterConnection: RBXScriptConnection?
local mouseLeaveConnection local mouseLeaveConnection: RBXScriptConnection?
local checkForResize = function() local function checkForResize()
if getGuiOwner(textLabel) == nil then if not hasGuiOwner(textLabel) then
return return
end end
textLabel.Text = text textLabel.Text = text
@ -2228,11 +2260,8 @@ function RbxGui.AutoTruncateTextObject(textLabel)
--Shrink the text --Shrink the text
local textSize = binaryGrow(0, len, function(pos) local textSize = binaryGrow(0, len, function(pos)
if pos == 0 then textLabel.Text = pos == 0 and "~"
textLabel.Text = "~" or string.sub(text, 1, pos) .. "~"
else
textLabel.Text = `{string.sub(text, 1, pos)}~`
end
return textLabel.TextFits return textLabel.TextFits
end) end)
shortText = `{string.sub(text, 1, textSize)}~` shortText = `{string.sub(text, 1, textSize)}~`
@ -2290,8 +2319,8 @@ function RbxGui.AutoTruncateTextObject(textLabel)
end end
local function TransitionTutorialPages( local function TransitionTutorialPages(
fromPage: Instance?, fromPage: GuiObject?,
toPage: Instance?, toPage: GuiObject?,
transitionFrame: Frame, transitionFrame: Frame,
currentPageValue: ObjectValue currentPageValue: ObjectValue
) )
@ -2445,8 +2474,8 @@ end
local function CreateBasicTutorialPage( local function CreateBasicTutorialPage(
name: string, name: string,
handleResize: (number, number) -> (), handleResize: (number, number) -> (),
skipTutorial, skipTutorial: () -> (),
giveDoneButton giveDoneButton: boolean? -- idk
) )
local frame = New "Frame" { local frame = New "Frame" {
Name = "TutorialPage", Name = "TutorialPage",
@ -2543,7 +2572,7 @@ local function CreateBasicTutorialPage(
innerFrame.Size = giveDoneButton and UDim2.new(1, 0, 1, -75) innerFrame.Size = giveDoneButton and UDim2.new(1, 0, 1, -75)
or UDim2.new(1, 0, 1, -22) or UDim2.new(1, 0, 1, -22)
local parentConnection local parentConnection: RBXScriptConnection?
local function basicHandleResize() local function basicHandleResize()
if frame.Visible and frame.Parent then if frame.Visible and frame.Parent then
@ -2557,7 +2586,7 @@ local function CreateBasicTutorialPage(
frame.Changed:connect(function(prop) frame.Changed:connect(function(prop)
if prop == "Parent" then if prop == "Parent" then
if parentConnection ~= nil then if parentConnection then
parentConnection:disconnect() parentConnection:disconnect()
parentConnection = nil parentConnection = nil
end end
@ -2565,7 +2594,7 @@ local function CreateBasicTutorialPage(
parentConnection = frame.Parent.Changed:connect( parentConnection = frame.Parent.Changed:connect(
function(parentProp) function(parentProp)
if parentProp == "AbsoluteSize" then if parentProp == "AbsoluteSize" then
wait() RunService.Heartbeat:wait()
basicHandleResize() basicHandleResize()
end end
end end
@ -2582,7 +2611,7 @@ local function CreateBasicTutorialPage(
return frame, innerFrame return frame, innerFrame
end end
RbxGui.CreateTextTutorialPage = function(name, text, skipTutorialFunc) function RbxGui.CreateTextTutorialPage(name, text, skipTutorial)
local frame local frame
local contentFrame local contentFrame
@ -2608,7 +2637,7 @@ RbxGui.CreateTextTutorialPage = function(name, text, skipTutorialFunc)
end end
frame, contentFrame = frame, contentFrame =
CreateBasicTutorialPage(name, handleResize, skipTutorialFunc) CreateBasicTutorialPage(name, handleResize, skipTutorial)
textLabel.Parent = contentFrame textLabel.Parent = contentFrame
return frame return frame
@ -2617,9 +2646,9 @@ end
RbxGui.CreateImageTutorialPage = function( RbxGui.CreateImageTutorialPage = function(
name, name,
imageAsset, imageAsset,
x, x: number,
y, y: number,
skipTutorialFunc, skipTutorial: () -> (),
giveDoneButton giveDoneButton
) )
local frame local frame
@ -2663,7 +2692,7 @@ RbxGui.CreateImageTutorialPage = function(
frame, contentFrame = CreateBasicTutorialPage( frame, contentFrame = CreateBasicTutorialPage(
name, name,
handleResize, handleResize,
skipTutorialFunc, skipTutorial,
giveDoneButton giveDoneButton
) )
imageLabel.Parent = contentFrame imageLabel.Parent = contentFrame
@ -2671,7 +2700,12 @@ RbxGui.CreateImageTutorialPage = function(
return frame return frame
end end
RbxGui.AddTutorialPage = function(tutorial, tutorialPage) type TutorialPage = GuiObject & {
NextButton: TextButton,
PrevButton: TextButton,
}
RbxGui.AddTutorialPage = function(tutorial, tutorialPage: TutorialPage)
local transitionFrame = tutorial.TransitionFrame local transitionFrame = tutorial.TransitionFrame
local currentPageValue = tutorial.CurrentTutorialPage local currentPageValue = tutorial.CurrentTutorialPage
@ -2683,7 +2717,7 @@ RbxGui.AddTutorialPage = function(tutorial, tutorialPage)
local children = tutorial.Pages:GetChildren() local children = tutorial.Pages:GetChildren()
if children and #children > 0 then if children and #children > 0 then
tutorialPage.Name = "TutorialPage" .. (#children + 1) tutorialPage.Name = "TutorialPage" .. (#children + 1)
local previousPage = children[#children] local previousPage: TutorialPage = children[#children]
if not previousPage:IsA "GuiObject" then if not previousPage:IsA "GuiObject" then
error "All elements under Pages must be GuiObjects" error "All elements under Pages must be GuiObjects"
end end
@ -3066,7 +3100,7 @@ RbxGui.CreateSetPanel = function(
end end
local function handleResize() local function handleResize()
wait() -- neccessary to insure heartbeat happened RunService.Heartbeat:wait() -- neccessary to insure heartbeat happened
local itemPreview = setGui.SetPanel.ItemPreview local itemPreview = setGui.SetPanel.ItemPreview
@ -3084,8 +3118,15 @@ RbxGui.CreateSetPanel = function(
) )
end end
local function buttonImage()
return New "ImageLabel" {
Image = "",
BackgroundTransparency = 1,
}
end
local function makeInsertAssetButton() local function makeInsertAssetButton()
local insertAssetButtonExample = New "Frame" { return New "Frame" {
Name = "InsertAssetButtonExample", Name = "InsertAssetButtonExample",
Position = UDim2.new(0, 128, 0, 64), Position = UDim2.new(0, 128, 0, 64),
Size = UDim2.new(0, 64, 0, 64), Size = UDim2.new(0, 64, 0, 64),
@ -3100,39 +3141,28 @@ RbxGui.CreateSetPanel = function(
Name = "AssetName", Name = "AssetName",
Value = "", Value = "",
}, },
New "TextButton" {
Name = "Button",
Text = "",
Style = Enum.ButtonStyle.RobloxButton,
Position = UDim2.new(0.025, 0, 0.025, 0),
Size = UDim2.new(0.95, 0, 0.95, 0),
ZIndex = 6,
Hydrate(buttonImage()) {
Name = "ButtonImage",
Position = UDim2.new(0, -7, 0, -7),
Size = UDim2.new(1, 14, 1, 14),
ZIndex = 7,
},
},
Hydrate(buttonImage()) {
Name = "ConfigIcon",
Visible = false,
Position = UDim2.new(1, -23, 1, -24),
Size = UDim2.new(0, 16, 0, 16),
ZIndex = 6,
},
} }
local button = New "TextButton" {
Name = "Button",
Text = "",
Style = Enum.ButtonStyle.RobloxButton,
Position = UDim2.new(0.025, 0, 0.025, 0),
Size = UDim2.new(0.95, 0, 0.95, 0),
ZIndex = 6,
Parent = insertAssetButtonExample,
}
local buttonImage = New "ImageLabel" {
Name = "ButtonImage",
Image = "",
Position = UDim2.new(0, -7, 0, -7),
Size = UDim2.new(1, 14, 1, 14),
BackgroundTransparency = 1,
ZIndex = 7,
Parent = button,
}
Hydrate(buttonImage:Clone()) {
Name = "ConfigIcon",
Visible = false,
Position = UDim2.new(1, -23, 1, -24),
Size = UDim2.new(0, 16, 0, 16),
Image = "",
ZIndex = 6,
Parent = insertAssetButtonExample,
}
return insertAssetButtonExample
end end
local function showLargePreview(insertButton) local function showLargePreview(insertButton)
@ -3161,9 +3191,9 @@ RbxGui.CreateSetPanel = function(
end end
end end
local function createTerrainTypeButton(name, parent) local function createTerrainTypeButton(name: string, parent: Frame)
local dropDownTextButton = New "TextButton" { local dropDownTextButton = New "TextButton" {
Name = `{name}Button`, Name = name .. "Button",
Font = Enum.Font.ArialBold, Font = Enum.Font.ArialBold,
FontSize = Enum.FontSize.Size14, FontSize = Enum.FontSize.Size14,
BorderSizePixel = 0, BorderSizePixel = 0,
@ -3201,7 +3231,7 @@ RbxGui.CreateSetPanel = function(
return dropDownTextButton return dropDownTextButton
end end
local function createTerrainDropDownMenu(zIndex) local function createTerrainDropDownMenu(zIndex: number)
local dropDown = New "Frame" { local dropDown = New "Frame" {
Name = "TerrainDropDown", Name = "TerrainDropDown",
BackgroundColor3 = Color3.new(0, 0, 0), BackgroundColor3 = Color3.new(0, 0, 0),
@ -3231,7 +3261,7 @@ RbxGui.CreateSetPanel = function(
end) end)
end end
local function createDropDownMenuButton(parent) local function createDropDownMenuButton(parent: Frame)
local dropDownButton = New "ImageButton" { local dropDownButton = New "ImageButton" {
Name = "DropDownButton", Name = "DropDownButton",
Image = "http://banland.xyz/asset?id=67581509", Image = "http://banland.xyz/asset?id=67581509",
@ -4002,7 +4032,7 @@ RbxGui.CreateLoadingFrame = function(name, size, position)
return loadingFrame, updateLoadingGuiPercent, cancelButtonClicked return loadingFrame, updateLoadingGuiPercent, cancelButtonClicked
end end
RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent) function RbxGui.CreatePluginFrame(name: string, size, position, scrollable, parent)
local function createMenuButton( local function createMenuButton(
size, size,
position, position,
@ -4043,6 +4073,15 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
return button return button
end end
local function separatingLineC()
return New "Frame" {
Name = "SeparatingLine",
BackgroundColor3 = Colour3(115, 115, 115),
BorderSizePixel = 0,
Size = UDim2.new(0, 1, 0, 14),
}
end
local dragBar = New "ImageButton" { local dragBar = New "ImageButton" {
Name = `{name}DragBar`, Name = `{name}DragBar`,
BackgroundColor3 = Colour3(39, 39, 39), BackgroundColor3 = Colour3(39, 39, 39),
@ -4061,7 +4100,14 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
TextXAlignment = Enum.TextXAlignment.Left, TextXAlignment = Enum.TextXAlignment.Left,
BackgroundTransparency = 1, BackgroundTransparency = 1,
}, },
Hydrate(separatingLineC()) {
Position = UDim2.new(1, -18, 0.5, -7),
},
Hydrate(separatingLineC()) {
Position = UDim2.new(1, -35, 0.5, -7),
},
} }
if size then if size then
dragBar.Size = UDim2.new(size.X.Scale, size.X.Offset, 0, 20) dragBar.Size = UDim2.new(size.X.Scale, size.X.Offset, 0, 20)
+ UDim2.new(0, 20, 0, 0) + UDim2.new(0, 20, 0, 0)
@ -4181,20 +4227,6 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
Parent = minimizeFrame, Parent = minimizeFrame,
} }
local separatingLine = New "Frame" {
Name = "SeparatingLine",
BackgroundColor3 = Colour3(115, 115, 115),
BorderSizePixel = 0,
Position = UDim2.new(1, -18, 0.5, -7),
Size = UDim2.new(0, 1, 0, 14),
Parent = dragBar,
}
-- otherSeparatingLine
Hydrate(separatingLine:Clone()) {
Position = UDim2.new(1, -35, 0.5, -7),
Parent = dragBar,
}
local widgetContainer = New "Frame" { local widgetContainer = New "Frame" {
Name = "WidgetContainer", Name = "WidgetContainer",
BackgroundTransparency = 1, BackgroundTransparency = 1,
@ -4208,22 +4240,11 @@ RbxGui.CreatePluginFrame = function(name, size, position, scrollable, parent)
widgetContainer.Parent = dragBar widgetContainer.Parent = dragBar
if size then if size then
if scrollable then widgetContainer.Size = scrollable and size
widgetContainer.Size = size or UDim2.new(0, dragBar.AbsoluteSize.X, size.Y.Scale, size.Y.Offset)
else
widgetContainer.Size = UDim2.new(
0,
dragBar.AbsoluteSize.X,
size.Y.Scale,
size.Y.Offset
)
end
else else
if scrollable then widgetContainer.Size = scrollable and UDim2.new(0, 163, 0, 400)
widgetContainer.Size = UDim2.new(0, 163, 0, 400) or UDim2.new(0, dragBar.AbsoluteSize.X, 0, 400)
else
widgetContainer.Size = UDim2.new(0, dragBar.AbsoluteSize.X, 0, 400)
end
end end
if position then if position then
widgetContainer.Position = position + UDim2.new(0, 0, 0, 20) widgetContainer.Position = position + UDim2.new(0, 0, 0, 20)

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,10 @@
-- CoreGui.RobloxGui.CoreScripts/PlayerListScript -- CoreGui.RobloxGui.CoreScripts/PlayerListScript
print "[Mercury]: Loaded corescript 48488235" print "[Mercury]: Loaded corescript 48488235"
local RunService = game:GetService "RunService"
local New = (require "../Modules/New").New local New = (require "../Modules/New").New
local log = require "../Modules/Logger"
-------------------- --------------------
-- Super Util -- Super Util
@ -623,43 +626,6 @@ local BigButton = New "ImageButton" {
Parent = ScreenGui, Parent = ScreenGui,
} }
local debugFrame = New "Frame" {
Name = "debugframe",
-- Position = UDim2.new(0, 0, 0, 0),
-- Size = UDim2.new(0, 150, 0, 800),--0.99000001
-- BackgroundTransparency = 1,
BackgroundTransparency = 1,
Position = UDim2.new(0.25, 0, 0.300000012, 0),
Size = UDim2.new(0.5, 0, 0.370000005, 0),
MakeBackgroundGuiObj "http://banland.xyz/asset?id=96506233",
}
local debugOutput = New "TextLabel" {
BackgroundTransparency = 0.8,
Position = UDim2.new(0, 0, 0.5, 0),
Size = UDim2.new(1, 0, 0.5, 0),
Parent = debugFrame,
Font = "ArialBold",
Text = "--",
FontSize = "Size14",
TextWrapped = true,
TextColor3 = Color3.new(1, 1, 1),
TextStrokeColor3 = Color3.new(0, 0, 0),
TextStrokeTransparency = 0,
TextXAlignment = "Right",
TextYAlignment = "Center",
}
--[[
simple function to toggle the display of debug output
--]]
local DebugPrintEnabled = true
local function debugprint(str)
--print(str)
if DebugPrintEnabled then
debugOutput.Text = str
end
end
--[[ --[[
obligatory wait for child function obligatory wait for child function
@Args: @Args:
@ -669,8 +635,8 @@ end
--]] --]]
local function WaitForChild(parent, child) local function WaitForChild(parent, child)
while not parent:FindFirstChild(child) do while not parent:FindFirstChild(child) do
wait() RunService.Heartbeat:wait()
debugprint(` child {parent.Name} waiting for {child}`) log(` child {parent.Name} waiting for {child}`)
end end
return parent[child] return parent[child]
end end
@ -833,7 +799,7 @@ local function TweenProperty(obj, propName, inita: number, enda: number, length)
while tick() - startTime < length do while tick() - startTime < length do
obj[propName] = ((enda - inita) * ((tick() - startTime) / length)) obj[propName] = ((enda - inita) * ((tick() - startTime) / length))
+ inita + inita
wait() RunService.Heartbeat:wait()
end end
obj[propName] = enda obj[propName] = enda
end end
@ -860,13 +826,13 @@ local function WaitForClick(frameParent, polledFunction, exitFunction)
if connection2 then if connection2 then
connection2:disconnect() connection2:disconnect()
end end
-- debugprint "mouse up!" -- log "mouse up!"
end) end)
connection2 = BigButton.MouseMoved:connect(function(nx, ny) connection2 = BigButton.MouseMoved:connect(function(nx, ny)
polledFunction(nx, ny) polledFunction(nx, ny)
end) end)
-- debugprint "waiting for click!" -- log "waiting for click!"
BigButton.Visible = true BigButton.Visible = true
BigButton.Active = true BigButton.Active = true
BigButton.Parent = frameParent BigButton.Parent = frameParent
@ -876,7 +842,7 @@ local function WaitForClick(frameParent, polledFunction, exitFunction)
BigButton.Visible = false BigButton.Visible = false
connection:disconnect() connection:disconnect()
connection2:disconnect() connection2:disconnect()
debugprint "forced out of wait for click" log "forced out of wait for click"
end end
end) end)
WaitForClickLock = false WaitForClickLock = false
@ -971,7 +937,7 @@ local function OnPrivilegeLevelSelect(
MemberButton, MemberButton,
AdminButton AdminButton
) )
debugprint "setting privilege level" log "setting privilege level"
SetPrivilegeRank(player, nlevel) SetPrivilegeRank(player, nlevel)
HighlightMyRank( HighlightMyRank(
player, player,
@ -1018,7 +984,7 @@ local function OnSubmitAbuse()
then then
CalmingAbuseBox.Parent = ReportAbuseShield CalmingAbuseBox.Parent = ReportAbuseShield
else else
debugprint "opening abuse box" log "opening abuse box"
NormalAbuseBox.Parent = ReportAbuseShield NormalAbuseBox.Parent = ReportAbuseShield
end end
else else
@ -1050,7 +1016,7 @@ end
opens the abuse dialog, initialises text to display selectedplayer opens the abuse dialog, initialises text to display selectedplayer
--]] --]]
local function OpenAbuseDialog() local function OpenAbuseDialog()
debugprint "adding report dialog" log "adding report dialog"
AbusePlayerLabel.Text = SelectedPlayer.Name AbusePlayerLabel.Text = SelectedPlayer.Name
--AbuseDescriptionBox.Text = "" --AbuseDescriptionBox.Text = ""
PopUpPanel:TweenPosition( PopUpPanel:TweenPosition(
@ -1304,7 +1270,7 @@ local function UpdateHeaderNameSize()
tHeader.FontSize = FONT_SIZES[fSize] tHeader.FontSize = FONT_SIZES[fSize]
Delay(0.2, function() Delay(0.2, function()
while tHeader.TextBounds.x == 0 do while tHeader.TextBounds.x == 0 do
wait() RunService.Heartbeat:wait()
end end
while tHeader.TextBounds.x - NormalBounds.X.Offset > 1 do while tHeader.TextBounds.x - NormalBounds.X.Offset > 1 do
fSize -= 1 fSize -= 1
@ -1687,8 +1653,8 @@ end
--]] --]]
local function BaseUpdate() local function BaseUpdate()
while BaseUpdateLock do while BaseUpdateLock do
debugprint "in baseupdate lock" log "in baseupdate lock"
wait() RunService.Heartbeat:wait()
end end
BaseUpdateLock = true BaseUpdateLock = true
-- print "baseupdate" -- print "baseupdate"
@ -1720,7 +1686,7 @@ local function BaseUpdate()
UpdateScrollPosition() UpdateScrollPosition()
UpdateScrollBarVisibility() UpdateScrollBarVisibility()
-- debugprint "EndBaseUpdate" -- log "EndBaseUpdate"
BaseUpdateLock = false BaseUpdateLock = false
end end
@ -1732,10 +1698,10 @@ RecreateScoreColumns = function(ptable)
end end
local nscoretxt = panel:FindFirstChild("PlayerScore"):Clone() local nscoretxt = panel:FindFirstChild("PlayerScore"):Clone()
local thisScore local thisScore
--here lies the resting place of a once great and terrible bug -- here lies the resting place of a once great and terrible bug
--may its treachery never be forgotten, lest its survivors fall for it again -- may its treachery never be forgotten, lest its survivors fall for it again
--RIP the leaderstat bug, oct 2012-nov 2012 -- RIP the leaderstat bug, oct 2012-nov 2012
wait() RunService.Heartbeat:wait()
if if
entry.Player:FindFirstChild "leaderstats" entry.Player:FindFirstChild "leaderstats"
and entry.Player.leaderstats:FindFirstChild(scoreval.Name) and entry.Player.leaderstats:FindFirstChild(scoreval.Name)
@ -1754,7 +1720,7 @@ RecreateScoreColumns = function(ptable)
nscoretxt.Name = scoreval.Name nscoretxt.Name = scoreval.Name
nscoretxt.Text = tostring(GetScoreValue(thisScore)) nscoretxt.Text = tostring(GetScoreValue(thisScore))
if scoreval.Name == ScoreNames[1]["Name"] then if scoreval.Name == ScoreNames[1]["Name"] then
debugprint "changing score" log "changing score"
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))
@ -1778,8 +1744,8 @@ RecreateScoreColumns = function(ptable)
end end
while AddingStatLock do while AddingStatLock do
debugprint "In Adding Stat Lock2" log "In Adding Stat Lock2"
wait() RunService.Heartbeat:wait()
end end
AddingStatLock = true AddingStatLock = true
local Xoffset = 5 --15 --current offset from Right local Xoffset = 5 --15 --current offset from Right
@ -1799,7 +1765,7 @@ RecreateScoreColumns = function(ptable)
-- make an entry for this object -- make an entry for this object
local nentry = MakeScoreEntry(entry, scoreval, panel) local nentry = MakeScoreEntry(entry, scoreval, panel)
if nentry then if nentry then
debugprint(`adding {nentry.Name} to {entry.Player.Name}`) log(`adding {nentry.Name} to {entry.Player.Name}`)
nentry.Parent = panel nentry.Parent = panel
-- add score to team -- add score to team
if if
@ -2033,8 +1999,8 @@ end
local function StatAdded(nchild, playerEntry) local function StatAdded(nchild, playerEntry)
-- dont re - add a leaderstat I alreday have -- dont re - add a leaderstat I alreday have
while AddingStatLock do while AddingStatLock do
debugprint "in stat added function lock" log "in stat added function lock"
wait() RunService.Heartbeat:wait()
end end
AddingStatLock = true AddingStatLock = true
if if
@ -2109,12 +2075,12 @@ end
--]] --]]
local function StatRemoved(nchild, playerEntry) local function StatRemoved(nchild, playerEntry)
while AddingStatLock do while AddingStatLock do
debugprint "In Adding Stat Lock1" log "In Adding Stat Lock1"
wait() RunService.Heartbeat:wait()
end end
AddingStatLock = true AddingStatLock = true
if playerEntry.Frame:FindFirstChild(nchild.Name) then if playerEntry.Frame:FindFirstChild(nchild.Name) then
debugprint "Destroyed frame!" log "Destroyed frame!"
playerEntry.Frame[nchild.Name].Parent = nil playerEntry.Frame[nchild.Name].Parent = nil
end end
if not DoesStatExist(nchild.Name, playerEntry.Player) then if not DoesStatExist(nchild.Name, playerEntry.Player) then
@ -2268,7 +2234,7 @@ local function InitMovingPanel(entry, player)
local nextIndex = 2 local nextIndex = 2
local friendStatus = GetFriendStatus(player) local friendStatus = GetFriendStatus(player)
debugprint(tostring(friendStatus)) log(tostring(friendStatus))
local showRankMenu = false local showRankMenu = false
-- IsPersonalServer -- IsPersonalServer
-- and LocalPlayer.PersonalServerRank >= PrivilegeLevel.Admin -- and LocalPlayer.PersonalServerRank >= PrivilegeLevel.Admin
@ -2391,7 +2357,7 @@ local function InitMovingPanel(entry, player)
0, 0,
myFrame.AbsolutePosition.Y myFrame.AbsolutePosition.Y
) )
wait() RunService.Heartbeat:wait()
end end
end) end)
end end
@ -2434,9 +2400,7 @@ local function StartDrag(entry, startx, starty)
startY = AbsoluteToPercent(nx, ny).Y startY = AbsoluteToPercent(nx, ny).Y
end end
local nowY = AbsoluteToPercent(nx, ny).Y local nowY = AbsoluteToPercent(nx, ny).Y
debugprint( log(`drag dist {Vector2.new(startx - nx, starty - ny).magnitude}`)
`drag dist {Vector2.new(startx - nx, starty - ny).magnitude}`
)
if if
Vector2.new(startx - nx, starty - ny).magnitude Vector2.new(startx - nx, starty - ny).magnitude
> MOUSE_DRAG_DISTANCE > MOUSE_DRAG_DISTANCE
@ -2462,9 +2426,9 @@ end
local function StartMinimizeDrag() local function StartMinimizeDrag()
Delay(0, function() Delay(0, function()
local startTime = tick() local startTime = tick()
debugprint "Got Click2" log "Got Click2"
local function dragExit() local function dragExit()
-- debugprint "undone click2" -- log "undone click2"
if tick() - startTime < 0.25 then --was click if tick() - startTime < 0.25 then --was click
ToggleMinimize() ToggleMinimize()
else --was drag else --was drag
@ -2660,8 +2624,8 @@ end
--]] --]]
local function LeaderstatsRemoved(_, playerEntry) local function LeaderstatsRemoved(_, playerEntry)
while AddingFrameLock do while AddingFrameLock do
debugprint(`waiting to insert {playerEntry.Player.Name}`) log(`waiting to insert {playerEntry.Player.Name}`)
wait() RunService.Heartbeat:wait()
end end
AddingFrameLock = true AddingFrameLock = true
RemoveAllStats(playerEntry) RemoveAllStats(playerEntry)
@ -2685,8 +2649,8 @@ end
local function RemoveNeutralTeam() local function RemoveNeutralTeam()
while NeutralTeamLock do while NeutralTeamLock do
debugprint "in neutral team lock" log "in neutral team lock"
wait() RunService.Heartbeat:wait()
end end
NeutralTeamLock = true NeutralTeamLock = true
NeutralTeam.Frame:Destroy() NeutralTeam.Frame:Destroy()
@ -2756,8 +2720,8 @@ end
--]] --]]
local function AddNeutralTeam() local function AddNeutralTeam()
while NeutralTeamLock do while NeutralTeamLock do
debugprint "in neutral team 2 lock" log "in neutral team 2 lock"
wait() RunService.Heartbeat:wait()
end end
NeutralTeamLock = true NeutralTeamLock = true
@ -2821,7 +2785,7 @@ local function SetPlayerToTeam(entry)
end end
-- if player was set to an invalid team, then set it back to neutral -- if player was set to an invalid team, then set it back to neutral
if not setToTeam and #(game.Teams:GetTeams()) > 0 then if not setToTeam and #(game.Teams:GetTeams()) > 0 then
debugprint(`{entry.Player.Name} could not find team`) log(`{entry.Player.Name} could not find team`)
entry.MyTeam = nil entry.MyTeam = nil
if not NeutralTeam then if not NeutralTeam then
AddNeutralTeam() AddNeutralTeam()
@ -2841,25 +2805,25 @@ end
--]] --]]
local function PlayerChanged(entry, property) local function PlayerChanged(entry, property)
while PlayerChangedLock do while PlayerChangedLock do
debugprint "in playerchanged lock" log "in playerchanged lock"
wait() RunService.Heartbeat:wait()
end end
PlayerChangedLock = true PlayerChangedLock = true
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
debugprint(`{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
debugprint(`{entry.Player.Name} creating neutral team`) log(`{entry.Player.Name} creating neutral team`)
AddNeutralTeam() AddNeutralTeam()
else else
debugprint(`{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
debugprint(`{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()
@ -2868,7 +2832,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
debugprint(`{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
@ -2899,8 +2863,8 @@ end
--]] --]]
local function InsertPlayerFrame(nplayer) local function InsertPlayerFrame(nplayer)
while AddingFrameLock do while AddingFrameLock do
debugprint(`waiting to insert {nplayer.Name}`) log(`waiting to insert {nplayer.Name}`)
wait() RunService.Heartbeat:wait()
end end
AddingFrameLock = true AddingFrameLock = true
@ -2999,8 +2963,8 @@ local function InsertPlayerFrame(nplayer)
nplayer.ChildAdded:connect(function(nchild) nplayer.ChildAdded:connect(function(nchild)
if nchild.Name == "leaderstats" then if nchild.Name == "leaderstats" then
while AddingFrameLock do while AddingFrameLock do
debugprint "in adding leaderstats lock" log "in adding leaderstats lock"
wait() RunService.Heartbeat:wait()
end end
AddingFrameLock = true AddingFrameLock = true
LeaderstatsAdded(nentry) LeaderstatsAdded(nentry)
@ -3034,8 +2998,8 @@ end
--]] --]]
local function RemovePlayerFrame(tplayer) local function RemovePlayerFrame(tplayer)
while AddingFrameLock do while AddingFrameLock do
debugprint "in removing player frame lock" log "in removing player frame lock"
wait() RunService.Heartbeat:wait()
end end
AddingFrameLock = true AddingFrameLock = true
@ -3072,7 +3036,7 @@ Players.ChildRemoved:connect(RemovePlayerFrame)
local function OnFriendshipChanged(player, friendStatus) local function OnFriendshipChanged(player, friendStatus)
Delay(0.5, function() Delay(0.5, function()
debugprint( log(
`friend status changed for {player.Name} {friendStatus} vs {GetFriendStatus( `friend status changed for {player.Name} {friendStatus} vs {GetFriendStatus(
player player
)}` )}`
@ -3086,7 +3050,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)
debugprint(`confirmed status {player.Name}`) log(`confirmed status {player.Name}`)
end end
entry.Frame.FriendLabel.Image = nicon entry.Frame.FriendLabel.Image = nicon
return return
@ -3137,8 +3101,8 @@ end
--]] --]]
local function RemoveTeamFrame(nteam) local function RemoveTeamFrame(nteam)
while AddingFrameLock do while AddingFrameLock do
debugprint "in removing team frame lock" log "in removing team frame lock"
wait() RunService.Heartbeat:wait()
end end
AddingFrameLock = true AddingFrameLock = true
-- if IsMinimized.Value then -- if IsMinimized.Value then
@ -3152,7 +3116,7 @@ local function RemoveTeamFrame(nteam)
end end
end end
if #TeamFrames == 0 then if #TeamFrames == 0 then
debugprint "removeteamframe, remove neutral" log "removeteamframe, remove neutral"
if NeutralTeam then if NeutralTeam then
RemoveNeutralTeam() RemoveNeutralTeam()
end end
@ -3198,8 +3162,8 @@ end
--]] --]]
local function InsertTeamFrame(nteam) local function InsertTeamFrame(nteam)
while AddingFrameLock do while AddingFrameLock do
debugprint "in adding team frame lock" log "in adding team frame lock"
wait() RunService.Heartbeat:wait()
end end
AddingFrameLock = true AddingFrameLock = true
--for _,i in pairs(TeamFrames) do --for _,i in pairs(TeamFrames) do
@ -3299,7 +3263,7 @@ game.GuiService:AddKey "\t"
local LastTabTime = time() local LastTabTime = time()
game.GuiService.KeyPressed:connect(function(key) game.GuiService.KeyPressed:connect(function(key)
if key == "\t" then if key == "\t" then
debugprint "caught tab key" log "caught tab key"
local modalCheck, isModal = pcall(function() local modalCheck, isModal = pcall(function()
return game.GuiService.IsModalDialog return game.GuiService.IsModalDialog
end) end)
@ -3362,8 +3326,8 @@ pcall(function()
end) end)
while not game:GetService "Teams" do while not game:GetService "Teams" do
wait() RunService.Heartbeat:wait()
debugprint "Waiting For Teams" log "Waiting For Teams"
end end
for _, i in pairs(game.Teams:GetTeams()) do for _, i in pairs(game.Teams:GetTeams()) do
TeamAdded(i) TeamAdded(i)

View File

@ -29,19 +29,15 @@ waitForProperty(game.Players, "LocalPlayer")
local function SlotNumber() local function SlotNumber()
return New "TextLabel" { return New "TextLabel" {
Name = "SlotNumber",
BackgroundTransparency = 1, BackgroundTransparency = 1,
BorderSizePixel = 0, BorderSizePixel = 0,
Font = Enum.Font.ArialBold, Font = Enum.Font.ArialBold,
FontSize = Enum.FontSize.Size18, FontSize = Enum.FontSize.Size18,
Position = UDim2.new(0, 0, 0, 0),
Size = UDim2.new(0, 10, 0, 15), Size = UDim2.new(0, 10, 0, 15),
TextColor3 = Color3.new(1, 1, 1),
TextTransparency = 0, TextTransparency = 0,
TextXAlignment = Enum.TextXAlignment.Left, TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Bottom, TextYAlignment = Enum.TextYAlignment.Bottom,
RobloxLocked = true, RobloxLocked = true,
ZIndex = 5,
} }
end end
@ -160,7 +156,12 @@ local CurrentLoadout = New "Frame" {
TextWrap = true, TextWrap = true,
ZIndex = 5.0, ZIndex = 5.0,
}, },
SlotNumber(), Hydrate(SlotNumber()) {
Name = "SlotNumber",
TextColor3 = Color3.new(1, 1, 1),
Position = UDim2.new(0, 0, 0, 0),
ZIndex = 5,
},
Hydrate(SlotNumber()) { Hydrate(SlotNumber()) {
Name = "SlotNumberDownShadow", Name = "SlotNumberDownShadow",
TextColor3 = Color3.new(0, 0, 0), TextColor3 = Color3.new(0, 0, 0),

View File

@ -3,6 +3,7 @@ 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 UserInputService = Game:GetService "UserInputService" local UserInputService = Game:GetService "UserInputService"
-- A couple of necessary functions -- A couple of necessary functions
@ -525,12 +526,6 @@ local function activateGear(num)
end end
end end
local waitForDebounce = function()
while debounce do
wait()
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 point.x > rectTopLeft.x and point.x < (rectTopLeft.x + rectSize.x) then
if if
@ -713,7 +708,9 @@ local function addingPlayerChild(
addToSlot, addToSlot,
inventoryGearButton inventoryGearButton
) )
waitForDebounce() while debounce do
RunService.Heartbeat:wait()
end
debounce = true debounce = true
if child:FindFirstChild "RobloxBuildTool" then if child:FindFirstChild "RobloxBuildTool" then
@ -1153,7 +1150,7 @@ pcall(function()
Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged) Game.StarterGui.CoreGuiChangedSignal:connect(coreGuiChanged)
end) end)
wait() -- let stuff initialize incase this is first heartbeat... RunService.Heartbeat:wait() -- let stuff initialize incase this is first heartbeat...
waitForChild(player, "Backpack") waitForChild(player, "Backpack")
waitForProperty(player, "Character") waitForProperty(player, "Character")

View File

@ -1,6 +1,8 @@
-- Script Context./Libraries/LibraryRegistration/LibraryRegist -- Script Context./Libraries/LibraryRegistration/LibraryRegist
print "[Mercury]: Loaded corescript 60595695" print "[Mercury]: Loaded corescript 60595695"
local RunService = game:GetService "RunService"
-- Library Registration Script -- Library Registration Script
-- This script is used to register RbxLua libraries on game servers, so game scripts have -- This script is used to register RbxLua libraries on game servers, so game scripts have
-- access to all of the libraries (otherwise only local scripts do) -- access to all of the libraries (otherwise only local scripts do)
@ -12,7 +14,7 @@ for i = 1, 4 do
if ScriptContext then if ScriptContext then
break break
end end
wait(0.2) RunService.Heartbeat:wait()
end end
if ScriptContext then if ScriptContext then

View File

@ -1,12 +1,8 @@
--!strict
-- CoreGui.RobloxGui.CoreScripts/ChatScript -- CoreGui.RobloxGui.CoreScripts/ChatScript
print "[Mercury]: Loaded corescript 97188756" print "[Mercury]: Loaded corescript 97188756"
--[[ local RunService = game:GetService "RunService"
//FileName: ChatScript.LUA
//Written by: Sorcus
//Description: Code for lua side chat on Mercury. Supports Scrolling.
//NOTE: If you find any bugs or inaccuracies PM Sorcus on Roblox or @Canavus on Twitter
]]
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
@ -21,19 +17,13 @@ local function WaitForChild(parent, childName)
return parent[childName] return parent[childName]
end end
local function IsPhone() while not Game.Players.LocalPlayer do
local cGui = Game:GetService "CoreGui" RunService.Heartbeat:wait()
local rGui = WaitForChild(cGui, "RobloxGui")
return rGui.AbsoluteSize.Y < 600
end
while Game.Players.LocalPlayer == nil do
wait(0.03)
end end
local Player = Game.Players.LocalPlayer local Player = Game.Players.LocalPlayer
while Player.Character == nil do while not Player.Character do
wait(0.03) RunService.Heartbeat:wait()
end end
local Camera = Game.Workspace.CurrentCamera local Camera = Game.Workspace.CurrentCamera
@ -51,7 +41,7 @@ local enum_mt = {
end, end,
__index = { __index = {
GetEnumItems = function(self) GetEnumItems = function(self)
local t = {} local t: { any } = {}
for i, item in pairs(self) do for i, item in pairs(self) do
if type(i) == "number" then if type(i) == "number" then
t[#t + 1] = item t[#t + 1] = item
@ -571,9 +561,9 @@ function Chat:CreateMessage(cPlayer, message)
end end
function Chat:ScreenSizeChanged() function Chat:ScreenSizeChanged()
wait() RunService.Heartbeat:wait()
while self.Frame.AbsoluteSize.Y > 120 do while self.Frame.AbsoluteSize.Y > 120 do
self.Frame.Size -= UDim2.new(0, 0, 0.005, 0) (self.Frame :: Frame).Size -= UDim2.new(0, 0, 0.005, 0)
end end
-- Chat:RecalculateSpacing() -- Chat:RecalculateSpacing()
end end
@ -706,13 +696,6 @@ function Chat:CreateGui()
}, },
} }
Spawn(function()
wait(0.5)
if IsPhone() then
self.Frame.Size = UDim2.new(0, 280, 0, 120)
end
end)
self.RenderFrame = self.Frame.ChatRenderFrame self.RenderFrame = self.Frame.ChatRenderFrame
if self.Frame.AbsoluteSize.Y > 120 then if self.Frame.AbsoluteSize.Y > 120 then
Chat:ScreenSizeChanged() Chat:ScreenSizeChanged()
@ -861,7 +844,7 @@ function Chat:CullThread()
end end
end end
end end
wait(5.0) wait(5)
end end
end end

View File

@ -93,7 +93,7 @@ end)
if _MAP_LOCATION_EXISTS then if _MAP_LOCATION_EXISTS then
-- yield so that file load happens in the heartbeat thread -- yield so that file load happens in the heartbeat thread
wait() RunService.Heartbeat:wait()
-- load the game -- load the game
game:Load(_MAP_LOCATION) game:Load(_MAP_LOCATION)

View File

@ -1,5 +1,6 @@
--!strict --!strict
print "[Mercury]: Loaded Join corescript" print "[Mercury]: Loaded Join corescript"
local InsertService = game:GetService "InsertService" local InsertService = game:GetService "InsertService"
local ChangeHistoryService = game:GetService "ChangeHistoryService" local ChangeHistoryService = game:GetService "ChangeHistoryService"
local ContentProvider = game:GetService "ContentProvider" local ContentProvider = game:GetService "ContentProvider"

View File

@ -1,6 +1,6 @@
-- Local function definitions -- Local function definitions
while game == nil do while game == nil do
wait(1 / 30) wait()
end end
--------------- ---------------

View File

@ -1,5 +1,5 @@
while game == nil do while game == nil do
wait(1 / 30) wait()
end end
local ChangeHistoryService = game:GetService "ChangeHistoryService" local ChangeHistoryService = game:GetService "ChangeHistoryService"

View File

@ -1,5 +1,5 @@
while game == nil do while game == nil do
wait(1 / 30) wait()
end end
local ChangeHistoryService = game:GetService "ChangeHistoryService" local ChangeHistoryService = game:GetService "ChangeHistoryService"

View File

@ -1,5 +1,5 @@
while game == nil do while game == nil do
wait(1 / 30) wait()
end end
local ChangeHistoryService = game:GetService "ChangeHistoryService" local ChangeHistoryService = game:GetService "ChangeHistoryService"
@ -216,7 +216,7 @@ end
-- Show the highlighter. -- Show the highlighter.
function MouseHighlighter:EnablePreview() function MouseHighlighter:EnablePreview()
self.selectionBox.Parent = CoreGui-- This will make it not show up in workspace. self.selectionBox.Parent = CoreGui -- This will make it not show up in workspace.
end end
-- Create the mouse movement highlighter. -- Create the mouse movement highlighter.
@ -625,7 +625,7 @@ function onClicked(mouse2)
d = math.floor(50 * (originalY - prevY) / mouse2.ViewSizeY) d = math.floor(50 * (originalY - prevY) / mouse2.ViewSizeY)
elevate(x, y, z, elevationOptions.r, r2, d, range) elevate(x, y, z, elevationOptions.r, r2, d, range)
end end
wait(0) wait()
end end
ChangeHistoryService:SetWaypoint "Elevation" ChangeHistoryService:SetWaypoint "Elevation"
end end

View File

@ -1,5 +1,5 @@
while game == nil do while game == nil do
wait(1 / 30) wait()
end end
local ChangeHistoryService = game:GetService "ChangeHistoryService" local ChangeHistoryService = game:GetService "ChangeHistoryService"

View File

@ -1,5 +1,5 @@
while game == nil do while game == nil do
wait(1 / 30) wait()
end end
local ChangeHistoryService = game:GetService "ChangeHistoryService" local ChangeHistoryService = game:GetService "ChangeHistoryService"
@ -80,11 +80,11 @@ function makeCrater(x, y, z, cr, cd)
if cellschanged == false then if cellschanged == false then
break break
end end
wait(0) wait()
end end
for ri = 0, cr do for ri = 0, cr do
wait(0) wait()
local i = x - ri local i = x - ri
for k = z - cr, z + cr do for k = z - cr, z + cr do

View File

@ -1,5 +1,5 @@
while game == nil do while game == nil do
wait(1 / 30) wait()
end end
local ChangeHistoryService = game:GetService "ChangeHistoryService" local ChangeHistoryService = game:GetService "ChangeHistoryService"

View File

@ -1,5 +1,5 @@
while game == nil do while game == nil do
wait(1 / 30) wait()
end end
local ChangeHistoryService = game:GetService "ChangeHistoryService" local ChangeHistoryService = game:GetService "ChangeHistoryService"

View File

@ -1,5 +1,5 @@
while game == nil do while game == nil do
wait(1 / 30) wait()
end end
--------------- ---------------

View File

@ -1,5 +1,5 @@
while game == nil do while game == nil do
wait(1 / 30) wait()
end end
local ChangeHistoryService = game:GetService "ChangeHistoryService" local ChangeHistoryService = game:GetService "ChangeHistoryService"