2013/yue/46295863.yue

2300 lines
70 KiB
Plaintext

import "macros" as { $ }
$load $FILE
waitForChild = (instance, name) ->
until instance\FindFirstChild name
instance.ChildAdded\wait!
waitForProperty = (instance, property) ->
until instance[property]
instance.Changed\wait!
-- A Few Script Globals
gui = if script.Parent\FindFirstChild "ControlFrame"
script.Parent\FindFirstChild "ControlFrame"
else
script.Parent
local helpButton
local updateCameraDropDownSelection
local updateVideoCaptureDropDownSelection
tweenTime = 0.2
mouseLockLookScreenUrl = "http://www.roblox.com/asset?id=54071825"
classicLookScreenUrl = "http://www.roblox.com/Asset?id=45915798"
hasGraphicsSlider = game\GetService"CoreGui".Version >= 5
GraphicsQualityLevels = 10 -- how many levels we allow on graphics slider
recordingVideo = false
local currentMenuSelection
lastMenuSelection = {}
-- defaultPosition = UDim2.new 0, 0, 0, 0
-- newGuiPlaces = { 0, 41324860 }
centerDialogs = {}
local mainShield
inStudioMode = UserSettings!.GameSettings\InStudioMode!
macClient = false
local success, isMac = try
not game.GuiService.IsWindows
macClient = success and isMac
Color3I = (r, g, b) -> Color3.new r / 255, g / 255, b / 255
robloxLock = (instance) ->
instance.RobloxLocked = true
children = instance\GetChildren!
if children
for _, child in ipairs children
robloxLock child
resumeGameFunction = (shield) ->
shield.Settings\TweenPosition(
UDim2.new(0.5, -262, -0.5, -200),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
delay tweenTime, ->
shield.Visible = false
for i = 1, #centerDialogs
centerDialogs[i].Visible = false
game.GuiService\RemoveCenterDialog centerDialogs[i]
game.GuiService\RemoveCenterDialog shield
settingsButton.Active = true
currentMenuSelection = nil
lastMenuSelection = {}
goToMenu = (container, menuName, moveDirection, size, position) ->
return if type(menuName) ~= "string"
table.insert(lastMenuSelection, currentMenuSelection)
if menuName == "GameMainMenu"
lastMenuSelection = {}
containerChildren = container\GetChildren!
for i = 1, #containerChildren
if containerChildren[i].Name == menuName
containerChildren[i].Visible = true
currentMenuSelection =
container: container
name: menuName
direction: moveDirection
lastSize: size
-- selectedMenu = true
if size and position
containerChildren[i]\TweenSizeAndPosition(
size,
position,
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
elseif size
containerChildren[i]\TweenSizeAndPosition(
size,
UDim2.new(0.5, -size.X.Offset / 2, 0.5, -size.Y.Offset / 2),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
else
containerChildren[i]\TweenPosition(
UDim2.new(0, 0, 0, 0),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
else
if moveDirection == "left"
containerChildren[i]\TweenPosition(
UDim2.new(-1, -525, 0, 0),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
elseif moveDirection == "right"
containerChildren[i]\TweenPosition(
UDim2.new(1, 525, 0, 0),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
elseif moveDirection == "up"
containerChildren[i]\TweenPosition(
UDim2.new(0, 0, -1, -400),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
elseif moveDirection == "down"
containerChildren[i]\TweenPosition(
UDim2.new(0, 0, 1, 400),
Enum.EasingDirection.InOut,
Enum.EasingStyle.Sine,
tweenTime,
true
)
delay tweenTime, ->
containerChildren[i].Visible = false
resetLocalCharacter = ->
player = game.Players.LocalPlayer
if player and
player.Character and
player.Character\FindFirstChild "Humanoid"
player.Character.Humanoid.Health = 0
createTextButton = (text, style, fontSize, buttonSize, buttonPosition) ->
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
newTextButton
CreateTextButtons = (frame, buttons, yPos, ySize) ->
if #buttons < 1
error "Must have more than one button"
buttonNum = 1
buttonObjs = {}
toggleSelection = (button) ->
for _, obj in ipairs buttonObjs
if obj == button
obj.Style = Enum.ButtonStyle.RobloxButtonDefault
else
obj.Style = Enum.ButtonStyle.RobloxButton
for _, obj in ipairs buttons
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 ->
toggleSelection button
obj.Function!
button.Parent = frame
buttonObjs[buttonNum] = button
buttonNum += 1
toggleSelection(buttonObjs[1])
numButtons = buttonNum - 1
if numButtons == 1
frame.Button1.Position = UDim2.new 0.35, 0, yPos.Scale, yPos.Offset
frame.Button1.Size = UDim2.new 0.4, 0, ySize.Scale, ySize.Offset
elseif numButtons == 2
frame.Button1.Position = UDim2.new 0.1, 0, yPos.Scale, yPos.Offset
frame.Button1.Size = UDim2.new 0.35, 0, ySize.Scale, ySize.Offset
frame.Button2.Position = UDim2.new 0.55, 0, yPos.Scale, yPos.Offset
frame.Button2.Size = UDim2.new 0.35, 0, ySize.Scale, ySize.Offset
elseif numButtons >= 3
spacing = 0.1 / numButtons
buttonSize = 0.9 / numButtons
buttonNum = 1
while buttonNum <= numButtons
buttonObjs[buttonNum].Position = UDim2.new(
spacing * buttonNum + (buttonNum - 1) * buttonSize, 0,
yPos.Scale, yPos.Offset
)
buttonObjs[buttonNum].Size = UDim2.new buttonSize, 0, ySize.Scale, ySize.Offset
buttonNum += 1
setRecordGui = (recording, stopRecordButton, recordVideoButton) ->
if recording
stopRecordButton.Visible = true
recordVideoButton.Text = "Stop Recording"
else
stopRecordButton.Visible = false
recordVideoButton.Text = "Record Video"
recordVideoClick = (recordVideoButton, stopRecordButton) ->
recordingVideo = not recordingVideo
setRecordGui recordingVideo, stopRecordButton, recordVideoButton
backToGame = (buttonClicked, shield, settingsButton) ->
buttonClicked.Parent.Parent.Parent.Parent.Visible = false
shield.Visible = false
for i = 1, #centerDialogs
game.GuiService\RemoveCenterDialog centerDialogs[i]
centerDialogs[i].Visible = false
centerDialogs = {}
game.GuiService\RemoveCenterDialog shield
settingsButton.Active = true
setDisabledState = (guiObject) ->
return if not guiObject
if guiObject\IsA "TextLabel"
guiObject.TextTransparency = 0.9
elseif guiObject\IsA "TextButton"
guiObject.TextTransparency = 0.9
guiObject.Active = false
else
if guiObject["ClassName"]
print("setDisabledState! got object of unsupported type. object type is ", guiObject.ClassName)
createHelpDialog = (baseZIndex) ->
if helpButton == nil
helpButton= if gui\FindFirstChild "TopLeftControl" and gui.TopLeftControl\FindFirstChild "Help"
gui.TopLeftControl.Help
elseif gui\FindFirstChild "BottomRightControl" and gui.BottomRightControl\FindFirstChild "Help"
gui.BottomRightControl.Help
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
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
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
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
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
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
image = Instance.new "ImageLabel"
image.Name = "Image"
image.Image = if UserSettings!.GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"]
mouseLockLookScreenUrl
else
classicLookScreenUrl
image.Position = UDim2.new -0.5, 0, 0, 0
image.Size = UDim2.new 1, 0, 1, 0
image.BackgroundTransparency = 1
image.Parent = layoutFrame
buttons = {}
buttons[1] = {}
buttons[1].Text = "Look"
buttons[1].Function = ->
image.Image = if UserSettings!.GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"]
mouseLockLookScreenUrl
else
classicLookScreenUrl
buttons[2] = {}
buttons[2].Text = "Move"
buttons[2].Function = ->
image.Image = "http://www.roblox.com/Asset?id=45915811"
buttons[3] = {}
buttons[3].Text = "Gear"
buttons[3].Function = ->
image.Image = "http://www.roblox.com/Asset?id=45917596"
buttons[4] = {}
buttons[4].Text = "Zoom"
buttons[4].Function = ->
image.Image = "http://www.roblox.com/Asset?id=45915825"
CreateTextButtons(buttonRow, buttons, UDim.new(0, 0), UDim.new(1, 0))
-- set up listeners for type of mouse mode, but keep constructing gui at same time
delay 0, ->
waitForChild(gui, "UserSettingsShield")
waitForChild(gui.UserSettingsShield, "Settings")
waitForChild(gui.UserSettingsShield.Settings, "SettingsStyle")
waitForChild(gui.UserSettingsShield.Settings.SettingsStyle, "GameSettingsMenu")
waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu, "CameraField")
waitForChild(gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField, "DropDownMenuButton")
gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Changed
\connect (prop) ->
return if prop ~= "Text"
if buttonRow.Button1.Style == Enum.ButtonStyle.RobloxButtonDefault -- only change if this is the currently selected panel
image.Image = if gui.UserSettingsShield.Settings.SettingsStyle.GameSettingsMenu.CameraField.DropDownMenuButton.Text ==
"Classic"
classicLookScreenUrl
else
mouseLockLookScreenUrl
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 ->
shield.Visible = false
game.GuiService\RemoveCenterDialog shield
okBtn.Parent = helpDialog
robloxLock shield
shield
createLeaveConfirmationMenu = (baseZIndex, shield) ->
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
yesButton = createTextButton(
"Leave",
Enum.ButtonStyle.RobloxButton,
Enum.FontSize.Size24,
UDim2.new(0, 128, 0, 50),
UDim2.new 0, 313, 0.8, 0
)
yesButton.Name = "YesButton"
yesButton.ZIndex = baseZIndex + 4
yesButton.Parent = frame
yesButton.Modal = true
yesButton\SetVerb "Exit"
noButton = createTextButton(
"Stay",
Enum.ButtonStyle.RobloxButtonDefault,
Enum.FontSize.Size24,
UDim2.new(0, 128, 0, 50),
UDim2.new 0, 90, 0.8, 0
)
noButton.Name = "NoButton"
noButton.Parent = frame
noButton.ZIndex = baseZIndex + 4
noButton.MouseButton1Click\connect ->
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
)
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
frame
createResetConfirmationMenu = (baseZIndex, shield) ->
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
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 ->
resumeGameFunction shield
resetLocalCharacter!
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 ->
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
)
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
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
frame
createGameMainMenu = (baseZIndex, shield) ->
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
-- GameMainMenu Children
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
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
helpButton = robloxHelpButton
helpDialog = createHelpDialog(baseZIndex)
helpDialog.Parent = gui
helpButton.MouseButton1Click\connect ->
table.insert(centerDialogs, helpDialog)
game.GuiService\AddCenterDialog(
helpDialog,
Enum.CenterDialogType.ModalDialog,
--ShowFunction
->
helpDialog.Visible = true
mainShield.Visible = false
--HideFunction
->
helpDialog.Visible = false
)
helpButton.Active = true
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
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
screenshotButton\SetVerb "Screenshot"
screenshotShortcut = helpShortcut\clone!
screenshotShortcut.Name = "ScreenshotShortcutText"
screenshotShortcut.Text = "PrintSc"
screenshotShortcut.Position = UDim2.new 0, 118, 0, 0
screenshotShortcut.Visible = true
screenshotShortcut.Parent = screenshotButton
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
recordVideoButton\SetVerb "RecordToggle"
recordVideoShortcut = helpShortcut\clone!
recordVideoShortcut.Visible = hasGraphicsSlider
recordVideoShortcut.Name = "RecordVideoShortcutText"
recordVideoShortcut.Text = "F12"
recordVideoShortcut.Position = UDim2.new 0, 120, 0, 0
recordVideoShortcut.Parent = recordVideoButton
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
stopRecordButton\SetVerb "RecordToggle"
stopRecordButton.MouseButton1Click\connect ->
recordVideoClick(recordVideoButton, stopRecordButton)
stopRecordButton.Visible = false
stopRecordButton.Parent = gui
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
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
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 ->
resumeGameFunction(shield)
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
if game\FindFirstChild"LoadingGuiService" and #game.LoadingGuiService\GetChildren! > 0
gameSettingsButton = createTextButton(
"Game Instructions",
Enum.ButtonStyle.RobloxButton,
Enum.FontSize.Size24,
UDim2.new(0, 340, 0, 50),
UDim2.new 0, 82, 0, 207
)
gameSettingsButton.Name = "GameInstructions"
gameSettingsButton.ZIndex = baseZIndex + 4
gameSettingsButton.Parent = gameMainMenuFrame
gameSettingsButton.MouseButton1Click\connect ->
if game\FindFirstChild "Players" and game.Players["LocalPlayer"]
loadingGui = game.Players.LocalPlayer\FindFirstChild "PlayerLoadingGui"
if loadingGui
loadingGui.Visible = true
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
gameMainMenuFrame
createGameSettingsMenu = (baseZIndex, _) ->
gameSettingsMenuFrame = Instance.new "Frame"
gameSettingsMenuFrame.Name = "GameSettingsMenu"
gameSettingsMenuFrame.BackgroundTransparency = 1
gameSettingsMenuFrame.Size = UDim2.new 1, 0, 1, 0
gameSettingsMenuFrame.ZIndex = baseZIndex + 4
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
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
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
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
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 studioCheckbox
if hasGraphicsSlider
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
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
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
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
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
betterQualityShortcut = fullscreenShortcut\clone!
betterQualityShortcut.Name = "BetterQualityShortcut"
betterQualityShortcut.Text = "F10"
betterQualityShortcut.Position = UDim2.new 0, 394, 0, 288
betterQualityShortcut.Parent = gameSettingsMenuFrame
betterQualityShortcut.Visible = not inStudioMode
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
graphicsSlider, graphicsLevel = RbxGui.CreateSlider GraphicsQualityLevels, 150, UDim2.new 0, 230, 0, 280 -- graphics - 1 because slider starts at 1 instead of 0
graphicsSlider.Parent = gameSettingsMenuFrame
graphicsSlider.Bar.ZIndex = baseZIndex + 4
graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5
graphicsSlider.Visible = not inStudioMode
graphicsLevel.Value = math.floor((settings!.Rendering\GetMaxQualityLevel! - 1) / 2)
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
isAutoGraphics = true
if not inStudioMode
isAutoGraphics = (UserSettings!.GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic)
else
settings!.Rendering.EnableFRM = false
listenToGraphicsLevelChange = true
setAutoGraphicsGui = (active) ->
isAutoGraphics = active
if active
autoGraphicsButton.Text = "X"
betterQualityText.ZIndex = 1
betterQualityShortcut.ZIndex = 1
fasterShortcut.ZIndex = 1
fasterText.ZIndex = 1
graphicsSlider.Bar.ZIndex = 1
graphicsSlider.Bar.Slider.ZIndex = 1
graphicsSetter.ZIndex = 1
graphicsSetter.Text = "Auto"
else
autoGraphicsButton.Text = ""
graphicsSlider.Bar.ZIndex = baseZIndex + 4
graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5
betterQualityShortcut.ZIndex = baseZIndex + 4
fasterShortcut.ZIndex = baseZIndex + 4
betterQualityText.ZIndex = baseZIndex + 4
fasterText.ZIndex = baseZIndex + 4
graphicsSetter.ZIndex = baseZIndex + 4
goToAutoGraphics = ->
setAutoGraphicsGui(true)
UserSettings!.GameSettings.SavedQualityLevel = Enum.SavedQualitySetting.Automatic
settings!.Rendering.QualityLevel = Enum.QualityLevel.Automatic
setGraphicsQualityLevel = (newLevel) ->
percentage = newLevel / GraphicsQualityLevels
newSetting = math.floor((settings!.Rendering\GetMaxQualityLevel! - 1) * percentage)
if newSetting == 20 -- Level 20 is the same as level 21, except it doesn't render ambient occlusion
newSetting = 21
elseif newLevel == 1 -- make sure we can go to lowest settings (for terrible computers)
newSetting = 1
elseif newSetting > settings!.Rendering\GetMaxQualityLevel!
newSetting = settings!.Rendering\GetMaxQualityLevel! - 1
UserSettings!.GameSettings.SavedQualityLevel = newLevel
settings!.Rendering.QualityLevel = newSetting
goToManualGraphics = (explicitLevel) ->
setAutoGraphicsGui(false)
if explicitLevel
graphicsLevel.Value = explicitLevel
else
graphicsLevel.Value = math.floor(
(settings!.Rendering.AutoFRMLevel / (settings!.Rendering\GetMaxQualityLevel! - 1))
* GraphicsQualityLevels
)
if explicitLevel == graphicsLevel.Value -- make sure we are actually in right graphics mode
setGraphicsQualityLevel(graphicsLevel.Value)
if not explicitLevel
UserSettings!.GameSettings.SavedQualityLevel = graphicsLevel.Value
graphicsSetter.Text = "#{graphicsLevel.Value}"
showAutoGraphics = ->
autoText.ZIndex = baseZIndex + 4
autoGraphicsButton.ZIndex = baseZIndex + 4
hideAutoGraphics = ->
autoText.ZIndex = 1
autoGraphicsButton.ZIndex = 1
showManualGraphics = ->
graphicsSlider.Bar.ZIndex = baseZIndex + 4
graphicsSlider.Bar.Slider.ZIndex = baseZIndex + 5
betterQualityShortcut.ZIndex = baseZIndex + 4
fasterShortcut.ZIndex = baseZIndex + 4
betterQualityText.ZIndex = baseZIndex + 4
fasterText.ZIndex = baseZIndex + 4
graphicsSetter.ZIndex = baseZIndex + 4
hideManualGraphics = ->
betterQualityText.ZIndex = 1
betterQualityShortcut.ZIndex = 1
fasterShortcut.ZIndex = 1
fasterText.ZIndex = 1
graphicsSlider.Bar.ZIndex = 1
graphicsSlider.Bar.Slider.ZIndex = 1
graphicsSetter.ZIndex = 1
translateSavedQualityLevelToInt = (savedQualityLevel) ->
switch savedQualityLevel
when Enum.SavedQualitySetting.Automatic then 0
when Enum.SavedQualitySetting.QualityLevel1 then 1
when Enum.SavedQualitySetting.QualityLevel2 then 2
when Enum.SavedQualitySetting.QualityLevel3 then 3
when Enum.SavedQualitySetting.QualityLevel4 then 4
when Enum.SavedQualitySetting.QualityLevel5 then 5
when Enum.SavedQualitySetting.QualityLevel6 then 6
when Enum.SavedQualitySetting.QualityLevel7 then 7
when Enum.SavedQualitySetting.QualityLevel8 then 8
when Enum.SavedQualitySetting.QualityLevel9 then 9
when Enum.SavedQualitySetting.QualityLevel10 then 10
enableGraphicsWidget = ->
settings!.Rendering.EnableFRM = true
isAutoGraphics = UserSettings!.GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic
if isAutoGraphics
showAutoGraphics!
goToAutoGraphics!
else
showAutoGraphics!
showManualGraphics!
goToManualGraphics translateSavedQualityLevelToInt UserSettings!.GameSettings.SavedQualityLevel
disableGraphicsWidget = ->
hideManualGraphics!
hideAutoGraphics!
settings!.Rendering.EnableFRM = false
graphicsSetter.FocusLost\connect ->
if isAutoGraphics
graphicsSetter.Text = "#{graphicsLevel.Value}"
return
newGraphicsValue = tonumber graphicsSetter.Text
if newGraphicsValue == nil
graphicsSetter.Text = "#{graphicsLevel.Value}"
return
if newGraphicsValue < 1
newGraphicsValue = 1
elseif newGraphicsValue >= settings!.Rendering\GetMaxQualityLevel!
newGraphicsValue = settings!.Rendering\GetMaxQualityLevel! - 1
graphicsLevel.Value = newGraphicsValue
setGraphicsQualityLevel graphicsLevel.Value
graphicsSetter.Text = "#{graphicsLevel.Value}"
graphicsLevel.Changed\connect (_) ->
return if isAutoGraphics
return if not listenToGraphicsLevelChange
graphicsSetter.Text = "#{graphicsLevel.Value}"
setGraphicsQualityLevel graphicsLevel.Value
-- setup our graphic mode on load
if inStudioMode or UserSettings!.GameSettings.SavedQualityLevel == Enum.SavedQualitySetting.Automatic
if inStudioMode
settings!.Rendering.EnableFRM = false
disableGraphicsWidget!
else
settings!.Rendering.EnableFRM = true
goToAutoGraphics!
else
settings!.Rendering.EnableFRM = true
goToManualGraphics translateSavedQualityLevelToInt UserSettings!.GameSettings.SavedQualityLevel
autoGraphicsButton.MouseButton1Click\connect ->
return if inStudioMode and not game.Players.LocalPlayer
if not isAutoGraphics
goToAutoGraphics!
else
goToManualGraphics graphicsLevel.Value
game.GraphicsQualityChangeRequest\connect (graphicsIncrease) ->
return if isAutoGraphics
-- only can set graphics in manual mode
if graphicsIncrease
return if (graphicsLevel.Value + 1) > GraphicsQualityLevels
graphicsLevel.Value = graphicsLevel.Value + 1
graphicsSetter.Text = "#{graphicsLevel.Value}"
setGraphicsQualityLevel graphicsLevel.Value
game\GetService"GuiService"\SendNotification(
"Graphics Quality",
"Increased to (#{graphicsSetter.Text})",
"",
2,
->
)
else
return if (graphicsLevel.Value - 1) <= 0
graphicsLevel.Value = graphicsLevel.Value - 1
graphicsSetter.Text = "#{graphicsLevel.Value}"
setGraphicsQualityLevel graphicsLevel.Value
game\GetService"GuiService"\SendNotification(
"Graphics Quality",
"Decreased to (#{graphicsSetter.Text})",
"",
2,
->
)
game.Players.PlayerAdded\connect (player) ->
if player == game.Players.LocalPlayer and inStudioMode
enableGraphicsWidget!
game.Players.PlayerRemoving\connect (player) ->
if player == game.Players.LocalPlayer and inStudioMode
disableGraphicsWidget!
studioCheckbox = createTextButton(
"",
Enum.ButtonStyle.RobloxButton,
Enum.FontSize.Size18,
UDim2.new(0, 25, 0, 25),
UDim2.new 0, 30, 0, 176
)
studioCheckbox.Name = "StudioCheckbox"
studioCheckbox.ZIndex = baseZIndex + 4
--studioCheckbox.Parent = gameSettingsMenuFrame -- todo: enable when studio h4x aren't an issue anymore
studioCheckbox\SetVerb "TogglePlayMode"
studioCheckbox.Visible = false -- todo: enabled when studio h4x aren't an issue anymore
wasManualGraphics = (settings!.Rendering.QualityLevel ~= Enum.QualityLevel.Automatic)
if inStudioMode and not game.Players.LocalPlayer
studioCheckbox.Text = "X"
disableGraphicsWidget!
elseif inStudioMode
studioCheckbox.Text = "X"
enableGraphicsWidget!
if hasGraphicsSlider
UserSettings!.GameSettings.StudioModeChanged\connect (isStudioMode) ->
inStudioMode = isStudioMode
if isStudioMode
wasManualGraphics = (settings!.Rendering.QualityLevel ~= Enum.QualityLevel.Automatic)
goToAutoGraphics!
studioCheckbox.Text = "X"
autoGraphicsButton.ZIndex = 1
autoText.ZIndex = 1
else
if wasManualGraphics
goToManualGraphics!
studioCheckbox.Text = ""
autoGraphicsButton.ZIndex = baseZIndex + 4
autoText.ZIndex = baseZIndex + 4
else
studioCheckbox.MouseButton1Click\connect ->
return if not studioCheckbox.Active
studioCheckbox.Text = if studioCheckbox.Text == ""
"X"
else
""
fullscreenCheckbox = createTextButton(
"",
Enum.ButtonStyle.RobloxButton,
Enum.FontSize.Size18,
UDim2.new(0, 25, 0, 25),
UDim2.new 0, 30, 0, 144
)
fullscreenCheckbox.Name = "FullscreenCheckbox"
fullscreenCheckbox.ZIndex = baseZIndex + 4
fullscreenCheckbox.Parent = gameSettingsMenuFrame
fullscreenCheckbox\SetVerb "ToggleFullScreen"
if UserSettings!.GameSettings\InFullScreen!
fullscreenCheckbox.Text = "X"
if hasGraphicsSlider
UserSettings!.GameSettings.FullscreenChanged\connect (isFullscreen) ->
fullscreenCheckbox.Text = if isFullscreen
"X"
else
""
else
fullscreenCheckbox.MouseButton1Click\connect ->
fullscreenCheckbox.Text = if fullscreenCheckbox.Text == ""
"X"
else
""
if game\FindFirstChild "NetworkClient" -- we are playing online
setDisabledState studioText
setDisabledState studioShortcut
setDisabledState studioCheckbox
local backButton
if hasGraphicsSlider
backButton = createTextButton(
"OK",
Enum.ButtonStyle.RobloxButtonDefault,
Enum.FontSize.Size24,
UDim2.new(0, 180, 0, 50),
UDim2.new 0, 170, 0, 330
)
backButton.Modal = true
else
backButton = createTextButton(
"OK",
Enum.ButtonStyle.RobloxButtonDefault,
Enum.FontSize.Size24,
UDim2.new(0, 180, 0, 50),
UDim2.new 0, 170, 0, 270
)
backButton.Modal = true
backButton.Name = "BackButton"
backButton.ZIndex = baseZIndex + 4
backButton.Parent = gameSettingsMenuFrame
global syncVideoCaptureSetting = nil
if not macClient
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
videoNames = {}
videoNameToItem = {}
videoNames[1] = "Just Save to Disk"
videoNameToItem[videoNames[1]] = Enum.UploadSetting["Never"]
videoNames[2] = "Upload to YouTube"
videoNameToItem[videoNames[2]] = Enum.UploadSetting["Ask me first"]
local videoCaptureDropDown
videoCaptureDropDown, updateVideoCaptureDropDownSelection = RbxGui.CreateDropDownMenu videoNames, (text) ->
UserSettings!.GameSettings.VideoUploadPromptBehavior = videoNameToItem[text]
videoCaptureDropDown.Name = "VideoCaptureField"
videoCaptureDropDown.ZIndex = baseZIndex + 4
videoCaptureDropDown.DropDownMenuButton.ZIndex = baseZIndex + 4
videoCaptureDropDown.DropDownMenuButton.Icon.ZIndex = baseZIndex + 4
videoCaptureDropDown.Position = UDim2.new 0, 270, 0, 94
videoCaptureDropDown.Size = UDim2.new 0, 200, 0, 32
videoCaptureDropDown.Parent = gameSettingsMenuFrame
syncVideoCaptureSetting = ->
updateVideoCaptureDropDownSelection if UserSettings!.GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Never"]
videoNames[1]
elseif UserSettings!.GameSettings.VideoUploadPromptBehavior == Enum.UploadSetting["Ask me first"]
videoNames[2]
else
UserSettings!.GameSettings.VideoUploadPromptBehavior = Enum.UploadSetting["Ask me first"]
videoNames[2]
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
mouseLockLabel = game.CoreGui.RobloxGui\FindFirstChild "MouseLockLabel", true
enumItems = Enum.ControlMode\GetEnumItems!
enumNames = {}
enumNameToItem = {}
for i, obj in ipairs enumItems
enumNames[i] = obj.Name
enumNameToItem[obj.Name] = obj
local cameraDropDown
cameraDropDown, updateCameraDropDownSelection = RbxGui.CreateDropDownMenu enumNames, (text) ->
UserSettings!.GameSettings.ControlMode = enumNameToItem[text]
try
mouseLockLabel.Visible = if mouseLockLabel and UserSettings!.GameSettings.ControlMode == Enum.ControlMode["Mouse Lock Switch"]
true
elseif mouseLockLabel
false
cameraDropDown.Name = "CameraField"
cameraDropDown.ZIndex = baseZIndex + 4
cameraDropDown.DropDownMenuButton.ZIndex = baseZIndex + 4
cameraDropDown.DropDownMenuButton.Icon.ZIndex = baseZIndex + 4
cameraDropDown.Position = UDim2.new 0, 270, 0, 52
cameraDropDown.Size = UDim2.new 0, 200, 0, 32
cameraDropDown.Parent = gameSettingsMenuFrame
gameSettingsMenuFrame
if LoadLibrary
global RbxGui = LoadLibrary "RbxGui"
baseZIndex = 0
if UserSettings
createSettingsDialog = ->
waitForChild gui, "BottomLeftControl"
global settingsButton = gui.BottomLeftControl\FindFirstChild "SettingsButton"
if settingsButton == nil
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
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
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
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
gameMainMenu = createGameMainMenu baseZIndex, shield
gameMainMenu.Parent = settingsFrame
gameMainMenu.ScreenshotButton.MouseButton1Click\connect ->
backToGame gameMainMenu.ScreenshotButton, shield, settingsButton
gameMainMenu.RecordVideoButton.MouseButton1Click\connect ->
recordVideoClick gameMainMenu.RecordVideoButton, gui.StopRecordButton
backToGame gameMainMenu.RecordVideoButton, shield, settingsButton
if settings!\FindFirstChild "Game Options"
try
settings!\FindFirstChild"Game Options".VideoRecordingChangeRequest\connect (recording) ->
recordingVideo = recording
setRecordGui recording, gui.StopRecordButton, gameMainMenu.RecordVideoButton
game.CoreGui.RobloxGui.Changed\connect (prop) -> -- We have stopped recording when we resize
if prop == "AbsoluteSize" and recordingVideo
recordVideoClick gameMainMenu.RecordVideoButton, gui.StopRecordButton
localPlayerChange = ->
gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer
if game.Players.LocalPlayer
settings!.Rendering.EnableFRM = true
elseif inStudioMode
settings!.Rendering.EnableFRM = false
gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer
if game.Players.LocalPlayer?
game.Players.LocalPlayer.Changed\connect ->
localPlayerChange!
else
delay 0, ->
waitForProperty game.Players, "LocalPlayer"
gameMainMenu.ResetButton.Visible = game.Players.LocalPlayer
game.Players.LocalPlayer.Changed\connect ->
localPlayerChange!
gameMainMenu.ReportAbuseButton.Visible = game\FindFirstChild "NetworkClient"
if not gameMainMenu.ReportAbuseButton.Visible
game.ChildAdded\connect (child) ->
if child\IsA "NetworkClient"
gameMainMenu.ReportAbuseButton.Visible = game\FindFirstChild "NetworkClient"
gameMainMenu.ResetButton.MouseButton1Click\connect ->
goToMenu settingsFrame, "ResetConfirmationMenu", "up", UDim2.new 0, 525, 0, 370
gameMainMenu.LeaveGameButton.MouseButton1Click\connect ->
goToMenu settingsFrame, "LeaveConfirmationMenu", "down", UDim2.new 0, 525, 0, 300
if game.CoreGui.Version >= 4 then -- we can use escape!
game\GetService"GuiService".EscapeKeyPressed\connect ->
if currentMenuSelection == nil
game.GuiService\AddCenterDialog(
shield,
Enum.CenterDialogType.ModalDialog,
--showFunction
->
settingsButton.Active = false
updateCameraDropDownSelection(UserSettings!.GameSettings.ControlMode.Name)
if syncVideoCaptureSetting
syncVideoCaptureSetting!
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
)
--hideFunction
->
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
)
elseif #lastMenuSelection > 0
if #centerDialogs > 0
for i = 1, #centerDialogs
game.GuiService\RemoveCenterDialog centerDialogs[i]
centerDialogs[i].Visible = false
centerDialogs = {}
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 = {}
else
resumeGameFunction(shield)
gameSettingsMenu = createGameSettingsMenu(baseZIndex, shield)
gameSettingsMenu.Visible = false
gameSettingsMenu.Parent = settingsFrame
gameMainMenu.SettingsButton.MouseButton1Click\connect ->
goToMenu(settingsFrame, "GameSettingsMenu", "left", UDim2.new(0, 525, 0, 350))
gameSettingsMenu.BackButton.MouseButton1Click\connect ->
goToMenu(settingsFrame, "GameMainMenu", "right", UDim2.new(0, 525, 0, 430))
resetConfirmationWindow = createResetConfirmationMenu(baseZIndex, shield)
resetConfirmationWindow.Visible = false
resetConfirmationWindow.Parent = settingsFrame
leaveConfirmationWindow = createLeaveConfirmationMenu(baseZIndex, shield)
leaveConfirmationWindow.Visible = false
leaveConfirmationWindow.Parent = settingsFrame
robloxLock(shield)
settingsButton.MouseButton1Click\connect ->
game.GuiService\AddCenterDialog(
shield,
Enum.CenterDialogType.ModalDialog,
--showFunction
->
settingsButton.Active = false
updateCameraDropDownSelection(UserSettings!.GameSettings.ControlMode.Name)
if syncVideoCaptureSetting
syncVideoCaptureSetting!
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
)
--hideFunction
->
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
)
return shield
delay 0, ->
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"]
mouseLockLabel.Visible = true
elseif mouseLockLabel
mouseLockLabel.Visible = false
-- our script has loaded, get rid of older buttons now
leaveGameButton = gui.BottomLeftControl\FindFirstChild "Exit"
if leaveGameButton
leaveGameButton\Remove!
topLeft = gui\FindFirstChild "TopLeftControl"
if topLeft
leaveGameButton = topLeft\FindFirstChild "Exit"
if leaveGameButton
leaveGameButton\Remove!
topLeft\Remove!
--UserSettings call
createSaveDialogs = ->
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, save, saveLocal, dontSave, cancel
messageBoxButtons = {}
messageBoxButtons[1] = {}
messageBoxButtons[1].Text = "Save"
messageBoxButtons[1].Style = Enum.ButtonStyle.RobloxButtonDefault
messageBoxButtons[1].Function = ->
save!
messageBoxButtons[2] = {}
messageBoxButtons[2].Text = "Cancel"
messageBoxButtons[2].Function = ->
cancel!
messageBoxButtons[3] = {}
messageBoxButtons[3].Text = "Don't Save"
messageBoxButtons[3].Function = ->
dontSave!
saveDialogMessageBox = RbxGui.CreateStyledMessageDialog(
"Unsaved Changes",
"Save your changes to Mercury before leaving?",
"Confirm",
messageBoxButtons
)
saveDialogMessageBox.Visible = true
saveDialogMessageBox.Parent = shield
errorBoxButtons = {}
buttonOffset = 1
if game.LocalSaveEnabled
errorBoxButtons[buttonOffset] = {}
errorBoxButtons[buttonOffset].Text = "Save to Disk"
errorBoxButtons[buttonOffset].Function = ->
saveLocal!
buttonOffset += 1
errorBoxButtons[buttonOffset] = {}
errorBoxButtons[buttonOffset].Text = "Keep Playing"
errorBoxButtons[buttonOffset].Function = ->
cancel!
errorBoxButtons[buttonOffset + 1] = {}
errorBoxButtons[buttonOffset + 1].Text = "Don't Save"
errorBoxButtons[buttonOffset + 1].Function = ->
dontSave!
errorDialogMessageBox = RbxGui.CreateStyledMessageDialog(
"Upload Failed",
"Sorry, we could not save your changes to Mercury.",
"Error",
errorBoxButtons
)
errorDialogMessageBox.Visible = false
errorDialogMessageBox.Parent = shield
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
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
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
spinnerIcons = {}
spinnerNum = 1
while spinnerNum <= 8
spinnerImage = Instance.new "ImageLabel"
spinnerImage.Name = "Spinner" .. spinnerNum
spinnerImage.Size = UDim2.new 0, 16, 0, 16
spinnerImage.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://www.roblox.com/Asset?id=45880710"
spinnerImage.Parent = spinnerFrame
spinnerIcons[spinnerNum] = spinnerImage
spinnerNum += 1
save = ->
saveDialogMessageBox.Visible = false
--Show the spinner dialog
spinnerDialog.Visible = true
spin = true
--Make it spin
delay 0, ->
spinPos = 0
while spin
pos = 0
while pos < 8
spinnerIcons[pos + 1].Image = if pos == spinPos or pos == ((spinPos + 1) % 8)
"http://www.roblox.com/Asset?id=45880668"
else
"http://www.roblox.com/Asset?id=45880710"
pos += 1
spinPos = (spinPos + 1) % 8
wait 0.2
--Do the save while the spinner is going, function will wait
result = game\SaveToRoblox!
if not result
--Try once more
result = game\SaveToRoblox!
--Hide the spinner dialog
spinnerDialog.Visible = false
--And cause the delay thread to stop
spin = false
--Now process the result
if result
--Success, close
game\FinishShutdown(false)
clearAndResetDialog!
else
--Failure, show the second dialog prompt
errorDialogMessageBox.Visible = true
saveLocal = ->
errorDialogMessageBox.Visible = false
game\FinishShutdown(true)
clearAndResetDialog!
dontSave = ->
saveDialogMessageBox.Visible = false
errorDialogMessageBox.Visible = false
game\FinishShutdown(false)
clearAndResetDialog!
cancel = ->
saveDialogMessageBox.Visible = false
errorDialogMessageBox.Visible = false
clearAndResetDialog!
clearAndResetDialog = ->
saveDialogMessageBox.Visible = true
errorDialogMessageBox.Visible = false
spinnerDialog.Visible = false
shield.Visible = false
game.GuiService\RemoveCenterDialog(shield)
robloxLock(shield)
shield.Visible = false
return shield
createReportAbuseDialog = ->
--Only show things if we are a NetworkClient
waitForChild(game, "NetworkClient")
waitForChild(game, "Players")
waitForProperty(game.Players, "LocalPlayer")
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
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
local closeAndResetDialog
messageBoxButtons = {}
messageBoxButtons[1] = {}
messageBoxButtons[1].Text = "Ok"
messageBoxButtons[1].Modal = true
messageBoxButtons[1].Function = ->
closeAndResetDialog!
calmingMessageBox = 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
recordedMessageBox = RbxGui.CreateMessageDialog(
"Thanks for your report!",
"We've recorded your report for evaluation.",
messageBoxButtons
)
recordedMessageBox.Visible = false
recordedMessageBox.Parent = shield
normalMessageBox = RbxGui.CreateMessageDialog(
"Thanks for your report!",
"Our moderators will review the chat logs and determine what happened.",
messageBoxButtons
)
normalMessageBox.Visible = false
normalMessageBox.Parent = shield
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
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
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
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
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
local abusingPlayer
local abuse
local submitReportButton
local updatePlayerSelection
createPlayersDropDown = ->
players = game\GetService "Players"
playerNames = {}
nameToPlayer = {}
children = players\GetChildren!
pos = 1
if children
for _, player in ipairs children
if player\IsA"Player" and player ~= localPlayer
playerNames[pos] = player.Name
nameToPlayer[player.Name] = player
pos += 1
local playerDropDown
playerDropDown, updatePlayerSelection = RbxGui.CreateDropDownMenu playerNames, (playerName) ->
abusingPlayer = nameToPlayer[playerName]
if abuse and abusingPlayer
submitReportButton.Active = true
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
playerDropDown
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
abuses =
* "Swearing"
* "Bullying"
* "Scamming"
* "Dating"
* "Cheating/Exploiting"
* "Personal Questions"
* "Offsite Links"
* "Bad Model or Script"
* "Bad Username"
abuseDropDown, updateAbuseSelection = RbxGui.CreateDropDownMenu(abuses, (abuseText) ->
abuse = abuseText
if abuse and abusingPlayer
submitReportButton.Active = true
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
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
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
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
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
submitReportButton.MouseButton1Click\connect ->
if submitReportButton.Active
if abuse and abusingPlayer
frame.Visible = false
game.Players\ReportAbuse abusingPlayer, abuse, shortDescriptionBox.Text
if abuse == "Cheating/Exploiting"
recordedMessageBox.Visible = true
elseif abuse == "Bullying" or abuse == "Swearing"
calmingMessageBox.Visible = true
else
normalMessageBox.Visible = true
else
closeAndResetDialog!
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
closeAndResetDialog = ->
--Delete old player combo box
oldComboBox = settingsFrame\FindFirstChild "PlayersComboBox"
if oldComboBox
oldComboBox.Parent = nil
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)
cancelButton.MouseButton1Click\connect(closeAndResetDialog)
reportAbuseButton.MouseButton1Click\connect ->
createPlayersDropDown!.Parent = settingsFrame
table.insert(centerDialogs, shield)
game.GuiService\AddCenterDialog(
shield,
Enum.CenterDialogType.ModalDialog,
--ShowFunction
->
reportAbuseButton.Active = false
shield.Visible = true
mainShield.Visible = false
--HideFunction
->
reportAbuseButton.Active = true
shield.Visible = false
)
robloxLock shield
shield
-- createChatBar = ->
-- --Only show a chat bar if we are a NetworkClient
-- waitForChild(game, "NetworkClient")
-- waitForChild(game, "Players")
-- waitForProperty(game.Players, "LocalPlayer")
-- 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
-- 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
-- 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
-- activateChat = ->
-- if chatBox.Visible
-- return
-- end
-- chatButton.Visible = false
-- chatBox.Text = ""
-- chatBox.Visible = true
-- chatBox\CaptureFocus!
-- chatButton.MouseButton1Click\connect(activateChat)
-- -- hotKeyEnabled = true
-- toggleHotKey = function(_)
-- -- hotKeyEnabled = value
-- -- guiService = game\GetService "GuiService"
-- --[[newChatMode = ]]try
-- --guiService\AddSpecialKey(Enum.SpecialKey.ChatHotkey)
-- --guiService.SpecialKeyPressed\connect (key) -> if key == Enum.SpecialKey.ChatHotkey and hotKeyEnabled then activateChat!
-- end)
-- -- if not newChatMode
-- --guiService\AddKey("/")
-- --guiService.KeyPressed\connect (key) -> if key == "/" and hotKeyEnabled then activateChat!
-- chatBox.FocusLost\connect (enterPressed) ->
-- if enterPressed
-- if chatBox.Text ~= ""
-- str = chatBox.Text
-- if string.sub(str, 1, 1) == "%"
-- game.Players\TeamChat(string.sub(str, 2))
-- else
-- game.Players\Chat(str)
-- chatBox.Text = ""
-- chatBox.Visible = false
-- chatButton.Visible = true
-- robloxLock(chatBar)
-- return chatBar, toggleHotKey
--Spawn a thread for the Save dialogs
isSaveDialogSupported = try
-- var = game.LocalSaveEnabled
if isSaveDialogSupported
delay 0, ->
saveDialogs = createSaveDialogs!
saveDialogs.Parent = gui
game.RequestShutdown = ->
table.insert centerDialogs, saveDialogs
game.GuiService\AddCenterDialog(
saveDialogs,
Enum.CenterDialogType.QuitDialog,
--ShowFunction
-> saveDialogs.Visible = true
--HideFunction
-> saveDialogs.Visible = false
)
return true
--Spawn a thread for the Report Abuse dialogs
delay 0, ->
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
--Spawn a thread for Chat Bar
--[[local success, luaChat = ]]
try
game.GuiService.UseLuaChat
-- if success and luaChat
--[[delay 0, ->
waitForChild(game, "Players")
waitForProperty(game.Players, "LocalPlayer")
advancedChatBarSupported = game.Players.LocalPlayer.ChatMode
local chatBar, toggleHotKey = createChatBar!
[if advancedChatBarSupported
toggleChatBar = (chatMode) ->
if chatMode == Enum.ChatMode.Menu
chatBar.Parent = nil
game.GuiService\SetGlobalSizeOffsetPixel(0,0)
toggleHotKey(false)
elseif chatMode == Enum.ChatMode.TextAndMenu
--chatBar.Parent = gui
--game.GuiService\SetGlobalSizeOffsetPixel(0,-22)
toggleHotKey(true)
game.Players.LocalPlayer.Changed\connect(
function(prop)
if prop == "ChatMode"
toggleChatBar(game.Players.LocalPlayer.ChatMode)
toggleChatBar(game.Players.LocalPlayer.ChatMode)
else
--chatBar.Parent = gui
--game.GuiService\SetGlobalSizeOffsetPixel(0,-22)
]]
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, ->
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
game.Players.LocalPlayer.Character.Humanoid\SetClickToWalkEnabled false
game.Players.LocalPlayer.CharacterAdded\connect (character) ->
waitForChild character, "Humanoid"
character.Humanoid\SetClickToWalkEnabled false