diff --git a/luau/46295863.luau b/luau/46295863.luau index f3d70ce..aab8c0d 100644 --- a/luau/46295863.luau +++ b/luau/46295863.luau @@ -13,6 +13,208 @@ local function waitForProperty(instance, property) end end +local RbxGui + +-- WE'RE HERE +-- WE'RE QUEER +-- WE F*CK SH*T UP + +--#region Fusion types +--[[ + Stores common public-facing type information for Fusion APIs. +]] + +type Set = { [T]: any } +-- A unique symbolic value. +type Symbol = { + type: "Symbol", + name: string, +} + +-- Types that can be expressed as vectors of numbers, and so can be animated. +type Animatable = + number + | CFrame + | Color3 + | ColorSequenceKeypoint + | DateTime + | NumberRange + | NumberSequenceKeypoint + | PhysicalProperties + | Ray + | Rect + | Region3 + | Region3int16 + | UDim + | UDim2 + | Vector2 + | Vector2int16 + | Vector3 + | Vector3int16 + +-- A task which can be accepted for cleanup. +type Task = + Instance + | RBXScriptConnection + | () -> () | { destroy: (any) -> () } | { Destroy: (any) -> () } | { Task } + +-- Script-readable version information. +type Version = { + major: number, + minor: number, + isRelease: boolean, +} +--[[ + Generic reactive graph types +]] + +-- A graph object which can have dependents. +type Dependency = { + dependentSet: Set, +} + +-- A graph object which can have dependencies. +type Dependent = { + update: (Dependent) -> boolean, + dependencySet: Set, +} + +-- An object which stores a piece of reactive state. +type StateObject = Dependency & { + type: "State", + kind: string, +} + +-- Either a constant value of type T, or a state object containing type T. +type CanBeState = StateObject | T + +-- Function signature for use callbacks. +type Use = (target: CanBeState) -> T + +--[[ + Specific reactive graph types +]] + +-- A state object whose value can be set at any time by the user. +type Value = StateObject & { + kind: "State", + set: (Value, newValue: any, force: boolean?) -> (), +} + +-- A state object whose value is derived from other objects using a callback. +type Computed = StateObject & Dependent & { + kind: "Computed", +} + +-- A state object whose value is derived from other objects using a callback. +type ForPairs = StateObject<{ [KO]: VO }> & Dependent & { + kind: "ForPairs", +} +-- A state object whose value is derived from other objects using a callback. +type ForKeys = StateObject<{ [KO]: V }> & Dependent & { + kind: "ForKeys", +} +-- A state object whose value is derived from other objects using a callback. +type ForValues = StateObject<{ [K]: VO }> & Dependent & { + kind: "ForKeys", +} + +-- A state object which follows another state object using tweens. +type Tween = StateObject & Dependent & { + kind: "Tween", +} + +-- A state object which follows another state object using spring simulation. +type Spring = StateObject & Dependent & { + kind: "Spring", + setPosition: (Spring, newPosition: Animatable) -> (), + setVelocity: (Spring, newVelocity: Animatable) -> (), + addVelocity: (Spring, deltaVelocity: Animatable) -> (), +} + +-- An object which can listen for updates on another state object. +type Observer = Dependent & { + kind: "Observer", + onChange: (Observer, callback: () -> ()) -> () -> (), +} + +--[[ + Instance related types +]] + +-- Denotes children instances in an instance or component's property table. +type SpecialKey = { + type: "SpecialKey", + kind: string, + stage: "self" | "descendants" | "ancestor" | "observer", + apply: ( + SpecialKey, + value: any, + applyTo: Instance, + cleanupTasks: { Task } + ) -> (), +} + +-- A collection of instances that may be parented to another instance. +type Children = Instance | StateObject | { [any]: Children } + +-- A table that defines an instance's properties, handlers and children. +type PropertyTable = { [string | SpecialKey]: any } + +type Fusion = { + version: Version, + + New: (className: string) -> (propertyTable: PropertyTable) -> Instance, + Hydrate: ( + target: Instance + ) -> (propertyTable: PropertyTable) -> Instance, + Ref: SpecialKey, + Cleanup: SpecialKey, + Children: SpecialKey, + Out: (propertyName: string) -> SpecialKey, + OnEvent: (eventName: string) -> SpecialKey, + OnChange: (propertyName: string) -> SpecialKey, + + Value: (initialValue: T) -> Value, + Computed: (callback: (Use) -> T, destructor: (T) -> ()?) -> Computed, + ForPairs: ( + inputTable: CanBeState<{ [KI]: VI }>, + processor: (Use, KI, VI) -> (KO, VO, M?), + destructor: (KO, VO, M?) -> ()? + ) -> ForPairs, + ForKeys: ( + inputTable: CanBeState<{ [KI]: any }>, + processor: (Use, KI) -> (KO, M?), + destructor: (KO, M?) -> ()? + ) -> ForKeys, + ForValues: ( + inputTable: CanBeState<{ [any]: VI }>, + processor: (Use, VI) -> (VO, M?), + destructor: (VO, M?) -> ()? + ) -> ForValues, + Observer: (watchedState: StateObject) -> Observer, + + Tween: (goalState: StateObject, tweenInfo: TweenInfo?) -> Tween, + Spring: ( + goalState: StateObject, + speed: CanBeState?, + damping: CanBeState? + ) -> Spring, + + cleanup: (...any) -> (), + doNothing: (...any) -> (), + peek: Use, +} + +--#endregion + +local Fusion = (LoadLibrary "RbxFusion") :: Fusion + +local New = Fusion.New +local Children = Fusion.Children +local OnEvent = Fusion.OnEvent +local Hydrate = Fusion.Hydrate + -- A Few Script Globals local gui if script.Parent:FindFirstChild "ControlFrame" then @@ -62,6 +264,8 @@ local function robloxLock(instance) end end +local settingsButton + local function resumeGameFunction(shield) shield.Settings:TweenPosition( UDim2.new(0.5, -262, -0.5, -200), @@ -188,15 +392,15 @@ local function createTextButton( buttonSize, buttonPosition ) - local newTextButton = Instance.new "TextButton" - newTextButton.Font = Enum.Font.Arial - newTextButton.FontSize = fontSize - newTextButton.Size = buttonSize - newTextButton.Position = buttonPosition - newTextButton.Style = style - newTextButton.TextColor3 = Color3.new(1, 1, 1) - newTextButton.Text = text - return newTextButton + return New "TextButton" { + Font = Enum.Font.Arial, + FontSize = fontSize, + Size = buttonSize, + Position = buttonPosition, + Style = style, + TextColor3 = Color3.new(1, 1, 1), + Text = text, + } end local function CreateTextButtons(frame, buttons, yPos, ySize) @@ -218,19 +422,23 @@ local function CreateTextButtons(frame, buttons, yPos, ySize) end for _, obj in ipairs(buttons) do - local button = Instance.new "TextButton" - button.Name = "Button" .. buttonNum - button.Font = Enum.Font.Arial - button.FontSize = Enum.FontSize.Size18 - button.AutoButtonColor = true - button.Style = Enum.ButtonStyle.RobloxButton - button.Text = obj.Text - button.TextColor3 = Color3.new(1, 1, 1) - button.MouseButton1Click:connect(function() - toggleSelection(button) - obj.Function() - end) - button.Parent = frame + local button + button = New "TextButton" { + Name = "Button" .. buttonNum, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + AutoButtonColor = true, + Style = Enum.ButtonStyle.RobloxButton, + Text = obj.Text, + TextColor3 = Color3.new(1, 1, 1), + Parent = frame, + + [OnEvent "MouseButton1Click"] = function() + toggleSelection(button) + obj.Function() + end, + } + buttonObjs[buttonNum] = button buttonNum += 1 @@ -330,59 +538,72 @@ local function createHelpDialog(baseZIndex) end end - local shield = Instance.new "Frame" - shield.Name = "HelpDialogShield" - shield.Active = true - shield.Visible = false - shield.Size = UDim2.new(1, 0, 1, 0) - shield.BackgroundColor3 = Color3I(51, 51, 51) - shield.BorderColor3 = Color3I(27, 42, 53) - shield.BackgroundTransparency = 0.4 - shield.ZIndex = baseZIndex + 1 + local shield = New "Frame" { + Name = "HelpDialogShield", + Active = true, + Visible = false, + Size = UDim2.new(1, 0, 1, 0), + BackgroundColor3 = Color3I(51, 51, 51), + BorderColor3 = Color3I(27, 42, 53), + BackgroundTransparency = 0.4, + ZIndex = baseZIndex + 1, + } - local helpDialog = Instance.new "Frame" - helpDialog.Name = "HelpDialog" - helpDialog.Style = Enum.FrameStyle.RobloxRound - helpDialog.Position = UDim2.new(0.2, 0, 0.2, 0) - helpDialog.Size = UDim2.new(0.6, 0, 0.6, 0) - helpDialog.Active = true - helpDialog.Parent = shield + local helpDialog = New "Frame" { + Name = "HelpDialog", + Style = Enum.FrameStyle.RobloxRound, + Position = UDim2.new(0.2, 0, 0.2, 0), + Size = UDim2.new(0.6, 0, 0.6, 0), + Active = true, + Parent = shield, - local titleLabel = Instance.new "TextLabel" - titleLabel.Name = "Title" - titleLabel.Text = "Keyboard & Mouse Controls" - titleLabel.Font = Enum.Font.ArialBold - titleLabel.FontSize = Enum.FontSize.Size36 - titleLabel.Position = UDim2.new(0, 0, 0.025, 0) - titleLabel.Size = UDim2.new(1, 0, 0, 40) - titleLabel.TextColor3 = Color3.new(1, 1, 1) - titleLabel.BackgroundTransparency = 1 - titleLabel.Parent = helpDialog + [Children] = { + New "TextLabel" { + Name = "Title", + Text = "Keyboard & Mouse Controls", + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + Position = UDim2.new(0, 0, 0.025, 0), + Size = UDim2.new(1, 0, 0, 40), + TextColor3 = Color3.new(1, 1, 1), + BackgroundTransparency = 1, + }, + }, + } - local buttonRow = Instance.new "Frame" - buttonRow.Name = "Buttons" - buttonRow.Position = UDim2.new(0.1, 0, 0.07, 40) - buttonRow.Size = UDim2.new(0.8, 0, 0, 45) - buttonRow.BackgroundTransparency = 1 - buttonRow.Parent = helpDialog + local buttonRow = New "Frame" { + Name = "Buttons", + Position = UDim2.new(0.1, 0, 0.07, 40), + Size = UDim2.new(0.8, 0, 0, 45), + BackgroundTransparency = 1, + Parent = helpDialog, + } - local imageFrame = Instance.new "Frame" - imageFrame.Name = "ImageFrame" - imageFrame.Position = UDim2.new(0.05, 0, 0.075, 80) - imageFrame.Size = UDim2.new(0.9, 0, 0.9, -120) - imageFrame.BackgroundTransparency = 1 - imageFrame.Parent = helpDialog + local imageFrame = New "Frame" { + Name = "ImageFrame", + Position = UDim2.new(0.05, 0, 0.075, 80), + Size = UDim2.new(0.9, 0, 0.9, -120), + BackgroundTransparency = 1, + Parent = helpDialog, + } - local layoutFrame = Instance.new "Frame" - layoutFrame.Name = "LayoutFrame" - layoutFrame.Position = UDim2.new(0.5, 0, 0, 0) - layoutFrame.Size = UDim2.new(1.5, 0, 1, 0) - layoutFrame.BackgroundTransparency = 1 - layoutFrame.SizeConstraint = Enum.SizeConstraint.RelativeYY - layoutFrame.Parent = imageFrame + local layoutFrame = New "Frame" { + Name = "LayoutFrame", + Position = UDim2.new(0.5, 0, 0, 0), + Size = UDim2.new(1.5, 0, 1, 0), + BackgroundTransparency = 1, + SizeConstraint = Enum.SizeConstraint.RelativeYY, + Parent = imageFrame, + } + + local image = New "ImageLabel" { + Name = "Image", + Position = UDim2.new(-0.5, 0, 0, 0), + Size = UDim2.new(1, 0, 1, 0), + BackgroundTransparency = 1, + Parent = layoutFrame, + } - local image = Instance.new "ImageLabel" - image.Name = "Image" if UserSettings().GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"] @@ -391,10 +612,6 @@ local function createHelpDialog(baseZIndex) else image.Image = classicLookScreenUrl end - image.Position = UDim2.new(-0.5, 0, 0, 0) - image.Size = UDim2.new(1, 0, 1, 0) - image.BackgroundTransparency = 1 - image.Parent = layoutFrame local buttons = {} buttons[1] = {} @@ -466,34 +683,37 @@ local function createHelpDialog(baseZIndex) ) end) - local okBtn = Instance.new "TextButton" - okBtn.Name = "OkBtn" - okBtn.Text = "OK" - okBtn.Modal = true - okBtn.Size = UDim2.new(0.3, 0, 0, 45) - okBtn.Position = UDim2.new(0.35, 0, 0.975, -50) - okBtn.Font = Enum.Font.Arial - okBtn.FontSize = Enum.FontSize.Size18 - okBtn.BackgroundTransparency = 1 - okBtn.TextColor3 = Color3.new(1, 1, 1) - okBtn.Style = Enum.ButtonStyle.RobloxButtonDefault - okBtn.MouseButton1Click:connect(function() - shield.Visible = false - game.GuiService:RemoveCenterDialog(shield) - end) - okBtn.Parent = helpDialog + New "TextButton" { + Name = "OkBtn", + Text = "OK", + Modal = true, + Size = UDim2.new(0.3, 0, 0, 45), + Position = UDim2.new(0.35, 0, 0.975, -50), + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + BackgroundTransparency = 1, + TextColor3 = Color3.new(1, 1, 1), + Style = Enum.ButtonStyle.RobloxButtonDefault, + Parent = helpDialog, + + [OnEvent "MouseButton1Click"] = function() + shield.Visible = false + game.GuiService:RemoveCenterDialog(shield) + end, + } robloxLock(shield) return shield end local function createLeaveConfirmationMenu(baseZIndex, shield) - local frame = Instance.new "Frame" - frame.Name = "LeaveConfirmationMenu" - frame.BackgroundTransparency = 1 - frame.Size = UDim2.new(1, 0, 1, 0) - frame.Position = UDim2.new(0, 0, 2, 400) - frame.ZIndex = baseZIndex + 4 + local frame = New "Frame" { + Name = "LeaveConfirmationMenu", + BackgroundTransparency = 1, + Size = UDim2.new(1, 0, 1, 0), + Position = UDim2.new(0, 0, 2, 400), + ZIndex = baseZIndex + 4, + } local yesButton = createTextButton( "Leave", @@ -534,127 +754,148 @@ local function createLeaveConfirmationMenu(baseZIndex, shield) ) end) - local leaveText = Instance.new "TextLabel" - leaveText.Name = "LeaveText" - leaveText.Text = "Leave this game?" - leaveText.Size = UDim2.new(1, 0, 0.8, 0) - leaveText.TextWrap = true - leaveText.TextColor3 = Color3.new(1, 1, 1) - leaveText.Font = Enum.Font.ArialBold - leaveText.FontSize = Enum.FontSize.Size36 - leaveText.BackgroundTransparency = 1 - leaveText.ZIndex = baseZIndex + 4 - leaveText.Parent = frame + New "TextLabel" { + Name = "LeaveText", + Text = "Leave this game?", + Size = UDim2.new(1, 0, 0.8, 0), + TextWrap = true, + TextColor3 = Color3.new(1, 1, 1), + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + BackgroundTransparency = 1, + ZIndex = baseZIndex + 4, + Parent = frame, + } return frame end local function createResetConfirmationMenu(baseZIndex, shield) - local frame = Instance.new "Frame" - frame.Name = "ResetConfirmationMenu" - frame.BackgroundTransparency = 1 - frame.Size = UDim2.new(1, 0, 1, 0) - frame.Position = UDim2.new(0, 0, 2, 400) - frame.ZIndex = baseZIndex + 4 + return New "Frame" { + Name = "ResetConfirmationMenu", + BackgroundTransparency = 1, + Size = UDim2.new(1, 0, 1, 0), + Position = UDim2.new(0, 0, 2, 400), + ZIndex = baseZIndex + 4, - local yesButton = createTextButton( - "Reset", - Enum.ButtonStyle.RobloxButtonDefault, - Enum.FontSize.Size24, - UDim2.new(0, 128, 0, 50), - UDim2.new(0, 313, 0, 299) - ) - yesButton.Name = "YesButton" - yesButton.ZIndex = baseZIndex + 4 - yesButton.Parent = frame - yesButton.Modal = true - yesButton.MouseButton1Click:connect(function() - resumeGameFunction(shield) - resetLocalCharacter() - end) + [Children] = { + New "TextLabel" { + Name = "ResetCharacterText", + Text = "Are you sure you want to reset your character?", + Size = UDim2.new(1, 0, 0.8, 0), + TextWrap = true, + TextColor3 = Color3.new(1, 1, 1), + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + BackgroundTransparency = 1, + ZIndex = baseZIndex + 4, + }, - local noButton = createTextButton( - "Cancel", - Enum.ButtonStyle.RobloxButton, - Enum.FontSize.Size24, - UDim2.new(0, 128, 0, 50), - UDim2.new(0, 90, 0, 299) - ) - noButton.Name = "NoButton" - noButton.Parent = frame - noButton.ZIndex = baseZIndex + 4 - noButton.MouseButton1Click:connect(function() - goToMenu( - shield.Settings.SettingsStyle, - "GameMainMenu", - "down", - UDim2.new(0, 525, 0, 430) - ) - shield.Settings:TweenSize( - UDim2.new(0, 525, 0, 430), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - end) + New "TextLabel" { + Name = "FineResetCharacterText", + Text = "You will be put back on a spawn point", + Size = UDim2.new(0, 303, 0, 18), + TextWrap = true, + TextColor3 = Color3.new(1, 1, 1), + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size18, + BackgroundTransparency = 1, + ZIndex = baseZIndex + 4, + Position = UDim2.new(0, 109, 0, 215), + }, - local resetCharacterText = Instance.new "TextLabel" - resetCharacterText.Name = "ResetCharacterText" - resetCharacterText.Text = "Are you sure you want to reset your character?" - resetCharacterText.Size = UDim2.new(1, 0, 0.8, 0) - resetCharacterText.TextWrap = true - resetCharacterText.TextColor3 = Color3.new(1, 1, 1) - resetCharacterText.Font = Enum.Font.ArialBold - resetCharacterText.FontSize = Enum.FontSize.Size36 - resetCharacterText.BackgroundTransparency = 1 - resetCharacterText.ZIndex = baseZIndex + 4 - resetCharacterText.Parent = frame + Hydrate( + createTextButton( + "Reset", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 128, 0, 50), + UDim2.new(0, 313, 0, 299) + ) + ) { + Name = "YesButton", + ZIndex = baseZIndex + 4, + Modal = true, - local fineResetCharacterText = resetCharacterText:Clone() - fineResetCharacterText.Name = "FineResetCharacterText" - fineResetCharacterText.Text = "You will be put back on a spawn point" - fineResetCharacterText.Size = UDim2.new(0, 303, 0, 18) - fineResetCharacterText.Position = UDim2.new(0, 109, 0, 215) - fineResetCharacterText.FontSize = Enum.FontSize.Size18 - fineResetCharacterText.Parent = frame + [OnEvent "MouseButton1Click"] = function() + resumeGameFunction(shield) + resetLocalCharacter() + end, + }, - return frame + Hydrate( + createTextButton( + "Cancel", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 128, 0, 50), + UDim2.new(0, 90, 0, 299) + ) + ) { + Name = "NoButton", + ZIndex = baseZIndex + 4, + + [OnEvent "MouseButton1Click"] = function() + goToMenu( + shield.Settings.SettingsStyle, + "GameMainMenu", + "down", + UDim2.new(0, 525, 0, 430) + ) + shield.Settings:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + end, + }, + }, + } end +local settingsFrame + local function createGameMainMenu(baseZIndex, shield) - local gameMainMenuFrame = Instance.new "Frame" - gameMainMenuFrame.Name = "GameMainMenu" - gameMainMenuFrame.BackgroundTransparency = 1 - gameMainMenuFrame.Size = UDim2.new(1, 0, 1, 0) - gameMainMenuFrame.ZIndex = baseZIndex + 4 - gameMainMenuFrame.Parent = settingsFrame + local gameMainMenuFrame = New "Frame" { + Name = "GameMainMenu", + BackgroundTransparency = 1, + Size = UDim2.new(1, 0, 1, 0), + ZIndex = baseZIndex + 4, + Parent = settingsFrame, + + [Children] = { + New "TextLabel" { + Name = "Title", + Text = "Game Menu", + BackgroundTransparency = 1, + TextStrokeTransparency = 0, + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + Size = UDim2.new(1, 0, 0, 36), + Position = UDim2.new(0, 0, 0, 4), + TextColor3 = Color3.new(1, 1, 1), + ZIndex = baseZIndex + 4, + }, + }, + } -- GameMainMenu Children - local gameMainMenuTitle = Instance.new "TextLabel" - gameMainMenuTitle.Name = "Title" - gameMainMenuTitle.Text = "Game Menu" - gameMainMenuTitle.BackgroundTransparency = 1 - gameMainMenuTitle.TextStrokeTransparency = 0 - gameMainMenuTitle.Font = Enum.Font.ArialBold - gameMainMenuTitle.FontSize = Enum.FontSize.Size36 - gameMainMenuTitle.Size = UDim2.new(1, 0, 0, 36) - gameMainMenuTitle.Position = UDim2.new(0, 0, 0, 4) - gameMainMenuTitle.TextColor3 = Color3.new(1, 1, 1) - gameMainMenuTitle.ZIndex = baseZIndex + 4 - gameMainMenuTitle.Parent = gameMainMenuFrame - - local robloxHelpButton = createTextButton( - "Help", - Enum.ButtonStyle.RobloxButton, - Enum.FontSize.Size18, - UDim2.new(0, 164, 0, 50), - UDim2.new(0, 82, 0, 256) - ) - robloxHelpButton.Name = "HelpButton" - robloxHelpButton.ZIndex = baseZIndex + 4 - robloxHelpButton.Parent = gameMainMenuFrame + local robloxHelpButton = Hydrate( + createTextButton( + "Help", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 164, 0, 50), + UDim2.new(0, 82, 0, 256) + ) + ) { + Name = "HelpButton", + ZIndex = baseZIndex + 4, + Parent = gameMainMenuFrame, + } helpButton = robloxHelpButton local helpDialog = createHelpDialog(baseZIndex) @@ -678,293 +919,343 @@ local function createGameMainMenu(baseZIndex, shield) end) helpButton.Active = true - local helpShortcut = Instance.new "TextLabel" - helpShortcut.Name = "HelpShortcutText" - helpShortcut.Text = "F1" - helpShortcut.Visible = false - helpShortcut.BackgroundTransparency = 1 - helpShortcut.Font = Enum.Font.Arial - helpShortcut.FontSize = Enum.FontSize.Size12 - helpShortcut.Position = UDim2.new(0, 85, 0, 0) - helpShortcut.Size = UDim2.new(0, 30, 0, 30) - helpShortcut.TextColor3 = Color3.new(0, 1, 0) - helpShortcut.ZIndex = baseZIndex + 4 - helpShortcut.Parent = robloxHelpButton + local helpShortcut = New "TextLabel" { + Name = "HelpShortcutText", + Text = "F1", + Visible = false, + BackgroundTransparency = 1, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size12, + Position = UDim2.new(0, 85, 0, 0), + Size = UDim2.new(0, 30, 0, 30), + TextColor3 = Color3.new(0, 1, 0), + ZIndex = baseZIndex + 4, + Parent = robloxHelpButton, + } - local screenshotButton = createTextButton( - "Screenshot", - Enum.ButtonStyle.RobloxButton, - Enum.FontSize.Size18, - UDim2.new(0, 168, 0, 50), - UDim2.new(0, 254, 0, 256) - ) - screenshotButton.Name = "ScreenshotButton" - screenshotButton.ZIndex = baseZIndex + 4 - screenshotButton.Parent = gameMainMenuFrame - screenshotButton.Visible = not macClient + local screenshotButton = Hydrate( + createTextButton( + "Screenshot", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 168, 0, 50), + UDim2.new(0, 254, 0, 256) + ) + ) { + Name = "ScreenshotButton", + ZIndex = baseZIndex + 4, + Parent = gameMainMenuFrame, + Visible = not macClient, + } screenshotButton:SetVerb "Screenshot" - local screenshotShortcut = helpShortcut:clone() - screenshotShortcut.Name = "ScreenshotShortcutText" - screenshotShortcut.Text = "PrintSc" - screenshotShortcut.Position = UDim2.new(0, 118, 0, 0) - screenshotShortcut.Visible = true - screenshotShortcut.Parent = screenshotButton + Hydrate(helpShortcut:clone()) { + Name = "ScreenshotShortcutText", + Text = "PrintSc", + Position = UDim2.new(0, 118, 0, 0), + Visible = true, + Parent = screenshotButton, + } - local recordVideoButton = createTextButton( - "Record Video", - Enum.ButtonStyle.RobloxButton, - Enum.FontSize.Size18, - UDim2.new(0, 168, 0, 50), - UDim2.new(0, 254, 0, 306) - ) - recordVideoButton.Name = "RecordVideoButton" - recordVideoButton.ZIndex = baseZIndex + 4 - recordVideoButton.Parent = gameMainMenuFrame - recordVideoButton.Visible = not macClient + local recordVideoButton = Hydrate( + createTextButton( + "Record Video", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 168, 0, 50), + UDim2.new(0, 254, 0, 306) + ) + ) { + Name = "RecordVideoButton", + ZIndex = baseZIndex + 4, + Parent = gameMainMenuFrame, + Visible = not macClient, + + [Children] = { + Hydrate(helpShortcut:clone()) { + Visible = hasGraphicsSlider, + Name = "RecordVideoShortcutText", + Text = "F12", + Position = UDim2.new(0, 120, 0, 0), + }, + }, + } recordVideoButton:SetVerb "RecordToggle" - local recordVideoShortcut = helpShortcut:clone() - recordVideoShortcut.Visible = hasGraphicsSlider - recordVideoShortcut.Name = "RecordVideoShortcutText" - recordVideoShortcut.Text = "F12" - recordVideoShortcut.Position = UDim2.new(0, 120, 0, 0) - recordVideoShortcut.Parent = recordVideoButton + local stopRecordButton + stopRecordButton = New "ImageButton" { + Name = "StopRecordButton", + BackgroundTransparency = 1, + Image = "rbxasset://textures/ui/RecordStop.png", + Size = UDim2.new(0, 59, 0, 27), + Parent = gui, + Visible = false, - local stopRecordButton = Instance.new "ImageButton" - stopRecordButton.Name = "StopRecordButton" - stopRecordButton.BackgroundTransparency = 1 - stopRecordButton.Image = "rbxasset://textures/ui/RecordStop.png" - stopRecordButton.Size = UDim2.new(0, 59, 0, 27) + [OnEvent "MouseButton1Click"] = function() + recordVideoClick(recordVideoButton, stopRecordButton) + end, + } stopRecordButton:SetVerb "RecordToggle" - stopRecordButton.MouseButton1Click:connect(function() - recordVideoClick(recordVideoButton, stopRecordButton) - end) - stopRecordButton.Visible = false - stopRecordButton.Parent = gui + Hydrate( + createTextButton( + "Report Abuse", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 164, 0, 50), + UDim2.new(0, 82, 0, 306) + ) + ) { + Name = "ReportAbuseButton", + ZIndex = baseZIndex + 4, + Parent = gameMainMenuFrame, + } - local reportAbuseButton = createTextButton( - "Report Abuse", - Enum.ButtonStyle.RobloxButton, - Enum.FontSize.Size18, - UDim2.new(0, 164, 0, 50), - UDim2.new(0, 82, 0, 306) - ) - reportAbuseButton.Name = "ReportAbuseButton" - reportAbuseButton.ZIndex = baseZIndex + 4 - reportAbuseButton.Parent = gameMainMenuFrame + Hydrate( + createTextButton( + "Leave Game", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new(0, 82, 0, 358) + ) + ) { + Name = "LeaveGameButton", + ZIndex = baseZIndex + 4, + Parent = gameMainMenuFrame, + } - local leaveGameButton = createTextButton( - "Leave Game", - Enum.ButtonStyle.RobloxButton, - Enum.FontSize.Size24, - UDim2.new(0, 340, 0, 50), - UDim2.new(0, 82, 0, 358) - ) - leaveGameButton.Name = "LeaveGameButton" - leaveGameButton.ZIndex = baseZIndex + 4 - leaveGameButton.Parent = gameMainMenuFrame + Hydrate( + createTextButton( + "Resume Game", + Enum.ButtonStyle.RobloxButtonDefault, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new(0, 82, 0, 54) + ) + ) { + Name = "resumeGameButton", + ZIndex = baseZIndex + 4, + Parent = gameMainMenuFrame, + Modal = true, - local resumeGameButton = createTextButton( - "Resume Game", - Enum.ButtonStyle.RobloxButtonDefault, - Enum.FontSize.Size24, - UDim2.new(0, 340, 0, 50), - UDim2.new(0, 82, 0, 54) - ) - resumeGameButton.Name = "resumeGameButton" - resumeGameButton.ZIndex = baseZIndex + 4 - resumeGameButton.Parent = gameMainMenuFrame - resumeGameButton.Modal = true - resumeGameButton.MouseButton1Click:connect(function() - resumeGameFunction(shield) - end) + [OnEvent "MouseButton1Click"] = function() + resumeGameFunction(shield) + end, + } - local gameSettingsButton = createTextButton( - "Game Settings", - Enum.ButtonStyle.RobloxButton, - Enum.FontSize.Size24, - UDim2.new(0, 340, 0, 50), - UDim2.new(0, 82, 0, 156) - ) - gameSettingsButton.Name = "SettingsButton" - gameSettingsButton.ZIndex = baseZIndex + 4 - gameSettingsButton.Parent = gameMainMenuFrame + Hydrate( + createTextButton( + "Game Settings", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new(0, 82, 0, 156) + ) + ) { + Name = "SettingsButton", + ZIndex = baseZIndex + 4, + Parent = gameMainMenuFrame, + } if game:FindFirstChild "LoadingGuiService" and #game.LoadingGuiService:GetChildren() > 0 then - gameSettingsButton = createTextButton( - "Game Instructions", + Hydrate( + createTextButton( + "Game Instructions", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size24, + UDim2.new(0, 340, 0, 50), + UDim2.new(0, 82, 0, 207) + ) + ) { + Name = "GameInstructions", + ZIndex = baseZIndex + 4, + Parent = gameMainMenuFrame, + + [OnEvent "MouseButton1Click"] = function() + if + game:FindFirstChild "Players" and game.Players.LocalPlayer + then + local loadingGui = + game.Players.LocalPlayer:FindFirstChild "PlayerLoadingGui" + if loadingGui then + loadingGui.Visible = true + end + end + end, + } + end + + Hydrate( + createTextButton( + "Reset Character", Enum.ButtonStyle.RobloxButton, Enum.FontSize.Size24, UDim2.new(0, 340, 0, 50), - UDim2.new(0, 82, 0, 207) + UDim2.new(0, 82, 0, 105) ) - gameSettingsButton.Name = "GameInstructions" - gameSettingsButton.ZIndex = baseZIndex + 4 - gameSettingsButton.Parent = gameMainMenuFrame - gameSettingsButton.MouseButton1Click:connect(function() - if game:FindFirstChild "Players" and game.Players.LocalPlayer then - local loadingGui = - game.Players.LocalPlayer:FindFirstChild "PlayerLoadingGui" - if loadingGui then - loadingGui.Visible = true - end - end - end) - end - - local resetButton = createTextButton( - "Reset Character", - Enum.ButtonStyle.RobloxButton, - Enum.FontSize.Size24, - UDim2.new(0, 340, 0, 50), - UDim2.new(0, 82, 0, 105) - ) - resetButton.Name = "ResetButton" - resetButton.ZIndex = baseZIndex + 4 - resetButton.Parent = gameMainMenuFrame + ) { + Name = "ResetButton", + ZIndex = baseZIndex + 4, + Parent = gameMainMenuFrame, + } return gameMainMenuFrame end +local mouseLockLabel, syncVideoCaptureSetting + local function createGameSettingsMenu(baseZIndex, _) - local gameSettingsMenuFrame = Instance.new "Frame" - gameSettingsMenuFrame.Name = "GameSettingsMenu" - gameSettingsMenuFrame.BackgroundTransparency = 1 - gameSettingsMenuFrame.Size = UDim2.new(1, 0, 1, 0) - gameSettingsMenuFrame.ZIndex = baseZIndex + 4 + local gameSettingsMenuFrame = New "Frame" { + Name = "GameSettingsMenu", + BackgroundTransparency = 1, + Size = UDim2.new(1, 0, 1, 0), + ZIndex = baseZIndex + 4, - local title = Instance.new "TextLabel" - title.Name = "Title" - title.Text = "Settings" - title.Size = UDim2.new(1, 0, 0, 48) - title.Position = UDim2.new(0, 9, 0, -9) - title.Font = Enum.Font.ArialBold - title.FontSize = Enum.FontSize.Size36 - title.TextColor3 = Color3.new(1, 1, 1) - title.ZIndex = baseZIndex + 4 - title.BackgroundTransparency = 1 - title.Parent = gameSettingsMenuFrame + [Children] = { + New "TextLabel" { + Name = "Title", + Text = "Settings", + Size = UDim2.new(1, 0, 0, 48), + Position = UDim2.new(0, 9, 0, -9), + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + TextColor3 = Color3.new(1, 1, 1), + ZIndex = baseZIndex + 4, + BackgroundTransparency = 1, + }, - local fullscreenText = Instance.new "TextLabel" - fullscreenText.Name = "FullscreenText" - fullscreenText.Text = "Fullscreen Mode" - fullscreenText.Size = UDim2.new(0, 124, 0, 18) - fullscreenText.Position = UDim2.new(0, 62, 0, 145) - fullscreenText.Font = Enum.Font.Arial - fullscreenText.FontSize = Enum.FontSize.Size18 - fullscreenText.TextColor3 = Color3.new(1, 1, 1) - fullscreenText.ZIndex = baseZIndex + 4 - fullscreenText.BackgroundTransparency = 1 - fullscreenText.Parent = gameSettingsMenuFrame + New "TextLabel" { + Name = "FullscreenText", + Text = "Fullscreen Mode", + Size = UDim2.new(0, 124, 0, 18), + Position = UDim2.new(0, 62, 0, 145), + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + TextColor3 = Color3.new(1, 1, 1), + ZIndex = baseZIndex + 4, + BackgroundTransparency = 1, + }, + }, + } - local fullscreenShortcut = Instance.new "TextLabel" - fullscreenShortcut.Visible = hasGraphicsSlider - fullscreenShortcut.Name = "FullscreenShortcutText" - fullscreenShortcut.Text = "F11" - fullscreenShortcut.BackgroundTransparency = 1 - fullscreenShortcut.Font = Enum.Font.Arial - fullscreenShortcut.FontSize = Enum.FontSize.Size12 - fullscreenShortcut.Position = UDim2.new(0, 186, 0, 141) - fullscreenShortcut.Size = UDim2.new(0, 30, 0, 30) - fullscreenShortcut.TextColor3 = Color3.new(0, 1, 0) - fullscreenShortcut.ZIndex = baseZIndex + 4 - fullscreenShortcut.Parent = gameSettingsMenuFrame + local fullscreenShortcut = New "TextLabel" { + Visible = hasGraphicsSlider, + Name = "FullscreenShortcutText", + Text = "F11", + BackgroundTransparency = 1, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size12, + Position = UDim2.new(0, 186, 0, 141), + Size = UDim2.new(0, 30, 0, 30), + TextColor3 = Color3.new(0, 1, 0), + ZIndex = baseZIndex + 4, + Parent = gameSettingsMenuFrame, + } + local studioText = New "TextLabel" { + Visible = false, + Name = "StudioText", + Text = "Studio Mode", + Size = UDim2.new(0, 95, 0, 18), + Position = UDim2.new(0, 62, 0, 179), + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + TextColor3 = Color3.new(1, 1, 1), + ZIndex = baseZIndex + 4, + BackgroundTransparency = 1, + Parent = gameSettingsMenuFrame, + } - local studioText = Instance.new "TextLabel" - studioText.Visible = false - studioText.Name = "StudioText" - studioText.Text = "Studio Mode" - studioText.Size = UDim2.new(0, 95, 0, 18) - studioText.Position = UDim2.new(0, 62, 0, 179) - studioText.Font = Enum.Font.Arial - studioText.FontSize = Enum.FontSize.Size18 - studioText.TextColor3 = Color3.new(1, 1, 1) - studioText.ZIndex = baseZIndex + 4 - studioText.BackgroundTransparency = 1 - studioText.Parent = gameSettingsMenuFrame - - local studioShortcut = fullscreenShortcut:clone() - studioShortcut.Name = "StudioShortcutText" - studioShortcut.Visible = false -- TODO: turn back on when f2 hack is fixed - studioShortcut.Text = "F2" - studioShortcut.Position = UDim2.new(0, 154, 0, 175) - studioShortcut.Parent = gameSettingsMenuFrame + local studioShortcut = Hydrate(fullscreenShortcut:clone()) { + Name = "StudioShortcutText", + Visible = false, -- TODO: turn back on when f2 hack is fixed + Text = "F2", + Position = UDim2.new(0, 154, 0, 175), + Parent = gameSettingsMenuFrame, + } local studioCheckbox if hasGraphicsSlider then - local qualityText = Instance.new "TextLabel" - qualityText.Name = "QualityText" - qualityText.Text = "Graphics Quality" - qualityText.Size = UDim2.new(0, 128, 0, 18) - qualityText.Position = UDim2.new(0, 30, 0, 239) - qualityText.Font = Enum.Font.Arial - qualityText.FontSize = Enum.FontSize.Size18 - qualityText.TextColor3 = Color3.new(1, 1, 1) - qualityText.ZIndex = baseZIndex + 4 - qualityText.BackgroundTransparency = 1 - qualityText.Parent = gameSettingsMenuFrame - qualityText.Visible = not inStudioMode + local qualityText = New "TextLabel" { + Name = "QualityText", + Text = "Graphics Quality", + Size = UDim2.new(0, 128, 0, 18), + Position = UDim2.new(0, 30, 0, 239), + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + TextColor3 = Color3.new(1, 1, 1), + ZIndex = baseZIndex + 4, + BackgroundTransparency = 1, + Parent = gameSettingsMenuFrame, + Visible = not inStudioMode, + } - local autoText = qualityText:clone() - autoText.Name = "AutoText" - autoText.Text = "Auto" - autoText.Position = UDim2.new(0, 183, 0, 214) - autoText.TextColor3 = Color3.new(128 / 255, 128 / 255, 128 / 255) - autoText.Size = UDim2.new(0, 34, 0, 18) - autoText.Parent = gameSettingsMenuFrame - autoText.Visible = not inStudioMode + local autoText = Hydrate(qualityText:clone()) { + Name = "AutoText", + Text = "Auto", + Position = UDim2.new(0, 183, 0, 214), + TextColor3 = Color3.new(128 / 255, 128 / 255, 128 / 255), + Size = UDim2.new(0, 34, 0, 18), + Parent = gameSettingsMenuFrame, + Visible = not inStudioMode, + } - local fasterText = autoText:clone() - fasterText.Name = "FasterText" - fasterText.Text = "Faster" - fasterText.Position = UDim2.new(0, 185, 0, 274) - fasterText.TextColor3 = Color3.new(95, 95, 95) - fasterText.FontSize = Enum.FontSize.Size14 - fasterText.Parent = gameSettingsMenuFrame - fasterText.Visible = not inStudioMode + local fasterText = Hydrate(autoText:clone()) { + Name = "FasterText", + Text = "Faster", + Position = UDim2.new(0, 185, 0, 274), + TextColor3 = Color3.new(95, 95, 95), + FontSize = Enum.FontSize.Size14, + Parent = gameSettingsMenuFrame, + Visible = not inStudioMode, + } - local fasterShortcut = fullscreenShortcut:clone() - fasterShortcut.Name = "FasterShortcutText" - fasterShortcut.Text = "F10 + Shift" - fasterShortcut.Position = UDim2.new(0, 185, 0, 283) - fasterShortcut.Parent = gameSettingsMenuFrame - fasterShortcut.Visible = not inStudioMode + local fasterShortcut = Hydrate(fullscreenShortcut:clone()) { + Name = "FasterShortcutText", + Text = "F10 + Shift", + Position = UDim2.new(0, 185, 0, 283), + Parent = gameSettingsMenuFrame, + Visible = not inStudioMode, + } - local betterQualityText = autoText:clone() - betterQualityText.Name = "BetterQualityText" - betterQualityText.Text = "Better Quality" - betterQualityText.TextWrap = true - betterQualityText.Size = UDim2.new(0, 41, 0, 28) - betterQualityText.Position = UDim2.new(0, 390, 0, 269) - betterQualityText.TextColor3 = Color3.new(95, 95, 95) - betterQualityText.FontSize = Enum.FontSize.Size14 - betterQualityText.Parent = gameSettingsMenuFrame - betterQualityText.Visible = not inStudioMode + local betterQualityText = Hydrate(autoText:clone()) { + Name = "BetterQualityText", + Text = "Better Quality", + TextWrap = true, + Size = UDim2.new(0, 41, 0, 28), + Position = UDim2.new(0, 390, 0, 269), + TextColor3 = Color3.new(95, 95, 95), + FontSize = Enum.FontSize.Size14, + Parent = gameSettingsMenuFrame, + Visible = not inStudioMode, + } - local betterQualityShortcut = fullscreenShortcut:clone() - betterQualityShortcut.Name = "BetterQualityShortcut" - betterQualityShortcut.Text = "F10" - betterQualityShortcut.Position = UDim2.new(0, 394, 0, 288) - betterQualityShortcut.Parent = gameSettingsMenuFrame - betterQualityShortcut.Visible = not inStudioMode + local betterQualityShortcut = Hydrate(fullscreenShortcut:clone()) { + Name = "BetterQualityShortcut", + Text = "F10", + Position = UDim2.new(0, 394, 0, 288), + Parent = gameSettingsMenuFrame, + Visible = not inStudioMode, + } - local autoGraphicsButton = createTextButton( - "X", - Enum.ButtonStyle.RobloxButton, - Enum.FontSize.Size18, - UDim2.new(0, 25, 0, 25), - UDim2.new(0, 187, 0, 239) - ) - autoGraphicsButton.Name = "AutoGraphicsButton" - autoGraphicsButton.ZIndex = baseZIndex + 4 - autoGraphicsButton.Parent = gameSettingsMenuFrame - autoGraphicsButton.Visible = not inStudioMode + local autoGraphicsButton = Hydrate( + createTextButton( + "X", + Enum.ButtonStyle.RobloxButton, + Enum.FontSize.Size18, + UDim2.new(0, 25, 0, 25), + UDim2.new(0, 187, 0, 239) + ) + ) { + Name = "AutoGraphicsButton", + ZIndex = baseZIndex + 4, + Parent = gameSettingsMenuFrame, + Visible = not inStudioMode, + } local graphicsSlider, graphicsLevel = RbxGui.CreateSlider( GraphicsQualityLevels, @@ -978,21 +1269,21 @@ local function createGameSettingsMenu(baseZIndex, _) graphicsLevel.Value = math.floor((settings().Rendering:GetMaxQualityLevel() - 1) / 2) - local graphicsSetter = Instance.new "TextBox" - graphicsSetter.Name = "GraphicsSetter" - graphicsSetter.BackgroundColor3 = Color3.new(0, 0, 0) - graphicsSetter.BorderColor3 = - Color3.new(128 / 255, 128 / 255, 128 / 255) - graphicsSetter.Size = UDim2.new(0, 50, 0, 25) - graphicsSetter.Position = UDim2.new(0, 450, 0, 269) - graphicsSetter.TextColor3 = Color3.new(1, 1, 1) - graphicsSetter.Font = Enum.Font.Arial - graphicsSetter.FontSize = Enum.FontSize.Size18 - graphicsSetter.Text = "Auto" - graphicsSetter.ZIndex = 1 - graphicsSetter.TextWrap = true - graphicsSetter.Parent = gameSettingsMenuFrame - graphicsSetter.Visible = not inStudioMode + local graphicsSetter = New "TextBox" { + Name = "GraphicsSetter", + BackgroundColor3 = Color3.new(0, 0, 0), + BorderColor3 = Color3.new(128 / 255, 128 / 255, 128 / 255), + Size = UDim2.new(0, 50, 0, 25), + Position = UDim2.new(0, 450, 0, 269), + TextColor3 = Color3.new(1, 1, 1), + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Text = "Auto", + ZIndex = 1, + TextWrap = true, + Parent = gameSettingsMenuFrame, + Visible = not inStudioMode, + } local isAutoGraphics = true if not inStudioMode then @@ -1413,18 +1704,19 @@ local function createGameSettingsMenu(baseZIndex, _) syncVideoCaptureSetting = nil if not macClient then - local videoCaptureLabel = Instance.new "TextLabel" - videoCaptureLabel.Name = "VideoCaptureLabel" - videoCaptureLabel.Text = "After Capturing Video" - videoCaptureLabel.Font = Enum.Font.Arial - videoCaptureLabel.FontSize = Enum.FontSize.Size18 - videoCaptureLabel.Position = UDim2.new(0, 32, 0, 100) - videoCaptureLabel.Size = UDim2.new(0, 164, 0, 18) - videoCaptureLabel.BackgroundTransparency = 1 - videoCaptureLabel.TextColor3 = Color3I(255, 255, 255) - videoCaptureLabel.TextXAlignment = Enum.TextXAlignment.Left - videoCaptureLabel.ZIndex = baseZIndex + 4 - videoCaptureLabel.Parent = gameSettingsMenuFrame + New "TextLabel" { + Name = "VideoCaptureLabel", + Text = "After Capturing Video", + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0, 32, 0, 100), + Size = UDim2.new(0, 164, 0, 18), + BackgroundTransparency = 1, + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + ZIndex = baseZIndex + 4, + Parent = gameSettingsMenuFrame, + } local videoNames = {} local videoNameToItem = {} @@ -1441,6 +1733,7 @@ local function createGameSettingsMenu(baseZIndex, _) videoNameToItem[text] end ) + videoCaptureDropDown.Name = "VideoCaptureField" videoCaptureDropDown.ZIndex = baseZIndex + 4 videoCaptureDropDown.DropDownMenuButton.ZIndex = baseZIndex + 4 @@ -1468,20 +1761,21 @@ local function createGameSettingsMenu(baseZIndex, _) end end - local cameraLabel = Instance.new "TextLabel" - cameraLabel.Name = "CameraLabel" - cameraLabel.Text = "Character & Camera Controls" - cameraLabel.Font = Enum.Font.Arial - cameraLabel.FontSize = Enum.FontSize.Size18 - cameraLabel.Position = UDim2.new(0, 31, 0, 58) - cameraLabel.Size = UDim2.new(0, 224, 0, 18) - cameraLabel.TextColor3 = Color3I(255, 255, 255) - cameraLabel.TextXAlignment = Enum.TextXAlignment.Left - cameraLabel.BackgroundTransparency = 1 - cameraLabel.ZIndex = baseZIndex + 4 - cameraLabel.Parent = gameSettingsMenuFrame + New "TextLabel" { + Name = "CameraLabel", + Text = "Character & Camera Controls", + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0, 31, 0, 58), + Size = UDim2.new(0, 224, 0, 18), + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + BackgroundTransparency = 1, + ZIndex = baseZIndex + 4, + Parent = gameSettingsMenuFrame, + } - local mouseLockLabel = + mouseLockLabel = game.CoreGui.RobloxGui:FindFirstChild("MouseLockLabel", true) local enumItems = Enum.ControlMode:GetEnumItems() @@ -1522,839 +1816,852 @@ local function createGameSettingsMenu(baseZIndex, _) return gameSettingsMenuFrame end -if LoadLibrary then - RbxGui = LoadLibrary "RbxGui" - local baseZIndex = 0 - if UserSettings then - local createSettingsDialog = function() - waitForChild(gui, "BottomLeftControl") - settingsButton = - gui.BottomLeftControl:FindFirstChild "SettingsButton" +-- if not LoadLibrary then +-- return +-- end - if settingsButton == nil then - settingsButton = Instance.new "ImageButton" - settingsButton.Name = "SettingsButton" - settingsButton.Image = - "rbxasset://textures/ui/SettingsButton.png" - settingsButton.BackgroundTransparency = 1 - settingsButton.Active = false - settingsButton.Size = UDim2.new(0, 54, 0, 46) - settingsButton.Position = UDim2.new(0, 2, 0, 50) - settingsButton.Parent = gui.BottomLeftControl - end +RbxGui = LoadLibrary "RbxGui" - local shield = Instance.new "TextButton" - shield.Text = "" - shield.Name = "UserSettingsShield" - shield.Active = true - shield.AutoButtonColor = false - shield.Visible = false - shield.Size = UDim2.new(1, 0, 1, 0) - shield.BackgroundColor3 = Color3I(51, 51, 51) - shield.BorderColor3 = Color3I(27, 42, 53) - shield.BackgroundTransparency = 0.4 - shield.ZIndex = baseZIndex + 2 - mainShield = shield +local baseZIndex = 0 +if UserSettings then + local createSettingsDialog = function() + waitForChild(gui, "BottomLeftControl") + settingsButton = gui.BottomLeftControl:FindFirstChild "SettingsButton" - local frame = Instance.new "Frame" - frame.Name = "Settings" - frame.Position = UDim2.new(0.5, -262, -0.5, -200) - frame.Size = UDim2.new(0, 525, 0, 430) - frame.BackgroundTransparency = 1 - frame.Active = true - frame.Parent = shield + if settingsButton == nil then + settingsButton = New "ImageButton" { + Name = "SettingsButton", + Image = "rbxasset://textures/ui/SettingsButton.png", + BackgroundTransparency = 1, + Active = false, + Size = UDim2.new(0, 54, 0, 46), + Position = UDim2.new(0, 2, 0, 50), + Parent = gui.BottomLeftControl, + } + end - local settingsFrame = Instance.new "Frame" - settingsFrame.Name = "SettingsStyle" - settingsFrame.Size = UDim2.new(1, 0, 1, 0) - settingsFrame.Style = Enum.FrameStyle.RobloxRound - settingsFrame.Active = true - settingsFrame.ZIndex = baseZIndex + 3 - settingsFrame.Parent = frame + local shield = New "TextButton" { + Text = "", + Name = "UserSettingsShield", + Active = true, + AutoButtonColor = false, + Visible = false, + Size = UDim2.new(1, 0, 1, 0), + BackgroundColor3 = Color3I(51, 51, 51), + BorderColor3 = Color3I(27, 42, 53), + BackgroundTransparency = 0.4, + ZIndex = baseZIndex + 2, + } - local gameMainMenu = createGameMainMenu(baseZIndex, shield) - gameMainMenu.Parent = settingsFrame + mainShield = shield - gameMainMenu.ScreenshotButton.MouseButton1Click:connect(function() - backToGame( - gameMainMenu.ScreenshotButton, - shield, - settingsButton - ) - end) + local frame = New "Frame" { + Name = "Settings", + Position = UDim2.new(0.5, -262, -0.5, -200), + Size = UDim2.new(0, 525, 0, 430), + BackgroundTransparency = 1, + Active = true, + Parent = shield, + } - gameMainMenu.RecordVideoButton.MouseButton1Click:connect(function() - recordVideoClick( - gameMainMenu.RecordVideoButton, - gui.StopRecordButton - ) - backToGame( - gameMainMenu.RecordVideoButton, - shield, - settingsButton - ) - end) + settingsFrame = New "Frame" { + Name = "SettingsStyle", + Size = UDim2.new(1, 0, 1, 0), + Style = Enum.FrameStyle.RobloxRound, + Active = true, + ZIndex = baseZIndex + 3, + Parent = frame, + } - if settings():FindFirstChild "Game Options" then - pcall(function() - settings() - :FindFirstChild("Game Options").VideoRecordingChangeRequest - :connect(function(recording) - recordingVideo = recording - setRecordGui( - recording, - gui.StopRecordButton, - gameMainMenu.RecordVideoButton - ) - end) - end) - end + local gameMainMenu = createGameMainMenu(baseZIndex, shield) + gameMainMenu.Parent = settingsFrame - game.CoreGui.RobloxGui.Changed:connect( - function(prop) -- We have stopped recording when we resize - if prop == "AbsoluteSize" and recordingVideo then - recordVideoClick( - gameMainMenu.RecordVideoButton, - gui.StopRecordButton - ) - end - end + gameMainMenu.ScreenshotButton.MouseButton1Click:connect(function() + backToGame(gameMainMenu.ScreenshotButton, shield, settingsButton) + end) + + gameMainMenu.RecordVideoButton.MouseButton1Click:connect(function() + recordVideoClick( + gameMainMenu.RecordVideoButton, + gui.StopRecordButton ) + backToGame(gameMainMenu.RecordVideoButton, shield, settingsButton) + end) - local function localPlayerChange() - gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer - if game.Players.LocalPlayer then - settings().Rendering.EnableFRM = true - elseif inStudioMode then - settings().Rendering.EnableFRM = false + if settings():FindFirstChild "Game Options" then + pcall(function() + settings() + :FindFirstChild("Game Options").VideoRecordingChangeRequest + :connect(function(recording) + recordingVideo = recording + setRecordGui( + recording, + gui.StopRecordButton, + gameMainMenu.RecordVideoButton + ) + end) + end) + end + + game.CoreGui.RobloxGui.Changed:connect( + function(prop) -- We have stopped recording when we resize + if prop == "AbsoluteSize" and recordingVideo then + recordVideoClick( + gameMainMenu.RecordVideoButton, + gui.StopRecordButton + ) end end + ) + local function localPlayerChange() gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer - if game.Players.LocalPlayer ~= nil then + if game.Players.LocalPlayer then + settings().Rendering.EnableFRM = true + elseif inStudioMode then + settings().Rendering.EnableFRM = false + end + end + + gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer + if game.Players.LocalPlayer ~= nil then + game.Players.LocalPlayer.Changed:connect(function() + localPlayerChange() + end) + else + delay(0, function() + waitForProperty(game.Players, "LocalPlayer") + gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer game.Players.LocalPlayer.Changed:connect(function() localPlayerChange() end) - else - delay(0, function() - waitForProperty(game.Players, "LocalPlayer") - gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer - game.Players.LocalPlayer.Changed:connect(function() - localPlayerChange() - end) - end) - end - - gameMainMenu.ReportAbuseButton.Visible = - game:FindFirstChild "NetworkClient" - if not gameMainMenu.ReportAbuseButton.Visible then - game.ChildAdded:connect(function(child) - if child:IsA "NetworkClient" then - gameMainMenu.ReportAbuseButton.Visible = - game:FindFirstChild "NetworkClient" - end - end) - end - - gameMainMenu.ResetButton.MouseButton1Click:connect(function() - goToMenu( - settingsFrame, - "ResetConfirmationMenu", - "up", - UDim2.new(0, 525, 0, 370) - ) end) + end - gameMainMenu.LeaveGameButton.MouseButton1Click:connect(function() - goToMenu( - settingsFrame, - "LeaveConfirmationMenu", - "down", - UDim2.new(0, 525, 0, 300) - ) + gameMainMenu.ReportAbuseButton.Visible = + game:FindFirstChild "NetworkClient" + if not gameMainMenu.ReportAbuseButton.Visible then + game.ChildAdded:connect(function(child) + if child:IsA "NetworkClient" then + gameMainMenu.ReportAbuseButton.Visible = + game:FindFirstChild "NetworkClient" + end end) + end - if game.CoreGui.Version >= 4 then -- we can use escape! - game:GetService("GuiService").EscapeKeyPressed:connect( - function() - if currentMenuSelection == nil then - game.GuiService:AddCenterDialog( - shield, - Enum.CenterDialogType.ModalDialog, - --showFunction - function() - settingsButton.Active = false - updateCameraDropDownSelection( - UserSettings().GameSettings.ControlMode.Name - ) + gameMainMenu.ResetButton.MouseButton1Click:connect(function() + goToMenu( + settingsFrame, + "ResetConfirmationMenu", + "up", + UDim2.new(0, 525, 0, 370) + ) + end) - if syncVideoCaptureSetting then - syncVideoCaptureSetting() - end + gameMainMenu.LeaveGameButton.MouseButton1Click:connect(function() + goToMenu( + settingsFrame, + "LeaveConfirmationMenu", + "down", + UDim2.new(0, 525, 0, 300) + ) + end) - goToMenu( - settingsFrame, - "GameMainMenu", - "right", - UDim2.new(0, 525, 0, 430) - ) - shield.Visible = true - shield.Active = true - settingsFrame.Parent:TweenPosition( - UDim2.new(0.5, -262, 0.5, -200), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - settingsFrame.Parent:TweenSize( - UDim2.new(0, 525, 0, 430), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - end, - --hideFunction - function() - settingsFrame.Parent:TweenPosition( - UDim2.new(0.5, -262, -0.5, -200), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - settingsFrame.Parent:TweenSize( - UDim2.new(0, 525, 0, 430), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - shield.Visible = false - settingsButton.Active = true - end + if game.CoreGui.Version >= 4 then -- we can use escape! + game:GetService("GuiService").EscapeKeyPressed:connect(function() + if currentMenuSelection == nil then + game.GuiService:AddCenterDialog( + shield, + Enum.CenterDialogType.ModalDialog, + --showFunction + function() + settingsButton.Active = false + updateCameraDropDownSelection( + UserSettings().GameSettings.ControlMode.Name ) - elseif #lastMenuSelection > 0 then - if #centerDialogs > 0 then - for i = 1, #centerDialogs do - game.GuiService:RemoveCenterDialog( - centerDialogs[i] - ) - centerDialogs[i].Visible = false - end - centerDialogs = {} + + if syncVideoCaptureSetting then + syncVideoCaptureSetting() end goToMenu( - lastMenuSelection[#lastMenuSelection]["container"], - lastMenuSelection[#lastMenuSelection]["name"], - lastMenuSelection[#lastMenuSelection]["direction"], - lastMenuSelection[#lastMenuSelection]["lastSize"] + settingsFrame, + "GameMainMenu", + "right", + UDim2.new(0, 525, 0, 430) ) - - table.remove(lastMenuSelection, #lastMenuSelection) - if #lastMenuSelection == 1 then -- apparently lua can't reduce count to 0... T_T - lastMenuSelection = {} - end - else - resumeGameFunction(shield) + shield.Visible = true + shield.Active = true + settingsFrame.Parent:TweenPosition( + UDim2.new(0.5, -262, 0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + end, + --hideFunction + function() + settingsFrame.Parent:TweenPosition( + UDim2.new(0.5, -262, -0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + shield.Visible = false + settingsButton.Active = true end - end - ) - end - - local gameSettingsMenu = createGameSettingsMenu(baseZIndex, shield) - gameSettingsMenu.Visible = false - gameSettingsMenu.Parent = settingsFrame - - gameMainMenu.SettingsButton.MouseButton1Click:connect(function() - goToMenu( - settingsFrame, - "GameSettingsMenu", - "left", - UDim2.new(0, 525, 0, 350) - ) - end) - - gameSettingsMenu.BackButton.MouseButton1Click:connect(function() - goToMenu( - settingsFrame, - "GameMainMenu", - "right", - UDim2.new(0, 525, 0, 430) - ) - end) - - local resetConfirmationWindow = - createResetConfirmationMenu(baseZIndex, shield) - resetConfirmationWindow.Visible = false - resetConfirmationWindow.Parent = settingsFrame - - local leaveConfirmationWindow = - createLeaveConfirmationMenu(baseZIndex, shield) - leaveConfirmationWindow.Visible = false - leaveConfirmationWindow.Parent = settingsFrame - - robloxLock(shield) - - settingsButton.MouseButton1Click:connect(function() - game.GuiService:AddCenterDialog( - shield, - Enum.CenterDialogType.ModalDialog, - --showFunction - function() - settingsButton.Active = false - updateCameraDropDownSelection( - UserSettings().GameSettings.ControlMode.Name - ) - - if syncVideoCaptureSetting then - syncVideoCaptureSetting() + ) + elseif #lastMenuSelection > 0 then + if #centerDialogs > 0 then + for i = 1, #centerDialogs do + game.GuiService:RemoveCenterDialog(centerDialogs[i]) + centerDialogs[i].Visible = false end - - goToMenu( - settingsFrame, - "GameMainMenu", - "right", - UDim2.new(0, 525, 0, 430) - ) - shield.Visible = true - settingsFrame.Parent:TweenPosition( - UDim2.new(0.5, -262, 0.5, -200), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - settingsFrame.Parent:TweenSize( - UDim2.new(0, 525, 0, 430), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - end, - --hideFunction - function() - settingsFrame.Parent:TweenPosition( - UDim2.new(0.5, -262, -0.5, -200), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - settingsFrame.Parent:TweenSize( - UDim2.new(0, 525, 0, 430), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - shield.Visible = false - settingsButton.Active = true + centerDialogs = {} end - ) - end) - return shield + goToMenu( + lastMenuSelection[#lastMenuSelection]["container"], + lastMenuSelection[#lastMenuSelection]["name"], + lastMenuSelection[#lastMenuSelection]["direction"], + lastMenuSelection[#lastMenuSelection]["lastSize"] + ) + + table.remove(lastMenuSelection, #lastMenuSelection) + if #lastMenuSelection == 1 then -- apparently lua can't reduce count to 0... T_T + lastMenuSelection = {} + end + else + resumeGameFunction(shield) + end + end) end - delay(0, function() - createSettingsDialog().Parent = gui + local gameSettingsMenu = createGameSettingsMenu(baseZIndex, shield) + gameSettingsMenu.Visible = false + gameSettingsMenu.Parent = settingsFrame - gui.BottomLeftControl.SettingsButton.Active = true - gui.BottomLeftControl.SettingsButton.Position = - UDim2.new(0, 2, 0, -2) + gameMainMenu.SettingsButton.MouseButton1Click:connect(function() + goToMenu( + settingsFrame, + "GameSettingsMenu", + "left", + UDim2.new(0, 525, 0, 350) + ) + end) - if - mouseLockLabel - and UserSettings().GameSettings.ControlMode - == Enum.ControlMode["Mouse Lock Switch"] - then - mouseLockLabel.Visible = true - elseif mouseLockLabel then - mouseLockLabel.Visible = false - end + gameSettingsMenu.BackButton.MouseButton1Click:connect(function() + goToMenu( + settingsFrame, + "GameMainMenu", + "right", + UDim2.new(0, 525, 0, 430) + ) + end) - -- our script has loaded, get rid of older buttons now - local leaveGameButton = gui.BottomLeftControl:FindFirstChild "Exit" + local resetConfirmationWindow = + createResetConfirmationMenu(baseZIndex, shield) + resetConfirmationWindow.Visible = false + resetConfirmationWindow.Parent = settingsFrame + + local leaveConfirmationWindow = + createLeaveConfirmationMenu(baseZIndex, shield) + leaveConfirmationWindow.Visible = false + leaveConfirmationWindow.Parent = settingsFrame + + robloxLock(shield) + + settingsButton.MouseButton1Click:connect(function() + game.GuiService:AddCenterDialog( + shield, + Enum.CenterDialogType.ModalDialog, + --showFunction + function() + settingsButton.Active = false + updateCameraDropDownSelection( + UserSettings().GameSettings.ControlMode.Name + ) + + if syncVideoCaptureSetting then + syncVideoCaptureSetting() + end + + goToMenu( + settingsFrame, + "GameMainMenu", + "right", + UDim2.new(0, 525, 0, 430) + ) + shield.Visible = true + settingsFrame.Parent:TweenPosition( + UDim2.new(0.5, -262, 0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + end, + --hideFunction + function() + settingsFrame.Parent:TweenPosition( + UDim2.new(0.5, -262, -0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + shield.Visible = false + settingsButton.Active = true + end + ) + end) + + return shield + end + + delay(0, function() + createSettingsDialog().Parent = gui + + gui.BottomLeftControl.SettingsButton.Active = true + gui.BottomLeftControl.SettingsButton.Position = UDim2.new(0, 2, 0, -2) + + if + mouseLockLabel + and UserSettings().GameSettings.ControlMode + == Enum.ControlMode["Mouse Lock Switch"] + then + mouseLockLabel.Visible = true + elseif mouseLockLabel then + mouseLockLabel.Visible = false + end + + -- our script has loaded, get rid of older buttons now + local leaveGameButton = gui.BottomLeftControl:FindFirstChild "Exit" + if leaveGameButton then + leaveGameButton:Remove() + end + + local topLeft = gui:FindFirstChild "TopLeftControl" + if topLeft then + leaveGameButton = topLeft:FindFirstChild "Exit" if leaveGameButton then leaveGameButton:Remove() end - local topLeft = gui:FindFirstChild "TopLeftControl" - if topLeft then - leaveGameButton = topLeft:FindFirstChild "Exit" - if leaveGameButton then - leaveGameButton:Remove() - end - - topLeft:Remove() - end - end) - end --UserSettings call - - local createSaveDialogs = function() - local shield = Instance.new "TextButton" - shield.Text = "" - shield.AutoButtonColor = false - shield.Name = "SaveDialogShield" - shield.Active = true - shield.Visible = false - shield.Size = UDim2.new(1, 0, 1, 0) - shield.BackgroundColor3 = Color3I(51, 51, 51) - shield.BorderColor3 = Color3I(27, 42, 53) - shield.BackgroundTransparency = 0.4 - shield.ZIndex = baseZIndex + 1 - - local clearAndResetDialog - local save - local saveLocal - local dontSave - local cancel - - local messageBoxButtons = {} - messageBoxButtons[1] = {} - messageBoxButtons[1].Text = "Save" - messageBoxButtons[1].Style = Enum.ButtonStyle.RobloxButtonDefault - messageBoxButtons[1].Function = function() - save() - end - messageBoxButtons[2] = {} - messageBoxButtons[2].Text = "Cancel" - messageBoxButtons[2].Function = function() - cancel() - end - messageBoxButtons[3] = {} - messageBoxButtons[3].Text = "Don't Save" - messageBoxButtons[3].Function = function() - dontSave() + topLeft:Remove() end + end) +end --UserSettings call - local saveDialogMessageBox = RbxGui.CreateStyledMessageDialog( - "Unsaved Changes", - "Save your changes to Mercury before leaving?", - "Confirm", - messageBoxButtons - ) - saveDialogMessageBox.Visible = true - saveDialogMessageBox.Parent = shield +local createSaveDialogs = function() + local shield = New "TextButton" { + Text = "", + AutoButtonColor = false, + Name = "SaveDialogShield", + Active = true, + Visible = false, + Size = UDim2.new(1, 0, 1, 0), + BackgroundColor3 = Color3I(51, 51, 51), + BorderColor3 = Color3I(27, 42, 53), + BackgroundTransparency = 0.4, + ZIndex = baseZIndex + 1, + } - local errorBoxButtons = {} + local clearAndResetDialog + local save + local saveLocal + local dontSave + local cancel - local buttonOffset = 1 - if game.LocalSaveEnabled then - errorBoxButtons[buttonOffset] = {} - errorBoxButtons[buttonOffset].Text = "Save to Disk" - errorBoxButtons[buttonOffset].Function = function() - saveLocal() - end - buttonOffset += 1 - end + local messageBoxButtons = {} + messageBoxButtons[1] = {} + messageBoxButtons[1].Text = "Save" + messageBoxButtons[1].Style = Enum.ButtonStyle.RobloxButtonDefault + messageBoxButtons[1].Function = function() + save() + end + messageBoxButtons[2] = {} + messageBoxButtons[2].Text = "Cancel" + messageBoxButtons[2].Function = function() + cancel() + end + messageBoxButtons[3] = {} + messageBoxButtons[3].Text = "Don't Save" + messageBoxButtons[3].Function = function() + dontSave() + end + + local saveDialogMessageBox = RbxGui.CreateStyledMessageDialog( + "Unsaved Changes", + "Save your changes to Mercury before leaving?", + "Confirm", + messageBoxButtons + ) + saveDialogMessageBox.Visible = true + saveDialogMessageBox.Parent = shield + + local errorBoxButtons = {} + + local buttonOffset = 1 + if game.LocalSaveEnabled then errorBoxButtons[buttonOffset] = {} - errorBoxButtons[buttonOffset].Text = "Keep Playing" + errorBoxButtons[buttonOffset].Text = "Save to Disk" errorBoxButtons[buttonOffset].Function = function() - cancel() - end - errorBoxButtons[buttonOffset + 1] = {} - errorBoxButtons[buttonOffset + 1].Text = "Don't Save" - errorBoxButtons[buttonOffset + 1].Function = function() - dontSave() + saveLocal() end + buttonOffset += 1 + end + errorBoxButtons[buttonOffset] = {} + errorBoxButtons[buttonOffset].Text = "Keep Playing" + errorBoxButtons[buttonOffset].Function = function() + cancel() + end + errorBoxButtons[buttonOffset + 1] = {} + errorBoxButtons[buttonOffset + 1].Text = "Don't Save" + errorBoxButtons[buttonOffset + 1].Function = function() + dontSave() + end - local errorDialogMessageBox = RbxGui.CreateStyledMessageDialog( - "Upload Failed", - "Sorry, we could not save your changes to Mercury.", - "Error", - errorBoxButtons - ) - errorDialogMessageBox.Visible = false - errorDialogMessageBox.Parent = shield + local errorDialogMessageBox = RbxGui.CreateStyledMessageDialog( + "Upload Failed", + "Sorry, we could not save your changes to Mercury.", + "Error", + errorBoxButtons + ) + errorDialogMessageBox.Visible = false + errorDialogMessageBox.Parent = shield - local spinnerDialog = Instance.new "Frame" - spinnerDialog.Name = "SpinnerDialog" - spinnerDialog.Style = Enum.FrameStyle.RobloxRound - spinnerDialog.Size = UDim2.new(0, 350, 0, 150) - spinnerDialog.Position = UDim2.new(0.5, -175, 0.5, -75) - spinnerDialog.Visible = false - spinnerDialog.Active = true - spinnerDialog.Parent = shield + local spinnerDialog = New "Frame" { + Name = "SpinnerDialog", + Style = Enum.FrameStyle.RobloxRound, + Size = UDim2.new(0, 350, 0, 150), + Position = UDim2.new(0.5, -175, 0.5, -75), + Visible = false, + Active = true, + Parent = shield, - local waitingLabel = Instance.new "TextLabel" - waitingLabel.Name = "WaitingLabel" - waitingLabel.Text = "Saving to Mercury..." - waitingLabel.Font = Enum.Font.ArialBold - waitingLabel.FontSize = Enum.FontSize.Size18 - waitingLabel.Position = UDim2.new(0.5, 25, 0.5, 0) - waitingLabel.TextColor3 = Color3.new(1, 1, 1) - waitingLabel.Parent = spinnerDialog + [Children] = { + New "TextLabel" { + Name = "WaitingLabel", + Text = "Saving to Mercury...", + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.5, 25, 0.5, 0), + TextColor3 = Color3.new(1, 1, 1), + }, + }, + } - local spinnerFrame = Instance.new "Frame" - spinnerFrame.Name = "Spinner" - spinnerFrame.Size = UDim2.new(0, 80, 0, 80) - spinnerFrame.Position = UDim2.new(0.5, -150, 0.5, -40) - spinnerFrame.BackgroundTransparency = 1 - spinnerFrame.Parent = spinnerDialog + local spinnerFrame = New "Frame" { + Name = "Spinner", + Size = UDim2.new(0, 80, 0, 80), + Position = UDim2.new(0.5, -150, 0.5, -40), + BackgroundTransparency = 1, + Parent = spinnerDialog, + } - local spinnerIcons = {} - local spinnerNum = 1 - while spinnerNum <= 8 do - local spinnerImage = Instance.new "ImageLabel" - spinnerImage.Name = "Spinner" .. spinnerNum - spinnerImage.Size = UDim2.new(0, 16, 0, 16) - spinnerImage.Position = UDim2.new( + local spinnerIcons = {} + local spinnerNum = 1 + while spinnerNum <= 8 do + spinnerIcons[spinnerNum] = New "ImageLabel" { + Name = "Spinner" .. spinnerNum, + Size = UDim2.new(0, 16, 0, 16), + Position = UDim2.new( 0.5 + 0.3 * math.cos(math.rad(45 * spinnerNum)), -8, 0.5 + 0.3 * math.sin(math.rad(45 * spinnerNum)), -8 - ) - spinnerImage.BackgroundTransparency = 1 - spinnerImage.Image = "http://banland.xyz/Asset?id=45880710" - spinnerImage.Parent = spinnerFrame - - spinnerIcons[spinnerNum] = spinnerImage - spinnerNum += 1 - end - - save = function() - saveDialogMessageBox.Visible = false - - --Show the spinner dialog - spinnerDialog.Visible = true - local spin = true - --Make it spin - delay(0, function() - local spinPos = 0 - while spin do - local pos = 0 - - while pos < 8 do - if pos == spinPos or pos == ((spinPos + 1) % 8) then - spinnerIcons[pos + 1].Image = - "http://banland.xyz/Asset?id=45880668" - else - spinnerIcons[pos + 1].Image = - "http://banland.xyz/Asset?id=45880710" - end - - pos += 1 - end - spinPos = (spinPos + 1) % 8 - wait(0.2) - end - end) - - --Do the save while the spinner is going, function will wait - local result = game:SaveToRoblox() - if not result then - --Try once more - result = game:SaveToRoblox() - end - - --Hide the spinner dialog - spinnerDialog.Visible = false - --And cause the delay thread to stop - spin = false - - --Now process the result - if result then - --Success, close - game:FinishShutdown(false) - clearAndResetDialog() - else - --Failure, show the second dialog prompt - errorDialogMessageBox.Visible = true - end - end - - saveLocal = function() - errorDialogMessageBox.Visible = false - game:FinishShutdown(true) - clearAndResetDialog() - end - - dontSave = function() - saveDialogMessageBox.Visible = false - errorDialogMessageBox.Visible = false - game:FinishShutdown(false) - clearAndResetDialog() - end - cancel = function() - saveDialogMessageBox.Visible = false - errorDialogMessageBox.Visible = false - clearAndResetDialog() - end - - clearAndResetDialog = function() - saveDialogMessageBox.Visible = true - errorDialogMessageBox.Visible = false - spinnerDialog.Visible = false - shield.Visible = false - game.GuiService:RemoveCenterDialog(shield) - end - - robloxLock(shield) - shield.Visible = false - return shield + ), + BackgroundTransparency = 1, + Image = "http://banland.xyz/Asset?id=45880710", + Parent = spinnerFrame, + } + spinnerNum += 1 end - local createReportAbuseDialog = function() - --Only show things if we are a NetworkClient - waitForChild(game, "NetworkClient") + save = function() + saveDialogMessageBox.Visible = false - waitForChild(game, "Players") - waitForProperty(game.Players, "LocalPlayer") - local localPlayer = game.Players.LocalPlayer + --Show the spinner dialog + spinnerDialog.Visible = true + local spin = true + --Make it spin + delay(0, function() + local spinPos = 0 + while spin do + local pos = 0 - local reportAbuseButton - waitForChild(gui, "UserSettingsShield") - waitForChild(gui.UserSettingsShield, "Settings") - waitForChild(gui.UserSettingsShield.Settings, "SettingsStyle") - waitForChild( - gui.UserSettingsShield.Settings.SettingsStyle, - "GameMainMenu" - ) - waitForChild( - gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, - "ReportAbuseButton" - ) - reportAbuseButton = - gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton + while pos < 8 do + if pos == spinPos or pos == ((spinPos + 1) % 8) then + spinnerIcons[pos + 1].Image = + "http://banland.xyz/Asset?id=45880668" + else + spinnerIcons[pos + 1].Image = + "http://banland.xyz/Asset?id=45880710" + end - local shield = Instance.new "TextButton" - shield.Name = "ReportAbuseShield" - shield.Text = "" - shield.AutoButtonColor = false - shield.Active = true - shield.Visible = false - shield.Size = UDim2.new(1, 0, 1, 0) - shield.BackgroundColor3 = Color3I(51, 51, 51) - shield.BorderColor3 = Color3I(27, 42, 53) - shield.BackgroundTransparency = 0.4 - shield.ZIndex = baseZIndex + 1 + pos += 1 + end + spinPos = (spinPos + 1) % 8 + wait(0.2) + end + end) - local closeAndResetDialog - - local messageBoxButtons = {} - messageBoxButtons[1] = {} - messageBoxButtons[1].Text = "Ok" - messageBoxButtons[1].Modal = true - messageBoxButtons[1].Function = function() - closeAndResetDialog() + --Do the save while the spinner is going, function will wait + local result = game:SaveToRoblox() + if not result then + --Try once more + result = game:SaveToRoblox() end - local calmingMessageBox = RbxGui.CreateMessageDialog( + + --Hide the spinner dialog + spinnerDialog.Visible = false + --And cause the delay thread to stop + spin = false + + --Now process the result + if result then + --Success, close + game:FinishShutdown(false) + clearAndResetDialog() + else + --Failure, show the second dialog prompt + errorDialogMessageBox.Visible = true + end + end + + saveLocal = function() + errorDialogMessageBox.Visible = false + game:FinishShutdown(true) + clearAndResetDialog() + end + + dontSave = function() + saveDialogMessageBox.Visible = false + errorDialogMessageBox.Visible = false + game:FinishShutdown(false) + clearAndResetDialog() + end + cancel = function() + saveDialogMessageBox.Visible = false + errorDialogMessageBox.Visible = false + clearAndResetDialog() + end + + clearAndResetDialog = function() + saveDialogMessageBox.Visible = true + errorDialogMessageBox.Visible = false + spinnerDialog.Visible = false + shield.Visible = false + game.GuiService:RemoveCenterDialog(shield) + end + + robloxLock(shield) + shield.Visible = false + return shield +end + +local createReportAbuseDialog = function() + --Only show things if we are a NetworkClient + waitForChild(game, "NetworkClient") + + waitForChild(game, "Players") + waitForProperty(game.Players, "LocalPlayer") + local localPlayer = game.Players.LocalPlayer + + local reportAbuseButton + waitForChild(gui, "UserSettingsShield") + waitForChild(gui.UserSettingsShield, "Settings") + waitForChild(gui.UserSettingsShield.Settings, "SettingsStyle") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle, "GameMainMenu") + waitForChild( + gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, + "ReportAbuseButton" + ) + reportAbuseButton = + gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton + + local shield = New "TextButton" { + Name = "ReportAbuseShield", + Text = "", + AutoButtonColor = false, + Active = true, + Visible = false, + Size = UDim2.new(1, 0, 1, 0), + BackgroundColor3 = Color3I(51, 51, 51), + BorderColor3 = Color3I(27, 42, 53), + BackgroundTransparency = 0.4, + ZIndex = baseZIndex + 1, + } + + local closeAndResetDialog + + local messageBoxButtons = {} + messageBoxButtons[1] = {} + messageBoxButtons[1].Text = "Ok" + messageBoxButtons[1].Modal = true + messageBoxButtons[1].Function = function() + closeAndResetDialog() + end + + local calmingMessageBox = Hydrate( + RbxGui.CreateMessageDialog( "Thanks for your report!", "Our moderators will review the chat logs and determine what happened. The other user is probably just trying to make you mad.\n\nIf anyone used swear words, inappropriate language, or threatened you in real life, please report them for Bad Words or Threats", messageBoxButtons ) - calmingMessageBox.Visible = false - calmingMessageBox.Parent = shield + ) { + Visible = false, + Parent = shield, + } - local recordedMessageBox = RbxGui.CreateMessageDialog( + local recordedMessageBox = Hydrate( + RbxGui.CreateMessageDialog( "Thanks for your report!", "We've recorded your report for evaluation.", messageBoxButtons ) - recordedMessageBox.Visible = false - recordedMessageBox.Parent = shield + ) { + Visible = false, + Parent = shield, + } - local normalMessageBox = RbxGui.CreateMessageDialog( + local normalMessageBox = Hydrate( + RbxGui.CreateMessageDialog( "Thanks for your report!", "Our moderators will review the chat logs and determine what happened.", messageBoxButtons ) - normalMessageBox.Visible = false - normalMessageBox.Parent = shield + ) { + Visible = false, + Parent = shield, + } - local frame = Instance.new "Frame" - frame.Name = "Settings" - frame.Position = UDim2.new(0.5, -250, 0.5, -200) - frame.Size = UDim2.new(0, 500, 0, 400) - frame.BackgroundTransparency = 1 - frame.Active = true - frame.Parent = shield + local frame = New "Frame" { + Name = "Settings", + Position = UDim2.new(0.5, -250, 0.5, -200), + Size = UDim2.new(0, 500, 0, 400), + BackgroundTransparency = 1, + Active = true, + Parent = shield, + } - local settingsFrame = Instance.new "Frame" - settingsFrame.Name = "ReportAbuseStyle" - settingsFrame.Size = UDim2.new(1, 0, 1, 0) - settingsFrame.Style = Enum.FrameStyle.RobloxRound - settingsFrame.Active = true - settingsFrame.ZIndex = baseZIndex + 1 - settingsFrame.Parent = frame + settingsFrame = New "Frame" { + Name = "ReportAbuseStyle", + Size = UDim2.new(1, 0, 1, 0), + Style = Enum.FrameStyle.RobloxRound, + Active = true, + ZIndex = baseZIndex + 1, + Parent = frame, - local title = Instance.new "TextLabel" - title.Name = "Title" - title.Text = "Report Abuse" - title.TextColor3 = Color3I(221, 221, 221) - title.Position = UDim2.new(0.5, 0, 0, 30) - title.Font = Enum.Font.ArialBold - title.FontSize = Enum.FontSize.Size36 - title.ZIndex = baseZIndex + 2 - title.Parent = settingsFrame + [Children] = { + New "TextLabel" { + Name = "Title", + Text = "Report Abuse", + TextColor3 = Color3I(221, 221, 221), + Position = UDim2.new(0.5, 0, 0, 30), + Font = Enum.Font.ArialBold, + FontSize = Enum.FontSize.Size36, + ZIndex = baseZIndex + 2, + }, - local description = Instance.new "TextLabel" - description.Name = "Description" - description.Text = - "This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action." - description.TextColor3 = Color3I(221, 221, 221) - description.Position = UDim2.new(0, 0, 0, 55) - description.Size = UDim2.new(1, 0, 0, 40) - description.BackgroundTransparency = 1 - description.Font = Enum.Font.Arial - description.FontSize = Enum.FontSize.Size18 - description.TextWrap = true - description.ZIndex = baseZIndex + 2 - description.TextXAlignment = Enum.TextXAlignment.Left - description.TextYAlignment = Enum.TextYAlignment.Top - description.Parent = settingsFrame + New "TextLabel" { + Name = "Description", + Text = "This will send a complete report to a moderator. The moderator will review the chat log and take appropriate action.", + TextColor3 = Color3I(221, 221, 221), + Position = UDim2.new(0, 0, 0, 55), + Size = UDim2.new(1, 0, 0, 40), + BackgroundTransparency = 1, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + TextWrap = true, + ZIndex = baseZIndex + 2, + TextXAlignment = Enum.TextXAlignment.Left, + TextYAlignment = Enum.TextYAlignment.Top, + }, - local playerLabel = Instance.new "TextLabel" - playerLabel.Name = "PlayerLabel" - playerLabel.Text = "Which player?" - playerLabel.BackgroundTransparency = 1 - playerLabel.Font = Enum.Font.Arial - playerLabel.FontSize = Enum.FontSize.Size18 - playerLabel.Position = UDim2.new(0.025, 0, 0, 100) - playerLabel.Size = UDim2.new(0.4, 0, 0, 36) - playerLabel.TextColor3 = Color3I(255, 255, 255) - playerLabel.TextXAlignment = Enum.TextXAlignment.Left - playerLabel.ZIndex = baseZIndex + 2 - playerLabel.Parent = settingsFrame + New "TextLabel" { + Name = "PlayerLabel", + Text = "Which player?", + BackgroundTransparency = 1, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.025, 0, 0, 100), + Size = UDim2.new(0.4, 0, 0, 36), + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + ZIndex = baseZIndex + 2, + }, - local abusingPlayer - local abuse - local submitReportButton + New "TextLabel" { + Name = "AbuseLabel", + Text = "Type of Abuse:", + Font = Enum.Font.Arial, + BackgroundTransparency = 1, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.025, 0, 0, 140), + Size = UDim2.new(0.4, 0, 0, 36), + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + ZIndex = baseZIndex + 2, + }, - local updatePlayerSelection - local createPlayersDropDown = function() - local players = game:GetService "Players" - local playerNames = {} - local nameToPlayer = {} - local children = players:GetChildren() - local pos = 1 - if children then - for _, player in ipairs(children) do - if player:IsA "Player" and player ~= localPlayer then - playerNames[pos] = player.Name - nameToPlayer[player.Name] = player - pos += 1 - end + New "TextLabel" { + Name = "ShortDescriptionLabel", + Text = "Short Description: (optional)", + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.025, 0, 0, 180), + Size = UDim2.new(0.95, 0, 0, 36), + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + BackgroundTransparency = 1, + ZIndex = baseZIndex + 2, + Parent = settingsFrame, + }, + }, + } + + local abusingPlayer + local abuse + local submitReportButton + + local updatePlayerSelection + local function createPlayersDropDown() + local players = game:GetService "Players" + local playerNames = {} + local nameToPlayer = {} + local children = players:GetChildren() + local pos = 1 + if children then + for _, player in ipairs(children) do + if player:IsA "Player" and player ~= localPlayer then + playerNames[pos] = player.Name + nameToPlayer[player.Name] = player + pos += 1 end end - local playerDropDown - playerDropDown, updatePlayerSelection = RbxGui.CreateDropDownMenu( - playerNames, - function(playerName) - abusingPlayer = nameToPlayer[playerName] - if abuse and abusingPlayer then - submitReportButton.Active = true - end - end - ) - playerDropDown.Name = "PlayersComboBox" - playerDropDown.ZIndex = baseZIndex + 2 - playerDropDown.Position = UDim2.new(0.425, 0, 0, 102) - playerDropDown.Size = UDim2.new(0.55, 0, 0, 32) - - return playerDropDown end - - local abuseLabel = Instance.new "TextLabel" - abuseLabel.Name = "AbuseLabel" - abuseLabel.Text = "Type of Abuse:" - abuseLabel.Font = Enum.Font.Arial - abuseLabel.BackgroundTransparency = 1 - abuseLabel.FontSize = Enum.FontSize.Size18 - abuseLabel.Position = UDim2.new(0.025, 0, 0, 140) - abuseLabel.Size = UDim2.new(0.4, 0, 0, 36) - abuseLabel.TextColor3 = Color3I(255, 255, 255) - abuseLabel.TextXAlignment = Enum.TextXAlignment.Left - abuseLabel.ZIndex = baseZIndex + 2 - abuseLabel.Parent = settingsFrame - - local abuses = { - "Swearing", - "Bullying", - "Scamming", - "Dating", - "Cheating/Exploiting", - "Personal Questions", - "Offsite Links", - "Bad Model or Script", - "Bad Username", - } - local abuseDropDown, updateAbuseSelection = RbxGui.CreateDropDownMenu( - abuses, - function(abuseText) - abuse = abuseText + local playerDropDown + playerDropDown, updatePlayerSelection = RbxGui.CreateDropDownMenu( + playerNames, + function(playerName) + abusingPlayer = nameToPlayer[playerName] if abuse and abusingPlayer then submitReportButton.Active = true end - end, - true + end ) - abuseDropDown.Name = "AbuseComboBox" - abuseDropDown.ZIndex = baseZIndex + 2 - abuseDropDown.Position = UDim2.new(0.425, 0, 0, 142) - abuseDropDown.Size = UDim2.new(0.55, 0, 0, 32) - abuseDropDown.Parent = settingsFrame - local shortDescriptionLabel = Instance.new "TextLabel" - shortDescriptionLabel.Name = "ShortDescriptionLabel" - shortDescriptionLabel.Text = "Short Description: (optional)" - shortDescriptionLabel.Font = Enum.Font.Arial - shortDescriptionLabel.FontSize = Enum.FontSize.Size18 - shortDescriptionLabel.Position = UDim2.new(0.025, 0, 0, 180) - shortDescriptionLabel.Size = UDim2.new(0.95, 0, 0, 36) - shortDescriptionLabel.TextColor3 = Color3I(255, 255, 255) - shortDescriptionLabel.TextXAlignment = Enum.TextXAlignment.Left - shortDescriptionLabel.BackgroundTransparency = 1 - shortDescriptionLabel.ZIndex = baseZIndex + 2 - shortDescriptionLabel.Parent = settingsFrame + return Hydrate(playerDropDown) { + Name = "PlayersComboBox", + ZIndex = baseZIndex + 2, + Position = UDim2.new(0.425, 0, 0, 102), + Size = UDim2.new(0.55, 0, 0, 32), + } + end - local shortDescriptionWrapper = Instance.new "Frame" - shortDescriptionWrapper.Name = "ShortDescriptionWrapper" - shortDescriptionWrapper.Position = UDim2.new(0.025, 0, 0, 220) - shortDescriptionWrapper.Size = UDim2.new(0.95, 0, 1, -310) - shortDescriptionWrapper.BackgroundColor3 = Color3I(0, 0, 0) - shortDescriptionWrapper.BorderSizePixel = 0 - shortDescriptionWrapper.ZIndex = baseZIndex + 2 - shortDescriptionWrapper.Parent = settingsFrame + local abuses = { + "Swearing", + "Bullying", + "Scamming", + "Dating", + "Cheating/Exploiting", + "Personal Questions", + "Offsite Links", + "Bad Model or Script", + "Bad Username", + } + local abuseDropDown, updateAbuseSelection = RbxGui.CreateDropDownMenu( + abuses, + function(abuseText) + abuse = abuseText + if abuse and abusingPlayer then + submitReportButton.Active = true + end + end, + true + ) + abuseDropDown.Name = "AbuseComboBox" + abuseDropDown.ZIndex = baseZIndex + 2 + abuseDropDown.Position = UDim2.new(0.425, 0, 0, 142) + abuseDropDown.Size = UDim2.new(0.55, 0, 0, 32) + abuseDropDown.Parent = settingsFrame - local shortDescriptionBox = Instance.new "TextBox" - shortDescriptionBox.Name = "TextBox" - shortDescriptionBox.Text = "" - shortDescriptionBox.ClearTextOnFocus = false - shortDescriptionBox.Font = Enum.Font.Arial - shortDescriptionBox.FontSize = Enum.FontSize.Size18 - shortDescriptionBox.Position = UDim2.new(0, 3, 0, 3) - shortDescriptionBox.Size = UDim2.new(1, -6, 1, -6) - shortDescriptionBox.TextColor3 = Color3I(255, 255, 255) - shortDescriptionBox.TextXAlignment = Enum.TextXAlignment.Left - shortDescriptionBox.TextYAlignment = Enum.TextYAlignment.Top - shortDescriptionBox.TextWrap = true - shortDescriptionBox.BackgroundColor3 = Color3I(0, 0, 0) - shortDescriptionBox.BorderSizePixel = 0 - shortDescriptionBox.ZIndex = baseZIndex + 2 - shortDescriptionBox.Parent = shortDescriptionWrapper + local shortDescriptionWrapper = New "Frame" { + Name = "ShortDescriptionWrapper", + Position = UDim2.new(0.025, 0, 0, 220), + Size = UDim2.new(0.95, 0, 1, -310), + BackgroundColor3 = Color3I(0, 0, 0), + BorderSizePixel = 0, + ZIndex = baseZIndex + 2, + Parent = settingsFrame, + } - submitReportButton = Instance.new "TextButton" - submitReportButton.Name = "SubmitReportBtn" - submitReportButton.Active = false - submitReportButton.Modal = true - submitReportButton.Font = Enum.Font.Arial - submitReportButton.FontSize = Enum.FontSize.Size18 - submitReportButton.Position = UDim2.new(0.1, 0, 1, -80) - submitReportButton.Size = UDim2.new(0.35, 0, 0, 50) - submitReportButton.AutoButtonColor = true - submitReportButton.Style = Enum.ButtonStyle.RobloxButtonDefault - submitReportButton.Text = "Submit Report" - submitReportButton.TextColor3 = Color3I(255, 255, 255) - submitReportButton.ZIndex = baseZIndex + 2 - submitReportButton.Parent = settingsFrame + local shortDescriptionBox = New "TextBox" { + Name = "TextBox", + Text = "", + ClearTextOnFocus = false, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0, 3, 0, 3), + Size = UDim2.new(1, -6, 1, -6), + TextColor3 = Color3I(255, 255, 255), + TextXAlignment = Enum.TextXAlignment.Left, + TextYAlignment = Enum.TextYAlignment.Top, + TextWrap = true, + BackgroundColor3 = Color3I(0, 0, 0), + BorderSizePixel = 0, + ZIndex = baseZIndex + 2, + Parent = shortDescriptionWrapper, + } - submitReportButton.MouseButton1Click:connect(function() + submitReportButton = New "TextButton" { + Name = "SubmitReportBtn", + Active = false, + Modal = true, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.1, 0, 1, -80), + Size = UDim2.new(0.35, 0, 0, 50), + AutoButtonColor = true, + Style = Enum.ButtonStyle.RobloxButtonDefault, + Text = "Submit Report", + TextColor3 = Color3I(255, 255, 255), + ZIndex = baseZIndex + 2, + Parent = settingsFrame, + + [OnEvent "MouseButton1Click"] = function() if submitReportButton.Active then if abuse and abusingPlayer then frame.Visible = false @@ -2374,261 +2681,262 @@ if LoadLibrary then closeAndResetDialog() end end - end) + end, + } - local cancelButton = Instance.new "TextButton" - cancelButton.Name = "CancelBtn" - cancelButton.Font = Enum.Font.Arial - cancelButton.FontSize = Enum.FontSize.Size18 - cancelButton.Position = UDim2.new(0.55, 0, 1, -80) - cancelButton.Size = UDim2.new(0.35, 0, 0, 50) - cancelButton.AutoButtonColor = true - cancelButton.Style = Enum.ButtonStyle.RobloxButtonDefault - cancelButton.Text = "Cancel" - cancelButton.TextColor3 = Color3I(255, 255, 255) - cancelButton.ZIndex = baseZIndex + 2 - cancelButton.Parent = settingsFrame + local cancelButton = New "TextButton" { + Name = "CancelBtn", + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size18, + Position = UDim2.new(0.55, 0, 1, -80), + Size = UDim2.new(0.35, 0, 0, 50), + AutoButtonColor = true, + Style = Enum.ButtonStyle.RobloxButtonDefault, + Text = "Cancel", + TextColor3 = Color3I(255, 255, 255), + ZIndex = baseZIndex + 2, + Parent = settingsFrame, + } - closeAndResetDialog = function() - --Delete old player combo box - local oldComboBox = settingsFrame:FindFirstChild "PlayersComboBox" - if oldComboBox then - oldComboBox.Parent = nil - end - - abusingPlayer = nil - updatePlayerSelection(nil) - abuse = nil - updateAbuseSelection(nil) - submitReportButton.Active = false - shortDescriptionBox.Text = "" - frame.Visible = true - calmingMessageBox.Visible = false - recordedMessageBox.Visible = false - normalMessageBox.Visible = false - shield.Visible = false - reportAbuseButton.Active = true - game.GuiService:RemoveCenterDialog(shield) + closeAndResetDialog = function() + --Delete old player combo box + local oldComboBox = settingsFrame:FindFirstChild "PlayersComboBox" + if oldComboBox then + oldComboBox.Parent = nil end - cancelButton.MouseButton1Click:connect(closeAndResetDialog) + abusingPlayer = nil + updatePlayerSelection(nil) + abuse = nil + updateAbuseSelection(nil) + submitReportButton.Active = false + shortDescriptionBox.Text = "" + frame.Visible = true + calmingMessageBox.Visible = false + recordedMessageBox.Visible = false + normalMessageBox.Visible = false + shield.Visible = false + reportAbuseButton.Active = true + game.GuiService:RemoveCenterDialog(shield) + end - reportAbuseButton.MouseButton1Click:connect(function() - createPlayersDropDown().Parent = settingsFrame - table.insert(centerDialogs, shield) + cancelButton.MouseButton1Click:connect(closeAndResetDialog) + + reportAbuseButton.MouseButton1Click:connect(function() + createPlayersDropDown().Parent = settingsFrame + table.insert(centerDialogs, shield) + game.GuiService:AddCenterDialog( + shield, + Enum.CenterDialogType.ModalDialog, + --ShowFunction + function() + reportAbuseButton.Active = false + shield.Visible = true + mainShield.Visible = false + end, + --HideFunction + function() + reportAbuseButton.Active = true + shield.Visible = false + end + ) + end) + + robloxLock(shield) + return shield +end + +--[=[ +local createChatBar = function() + --Only show a chat bar if we are a NetworkClient + waitForChild(game, "NetworkClient") + + waitForChild(game, "Players") + waitForProperty(game.Players, "LocalPlayer") + + local chatBar = New "Frame" { + Name = "ChatBar", + Size = UDim2.new(1, 0, 0, 22), + Position = UDim2.new(0, 0, 1, 0), + BackgroundColor3 = Color3.new(0, 0, 0), + BorderSizePixel = 0, + } + + local chatBox = New "TextBox" { + Text = "", + Visible = false, + Size = UDim2.new(1, -4, 1, 0), + Position = UDim2.new(0, 2, 0, 0), + TextXAlignment = Enum.TextXAlignment.Left, + Font = Enum.Font.Arial, + ClearTextOnFocus = false, + FontSize = Enum.FontSize.Size14, + TextColor3 = Color3.new(1, 1, 1), + BackgroundTransparency = 1, + Parent = chatBar, + } + + local chatButton = New "TextButton" { + Size = UDim2.new(1, -4, 1, 0), + Position = UDim2.new(0, 2, 0, 0), + AutoButtonColor = false, + Text = 'To chat click here or press "/" key', + TextXAlignment = Enum.TextXAlignment.Left, + Font = Enum.Font.Arial, + FontSize = Enum.FontSize.Size14, + TextColor3 = Color3.new(1, 1, 1), + BackgroundTransparency = 1, + Parent = chatBar, + } + + local activateChat = function() + if chatBox.Visible then + return + end + chatButton.Visible = false + chatBox.Text = "" + chatBox.Visible = true + chatBox:CaptureFocus() + end + + chatButton.MouseButton1Click:connect(activateChat) + + -- local hotKeyEnabled = true + local toggleHotKey = function(_) + -- hotKeyEnabled = value + end + + -- local guiService = game:GetService "GuiService" + --[[local newChatMode = ]] + pcall(function() + --guiService:AddSpecialKey(Enum.SpecialKey.ChatHotkey) + --guiService.SpecialKeyPressed:connect(function(key) if key == Enum.SpecialKey.ChatHotkey and hotKeyEnabled then activateChat() end end) + end) + -- if not newChatMode then + --guiService:AddKey("/") + --guiService.KeyPressed:connect(function(key) if key == "/" and hotKeyEnabled then activateChat() end end) + -- end + + chatBox.FocusLost:connect(function(enterPressed) + if enterPressed then + if chatBox.Text ~= "" then + local str = chatBox.Text + if string.sub(str, 1, 1) == "%" then + game.Players:TeamChat(string.sub(str, 2)) + else + game.Players:Chat(str) + end + end + end + chatBox.Text = "" + chatBox.Visible = false + chatButton.Visible = true + end) + robloxLock(chatBar) + return chatBar, toggleHotKey +end +]=] + +--Spawn a thread for the Save dialogs +local isSaveDialogSupported = pcall(function() + -- local var = game.LocalSaveEnabled +end) +if isSaveDialogSupported then + delay(0, function() + local saveDialogs = createSaveDialogs() + saveDialogs.Parent = gui + + game.RequestShutdown = function() + table.insert(centerDialogs, saveDialogs) game.GuiService:AddCenterDialog( - shield, - Enum.CenterDialogType.ModalDialog, + saveDialogs, + Enum.CenterDialogType.QuitDialog, --ShowFunction function() - reportAbuseButton.Active = false - shield.Visible = true - mainShield.Visible = false + saveDialogs.Visible = true end, --HideFunction function() - reportAbuseButton.Active = true - shield.Visible = false + saveDialogs.Visible = false end ) - end) - robloxLock(shield) - return shield - end - - -- local createChatBar = function() - -- --Only show a chat bar if we are a NetworkClient - -- waitForChild(game, "NetworkClient") - - -- waitForChild(game, "Players") - -- waitForProperty(game.Players, "LocalPlayer") - - -- local chatBar = Instance.new "Frame" - -- chatBar.Name = "ChatBar" - -- chatBar.Size = UDim2.new(1, 0, 0, 22) - -- chatBar.Position = UDim2.new(0, 0, 1, 0) - -- chatBar.BackgroundColor3 = Color3.new(0, 0, 0) - -- chatBar.BorderSizePixel = 0 - - -- local chatBox = Instance.new "TextBox" - -- chatBox.Text = "" - -- chatBox.Visible = false - -- chatBox.Size = UDim2.new(1, -4, 1, 0) - -- chatBox.Position = UDim2.new(0, 2, 0, 0) - -- chatBox.TextXAlignment = Enum.TextXAlignment.Left - -- chatBox.Font = Enum.Font.Arial - -- chatBox.ClearTextOnFocus = false - -- chatBox.FontSize = Enum.FontSize.Size14 - -- chatBox.TextColor3 = Color3.new(1, 1, 1) - -- chatBox.BackgroundTransparency = 1 - -- --chatBox.Parent = chatBar - - -- local chatButton = Instance.new "TextButton" - -- chatButton.Size = UDim2.new(1, -4, 1, 0) - -- chatButton.Position = UDim2.new(0, 2, 0, 0) - -- chatButton.AutoButtonColor = false - -- chatButton.Text = 'To chat click here or press "/" key' - -- chatButton.TextXAlignment = Enum.TextXAlignment.Left - -- chatButton.Font = Enum.Font.Arial - -- chatButton.FontSize = Enum.FontSize.Size14 - -- chatButton.TextColor3 = Color3.new(1, 1, 1) - -- chatButton.BackgroundTransparency = 1 - -- --chatButton.Parent = chatBar - - -- local activateChat = function() - -- if chatBox.Visible then - -- return - -- end - -- chatButton.Visible = false - -- chatBox.Text = "" - -- chatBox.Visible = true - -- chatBox:CaptureFocus() - -- end - - -- chatButton.MouseButton1Click:connect(activateChat) - - -- -- local hotKeyEnabled = true - -- local toggleHotKey = function(_) - -- -- hotKeyEnabled = value - -- end - - -- -- local guiService = game:GetService "GuiService" - -- --[[local newChatMode = ]]pcall(function() - -- --guiService:AddSpecialKey(Enum.SpecialKey.ChatHotkey) - -- --guiService.SpecialKeyPressed:connect(function(key) if key == Enum.SpecialKey.ChatHotkey and hotKeyEnabled then activateChat() end end) - -- end) - -- -- if not newChatMode then - -- --guiService:AddKey("/") - -- --guiService.KeyPressed:connect(function(key) if key == "/" and hotKeyEnabled then activateChat() end end) - -- -- end - - -- chatBox.FocusLost:connect(function(enterPressed) - -- if enterPressed then - -- if chatBox.Text ~= "" then - -- local str = chatBox.Text - -- if string.sub(str, 1, 1) == "%" then - -- game.Players:TeamChat(string.sub(str, 2)) - -- else - -- game.Players:Chat(str) - -- end - -- end - -- end - -- chatBox.Text = "" - -- chatBox.Visible = false - -- chatButton.Visible = true - -- end) - -- robloxLock(chatBar) - -- return chatBar, toggleHotKey - -- end - - --Spawn a thread for the Save dialogs - local isSaveDialogSupported = pcall(function() - -- local var = game.LocalSaveEnabled - end) - if isSaveDialogSupported then - delay(0, function() - local saveDialogs = createSaveDialogs() - saveDialogs.Parent = gui - - game.RequestShutdown = function() - table.insert(centerDialogs, saveDialogs) - game.GuiService:AddCenterDialog( - saveDialogs, - Enum.CenterDialogType.QuitDialog, - --ShowFunction - function() - saveDialogs.Visible = true - end, - --HideFunction - function() - saveDialogs.Visible = false - end - ) - - return true - end - end) - end - - --Spawn a thread for the Report Abuse dialogs - delay(0, function() - createReportAbuseDialog().Parent = gui - waitForChild(gui, "UserSettingsShield") - waitForChild(gui.UserSettingsShield, "Settings") - waitForChild(gui.UserSettingsShield.Settings, "SettingsStyle") - waitForChild( - gui.UserSettingsShield.Settings.SettingsStyle, - "GameMainMenu" - ) - waitForChild( - gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, - "ReportAbuseButton" - ) - gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton.Active = - true - end) - - --Spawn a thread for Chat Bar - --[[local success, luaChat = ]] - pcall(function() - return game.GuiService.UseLuaChat - end) - -- if success and luaChat then - - --[[delay(0, - function() - waitForChild(game, "Players") - waitForProperty(game.Players, "LocalPlayer") - - local advancedChatBarSupported = game.Players.LocalPlayer.ChatMode - local chatBar, toggleHotKey = createChatBar() - - [if advancedChatBarSupported then - local function toggleChatBar(chatMode) - if chatMode == Enum.ChatMode.Menu then - chatBar.Parent = nil - game.GuiService:SetGlobalSizeOffsetPixel(0,0) - toggleHotKey(false) - elseif chatMode == Enum.ChatMode.TextAndMenu then - --chatBar.Parent = gui - --game.GuiService:SetGlobalSizeOffsetPixel(0,-22) - toggleHotKey(true) - end - end - game.Players.LocalPlayer.Changed:connect( - function(prop) - if prop == "ChatMode" then - toggleChatBar(game.Players.LocalPlayer.ChatMode) - end - end) - toggleChatBar(game.Players.LocalPlayer.ChatMode) - else - --chatBar.Parent = gui - --game.GuiService:SetGlobalSizeOffsetPixel(0,-22) - end - end)]] - -- end - - local BurningManPlaceID = 41324860 - -- TODO: remove click to walk completely if testing shows we don't need it - -- Removes click to walk option from Burning Man - delay(0, function() - waitForChild(game, "NetworkClient") - waitForChild(game, "Players") - waitForProperty(game.Players, "LocalPlayer") - waitForProperty(game.Players.LocalPlayer, "Character") - waitForChild(game.Players.LocalPlayer.Character, "Humanoid") - waitForProperty(game, "PlaceId") - - if game.PlaceId == BurningManPlaceID then - game.Players.LocalPlayer.Character.Humanoid:SetClickToWalkEnabled( - false - ) - game.Players.LocalPlayer.CharacterAdded:connect(function(character) - waitForChild(character, "Humanoid") - character.Humanoid:SetClickToWalkEnabled(false) - end) + return true end end) -end --LoadLibrary if +end + +--Spawn a thread for the Report Abuse dialogs +delay(0, function() + createReportAbuseDialog().Parent = gui + waitForChild(gui, "UserSettingsShield") + waitForChild(gui.UserSettingsShield, "Settings") + waitForChild(gui.UserSettingsShield.Settings, "SettingsStyle") + waitForChild(gui.UserSettingsShield.Settings.SettingsStyle, "GameMainMenu") + waitForChild( + gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu, + "ReportAbuseButton" + ) + gui.UserSettingsShield.Settings.SettingsStyle.GameMainMenu.ReportAbuseButton.Active = + true +end) + +--Spawn a thread for Chat Bar +-- local success, luaChat = pcall(function() +-- return game.GuiService.UseLuaChat +-- end) + +--[[ +if success and luaChat then + delay(0, function() + waitForChild(game, "Players") + waitForProperty(game.Players, "LocalPlayer") + + local advancedChatBarSupported = game.Players.LocalPlayer.ChatMode + local chatBar, toggleHotKey = createChatBar() + + if advancedChatBarSupported then + local function toggleChatBar(chatMode) + if chatMode == Enum.ChatMode.Menu then + chatBar.Parent = nil + game.GuiService:SetGlobalSizeOffsetPixel(0, 0) + toggleHotKey(false) + elseif chatMode == Enum.ChatMode.TextAndMenu then + --chatBar.Parent = gui + --game.GuiService:SetGlobalSizeOffsetPixel(0,-22) + toggleHotKey(true) + end + end + game.Players.LocalPlayer.Changed:connect(function(prop) + if prop == "ChatMode" then + toggleChatBar(game.Players.LocalPlayer.ChatMode) + end + end) + toggleChatBar(game.Players.LocalPlayer.ChatMode) + else + --chatBar.Parent = gui + --game.GuiService:SetGlobalSizeOffsetPixel(0,-22) + end + end) +end +]] + +local BurningManPlaceID = 41324860 +-- TODO: remove click to walk completely if testing shows we don't need it +-- Removes click to walk option from Burning Man +delay(0, function() + waitForChild(game, "NetworkClient") + waitForChild(game, "Players") + waitForProperty(game.Players, "LocalPlayer") + waitForProperty(game.Players.LocalPlayer, "Character") + waitForChild(game.Players.LocalPlayer.Character, "Humanoid") + waitForProperty(game, "PlaceId") + + if game.PlaceId == BurningManPlaceID then + game.Players.LocalPlayer.Character.Humanoid:SetClickToWalkEnabled(false) + game.Players.LocalPlayer.CharacterAdded:connect(function(character) + waitForChild(character, "Humanoid") + character.Humanoid:SetClickToWalkEnabled(false) + end) + end +end) diff --git a/luau/97188756.luau b/luau/97188756.luau index 5388fb1..486749a 100644 --- a/luau/97188756.luau +++ b/luau/97188756.luau @@ -1533,7 +1533,7 @@ function Chat:CreateChatBar() -- Engine has code to offset the entire world, so if we do it by -20 pixels nothing gets in our chat's way --GuiService:SetGlobalSizeOffsetPixel(0, -20) - local success, error = pcall(function() + local success = pcall(function() GuiService:SetGlobalGuiInset(0, 0, 0, 20) end) if not success then