Repository navigation
Expand file tree
/
Copy pathStarterScript.lua
More file actions
114 lines (96 loc) · 4.7 KB
/
Copy pathStarterScript.lua
File metadata and controls
114 lines (96 loc) · 4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
-- Creates all neccessary scripts for the gui on initial load, everything except build tools
-- Created by Ben T. 10/29/10
-- Please note that these are loaded in a specific order to diminish errors/perceived load time by user
local scriptContext = game:GetService("ScriptContext")
local touchEnabled = game:GetService("UserInputService").TouchEnabled
local RobloxGui = Game:GetService("CoreGui"):WaitForChild("RobloxGui")
local screenGui = Game:GetService("CoreGui"):FindFirstChild("RobloxGui")
-- TopBar
local topbarSuccess, topbarFlagValue = pcall(function() return settings():GetFFlag("UseInGameTopBar") end)
local useTopBar = (topbarSuccess and topbarFlagValue == true)
if useTopBar then
scriptContext:AddCoreScriptLocal("CoreScripts/Topbar", screenGui)
end
-- SettingsScript
local luaControlsSuccess, luaControlsFlagValue = pcall(function() return settings():GetFFlag("UseLuaCameraAndControl") end)
local newSettingsSuccess, newSettingsFlagValue = pcall(function() return settings():GetFFlag("NewMenuSettingsScript") end)
local useNewSettings = (luaControlsSuccess and luaControlsFlagValue) and (newSettingsSuccess and newSettingsFlagValue)
if useNewSettings then
spawn(function() require(RobloxGui.Modules.Settings2) end)
else
scriptContext:AddCoreScriptLocal("CoreScripts/Settings", screenGui)
end
-- Set up touch controls. TODO: Remove when new lua controls are stable.
if touchEnabled then
if not luaControlsSuccess or luaControlsFlagValue == false then
scriptContext:AddCoreScriptLocal("CoreScripts/TouchControls", screenGui)
end
end
-- MainBotChatScript (the Lua part of Dialogs)
local useNewDialogLook = false
pcall(function() useNewDialogLook = settings():GetFFlag("UseNewBubbleSkin") end)
if useNewDialogLook then
scriptContext:AddCoreScriptLocal("CoreScripts/MainBotChatScript2", screenGui)
else
scriptContext:AddCoreScriptLocal("CoreScripts/MainBotChatScript", screenGui)
end
-- Developer Console Script
scriptContext:AddCoreScriptLocal("CoreScripts/DeveloperConsole", screenGui)
-- In-game notifications script
scriptContext:AddCoreScriptLocal("CoreScripts/NotificationScript2", screenGui)
-- Chat script
if useTopBar then
spawn(function() require(RobloxGui.Modules.Chat) end)
else
scriptContext:AddCoreScriptLocal("CoreScripts/ChatScript2", screenGui)
end
-- Purchase Prompt Script
local newPurchaseSuccess, newPurchaseEnabled = pcall(function() return settings():GetFFlag("NewPurchaseScript") end)
local isNewPurchaseScript = newPurchaseSuccess and newPurchaseEnabled
if isNewPurchaseScript then
scriptContext:AddCoreScriptLocal("CoreScripts/PurchasePromptScript2", screenGui)
else
scriptContext:AddCoreScriptLocal("CoreScripts/PurchasePromptScript", screenGui)
end
-- Health Script
if not useTopBar then
scriptContext:AddCoreScriptLocal("CoreScripts/HealthScript", screenGui)
end
local playerListSuccess, playerListFlagValue = pcall(function() return settings():GetFFlag("NewPlayerListScript") end)
local isNotSmallTouchDevice = not touchEnabled or Game:GetService("GuiService"):GetScreenResolution().Y >= 500
-- New Player List
if playerListSuccess and playerListFlagValue == true then
if useTopBar then
spawn(function() require(RobloxGui.Modules.PlayerlistModule) end)
elseif isNotSmallTouchDevice then
scriptContext:AddCoreScriptLocal("CoreScripts/PlayerListScript2", screenGui)
end
elseif isNotSmallTouchDevice then
scriptContext:AddCoreScriptLocal("CoreScripts/PlayerListScript", screenGui)
end
do -- Backpack!
local useNewBackpack = false
pcall(function() useNewBackpack = settings():GetFFlag("NewBackpackScript") end)
if useNewBackpack then
spawn(function() require(RobloxGui.Modules.BackpackScript) end)
else
-- Backpack Builder, creates most of the backpack gui
scriptContext:AddCoreScriptLocal("CoreScripts/BackpackScripts/BackpackBuilder", screenGui)
screenGui:WaitForChild("CurrentLoadout")
screenGui:WaitForChild("Backpack")
local Backpack = screenGui.Backpack
-- Manager handles all big backpack state changes, other scripts subscribe to this and do things accordingly
scriptContext:AddCoreScriptLocal("CoreScripts/BackpackScripts/BackpackManager", Backpack)
-- Backpack Gear (handles all backpack gear tab stuff)
scriptContext:AddCoreScriptLocal("CoreScripts/BackpackScripts/BackpackGear", Backpack)
-- Loadout Script, used for gear hotkeys
scriptContext:AddCoreScriptLocal("CoreScripts/BackpackScripts/LoadoutScript", screenGui.CurrentLoadout)
end
end
if touchEnabled then -- touch devices don't use same control frame
-- only used for touch device button generation
scriptContext:AddCoreScriptLocal("CoreScripts/ContextActionTouch", screenGui)
screenGui:WaitForChild("ControlFrame")
screenGui.ControlFrame:WaitForChild("BottomLeftControl")
screenGui.ControlFrame.BottomLeftControl.Visible = false
end