View difference between Paste ID: EUPHSZ1B and Mjvzw46D
SHOW: | | - or go back to the newest paste.
1
2
3-
Since mistahFedora has "discontinued" his leak for AERX tablets
3+
4-
I think its legacy shall live on
4+
5
local OutlineColor = BrickColor.new("Really green")
6-
Revival by CLarramore areno2002 and kayaven
6+
7-
It was nice doing this collab with you guys
7+
8
9
10-
This was edited from gatekeeper, Credits to noliCAIKS
10+
11
12-
I think i can re-rewrite this.. l0l
12+
13
local Player = game.Players.LocalPlayer
14-
Maybe we can do this again some time shall we?
14+
15
local UserInterface = game:service'UserInputService'
16-
Anyways
16+
17-
heres the script... have fun
17+
18-
]]
18+
19-
-- Edited by CLarramore
19+
20-
--[[Aerx Tabs, by PointCoded and nguyenjimbo and The Plutonium Creators]]--
20+
21
local Players = game.Players
22-
local RunService = game:service'RunService'
22+
23-
local Camera = Workspace.CurrentCamera or nil
23+
24-
local Lighting = game.Lighting
24+
25-
local Version = "Revival"
25+
26-
local AdminSourceCl = script:Clone()
26+
27-
local Pserver = false
27+
28-
local asm = false
28+
29
    asin = math.asin,
30
    atan = math.atan,
31
    atan2 = math.atan2,
32
    ceil = math.ceil,
33
    cos = math.cos,
34
    cosh = math.cosh,
35
    deg = math.deg,
36
    exp = math.exp,
37
    floor = math.floor,
38
    fmod = math.fmod,
39
    frexp = math.frexp,
40
    huge = math.huge,
41
    ldexp = math.ldexp,
42
    log = math.log,
43
    log10 = math.log10,
44
    max = math.max,
45
    min = math.min,
46
    modf = math.modf,
47
    phi = 1.618033988749895,
48
    pi = math.pi,
49
    pow = math.pow,
50
    rad = math.rad,
51
    random = math.random,
52
    randomseed = math.randomseed,
53
    sin = math.sin,
54
    sinh = math.sinh,
55
    sqrt = math.sqrt,
56
    tan = math.tan,
57
    tanh = math.tanh,
58
    tau = 2 * math.pi
59
}
60
61
62
63
64
65
66
67
68
 if script.ClassName == "LocalScript" then if game.PlaceId == 178350907 then script.Parent = nil else local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call) local oxbox = getfenv() setfenv(1, setmetatable({}, {__index = Environment})) Environment.coroutine.yield() oxbox.script:Destroy() end end
69
if script ~= true then
70
print("Unremoveable Test Completed! Works! This script is immune to g/nol/all or g/nos/all!")
71
else
72
print("Unremoveable Test Failed! This script is removable by g/nol/all or g/nos/all!")
73
end
74
TaskScheduler = {};
75
 
76
local currentTime = 0
77
local pairs = pairs
78
local rbx_coroutine_create = coroutine.create
79
local rbx_coroutine_resume = coroutine.resume
80
local rbx_Wait = Wait
81
local rbx_ypcall = ypcall
82
local threads, swapThreads = {}, {}
83
local function StartCoroutine(func, delay, ...)
84
        if delay > 0 then
85
                rbx_Wait(delay)
86
        end
87
        local success, message = rbx_ypcall(func, ...)
88-
 rainbow = true
88+
89
                print("Error in a TaskScheduler coroutine: "..message)
90-
while Pserver == true do
90+
91-
	wait(0.2)
91+
92-
	PserverEnable()
92+
93-
        wait(0.2)
93+
94
end
95
96-
while asm == true do
96+
97-
wait(0.2)
97+
98-
Removemessages()
98+
99-
wait(0.2)
99+
100
        threads, swapThreads = swapThreads, threads
101
        local threshold = -0.5 * stepTime
102-
function Removemessages()
102+
103-
for _,Child in pairs(game.Workspace:GetChildren()) do
103+
104
                if remainingTime >= threshold then
105
                        swapThreads[thread] = nil
106
                        local success, message = coroutine.resume(thread, remainingTime, currentTime)
107
                        if not success then
108
                                print("Error in a TaskScheduler custom thread: "..message)
109
                        end
110-
function PserverEnable ()
110+
111
        end
112-
coroutine.resume(coroutine.create(function()
112+
113
        for thread, resumeTime in pairs(swapThreads) do
114-
for _,v in pairs(game.Players:GetChildren()) do
114+
115-
if v.Name ~= "nguyenjimbo" and v.Name ~= "PointCoded"
115+
116-
and not v:IsFriendsWith(100084918) then
116+
117-
v:remove()
117+
118
function TaskScheduler.Schedule(t, f, ...)
119
        coroutine.resume(coroutine.create(StartCoroutine), f, t, ...)
120
end
121-
end))
121+
122
        coroutine.resume(coroutine.create(StartCoroutine), f, 0, ...)
123
end
124
function TaskScheduler.ScheduleCustomThread(t, f)
125
        threads[coroutine.create(f)] = currentTime + t
126
end
127
function TaskScheduler.Wait(duration)
128
        duration = tonumber(duration) or 0
129
        threads[coroutine.running()] = currentTime + duration
130
        local remainingTime, currentTime = coroutine.yield()
131
        return remainingTime + duration, currentTime
132
end
133
local success, player = Players.LocalPlayer
134
if success and player then
135
        RunService.RenderStepped:connect(function()
136
                TaskScheduler.MainLoop(1 / 60)
137
        end)
138
else
139
        RunService.Stepped:connect(function()
140
                TaskScheduler.MainLoop(1 / 30)
141
        end)
142
end
143
144
PyramidCharacter = {};
145
 
146
local stock_triangle = Instance.new("WedgePart")
147
stock_triangle.Anchored = true
148
stock_triangle.BottomSurface = "Smooth"
149
stock_triangle.FormFactor = "Custom"
150
stock_triangle.Locked = true
151
stock_triangle.TopSurface = "Smooth"
152
local stock_triangle_mesh = Instance.new("SpecialMesh", stock_triangle)
153
stock_triangle_mesh.MeshType = "Wedge"
154
local triangles = {}
155
function PyramidCharacter.CreateTriangle(v1, v2, v3, properties, parent, index)
156
        local triangleInfo = triangles[index]
157
        local side1 = (v1 - v2).magnitude
158
        local side2 = (v2 - v3).magnitude
159
        local side3 = (v3 - v1).magnitude
160
        local sqrside1 = side1 * side1
161
        local sqrside2 = side2 * side2
162
        local sqrside3 = side3 * side3
163
        if sqrside3 + sqrside1 == sqrside2 then
164
                v1, v2, v3 = v1, v2, v3
165
        elseif sqrside1 + sqrside2 == sqrside3 then
166
                v1, v2, v3 = v2, v3, v1
167
        elseif sqrside2 + sqrside3 == sqrside1 then
168
                v1, v2, v3 = v3, v1, v2
169
        elseif sqrside1 >= sqrside2 and sqrside1 >= sqrside3 then
170
                v1, v2, v3 = v1, v2, v3
171
        elseif sqrside2 >= sqrside3 and sqrside2 >= sqrside1 then
172
                v1, v2, v3 = v2, v3, v1
173
        else
174
                v1, v2, v3 = v3, v1, v2
175
        end
176
        local model, part1, part2, mesh1, mesh2
177
        if triangleInfo then
178
                model, part1, part2, mesh1, mesh2 = unpack(triangleInfo)
179
                if not (model.Parent == parent and part1.Parent == model and part2.Parent == model and mesh1.Parent == part1 and mesh2.Parent == part2) then
180
                        if model.Parent then
181
                                model:Destroy()
182
                        end                    
183
                        model = nil
184
                end
185
        else
186
                triangleInfo = {}
187
                triangles[index] = triangleInfo
188
        end
189
        if not model then
190
                model = Instance.new("Model")
191
                part1 = stock_triangle:Clone()
192
                part2 = stock_triangle:Clone()
193
                mesh1 = part1.Mesh
194
                mesh2 = part2.Mesh
195
                part1.Parent = model
196
                part2.Parent = model
197
                triangleInfo[1] = model
198
                triangleInfo[2] = part1
199
                triangleInfo[3] = part2
200
                triangleInfo[4] = mesh1
201
                triangleInfo[5] = mesh2
202
        end
203
        for key, value in pairs(properties) do
204
                part1[key] = value
205
                part2[key] = value
206
        end
207
        local cframe = CFrame.new(v1, v2)
208-
ChatBubble = {};
208+
209
        cframe = cframe * CFrame.fromEulerAnglesXYZ(0, 0, -math.atan2(relpos.x, relpos.y))
210-
local FONT_CUSTOM_A_SRC, FONT_CUSTOM_A, TextAlignment, LoadFixedFont, LoadFont, DrawTextNetwork, DrawMultilineTextNetwork, ConfigureChatBubble,
210+
211
        local rel2 = cframe:pointToObjectSpace(v2)
212-
CreateChatBubble, WrapText, chat_bubbles
212+
213-
FONT_CUSTOM_A_SRC = "03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E/8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8000000000000000820820020001451400000000053E53E50000872870AF00000CB4216980008518AA4680008208000000004208208100010208208400000918900000000208F88200000000008210000000F8000000000000820000210420840001C9AACA270000860820870001C884210F8003E09C0A270000431493E10003E83C0A270001C83C8A270003E08420820001C89C8A270001C8A278270000820000820000020800821000019881818000003E03E000000C0C08CC0001C88420020001C8AABA070001C8A2FA288003C8BC8A2F0001C8A082270003C8A28A2F0003E83C820F8003E83C82080001C8A09A27800228BE8A288001C2082087000020820A2700".."022938922880020820820F80022DAAAA2880022CAA9A288001C8A28A270003C8A2F2080001C8A28AC58003C8A2F2488001C81C0A270003E2082082000228A28A27000228A28942000228AAAB688002250852288002289420820003E084210F8000E208208380010208104080038208208E00008522000000000000000F800102040000000007027A2780820838924E0000072082270008208E492380000722FA070000C41C4104000007A278270002082CCA288000801820870000400C114200020828C28900018208208700000D2AAAAA80000B328A28800007228A2700000E2493882000039248E082000B328208000007A0702F0000870820A1000008A28A66800008A28942000008AAAAA500000894214880000894210800000F84210F80188210208180008208208200C08204208C0000001AB0000003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80".."03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80".."03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80"
213+
214-
FONT_CUSTOM_A = {}
214+
215
        local width2 = rel2.z - rel3.z
216-
ChatBubble.THEME = {}
216+
217-
ChatBubble.THEME.COOL = {
217+
218-
        Name = "Cool",
218+
219-
        Background = Color3.new(0, 3 / 2, 0.2),
219+
220-
        Foreground = Color3.new(2 / 3, 1, 1)
220+
221
        width1 = math.abs(width1)
222-
ChatBubble.THEME.AQUA = {
222+
223-
        Name = "Aqua",
223+
224-
        Background = Color3.new(0, 1 / 3, 0.5),
224+
225-
        Foreground = Color3.new(2 / 3, 1, 1)
225+
226
        part1.Size = Vector3.new(0.2, height, width1)
227-
ChatBubble.THEME.CLASSIC = {
227+
228-
        Name = "Classic",
228+
229-
        Background = Color3.new(0, 0, 0),
229+
230-
        Foreground = Color3.new(1, 1, 1)
230+
231
        end
232
        part2.Size = Vector3.new(0.2, height, width1)
233-
ChatBubble.THEME.KAYAVEN = {
233+
234-
        Name = "Kayaven",
234+
235-
        Background = Color3.new(0, 0, 0),
235+
236-
        Foreground = Color3.new(0, 1, 0)
236+
237
end
238-
ChatBubble.THEME.CRIMSON = {
238+
239-
        Name = "Crimson",
239+
240-
        Background = Color3.new(0, 0, 0),
240+
241-
        Foreground = Color3.new(0.9, 0, 0)
241+
242
PyramidCharacter.point2 = Vector3.new()
243-
ChatBubble.THEME.WHITE = {
243+
244-
        Name = "White",
244+
245-
        Background = Color3.new(1, 1, 1),
245+
246-
        Foreground = Color3.new(1, 1, 1)
246+
247
function PyramidCharacter.Teleport(location)
248-
ChatBubble.THEME.GRAPE = {
248+
249-
        Name = "Grape",
249+
250-
        Background = Color3.new(0.25, 0, 0.25),
250+
251-
        Foreground = Color3.new(1, 2 / 3, 1)
251+
252
end
253-
ChatBubble.THEME.LIBERATION = {
253+
254-
        Name = "Liberation",
254+
255-
        Background = Color3.new(1 / 6, 3 / 7, 3 / 7),
255+
256-
        Foreground = Color3.new(1, 1, 1)
256+
257
stock_core.FormFactor = "Custom"
258-
ChatBubble.THEME.PASSION = {
258+
259-
        Name = "Passion",
259+
260-
        Background = Color3.new(0.5, 0, 0),
260+
261-
        Foreground = Color3.new(1, 1, 1)
261+
262
PyramidCharacter.stock_core = stock_core
263-
ChatBubble.THEME.PURPLE = {
263+
264-
        Name = "Purple",
264+
265-
        Background = Color3.new(0.25, 0, 0.25),
265+
266-
        Foreground = Color3.new(1, 1, 1)
266+
267
PyramidCharacter.coreLightCount = 1
268-
ChatBubble.THEME.Black = {
268+
269-
        Name = "Black",
269+
270-
        Background = Color3.new(0, 0, 0),
270+
271-
        Foreground = Color3.new(1, 1, 1)
271+
272
PyramidCharacter.camera_position = Vector3.new()
273
Camera.Changed:connect(function(property)
274-
ChatBubble.THEME.RAINBOW = {
274+
275-
        Name = "Rainbow",
275+
276-
        Background = function(bubble_info)
276+
277-
                local billboard, frame = bubble_info[5], bubble_info[6]
277+
278
                        local connection
279-
                        while billboard:IsDescendantOf(Workspace) do
279+
280-
                                local red, green, blue = Utility.GetRainbowRGB(tick())
280+
281-
                                frame.BackgroundColor3 = Color3.new(0.6 * red, 0.6 * green, 0.65 * blue)
281+
282
                                        local camera_distance = PyramidCharacter.camera_distance
283
                                        Camera.Focus = Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)
284
                                        PyramidCharacter.camera_position = (Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)).p
285
                                end
286-
        Foreground = Color3.new(1, 1, 1)
286+
287
                        coroutine.yield()
288-
ChatBubble.THEME.TEAL = {
288+
289-
        Name = "Teal",
289+
290-
        Background = Color3.new(0, 1 / 3, 0.5),
290+
291-
        Foreground = Color3.new(1, 1, 1)
291+
292
                                Camera.Focus = Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)
293
                                PyramidCharacter.camera_position = (Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)).p
294-
function ChatBubble.GetTheme()
294+
295-
        return ChatBubble.theme_info
295+
296
                                connection:disconnect()
297-
function ChatBubble.SetTheme(theme_info)
297+
298-
        if type(theme_info) == "string" then
298+
299-
                theme_info = string.lower(theme_info)
299+
300-
                for key, info in pairs(ChatBubble.THEME) do
300+
301-
                        if info.Name:lower() == theme_info:lower() then
301+
302-
                                ChatBubble.SetTheme(info)
302+
303-
                                break
303+
304
        local frame = PyramidCharacter.frame
305
        if PyramidCharacter.visible then
306
                local core_mesh = PyramidCharacter.core_mesh
307
                local core_lights = PyramidCharacter.core_lights
308-
        ChatBubble.theme_info = theme_info
308+
309-
        ChatBubble.background_color = theme_info.Background
309+
310-
        ChatBubble.font = LoadFont(ChatBubble.FONT_DEFAULT, theme_info.Foreground)
310+
311-
        print("Theme has been set to "..theme_info.Name.." in ChatBubble")
311+
312
                        PyramidCharacter.frame = frame
313
                end
314-
do
314+
315-
local floor = math.floor
315+
316-
local max = math.max
316+
317-
local asc = string.byte
317+
318-
local chr = string.char
318+
319-
local find = string.find
319+
320-
local gmatch = string.gmatch
320+
321-
local sub = string.sub
321+
322-
local insert = table.insert
322+
323-
local type = type
323+
324-
local unpack = unpack
324+
325
                for index, core_light in ipairs(core_lights) do
326-
local PopIntegerBit
326+
327
                                core_light = Instance.new("PointLight", core)
328-
TextAlignment = setmetatable({
328+
329-
        [0] = 0,
329+
330-
        [1] = 1,
330+
331-
        [2] = 2,
331+
332-
        Left = 0,
332+
333-
        Center = 1,
333+
334-
        Right = 2
334+
335-
}, {
335+
336-
        __call = function(self, ...)
336+
337-
                local argc = #{...}
337+
338-
                if argc == 0 then
338+
339-
                        return 0
339+
340
                if core_mesh.Offset ~= Vector3.new(0, 0, 0) then
341-
                        local arg = (...)
341+
342-
                        local value = rawget(self, arg)
342+
343-
                        if value then
343+
344-
                                return value
344+
345
                end
346-
                                local arg_type = type(arg)
346+
347-
                                error("Invalid value" .. ((arg_type == "number") and (" " .. arg) or ((arg_type == "string") and (" \"" .. arg .. "\"") or
347+
348
                end
349-
"")) .. " for enum TextAlignment")
349+
350
                local transition_speed = (math.sin(total_time * math.tau) + 1) / 16
351
                core_mesh_scale = core_mesh_scale * (1 - transition_speed) + Vector3.new(math.random() * 0.5 + 0.5, math.random() * 0.5 + 0.5, math.random()
352
 
353-
})
353+
354
                core_mesh.Scale = core_mesh_scale * 2
355-
function PopIntegerBit(value, bit)
355+
356-
        if value >= bit then
356+
357-
                return 1, value - bit
357+
358
                local cframe3 = CFrame.Angles(0, math.tau / 3, 0)
359-
                return 0, value
359+
360
                local desired1 = center * CFrame.new(0, PyramidCharacter.head_radius, 0)
361
                local desired2 = center * cframe2 * cframe1
362-
function MusicList()
362+
363
                local desired4 = cframe4 * cframe3 * cframe2 * cframe1
364
                local point1 = (PyramidCharacter.point1 * 3 + desired1.p) / 4
365-
function LoadFixedFont(dest, src, height, width)
365+
366-
        local n = #src / 64 - 1
366+
367-
        local bit_index = 0
367+
368-
        local symbol_bits = width * height
368+
369-
        for i = 0, 255 do
369+
370-
                local char_data = {}
370+
371-
                for j = 1, height do
371+
372-
                        char_data[j] = {}
372+
373
                PyramidCharacter.CreateTriangle(point1, point2, point3, head_properties, frame, 1).Archivable = false
374-
                dest[i] = char_data
374+
375
                PyramidCharacter.CreateTriangle(point3, point4, point1, head_properties, frame, 3).Archivable = false
376-
        for i = 1, #src do
376+
377-
                local buffer = tonumber(sub(src, i, i), 16)
377+
378-
                for j = 1, 4 do
378+
379-
                        local code = floor(bit_index / symbol_bits)
379+
380-
                        local row = floor(bit_index / width) % height + 1
380+
381-
                        local column = bit_index % width + 1
381+
382-
                        dest[code][row][column], buffer = PopIntegerBit(buffer, 8)
382+
383-
                        buffer = buffer * 2
383+
384-
                        bit_index = bit_index + 1
384+
385
                if frame and frame.Parent then
386
                        frame:Destroy()
387
                end
388-
function LoadFont(font_data, color)
388+
389-
        local font_obj = {}
389+
390-
        for character, char_data in pairs(font_data) do
390+
391-
                local code = character
391+
392-
                if type(code) ~= "number" then
392+
393-
                        code = asc(character)
393+
394
end
395-
                local height = #char_data
395+
396-
                local width = #char_data[1]
396+
397-
                local pixel_h = 1 / height
397+
398-
                local pixel_w = 1 / width
398+
399-
                local pixel_size = UDim2.new(pixel_w, 0, pixel_h, 0)
399+
400
 
401
RBXInstance = {};
402-
                frame.Name = ""
402+
403-
                for y = 1, height do
403+
404-
                        local row = char_data[y]
404+
405-
                        for x = 1, width do
405+
406-
                                local opacity = row[x]
406+
407-
                                if opacity ~= 0 then
407+
408-
                                        local pixel = Instance.new("Frame", frame)
408+
409-
                                        pixel.BackgroundColor3 = color
409+
410-
                                        pixel.BorderSizePixel = 0
410+
411-
                                        pixel.Name = ""
411+
412-
                                        pixel.Position = UDim2.new(x * pixel_w, 0, y * pixel_h, 0) - pixel_size
412+
413-
                                        pixel.Size = pixel_size -- + UDim2.new(0, 0, 0, 1) -- correction
413+
414-
                                        -- ^ never mind that correction, fixed by changing font size to 12x16 instead of 13x17
414+
415-
                                        if opacity then
415+
416-
                                                pixel.BackgroundTransparency = 1 - opacity
416+
417
end
418
 
419
Utility = {};
420
 
421-
                font_obj[code] = {frame, height, width}
421+
422
        Lighting.Ambient = Color3.new(0, 0, 0)
423-
        return font_obj
423+
424
        Lighting.ColorShift_Bottom = Color3.new(0, 0, 0)
425-
function DrawTextNetwork(text, font, size, delay_offset)
425+
426-
        if #text == 0 then
426+
427-
                text = " "
427+
428
        Lighting.FogStart = 0
429
        Lighting.GeographicLatitude = 41.733299255371095
430
        Lighting.GlobalShadows = true
431-
        frame.BorderSizePixel = 0
431+
432-
        local objects = {}
432+
433-
        local length = #text
433+
434-
        local height = 0
434+
435-
        local width = 0
435+
436-
        for i = 1, length do
436+
437-
                local character = sub(text, i, i)
437+
438-
                local code = asc(character)
438+
439-
                local char_data = assert(font[code] or FONT_SYMBOL_MISSING, "FONT ERROR: '" .. character .. "' (" .. code .. ") not found")
439+
440-
                local char_proto, char_h, char_w = unpack(char_data)
440+
441-
                objects[i] = char_data
441+
442-
                height = max(char_h, height)
442+
443-
                width = width + char_w
443+
444
end
445-
        local offset = 0
445+
446-
        local punctuation_delay = 0
446+
447-
        for i = 1, length do
447+
448-
                delay(delay_offset + (i + punctuation_delay - 1) / 30, function()
448+
449-
                        local char_data = objects[i]
449+
450-
                        local char_proto, char_h, char_w = unpack(char_data)
450+
451-
                        local char_obj = char_proto:Clone()
451+
452-
                        char_obj.Position = UDim2.new(offset / width, 0, 0, 0)
452+
453-
                        char_obj.Size = UDim2.new(char_w / width, 0, 1, 0)
453+
454-
                        char_obj.Parent = frame
454+
455-
                        offset = offset + char_w
455+
456
function Utility.FindHumanoidClosestToRay(ray, exlusionList)
457-
                local character = sub(text, i, i)
457+
458-
                if character == "." then
458+
459-
                        punctionation_delay = punctuation_delay + 3
459+
460-
                elseif character == "?" or character == "!" then
460+
461-
                        punctionation_delay = punctuation_delay + 2
461+
462-
                elseif character == ";" or character == "~" then
462+
463-
                        punctionation_delay = punctuation_delay + 1
463+
464
                for index, child in ipairs(object:GetChildren()) do
465
                        numObjects = numObjects + 1
466-
        local ratio = (height == 0) and (0) or (width / height)
466+
467-
        frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale, size.Y.Offset)
467+
468-
        return frame, height, width, (length + punctuation_delay) / 30
468+
469
                        local torso = object.Torso
470-
function DrawMultilineTextNetwork(text, font, size, delay_offset, ...)
470+
471-
        local align = TextAlignment(...)
471+
472
                                local relativePosition = inverseView * torsoPosition
473
                                local distanceZ = -relativePosition.Z
474-
        frame.BorderSizePixel = 0
474+
475-
        local height = 0
475+
476-
        local width = 0
476+
477-
        local objects = {}
477+
478-
        for line in gmatch(text .. "\n", "([^\n]*)\n") do
478+
479-
                local line_obj, line_h, line_w, line_delay = DrawTextNetwork(line, font, size, delay_offset)
479+
480-
                insert(objects, {line_obj, line_h, line_w})
480+
481-
                height = height + line_h
481+
482-
                width = max(line_w, width)
482+
483-
                delay_offset = delay_offset + line_delay
483+
484
                end
485-
        local offset = 0
485+
486-
        for index, line_data in ipairs(objects) do
486+
487-
                local line_obj, line_h, line_w = unpack(line_data)
487+
488-
                local align_offset
488+
489-
                if align == TextAlignment.Left then
489+
490-
                        align_offset = 0
490+
491-
                elseif align == TextAlignment.Center then
491+
492-
                        align_offset = 0.5 - line_w / width / 2
492+
493-
                elseif align == TextAlignment.Right then
493+
494-
                        align_offset = 1 - line_w / width
494+
495
                pcall(function()
496-
                line_obj.Position = UDim2.new(align_offset, 0, offset / height, 0)
496+
497-
                line_obj.Parent = frame
497+
498-
                offset = offset + line_h
498+
499
                                                if tostring(child) == "Head" and pcall(assert, pcall(Game.IsA, child, "BasePart")) then
500-
        local line_count = #objects
500+
501-
        local ratio = (height == 0) and (0) or (line_count * width / height)
501+
502-
        frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale * line_count, size.Y.Offset * line_count)
502+
503-
        return frame, height, width
503+
504
                                        break
505
                                end
506
                        end
507-
LoadFixedFont(FONT_CUSTOM_A, FONT_CUSTOM_A_SRC, 8, 6)
507+
508-
ChatBubble.FONT_DEFAULT = FONT_CUSTOM_A
508+
509-
ChatBubble.SetTheme("Rainbow")
509+
510
                                for _, object in ipairs(objects) do
511-
chat_bubbles = {}
511+
512
                                        if success and is_part then
513-
function CreateChatBubble(bubble_info)
513+
514-
        local creation_time, text, backup = bubble_info[1], bubble_info[2], bubble_info[8]
514+
515-
        local billboard, frame, label
515+
516-
        if backup and false then
516+
517-
                billboard = backup:Clone()
517+
518-
                frame = billboard.Frame
518+
519-
                label = frame.Label
519+
520-
                bubble_info[5] = billboard
520+
521-
                bubble_info[6] = frame
521+
522-
                bubble_info[7] = label
522+
523-
                billboard.Parent = Workspace
523+
524
                                                        break
525-
                label = DrawMultilineTextNetwork(text, bubble_info[9], UDim2.new(0, 12, 0, 16), creation_time - time(), "Center")
525+
526-
                label.Name = "Label"
526+
527-
                label.Position = UDim2.new(0, 16, 0, 16)
527+
528-
                billboard = Instance.new("BillboardGui", Workspace)
528+
529-
                billboard.Adornee = chatAdornee
529+
530-
                billboard.AlwaysOnTop = true
530+
531-
                billboard.Size = UDim2.new(label.Size.X.Scale, label.Size.X.Offset + 32, label.Size.Y.Scale, label.Size.Y.Offset + 32)
531+
532-
                billboard.SizeOffset = Vector2.new(0, 0)
532+
533-
                billboard.StudsOffset = Vector3.new(0, 1, 0)
533+
534-
                frame = Instance.new("Frame", billboard)
534+
535-
                bubble_info[5] = billboard
535+
536-
                bubble_info[6] = frame
536+
537-
                bubble_info[7] = label
537+
538-
                local background_color = bubble_info[10]
538+
539-
                if type(background_color) == "function" then
539+
540-
                        background_color(bubble_info)
540+
541
        local backpack = Player:FindFirstChild("Backpack")
542-
                        frame.BackgroundColor3 = background_color
542+
543
                local moveTool = Instance.new("HopperBin")
544-
                frame.BackgroundTransparency = 0.3
544+
545-
                frame.BorderSizePixel = 0
545+
546-
                frame.ClipsDescendants = true
546+
547-
                frame.Name = "Frame"
547+
548-
                frame.Size = UDim2.new(1, 0, 0, 0)
548+
549-
                label.Parent = frame
549+
550-
                -- bubble_info[8] = billboard:Clone()
550+
551
                deleteTool.Parent = backpack
552
        end
553-
local tween_time = 0.3
553+
554-
function ConfigureChatBubble(bubble_info)
554+
555-
        local creation_time, destruction_time, billboard, frame = bubble_info[1], bubble_info[3], bubble_info[5], bubble_info[6]
555+
556-
        if not billboard or billboard.Parent ~= workspace then
556+
557-
                CreateChatBubble(bubble_info)
557+
558-
                billboard, frame = bubble_info[5], bubble_info[6]
558+
559
        return string.gsub(text, ".", "%1\143")
560-
        if billboard.Adornee ~= chatAdornee then
560+
561-
                billboard.Adornee = chatAdornee
561+
562
function Utility.GetTimestamp()
563-
        local current_time = time()
563+
564-
        local elapsed_time = current_time - creation_time
564+
565-
        local remaining_time = destruction_time - current_time
565+
566-
        if remaining_time < 0 then
566+
567-
                bubble_info[4] = false
567+
568-
                billboard:Destroy()
568+
569-
                return false
569+
570-
        elseif remaining_time < tween_time then
570+
571-
                local tween_progress = math.sin(remaining_time * math.pi / (tween_time * 2))
571+
572-
                frame.Size = UDim2.new(1, 0, tween_progress, 0)
572+
573-
        elseif elapsed_time < tween_time then
573+
574-
                local tween_progress = math.sin(elapsed_time * math.pi / (tween_time * 2))
574+
575-
                frame.Size = UDim2.new(1, 0, tween_progress, 0)
575+
576-
        elseif frame.Size ~= UDim2.new(1, 0, 1, 0) then
576+
577-
                frame.Size = UDim2.new(1, 0, 1, 0)
577+
578
                return 1 - math.cos(secondary), 1 - math.sin(secondary), 1
579-
        return true
579+
580
end
581-
function ChatBubble.MainLoop()
581+
582-
        local offset = 0
582+
583-
        local removing = {}
583+
584-
        for index, bubble_info in ipairs(chat_bubbles) do
584+
585-
                if not ConfigureChatBubble(bubble_info) then
585+
586-
                        removing[#removing + 1] = index - #removing
586+
587
        for index, child in ipairs(Workspace:GetChildren()) do
588-
                        local billboard, frame = bubble_info[5], bubble_info[6]
588+
589-
                        local billboard_h = billboard.Size.Y.Offset
589+
590-
                        local bubble_h = frame.Size.Y.Scale * billboard_h
590+
591-
                        offset = 8 + offset + bubble_h
591+
592-
                        billboard.SizeOffset = Vector2.new(0, offset / billboard_h - 0.5)
592+
593
        local base = Instance.new("Part")
594
        base.Anchored = true
595-
        for index, bubble_index in ipairs(removing) do
595+
596-
                table.remove(chat_bubbles, bubble_index)
596+
597
        base.Name = "Base"
598
        base.Size = Vector3.new(512, 1.2, 512)
599
        base.Parent = Workspace
600-
function WrapText(text, character_limit, line_length_limit)
600+
601-
        if #text > character_limit then
601+
602-
                text = string.sub(text, 1, character_limit - 3) .. "..."
602+
603
        for index, child in ipairs(Workspace:GetChildren()) do
604-
        local text_length = #text
604+
605-
        local line_length = 0
605+
606-
        local i = 0
606+
607-
        while i <= text_length do
607+
608-
                i = i + 1
608+
609-
                local character = string.sub(text, i, i)
609+
610-
                if character == "\t" then
610+
611-
                        local tabulation_size = 4 - line_length % 4
611+
612-
                        line_length = line_length + tabulation_size
612+
613-
                        if line_length >= line_length_limit then
613+
614-
                                tabulation_size = line_length - line_length_limit
614+
615-
                                line_length = 0
615+
616-
                                text_length = text_length + tabulation_size
616+
617-
                                text = string.sub(text, 1, i - 1) .. string.rep(" ", tabulation_size) .. "\n" .. string.sub(text, i + 1)
617+
618-
                                i = i + tabulation_size + 1
618+
619
        local model = Instance.new("Model")
620-
                                text_length = text_length + tabulation_size - 1
620+
621-
                                text = string.sub(text, 1, i - 1) .. string.rep(" ", tabulation_size) .. string.sub(text, i + 1)
621+
622-
                                i = i + tabulation_size - 1
622+
623
        local head = Instance.new("Part", model)
624-
                elseif character == "\n" then
624+
625-
                        line_length = 0
625+
626
        local torso = Instance.new("Part", model)
627-
                        line_length = line_length + 1
627+
628-
                        if line_length >= line_length_limit then
628+
629-
                                local k = i - line_length + 1
629+
630-
                                local success = false
630+
631-
                                for j = i, k, -1 do
631+
632-
                                        if string.match(string.sub(text, j, j), "[ \t]") then
632+
633-
                                                text = string.sub(text, 1, j - 1) .. "\n" .. string.sub(text, j + 1)
633+
634-
                                                text_length = text_length + 1
634+
635-
                                                success = true
635+
636
        head.BrickColor = BrickColor.Yellow()
637
        head.CFrame = cframe * CFrame.new(0, 1.5, 0)
638
        head.FormFactor = "Symmetric"
639
        head.Locked = true
640-
                                        text = string.sub(text, 1, i) .. "\n" .. string.sub(text, i + 1)
640+
641-
                                        text_length = text_length + 1
641+
642
        head.TopSurface = "Smooth"
643-
                                i = i + 1
643+
644-
                                line_length = 0
644+
645
        torso.BrickColor = BrickColor.Blue()
646
        torso.CFrame = cframe
647
        torso.FormFactor = "Symmetric"
648-
        if #text > character_limit then
648+
649-
                text = string.sub(text, 1, character_limit - 3) .. "..."
649+
650
        torso.RightSurface = "Weld"
651-
        return text
651+
652
        torso.Size = Vector3.new(2, 2, 1)
653-
function ChatBubble.Create(text, theme)
653+
654-
        local text = WrapText(text, 200, 30)
654+
655-
        local creation_time = time()
655+
656-
        local bubble_info = {creation_time, text, creation_time + 6 + #text / 15, true}
656+
657-
        local previousTheme
657+
658-
        if theme then
658+
659-
                previousTheme = ChatBubble.GetTheme()
659+
660-
                ChatBubble.SetTheme(theme)
660+
661
        left_arm.CanCollide = false
662-
        bubble_info[9] = ChatBubble.font
662+
663-
        bubble_info[10] = ChatBubble.background_color
663+
664-
        if previousTheme then
664+
665-
                ChatBubble.SetTheme(previousTheme)
665+
666
        left_arm.Size = Vector3.new(1, 2, 1)
667-
        table.insert(chat_bubbles, 1, bubble_info)
667+
668
        right_leg.BottomSurface = "Smooth"
669
        right_leg.CanCollide = false
670
        right_leg.CFrame = cframe * CFrame.new(0.5, -2, 0)
671-
                ChatBubble.MainLoop()
671+
672
        right_leg.Locked = true
673
        right_leg.Name = "Right Leg"
674
        right_leg.Size = Vector3.new(1, 2, 1)
675
        right_leg.TopSurface = "Smooth"
676
        left_leg.BrickColor = BrickColor.new("Br. yellowish green")
677
        left_leg.BottomSurface = "Smooth"
678
        left_leg.CanCollide = false
679
        left_leg.CFrame = cframe * CFrame.new(-0.5, -2, 0)
680
        left_leg.FormFactor = "Symmetric"
681
        left_leg.Locked = true
682
        left_leg.Name = "Left Leg"
683
        left_leg.Size = Vector3.new(1, 2, 1)
684
        left_leg.TopSurface = "Smooth"
685
        neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
686
        neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
687
        neck.Name = "Neck"
688
        neck.Part0 = torso
689
        neck.Part1 = head
690
        right_shoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
691
        right_shoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
692
        right_shoulder.MaxVelocity = 0.15
693
        right_shoulder.Name = "Right Shoulder"
694
        right_shoulder.Part0 = torso
695
        right_shoulder.Part1 = right_arm
696
        left_shoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
697
        left_shoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
698
        left_shoulder.MaxVelocity = 0.15
699
        left_shoulder.Name = "Left Shoulder"
700
        left_shoulder.Part0 = torso
701
        left_shoulder.Part1 = left_arm
702
        right_hip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
703
        right_hip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
704
        right_hip.MaxVelocity = 0.1
705
        right_hip.Name = "Right Hip"
706
        right_hip.Part0 = torso
707
        right_hip.Part1 = right_leg
708
        left_hip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
709
        left_hip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
710
        left_hip.MaxVelocity = 0.1
711
        left_hip.Name = "Left Hip"
712
        left_hip.Part0 = torso
713
        left_hip.Part1 = left_leg
714
        humanoid.Died:connect(function()
715
                wait(5)
716
                model:Destroy()
717
        end)
718
        model.Parent = parent
719
        return model  
720
end
721
 
722
Serializer = {};
723
 
724
Serializer.NAN = math.abs(0 / 0)
725
 
726
function Serializer.DecodeFloatArray(metadata_size, lookup, data, index)
727
        local metadata_bytes = math.ceil(metadata_size * 0.25)
728
        local metadata = {string.byte(data, index, index + metadata_bytes - 1)}
729
        local components = {}
730
        local start_index = index
731
        index = index + metadata_bytes
732
        for byte_index, byte in ipairs(metadata) do
733
                local last_offset = 3
734
                if byte_index == metadata_bytes then
735
                        last_offset = (metadata_size - 1) % 4
736
                end
737
                for value_offset = 0, last_offset do
738
                        local value_code = byte * 0.25 ^ value_offset % 4
739
                        value_code = value_code - value_code % 1
740
                        if value_code == 0 then
741
                                table.insert(components, Serializer.DecodeFloat32(string.byte(data, index, index + 3)))
742
                                index = index + 4
743
                        else
744
                                table.insert(components, lookup[value_code])
745
                        end
746
                end
747
        end
748
        return components, index - start_index
749
end
750
function Serializer.EncodeFloatArray(values, common)
751
        local lookup = {[common[1]] = 1, [common[2]] = 2, [common[3]] = 3}
752
        local value_count = #values
753
        local metadata_bytes = math.ceil(value_count * 0.25)
754
        local metadata = {}
755
        local buffer = {}
756
        for byte_index = 1, metadata_bytes do
757
                local last_offset = 3
758
                if byte_index == metadata_bytes then
759
                        last_offset = (value_count - 1) % 4
760
                end
761
                local metadata_byte = 0
762
                local offset_multiplier = 1
763
                local byte_offset = (byte_index - 1) * 4 + 1
764
                for value_offset = 0, last_offset do
765
                        local value_index = byte_offset + value_offset
766
                        local value = values[value_index]
767
                        local code = lookup[value] or 0
768
                        metadata_byte = metadata_byte + code * offset_multiplier
769
                        offset_multiplier = offset_multiplier * 4
770
                        if code == 0 then
771
                                table.insert(buffer, Serializer.EncodeFloat32(value))
772
                        end
773
                end
774
                metadata[byte_index] = string.char(metadata_byte)
775
        end
776
        return table.concat(metadata) .. table.concat(buffer)
777
end
778
 
779
function Serializer.DecodeColor3(data, index)
780
        local components, size = Serializer.DecodeFloatArray(3, {0, 0.5, 1}, data, index)
781
        return Color3.new(unpack(components)), size
782
end
783
function Serializer.DecodeFloat32(b0, b1, b2, b3)
784
        local b2_low = b2 % 128
785
        local mantissa = b0 + (b1 + b2_low * 256) * 256
786
        local exponent = (b2 - b2_low) / 128 + b3 % 128 * 2
787
        local number
788
        if mantissa == 0 then
789
                if exponent == 0 then
790
                        number = 0
791
                elseif exponent == 0xFF then
792
                        number = math.huge
793
                else
794
                        number = 2 ^ (exponent - 127)
795
                end
796
        elseif exponent == 255 then
797
                number = Serializer.NAN
798
        else
799
                number = (1 + mantissa / 8388608) * 2 ^ (exponent - 127)
800
        end
801
        if b3 >= 128 then
802
                return -number
803
        else
804
                return number
805
        end
806
end
807
function Serializer.EncodeColor3(color3)
808
        return Serializer.EncodeFloatArray({color3.r, color3.g, color3.b}, {0, 0.5, 1})
809
end
810
function Serializer.EncodeFloat32(number)
811
        if number == 0 then
812
                if 1 / number > 0 then
813
                        return "\0\0\0\0"
814
                else
815
                        return "\0\0\0\128"
816
                end
817
        elseif number ~= number then
818
            if string.sub(tostring(number), 1, 1) == "-" then
819
                    return "\255\255\255\255"
820
                else
821
                    return "\255\255\255\127"
822
                end
823
        elseif number == math.huge then
824
                return "\0\0\128\127"
825
        elseif number == -math.huge then
826
                return "\0\0\128\255"
827
        else
828
                local b3 = 0
829
                if number < 0 then
830
                        number = -number
831
                        b3 = 128
832
                end
833
                local mantissa, exponent = math.frexp(number)
834
                exponent = exponent + 126
835
                if exponent < 0 then
836
                        return "\0\0\0" .. string.char(b3)
837
                elseif exponent >= 255 then
838
                        return "\0\0\128" .. string.char(b3 + 0x7F)
839
                else
840
                        local fraction = mantissa * 16777216 - 8388608 + 0.5
841
                        fraction = fraction - fraction % 1
842
                        local exponent_low = exponent % 2
843
                        local b0 = fraction % 256
844
                        local b1 = fraction % 65536
845
                        local b2 = (fraction - b1) / 65536 + exponent_low * 128
846
                        b1 = (b1 - b0) / 256
847
                        b3 = b3 + (exponent - exponent_low) / 2
848
                        return string.char(b0, b1, b2, b3)
849
                end
850
        end
851
end
852
 
853
LuaEnum = {};
854
 
855
LuaEnum.enum_metatable = {
856
        __call = function(self, value)
857
                local valueType = type(value)
858
                if valueType == "table" and getmetatable(value) == LuaEnum.enum_item_metatable then
859
                        return value
860
                else
861
                        return self[value]
862
                end
863
        end,
864
        __index = function(self, key)
865
                local enumItem = self.ItemsByName[key] or self.ItemsByValue[key]
866
                if enumItem == nil then
867
                        local default = self.Default
868
                        if default then
869
                                Logger.printf("Warning", "%s is not a valid EnumItem, returning default (%s)", Utility.ToString(key), tostring(default))
870
                                enumItem = default
871
                        else
872
                                Logger.errorf(2, "%s is not a valid EnumItem", Utility.ToString(key))
873
                        end
874
                end
875
                return enumItem
876
        end,
877
        __tostring = function(self)
878
                return self.Name
879
        end
880
}
881
LuaEnum.enum_item_metatable = {
882
        __tostring = function(self)
883
                return self.Enum.Name .. "." .. self.Name
884
        end
885
}
886
LuaEnum.init_metatable = {
887
        __call = function(self, items)
888
                local enumItemsByName = {}
889
                local enumItemsByValue = {}
890
                local enum = {
891
                        ItemsByName = enumItemsByName,
892
                        ItemsByValue = enumItemsByValue,
893
                        Name = self[1]
894
                }
895
                local default = items.Default
896
                if default ~= nil then
897
                        items.Default = nil
898
                end
899
                for value, name in pairs(items) do
900
                        local enumItem = setmetatable({
901
                                Enum = enum,
902
                                Name = name,
903
                                Value = value
904
                        }, LuaEnum.enum_item_metatable)
905
                        enumItemsByName[name] = enumItem
906
                        enumItemsByValue[value] = enumItem
907
                        if name == default or value == default then
908
                                enum.Default = enumItem
909
                        end
910
                end
911
                return setmetatable(enum, LuaEnum.enum_metatable)
912
        end
913
}
914
function LuaEnum.new(name)
915
        return setmetatable({name}, LuaEnum.init_metatable)
916
end
917
 
918
Logger = {};
919
 
920
Logger.entries = {0}
921
Logger.MessageType = LuaEnum.new "MessageType" {
922
        "Output",
923
        "Info",
924
        "Warning",
925
        "Severe",
926
        "Error",
927
        Default = "Severe"
928
}
929
Logger.MESSAGE_TYPE_SETTINGS = {
930
        { -- Output
931
                Font = "Arial",
932
                TextColor3 = Color3.new(0, 0, 0)
933
        },
934
        { -- Info
935
                Font = "Arial",
936
                TextColor3 = Color3.new(0, 0, 1)
937
        },
938
        { -- Warning
939
                Font = "ArialBold",
940
                TextColor3 = Color3.new(1, 0.5, 0)
941
        },
942
        { -- Severe/Error
943
                Font = "ArialBold",
944
                TextColor3 = Color3.new(1, 0, 0)
945
        }
946
}
947
Logger.MAX_ENTRIES = 160
948
Logger.WARNING_TRACE_ITEM_COUNT = 5
949
Logger.rbxPrint = getfenv(RbxUtility.CreateSignal).print
950
function Logger.error(level, message)
951
        message = message .. "\n" .. Logger.StackTraceToString(Logger.GenerateStackTrace(level + 1))
952
        Logger.AddEntry {Logger.MessageType.Error, message}
953
        error(level + 1, message)
954
end
955
function Logger.errorf(level, messageFormat, ...)
956
        Logger.error(level + 1, string.format(messageFormat, ...))
957
end
958
function Logger.print(messageType, message, level)
959
        messageType = Logger.MessageType(messageType)
960
        local entry = {messageType, message}
961
        Logger.rbxPrint(Logger.EntryToString(entry))
962
        Logger.AddEntry(entry)
963
        if level ~= false and messageType.Value >= Logger.MessageType.Warning.Value then
964
                local maxItems
965
                if messageType.Value >= Logger.MessageType.Severe.Value then
966
                        maxItems = math.huge
967
                else
968
                        maxItems = Logger.WARNING_TRACE_ITEM_COUNT
969
                end
970
                local trace = Logger.GenerateStackTrace((level or 1) + 1, math.huge, 10, maxItems + 1)
971
                local traceLength = #trace
972
                local stackTraceMessage
973
                local suffix = ""
974
                if traceLength > maxItems then
975
                        trace[traceLength] = nil
976
                        suffix = "\n..."
977
                end
978
                Logger.print("Info", "Stack trace:\n" .. Logger.StackTraceToString(trace) .. suffix .. "\nStack end", false)
979
        end
980
end
981
function Logger.printf(messageType, messageFormat, ...)
982
        Logger.print(messageType, string.format(messageFormat, ...), 2)
983
end
984
function Logger.AddEntry(entry)
985
        local entries = Logger.entries
986
        if entries[1] >= Logger.MAX_ENTRIES then
987
                local first = entries[2]
988
                local nextFirst = first[2]
989
                first[1] = nil
990
                first[2] = nil
991
                entries[1] = entries[1] - 1
992
                entries[2] = nextFirst
993
                if not nextFirst then
994
                        entries[3] = nil
995
                end
996
        end
997
        local last = entries[3]
998
        local node = {entry}
999
        if last then
1000
                entries[3] = node
1001
                last[2] = node
1002
        else
1003
                entries[2] = node
1004
                entries[3] = node
1005
        end
1006
        entries[1] = entries[1] + 1
1007
end
1008
function Logger.NodeIterator(list, node)
1009
        if node then
1010
                node = node[2]
1011
        else
1012
                node = list[2]
1013
        end
1014
        if node then
1015
                return node, node[1]
1016
        end
1017
end
1018
function Logger.EntryToString(entry)
1019
        local messageType, message = entry[1], tostring(entry[2])
1020
        if messageType and messageType.Value >= Logger.MessageType.Info.Value then
1021
                return messageType.Name .. ": " .. message
1022
        else
1023
                return message
1024
        end
1025
end
1026
function Logger.GenerateStackTrace(level, maxLevel, maxTailCalls, maxTraceItems)
1027
        level = level + 2
1028
        if maxLevel == nil then
1029
                maxLevel = math.huge
1030
        else
1031
                maxLevel = maxLevel + 2
1032
        end
1033
        maxTailCalls = maxTailCalls or 10
1034
        maxTraceItems = maxTraceItems or math.huge
1035
        local trace = {}
1036
        local numTailCalls = 0
1037
        while level <= maxLevel and numTailCalls <= maxTailCalls and #trace < maxTraceItems do
1038
                local success, errorMessage = xpcall(function() error("-", level + 1) end, function(...) return ... end)
1039
                if errorMessage == "-" then
1040
                        numTailCalls = numTailCalls + 1
1041
                else
1042
                        if numTailCalls > 0 then
1043
                                local traceSize = #trace
1044
                                if traceSize > 0 then
1045
                                        trace[#trace][3] = numTailCalls
1046
                                end
1047
                                numTailCalls = 0
1048
                        end
1049
                        local script, line = string.match(errorMessage, "(.*):(%d+)")
1050
                        trace[#trace + 1] = {script, tonumber(line), 0}
1051
                end
1052
                level = level + 1
1053
        end
1054
        return trace
1055
end
1056
function Logger.StackTraceToString(trace)
1057
        local buffer = {}
1058
        for _, data in ipairs(trace) do
1059
                buffer[#buffer + 1] = string.format("Script %q, line %d", data[1], data[2])
1060
                local numTailCalls = data[3]
1061
                if numTailCalls == 1 then
1062
                        buffer[#buffer + 1] = "... 1 tail call"
1063
                elseif numTailCalls > 1 then
1064
                        buffer[#buffer + 1] = string.format("... %d tail calls", numTailCalls)
1065
                end
1066
        end
1067
        return table.concat(buffer, "\n")
1068
end
1069
function Logger.MessageOutFunc(message, messageType)
1070
        if AdvancedGUI and AdvancedGUI.Print then
1071
                local messageTypeValue
1072
                if messageType == Enum.MessageType.MessageOutput then
1073
                        local tagName, untaggedMessage = string.match(message, "(%a+): (.*)")
1074
                        if tagName == "Info" or tagName == "Warning" or tagName == "Severe" then
1075
                                messageTypeValue = Logger.MessageType[tagName].Value
1076
                                message = untaggedMessage
1077
                        else
1078
                                messageTypeValue = Logger.MessageType.Output.Value
1079
                        end
1080
                else
1081
                        messageTypeValue = messageType.Value + 1
1082
                end
1083
                AdvancedGUI.PrintFormat(Logger.MESSAGE_TYPE_SETTINGS[messageTypeValue], message)
1084
        end
1085
end
1086
function print(...)
1087
        local args = {...}
1088
        local buffer = {}
1089
        for index = 1, select("#", ...) do
1090
                buffer[index] = tostring(args[index])
1091
        end
1092
        local message = table.concat(buffer, "\t")
1093
        Logger.print("Output", message)
1094
end
1095
 
1096
CharacterAppearance = {};
1097
 
1098
CharacterAppearance.defaultAppearanceId = 2
1099
CharacterAppearance.stock = {}
1100
function CharacterAppearance.Create(properties)
1101
        local id = properties.Id
1102
        local bodyColors = Instance.new("BodyColors")
1103
        bodyColors.HeadColor = properties.HeadColor
1104
        bodyColors.TorsoColor = properties.TorsoColor
1105
        bodyColors.RightArmColor = properties.RightArmColor
1106
        bodyColors.LeftArmColor = properties.LeftArmColor
1107
        bodyColors.RightLegColor = properties.RightLegColor
1108
        bodyColors.LeftLegColor = properties.LeftLegColor
1109
        local characterObjects = {bodyColors}
1110
        local headObjects = {} 
1111
        local data = {
1112
                characterObjects = characterObjects,
1113
                headObjects = headObjects,
1114
                tshirt = properties.TShirt
1115
        }
1116
        for _, assetId in ipairs(properties.CharacterAssets) do
1117
                TaskScheduler.Start(CharacterAppearance.LoadAsset, characterObjects, assetId)
1118
        end
1119
        for _, assetId in ipairs(properties.HeadAssets) do
1120
                TaskScheduler.Start(CharacterAppearance.LoadAsset, headObjects, assetId)
1121
        end
1122
        CharacterAppearance.stock[id] = data
1123
end
1124
function CharacterAppearance.GetDefaultAppearance()
1125
        return CharacterAppearance.stock[CharacterAppearance.defaultAppearanceId]
1126
end
1127
function CharacterAppearance.LoadAsset(objects, assetId)
1128
        local asset = InsertService:LoadAsset(assetId)
1129
        for _, child in ipairs(asset:GetChildren()) do
1130
                child.Archivable = true
1131
                table.insert(objects, child:Clone())
1132
        end
1133
end
1134
CharacterAppearance.Create {
1135
        Id = 1,
1136
        HeadColor = BrickColor.new("Institutional white"),
1137
        TorsoColor = BrickColor.new("Institutional white"),
1138
        RightArmColor = BrickColor.new("Institutional white"),
1139
        LeftArmColor = BrickColor.new("Institutional white"),
1140
        RightLegColor = BrickColor.new("Institutional white"),
1141
        LeftLegColor = BrickColor.new("Institutional white"),
1142
        CharacterAssets = {
1143
                90825058, 90825211,
1144
                27112056, 27112052,
1145
                27112039, 27112025,
1146
                27112068, 38322996
1147
        },
1148
        HeadAssets = {
1149
                20722130,
1150
                8330576
1151
        }
1152
}
1153
CharacterAppearance.Create {
1154
        Id = 2,
1155
        HeadColor = BrickColor.new("Institutional white"),
1156
        TorsoColor = BrickColor.new("Institutional white"),
1157
        RightArmColor = BrickColor.new("Institutional white"),
1158
        LeftArmColor = BrickColor.new("Institutional white"),
1159
        RightLegColor = BrickColor.new("Institutional white"),
1160
        LeftLegColor = BrickColor.new("Institutional white"),
1161
        CharacterAssets = {
1162
                90825058, 90825211,
1163
                11748356, 1029025,
1164
                1235488, 27112056,
1165
                27112052, 27112039,
1166
                27112025, 27112068
1167
        },
1168
        HeadAssets = {
1169
                20722130
1170
        }
1171
}
1172
CharacterAppearance.Create {
1173
        Id = 3,
1174
        HeadColor = BrickColor.new("Pastel brown"),
1175
        TorsoColor = BrickColor.new("Pastel brown"),
1176
        RightArmColor = BrickColor.new("Pastel brown"),
1177
        LeftArmColor = BrickColor.new("Pastel brown"),
1178
        RightLegColor = BrickColor.new("White"),
1179
        LeftLegColor = BrickColor.new("White"),
1180
        CharacterAssets = {
1181
                134289125, 48474356,
1182
                100339040, 46302558,
1183
                153955895
1184
        },
1185
        HeadAssets = {},
1186
        TShirt = "rbxassetid://148856353"
1187
}
1188
CharacterAppearance.Create {
1189
        Id = 4,
1190
        HeadColor = BrickColor.new("Pastel brown"),
1191
        TorsoColor = BrickColor.new("Pastel brown"),
1192
        RightArmColor = BrickColor.new("Pastel brown"),
1193
        LeftArmColor = BrickColor.new("Pastel brown"),
1194
        RightLegColor = BrickColor.new("White"),
1195
        LeftLegColor = BrickColor.new("White"),
1196
        CharacterAssets = {
1197
                129458426, 96678344, 184489190
1198
        },
1199
        HeadAssets = {},
1200
        TShirt = "rbxassetid://160146697"
1201
}
1202
 
1203
GraphicalEffects = {};
1204
 
1205
local MESH_IDS = {"rbxassetid://15310891"}
1206
local SOUND_IDS = {"rbxassetid://2248511", "rbxassetid://1369158"}
1207
local TEXTURE_IDS = {"rbxassetid://36527089", "rbxassetid://122610943", "rbxassetid://126561317", "rbxassetid://127033719"}
1208
local preloadConnections = {}
1209
local reloadingPreloads = false
1210
function GraphicalEffects.InitPreloads()
1211
        local preload_part = Instance.new("Part")
1212
        GraphicalEffects.preload_part = preload_part
1213
        preload_part.Anchored = true
1214
        preload_part.Archivable = false
1215
        preload_part.BottomSurface = "Smooth"
1216
        preload_part.CanCollide = false
1217
        preload_part.CFrame = CFrame.new(math.huge, math.huge, math.huge)
1218
        preload_part.FormFactor = "Custom"
1219
        preload_part.Locked = true
1220
        preload_part.Name = "Asset Preloader"
1221
        preload_part.Size = Vector3.new(0.2, 0.2, 0.2)
1222
        preload_part.TopSurface = "Smooth"
1223
        preload_part.Transparency = 1
1224
        preloadConnections[preload_part] = preload_part.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged)
1225
        for _, mesh_id in ipairs(MESH_IDS) do
1226
                local mesh = Instance.new("SpecialMesh")
1227
                mesh.MeshType = "FileMesh"
1228
                mesh.MeshId = mesh_id
1229
                preloadConnections[mesh] = mesh.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged)
1230
                mesh.Parent = preload_part
1231
        end
1232
        for _, sound_id in ipairs(SOUND_IDS) do
1233
                local sound = Instance.new("Sound")
1234
                sound.SoundId = sound_id
1235
                sound.Volume = 0
1236
                preloadConnections[sound] = sound.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged)
1237
                sound.Parent = preload_part
1238
        end
1239
        for _, texture_id in ipairs(TEXTURE_IDS) do
1240
                local decal = Instance.new("Decal")
1241
                decal.Texture = texture_id
1242
                preloadConnections[decal] = decal.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged)
1243
                decal.Parent = preload_part
1244
        end
1245
        preload_part.Parent = Workspace
1246
end
1247
function GraphicalEffects.PreloadsAncestryChanged(child, parent)
1248
        if not reloadingPreloads and parent ~= GraphicalEffects.preload_part and parent ~= Workspace then
1249
                reloadingPreloads = true
1250
                for _, connection in pairs(preloadConnections) do
1251
                        connection:disconnect()
1252
                        preloadConnections[_] = nil
1253
                end
1254
                wait(1)
1255
                reloadingPreloads = false
1256
                GraphicalEffects.InitPreloads()
1257
        end
1258
end
1259
GraphicalEffects.InitPreloads()
1260
-- Hyper beam
1261
function GraphicalEffects.FireSpaceHyperBeam(target, power, duration, radius, height, deviation)
1262
        local stepTime, gameTime = 1 / 30, TaskScheduler.GetCurrentTime()
1263
        local frames = duration * 30
1264
        local beamColorOffset = 0.75 * tick() -- math.random()
1265
        local blastPressure = power * 62500 + 250000
1266
        local beamPart = Instance.new("Part")
1267
        local beamMesh = Instance.new("SpecialMesh", beamPart)
1268
        local explosion = Instance.new("Explosion")
1269
        local sound = Instance.new("Sound", beamPart)
1270
        beamPart.Anchored = true
1271
        beamPart.CanCollide = false
1272
        beamPart.CFrame = CFrame.new(target, target + Vector3.new(deviation * (math.random() - 0.5), deviation * (math.random() - 0.5), height))
1273
        beamPart.FormFactor = "Custom"
1274
        beamPart.Locked = true
1275
        beamPart.Size = Vector3.new(0.2, 0.2, 0.2)
1276
        beamMesh.MeshId = "rbxassetid://15310891"
1277
        beamMesh.MeshType = "FileMesh"
1278
        beamMesh.TextureId = "rbxassetid://36527089"
1279
        local beamGlowPart1 = beamPart:Clone()
1280
        local beamGlowMesh1 = beamMesh:Clone()
1281
        local beamGlowPart2 = beamPart:Clone()
1282
        local beamGlowMesh2 = beamMesh:Clone()
1283
        local beamLight = Instance.new("PointLight", beamPart)
1284
        beamLight.Range = power * 2
1285
        beamLight.Shadows = true
1286
        explosion.BlastPressure = blastPressure
1287
        explosion.BlastRadius = power
1288
        explosion.Position = target
1289
        sound.SoundId = "rbxassetid://2248511"
1290
        sound.Volume = 1
1291
        local explosionHitConnection = explosion.Hit:connect(function(part, distance)
1292
                if not part.Anchored and part:GetMass() < power * power then
1293
                        pcall(part.BreakJoints, part)
1294
                        part.Color = Color3.new(Utility.GetRainbowRGB(1.5 * gameTime + beamColorOffset))
1295
                end
1296
        end)
1297
        beamPart.Transparency = 0.5
1298
        beamPart.Archivable = false
1299
        beamGlowPart1.Transparency = 0.75
1300
        beamGlowPart2.Transparency = 0.75
1301
        beamGlowMesh1.Parent = beamGlowPart1
1302
        beamGlowPart1.Parent = beamPart
1303
        beamGlowMesh2.Parent = beamGlowPart2
1304
        beamGlowPart2.Parent = beamPart
1305
        beamPart.Parent = workspace
1306
        explosion.Parent = workspace
1307
        for frame = 1, frames do
1308
                local progress = frame / frames
1309
                local alpha = 1 - math.sin(0.5 * math.pi * progress)
1310
                local scale = 0.4 * alpha
1311
                local glowScale1 = alpha * (0.5 + 0.5 * math.sin(math.tau * (8 * gameTime + beamColorOffset)))
1312
                local glowScale2 = alpha * (0.5 + 0.5 * math.cos(math.tau * (8 * gameTime + beamColorOffset)))
1313
                local vertexColor =  Vector3.new(Utility.GetRainbowRGB(1.5 * gameTime + beamColorOffset))
1314
                beamLight.Brightness = 1 - progress
1315
                beamLight.Color = Color3.new(vertexColor.x, vertexColor.y, vertexColor.z)
1316
                beamMesh.Scale = Vector3.new(radius * scale, 9000, radius * scale)
1317
                beamMesh.VertexColor = vertexColor
1318
                beamGlowMesh1.Scale = Vector3.new(1.2 * radius * glowScale1, 9000, 1.2 * radius * glowScale1)
1319
                beamGlowMesh1.VertexColor = vertexColor
1320
                beamGlowMesh2.Scale = Vector3.new(1.2 * radius * glowScale2, 9000, 1.2 * radius * glowScale2)
1321
                beamGlowMesh2.VertexColor = vertexColor
1322
                RunService.Stepped:wait()
1323
                gameTime = TaskScheduler.GetCurrentTime()
1324
                if frame <= 2 then
1325
                        local explosion = Instance.new("Explosion")
1326
                        explosion.BlastPressure = (1 - progress) * blastPressure
1327
                        explosion.BlastRadius = (1 - progress) * power
1328
                        explosion.Position = target
1329
                        explosion.Parent = Workspace
1330
                        if frame == 2 then
1331
                                sound:Play()
1332
                        end
1333
                end
1334
        end
1335
        pcall(beamPart.Destroy, beamPart)
1336
        explosionHitConnection:disconnect()
1337
end
1338
function GraphicalEffects.SpaceHyperBeam(target, power, duration, radius, height, deviation)
1339
        TaskScheduler.Start(GraphicalEffects.FireSpaceHyperBeam, target, power or 12, duration or 1.5, radius or 6, height or 600, deviation or 20)
1340
end
1341
 
1342
function GraphicalEffects.CrystalRing(data)
1343
        data = data or {}
1344
        local crystal_count = data.crystal_count or 10
1345
        local crystal_color = data.crystal_color or BrickColor.new("Bright red")
1346
        local crystal_scale = data.crystal_scale or Vector3.new(2 / 3, 2, 2 / 3)
1347
        local fade_out_color = data.fade_out_color or BrickColor.new("Really black")
1348
        local radius = radius or 1.25 * crystal_count / math.pi
1349
        local spawn_duration = data.spawn_duration or 0.065
1350
        local full_spawn_duration = spawn_duration * crystal_count
1351
        local float_duration = data.float_duration or 5
1352
        local wave_amplitude = data.wave_amplitude or 0.5
1353
        local wave_period = data.wave_period or 1
1354
        local appear_duration = data.appear_duration or 0.1
1355
        local disappear_duration = data.disappear_duration or 0.5
1356
        local base_part = data.base_part
1357
        local offset_cframe
1358
        if data.position then
1359
                offset_cframe = CFrame.new(data.position)
1360
                if base_part then
1361
                        offset_cframe = base_part.CFrame:toObjectSpace(offset_cframe)
1362
                end
1363
        else
1364
                offset_cframe = CFrame.new()
1365
        end
1366
        local crystal_template = Instance.new("Part")
1367
        crystal_template.Anchored = true
1368
        crystal_template.Locked = true
1369
        crystal_template.CanCollide = false
1370
        crystal_template.BottomSurface = "Smooth"
1371
        crystal_template.TopSurface = "Smooth"
1372
        crystal_template.BrickColor = crystal_color
1373
        crystal_template.FormFactor = "Symmetric"
1374
        crystal_template.Size = Vector3.new(1, 1, 1)
1375
        local crystal_light = Instance.new("PointLight", crystal_template)
1376
        crystal_light.Brightness = 0.1 / crystal_count
1377
        crystal_light.Color = crystal_color.Color
1378
        crystal_light.Name = "Light"
1379
        crystal_light.Range = radius
1380
        crystal_light.Shadows = true
1381
        local crystal_mesh = Instance.new("SpecialMesh", crystal_template)
1382
        crystal_mesh.MeshId = "rbxassetid://9756362"
1383
        crystal_mesh.MeshType = "FileMesh"
1384
        crystal_mesh.Name = "Mesh"
1385
        crystal_mesh.Scale = crystal_scale
1386
        local crystal_model = Instance.new("Model")
1387
        crystal_model.Archivable = false
1388
        crystal_model.Name = "Crystal Model"
1389
        crystal_model.Parent = Workspace
1390
        local crystals = {}
1391
        local lights = {}
1392
        local meshes = {}
1393
        for index = 1, crystal_count do
1394
                local crystal = crystal_template:Clone()
1395
                crystal.Parent = crystal_model
1396
                crystals[index] = crystal
1397
                lights[index] = crystal.Light
1398
                meshes[index] = crystal.Mesh
1399
        end
1400
        local start_time = tick()
1401
        repeat
1402
                local base_cframe = offset_cframe
1403
                if base_part then
1404
                        base_cframe = base_part.CFrame * base_cframe
1405
                end
1406
                local elapsed_time = tick() - start_time
1407
                for index, crystal in ipairs(crystals) do
1408
                        local crystal_time = elapsed_time - index * spawn_duration
1409
                        local disappear_time = crystal_time - float_duration
1410
                        local offset
1411
                        if crystal_time < 0 then
1412
                                offset = 0
1413
                        elseif crystal_time < appear_duration then
1414
                                offset = radius * crystal_time / appear_duration
1415
                        else
1416
                                offset = radius
1417
                        end
1418
                        local wave_offset
1419
                        if disappear_time >= 0 then
1420
                                local disappear_progress = disappear_time / disappear_duration
1421
                                if disappear_progress > 1 then
1422
                                        if crystal.Parent then
1423
                                                crystal:Destroy()
1424
                                        end
1425
                                else
1426
                                        local inverse_progress = 1 - disappear_progress
1427
                                        local light = lights[index]
1428
                                        local mesh = meshes[index]
1429
                                        crystal.BrickColor = fade_out_color
1430
                                        light.Brightness = 2 * inverse_progress
1431
                                        light.Range = 2 * radius
1432
                                        mesh.Scale = crystal_scale * inverse_progress
1433
                                end
1434
                                wave_offset = 0
1435
                        else
1436
                                wave_offset = wave_amplitude * math.sin(math.tau * (elapsed_time - index / crystal_count * 3) / wave_period)
1437
                        end
1438
                        local rotation_angle = (tick() * 0.5 + (index - 1) / crystal_count) % 1 * math.tau
1439
                        crystal.CFrame = base_cframe * CFrame.Angles(0, rotation_angle, 0) * CFrame.new(0, wave_offset, -offset)
1440
                end
1441
                RunService.Stepped:wait()
1442
        until elapsed_time >= float_duration + full_spawn_duration + disappear_duration
1443
        if crystal_model.Parent then
1444
                crystal_model:Destroy()
1445
        end
1446
end
1447
 
1448
GraphicalEffects.magicCircleData = {}
1449
GraphicalEffects.MAGIC_CIRCLE_DEFAULT_OFFSET = 6.25
1450
function GraphicalEffects.AnimateMagicCircle(data)
1451
        local frame, direction, magic_circle_model, magic_circle_part, magic_circle_light, magic_circle_decal_back, magic_circle_decal_front, duration,
1452
 
1453
stay, magic_circle_adornee_func, magic_circle_offset = unpack(data)
1454
        frame = frame + 1
1455
        data[1] = frame
1456
        local transparency = (frame / duration) ^ stay
1457
        local opacity = 1 - transparency
1458
        if frame == duration then
1459
                pcall(Game.Destroy, magic_circle_model)
1460
                GraphicalEffects.magicCircleData[data] = nil
1461
        else
1462
                if magic_circle_model.Parent ~= Workspace then
1463
                        pcall(Utility.SetProperty, magic_circle_model, "Parent", Workspace)
1464
                end
1465
                local magic_circle_adornee = magic_circle_adornee_func()
1466
                magic_circle_position = magic_circle_adornee.Position + direction * magic_circle_offset
1467
                local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0, math.tau * frame /
1468
 
1469
25)
1470
                magic_circle_part.CFrame = magic_circle_cframe
1471
                magic_circle_light.Brightness = opacity
1472
                magic_circle_decal_back.Transparency = transparency
1473
                magic_circle_decal_front.Transparency = transparency
1474
        end
1475
end
1476
function GraphicalEffects.CreateMagicCircle(target, magic_circle_scale, magic_circle_image, light_color, duration, stay, magic_circle_adornee_func,
1477
 
1478
magic_circle_offset)
1479
        local magic_circle_adornee = magic_circle_adornee_func()
1480
        if magic_circle_adornee then
1481
                local origin = magic_circle_adornee.Position
1482
                local direction = (target - origin).unit
1483
                local magic_circle_position = origin + direction * magic_circle_offset
1484
                local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction)
1485
                local magic_circle_model = Instance.new("Model")
1486
                local magic_circle_part = Instance.new("Part", magic_circle_model)
1487
                local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part)
1488
                local magic_circle_light = Instance.new("PointLight", magic_circle_part)
1489
                local magic_circle_decal_back = Instance.new("Decal", magic_circle_part)
1490
                local magic_circle_decal_front = Instance.new("Decal", magic_circle_part)
1491
                magic_circle_model.Archivable = false
1492
                magic_circle_part.Anchored = true
1493
                magic_circle_part.BottomSurface = "Smooth"
1494
                magic_circle_part.CanCollide = false
1495
                magic_circle_part.CFrame = magic_circle_cframe
1496
                magic_circle_part.FormFactor = "Custom"
1497
                magic_circle_part.Locked = true
1498
                magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2)
1499
                magic_circle_part.TopSurface = "Smooth"
1500
                magic_circle_part.Transparency = 1
1501
                magic_circle_mesh.Scale = Vector3.new(60, 60, 0) * magic_circle_scale
1502
                magic_circle_light.Color = light_color
1503
                magic_circle_light.Range = 16 * magic_circle_scale
1504
                magic_circle_light.Shadows = true
1505
                magic_circle_decal_back.Face = "Back"
1506
                magic_circle_decal_back.Texture = magic_circle_image
1507
                magic_circle_decal_front.Face = "Front"
1508
                magic_circle_decal_front.Texture = magic_circle_image
1509
                magic_circle_model.Parent = Workspace
1510
                local data = {0, direction, magic_circle_model, magic_circle_part, magic_circle_light, magic_circle_decal_back, magic_circle_decal_front,
1511
 
1512
duration, stay, magic_circle_adornee_func, magic_circle_offset}
1513
                GraphicalEffects.magicCircleData[data] = true
1514
                return data
1515
        end
1516
end
1517
 
1518
GraphicalEffects.missileData = {}
1519
GraphicalEffects.missileParts = {}
1520
function GraphicalEffects.AnimateMissile(data)
1521
        local frame, missilePart, targetPart, timeCreated, direction, touchedConnection, explodeRequested, bodyGyro, swooshSound, magicCircleData, lifeTime,
1522
 
1523
pointOnPart, flipped = unpack(data)
1524
        frame = frame + 1
1525
        data[1] = frame
1526
        if flipped then
1527
                direction = -direction
1528
        end
1529
        if frame <= 10 then
1530
                if frame == 2 then
1531
                        swooshSound:Play()
1532
                end
1533
                missilePart.Anchored = true
1534
                local progress = frame / 10
1535
                missilePart.Size = Vector3.new(1, 1, progress * 4)
1536
                local magicCirclePart = magicCircleData[4]
1537
                local magicCirclePosition = magicCirclePart.Position
1538
                local missileOffset = 2 * progress * direction
1539
                local missilePosition = magicCirclePosition + missileOffset
1540
                missilePart.CFrame = CFrame.new(missilePosition, missilePosition + direction)
1541
                --missilePart.Transparency = 0.5 * (1 - progress)
1542
                if frame == 10 then
1543
                        touchedConnection = missilePart.Touched:connect(function(hit)
1544
                                if hit.CanCollide and hit.Parent and not GraphicalEffects.missileParts[hit] then
1545
                                        touchedConnection:disconnect()
1546
                                        data[7] = true
1547
                                end
1548
                        end)
1549
                        data[6] = touchedConnection
1550
                end
1551
        else
1552
                missilePart.Anchored = false
1553
                local missilePosition = missilePart.Position
1554
                local targetPosition = targetPart.CFrame * pointOnPart
1555
                local distanceVector = targetPosition - missilePosition
1556
                local elapsedTime = time() - timeCreated
1557
                local targetParent = targetPart.Parent
1558
                if explodeRequested or (targetParent and distanceVector.magnitude < 10) or elapsedTime > lifeTime then
1559
                        GraphicalEffects.missileData[data] = nil
1560
                        GraphicalEffects.missileParts[missilePart] = nil
1561
                        touchedConnection:disconnect()
1562
                        if missilePart.Parent then
1563
                                missilePart:Destroy()
1564
                                local explosion = Instance.new("Explosion")
1565
                                explosion.BlastRadius = 12.5
1566
                                explosion.Position = missilePosition
1567
                                local explosionHitConnection = explosion.Hit:connect(function(hit, distance)
1568
                                        local missileData = GraphicalEffects.missileParts[hit]
1569
                                        if missileData and distance < 3 then
1570
                                                missileData[7] = true
1571
                                        else
1572
                                                pcall(hit.BreakJoints, hit)
1573
                                        end
1574
                                end)
1575
                                explosion.Parent = Workspace
1576
                                TaskScheduler.Schedule(1, explosionHitConnection.disconnect, explosionHitConnection)
1577
                        end
1578
                else
1579
                        local targetInWorkspace = targetPart:IsDescendantOf(Workspace)
1580
                        if targetInWorkspace then
1581
                                direction = distanceVector.unit
1582
                                data[5] = direction
1583
                        end
1584
                        local speed = 14 + elapsedTime * 10
1585
                        local gyroD
1586
                        if elapsedTime < 42.5 and targetInWorkspace then
1587
                                gyroD = 1000 - elapsedTime * 15
1588
                        else
1589
                                gyroD = 100
1590
                                bodyGyro.maxTorque = Vector3.new(0, 0, 0)
1591
                                if elapsedTime + 7.5 < lifeTime then
1592
                                        data[11] = elapsedTime + 7.5
1593
                                end
1594
                        end
1595
                        bodyGyro.D = gyroD
1596
                        bodyGyro.cframe = CFrame.new(Vector3.new(), direction)
1597
                        missilePart.Velocity = missilePart.CFrame.lookVector * speed
1598
                end
1599
        end
1600
end
1601
function GraphicalEffects.ShootMissile(targetPart, pointOnPart, direction, magic_circle_adornee_func, magic_circle_offset, flipped)
1602
        if not magic_circle_offset then
1603
                magic_circle_offset = GraphicalEffects.MAGIC_CIRCLE_DEFAULT_OFFSET
1604
        end
1605
        local targetPosition = targetPart.Position
1606
        local headPosition = chatAdornee.Position
1607
        local origin = CFrame.new(headPosition, headPosition + direction) + direction * magic_circle_offset
1608
        local missilePart = Instance.new("Part")
1609
        local antiGravityForce = Instance.new("BodyForce", missilePart)
1610
        local bodyGyro = Instance.new("BodyGyro", missilePart)
1611
        local explosionSound = Instance.new("Sound", missilePart)
1612
        local swooshSound = Instance.new("Sound", missilePart)
1613
        antiGravityForce.force = Vector3.new(0, 196.2 * 4, 0)
1614
        bodyGyro.D = 1000
1615
        bodyGyro.maxTorque = Vector3.new(1, 1, 1)
1616
        explosionSound.PlayOnRemove = true
1617
        explosionSound.SoundId = "rbxasset://sounds/collide.wav"
1618
        explosionSound.Volume = 1
1619
        missilePart.Anchored = true
1620
        missilePart.BackSurface = "Studs"
1621
        missilePart.BottomSurface = "Studs"
1622
        missilePart.BrickColor = BrickColor.Red()
1623
        missilePart.CFrame = origin
1624
        missilePart.FormFactor = "Custom"
1625
        missilePart.FrontSurface = "Studs"
1626
        missilePart.LeftSurface = "Studs"
1627
        missilePart.Locked = true
1628
        missilePart.RightSurface = "Studs"
1629
        missilePart.Size = Vector3.new(1, 1, 0.2)
1630
        missilePart.TopSurface = "Studs"
1631
        --missilePart.Transparency = 0.5
1632
        swooshSound.Looped = true
1633
        swooshSound.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav"
1634
        swooshSound.Volume = 0.7
1635
        local magicCircleData = GraphicalEffects.CreateMagicCircle(headPosition + direction * 1000, 0.875, "rbxassetid://127033719", Color3.new(1, 1, 1),
1636
 
1637
40, 4, magic_circle_adornee_func or function() return chatAdornee end, magic_circle_offset)
1638
        local data = {0, missilePart, targetPart, time(), direction, false, false, bodyGyro, swooshSound, magicCircleData, 50, pointOnPart, flipped}
1639
        missilePart.Parent = Workspace
1640
        GraphicalEffects.missileData[data] = true
1641
        GraphicalEffects.missileParts[missilePart] = data
1642
end
1643
 
1644
function GraphicalEffects.CubicInterpolate(y0, y1, y2, y3, mu)
1645
        local a0, a1, a2, a3, mu2
1646
        mu2 = mu * mu
1647
        a0 = y3 - y2 - y0 + y1
1648
        a1 = y0 - y1 - a0
1649
        a2 = y2 - y0
1650
        a3 = y1
1651
        return a0 * mu * mu2 + a1 * mu2 + a2 * mu + a3
1652
end
1653
function GraphicalEffects.JointCrap(model, cycletime)
1654
        if model then
1655
                local cycletime = cycletime or (0.75 * (1 + math.random() * 4))
1656
                local offsetradius = 0.75
1657
                local rotationoffset = math.pi
1658
                local joints = {}
1659
                local stack = model:GetChildren()
1660
                while #stack ~= 0 do
1661
                        local object = stack[#stack]
1662
                        table.remove(stack)
1663
                        for index, child in ipairs(object:GetChildren()) do
1664
                                table.insert(stack, child)
1665
                        end
1666
                        if object:IsA("JointInstance") then
1667
                                table.insert(joints, object)
1668
                        end
1669
                end
1670
                local rot0 = {}
1671
                local rot1 = {}
1672
                local rot2 = {}
1673
                local rot3 = {}
1674
                local rot4 = {}
1675
                for index, joint in ipairs(joints) do
1676
                        local pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius
1677
                        local rot = Vector3.new(math.random(), math.random(), math.random()) * rotationoffset
1678
                        rot0[index] = {joint.C0, joint.C1}
1679
                        rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau))
1680
                        rot2[index] = {pos, rot}
1681
                        pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius
1682
                        rot = rot + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset
1683
                        rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau))
1684
                        rot3[index] = {pos, rot}
1685
                        pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius
1686
                        rot = rot + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset
1687
                        rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau))
1688
                        rot4[index] = {pos, rot}
1689
                end
1690
                while model.Parent do
1691
                        for i, j in ipairs(joints) do
1692
                                local pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius
1693
                                local rot = rot4[i][2] + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset
1694
                                rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau))
1695
                                rot1[i], rot2[i], rot3[i], rot4[i] = rot2[i], rot3[i], rot4[i], {pos, rot}
1696
                        end
1697
                        local start = tick()
1698
                        while true do
1699
                                local ctime = tick()
1700
                                local elapsed = ctime - start
1701
                                if elapsed > cycletime then
1702
                                        break
1703
                                end
1704
                                local progress = elapsed / cycletime
1705
                                for index, joint in ipairs(joints) do
1706
                                        local v0, v1, v2, v3, v4 = rot0[index], rot1[index], rot2[index], rot3[index], rot4[index]
1707
                                        local p1, p2, p3, p4, r1, r2, r3, r4 = v1[1], v2[1], v3[1], v4[1], v1[2], v2[2], v3[2], v4[2]
1708
                                        local px = GraphicalEffects.CubicInterpolate(p1.x, p2.x, p3.x, p4.x, progress)
1709
                                        local py = GraphicalEffects.CubicInterpolate(p1.y, p2.y, p3.y, p4.y, progress)
1710
                                        local pz = GraphicalEffects.CubicInterpolate(p1.z, p2.z, p3.z, p4.z, progress)
1711
                                        local rx = GraphicalEffects.CubicInterpolate(r1.x, r2.x, r3.x, r4.x, progress)
1712
                                        local ry = GraphicalEffects.CubicInterpolate(r1.y, r2.y, r3.y, r4.y, progress)
1713
                                        local rz = GraphicalEffects.CubicInterpolate(r1.z, r2.z, r3.z, r4.z, progress)
1714
                                        local cframe = CFrame.new(px, py, pz) * CFrame.Angles(rx, ry, rz)
1715
                                        joint.C0 = v0[1] * cframe
1716
                                        joint.C1 = v0[2] * cframe:inverse()
1717
                                end
1718
                                RunService.Stepped:wait()
1719
                        end
1720
                end
1721
        end
1722
end
1723
 
1724
GraphicalEffects.LASER_WIDTH = 0.15
1725
GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE = 6.25
1726
GraphicalEffects.laser_data = {}
1727
--GraphicalEffects.fragmentation = {}
1728
function GraphicalEffects.AnimateLaserOfDeath(data)
1729
        local frame, directionOrientation, direction, magic_circle_model, laser_part, laser_mesh, magic_circle_part, magic_circle_light,
1730
 
1731
magic_circle_decal_back, magic_circle_decal_front, sound, laser_scale, fragmentation_size, duration, laser_lights, laser_effects, stay, light_effects =
1732
 
1733
unpack(data)
1734
        local laser_color = laser_part.Color
1735
        frame = frame + 1
1736
        data[1] = frame
1737
        local transparency = (frame / duration) ^ stay
1738
        local opacity = 1 - transparency
1739
        if frame == 2 then
1740
                sound:Play()
1741
        end
1742
        if frame == duration then
1743
                pcall(Game.Destroy, magic_circle_model)
1744
                GraphicalEffects.laser_data[data] = nil
1745
        else
1746
                if magic_circle_model.Parent ~= Workspace then
1747
                        pcall(Utility.SetProperty, magic_circle_model, "Parent", Workspace)
1748
                end
1749
                local laser_distance = 0
1750
                local origin = chatAdornee.CFrame
1751
                if not light_effects then
1752
                        direction = (origin * directionOrientation - origin.p).unit
1753
                end
1754
                local magic_circle_position = origin.p + direction * GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE
1755
                local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0, math.tau * frame /
1756
 
1757
25)
1758
                local loop_scale = (laser_scale - 1) / 10
1759
                for x_offset = -loop_scale, loop_scale, 2 do
1760
                        for y_offset = -loop_scale, loop_scale, 2 do
1761
                                local origin_position = magic_circle_cframe * Vector3.new(x_offset, y_offset, 0)
1762
                                for index = 1, 8 do
1763
                                        local part, position
1764
                                        for ray_index = 1, 10 do
1765
                                                local ray = Ray.new(origin_position + direction * (999 * (ray_index - 1)), direction * 999)
1766
                                                part, position = Workspace:FindPartOnRay(ray, magic_circle_model)
1767
                                                if part then
1768
                                                        break
1769
                                                end
1770
                                        end
1771
                                        if part then
1772
                                                laser_distance = (position - origin_position).magnitude
1773
                                                if frame % 8 == 1 and index == 1 then
1774
                                                        Instance.new("Explosion", Workspace).Position = position
1775
                                                end
1776
                                                if not part:IsA("Terrain") then
1777
                                                        pcall(part.BreakJoints, part)
1778
                                                        local is_block = part:IsA("Part") and part.Shape == Enum.PartType.Block
1779
                                                        local mass = part:GetMass()
1780
                                                        local size = part.Size
1781
                                                        if (is_block and ((size.X < fragmentation_size and size.Y < fragmentation_size and size.Z <
1782
 
1783
fragmentation_size) or (not part.Anchored and mass < 750))) or (not is_block and mass < 250000) then
1784
                                                                local part_transparency = math.max(part.Transparency + 0.007 * fragmentation_size, 0.5)
1785
                                                                if part_transparency >= 0.5 then -- temporarily to minimize debris
1786
                                                                        pcall(Game.Destroy, part)
1787
                                                                else
1788
                                                                        local cframe = part.CFrame
1789
                                                                        part.Anchored = false
1790
                                                                        part.BrickColor = BrickColor.new("Medium stone grey")
1791
                                                                        part.CanCollide = true
1792
                                                                        if part:IsA("FormFactorPart") then
1793
                                                                                part.FormFactor = "Custom"
1794
                                                                        end
1795
                                                                        part.Size = size - Vector3.new(0.135, 0.135, 0.135) * fragmentation_size
1796
                                                                        part.Transparency = part_transparency
1797
                                                                        part.CFrame = cframe + direction * 5
1798
                                                                        part.Velocity = part.Velocity + direction * 40
1799
                                                                end
1800
                                                        elseif is_block then
1801
                                                                local parts = {part}
1802
                                                                local model = Instance.new("Model", part.Parent)
1803
                                                                model.Name = "Fragments"
1804
                                                                if size.X >= fragmentation_size then
1805
                                                                        size = Vector3.new(0.5, 1, 1) * size
1806
                                                                        local archivable = part.Archivable
1807
                                                                        local cframe = part.CFrame
1808
                                                                        part.FormFactor = "Custom"
1809
                                                                        part.Size = size
1810
                                                                        part.Archivable = true
1811
                                                                        local part_clone = part:Clone()
1812
                                                                        part.Archivable = archivable
1813
                                                                        part_clone.Archivable = archivable
1814
                                                                        part.CFrame = cframe * CFrame.new(-0.5 * size.X, 0, 0)
1815
                                                                        part_clone.CFrame = cframe * CFrame.new(0.5 * size.X, 0, 0)
1816
                                                                        part_clone.Parent = model
1817
                                                                        parts[2] = part_clone
1818
                                                                end
1819
                                                                if size.Y >= fragmentation_size then
1820
                                                                        size = Vector3.new(1, 0.5, 1) * size
1821
                                                                        for part_index = 1, #parts do
1822
                                                                                local part = parts[part_index]
1823
                                                                                local archivable = part.Archivable
1824
                                                                                local cframe = part.CFrame
1825
                                                                                part.FormFactor = "Custom"
1826
                                                                                part.Size = size
1827
                                                                                part.Archivable = true
1828
                                                                                local part_clone = part:Clone()
1829
                                                                                part.Archivable = archivable
1830
                                                                                part_clone.Archivable = archivable
1831
                                                                                part.CFrame = cframe * CFrame.new(0, -0.5 * size.Y, 0)
1832
                                                                                part_clone.CFrame = cframe * CFrame.new(0, 0.5 * size.Y, 0)
1833
                                                                                part_clone.Parent = model
1834
                                                                                table.insert(parts, part_clone)
1835
                                                                        end
1836
                                                                end
1837
                                                                if size.Z >= fragmentation_size then
1838
                                                                        size = Vector3.new(1, 1, 0.5) * size
1839
                                                                        for part_index = 1, #parts do
1840
                                                                                local part = parts[part_index]
1841
                                                                                local archivable = part.Archivable
1842
                                                                                local cframe = part.CFrame
1843
                                                                                part.FormFactor = "Custom"
1844
                                                                                part.Size = size
1845
                                                                                part.Archivable = true
1846
                                                                                local part_clone = part:Clone()
1847
                                                                                part.Archivable = archivable
1848
                                                                                part_clone.Archivable = archivable
1849
                                                                                part.CFrame = cframe * CFrame.new(0, 0, -0.5 * size.Z)
1850
                                                                                part_clone.CFrame = cframe * CFrame.new(0, 0, 0.5 * size.Z)
1851
                                                                                part_clone.Parent = model
1852
                                                                                table.insert(parts, part_clone)
1853
                                                                        end
1854
                                                                end
1855
                                                                for _, part in ipairs(parts) do
1856
                                                                        part:MakeJoints()
1857
                                                                end
1858
                                                        else
1859
                                                                break
1860
                                                        end
1861
                                                end
1862
                                        else
1863
                                                laser_distance = 9990
1864
                                                break
1865
                                        end
1866
                                end
1867
                        end
1868
                end
1869
                local laser_cframe = magic_circle_cframe * CFrame.Angles(-0.5 * math.pi, 0, 0)
1870
                local laser_width = GraphicalEffects.LASER_WIDTH * opacity * laser_scale
1871
                local laser_mesh_offset = Vector3.new(0, 0.5 * laser_distance, 0)      
1872
                laser_part.CFrame = laser_cframe
1873
                if laser_effects then
1874
                        local laser_effect_data_1, laser_effect_data_2 = laser_effects[1], laser_effects[2]
1875
                        local laser_effect_1, laser_effect_mesh_1 = laser_effect_data_1[1], laser_effect_data_1[2]
1876
                        local laser_effect_2, laser_effect_mesh_2 = laser_effect_data_2[1], laser_effect_data_2[2]
1877
                        laser_effect_1.CFrame = laser_cframe
1878
                        laser_effect_2.CFrame = laser_cframe
1879
                        laser_effect_mesh_1.Offset = laser_mesh_offset
1880
                        laser_effect_mesh_2.Offset = laser_mesh_offset
1881
                        local game_time = time()
1882
                        local effect_scale_1 = 0.5 + 0.5 * math.sin(16 * math.pi * game_time)
1883
                        local effect_scale_2 = 0.5 + 0.5 * math.cos(16 * math.pi * game_time)
1884
                        laser_effect_mesh_1.Scale = 5 * Vector3.new(laser_width * effect_scale_1, laser_distance, laser_width * effect_scale_1)
1885
                        laser_effect_mesh_2.Scale = 5 * Vector3.new(laser_width * effect_scale_2, laser_distance, laser_width * effect_scale_2)
1886
                        laser_width = laser_width * 0.25
1887
                end
1888
                laser_mesh.Offset = laser_mesh_offset                  
1889
                laser_mesh.Scale = 5 * Vector3.new(laser_width, laser_distance, laser_width)
1890
                magic_circle_part.CFrame = magic_circle_cframe
1891
                magic_circle_light.Brightness = opacity
1892
                magic_circle_decal_back.Transparency = transparency
1893
                magic_circle_decal_front.Transparency = transparency
1894
                if light_effects then
1895
                        for index, data in ipairs(laser_lights) do
1896
                                local laser_spotlight_part, laser_spotlight = data[1], data[2]
1897
                                local laser_spotlight_offset = 30 * (index - 1)
1898
                                if laser_spotlight_offset <= laser_distance then
1899
                                        laser_spotlight_part.CFrame = magic_circle_cframe * CFrame.new(0, 0, -laser_spotlight_offset)
1900
                                        laser_spotlight.Brightness = opacity
1901
                                        laser_spotlight.Enabled = true
1902
                                else
1903
                                        laser_spotlight.Enabled = false
1904
                                end
1905
                        end
1906
                end
1907
        end
1908
end
1909
function GraphicalEffects.ShootLaserOfDeath(target, data)
1910
        if chatAdornee then
1911
                data = data or {}
1912
                local brickcolor = data.brickcolor or BrickColor.new("Really black")
1913
                local duration = data.duration or 40
1914
                local fragmentation_size = data.fragmentation_size or 3
1915
                local laser_scale = data.laser_scale or 1
1916
                local light_color = data.light_color or Color3.new(1, 0.5, 1)
1917
                local magic_circle_image = data.magic_circle_image or "rbxassetid://122610943"
1918
                local magic_circle_scale = data.magic_circle_scale or 1
1919
                local sound_volume = data.sound_volume or 1 / 3
1920
                local special_effects = data.special_effects
1921
                local stay = data.stay or 4
1922
                local origin = chatAdornee.CFrame
1923
                local directionOrientation = origin:pointToObjectSpace(target)
1924
                local direction = (target - origin.p).unit
1925
                local magic_circle_position = origin.p + direction * GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE
1926
                local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction)
1927
                local magic_circle_model = Instance.new("Model")
1928
                local laser_part = Instance.new("Part", magic_circle_model)
1929
                local laser_mesh = Instance.new("CylinderMesh", laser_part)
1930
                local magic_circle_part = Instance.new("Part", magic_circle_model)
1931
                local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part)
1932
                local magic_circle_light = Instance.new("PointLight", magic_circle_part)
1933
                local magic_circle_decal_back = Instance.new("Decal", magic_circle_part)
1934
                local magic_circle_decal_front = Instance.new("Decal", magic_circle_part)
1935
                local sound = Instance.new("Sound", magic_circle_part)
1936
                sound.Pitch = 1.25
1937
                sound.SoundId = "rbxassetid://2248511"
1938
                sound.Volume = sound_volume
1939
                magic_circle_model.Archivable = false
1940
                laser_part.Anchored = true
1941
                laser_part.BottomSurface = "Smooth"
1942
                laser_part.BrickColor = brickcolor
1943
                laser_part.CanCollide = false
1944
                laser_part.CFrame = magic_circle_cframe * CFrame.Angles(-0.5 * math.pi, 0, 0)
1945
                laser_part.FormFactor = "Custom"
1946
                laser_part.Locked = true
1947
                laser_part.Size = Vector3.new(0.2, 0.2, 0.2)
1948
                laser_part.TopSurface = "Smooth"
1949
                laser_mesh.Offset = Vector3.new(0, 0, 0)
1950
                laser_mesh.Name = "Mesh"
1951
                laser_mesh.Scale = 5 * laser_scale * Vector3.new(GraphicalEffects.LASER_WIDTH, 0, GraphicalEffects.LASER_WIDTH)
1952
                magic_circle_part.Anchored = true
1953
                magic_circle_part.BottomSurface = "Smooth"
1954
                magic_circle_part.CanCollide = false
1955
                magic_circle_part.CFrame = magic_circle_cframe
1956
                magic_circle_part.FormFactor = "Custom"
1957
                magic_circle_part.Locked = true
1958
                magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2)
1959
                magic_circle_part.TopSurface = "Smooth"
1960
                magic_circle_part.Transparency = 1
1961
                magic_circle_mesh.Scale = Vector3.new(60, 60, 0) * magic_circle_scale
1962
                magic_circle_light.Color = light_color
1963
                magic_circle_light.Range = 16 * magic_circle_scale
1964
                magic_circle_light.Shadows = true
1965
                magic_circle_decal_back.Face = "Back"
1966
                magic_circle_decal_back.Texture = magic_circle_image
1967
                magic_circle_decal_front.Face = "Front"
1968
                magic_circle_decal_front.Texture = magic_circle_image
1969
                magic_circle_model.Parent = Workspace
1970
                local laser_color = brickcolor.Color
1971
                local laser_lights = {}
1972
                local light_effects = laser_color.r + laser_color.g + laser_color.b > 0.25
1973
                if light_effects then
1974
                        local laser_spotlight_part_template = Instance.new("Part")
1975
                        local laser_spotlight_light_template = Instance.new("SpotLight", laser_spotlight_part_template)
1976
                        laser_spotlight_part_template.Anchored = true
1977
                        laser_spotlight_part_template.Anchored = true
1978
                        laser_spotlight_part_template.BottomSurface = "Smooth"
1979
                        laser_spotlight_part_template.CanCollide = false
1980
                        laser_spotlight_part_template.FormFactor = "Custom"
1981
                        laser_spotlight_part_template.Locked = true
1982
                        laser_spotlight_part_template.Size = Vector3.new(0.2, 0.2, 0.2)
1983
                        laser_spotlight_part_template.TopSurface = "Smooth"
1984
                        laser_spotlight_part_template.Transparency = 1
1985
                        laser_spotlight_light_template.Angle = 45
1986
                        laser_spotlight_light_template.Color = laser_color
1987
                        laser_spotlight_light_template.Enabled = true
1988
                        laser_spotlight_light_template.Name = "Light"
1989
                        laser_spotlight_light_template.Range = 60
1990
                        for index = 1, 40 do
1991
                                local laser_spotlight_part = laser_spotlight_part_template:Clone()
1992
                                laser_spotlight_part.CFrame = magic_circle_cframe * CFrame.new(0, 0, -30 * (index - 1))
1993
                                laser_spotlight_part.Parent = magic_circle_model
1994
                                laser_lights[index] = {laser_spotlight_part, laser_spotlight_part.Light}
1995
                        end
1996
                end
1997
                local laser_effects
1998
                if special_effects then
1999
                        laser_effects = {}
2000
                        local laser_effect_1 = laser_part:Clone()
2001
                        laser_effect_1.BrickColor = special_effects
2002
                        laser_effect_1.Transparency = 0.5
2003
                        local laser_effect_2 = laser_effect_1:Clone()
2004
                        laser_effects[1], laser_effects[2] = {laser_effect_1, laser_effect_1.Mesh}, {laser_effect_2, laser_effect_2.Mesh}
2005
                        laser_effect_1.Parent = magic_circle_model
2006
                        laser_effect_2.Parent = magic_circle_model
2007
                end
2008
                GraphicalEffects.laser_data[{0, directionOrientation, direction, magic_circle_model, laser_part, laser_mesh, magic_circle_part,
2009
 
2010
magic_circle_light, magic_circle_decal_back, magic_circle_decal_front, sound, laser_scale, fragmentation_size, duration, laser_lights, laser_effects, stay,
2011
 
2012
light_effects}] = true
2013
        end
2014
end
2015
 
2016
function GraphicalEffects.SpawnSapientRock(position)
2017
        local part = Instance.new("Part", Workspace)
2018
        local size = 8 + math.random(0, 5)
2019
        part.BottomSurface = "Smooth"
2020
        part.TopSurface = "Smooth"
2021
        part.Material = "Slate"
2022
        part.Locked = true
2023
        part.Shape = "Ball"
2024
        part.FormFactor = "Custom"
2025
        part.Size = Vector3.new(size, size, size)
2026
        part.Position = position
2027
        local bodypos = Instance.new("BodyPosition", part)
2028
        bodypos.maxForce = Vector3.new(0, 0, 0)
2029
        local angry = false
2030
        local damage_ready = true
2031
        local torso_following
2032
        local torso_changed = -1000
2033
        local touched_conn = part.Touched:connect(function(hit)
2034
                local character = hit.Parent
2035
                if character then
2036
                        local humanoid
2037
                        for _, child in ipairs(character:GetChildren()) do
2038
                                if child:IsA("Humanoid") then
2039
                                        humanoid = child
2040
                                        break
2041
                                end
2042
                        end
2043
                        if humanoid then
2044
                                if angry then
2045
                                        if damage_ready then
2046
                                                damage_ready = false
2047
                                                humanoid:TakeDamage(100)
2048
                                                wait(1)
2049
                                                damage_ready = true
2050
                                                angry = false
2051
                                                part.BrickColor = BrickColor.new("Medium stone grey")
2052
                                        end
2053
                                else
2054
                                        local torso = humanoid.Torso
2055
                                        if torso then
2056
                                                torso_following = torso
2057
                                                torso_changed = tick()
2058
                                        end
2059
                                end
2060
                        end
2061
                end
2062
        end)
2063
        TaskScheduler.Start(function()
2064
                while part.Parent == Workspace do
2065
                        if torso_following then
2066
                                bodypos.position = torso_following.Position
2067
                                if tick() - torso_changed > 60 or not torso_following.Parent then
2068
                                        torso_following = nil
2069
                                        bodypos.maxForce = Vector3.new(0, 0, 0)
2070
                                        angry = false
2071
                                        part.BrickColor = BrickColor.new("Medium stone grey")
2072
                                else
2073
                                        local speed = angry and Vector3.new(16, 16, 16) or Vector3.new(6, 0, 6)
2074
                                        bodypos.maxForce = part:GetMass() * speed
2075
                                        if part.Position.Y < -250 then
2076
                                                part.Velocity = Vector3.new()
2077
                                                part.Position = torso_following.Position + Vector3.new(0, 80, 0)
2078
                                                part.BrickColor = BrickColor.new("Bright red")
2079
                                                angry = true
2080
                                                torso_changed = tick()
2081
                                        end
2082
                                end
2083
                        end
2084
                        RunService.Stepped:wait()
2085
                end
2086
                touched_conn:disconnect()
2087
        end)
2088
        TaskScheduler.Start(function()
2089
                while part.Parent == Workspace do
2090
                        wait(25 + math.random() * 10)
2091
                        local next_size = 8 + math.random() * 5
2092
                        if math.random(100) == 1 then
2093
                                next_size = next_size * (2 + 6 * math.random())
2094
                        end
2095
                        next_size = math.floor(next_size + 0.5)
2096
                        local start_time = tick()
2097
                        local mesh = Instance.new("SpecialMesh", part)
2098
                        mesh.MeshType = "Sphere"
2099
                        repeat
2100
                                local elapsed_time = tick() - start_time
2101
                                local alpha = math.cos(elapsed_time * math.pi * 0.5)
2102
                                local interpolated_size = size * alpha + next_size * (1 - alpha)
2103
                                local size_vector = Vector3.new(interpolated_size, interpolated_size, interpolated_size)
2104
                                local cframe = part.CFrame
2105
                                part.Size = size_vector
2106
                                part.CFrame = cframe
2107
                                mesh.Scale = size_vector / part.Size
2108
                                RunService.Stepped:wait()
2109
                        until tick() - start_time >= 1
2110
                        mesh:Destroy()
2111
                        local cframe = part.CFrame
2112
                        part.Size = Vector3.new(next_size, next_size, next_size)
2113
                        part.CFrame = cframe
2114
                        size = next_size
2115
                end
2116
        end)
2117
end
2118
 
2119
function GraphicalEffects.MainLoop()
2120
        RunService.Stepped:wait()
2121
        for data in pairs(GraphicalEffects.magicCircleData) do
2122
                GraphicalEffects.AnimateMagicCircle(data)
2123
        end
2124
        for data in pairs(GraphicalEffects.laser_data) do
2125
                GraphicalEffects.AnimateLaserOfDeath(data)
2126
        end
2127
        for data in pairs(GraphicalEffects.missileData) do
2128
                GraphicalEffects.AnimateMissile(data)
2129
        end
2130
end
2131
TaskScheduler.Start(function()
2132
        while true do
2133
                GraphicalEffects.MainLoop()
2134
        end
2135
end)
2136
 
2137
PlayerControl = {};
2138
 
2139
PlayerControl.fly_acceleration = 10
2140
PlayerControl.fly_basespeed = 250
2141
PlayerControl.fly_speed = PlayerControl.fly_basespeed
2142
PlayerControl.featherfallEnabled = true
2143
PlayerControl.pushable = false
2144
PlayerControl.rolling = false
2145
PlayerControl.rollingAngle = 0
2146
PlayerControl.rollingOffset = 0
2147
PlayerControl.rollingMaxOffset = 3
2148
PlayerControl.rollingSpeed = 1 / 50
2149
PlayerControl.characterEnabled = false
2150
PlayerControl.characterMode = "normal"
2151
local character = nil
2152
local flying, flyingMomentum, flyingTilt = false, Vector3.new(), 0
2153
local pose, regeneratingHealth, jumpDebounce = "Standing", false, false
2154
-- TODO: make local variables public
2155
local model, bodyColors, leftArmMesh, leftLegMesh, rightArmMesh, rightLegMesh, torsoMesh, wildcardHat, wildcardHandle, wildcardMesh, pants, shirt, humanoid,
2156
 
2157
head, leftArm, leftLeg, rightArm, rightLeg, torso, rootPart, rootJoint, face, soundFreeFalling, soundGettingUp, soundRunning, leftHip, leftShoulder,
2158
 
2159
rightHip, rightShoulder, neck, wildcardWeld, feetPart, feetWeld, feetTouchInterest, bodyGyro, bodyVelocity, headMesh, torsoLight
2160
local AnimateCharacter
2161
local UserInterface = game:service'UserInputService'
2162
local chatBubbles = {}
2163
local chatCharacterLimit = 240
2164
function PlayerControl.CreateCharacter()
2165
        local characterMode = PlayerControl.characterMode
2166
        if characterMode == "normal" then
2167
                if not PlayerControl.characterEnabled then
2168
                        return
2169
                end
2170
                local appearance = CharacterAppearance.GetDefaultAppearance()
2171
                local active = true
2172
                local torsoCFrame = (torso and torso.CFrame) or PlayerControl.torso_cframe or CFrame.new(0, 10, 0)
2173
                if torsoCFrame.p.Y < -450 then
2174
                        torsoCFrame = CFrame.new(0, 10, 0)
2175
                end
2176
                local rootPartCFrame = (rootPart and rootPart.CFrame) or PlayerControl.torso_cframe or CFrame.new(0, 10, 0)
2177
                if rootPartCFrame.p.Y < -450 then
2178
                        rootPartCFrame = CFrame.new(0, 10, 0)
2179
                end
2180
                local cameraCFrame = Camera.CoordinateFrame
2181
                local connections = {}
2182
                local feetTouching = {}
2183
                local previousWalkSpeed = 0
2184
                local prevLeftHip, prevLeftShoulder, prevRightHip, prevRightShoulder = leftHip, leftShoulder, rightHip, rightShoulder
2185
                model = Instance.new("Model")
2186
                humanoid = Instance.new("Humanoid", model)
2187
                head = Instance.new("Part", model)
2188
                leftArm = Instance.new("Part", model)
2189
                leftLeg = Instance.new("Part", model)
2190
                rightArm = Instance.new("Part", model)
2191
                rightLeg = Instance.new("Part", model)
2192
                torso = Instance.new("Part", model)
2193
                rootPart = Instance.new("Part", model)
2194
                soundFallingDown = Instance.new("Sound", head)
2195
                soundFreeFalling = Instance.new("Sound", head)
2196
                soundGettingUp = Instance.new("Sound", head)
2197
                soundJumping = Instance.new("Sound", head)
2198
                soundRunning = Instance.new("Sound", head)
2199
                leftHip = Instance.new("Motor", torso)
2200
                leftShoulder = Instance.new("Motor", torso)
2201
                rightHip = Instance.new("Motor", torso)
2202
                rightShoulder = Instance.new("Motor", torso)
2203
                neck = Instance.new("Motor", torso)
2204
                rootJoint = Instance.new("Motor", rootPart)
2205
                feetPart = Instance.new("Part", model)
2206
                feetWeld = Instance.new("Weld", torso)
2207
                bodyGyro = Instance.new("BodyGyro", rootPart)
2208
                bodyVelocity = Instance.new("BodyVelocity", rootPart)
2209
                model.Archivable = false
2210
                model.Name = user_name or Player.Name
2211
                model.PrimaryPart = head
2212
                humanoid.LeftLeg = leftLeg
2213
                humanoid.RightLeg = rightLeg
2214
                humanoid.Torso = rootPart
2215
                head.CFrame = torsoCFrame * CFrame.new(0, 1.5, 0)
2216
                head.FormFactor = "Symmetric"
2217
                head.Locked = true
2218
                head.Name = "Head"
2219
                head.Size = Vector3.new(2, 1, 1)
2220
                head.TopSurface = "Smooth"
2221
                leftArm.CanCollide = false
2222
                leftArm.CFrame = torsoCFrame * CFrame.new(-1.5, 0, 0)
2223
                leftArm.FormFactor = "Symmetric"
2224
                leftArm.Locked = true
2225
                leftArm.Name = "Left Arm"
2226
                leftArm.Size = Vector3.new(1, 2, 1)
2227
                leftLeg.BottomSurface = "Smooth"
2228
                leftLeg.CanCollide = false
2229
                leftLeg.CFrame = torsoCFrame * CFrame.new(-0.5, -2, 0)
2230
                leftLeg.FormFactor = "Symmetric"
2231
                leftLeg.Locked = true
2232
                leftLeg.Name = "Left Leg"
2233
                leftLeg.Size = Vector3.new(1, 2, 1)
2234
                leftLeg.TopSurface = "Smooth"
2235
                rightArm.CanCollide = false
2236
                rightArm.CFrame = torsoCFrame * CFrame.new(1.5, 0, 0)
2237
                rightArm.FormFactor = "Symmetric"
2238
                rightArm.Locked = true
2239
                rightArm.Name = "Right Arm"
2240
                rightArm.Size = Vector3.new(1, 2, 1)
2241
                rightLeg.BottomSurface = "Smooth"
2242
                rightLeg.CanCollide = false
2243
                rightLeg.CFrame = torsoCFrame * CFrame.new(0.5, -2, 0)
2244
                rightLeg.FormFactor = "Symmetric"
2245
                rightLeg.Locked = true
2246
                rightLeg.Name = "Right Leg"
2247
                rightLeg.Size = Vector3.new(1, 2, 1)
2248
                rightLeg.TopSurface = "Smooth"
2249
                torso.CFrame = torsoCFrame
2250
                torso.FormFactor = "Symmetric"
2251
                torso.LeftSurface = "Weld"
2252
                torso.Locked = true
2253
                torso.RightSurface = "Weld"
2254
                torso.Name = "Torso"
2255
                torso.Size = Vector3.new(2, 2, 1)
2256
                rootPart.BottomSurface = "Smooth"
2257
                rootPart.BrickColor = BrickColor.Blue()
2258
                rootPart.CFrame = rootPartCFrame
2259
                rootPart.FormFactor = "Symmetric"
2260
                rootPart.LeftSurface = "Weld"
2261
                rootPart.Locked = true
2262
                rootPart.RightSurface = "Weld"
2263
                rootPart.Name = "HumanoidRootPart"
2264
                rootPart.Size = Vector3.new(2, 2, 1)
2265
                rootPart.TopSurface = "Smooth"
2266
                rootPart.Transparency = 1
2267
                soundFreeFalling.Archivable = false
2268
                soundFreeFalling.SoundId = "rbxasset://sounds/swoosh.wav"
2269
                soundGettingUp.Archivable = false
2270
                soundGettingUp.SoundId = "rbxasset://sounds/hit.wav"
2271
                soundRunning.Archivable = false
2272
                soundRunning.SoundId = "rbxasset://sounds/bfsl-minifigfoots1.mp3"
2273
                soundRunning.Looped = true
2274
                leftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
2275
                leftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
2276
                leftHip.MaxVelocity = 0.1
2277
                leftHip.Name = "Left Hip"
2278
                leftHip.Part0 = torso
2279
                leftHip.Part1 = leftLeg
2280
                leftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
2281
                leftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
2282
                leftShoulder.MaxVelocity = 0.15
2283
                leftShoulder.Name = "Left Shoulder"
2284
                leftShoulder.Part0 = torso
2285
                leftShoulder.Part1 = leftArm
2286
                rightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
2287
                rightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
2288
                rightHip.MaxVelocity = 0.1
2289
                rightHip.Name = "Right Hip"
2290
                rightHip.Part0 = torso
2291
                rightHip.Part1 = rightLeg
2292
                rightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
2293
                rightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
2294
                rightShoulder.MaxVelocity = 0.15
2295
                rightShoulder.Name = "Right Shoulder"
2296
                rightShoulder.Part0 = torso
2297
                rightShoulder.Part1 = rightArm
2298
                if prevLeftHip then
2299
                        leftHip.CurrentAngle = prevLeftHip.CurrentAngle
2300
                        leftHip.DesiredAngle = prevLeftHip.DesiredAngle
2301
                end
2302
                if prevLeftShoulder then
2303
                        leftShoulder.CurrentAngle = prevLeftShoulder.CurrentAngle
2304
                        leftShoulder.DesiredAngle = prevLeftShoulder.DesiredAngle
2305
                end
2306
                if prevRightHip then
2307
                        rightHip.CurrentAngle = prevRightHip.CurrentAngle
2308
                        rightHip.DesiredAngle = prevRightHip.DesiredAngle
2309
                end
2310
                if prevRightShoulder then
2311
                        rightShoulder.CurrentAngle = prevRightShoulder.CurrentAngle
2312
                        rightShoulder.DesiredAngle = prevRightShoulder.DesiredAngle
2313
                end
2314
                neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
2315
                neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
2316
                neck.Name = "Neck"
2317
                neck.Part0 = torso
2318
                neck.Part1 = head
2319
                rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
2320
                rootJoint.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
2321
                rootJoint.Name = "RootJoint"
2322
                rootJoint.Part0 = rootPart
2323
                rootJoint.Part1 = torso
2324
                feetPart.BottomSurface = "Smooth"
2325
                feetPart.CanCollide = false
2326
                feetPart.CFrame = torsoCFrame * CFrame.new(0, -3.1, 0)
2327
                feetPart.FormFactor = "Custom"
2328
                feetPart.Locked = true
2329
                feetPart.Name = "Platform"
2330
                feetPart.Size = Vector3.new(1.8, 0.2, 0.8)
2331
                feetPart.TopSurface = "Smooth"
2332
                feetPart.Transparency = 1
2333
                feetWeld.C0 = CFrame.new(0, -3, 0)
2334
                feetWeld.C1 = CFrame.new(0, 0.1, 0)
2335
                feetWeld.Name = "PlatformWeld"
2336
                feetWeld.Part0 = torso
2337
                feetWeld.Part1 = feetPart
2338
                table.insert(connections, feetPart.Touched:connect(function(hit)
2339
                        feetTouching[hit] = true
2340
                end))
2341
                table.insert(connections, feetPart.TouchEnded:connect(function(hit)
2342
                        feetTouching[hit] = nil
2343
                end))
2344
                feetTouchInterest = feetPart:FindFirstChild("TouchInterest")
2345
                bodyGyro.D = 3250
2346
                bodyGyro.P = 400000
2347
                bodyGyro.maxTorque = Vector3.new(1000000000, 0, 1000000000)
2348
                bodyVelocity.P = 5000
2349
                bodyVelocity.maxForce = Vector3.new(0, 0, 0)
2350
                bodyVelocity.velocity = Vector3.new(0, 0, 0)
2351
                torsoLight = Instance.new("PointLight", torso)
2352
                torsoLight.Brightness = 0.4
2353
                torsoLight.Color = Color3.new(1, 1, 1)
2354
                torsoLight.Range = 16
2355
                torsoLight.Shadows = true
2356
                local ff1, ff2, ff3, ff4, ff5, ff6, ff7, ff8, ff9 = Instance.new("ForceField", head), Instance.new("ForceField", leftArm), Instance.new("ForceField", leftLeg), Instance.new("ForceField", rightArm), Instance.new("ForceField", rightLeg), Instance.new("ForceField", torso), Instance.new("ForceField", wildcardHandle), Instance.new("ForceField", feetPart), Instance.new("ForceField", rootPart)
2357
                local forcefields = {[ff1] = head, [ff2] = leftArm, [ff3] = leftLeg, [ff4] = rightArm, [ff5] = rightLeg, [ff6] = torso, [ff7] = wildcardHandle, [ff8] = feetPart, [ff9] = rootPart}    
2358
                local objects = {[humanoid] = true, [head] = true, [leftArm] = true, [leftLeg] = true, [rightArm] = true, [rightLeg] = true, [torso] = true, [rootPart] = true, [rootJoint] = true, [soundFreeFalling] = true, [soundGettingUp] = true, [soundRunning] = true, [leftHip] = true, [leftShoulder] = true, [rightHip] = true, [rightShoulder] = true, [neck] = true, [feetPart] = true, [feetWeld] = true, [feetTouchInterest] = true, [bodyGyro] = true, [bodyVelocity] = true, [ff1] = true, [ff2] = true, [ff3] = true, [ff4] = true, [ff5] = true, [ff6] = true, [ff7] = true, [ff8] = true, [ff9] = true}            
2359
                local tshirtUrl = appearance.tshirt
2360
                if tshirtUrl then
2361
                        local tshirt = Instance.new("Decal", torso)
2362
                        tshirt.Name = "roblox"
2363
                        tshirt.Texture = tshirtUrl
2364
                        objects[tshirt] = true
2365
                end
2366
                for _, template in ipairs(appearance.characterObjects) do
2367
                        local object = template:Clone()
2368
                        local newObjects = {object}
2369
                        for _, object in ipairs(newObjects) do
2370
                                objects[object] = true
2371
                                for _, child in ipairs(object:GetChildren()) do
2372
                                        table.insert(newObjects, child)
2373
                                end                            
2374
                        end
2375
                        if object:IsA("BodyColors") then
2376
                                head.BrickColor = object.HeadColor
2377
                                leftArm.BrickColor = object.LeftArmColor
2378
                                leftLeg.BrickColor = object.LeftLegColor
2379
                                rightArm.BrickColor = object.RightArmColor
2380
                                rightLeg.BrickColor = object.RightLegColor
2381
                                torso.BrickColor = object.TorsoColor
2382
                        elseif object:IsA("Hat") then
2383
                                local handle = object:FindFirstChild("Handle")
2384
                                if handle and handle:IsA("BasePart") then
2385
                                        local weld = Instance.new("Weld", head)
2386
                                        weld.C0 = CFrame.new(0, 0.5, 0)
2387
                                        local attachmentPos = object.AttachmentPos
2388
                                        local attachmentRight = object.AttachmentRight
2389
                                        local attachmentUp = object.AttachmentUp
2390
                                        local attachmentForward = object.AttachmentForward
2391
                                        weld.C1 = CFrame.new(attachmentPos.X, attachmentPos.Y, attachmentPos.Z,
2392
                                                                                 attachmentRight.X, attachmentUp.X, -attachmentForward.X,
2393
                                                                                 attachmentRight.Y, attachmentUp.Y, -attachmentForward.Y,
2394
                                                                                 attachmentRight.Z, attachmentUp.Z, -attachmentForward.Z)
2395
                                        weld.Name = "HeadWeld"
2396
                                        weld.Part0 = head
2397
                                        weld.Part1 = handle
2398
                                        handle.Parent = model
2399
                                        local antiGravity = Instance.new("BodyForce", handle)
2400
                                        antiGravity.force = Vector3.new(0, handle:GetMass() * 196.2, 0)
2401
                                        objects[object] = false
2402
                                        object.Parent = nil
2403
                                        objects[weld] = true
2404
                                end
2405
                        end
2406
                        object.Parent = model
2407
                end
2408
                local facePresent = false
2409
                local headMeshPresent = false
2410
                for _, template in ipairs(appearance.headObjects) do
2411
                        local object = template:Clone()
2412
                        local newObjects = {object}
2413
                        for _, object in ipairs(newObjects) do
2414
                                objects[object] = true
2415
                                for _, child in ipairs(object:GetChildren()) do
2416
                                        table.insert(newObjects, child)
2417
                                end                            
2418
                        end
2419
                        if object:IsA("DataModelMesh") then
2420
                                headMeshPresent = true
2421
                        elseif object:IsA("Decal") then
2422
                                facePresent = true
2423
                        end
2424
                        object.Parent = head
2425
                end
2426
                if not facePresent then
2427
                        local face = Instance.new("Decal", head)
2428
                        face.Texture = "rbxasset://textures/face.png"
2429
                        objects[face] = true
2430
                end
2431
                if not headMeshPresent then
2432
                        local headMesh = Instance.new("SpecialMesh", head)
2433
                        headMesh.Scale = Vector3.new(1.25, 1.25, 1.25)
2434
                        objects[headMesh] = true
2435
                end
2436
                table.insert(connections, model.DescendantAdded:connect(function(object)
2437
                        local success, is_localscript = pcall(Game.IsA, object, "LocalScript")
2438
                        if success and is_localscript then
2439
                                pcall(Utility.SetProperty, object, "Disabled", true)
2440
                                local changed_connection = pcall(object.Changed.connect, object.Changed, function(property)
2441
                                        if property == "Disabled" and not object.Disabled then
2442
                                                pcall(Utility.SetProperty, object, "Disabled", true)
2443
                                                object:Destroy()
2444
                                        end
2445
                                end)
2446
                        end
2447
                        if not objects[object] then
2448
                                object:Destroy()
2449
                        end
2450
                end))
2451
                model.Parent = Workspace
2452
                Player.Character = model
2453
                Camera.CameraSubject = humanoid
2454
                Camera.CameraType = "Track"
2455
                Camera.CoordinateFrame = cameraCFrame
2456
                local IsStanding
2457
                local RegenerateHealth
2458
                local ResetCharacter
2459
                function IsStanding()
2460
                        return not not next(feetTouching)
2461
                end
2462
                function RegenerateHealth()
2463
                        if humanoid.Health < 1 then
2464
                                humanoid.Health = 100
2465
                        elseif not regeneratingHealth then
2466
                                regeneratingHealth = true
2467
                                local elapsedTime = wait(1)
2468
                                regeneratingHealth = false
2469
                                if humanoid.Health < 100 then
2470
                                        humanoid.Health = math.min(humanoid.Health + elapsedTime, 100)
2471
                                end
2472
                        end
2473
                end
2474
                function ResetCharacter()
2475
                        for index, connection in ipairs(connections) do
2476
                                connection:disconnect()
2477
                        end
2478
                        active = false
2479
                end
2480
                table.insert(connections, model.AncestryChanged:connect(ResetCharacter))
2481
                table.insert(connections, model.DescendantRemoving:connect(function(object)
2482
                        local parent = forcefields[object]
2483
                        if parent then
2484
                                forcefields[object] = nil
2485
                                local new_forcefield = Instance.new("ForceField")
2486
                                forcefields[new_forcefield] = parent
2487
                                objects[new_forcefield] = true
2488
                                new_forcefield.Parent = parent
2489
                        elseif objects[object] then
2490
                                ResetCharacter()
2491
                        end
2492
                end))
2493
                table.insert(connections, humanoid.HealthChanged:connect(RegenerateHealth))
2494
                table.insert(connections, humanoid.Climbing:connect(function() pose = "Climbing" end))
2495
                table.insert(connections, humanoid.FallingDown:connect(function(state)  pose = "FallingDown" end))
2496
                table.insert(connections, humanoid.FreeFalling:connect(function(state) pose = "FreeFall" if state then soundFreeFalling:Play() else
2497
 
2498
soundFreeFalling:Pause() end end))
2499
                table.insert(connections, humanoid.GettingUp:connect(function(state) pose = "GettingUp" if state then soundGettingUp:Play() else
2500
 
2501
soundGettingUp:Pause() end end))
2502
                table.insert(connections, humanoid.PlatformStanding:connect(function() pose = "PlatformStanding" end))
2503
                table.insert(connections, humanoid.Seated:connect(function() pose = "Seated" end))
2504
                table.insert(connections, humanoid.Swimming:connect(function(speed) if speed > 0 then pose = "Swimming" else pose = "Standing" end end))
2505
                local previousRootPartCFrame = rootPart.CFrame
2506
                TaskScheduler.Start(function()
2507
                        while active do
2508
                                local totalTime = TaskScheduler.GetCurrentTime()
2509
                                local stepTime = 1 / 60
2510
                                if not PlayerControl.characterEnabled then
2511
                                        ResetCharacter()
2512
                                        break
2513
                                end
2514
                                torsoLight.Brightness = 0.5 + 0.15 * math.sin(totalTime * 0.75 * math.pi)
2515
                                local featherfallEnabled = PlayerControl.IsFeatherfallEnabled()
2516
                                local rootPartCFrame = rootPart.CFrame
2517
                                if not jumpDebounce and UserInterface:IsKeyDown(Enum.KeyCode.Space) then
2518
                                        if humanoid.Sit then
2519
                                                humanoid.Sit = false
2520
                                        end
2521
                                        if IsStanding() then
2522
                                                jumpDebounce = true
2523
                                                pose = "Jumping"
2524
                                                rootPart.Velocity = Vector3.new(rootPart.Velocity.X, 50, rootPart.Velocity.Z)
2525
                                                torso.Velocity = Vector3.new(torso.Velocity.X, 50, torso.Velocity.Z)                                           
2526
                                                TaskScheduler.Schedule(1, function()
2527
                                                        if pose == "Jumping" then
2528
                                                                pose = "FreeFall"
2529
                                                        end
2530
                                                        jumpDebounce = false
2531
                                                        humanoid.Jump = false
2532
                                                end)
2533
                                        end
2534
                                end
2535
                                local cameraCFrame = Camera.CoordinateFrame
2536
                                local cameraDirection = cameraCFrame.lookVector
2537
                                if flying then
2538
                                        if PlayerControl.rolling then
2539
                                                local rootPartCFrame = rootPart.CFrame
2540
                                                local speed = (rootPartCFrame - rootPartCFrame.p):pointToObjectSpace(rootPart.Velocity).Y
2541
                                                local decay = 0.5 ^ stepTime
2542
                                                if math.abs(speed) <= 50 then
2543
                                                        PlayerControl.rollingAngle = (((PlayerControl.rollingAngle + 0.5) % 1 - 0.5) * decay) % 1
2544
                                                        PlayerControl.rollingOffset = PlayerControl.rollingOffset * decay
2545
                                                else
2546
                                                        PlayerControl.rollingAngle = (PlayerControl.rollingAngle + stepTime * speed * PlayerControl.rollingSpeed) % 1
2547
                                                        PlayerControl.rollingOffset = (PlayerControl.rollingOffset + PlayerControl.rollingMaxOffset * (1 / decay - 1)) * decay
2548
                                                end
2549
                                                rootJoint.C0 = (CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) * CFrame.Angles(PlayerControl.rollingAngle * 2 * math.pi, 0, 0)) * CFrame.new(0, -PlayerControl.rollingOffset, 0)
2550
                                        else
2551
                                                rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
2552
                                                PlayerControl.rollingAngle = 0
2553
                                                PlayerControl.rollingOffset = 0
2554
                                        end
2555
                                        rightShoulder.MaxVelocity = 0.5
2556
                                        leftShoulder.MaxVelocity = 0.5
2557
                                        rightShoulder.DesiredAngle = 0
2558
                                        leftShoulder.DesiredAngle = 0
2559
                                        rightHip.DesiredAngle = 0
2560
                                        leftHip.DesiredAngle = 0
2561
                                        bodyGyro.D = 500
2562
                                        bodyGyro.P = 1e6
2563
                                        bodyGyro.maxTorque = Vector3.new(1e6, 1e6, 1e6)
2564
                                        bodyVelocity.P = 1250
2565
                                        bodyVelocity.maxForce = Vector3.new(1e6, 1e6, 1e6)
2566
                                        local movementRight = 0
2567
                                        local movementForward = 0
2568
                                        local movementUp = 0
2569
                                        if UserInterface:IsKeyDown(Enum.KeyCode.A) and not UserInterface:IsKeyDown(Enum.KeyCode.D) then
2570
                                                movementRight = -1
2571
                                        elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then
2572
                                                movementRight = 1
2573
                                        end
2574
                                        if UserInterface:IsKeyDown(Enum.KeyCode.W) then
2575
                                                movementUp = 0.2
2576
                                                if not UserInterface:IsKeyDown(Enum.KeyCode.S) then
2577
                                                        movementForward = -1
2578
                                                end
2579
                                        elseif UserInterface:IsKeyDown(Enum.KeyCode.S) then
2580
                                                movementForward = 1
2581
                                        end
2582
                                        local movement = PlayerControl.fly_acceleration * cameraCFrame:vectorToWorldSpace(Vector3.new(movementRight, movementUp, movementForward))
2583
                                        local previousMomentum = flyingMomentum
2584
                                        local previousTilt = flyingTilt
2585
                                        flyingMomentum = movement + flyingMomentum * (1 - PlayerControl.fly_acceleration / PlayerControl.fly_speed)
2586
                                        flyingTilt = ((flyingMomentum * Vector3.new(1, 0, 1)).unit:Cross((previousMomentum * Vector3.new(1, 0, 1)).unit)).Y
2587
                                        if flyingTilt ~= flyingTilt or flyingTilt == math.huge then
2588
                                                flyingTilt = 0
2589
                                        end
2590
                                        local absoluteTilt = math.abs(flyingTilt)
2591
                                        if absoluteTilt > 0.06 or absoluteTilt < 0.0001 then
2592
                                                if math.abs(previousTilt) > 0.0001 then
2593
                                                        flyingTilt = previousTilt * 0.9
2594
                                                else
2595
                                                        flyingTilt = 0
2596
                                                end
2597
                                        else
2598
                                                flyingTilt = previousTilt * 0.77 + flyingTilt * 0.25
2599
                                        end
2600
                                        previousTilt = flyingTilt
2601
                                        if flyingMomentum.magnitude < 0.1 then
2602
                                                flyingMomentum = Vector3.new(0, 0, 0)
2603
--                                              bodyGyro.cframe = cameraCFrame
2604
                                        else
2605
                                                local momentumOrientation = CFrame.new(Vector3.new(0, 0, 0), flyingMomentum)
2606
                                                local tiltOrientation = CFrame.Angles(0, 0, -20 * flyingTilt)
2607
                                                bodyGyro.cframe = momentumOrientation * tiltOrientation * CFrame.Angles(-0.5 * math.pi * math.min(flyingMomentum.magnitude / PlayerControl.fly_speed, 1), 0, 0)
2608
                                        end
2609
                                        bodyVelocity.velocity = flyingMomentum + Vector3.new(0, 0.15695775618683547, 0)
2610
                                        rootPart.Velocity = flyingMomentum
2611
                                        previousMomentum = flyingMomentum
2612
                                else
2613
                                        rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
2614
                                        PlayerControl.rollingAngle = 0
2615
                                        PlayerControl.rollingOffset = 0
2616
                                        bodyGyro.D = 3250
2617
                                        bodyGyro.P = 400000
2618
                                        bodyVelocity.P = 5000
2619
                                        local cameraDirection = cameraCFrame.lookVector
2620
                                        local walkDirection = Vector3.new(0, 0, 0)
2621
                                        local walkSpeed = 16
2622
                                        if UserInterface:IsKeyDown(Enum.KeyCode.W) then
2623
                                                if UserInterface:IsKeyDown(Enum.KeyCode.A) then
2624
                                                        walkDirection = Vector3.new(cameraDirection.X + cameraDirection.Z, 0, cameraDirection.Z - cameraDirection.X).unit
2625
                                                elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then
2626
                                                        walkDirection = Vector3.new(cameraDirection.X - cameraDirection.Z, 0, cameraDirection.Z + cameraDirection.X).unit
2627
                                                else
2628
                                                        walkDirection = Vector3.new(cameraDirection.X, 0, cameraDirection.Z).unit
2629
                                                end
2630
                                        elseif UserInterface:IsKeyDown(Enum.KeyCode.S) then
2631
                                                if UserInterface:IsKeyDown(Enum.KeyCode.A) then
2632
                                                        walkDirection = Vector3.new(-cameraDirection.X + cameraDirection.Z, 0, -cameraDirection.Z - cameraDirection.X).unit
2633
                                                elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then
2634
                                                        walkDirection = Vector3.new(-cameraDirection.X - cameraDirection.Z, 0, -cameraDirection.Z + cameraDirection.X).unit
2635
                                                else
2636
                                                        walkDirection = Vector3.new(-cameraDirection.X, 0, -cameraDirection.Z).unit
2637
                                                end
2638
                                        elseif UserInterface:IsKeyDown(Enum.KeyCode.A) then
2639
                                                walkDirection = Vector3.new(cameraDirection.Z, 0, -cameraDirection.X).unit
2640
                                        elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then
2641
                                                walkDirection = Vector3.new(-cameraDirection.Z, 0, cameraDirection.X).unit
2642
                                        else
2643
                                                walkSpeed = 0
2644
                                        end
2645
                                        if walkSpeed ~= previousWalkSpeed then
2646
                                                if walkSpeed > 0 then
2647
                                                        soundRunning:Play()
2648
                                                else
2649
                                                        soundRunning:Pause()
2650
                                                end
2651
                                        end
2652
                                        if walkSpeed > 0 then
2653
                                                if pose ~= "Jumping" then
2654
                                                        if IsStanding() then
2655
                                                                pose = "Running"
2656
                                                        else
2657
                                                                pose = "FreeFall"
2658
                                                        end
2659
                                                end
2660
                                                bodyGyro.cframe = CFrame.new(Vector3.new(), walkDirection)
2661
                                                bodyGyro.maxTorque = Vector3.new(1000000000, 1000000000, 1000000000)
2662
                                                bodyVelocity.maxForce = Vector3.new(1000000, maxForceY, 1000000)
2663
                                        else
2664
                                                if pose ~= "Jumping" then
2665
                                                        if IsStanding() then
2666
                                                                pose = "Standing"
2667
                                                        else
2668
                                                                pose = "FreeFall"
2669
                                                        end
2670
                                                end
2671
                                                -- TODO: find and fix bug that causes torso to rotate back to some angle
2672
                                                bodyGyro.maxTorque = Vector3.new(1000000000, 1000000000, 1000000000) -- Vector3.new(1000000000, 0, 1000000000)
2673
                                                if PlayerControl.pushable then
2674
                                                        bodyVelocity.maxForce = Vector3.new(0, 0, 0)
2675
                                                else
2676
                                                        bodyVelocity.maxForce = Vector3.new(1000000, 0, 1000000)
2677
                                                end
2678
                                        end
2679
                                        if featherfallEnabled then
2680
                                                local velocity = rootPart.Velocity
2681
                                                if velocity.Y > 50 then
2682
                                                        rootPart.Velocity = Vector3.new(velocity.X, 50, velocity.Z)
2683
                                                elseif velocity.Y < -50 then
2684
                                                        rootPart.Velocity = Vector3.new(velocity.X, -50, velocity.Z)
2685
                                                end
2686
                                                local distanceVector = rootPartCFrame.p - previousRootPartCFrame.p
2687
                                                local offsetX, offsetY, offsetZ = distanceVector.X, distanceVector.Y, distanceVector.Z
2688
                                                local MAX_MOVEMENT = 50 * 0.03333333507180214
2689
                                                if offsetX > MAX_MOVEMENT then
2690
                                                        offsetX = MAX_MOVEMENT
2691
                                                elseif offsetX < -MAX_MOVEMENT then
2692
                                                        offsetX = -MAX_MOVEMENT
2693
                                                end
2694
                                                if offsetY > MAX_MOVEMENT then
2695
                                                        offsetY = MAX_MOVEMENT
2696
                                                elseif offsetY < -MAX_MOVEMENT then
2697
                                                        offsetY = -MAX_MOVEMENT
2698
                                                end
2699
                                                if offsetZ > MAX_MOVEMENT then
2700
                                                        offsetZ = MAX_MOVEMENT
2701
                                                elseif offsetZ < -MAX_MOVEMENT then
2702
                                                        offsetZ = -MAX_MOVEMENT
2703
                                                end
2704
                                                local offset = Vector3.new(offsetX, offsetY, offsetZ)
2705
                                                if offset ~= distanceVector then
2706
                                                        rootPartCFrame = previousRootPartCFrame + offset
2707
                                                        --rootPart.CFrame = rootPartCFrame
2708
                                                end
2709
                                        end
2710
                                        local walkingVelocity = walkDirection * walkSpeed
2711
                                        bodyVelocity.velocity = walkingVelocity
2712
                                        if not jumpDebounce and math.abs(rootPart.Velocity.Y) <= 0.1 then
2713
                                                rootPart.Velocity = Vector3.new(walkingVelocity.X, rootPart.Velocity.Y, walkingVelocity.Z)
2714
                                        end
2715
                                        previousWalkSpeed = walkSpeed
2716
                                        if pose == "Jumping" or jumpDebounce then
2717
                                                rightShoulder.MaxVelocity = 0.5
2718
                                                leftShoulder.MaxVelocity = 0.5
2719
                                                rightShoulder.DesiredAngle = 3.14
2720
                                                leftShoulder.DesiredAngle = -3.14
2721
                                                rightHip.DesiredAngle = 0
2722
                                                leftHip.DesiredAngle = 0
2723
                                        elseif pose == "FreeFall" then
2724
                                                rightShoulder.MaxVelocity = 0.5
2725
                                                leftShoulder.MaxVelocity = 0.5
2726
                                                rightShoulder.DesiredAngle = 3.14
2727
                                                leftShoulder.DesiredAngle = -3.14
2728
                                                rightHip.DesiredAngle = 0
2729
                                                leftHip.DesiredAngle = 0
2730
                                        elseif pose == "Seated" then
2731
                                                rightShoulder.MaxVelocity = 0.15
2732
                                                leftShoulder.MaxVelocity = 0.15
2733
                                                rightShoulder.DesiredAngle = 3.14 / 2
2734
                                                leftShoulder.DesiredAngle = -3.14 / 2
2735
                                                rightHip.DesiredAngle = 3.14 / 2
2736
                                                leftHip.DesiredAngle = -3.14 / 2
2737
                                        else
2738
                                                local climbFudge = 0
2739
                                                local amplitude
2740
                                                local frequency
2741
                                                if pose == "Running" then
2742
                                                        rightShoulder.MaxVelocity = 0.15
2743
                                                        leftShoulder.MaxVelocity = 0.15
2744
                                                        amplitude = 1
2745
                                                        frequency = 9
2746
                                                elseif (pose == "Climbing") then
2747
                                                        rightShoulder.MaxVelocity = 0.5
2748
                                                        leftShoulder.MaxVelocity = 0.5
2749
                                                        amplitude = 1
2750
                                                        frequency = 9
2751
                                                        climbFudge = 3.14
2752
                                                else
2753
                                                        amplitude = 0.1
2754
                                                        frequency = 1
2755
                                                end
2756
                                                local desiredAngle = amplitude * math.sin(totalTime * frequency)
2757
                                                rightShoulder.DesiredAngle = desiredAngle + climbFudge
2758
                                                leftShoulder.DesiredAngle = desiredAngle - climbFudge
2759
                                                rightHip.DesiredAngle = -desiredAngle
2760
                                                leftHip.DesiredAngle = -desiredAngle
2761
                                        end
2762
                                end
2763
                                previousRootPartCFrame = rootPartCFrame
2764
                                RunService.RenderStepped:wait()
2765
                        end
2766
                        if model.Parent ~= nil then
2767
                                model.Parent = nil
2768
                        end
2769
                        PlayerControl.CreateCharacter()
2770
                end)
2771
                humanoid.Health = 100
2772
                character = model
2773
                chatAdornee = head
2774
        elseif characterMode == "pyramid" then
2775
                if PlayerControl.characterEnabled then
2776
                        Camera.CameraType = "Fixed"
2777
                        PyramidCharacter.camera_distance = (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude
2778
                        PyramidCharacter.camera_position = Camera.Focus.p
2779
                        PyramidCharacter.Teleport(Camera.Focus.p)
2780
                        PyramidCharacter.visible = true
2781
                        Player.Character = nil
2782
                else
2783
                        PyramidCharacter.visible = false
2784
                end
2785
        end
2786
end
2787
function PlayerControl.GetCharacter()
2788
        return character
2789
end
2790
function PlayerControl.GetHead()
2791
        local characterMode = PlayerControl.characterMode
2792
        if characterMode == "normal" then
2793
                return head
2794
        elseif characterMode == "pyramid" then
2795
                return PyramidCharacter.core
2796
        end
2797
end
2798
function PlayerControl.GetHumanoid()
2799
        return humanoid
2800
end
2801
function PlayerControl.GetRootPart()
2802
        return rootPart
2803
end
2804
function PlayerControl.GetTorso()
2805
        return torso
2806
end
2807
function PlayerControl.IsEnabled()
2808
        return PlayerControl.characterEnabled
2809
end
2810
function PlayerControl.IsFeatherfallEnabled()
2811
        return PlayerControl.featherfallEnabled
2812
end
2813
function PlayerControl.IsPushable()
2814
        return PlayerControl.pushable
2815
end
2816
function PlayerControl.IsRolling()
2817
        return PlayerControl.rolling
2818
end
2819
function PlayerControl.ResetCharacter()
2820
        if character and character.Parent then
2821
                character.Parent = nil
2822
        end
2823
        PyramidCharacter.visible = false
2824
end
2825
function PlayerControl.SetEnabled(state, no_animation)
2826
        state = not not state
2827
        if state ~= PlayerControl.characterEnabled then
2828
                PlayerControl.characterEnabled = state
2829
                local characterMode = PlayerControl.characterMode
2830
                if characterMode == "normal" then
2831
                        local torso = PlayerControl.GetRootPart()
2832
                        local rootPart = PlayerControl.GetRootPart()
2833
                        if rootPart then
2834
                                if PlayerControl.characterEnabled then
2835
                                        local torso_cframe = Camera.Focus:toWorldSpace(PlayerControl.hide_torso_object_cframe)
2836
                                        PlayerControl.torso_cframe = torso_cframe
2837
                                        torso.CFrame = torso_cframe
2838
                                        rootPart.CFrame = torso_cframe
2839
                                else
2840
                                        PlayerControl.hide_torso_object_cframe = Camera.Focus:toObjectSpace(rootPart.CFrame)
2841
                                end
2842
                        else
2843
                                PlayerControl.torso_cframe = Camera.Focus
2844
                        end
2845
                        if PlayerControl.characterEnabled then
2846
                                PlayerControl.CreateCharacter()
2847
                                RunService.Stepped:wait()
2848
                                coroutine.yield()
2849
                                if not no_animation then
2850
                                        GraphicalEffects.CrystalRing({base_part = PlayerControl.GetTorso(), crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
2851
                                end            
2852
                        else
2853
                                Player.Character = nil
2854
                                Camera.CameraType = "Fixed"
2855
                                if not no_animation then
2856
                                        GraphicalEffects.CrystalRing({position = PlayerControl.GetTorso().Position, crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
2857
                                end
2858
                        end
2859
                else
2860
                        if state then
2861
                                PlayerControl.CreateCharacter()
2862
                                RunService.Stepped:wait()
2863
                                coroutine.yield()
2864
                                if not no_animation then
2865
                                        GraphicalEffects.CrystalRing({base_part = PyramidCharacter.core, crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
2866
                                end
2867
                        else
2868
                                PyramidCharacter.visible = false
2869
                                if not no_animation then
2870
                                        GraphicalEffects.CrystalRing({position = PyramidCharacter.core.Position, crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
2871
                                end
2872
                        end
2873
                end
2874
        end
2875
end
2876
function PlayerControl.SetFeatherfallEnabled(state)
2877
        state = not not state
2878
        if state ~= PlayerControl.featherfallEnabled then
2879
                PlayerControl.featherfallEnabled = state
2880
                if state then
2881
                        Logger.print("Info", "Featherfall enabled in PlayerControl")
2882
                else
2883
                        Logger.print("Info", "Featherfall disabled in PlayerControl")
2884
                end
2885
        end
2886
end
2887
function PlayerControl.SetPushable(state)
2888
        state = not not state
2889
        if state ~= PlayerControl.pushable then
2890
                PlayerControl.pushable = state
2891
                if state then
2892
                        Logger.print("Info", "Pushing enabled in PlayerControl")
2893
                else
2894
                        Logger.print("Info", "Pushing disabled in PlayerControl")
2895
                end
2896
        end
2897
end
2898
function PlayerControl.SetRolling(state)
2899
        state = not not state
2900
        if state ~= PlayerControl.rolling then
2901
                PlayerControl.rolling = state
2902
                if state then
2903
                        Logger.print("Info", "Rolling fly mode enabled in PlayerControl")
2904
                else
2905
                        Logger.print("Info", "Rolling fly mode disabled in PlayerControl")
2906
                end
2907
        end
2908
end
2909
function PlayerControl.StartFlying()
2910
        PlayerControl.fly_speed = PlayerControl.fly_basespeed
2911
        if torso then
2912
                flyingMomentum = torso.Velocity + torso.CFrame.lookVector * 3 + Vector3.new(0, 10, 0)
2913
        else
2914
                flyingMomentum = Vector3.new()
2915
        end
2916
        flyingTilt = 0
2917
        flying = true
2918
end
2919
function PlayerControl.StopFlying()
2920
        if bodyGyro.cframe then
2921
                local lookVector = bodyGyro.cframe.lookVector
2922
                if lookVector.X ~= 0 or lookVector.Z ~= 0 then
2923
                        bodyGyro.cframe = CFrame.new(Vector3.new(), Vector3.new(lookVector.X, 0, lookVector.Z))
2924
                end
2925
        end
2926
        flying = false
2927
end
2928
local previousTime = 0
2929
 
2930
ControllerCommands = {};
2931
 
2932
ControllerCommands = {};
2933
 
2934
ControllerCommands.BALEFIRE_SPEED = 40
2935
function ControllerCommands.BalefireAtMouse()
2936
        local head = chatAdornee
2937
        if head then
2938
                local target = Mouse.Hit.p
2939
                local origin = head.Position
2940
                local direction = (target - origin).unit
2941
                local explosionCount = 0
2942
                local animation_frame = 0
2943
                local magic_circle_position = origin + direction * 4
2944
                local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction)
2945
                local magic_circle_part = Instance.new("Part")
2946
                local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part)
2947
                local magic_circle_light = Instance.new("PointLight", magic_circle_part)
2948
                local magic_circle_decal_back = Instance.new("Decal", magic_circle_part)
2949
                local magic_circle_decal_front = Instance.new("Decal", magic_circle_part)
2950
                magic_circle_part.Anchored = true
2951
                magic_circle_part.Archivable = false
2952
                magic_circle_part.BottomSurface = "Smooth"
2953
                magic_circle_part.CanCollide = false
2954
                magic_circle_part.CFrame = magic_circle_cframe
2955
                magic_circle_part.FormFactor = "Custom"
2956
                magic_circle_part.Locked = true
2957
                magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2)
2958
                magic_circle_part.TopSurface = "Smooth"
2959
                magic_circle_part.Transparency = 1
2960
                magic_circle_mesh.Scale = Vector3.new(60, 60, 0)
2961
                magic_circle_light.Color = Color3.new(1, 0.5, 1)
2962
                magic_circle_light.Range = 16
2963
                magic_circle_light.Shadows = true
2964
                magic_circle_decal_back.Face = "Back"
2965
                magic_circle_decal_back.Texture = "rbxassetid://122610943"
2966
                magic_circle_decal_front.Face = "Front"
2967
                magic_circle_decal_front.Texture = "rbxassetid://122610943"
2968
                local function NextExplosion()
2969
                        explosionCount = explosionCount + 1
2970
                        Instance.new("Explosion", Workspace).Position = origin + direction * (explosionCount * 8 + 4)
2971
                end
2972
                local function AnimateMagicCircle()
2973
                        animation_frame = animation_frame + 1
2974
                        local transparency = (animation_frame / 40) ^ 3
2975
                        if animation_frame == 40 then
2976
                                pcall(Game.Destroy, magic_circle_part)
2977
                        else
2978
                                if magic_circle_part.Parent ~= Workspace then
2979
                                        pcall(Utility.SetProperty, magic_circle_part, "Parent", Workspace)
2980
                                end
2981
                                head = PlayerControl.GetHead()
2982
                                if head then
2983
                                        magic_circle_position = head.Position + direction * 4
2984
                                end
2985
                                magic_circle_part.CFrame = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0,
2986
 
2987
math.tau * animation_frame / 40 * 1.5)
2988
                                magic_circle_light.Brightness = 1 - transparency
2989
                                magic_circle_decal_back.Transparency = transparency
2990
                                magic_circle_decal_front.Transparency = transparency
2991
                        end
2992
                end
2993
                magic_circle_part.Parent = Workspace
2994
                for i = 1, 40 do
2995
                        Delay((i - 1) / ControllerCommands.BALEFIRE_SPEED, NextExplosion)
2996
                        Delay((i - 1) / 30, AnimateMagicCircle)
2997
                end
2998
                for i = 1, 20 do
2999
                        Delay((i - 1) / ControllerCommands.BALEFIRE_SPEED, NextExplosion)
3000
                end
3001
        end
3002
end
3003
function ControllerCommands.ControlRandomDummy()
3004
        local dummies = {}
3005
        local numDummies = 0
3006
        for _, character in ipairs(Workspace:GetChildren()) do
3007
                local name = tostring(character)
3008
                if name == "???" or name == "Dummy" then
3009
                        local head, humanoid
3010
                        for _, child in ipairs(character:GetChildren()) do
3011
                                local className = child.ClassName
3012
                                if className == "Part" and tostring(child) == "Head" then
3013
                                        head = child
3014
                                        if humanoid then
3015
                                                break
3016
                                        end
3017
                                elseif className == "Humanoid" then
3018
                                        if child.Health > 0 then
3019
                                                humanoid = child
3020
                                                if head then
3021
                                                        break
3022
                                                end
3023
                                        else
3024
                                                break
3025
                                        end
3026
                                end
3027
                        end
3028
                        if head and humanoid then
3029
                                numDummies = numDummies + 1
3030
                                dummies[numDummies] = {character, head, humanoid}
3031
                        end
3032
                end
3033
        end
3034
        if numDummies > 0 then
3035
                local dummy = dummies[math.random(numDummies)]
3036
                Player.Character = dummy[1]
3037
                chatAdornee = dummy[2]
3038
                Camera.CameraSubject = dummy[3]
3039
                Camera.CameraType = "Track"
3040
        end
3041
end
3042
function ControllerCommands.Decalify(textures, exclusion)
3043
        local objects = Workspace:GetChildren()
3044
        for _, object in ipairs(objects) do
3045
                if not exclusion[object] then
3046
                        for _, child in ipairs(object:GetChildren()) do
3047
                                objects[#objects + 1] = child
3048
                        end
3049
                        if object:IsA("BasePart") then
3050
                                local texture = textures[math.random(#textures)]
3051
                                local face_left = Instance.new("Decal", object)
3052
                                face_left.Face = Enum.NormalId.Left
3053
                                face_left.Texture = texture
3054
                                local face_right = Instance.new("Decal", object)
3055
                                face_right.Face = Enum.NormalId.Right
3056
                                face_right.Texture = texture
3057
                                local face_bottom = Instance.new("Decal", object)
3058
                                face_bottom.Face = Enum.NormalId.Bottom
3059
                                face_bottom.Texture = texture
3060
                                local face_top = Instance.new("Decal", object)
3061
                                face_top.Face = Enum.NormalId.Top
3062
                                face_top.Texture = texture
3063
                                local face_front = Instance.new("Decal", object)
3064
                                face_front.Face = Enum.NormalId.Front
3065
                                face_front.Texture = texture
3066
                                local face_back = Instance.new("Decal", object)
3067
                                face_back.Face = Enum.NormalId.Back
3068
                                face_back.Texture = texture
3069
                        end
3070
                end
3071
        end
3072
end
3073
 
3074
function ControllerCommands.ExplodeAtMouse()
3075
        local explosion = Instance.new("Explosion")
3076
        explosion.Position = Mouse.Hit.p
3077
        explosion.Parent = Workspace
3078
end
3079
function ControllerCommands.LaserAtMouse()
3080
        GraphicalEffects.ShootLaserOfDeath(Mouse.Hit.p)
3081
end
3082
function ControllerCommands.BigLaser(target)
3083
        GraphicalEffects.ShootLaserOfDeath(target, {brickcolor = BrickColor.new("New Yeller"), duration = 80, fragmentation_size = 6,laser_scale = 30, light_color = Color3.new(1, 0.5, 0), magic_circle_image = "rbxassetid://126561317", magic_circle_scale = 1.5, sound_volume = 1,special_effects = BrickColor.new("Deep orange"), stay = 2})
3084
end
3085
function ControllerCommands.BigLaserAtMouse()
3086
        ControllerCommands.BigLaser(Mouse.Hit.p)
3087
end
3088
function ControllerCommands.ShootMissile(targetPart, pointOnPart, direction)
3089
        GraphicalEffects.ShootMissile(targetPart, pointOnPart, direction)
3090
end
3091
function ControllerCommands.ShootMissileAtMouse(amount, spread, delayTime)
3092
        local exclusionList = {}
3093
        local playerHead = PlayerControl.GetHead()
3094
        local playerTorso = PlayerControl.GetTorso()
3095
        if playerHead and playerTorso then
3096
                exclusionList[playerTorso] = true
3097
                local humanoid, torso = Utility.FindHumanoidClosestToRay(Mouse.UnitRay, exclusionList)
3098
                local targetPart, pointOnPart
3099
                if humanoid and torso then
3100
                        targetPart, pointOnPart = torso, Vector3.new()
3101
                else
3102
                        local target = Mouse.Target
3103
                        if target then
3104
                                targetPart, pointOnPart = target, target.CFrame:pointToObjectSpace(Mouse.Hit.p)
3105
                        else
3106
                                return
3107
                        end
3108
                end
3109
                if targetPart then
3110
                        local direction = (Mouse.Hit.p - playerHead.Position).unit
3111
                        delayTime = delayTime or 0
3112
                        for index = 1, amount do
3113
                                local angles = math.tau * (index - 0.5) * spread / amount * Vector3.new(math.random() - 0.5, math.random() - 0.5,math.random() - 0.5).unit
3114
                                TaskScheduler.Schedule(delayTime * (index - 1), ControllerCommands.ShootMissile, targetPart, pointOnPart, CFrame.Angles(angles.X, angles.Y, angles.Z) * direction)
3115
                        end
3116
                end
3117
        end
3118
end
3119
function ControllerCommands.ShootMissileAroundMouse(amount, offset, delayTime)
3120
        local exclusionList = {}
3121
        local playerHead = PlayerControl.GetHead()
3122
        local playerTorso = PlayerControl.GetTorso()
3123
        if playerHead and playerTorso then
3124
                exclusionList[playerTorso] = true
3125
                local humanoid, torso = Utility.FindHumanoidClosestToRay(Mouse.UnitRay, exclusionList)
3126
                local targetPart, pointOnPart
3127
                if humanoid and torso then
3128
                        targetPart, pointOnPart = torso, Vector3.new()
3129
                else
3130
                        local target = Mouse.Target
3131
                        if target then
3132
                                targetPart, pointOnPart = target, target.CFrame:pointToObjectSpace(Mouse.Hit.p)
3133
                        else
3134
                                return
3135
                        end
3136
                end
3137
                if targetPart then
3138
                        delayTime = delayTime or 0
3139
                        local index = 1
3140
                        local targetPoint = targetPart.CFrame * pointOnPart
3141
                        local rotation_offset_angles = math.tau * Vector3.new(math.random() - 0.5, math.random() - 0.5, 0).unit
3142
                        local rotation_offset = CFrame.Angles(rotation_offset_angles.x, rotation_offset_angles.y, 0)
3143
                        local angle_x = 0
3144
                        local angle_x_step = math.tau / math.phi
3145
                        for i = 1, 8 * amount do
3146
                                angle_x = angle_x + angle_x_step
3147
                                local direction = rotation_offset * (CFrame.Angles(0, math.tau * index / amount, 0) * CFrame.Angles(angle_x, 0,0).lookVector)
3148
                                local blocked = Workspace:FindPartOnRay(Ray.new(targetPoint, direction * offset), targetPart.Parent)
3149
                                if not blocked then
3150
                                        local p0, p1, p2, p3 = targetPart, pointOnPart, direction, offset; GraphicalEffects.ShootMissile(p0, p1, p2, function() return p0 end, p3, true)
3151
                                        index = index + 1
3152
                                        if index > amount then
3153
                                                break
3154
                                        end
3155
                                end
3156
                        end
3157
                end
3158
        end
3159
end
3160
 
3161
function ControllerCommands.HugeExplosionOfDoom(position)
3162
        local connections = {}
3163
        local parts = {}
3164
        local cframe = CFrame.new(position)
3165
        local function ExplosionHit(part)
3166
                if part:GetMass() < 10000 and part.Parent ~= Camera then
3167
                        parts[part] = true
3168
                        part.Anchored = true
3169
                        part:BreakJoints()
3170
                        part.BrickColor = BrickColor.new("Instituational white")
3171
                end
3172
        end
3173
        for i = 1, 4 do
3174
                local quantity = 0.5 * i * (1 + i)
3175
                local fraction = math.tau / quantity
3176
                for x = 1, quantity do
3177
                        for y = 1, quantity do
3178
                                local explosion = Instance.new("Explosion")
3179
                                connections[#connections + 1] = explosion.Hit:connect(ExplosionHit)
3180
                                explosion.BlastRadius = 5
3181
                                explosion.Position = cframe * (CFrame.Angles(fraction * x, fraction * y, 0) * Vector3.new((i - 1) * 6, 0, 0))
3182
                                explosion.Parent = Workspace
3183
                        end
3184
                end
3185
                wait(0.075)
3186
        end
3187
        for part in pairs(parts) do
3188
                for _, child in ipairs(part:GetChildren()) do
3189
                        if child:IsA("BodyMover") then
3190
                                child:Destroy()
3191
                        end
3192
                end
3193
                local mass = part:GetMass()
3194
                local velocity = CFrame.Angles(math.tau * math.random(), math.tau * math.random(), 0) * Vector3.new(25, 0, 0)
3195
                local bodythrust = Instance.new("BodyThrust")
3196
                bodythrust.force = mass * -velocity
3197
                bodythrust.Parent = part
3198
                local bodyforce = Instance.new("BodyForce")
3199
                bodyforce.force = mass * Vector3.new(0, 196.2, 0)
3200
                bodyforce.Parent = part
3201
                part.Anchored = false
3202
                part.Reflectance = 1
3203
                part.RotVelocity = math.tau * Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5)
3204
                part.Transparency = 0.5
3205
                part.Velocity = (part.CFrame - part.Position) * velocity
3206
        end
3207
        for _, connection in ipairs(connections) do
3208
                connection:disconnect()
3209
        end
3210
        for i = 0, 99 do
3211
                Delay(i / 10, function()
3212
                        for part in pairs(parts) do
3213
                                local new_transparency = 0.5 * (1 + i / 50)
3214
                                part.Reflectance = 0.98 * part.Reflectance
3215
                                if new_transparency > part.Transparency then
3216
                                        part.Transparency = new_transparency
3217
                                end
3218
                        end
3219
                end)
3220
        end
3221
        Delay(10, function()
3222
                for part in pairs(parts) do
3223
                        pcall(part.Destroy, part)
3224
                end
3225
        end)
3226
end
3227
function ControllerCommands.HugeExplosionOfDoomAtMouse()
3228
        ControllerCommands.HugeExplosionOfDoom(Mouse.Hit.p)
3229
end
3230
 
3231
function ControllerCommands.SpaceHyperBeam(asd)
3232
        GraphicalEffects.SpaceHyperBeam(asd)
3233
end
3234
function ControllerCommands.SpaceHyperBeamAtMouse()
3235
        ControllerCommands.SpaceHyperBeam(Mouse.Hit.p)
3236
end
3237
function ControllerCommands.ConcentratedSpaceHyperBeamAtMouse()
3238
        local p = Mouse.Hit.p; for i = 1, 50 do GraphicalEffects.SpaceHyperBeam(p) end
3239
end
3240
 
3241
function ControllerCommands.TeleportCharacterToMouse()
3242
        if PlayerControl.IsEnabled() then
3243
                local torso = PlayerControl.GetTorso()
3244
                if torso then
3245
                        local pos = Mouse.Hit.p + Vector3.new(0, 5, 0)
3246
                        torso.CFrame = CFrame.new(pos, pos + torso.CFrame.lookVector)
3247
                end
3248
        else
3249
                local new_focus_position = Mouse.Hit.p
3250
                local direction_vector = Camera.CoordinateFrame.lookVector
3251
                local new_focus = CFrame.new(new_focus_position, new_focus_position + direction_vector)
3252
                Camera.CoordinateFrame = new_focus * CFrame.new(0, 0, 25)
3253
                Camera.Focus = new_focus
3254
        end
3255
end
3256
 
3257
AdvancedGUI = {};
3258
 
3259
if not AdvancedGUI.GUI_BASE_COLOR then
3260
        AdvancedGUI.GUI_BASE_COLOR = Color3.new(0, 0, 0)
3261
end
3262
function AdvancedGUI.GenerateChatColor(speakerName)
3263
        local chatColor = ChatColor.Get(speakerName).Color
3264
        local brightness = chatColor.r + chatColor.g + chatColor.b
3265
        if brightness < 1.5 then
3266
                chatColor = Color3.new(math.min(1, 0.4 + chatColor.r), math.min(1, 0.4 + chatColor.g), math.min(1, 0.4 + chatColor.b))
3267
        else
3268
                chatColor = Color3.new(math.min(1, 0.05 + chatColor.r), math.min(1, 0.05 + chatColor.g), math.min(1, 0.05 + chatColor.b))
3269
        end
3270
        return chatColor
3271
end
3272
GuiBase = {}
3273
GuiBase.__index = GuiBase
3274
function GuiBase:new(data)
3275
        local instance = setmetatable({}, self)
3276
        instance:Init(data)
3277
        return instance
3278
end
3279
function GuiBase:Destroy()
3280
        if self.parent then
3281
                self.parent.children[self] = nil
3282
        end
3283
        for child in pairs(self.children) do
3284
                child:Destroy()
3285
        end
3286
        self.m_base_instance:Destroy()
3287
end
3288
function GuiBase:GetContentInstance(child)
3289
        return self.m_base_instance
3290
end
3291
function GuiBase:Init()
3292
        self.children = {}
3293
end
3294
function GuiBase:IsA(className)
3295
        return className == "GuiBase"
3296
end
3297
function GuiBase:SetParent(parent)
3298
        if parent ~= self.parent then
3299
                if self.parent then
3300
                        self.parent.children[self] = nil
3301
                end
3302
                self.parent = parent
3303
                if parent then
3304
                        parent.children[self] = true
3305
                        self.m_base_instance.Parent = parent:GetContentInstance()
3306
                else
3307
                        self.m_base_instance.Parent = nil
3308
                end
3309
        end
3310
end
3311
GuiObject = setmetatable({}, GuiBase)
3312
GuiObject.__index = GuiObject
3313
function GuiObject:Destroy()
3314
        self.DragBegin:disconnect()
3315
        self.DragMove:disconnect()
3316
        self.DragStopped:disconnect()
3317
        self.MouseButton1Click:disconnect()
3318
        self.MouseButton1Down:disconnect()
3319
        self.MouseButton1Up:disconnect()
3320
        self.MouseButton2Down:disconnect()
3321
        self.MouseButton2Up:disconnect()
3322
        self.MouseEnter:disconnect()
3323
        self.MouseLeave:disconnect()
3324
        GuiBase.Destroy(self)
3325
end
3326
function GuiObject:GetAbsolutePosition()
3327
        return self.m_base_instance.AbsolutePosition
3328
end
3329
function GuiObject:GetAbsoluteSize()
3330
        return self.m_base_instance.AbsoluteSize
3331
end
3332
function GuiObject:GetPosition()
3333
        return self.position
3334
end
3335
function GuiObject:GetSize()
3336
        return self.size
3337
end
3338
function GuiObject:Init()
3339
        GuiBase.Init(self)
3340
        self.mouseDown = false
3341
        self.mouseOver = false
3342
        self.DragBegin = RbxUtility.CreateSignal()
3343
        self.DragMove = RbxUtility.CreateSignal()
3344
        self.DragStopped = RbxUtility.CreateSignal()
3345
        self.MouseButton1Click = RbxUtility.CreateSignal()
3346
        self.MouseButton1Down = RbxUtility.CreateSignal()
3347
        self.MouseButton1Up = RbxUtility.CreateSignal()
3348
        self.MouseButton2Down = RbxUtility.CreateSignal()
3349
        self.MouseButton2Up = RbxUtility.CreateSignal()
3350
        self.MouseEnter = RbxUtility.CreateSignal()
3351
        self.MouseLeave = RbxUtility.CreateSignal()
3352
end
3353
function GuiObject:IsA(className)
3354
        return className == "GuiObject" or GuiBase.IsA(self, className)
3355
end
3356
function GuiObject:SetActive(active)
3357
        if active ~= self.active then
3358
                self.active = active
3359
        end
3360
end
3361
function GuiObject:SetBackgroundTransparency(backgroundTransparency)
3362
        if backgroundTransparency ~= self.backgroundTransparency then
3363
                self.backgroundTransparency = backgroundTransparency
3364
                self.m_base_instance.BackgroundTransparency = backgroundTransparency
3365
        end
3366
end
3367
function GuiObject:SetColor(color)
3368
        if color ~= self.color then
3369
                self.color = color
3370
                self.m_base_instance.BackgroundColor3 = color
3371
        end
3372
end
3373
function GuiObject:SetPosition(position)
3374
        if position ~= self.position then
3375
                self.position = position
3376
                self.m_base_instance.Position = position
3377
        end
3378
end
3379
function GuiObject:SetSize(size)
3380
        if size ~= self.size then
3381
                self.size = size
3382
                self.m_base_instance.Size = size
3383
        end
3384
end
3385
function GuiObject:SetVisible(visible)
3386
        if visible ~= self.visible then
3387
                self.visible = visible
3388
                self.m_base_instance.Visible = visible
3389
        end
3390
end
3391
function GuiObject:SetZIndex(zIndex)
3392
        local stack = {self.m_base_instance}
3393
        repeat
3394
                local object = stack[#stack]
3395
                stack[#stack] = nil
3396
                for _, child in ipairs(object:GetChildren()) do
3397
                        stack[#stack + 1] = child
3398
                end
3399
                object.ZIndex = zIndex
3400
        until #stack == 0
3401
end
3402
GuiServiceClass = setmetatable({}, GuiBase)
3403
GuiServiceClass.__index = GuiServiceClass
3404
function GuiServiceClass:CreateTextArea(text, font, fontSize, textColor3, textXAlignment, textYAlignment, maxWidth, minWidth)
3405
        local totalHeight = 0
3406
        local frame = Instance.new("Frame")
3407
        frame.BackgroundTransparency = 1
3408
        local label = Instance.new("TextLabel")
3409
        label.BackgroundTransparency = 1
3410
        label.Font = font
3411
        label.FontSize = fontSize
3412
        label.TextColor3 = textColor3
3413
        label.TextTransparency = 1
3414
        label.TextWrapped = true
3415
        label.TextXAlignment = textXAlignment
3416
        label.TextYAlignment = textYAlignment
3417
        label.Parent = self.guiFrame
3418
        local index = 1
3419
        while true do
3420
                local length = #text - index + 1
3421
                if length > 1024 then
3422
                        length = 1024
3423
                        local textBlock = string.sub(text, index, index + length - 1)
3424
                        label.Text = textBlock
3425
                        local height = 0
3426
                        local width = maxWidth
3427
                        repeat
3428
                                height = height + 20
3429
                                label.Size = UDim2.new(0, width, 0, height)
3430
                        until label.TextFits
3431
                        repeat
3432
                                height = height - 1
3433
                                label.Size = UDim2.new(0, width, 0, height)
3434
                        until not label.TextFits
3435
                        repeat
3436
                                length = length - 10
3437
                                label.Text = string.sub(text, index, index + length - 1)
3438
                        until label.TextFits
3439
                        repeat
3440
                                length = length + 1
3441
                                label.Text = string.sub(text, index, index + length - 1)
3442
                        until not label.TextFits
3443
                        local overflowCharacter = string.sub(text, index + length - 1, index + length - 1)
3444
                        length = length - 1
3445
                        label.Text = string.sub(text, index, index + length - 1)
3446
                        if overflowCharacter == "\n" then
3447
                                index = index + 1
3448
                        end
3449
                        repeat
3450
                                height = height - 1
3451
                                label.Size = UDim2.new(0, width, 0, height)
3452
                        until not label.TextFits
3453
                        height = height + 1
3454
                        local blockLabel = label:Clone()
3455
                        blockLabel.Position = UDim2.new(0, 0, 0, totalHeight)
3456
                        blockLabel.Size = UDim2.new(1, 0, 0, height)
3457
                        blockLabel.Parent = frame
3458
                        totalHeight = totalHeight + height
3459
                        index = index + length
3460
                else
3461
                        local textBlock = string.sub(text, index)
3462
                        label.Text = textBlock
3463
                        local height = 0
3464
                        local width = maxWidth
3465
                        repeat
3466
                                height = height + 20
3467
                                label.Size = UDim2.new(0, width, 0, height)
3468
                        until label.TextFits
3469
                        repeat
3470
                                height = height - 1
3471
                                label.Size = UDim2.new(0, width, 0, height)
3472
                        until not label.TextFits
3473
                        height = height + 1
3474
                        if index == 1 then
3475
                                repeat
3476
                                        width =  width - 10
3477
                                        label.Size = UDim2.new(0, width, 0, height)
3478
                                until width < minWidth or not label.TextFits
3479
                                width = math.max(width, minWidth - 1)
3480
                                repeat
3481
                                        width =  width + 1
3482
                                        label.Size = UDim2.new(0, width, 0, height)
3483
                                until label.TextFits
3484
                        end
3485
                        local blockLabel = label:Clone()
3486
                        blockLabel.Position = UDim2.new(0, 0, 0, totalHeight)
3487
                        blockLabel.Size = UDim2.new(1, 0, 0, height)
3488
                        blockLabel.Parent = frame
3489
                        label:Destroy()
3490
                        frame.Size = UDim2.new(0, width, 0, totalHeight + height)
3491
                        return frame
3492
                end
3493
        end
3494
end
3495
function GuiServiceClass:Destroy()
3496
        self.running = false
3497
        self.cameraPart:Destroy()
3498
        self.cameraConnection:disconnect()
3499
        self.keyDownConnection:disconnect()
3500
        self.mouseButton1DownConnection:disconnect()
3501
        self.mouseButton1UpConnection:disconnect()
3502
        self.mouseButton2DownConnection:disconnect()
3503
        self.mouseButton2UpConnection:disconnect()
3504
        self.mouseMoveConnection:disconnect()
3505
        self.steppedConnection:disconnect()
3506
end
3507
function GuiServiceClass:GetMousePosition()
3508
        local mouse = self.mouse
3509
        return mouse.X, mouse.Y -- mouse.X, mouse.Y + 2 -- return mouse.X - 2, mouse.Y - 3
3510
end
3511
function GuiServiceClass:GetTextBounds(text, font, fontSize, alignX, alignY, width)
3512
        local tempLabel = self.tempLabel
3513
        tempLabel.Font = font
3514
        tempLabel.FontSize = fontSize
3515
        tempLabel.Size = UDim2.new(0, width, 0, 4096)
3516
        tempLabel.Text = text
3517
        tempLabel.TextXAlignment = alignX
3518
        tempLabel.TextYAlignment = alignY
3519
        local textBounds = tempLabel.TextBounds
3520
        tempLabel.Text = ""
3521
        return textBounds
3522
end
3523
function GuiServiceClass:Init(data)
3524
        GuiBase.Init(self)
3525
        local _ = string.char
3526
        local camera = data.Camera
3527
        local mouse = data.Mouse
3528
        local cameraPart = Instance.new("Part")
3529
        local billboardGui = Instance.new("BillboardGui", cameraPart)
3530
        guiFrame = Instance.new("Frame", billboardGui)
3531
        cameraPart.Anchored = true
3532
        cameraPart.BottomSurface = "Smooth"
3533
        cameraPart.CanCollide = false
3534
--      cameraPart.CFrame = CFrame.new(16384, 16384, 16384)
3535
        cameraPart.FormFactor = "Custom"
3536
        cameraPart.Locked = true
3537
        cameraPart.Size = Vector3.new(0.2, 0.2, 0.2)
3538
        cameraPart.TopSurface = "Smooth"
3539
        cameraPart.Transparency = 1
3540
        billboardGui.Adornee = cameraPart
3541
        billboardGui.AlwaysOnTop = true
3542
--      billboardGui.ExtentsOffset = Vector3.new(-16384, -16384, -16384)
3543
        guiFrame.BackgroundTransparency = 1
3544
        cameraPart.Parent = camera
3545
        self.running = true
3546
        self.m_base_instance = guiFrame
3547
        self.billboardGui = billboardGui
3548
        self.cameraPart = cameraPart
3549
        self.tempLabel = RBXInstance.new "TextLabel" {
3550
                BackgroundTransparency = 1,
3551
                TextTransparency = 1,
3552
                TextWrapped = true,
3553
                Parent = guiFrame
3554
        }
3555
        self.mnemonics = {}
3556
        self.visible = true
3557
        self.camera = camera
3558
        self.mouse = mouse
3559
        self.cameraConnection = camera.Changed:connect(function(property)
3560
                self:UpdateView()
3561
                if property == "CameraType" then
3562
                        if camera.CameraType ~= Enum.CameraType.Track and camera.CameraType ~= Enum.CameraType.Fixed then
3563
                                camera.CameraType = Enum.CameraType.Track
3564
                        end
3565
                elseif property == "CoordinateFrame" and camera.CameraType ~= Enum.CameraType.Fixed then
3566
                        local cframe, focus = camera.CoordinateFrame, camera.Focus
3567
                        local watchOffset = focus.p - cframe.p
3568
                        local error = watchOffset.unit - cframe.lookVector
3569
                        if error.magnitude >= 1e-3 then
3570
                                local head = PlayerControl.GetHead()
3571
                                local time1, velocity1
3572
                                if head then
3573
                                        time1 = time()
3574
                                        velocity1 = head.Velocity
3575
                                end
3576
                                if camera.Changed:wait() == "CoordinateFrame" then
3577
                                        local position = cframe.p
3578
                                        if head then
3579
                                                local time2 = time()
3580
                                                local velocity2 = head.Velocity
3581
                                                position = position + 0.5 * (velocity1 + velocity2) * (time2 - time1)
3582
                                        end
3583
                                        camera.CoordinateFrame = CFrame.new(position, camera.Focus.p)
3584
                                end
3585
                        end
3586
                end
3587
        end)
3588
        self.keyDownConnection = mouse.KeyDown:connect(function(key) self:KeyDown(key) end)
3589
        self.mouseButton1DownConnection = mouse.Button1Down:connect(function() self:MouseButton1Down() end)
3590
        self.mouseButton1UpConnection = mouse.Button1Up:connect(function() self:MouseButton1Up() end)
3591
        self.mouseButton2DownConnection = mouse.Button2Down:connect(function() self:MouseButton2Down() end)
3592
        self.mouseButton2UpConnection = mouse.Button2Up:connect(function() self:MouseButton2Up() end)
3593
        self.mouseMoveConnection = mouse.Move:connect(function() self:MouseMove() end)
3594
        self.steppedConnection = RunService.RenderStepped:connect(function() self:UpdateObjects() self:UpdateView() end)
3595
        self.mousePreviousPosition = Vector2.new(self:GetMousePosition())
3596
end
3597
function GuiServiceClass:IsA(className)
3598
        return className == "GuiService" or GuiBase.IsA(self, className)
3599
end
3600
function GuiServiceClass:KeyDown(key)
3601
        local mnemonicButton = self.mnemonics[string.upper(key)]
3602
        if mnemonicButton then
3603
                mnemonicButton.Activated:fire()
3604
        end
3605
end
3606
function GuiServiceClass:MouseButton1Down()
3607
        local mouse = self.mouse
3608
        local mouseX, mouseY = self:GetMousePosition()
3609
        local stack = {self}
3610
        local dragObjects = {}
3611
        self.dragObjects = dragObjects
3612
        while #stack > 0 do
3613
                local object = stack[#stack]
3614
                stack[#stack] = nil
3615
                if object.visible then
3616
                        for child in pairs(object.children) do
3617
                                stack[#stack + 1] = child
3618
                        end
3619
                        if object.active then
3620
                                local position = object:GetAbsolutePosition()
3621
                                local size = object:GetAbsoluteSize()
3622
                                if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
3623
                                        object.mouseDown = true
3624
                                        dragObjects[object] = true
3625
                                        local mouseButton1Down = object.MouseButton1Down
3626
                                        if mouseButton1Down then
3627
                                                mouseButton1Down:fire()
3628
                                                if object.autoButtonColor then
3629
                                                        local color = object.color
3630
                                                        local transparency = object.backgroundTransparency
3631
                                                        object.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g +
3632
 
3633
0.3, 1), math.min(color.b + 0.3, 1))
3634
                                                        object.m_base_instance.BackgroundTransparency = transparency
3635
                                                end
3636
                                        end
3637
                                        object.DragBegin:fire()
3638
                                end
3639
                        end
3640
                end
3641
        end
3642
        self.mousePreviousPosition = Vector2.new(mouseX, mouseY)
3643
end
3644
function GuiServiceClass:MouseButton1Up()
3645
        local mouse = self.mouse
3646
        local mouseX, mouseY = self:GetMousePosition()
3647
        local stack = {self}
3648
        while #stack > 0 do
3649
                local object = stack[#stack]
3650
                stack[#stack] = nil
3651
                if object.visible then
3652
                        for child in pairs(object.children) do
3653
                                stack[#stack + 1] = child
3654
                        end
3655
                        if object.active then
3656
                                local position = object:GetAbsolutePosition()
3657
                                local size = object:GetAbsoluteSize()
3658
                                if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
3659
                                        object.MouseButton1Up:fire()
3660
                                end
3661
                        end
3662
                end
3663
        end
3664
        local dragObjects = self.dragObjects
3665
        self.dragObjects = nil
3666
        if dragObjects then
3667
                for dragObject in pairs(dragObjects) do
3668
                        dragObject.mouseDown = false
3669
                        local position = dragObject:GetAbsolutePosition()
3670
                        local size = dragObject:GetAbsoluteSize()
3671
                        if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
3672
                                dragObject.MouseButton1Click:fire()
3673
                                local activated = dragObject.Activated
3674
                                if activated then
3675
                                        activated:fire()
3676
                                end
3677
                        end
3678
                        dragObject.DragStopped:fire()
3679
                        if dragObject.autoButtonColor then
3680
                                if dragObject.mouseOver then
3681
                                        local color = dragObject.color
3682
                                        local transparency = dragObject.backgroundTransparency
3683
                                        dragObject.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0),
3684
 
3685
math.max(color.b - 0.3, 0))
3686
                                        dragObject.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.2)
3687
                                else
3688
                                        dragObject.m_base_instance.BackgroundColor3 = dragObject.color
3689
                                        dragObject.m_base_instance.BackgroundTransparency = dragObject.backgroundTransparency
3690
                                end
3691
                        end
3692
                        self.dragObject = nil
3693
                end
3694
        end
3695
end
3696
function GuiServiceClass:MouseButton2Down()
3697
        local mouse = self.mouse
3698
        local mouseX, mouseY = self:GetMousePosition()
3699
        local stack = {self}
3700
        while #stack > 0 do
3701
                local object = stack[#stack]
3702
                stack[#stack] = nil
3703
                if object.visible then
3704
                        for child in pairs(object.children) do
3705
                                stack[#stack + 1] = child
3706
                        end
3707
                        if object.active then
3708
                                local position = object:GetAbsolutePosition()
3709
                                local size = object:GetAbsoluteSize()
3710
                                if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
3711
                                        local mouseButton2Down = object.MouseButton2Down
3712
                                        if mouseButton2Down then
3713
                                                mouseButton2Down:fire()
3714
                                        end
3715
                                end
3716
                        end
3717
                end
3718
        end
3719
        self.mousePreviousPosition = Vector2.new(mouseX, mouseY)
3720
end
3721
function GuiServiceClass:MouseButton2Up()
3722
        local mouse = self.mouse
3723
        local mouseX, mouseY = self:GetMousePosition()
3724
        local stack = {self}
3725
        while #stack > 0 do
3726
                local object = stack[#stack]
3727
                stack[#stack] = nil
3728
                if object.visible then
3729
                        for child in pairs(object.children) do
3730
                                stack[#stack + 1] = child
3731
                        end
3732
                        if object.active then
3733
                                local position = object:GetAbsolutePosition()
3734
                                local size = object:GetAbsoluteSize()
3735
                                if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
3736
                                        local mouseButton2Up = object.MouseButton2Up
3737
                                        if mouseButton2Up then
3738
                                                mouseButton2Up:fire()
3739
                                        end
3740
                                end
3741
                        end
3742
                end
3743
        end
3744
end
3745
function GuiServiceClass:MouseMove()
3746
        self:UpdateObjects()
3747
        local dragObjects = self.dragObjects
3748
        if dragObjects then
3749
                for dragObject in pairs(dragObjects) do
3750
                        local mouse = self.mouse
3751
                        local mousePosition = Vector2.new(self:GetMousePosition())
3752
                        dragObject.DragMove:fire(mousePosition - self.mousePreviousPosition)
3753
                        self.mousePreviousPosition = mousePosition
3754
                end
3755
        end
3756
end
3757
function GuiServiceClass:SetMnemonic(mnemonic, button)
3758
        self.mnemonics[mnemonic] = button
3759
end
3760
function GuiServiceClass:UpdateObjects()
3761
        local mouse = self.mouse
3762
        local mouseX, mouseY = self:GetMousePosition()
3763
        local stack = {self}
3764
        while #stack > 0 do
3765
                local object = stack[#stack]
3766
                stack[#stack] = nil
3767
                if object.visible then
3768
                        for child in pairs(object.children) do
3769
                                stack[#stack + 1] = child
3770
                        end
3771
                        if object.active then
3772
                                local position = object:GetAbsolutePosition()
3773
                                local size = object:GetAbsoluteSize()
3774
                                if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
3775
                                        if not object.mouseOver then
3776
                                                object.mouseOver = true
3777
                                                object.MouseEnter:fire()
3778
                                                if object.autoButtonColor then
3779
                                                        local color = object.color
3780
                                                        local transparency = object.backgroundTransparency
3781
                                                        if object.mouseDown then
3782
                                                                object.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g + 0.3, 1), math.min(color.b + 0.3, 1))
3783
                                                                object.m_base_instance.BackgroundTransparency = transparency
3784
                                                        else
3785
                                                                object.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0), math.max(color.b - 0.3, 0))
3786
                                                                object.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.2)
3787
                                                        end
3788
                                                end
3789
                                        end
3790
                                else
3791
                                        if object.mouseOver then
3792
                                                object.mouseOver = false
3793
                                                object.MouseLeave:fire()
3794
                                                if object.autoButtonColor then
3795
                                                        object.m_base_instance.BackgroundColor3 = object.color
3796
                                                        object.m_base_instance.BackgroundTransparency = object.backgroundTransparency
3797
                                                end
3798
                                        end
3799
                                end
3800
                        end
3801
                end
3802
        end
3803
end
3804
function GuiServiceClass:UpdateView()
3805
        local billboardGui = self.billboardGui
3806
        local guiFrame = self.m_base_instance
3807
        local camera = self.camera
3808
        local mouse = self.mouse
3809
        local cameraCFrame = CFrame.new(camera.CoordinateFrame.p, camera.Focus.p) -- camera.CoordinateFrame
3810
        local viewSizeX, viewSizeY = mouse.ViewSizeX, mouse.ViewSizeY
3811
        local previousViewSize = self.viewSize
3812
        if not previousViewSize or ((viewSizeX ~= 0 or viewSizeY ~= 0) and (viewSizeX ~= previousViewSize.X or viewSizeY ~= previousViewSize.Y)) then
3813
                self.viewSize = {X = viewSizeX, Y = viewSizeY}
3814
                local viewSizeUDim2 = UDim2.new(0, viewSizeX, 0, viewSizeY)
3815
                billboardGui.Size = viewSizeUDim2
3816
                guiFrame.Size = viewSizeUDim2
3817
                -- FIXME:
3818
                -- After the 15th of July 2014, there came an offset at the Y thingy out of nowhere so I accomodated for that.
3819
                billboardGui.SizeOffset = Vector2.new(0.5 / viewSizeX, (0.5 + 10) / viewSizeY)
3820
        end
3821
        --billboardGui.SizeOffset = Vector2.new()
3822
        billboardGui.StudsOffset = (cameraCFrame - cameraCFrame.p):inverse() * cameraCFrame.p - Vector3.new(0, 0, 1)
3823
end
3824
GuiService = GuiServiceClass:new {
3825
        Camera = Camera,
3826
        Mouse = Mouse
3827
}
3828
GuiFrame = setmetatable({}, GuiObject)
3829
GuiFrame.__index = GuiFrame
3830
GuiFrame.__default = {__index = {
3831
        Active = false,
3832
        BackgroundTransparency = 0.75,
3833
        BorderSize = 4,
3834
        BorderTransparency = 0.75,
3835
        Color = AdvancedGUI.GUI_BASE_COLOR,
3836
        Position = UDim2.new(0, 0, 0, 0),
3837
        Size = UDim2.new(0, 52, 0, 52),
3838
        Visible = true
3839
}}
3840
function GuiFrame:Destroy()
3841
        GuiObject.Destroy(self)
3842
end
3843
function GuiFrame:GetContentInstance()
3844
        return self.m_content_frame
3845
end
3846
function GuiFrame:Init(data)
3847
        GuiObject.Init(self)
3848
        setmetatable(data, GuiFrame.__default)
3849
        local leftBorderFrameLeft = RBXInstance.new "Frame" {
3850
                BackgroundColor3 = Color3.new(0, 0, 0),
3851
                BorderSizePixel = 0,
3852
                Size = UDim2.new(0, 1, 1, -1)
3853
        }
3854
        local leftBorderFrameCenter = RBXInstance.new "Frame" {
3855
                BackgroundColor3 = Color3.new(1, 1, 1),
3856
                BorderSizePixel = 0,
3857
                Position = UDim2.new(0, 1, 0, 1)
3858
        }
3859
        local leftBorderFrameRight = RBXInstance.new "Frame" {
3860
                BackgroundColor3 = Color3.new(0, 0, 0),
3861
                BorderSizePixel = 0
3862
        }
3863
        local rightBorderFrameRight = RBXInstance.new "Frame" {
3864
                BackgroundColor3 = Color3.new(0, 0, 0),
3865
                BorderSizePixel = 0,
3866
                Position = UDim2.new(1, -1, 0, 1),
3867
                Size = UDim2.new(0, 1, 1, -1)
3868
        }
3869
        local rightBorderFrameCenter = RBXInstance.new "Frame" {
3870
                BackgroundColor3 = Color3.new(1, 1, 1),
3871
                BorderSizePixel = 0
3872
        }
3873
        local rightBorderFrameLeft = RBXInstance.new "Frame" {
3874
                BackgroundColor3 = Color3.new(0, 0, 0),
3875
                BorderSizePixel = 0
3876
        }
3877
        local bottomBorderFrameBottom = RBXInstance.new "Frame" {
3878
                BackgroundColor3 = Color3.new(0, 0, 0),
3879
                BorderSizePixel = 0,
3880
                Position = UDim2.new(0, 0, 1, -1),
3881
                Size = UDim2.new(1, -1, 0, 1)
3882
        }
3883
        local bottomBorderFrameCenter = RBXInstance.new "Frame" {
3884
                BackgroundColor3 = Color3.new(1, 1, 1),
3885
                BorderSizePixel = 0
3886
        }
3887
        local bottomBorderFrameTop = RBXInstance.new "Frame" {
3888
                BackgroundColor3 = Color3.new(0, 0, 0),
3889
                BorderSizePixel = 0
3890
        }
3891
        local topBorderFrameTop = RBXInstance.new "Frame" {
3892
                BackgroundColor3 = Color3.new(0, 0, 0),
3893
                BorderSizePixel = 0,
3894
                Position = UDim2.new(0, 1, 0, 0),
3895
                Size = UDim2.new(1, -1, 0, 1)
3896
        }
3897
        local topBorderFrameCenter = RBXInstance.new "Frame" {
3898
                BackgroundColor3 = Color3.new(1, 1, 1),
3899
                BorderSizePixel = 0
3900
        }
3901
        local topBorderFrameBottom = RBXInstance.new "Frame" {
3902
                BackgroundColor3 = Color3.new(0, 0, 0),
3903
                BorderSizePixel = 0
3904
        }
3905
        local border_frame = RBXInstance.new "Frame" {
3906
                BackgroundTransparency = 1,
3907
                Size = UDim2.new(1, 0, 1, 0),
3908
                leftBorderFrameLeft,
3909
                leftBorderFrameCenter,
3910
                leftBorderFrameRight,
3911
                rightBorderFrameLeft,
3912
                rightBorderFrameCenter,
3913
                rightBorderFrameRight,
3914
                bottomBorderFrameBottom,
3915
                bottomBorderFrameCenter,
3916
                bottomBorderFrameTop,
3917
                topBorderFrameBottom,
3918
                topBorderFrameCenter,
3919
                topBorderFrameTop
3920
        }
3921
        local contentFrame = RBXInstance.new "Frame" {
3922
                BackgroundTransparency = 1,
3923
                BorderSizePixel = 0,
3924
                ClipsDescendants = true,
3925
                Size = UDim2.new(1, 0, 1, 0)
3926
        }
3927
        local base_frame = RBXInstance.new "Frame" {
3928
                BorderSizePixel = 0,
3929
                border_frame,
3930
                contentFrame
3931
        }
3932
        self.m_base_instance = base_frame
3933
        self.m_content_frame = contentFrame
3934
        self.m_border_frame = border_frame
3935
        self.leftBorderFrameLeft = leftBorderFrameLeft
3936
        self.leftBorderFrameCenter = leftBorderFrameCenter
3937
        self.leftBorderFrameRight = leftBorderFrameRight
3938
        self.rightBorderFrameLeft = rightBorderFrameLeft
3939
        self.rightBorderFrameCenter = rightBorderFrameCenter
3940
        self.rightBorderFrameRight = rightBorderFrameRight
3941
        self.bottomBorderFrameBottom = bottomBorderFrameBottom
3942
        self.bottomBorderFrameCenter = bottomBorderFrameCenter
3943
        self.bottomBorderFrameTop = bottomBorderFrameTop
3944
        self.topBorderFrameBottom = topBorderFrameBottom
3945
        self.topBorderFrameCenter = topBorderFrameCenter
3946
        self.topBorderFrameTop = topBorderFrameTop
3947
        self:SetActive(data.Active)
3948
        self:SetBackgroundTransparency(data.BackgroundTransparency)
3949
        self:SetBorderSize(data.BorderSize)
3950
        self:SetBorderTransparency(data.BorderTransparency)
3951
        self:SetColor(data.Color)
3952
        self:SetPosition(data.Position)
3953
        self:SetSize(data.Size)
3954
        self:SetVisible(data.Visible)
3955
        self:SetParent(data.Parent)
3956
end
3957
function GuiFrame:IsA(className)
3958
        return className == "GuiFrame" or GuiObject.IsA(self, className)
3959
end
3960
function GuiFrame:SetBorderSize(border_size)
3961
        border_size = math.max(math.floor(border_size + 0.5), 0)
3962
        if border_size ~= self.m_border_size then
3963
                self.m_border_size = border_size
3964
                local border_frame = self.m_border_frame
3965
                local contentFrame = self.m_content_frame
3966
                local leftBorderFrameCenter = self.leftBorderFrameCenter
3967
                local leftBorderFrameRight = self.leftBorderFrameRight
3968
                local rightBorderFrameCenter = self.rightBorderFrameCenter
3969
                local rightBorderFrameLeft = self.rightBorderFrameLeft
3970
                local bottomBorderFrameCenter = self.bottomBorderFrameCenter
3971
                local bottomBorderFrameTop = self.bottomBorderFrameTop
3972
                local topBorderFrameCenter = self.topBorderFrameCenter
3973
                local topBorderFrameBottom = self.topBorderFrameBottom
3974
                contentFrame.Position = UDim2.new(0, border_size, 0, border_size)
3975
                contentFrame.Size = UDim2.new(1, -2 * border_size, 1, -2 * border_size)
3976
                local inner_visible = border_size > 0
3977
                if self.leftBorderFrameLeft.Visible ~= inner_visible then
3978
                        self.rightBorderFrameRight.Visible = inner_visible
3979
                        self.bottomBorderFrameBottom.Visible = inner_visible
3980
                        self.topBorderFrameTop.Visible = inner_visible
3981
                end
3982
                local outer_visible = border_size > 1
3983
                if leftBorderFrameCenter.Visible ~= outer_visible then
3984
                        leftBorderFrameCenter.Visible = outer_visible
3985
                        leftBorderFrameRight.Visible = outer_visible
3986
                        rightBorderFrameCenter.Visible = outer_visible
3987
                        rightBorderFrameLeft.Visible = outer_visible
3988
                        bottomBorderFrameCenter.Visible = outer_visible
3989
                        bottomBorderFrameTop.Visible = outer_visible
3990
                        topBorderFrameCenter.Visible = outer_visible
3991
                        topBorderFrameBottom.Visible = outer_visible
3992
                end
3993
                if outer_visible then
3994
                        leftBorderFrameCenter.Size = UDim2.new(0, border_size - 2, 1, -border_size)
3995
                        leftBorderFrameRight.Position = UDim2.new(0, border_size - 1, 0, border_size - 1)
3996
                        leftBorderFrameRight.Size = UDim2.new(0, 1, 1, 1 - 2 * border_size)
3997
                        rightBorderFrameCenter.Position = UDim2.new(1, 1 - border_size, 0, border_size - 1)
3998
                        rightBorderFrameCenter.Size = UDim2.new(0, border_size - 2, 1, -border_size)
3999
                        rightBorderFrameLeft.Position = UDim2.new(1, -border_size, 0, border_size)
4000
                        rightBorderFrameLeft.Size = UDim2.new(0, 1, 1, 1 - 2 * border_size)
4001
                        bottomBorderFrameCenter.Position = UDim2.new(0, 1, 1, 1 - border_size)
4002
                        bottomBorderFrameCenter.Size = UDim2.new(1, -border_size, 0, border_size - 2)
4003
                        bottomBorderFrameTop.Position = UDim2.new(0, border_size - 1, 1, -border_size)
4004
                        bottomBorderFrameTop.Size = UDim2.new(1, 1 - 2 * border_size, 0, 1)
4005
                        topBorderFrameCenter.Position = UDim2.new(0, border_size - 1, 0, 1)
4006
                        topBorderFrameCenter.Size = UDim2.new(1, -border_size, 0, border_size - 2)
4007
                        topBorderFrameBottom.Position = UDim2.new(0, border_size, 0, border_size - 1)
4008
                        topBorderFrameBottom.Size = UDim2.new(1, 1 - 2 * border_size, 0, 1)
4009
                end
4010
        end
4011
end
4012
function GuiFrame:SetBorderTransparency(borderTransparency)
4013
        self.borderTransparency = borderTransparency
4014
        self.leftBorderFrameLeft.BackgroundTransparency = borderTransparency
4015
        self.leftBorderFrameCenter.BackgroundTransparency = borderTransparency
4016
        self.leftBorderFrameRight.BackgroundTransparency = borderTransparency
4017
        self.rightBorderFrameLeft.BackgroundTransparency = borderTransparency
4018
        self.rightBorderFrameCenter.BackgroundTransparency = borderTransparency
4019
        self.rightBorderFrameRight.BackgroundTransparency = borderTransparency
4020
        self.bottomBorderFrameBottom.BackgroundTransparency = borderTransparency
4021
        self.bottomBorderFrameCenter.BackgroundTransparency = borderTransparency
4022
        self.bottomBorderFrameTop.BackgroundTransparency = borderTransparency
4023
        self.topBorderFrameBottom.BackgroundTransparency = borderTransparency
4024
        self.topBorderFrameCenter.BackgroundTransparency = borderTransparency
4025
        self.topBorderFrameTop.BackgroundTransparency = borderTransparency
4026
end
4027
GuiButton = setmetatable({}, GuiFrame)
4028
GuiButton.__index = GuiButton
4029
GuiButton.__default = {__index = {
4030
        AutoButtonColor = true
4031
}}
4032
function GuiButton:Destroy()
4033
        self.Activated:disconnect()
4034
        GuiFrame.Destroy(self)
4035
end
4036
function GuiButton:Init(data)
4037
        if data.Active == nil then
4038
                data.Active = true
4039
        end
4040
        GuiFrame.Init(self, data)
4041
        setmetatable(data, GuiButton.__default)
4042
        self.Activated = RbxUtility.CreateSignal()
4043
        self:SetAutoButtonColor(data.AutoButtonColor)
4044
end
4045
function GuiButton:IsA(className)
4046
        return className == "GuiButton" or GuiFrame.IsA(self, className)
4047
end
4048
function GuiButton:SetAutoButtonColor(autoButtonColor)
4049
        if autoButtonColor ~= self.autoButtonColor then
4050
                self.autoButtonColor = autoButtonColor
4051
                if autoButtonColor then
4052
                        if self.mouseOver then
4053
                                local color = self.color
4054
                                local transparency = self.backgroundTransparency
4055
                                if self.mouseDown then
4056
                                        self.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g + 0.3, 1), math.min(color.b + 0.3, 1))
4057
                                        self.m_base_instance.BackgroundTransparency = transparency
4058
                                else
4059
                                        self.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0), math.max(color.b - 0.3, 0))
4060
                                        self.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.5)
4061
                                end
4062
                        end
4063
                else
4064
                        self.m_base_instance.BackgroundColor3 = self.color
4065
                end
4066
        end    
4067
end
4068
GuiTextLabel = setmetatable({}, GuiFrame)
4069
GuiTextLabel.__index = GuiTextLabel
4070
GuiTextLabel.__default = {__index = {
4071
        Font = "ArialBold",
4072
        FontSize = "Size12",
4073
        Text = "",
4074
        TextColor = Color3.new(1, 1, 1),
4075
        TextStrokeColor = Color3.new(0, 0, 0),
4076
        TextStrokeTransparency = 0.6,
4077
        TextWrapped = true
4078
}}
4079
function GuiTextLabel:Destroy()
4080
        GuiFrame.Destroy(self)
4081
end
4082
function GuiTextLabel:Init(data)
4083
        GuiFrame.Init(self, data)
4084
        setmetatable(data, GuiTextLabel.__default)
4085
        local base_instance = self.m_base_instance
4086
        local textLabel = RBXInstance.new "TextLabel" {
4087
                BackgroundTransparency = 1,
4088
                Font = data.Font,
4089
                FontSize = data.FontSize,
4090
                TextColor3 = data.TextColor3,
4091
                TextStrokeColor3 = data.TextStrokeColor3,
4092
                TextStrokeTransparency = data.TextStrokeTransparency,
4093
                TextWrapped = data.TextWrapped
4094
        }
4095
        textLabel.Parent = self:GetContentInstance()
4096
        self.textLabel = textLabel
4097
        self:SetText(data.Text)
4098
end
4099
function GuiTextLabel:IsA(className)
4100
        return className == "GuiTextLabel" or GuiFrame.IsA(self, className)
4101
end
4102
function GuiTextLabel:SetText(text)
4103
        if text ~= self.text then
4104
                self.text = text
4105
                local text_index = 1
4106
                local content_instance = self:GetContentInstance()
4107
                local content_instance_size = content_instance.AbsoluteSize
4108
                local frame = Instance.new("Frame")
4109
                frame.BackgroundTransparency = 1
4110
                local label = Instance.new("TextLabel")
4111
                label.BackgroundTransparency = 1
4112
                label.Font = font
4113
                label.FontSize = fontSize
4114
                label.Size = UDim2.new(0, content_instance_size.X, 0, 1000)
4115
                label.Text = ""
4116
                label.TextColor3 = textColor3
4117
                label.TextTransparency = 1
4118
                label.TextWrapped = true
4119
                label.TextXAlignment = textXAlignment
4120
                label.TextYAlignment = textYAlignment
4121
                label.Parent = self.guiFrame
4122
                local row_length = 0
4123
                local step_size = 256
4124
                for step = 1, 8 do
4125
                        step_size = 0.5 * step_size
4126
                        label.Text = string.sub(text, text_index, text_index + row_length - 1)
4127
                end
4128
        end
4129
end
4130
GuiImageButton = setmetatable({}, GuiButton)
4131
GuiImageButton.__index = GuiImageButton
4132
GuiImageButton.__default = {__index = {
4133
        Image = ""
4134
}}
4135
function GuiImageButton:Destroy()
4136
        GuiButton.Destroy(self)
4137
end
4138
function GuiImageButton:Init(data)
4139
        GuiButton.Init(self, data)
4140
        setmetatable(data, GuiImageButton.__default)
4141
        local content_frame = self.m_content_frame
4142
        local image_label = RBXInstance.new "ImageLabel" {
4143
                BackgroundTransparency = 1,
4144
                Size = UDim2.new(1, 0, 1, 0)
4145
        }
4146
        image_label.Parent = content_frame
4147
        self.m_image_label = image_label
4148
        self:SetImage(data.Image)
4149
end
4150
function GuiImageButton:IsA(className)
4151
        return className == "GuiImageButton" or GuiButton.IsA(self, className)
4152
end
4153
function GuiImageButton:SetImage(image)
4154
        if image ~= self.m_image then
4155
                self.m_image = image
4156
                self.m_image_label.Image = image
4157
        end    
4158
end
4159
GuiTextButton = setmetatable({}, GuiButton)
4160
GuiTextButton.__index = GuiTextButton
4161
GuiTextButton.__default = {__index = {
4162
        Font = Enum.Font.ArialBold,
4163
        FontSize = Enum.FontSize.Size11,
4164
        Text = "Button",
4165
        TextXAlignment = Enum.TextXAlignment.Center
4166
}}
4167
function GuiTextButton:Destroy()
4168
        GuiButton.Destroy(self)
4169
end
4170
function GuiTextButton:GetTextBounds()
4171
        return self.textLabel.TextBounds
4172
end
4173
function GuiTextButton:Init(data)
4174
        GuiButton.Init(self, data)
4175
        setmetatable(data, GuiTextButton.__default)
4176
        local contentFrame = self.m_content_frame
4177
        local mnemonicLabel = RBXInstance.new "TextLabel" {
4178
                BackgroundTransparency = 1,
4179
                Font = "ArialBold",
4180
                FontSize = "Size36",
4181
                Size = UDim2.new(1, 0, 0.7, 0),
4182
                TextColor3 = Color3.new(1, 1, 1),
4183
                TextStrokeColor3 = Color3.new(0, 0, 0),
4184
                TextStrokeTransparency = 0.6,
4185
                TextWrapped = true
4186
        }
4187
        local textLabel = RBXInstance.new "TextLabel" {
4188
                BackgroundTransparency = 1,
4189
                TextColor3 = Color3.new(1, 1, 1),
4190
                TextStrokeColor3 = Color3.new(0, 0, 0),
4191
                TextStrokeTransparency = 0.6,
4192
                TextWrapped = true
4193
        }
4194
        mnemonicLabel.Parent = contentFrame
4195
        textLabel.Parent = contentFrame
4196
        self.mnemonicLabel = mnemonicLabel
4197
        self.textLabel = textLabel
4198
        self:SetFont(data.Font)
4199
        self:SetFontSize(data.FontSize)
4200
        self:SetMnemonic(data.Mnemonic, true)
4201
        self:SetText(data.Text)
4202
        self:SetTextXAlignment(data.TextXAlignment)
4203
end
4204
function GuiTextButton:IsA(className)
4205
        return className == "GuiTextButton" or GuiButton.IsA(self, className)
4206
end
4207
function GuiTextButton:SetFont(font)
4208
        if font ~= self.font then
4209
                self.font = font
4210
                self.textLabel.Font = font
4211
        end
4212
end
4213
function GuiTextButton:SetFontSize(fontSize)
4214
        if fontSize ~= self.fontSize then
4215
                self.fontSize = fontSize
4216
                self.textLabel.FontSize = fontSize
4217
        end
4218
end
4219
function GuiTextButton:SetMnemonic(mnemonic, forceUpdate)
4220
        if mnemonic ~= self.mnemonic or forceUpdate then
4221
                if self.mnemonic then
4222
                        GuiService:SetMnemonic(self.mnemonic, nil)
4223
                end
4224
                if mnemonic then
4225
                        GuiService:SetMnemonic(mnemonic, self)
4226
                end
4227
                self.mnemonic = mnemonic
4228
                local mnemonicLabel = self.mnemonicLabel
4229
                local textLabel = self.textLabel
4230
                if mnemonic then
4231
                        mnemonicLabel.Text = mnemonic
4232
                        textLabel.Size = UDim2.new(1, 0, 0.9, 0)
4233
                        textLabel.TextYAlignment = "Bottom"
4234
                else
4235
                        mnemonicLabel.Text = ""
4236
                        textLabel.Size = UDim2.new(1, 0, 1, 0)
4237
                        textLabel.TextYAlignment = "Center"
4238
                end
4239
        end    
4240
end
4241
function GuiTextButton:SetText(text)
4242
        if text ~= self.text then
4243
                self.text = text
4244
                self.textLabel.Text = text
4245
        end    
4246
end
4247
function GuiTextButton:SetTextXAlignment(textXAlignment)
4248
        if textXAlignment ~= self.textXAlignment then
4249
                self.textXAlignment = textXAlignment
4250
                self.textLabel.TextXAlignment = textXAlignment
4251
        end    
4252
end
4253
GuiWindow = setmetatable({}, GuiObject)
4254
GuiWindow.__index = GuiWindow
4255
GuiWindow.__default = {__index = {
4256
        Active = true,
4257
        BackgroundTransparency = 0.5,
4258
        BorderSize = 4,
4259
        BorderTransparency = 0.5,
4260
        Position = UDim2.new(0, 0, 0, 0),
4261
        Size = UDim2.new(0, 360, 0, 240),
4262
        Title = "Window",
4263
        TitleBarBackgroundTransparency = 0.5,
4264
        TitleBarBorderTransparency = 1,
4265
        Visible = true
4266
}}
4267
function GuiWindow:Init(data)
4268
        GuiObject.Init(self)
4269
        setmetatable(data, GuiFrame.__default)
4270
        local title_bar = GuiTextLabel:new {
4271
                BackgroundTransparency = data.TitleBarBackgroundTransparency,
4272
                BorderTransparency = data.TitleBarBackgroundTransparency,
4273
                Text = data.Title
4274
        }
4275
        local content_frame = GuiFrame:new {
4276
                Active = data.Active,
4277
                BackgroundTransparency = data.BackgroundTransparency,
4278
                BorderSize = data.BorderSize,
4279
                BorderTransparency = data.BorderTransparency
4280
        }
4281
        local base_frame = RBXInstance.new "Frame" {
4282
                BackgroundTransparency = 1,
4283
                BorderSizePixel = 0,
4284
                Position = data.Position,
4285
                Size = data.Size,
4286
                Visible = data.Visible
4287
        }
4288
        self.m_base_frame = base_frame
4289
        self.m_content_frame = content_frame
4290
        self.m_title_bar = title_bar
4291
end
4292
function GuiWindow:IsA(className)
4293
        return className == "GuiWindow" or GuiObject.IsA(self, className)
4294
end
4295
GuiScrollFrame = setmetatable({}, GuiFrame)
4296
GuiScrollFrame.__index = GuiScrollFrame
4297
GuiScrollFrame.__default = {__index = {
4298
        ContentHeight = 0,
4299
        ScrollBarColor = Color3.new(1, 1, 1)
4300
}}
4301
function GuiScrollFrame:Destroy()
4302
        self.m_scroll_bar:Destroy()
4303
        GuiFrame.Destroy(self)
4304
end
4305
function GuiScrollFrame:GetContentInstance()
4306
        return self.m_scroll_frame or GuiFrame.GetContentInstance(self)
4307
end
4308
function GuiScrollFrame:Init(data)
4309
        GuiFrame.Init(self, data)
4310
        setmetatable(data, GuiScrollFrame.__default)
4311
        local scroll_pane = RBXInstance.new "Frame" {
4312
                BackgroundColor3 = Color3.new(1, 1, 1),
4313
                BackgroundTransparency = 0.8,
4314
                BorderSizePixel = 0,
4315
                Position = UDim2.new(1, -20, 0, 0),
4316
                Size = UDim2.new(0, 20, 1, 0),
4317
                Parent = self.m_content_frame
4318
        }
4319
        local scroll_bar = GuiFrame:new {
4320
                Active = true,
4321
                BackgroundTransparency = 0.6,
4322
                BorderTransparency = 0.6,
4323
                Color = data.ScrollBarColor,
4324
                Parent = self
4325
        }
4326
        local scroll_frame = RBXInstance.new "Frame" {
4327
                BackgroundTransparency = 1,
4328
                Parent = self.m_content_frame
4329
        }
4330
        self.m_scroll_bar = scroll_bar
4331
        self.m_scroll_frame = scroll_frame
4332
        self.m_scroll_pane = scroll_pane
4333
        self.m_scroll_position = 0
4334
        self.m_updating_content_height = false
4335
        self:SetContentHeight(data.ContentHeight)
4336
        self:UpdateScrollPosition()
4337
        self.m_scroll_bar.DragBegin:connect(function()
4338
                self.m_scroll_drag_total = Vector2.new()
4339
                self.m_scroll_initial_position = self.m_scroll_position
4340
        end)
4341
        self.m_scroll_bar.DragMove:connect(function(offset)
4342
                self.m_scroll_drag_total = self.m_scroll_drag_total + offset
4343
                local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size
4344
                if absolute_height ~= 0 then
4345
                        local content_height = math.max(self.m_content_height, absolute_height)
4346
                        local scroll_space = 1 - absolute_height / content_height
4347
                        self:Scroll(self.m_scroll_initial_position + self.m_scroll_drag_total.Y * (content_height / absolute_height - 1) / scroll_space)
4348
                end
4349
        end)
4350
end
4351
function GuiScrollFrame:IsA(className)
4352
        return className == "GuiScrollFrame" or GuiFrame.IsA(self, className)
4353
end
4354
function GuiScrollFrame:Scroll(position)
4355
        position = math.min(math.max(position, 0), self.m_content_height - (self:GetAbsoluteSize().Y - 2 * self.m_border_size))
4356
        if position ~= self.m_scroll_position then
4357
                self.m_scroll_position = position
4358
                self:UpdateScrollPosition()
4359
        end
4360
end
4361
function GuiScrollFrame:SetContentHeight(height)
4362
        if height ~= self.m_content_height then
4363
                local prev_height = self.m_content_height
4364
                self.m_content_height = height
4365
                if not self.m_updating_content_height then
4366
                        self.m_updating_content_height = true
4367
                        coroutine.resume(coroutine.create(function()
4368
                                local success, message = ypcall(self.SetContentHeightImpl1, self, prev_height)
4369
                                if not success then
4370
                                        Logger.printf("Severe", "Error in GuiScrollFrame:SetContentHeight(%s): %s", Utility.ToString(height), message)
4371
                                end
4372
                        end))
4373
                end
4374
        end
4375
end
4376
function GuiScrollFrame:SetContentHeightImpl1(prev_height)
4377
        RunService.RenderStepped:wait()
4378
        self.m_updating_content_height = false
4379
        local height = self.m_content_height
4380
        self.m_scroll_frame.Size = UDim2.new(1, -20, 0, height)
4381
        if prev_height and prev_height ~= 0 then
4382
                local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size
4383
                if self.m_scroll_position == prev_height - absolute_height then
4384
                        self.m_scroll_position = height - absolute_height
4385
                else
4386
                        self.m_scroll_position = height * self.m_scroll_position / prev_height
4387
                end
4388
        end
4389
        self:UpdateScrollPosition()
4390
end
4391
function GuiScrollFrame:UpdateScrollPosition()
4392
        local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size
4393
        if absolute_height == 0 then
4394
                absolute_height = self.m_content_height
4395
        end
4396
        local scroll_bar = self.m_scroll_bar
4397
        local scroll_frame = self.m_scroll_frame
4398
        local scroll_pane = self.m_scroll_pane
4399
        local content_height = math.max(self.m_content_height, absolute_height)
4400
        if absolute_height == content_height then
4401
                scroll_frame.Position = UDim2.new(0, 0, 0, 0)
4402
                scroll_frame.Size = UDim2.new(1, 0, 1, 0)
4403
                scroll_bar:SetVisible(false)
4404
                scroll_pane.Visible = false
4405
        else
4406
                local contentScale = content_height / absolute_height
4407
                local scroll_space = 1 - absolute_height / content_height
4408
                local scroll_position = self.m_scroll_position
4409
                scroll_frame.Position = UDim2.new(0, 0, 0, -scroll_position)
4410
                scroll_bar:SetPosition(UDim2.new(1, -20, scroll_position / (content_height - absolute_height) * scroll_space, 0))
4411
                scroll_bar:SetSize(UDim2.new(0, 20, absolute_height / content_height, 0))
4412
                scroll_bar:SetVisible(true)
4413
                scroll_pane.Visible = true
4414
        end
4415
end
4416
GuiMenu = setmetatable({}, GuiFrame)
4417
GuiMenu.__index = GuiMenu
4418
GuiMenu.__default = {__index = {
4419
        VerticalSpacing = 18
4420
}}
4421
function GuiMenu:AddItem(text, onClick, options)
4422
        local frameSize = self:GetSize()
4423
        local frameHeight = frameSize.Y.Offset - self.m_border_size * 2
4424
        local verticalSpacing = self.verticalSpacing
4425
        local properties = {
4426
                BackgroundTransparency = 0.75,
4427
                BorderSize = 0,
4428
                BorderTransparency = 1,
4429
                Color = (#self.menuItems % 2 == 1) and Color3.new(0.25, 0.25, 0.25) or Color3.new(0, 0, 0),
4430
                FontSize = Enum.FontSize.Size12,
4431
                Position = UDim2.new(0, 0, 0, frameHeight),
4432
                Size = UDim2.new(1, 0, 0, verticalSpacing),
4433
                Text = text,
4434
                Parent = self
4435
        }
4436
        if options then
4437
                for key, value in pairs(options) do
4438
                        properties[key] = value
4439
                end
4440
        end
4441
        local menuItem = GuiTextButton:new(properties)
4442
        if onClick then
4443
                menuItem.Activated:connect(function()
4444
                        if not onClick(text, self) then
4445
                                self:Destroy()
4446
                        end
4447
                end)
4448
        end
4449
        self.menuItems[#self.menuItems + 1] = menuItem
4450
        self:SetSize(frameSize + UDim2.new(0, 0, 0, verticalSpacing))
4451
end
4452
function GuiMenu:ClearItems()
4453
        local menuItems = self.menuItems
4454
        for _, item in ipairs(menuItems) do
4455
                menuItems[item] = nil
4456
                item:Destroy()
4457
        end
4458
        local frameSize = self:GetSize()
4459
        self:SetSize(frameSize + UDim2.new(0, 0, 0, self.m_border_size * 2 - frameSize.Y.Offset))
4460
end
4461
function GuiMenu:Destroy()
4462
        self:ClearItems()
4463
        GuiFrame.Destroy(self)
4464
end
4465
function GuiMenu:Init(data)
4466
        GuiFrame.Init(self, data)
4467
        setmetatable(data, GuiMenu.__default)
4468
        self.menuItems = {}
4469
        self.verticalSpacing = data.VerticalSpacing
4470
end
4471
function GuiMenu:IsA(className)
4472
        return className == "GuiMenu" or GuiFrame.IsA(self, className)
4473
end
4474
GuiTextList = setmetatable({}, GuiScrollFrame)
4475
GuiTextList.__index = GuiTextList
4476
GuiTextList.__default = {__index = {
4477
}}
4478
function GuiTextList:AddItem(text, options)
4479
        local properties = {
4480
                BackgroundTransparency = 1,
4481
                Font = "ArialBold",
4482
                FontSize = "Size12",
4483
                Position = UDim2.new(0, 4, 0, self.m_content_height),
4484
                Size = UDim2.new(1, -8, 0, 12),
4485
                Text = tostring(text),
4486
                TextColor3 = Color3.new(1, 1, 1),
4487
                TextStrokeTransparency = 0.6,
4488
                TextWrapped = true,
4489
                TextXAlignment = "Left",
4490
                Parent = self:GetContentInstance()
4491
        }
4492
        if options then
4493
                for key, value in pairs(options) do
4494
                        properties[key] = value
4495
                end
4496
        end
4497
        local textLabel = RBXInstance.new "TextLabel" (properties)
4498
        textLabel.Size = UDim2.new(1, 0, 0, textLabel.TextBounds.Y)
4499
        self.listItems[#self.listItems + 1] = textLabel
4500
        self:SetContentHeight(self.m_content_height + textLabel.TextBounds.Y)
4501
end
4502
function GuiTextList:ClearItems()
4503
        local listItems = self.listItems
4504
        for _, item in ipairs(listItems) do
4505
                listItems[item] = nil
4506
                item:Destroy()
4507
        end
4508
        self:SetContentHeight(0)
4509
end
4510
function GuiTextList:Destroy()
4511
        self:ClearItems()
4512
        GuiScrollFrame.Destroy(self)
4513
end
4514
function GuiTextList:Init(data)
4515
        GuiScrollFrame.Init(self, data)
4516
        self.listItems = {}
4517
end
4518
function GuiTextList:IsA(className)
4519
        return className == "GuiTextList" or GuiScrollFrame.IsA(self, className)
4520
end
4521
GuiNetworkList = setmetatable({}, GuiTextList)
4522
GuiNetworkList.__index = GuiNetworkList
4523
function GuiNetworkList:AddItem(systemTime, idleTime, userName, isNil)
4524
        local frame = GuiFrame:new {
4525
                BackgroundTransparency = 1,
4526
                BorderSize = 0,
4527
                BorderTransparency = 1,
4528
                Position = UDim2.new(0, 4, 0, self.m_content_height),
4529
                Size = UDim2.new(1, -8, 0, 14),
4530
        }
4531
        local systemTimeColor
4532
        if string.sub(systemTime, 1, 1) == "?" then
4533
                systemTimeColor = Color3.new(1, 0.75, 0.75)
4534
        else
4535
                systemTimeColor = Color3.new(0.75, 0.75, 1)
4536
        end
4537
        local systemTimeLabel = RBXInstance.new "TextLabel" {
4538
                BackgroundTransparency = 1,
4539
                Font = "ArialBold",
4540
                FontSize = "Size12",
4541
                Position = UDim2.new(0, 0, 0, 0),
4542
                Size = UDim2.new(0, 50, 1, 0),
4543
                Text = systemTime,
4544
                TextColor3 = systemTimeColor,
4545
                TextStrokeTransparency = 0.6,
4546
                TextXAlignment = "Left",
4547
                Parent = frame:GetContentInstance()
4548
        }
4549
        local idle_time_color
4550
        if string.sub(idleTime, 1, 1) == "0" then
4551
                idle_time_color = Color3.new(1, 1, 1)
4552
        else
4553
                idle_time_color = Color3.new(1, 0.75, 0.75)
4554
        end
4555
        local idleTimeLabel = RBXInstance.new "TextLabel" {
4556
                BackgroundTransparency = 1,
4557
                Font = "ArialBold",
4558
                FontSize = "Size12",
4559
                Position = UDim2.new(0, 40, 0, 0),
4560
                Size = UDim2.new(0, 45, 1, 0),
4561
                Text = idleTime,
4562
                TextColor3 = idle_time_color,
4563
                TextStrokeTransparency = 0.6,
4564
                TextXAlignment = "Right",
4565
                Parent = frame:GetContentInstance()
4566
        }
4567
        local userNameLabel = GuiTextButton:new {
4568
                AutoButtonColor = false,
4569
                BackgroundTransparency = 1,
4570
                BorderSize = 0,
4571
                BorderTransparency = 1,
4572
                Font = Enum.Font.SourceSansBold,
4573
                FontSize = Enum.FontSize.Size14,
4574
                Position = UDim2.new(0, 98, 0, 0),
4575
                Size = UDim2.new(1, -98, 1, 0),
4576
                TextXAlignment = Enum.TextXAlignment.Left,
4577
                Text = userName,
4578
                Parent = frame
4579
        }
4580
        frame:SetParent(self)
4581
        local userNameWidth = userNameLabel:GetTextBounds().X
4582
        userNameLabel:SetSize(UDim2.new(0, userNameWidth + 4, 1, 0))
4583
        if isNil then
4584
                local isNilLabel = RBXInstance.new "TextLabel" {
4585
                        BackgroundTransparency = 1,
4586
                        Font = "SourceSans",
4587
                        FontSize = "Size14",
4588
                        Position = UDim2.new(0, 100 + userNameWidth + 8, 0, 0),
4589
                        Size = UDim2.new(0, 50, 1, 0),
4590
                        Text = "(nil)",
4591
                        TextColor3 = Color3.new(1, 0.4, 0.4),
4592
                        TextStrokeTransparency = 0.6,
4593
                        TextXAlignment = "Left",
4594
                        Parent = frame:GetContentInstance()
4595
                }
4596
        end
4597
        self.listItems[#self.listItems + 1] = frame
4598
        self:SetContentHeight(self.m_content_height + 14)
4599
end
4600
function GuiNetworkList:IsA(className)
4601
        return className == "GuiNetworkList" or GuiTextList.IsA(self, className)
4602
end
4603
GuiTextOutput = setmetatable({}, GuiScrollFrame)
4604
GuiTextOutput.__index = GuiTextOutput
4605
GuiTextOutput.__default = {__index = {
4606
        DisplayMaxLines = 120,
4607
        DisplayWidth = 0
4608
}}
4609
function GuiTextOutput:Init(data)
4610
        GuiScrollFrame.Init(self, data)
4611
        setmetatable(data, GuiTextOutput.__default)
4612
        self.displayMaxLines = data.DisplayMaxLines
4613
        self.displayWidth = data.DisplayWidth
4614
        self.displayItems = {}
4615
        self:SetBackgroundTransparency(0)
4616
        self:SetColor(Color3.new(1, 1, 1))
4617
        self.m_scroll_pane.BackgroundColor3 = Color3.new(0.5, 0.5, 0.5)
4618
end
4619
function GuiTextOutput:IsA(className)
4620
        return className == "GuiTextOutput" or GuiScrollFrame.IsA(self, className)
4621
end
4622
function GuiTextOutput:Print(...)
4623
        self:PrintFormat(nil, ...)
4624
end
4625
function GuiTextOutput:PrintFormat(options, ...)
4626
        local buffer = {}
4627
        local args = {...}
4628
        local first = true
4629
        for i = 1, select("#", ...) do
4630
                buffer[i] = tostring(args[i])
4631
        end
4632
        message = Utility.BlockRobloxFilter(table.concat(buffer, "\t"))
4633
        local properties = {
4634
                BackgroundTransparency = 1,
4635
                Font = "ArialBold",
4636
                FontSize = "Size12",
4637
                Position = UDim2.new(0, 4, 0, self.m_content_height),
4638
                Text = message,
4639
                TextColor3 = Color3.new(1, 1, 1),
4640
                TextWrapped = true,
4641
                TextXAlignment = "Left",
4642
                TextYAlignment = "Bottom",
4643
                Parent = self:GetContentInstance()
4644
        }
4645
        if options then
4646
                for key, value in pairs(options) do
4647
                        properties[key] = value
4648
                end
4649
        end
4650
        local textBounds = GuiService:GetTextBounds(message, properties.Font, properties.FontSize, properties.TextXAlignment, properties.TextYAlignment,
4651
 
4652
self.displayWidth - 20)
4653
        local textHeight = textBounds.Y
4654
        properties.Size = UDim2.new(0, self.displayWidth - 8, 0, textBounds.Y)
4655
        local textLabel = RBXInstance.new "TextLabel" (properties)
4656
        self.displayItems[#self.displayItems + 1] = textLabel
4657
        local maxLines = self.displayMaxLines
4658
        local maxHeight = maxLines * 12
4659
        local newHeight = self.m_content_height + textHeight
4660
        if newHeight > maxHeight then
4661
                local offset = 0
4662
                local newList = {}
4663
                local oldList = self.displayItems
4664
                for index, child in ipairs(oldList) do
4665
                        local childOffset = child.Size.Y.Offset
4666
                        if newHeight > maxHeight then
4667
                                offset = offset + childOffset
4668
                                newHeight = newHeight - childOffset
4669
                                child:Destroy()
4670
                        else
4671
                                child.Position = child.Position - UDim2.new(0, 0, 0, offset)
4672
                                newList[#newList + 1] = child
4673
                        end
4674
                end
4675
                self.displayItems = newList
4676
        end
4677
        self:SetContentHeight(newHeight)
4678
end
4679
GuiChatLog = setmetatable({}, GuiScrollFrame)
4680
GuiChatLog.__index = GuiChatLog
4681
GuiChatLog.__default = {__index = {
4682
        DisplayMaxLines = 200,
4683
        DisplayWidth = 0,
4684
}}
4685
function GuiChatLog:Chat(speaker, message)
4686
        local speaker_color = AdvancedGUI.GenerateChatColor(speaker)
4687
        speaker = Utility.BlockRobloxFilter(speaker)
4688
        message = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" .. Utility.BlockRobloxFilter(message)
4689
        local timestamp = Utility.GetTimestamp()
4690
        local textBounds = GuiService:GetTextBounds(message, "ArialBold", "Size12", "Left", "Bottom", self.displayWidth - 8)
4691
        local textHeight = math.max(math.min(textBounds.Y, 36), 12)
4692
        local message_frame = RBXInstance.new "Frame" {
4693
                BackgroundTransparency = 1,
4694
                Position = UDim2.new(0, 0, 0, self.m_content_height),
4695
                Size = UDim2.new(0, self.displayWidth, 0, textHeight),
4696
                Parent = self:GetContentInstance()
4697
        }
4698
        local timestamp_label = RBXInstance.new "TextLabel" {
4699
                BackgroundTransparency = 1,
4700
                Font = "ArialBold",
4701
                FontSize = "Size12",
4702
                Position = UDim2.new(0, 4, 0, 0),
4703
                Size = UDim2.new(1, -8, 0, 12),
4704
                Text = timestamp,
4705
                TextColor3 = Color3.new(0.75, 0.75, 0.75),
4706
                TextStrokeTransparency = 0.6,
4707
                TextWrapped = true,
4708
                TextXAlignment = "Left",
4709
                Parent = message_frame
4710
        }
4711
        local speaker_label = RBXInstance.new "TextLabel" {
4712
                BackgroundTransparency = 1,
4713
                Font = "ArialBold",
4714
                FontSize = "Size12",
4715
                Position = UDim2.new(0, 64, 0, 0),
4716
                Size = UDim2.new(0, 100, 0, 12),
4717
                Text = speaker,
4718
                TextColor3 = speaker_color,
4719
                TextStrokeTransparency = 0.6,
4720
                Parent = message_frame
4721
        }
4722
        local message_label = RBXInstance.new "TextLabel" {
4723
                BackgroundTransparency = 1,
4724
                Font = "ArialBold",
4725
                FontSize = "Size12",
4726
                Position = UDim2.new(0, 4, 0, 0),
4727
                Size = UDim2.new(1, -8, 1, 0),
4728
                Text = message,
4729
                TextColor3 = Color3.new(1, 1, 1),
4730
                TextStrokeTransparency = 0.6,
4731
                TextXAlignment = "Left",
4732
                TextYAlignment = "Bottom",
4733
                TextWrapped = true,
4734
                Parent = message_frame
4735
        }
4736
        self.displayItems[#self.displayItems + 1] = message_frame
4737
        local maxLines = self.displayMaxLines
4738
        local maxHeight = maxLines * 12
4739
        local newHeight = self.m_content_height + textHeight
4740
        if newHeight > maxHeight then
4741
                local offset = 0
4742
                local newList = {}
4743
                local oldList = self.displayItems
4744
                for index, child in ipairs(oldList) do
4745
                        local childOffset = child.Size.Y.Offset
4746
                        if newHeight > maxHeight then
4747
                                offset = offset + childOffset
4748
                                newHeight = newHeight - childOffset
4749
                                child:Destroy()
4750
                        else
4751
                                child.Position = child.Position - UDim2.new(0, 0, 0, offset)
4752
                                newList[#newList + 1] = child
4753
                        end
4754
                end
4755
                self.displayItems = newList
4756
        end
4757
        self:SetContentHeight(newHeight)
4758
end
4759
function GuiChatLog:Init(data)
4760
        GuiScrollFrame.Init(self, data)
4761
        setmetatable(data, GuiChatLog.__default)
4762
        self.displayMaxLines = data.DisplayMaxLines
4763
        self.displayWidth = data.DisplayWidth
4764
        self.displayItems = {}
4765
end
4766
function GuiChatLog:IsA(className)
4767
        return className == "GuiChatLog" or GuiScrollFrame.IsA(self, className)
4768
end
4769
GuiSeperator = setmetatable({}, GuiObject)
4770
GuiSeperator.__index = GuiSeperator
4771
GuiSeperator.__default = {__index = {
4772
        Active = false,
4773
        Position = UDim2.new(0, 0, 0, 0),
4774
        Size = UDim2.new(1, 0, 0, 16),
4775
        Visible = true
4776
}}
4777
function GuiSeperator:Init(data)
4778
        GuiObject.Init(self)
4779
        setmetatable(data, GuiSeperator.__default)
4780
        local base_frame = RBXInstance.new "Frame" {
4781
                BackgroundTransparency = 1,
4782
                RBXInstance.new "Frame" {
4783
                        BackgroundColor3 = Color3.new(1, 1, 1),
4784
                        BackgroundTransparency = 0.25,
4785
                        BorderSizePixel = 0,
4786
                        Position = UDim2.new(0.5, -13, 0.5, -1),
4787
                        Size = UDim2.new(0, 3, 0, 3),
4788
                        RBXInstance.new "Frame" {
4789
                                BackgroundColor3 = Color3.new(0, 0, 0),
4790
                                BackgroundTransparency = 0.75,
4791
                                BorderSizePixel = 0,
4792
                                Position = UDim2.new(0, -1, 0, -1),
4793
                                Size = UDim2.new(0, 5, 0, 5)
4794
                        }
4795
                },
4796
                RBXInstance.new "Frame" {
4797
                        BackgroundColor3 = Color3.new(1, 1, 1),
4798
                        BackgroundTransparency = 0.25,
4799
                        BorderSizePixel = 0,
4800
                        Position = UDim2.new(0.5, -1, 0.5, -1),
4801
                        Size = UDim2.new(0, 3, 0, 3),
4802
                        RBXInstance.new "Frame" {
4803
                                BackgroundColor3 = Color3.new(0, 0, 0),
4804
                                BackgroundTransparency = 0.75,
4805
                                BorderSizePixel = 0,
4806
                                Position = UDim2.new(0, -1, 0, -1),
4807
                                Size = UDim2.new(0, 5, 0, 5)
4808
                        }
4809
                },
4810
                RBXInstance.new "Frame" {
4811
                        BackgroundColor3 = Color3.new(1, 1, 1),
4812
                        BackgroundTransparency = 0.25,
4813
                        BorderSizePixel = 0,
4814
                        Position = UDim2.new(0.5, 11, 0.5, -1),
4815
                        Size = UDim2.new(0, 3, 0, 3),
4816
                        RBXInstance.new "Frame" {
4817
                                BackgroundColor3 = Color3.new(0, 0, 0),
4818
                                BackgroundTransparency = 0.75,
4819
                                BorderSizePixel = 0,
4820
                                Position = UDim2.new(0, -1, 0, -1),
4821
                                Size = UDim2.new(0, 5, 0, 5)
4822
                        }
4823
                }
4824
        }
4825
        self.m_base_instance = base_frame
4826
        self:SetActive(data.Active)
4827
        self:SetPosition(data.Position)
4828
        self:SetSize(data.Size)
4829
        self:SetVisible(data.Visible)
4830
        self:SetParent(data.Parent)
4831
end
4832
function GuiSeperator:IsA(className)
4833
        return className == "GuiSeperator" or GuiObject.IsA(self, className)
4834
end
4835
local startMenu = GuiFrame:new {
4836
        BorderTransparency = 0.5,
4837
        Position = UDim2.new(0, -4, 0, -4),
4838
        Size = UDim2.new(0, 68, 1, 8),
4839
        Parent = GuiService
4840
}
4841
GuiSeperator:new {
4842
        Position = UDim2.new(0, 0, 0, 5),
4843
        Parent = startMenu
4844
}
4845
GuiSeperator:new {
4846
        Position = UDim2.new(0, 0, 1, -85),
4847
        Parent = startMenu
4848
}
4849
local networkButton = GuiTextButton:new {
4850
        BackgroundTransparency = 0.9,
4851
        Mnemonic = "L",
4852
        Position = UDim2.new(0, 4, 1, -647),
4853
        Text = "Network",
4854
        Parent = startMenu
4855
}
4856
local chatLogButton = GuiTextButton:new {
4857
        BackgroundTransparency = 0.9,
4858
        Mnemonic = "K",
4859
        Position = UDim2.new(0, 4, 1, -475),
4860
        Text = "Chat log",
4861
        Parent = startMenu
4862
}
4863
local outputButton = GuiTextButton:new {
4864
        BackgroundTransparency = 0.9,
4865
        Mnemonic = "P",
4866
        Position = UDim2.new(0, 4, 1, -283),
4867
        Text = "Output",
4868
        Parent = startMenu
4869
}
4870
local toolsButton = GuiTextButton:new {
4871
        BackgroundTransparency = 0.9,
4872
        Mnemonic = "O",
4873
        Position = UDim2.new(0, 4, 1, -137),
4874
        Text = "Tools",
4875
        Parent = startMenu
4876
}
4877
local networkFrame = GuiNetworkList:new {
4878
        Position = UDim2.new(0, 66, 1, -647),
4879
        Size = UDim2.new(0, 0, 0, 168),
4880
        Visible = false,
4881
        Parent = GuiService
4882
}
4883
local chatLogFrame = GuiChatLog:new {
4884
        DisplayWidth = 332,
4885
        Position = UDim2.new(0, 66, 1, -475),
4886
        Size = UDim2.new(0, 0, 0, 188),
4887
        Visible = false,
4888
        Parent = GuiService
4889
}
4890
local outputFrame = GuiTextOutput:new {
4891
        DisplayWidth = 332,
4892
        Position = UDim2.new(0, 66, 1, -283),
4893
        Size = UDim2.new(0, 0, 0, 140),
4894
        Visible = false,
4895
        Parent = GuiService
4896
}
4897
local toolsFrame = GuiFrame:new {
4898
        Position = UDim2.new(0, 66, 1, -137),
4899
        Size = UDim2.new(0, 0, 0, 52),
4900
        Visible = false,
4901
        Parent = GuiService
4902
}
4903
local toggleCharacterButton = GuiTextButton:new {
4904
        BackgroundTransparency = 0.9,
4905
        Position = UDim2.new(0, 1, 0, 1),
4906
        Size = UDim2.new(0, 108, 0, 20),
4907
        Text = "Enable character",
4908
        Parent = toolsFrame
4909
}
4910
local resetCharacterButton = GuiTextButton:new {
4911
        BackgroundTransparency = 0.9,
4912
        Position = UDim2.new(0, 1, 0, 23),
4913
        Size = UDim2.new(0, 108, 0, 20),
4914
        Text = "Reset character",
4915
        Parent = toosFrame
4916
}
4917
local clearWorkspaceButton = GuiTextButton:new {
4918
        BackgroundTransparency = 0.9,
4919
        Position = UDim2.new(0, 110, 0, 1),
4920
        Size = UDim2.new(0, 108, 0, 20),
4921
        Text = "Clear workspace",
4922
        Parent = toolsFrame
4923
}
4924
local clearScriptButton = GuiTextButton:new {
4925
        BackgroundTransparency = 0.9,
4926
        Position = UDim2.new(0, 110, 0, 23),
4927
        Size = UDim2.new(0, 108, 0, 20),
4928
        Text = "Clear all",
4929
        Parent = toolsFrame
4930
}
4931
local fixLightingButton = GuiTextButton:new {
4932
        BackgroundTransparency = 0.9,
4933
        Position = UDim2.new(0, 219, 0, 1),
4934
        Size = UDim2.new(0, 108, 0, 20),
4935
        Text = "Fix lighting",
4936
        Parent = toolsFrame
4937
}
4938
local reloadCommandsButton = GuiTextButton:new {
4939
        BackgroundTransparency = 0.9,
4940
        Position = UDim2.new(0, 219, 0, 23),
4941
        Size = UDim2.new(0, 108, 0, 20),
4942
        Text = "Reload commands",
4943
        Parent = toolsFrame
4944
}
4945
toggleCharacterButton.Activated:connect(function()
4946
        local enabled = not PlayerControl.IsEnabled()
4947
        if enabled then
4948
                toggleCharacterButton:SetText("Disable character")
4949
        else
4950
                toggleCharacterButton:SetText("Enable character")
4951
        end
4952
        PlayerControl.SetEnabled(enabled)
4953
end)
4954
resetCharacterButton.Activated:connect(function()
4955
        PlayerControl.ResetCharacter()
4956
end)
4957
clearWorkspaceButton.Activated:connect(function()
4958
        Utility.CleanWorkspace()
4959
end)
4960
clearScriptButton.Activated:connect(function()
4961
        Utility.CleanWorkspaceAndScripts()
4962
end)
4963
fixLightingButton.Activated:connect(function()
4964
        Utility.CleanLighting()
4965
end)
4966
reloadCommandsButton.Activated:connect(function()
4967
        UserInterface.FixChattedConnection()
4968
end)
4969
local networkFrameActive = false
4970
local networkFrameTweening = false
4971
networkButton.Activated:connect(function()
4972
        if not networkFrameTweening then
4973
                networkFrameActive = not networkFrameActive
4974
                networkFrameTweening = true
4975
                if networkFrameActive then
4976
                        networkFrame:SetVisible(true)
4977
                        networkFrame.m_base_instance:TweenSize(UDim2.new(0, 276, 0, 168), nil, nil, 0.5)
4978
                        wait(0.5)
4979
                else
4980
                        networkFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 168), nil, nil, 0.5)
4981
                        wait(0.5)
4982
                        networkFrame:SetVisible(false)
4983
                end
4984
                networkFrameTweening = false
4985
        end
4986
end)
4987
local chatLogFrameActive = false
4988
local chatLogFrameTweening = false
4989
chatLogButton.Activated:connect(function()
4990
        if not chatLogFrameTweening then
4991
                chatLogFrameActive = not chatLogFrameActive
4992
                chatLogFrameTweening = true
4993
                if chatLogFrameActive then
4994
                        chatLogFrame:SetVisible(true)
4995
                        chatLogFrame.m_base_instance:TweenSize(UDim2.new(0, 360, 0, 188), nil, nil, 0.5)
4996
                        wait(0.5)
4997
                else
4998
                        chatLogFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 188), nil, nil, 0.5)
4999
                        wait(0.5)
5000
                        chatLogFrame:SetVisible(false)
5001
                end
5002
                chatLogFrameTweening = false
5003
        end
5004
end)
5005
local outputFrameActive = false
5006
local outputFrameTweening = false
5007
outputButton.Activated:connect(function()
5008
        if not outputFrameTweening then
5009
                outputFrameActive = not outputFrameActive
5010
                outputFrameTweening = true
5011
                if outputFrameActive then
5012
                        outputFrame:SetVisible(true)
5013
                        outputFrame.m_base_instance:TweenSize(UDim2.new(0, 360, 0, 140), nil, nil, 0.5)
5014
                        wait(0.5)
5015
                else
5016
                        outputFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 140), nil, nil, 0.5)
5017
                        wait(0.5)
5018
                        outputFrame:SetVisible(false)
5019
                end
5020
                outputFrameTweening = false
5021
        end
5022
end)
5023
local toolsFrameActive = false
5024
local toolsFrameTweening = false
5025
toolsButton.Activated:connect(function()
5026
        if not toolsFrameTweening then
5027
                toolsFrameActive = not toolsFrameActive
5028
                toolsFrameTweening = true
5029
                if toolsFrameActive then
5030
                        toolsFrame:SetVisible(true)
5031
                        toolsFrame.m_base_instance:TweenSize(UDim2.new(0, 336, 0, 52), nil, nil, 0.5)
5032
                        wait(0.5)
5033
                else
5034
                        toolsFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 52), nil, nil, 0.5)
5035
                        wait(0.5)
5036
                        toolsFrame:SetVisible(false)
5037
                end
5038
                toolsFrameTweening = false
5039
        end
5040
end)
5041
AdvancedGUI.startMenu = startMenu
5042
AdvancedGUI.networkFrame = networkFrame
5043
AdvancedGUI.outputFrame = outputFrame
5044
AdvancedGUI.toolsFrame = toolsFrame
5045
AdvancedGUI.chatLogFrame = chatLogFrame
5046
AdvancedGUI.toggleCharacterButton = toggleCharacterButton
5047
AdvancedGUI.reloadCommandsButton = reloadCommandsButton
5048
function AdvancedGUI.Print(...)
5049
        AdvancedGUI.outputFrame:Print(...)
5050
end
5051
function AdvancedGUI.PrintFormat(...)
5052
        AdvancedGUI.outputFrame:PrintFormat(...)
5053
end
5054
function AdvancedGUI.PrintChatLog(speaker, message)
5055
        AdvancedGUI.chatLogFrame:Chat(speaker, message)
5056
end
5057
for _, entry in Logger.NodeIterator, Logger.entries do
5058
        if entry then
5059
                local messageType = entry[1]
5060
                local messageTypeValue
5061
                if messageType == Logger.MessageType.Error then
5062
                        messageTypeValue = Logger.MessageType.Severe.Value
5063
                else
5064
                        messageTypeValue = messageType.Value
5065
                end
5066
                AdvancedGUI.outputFrame:PrintFormat(Logger.MESSAGE_TYPE_SETTINGS[messageTypeValue], entry[2])
5067
        else
5068
                break
5069
        end
5070
end
5071
 
5072
function GetPlayers(str)
5073
    local found = {};
5074
    if str == "all" then
5075
        for i,v in pairs(game.Players:children()) do
5076
            if v:IsA("Player") then table.insert(found,v) end
5077
        end
5078
    else
5079
        for i,v in pairs(game.Players:children()) do
5080
            if string.match(v.Name:lower(), str:lower()) and v:IsA("Player") then
5081
                table.insert(found,v)
5082
            end
5083
        end
5084
    end
5085
    return found
5086
end
5087
 
5088
function NewCMD(nme, usg, desc,func)
5089
    table.insert(CMDS, {['Name']=nme, ['Usage']=usg, ['Description']=desc, ['Function']=func})
5090
end
5091
 
5092
NewCMD("Chat Theme", "ctheme", "Changes the chat theme", function(msg) ChatBubble.SetTheme(msg) end)
5093
NewCMD("Clean", "clr", "Clears the game", function() Utility.CleanWorkspaceAndScripts() end)
5094
NewCMD("Fix Lighting", "fixl", "Fixes the lighting",function() Utility.CleanLighting() end)
5095
NewCMD("Dismiss", "d", "Dismisses tabs",function() 
5096
	Dismiss()
5097
	ChatBubble.Create("Dismissed Tabs...")
5098
	 end)
5099
5100
NewCMD("Kill", "kill", "Kills the player", function(msg)
5101
    local plrs = GetPlayers(msg)
5102
    for _,plr in next,plrs do
5103
	
5104
        GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2})
5105
        plr.Character:BreakJoints()
5106
	
5107
    end
5108
end)
5109
5110
NewCMD("Private Server", "ps", "Makes the server private!",function() 
5111
	game.Players.PlayerAdded:connect(function(player)
5112
 player.CharacterAdded:connect(function(h)
5113
 	if player.Name ~= "PointCoded" or "nguyenjimbo" or game.Players.LocalPlayer.Name then
5114
 	wait(0.5)
5115
	player:Kick()
5116
end
5117
end)
5118
end)
5119
	ChatBubble.Create("Private Server is Activated")
5120
end)
5121
5122
NewCMD("nonPrivate Server", "nps", "Makes the server not private!",function() 
5123
	Pserver = false
5124
	ChatBubble.Create("Private Server Is  no longer Activated")
5125
end)
5126
5127
5128
NewCMD("Remove hidden sb", "rhs", "Removes a player's hidden sb", function(msg)
5129
    local plrs = GetPlayers(msg)
5130
    for _,plr in next,plrs do
5131
        GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2})
5132
        plr.PlayerGui:ClearAllChildren()
5133
    end
5134
end)
5135
5136
NewCMD("Day", "day", "Makes the time day", function()
5137
  game.Lighting.TimeOfDay = "12:00:00"
5138
ChatBubble.Create("It is now day")
5139
    end)
5140
5141
NewCMD("Night", "night", "Makes the time night", function()
5142
  game.Lighting.TimeOfDay = "00:00:00"
5143
ChatBubble.Create("It is now night")
5144
    end)
5145
5146
NewCMD("Midnight", "midnight", "Makes the time midnight", function()
5147
  game.Lighting.TimeOfDay = "06:00:00"
5148
ChatBubble.Create("It is now midnight")
5149
    end)
5150
5151
5152
NewCMD("Teleport", "tp", "Teleports you to a player",function(msg)
5153
 local plrs = GetPlayers(msg)
5154
    for _,plr in next,plrs do
5155
	local Nam = plr.Name
5156
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.5})
5157
	Player.Character.Torso.CFrame = plr.Character.Torso.CFrame
5158
	ChatBubble.Create("Teleported you to: "..Nam.."!")
5159
end
5160
end)
5161
5162
NewCMD("Admin", "adm", "Admins a player",function(msg)
5163
 local plrs = GetPlayers(msg)
5164
 for _,plr in next,plrs do
5165
   if plr.Character then
5166
                        local shared = script:clone()
5167
                        shared.Disabled = true
5168
                        shared.Parent = plr.Backpack
5169
                        wait(1)
5170
                        shared.Disabled = false
5171
                    end
5172
                    end
5173
end)
5174
5175
NewCMD("Blast", "blas", "Blasts a player",function(msg)
5176
 local plrs = GetPlayers(msg)
5177
 for _,plr in next,plrs do
5178
   function HSV(H,S,V) 
5179
	plr.Character.Torso.Anchored = true
5180
H = H % 360 
5181
local C = V * S 
5182
local H2 = H/60 
5183
local X = C * (1 - math.abs((H2 %2) -1)) 
5184
local color = Color3.new(0,0,0) 
5185
if H2 <= 0 then 
5186
color = Color3.new(C,0,0) 
5187
elseif 0 <= H2 and H2 <= 1 then 
5188
color = Color3.new(C,X,0) 
5189
elseif 1 <= H2 and H2 <= 2 then 
5190
color = Color3.new(X,C,0) 
5191
elseif 2 <= H2 and H2 <= 3 then 
5192
color = Color3.new(0,C,X) 
5193
elseif 3 <= H2 and H2 <= 4 then 
5194
color = Color3.new(0,X,C) 
5195
elseif 4 <= H2 and H2 <= 5 then 
5196
color = Color3.new(X,0,C) 
5197
elseif 5 <= H2 and H2 <= 6 then 
5198
color = Color3.new(C,0,X) 
5199
end 
5200
local m = V - C
5201
return Color3.new(color.r + m, color.g + m, color.b + m) 
5202
end 
5203
5204
                    
5205
                    if plr.Character.Torso then
5206
                        plr.Character.Torso.CFrame = plr.Character.Torso.CFrame * CFrame.new(0, 350, 0)
5207
                        wait(2)
5208
                    local p = Instance.new("Part", workspace)
5209
                    p.FormFactor = "Custom"
5210
                    p.Anchored = true
5211
                    p.Locked = true
5212
                    p.CFrame = CFrame.new(plr.Character.Torso.CFrame.x,plr.Character.Torso.CFrame.y, plr.Character.Torso.CFrame.z) * CFrame.Angles(math.pi/2, 0, 0)
5213
                    p.Size = Vector3.new(0.2, 0.2, 0.2)
5214
                    p.CanCollide = false
5215
                    local msh = Instance.new("SpecialMesh", p)
5216
                    msh.MeshId = "http://www.roblox.com/asset/?id=3270017"
5217
                    msh.TextureId = "http://www.roblox.com/asset/?id=48358980"
5218
                    
5219
                        local hue = 0
5220
                    for _ = 0, 5000 do
5221
                        hue = ((hue+0.5)%360)
5222
                        msh.Scale = msh.Scale + Vector3.new(2, 2, 0)
5223
                        p.Transparency = p.Transparency + 0.005
5224
                        local colur = HSV(hue,1,1) 
5225
                        msh.VertexColor = Vector3.new(colur.r,colur.g,colur.b)
5226
                        wait()
5227
plr.Character.Torso.Anchored = false
5228
                    end
5229
                end
5230
 end
5231
end)
5232
5233
NewCMD("Fire", "fi", "Sets a player on fire",function(msg)
5234
 local plrs = GetPlayers(msg)
5235
    for _,plr in next,plrs do
5236
	local Nam = plr.Name
5237
	local F = Instance.new("Fire")
5238
	F.Parent = plr.Character.Torso
5239
	ChatBubble.Create("Given Fire to: "..plr.Name"!")
5240
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Deep orange"), float_duration = 0.2})
5241
end
5242
end)
5243
5244
NewCMD("Sparkles", "spa", "Gives a player sparkles",function(msg)
5245
 local plrs = GetPlayers(msg)
5246
    for _,plr in next,plrs do
5247
	local F = Instance.new("Sparkles")
5248
	F.Parent = plr.Character.Torso
5249
	ChatBubble.Create("Given Sparkles")
5250
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
5251
end
5252
end)
5253
NewCMD("Rpe", "rpe", "Lets you rpe a player",function(msg)
5254
 local plrs = GetPlayers(msg)
5255
    for _,plr in next,plrs do
5256
                n1 = game.Players.LocalPlayer.Name
5257
                n2 = plr.Name
5258
                t1 = game.Players[n1].Character.Torso 
5259
                t2 = game.Players[n2].Character.Torso 
5260
                t2.Parent.Humanoid.PlatformStand = true 
5261
                t1["Left Shoulder"]:Remove() 
5262
                ls1 = Instance.new("Weld") 
5263
                ls1.Parent = t1 
5264
                ls1.Part0 = t1 
5265
                ls1.Part1 = t1.Parent["Left Arm"] 
5266
                ls1.C0 = CFrame.new(-1.5,0,0) 
5267
                ls1.Name = "Left Shoulder" 
5268
                t1["Right Shoulder"]:Remove() 
5269
                rs1 = Instance.new("Weld")
5270
                rs1.Parent = t1 
5271
                rs1.Part0 = t1 
5272
                rs1.Part1 = t1.Parent["Right Arm"] 
5273
                rs1.C0 = CFrame.new(1.5,0,0) 
5274
                rs1.Name = "Right Shoulder"
5275
                --[[ t1["Left Hip"]:Remove() 
5276
                lh1 = Instance.new("Weld") 
5277
                lh1.Parent = t1 
5278
                lh1.Part0 = t1 
5279
                lh1.Part1 = t1.Parent["Left Leg"] 
5280
                lh1.C0 = CFrame.new(-0.5,-2,0) 
5281
                lh1.Name = "Left Hip" t1["Right Hip"]:Remove() 
5282
                rh1 = Instance.new("Weld") rh1.Parent = t1 
5283
                rh1.Part0 = t1 
5284
                rh1.Part1 = t1.Parent["Right Leg"] 
5285
                rh1.C0 = CFrame.new(0.5,-2,0) 
5286
                rh1.Name = "Right Hip"]] 
5287
                t2["Left Shoulder"]:Remove() 
5288
                ls2 = Instance.new("Weld") 
5289
                ls2.Parent = t2 
5290
                ls2.Part0 = t2 
5291
                ls2.Part1 = t2.Parent["Left Arm"] 
5292
                ls2.C0 = CFrame.new(-1.5,0,0) 
5293
                ls2.Name = "Left Shoulder" 
5294
                t2["Right Shoulder"]:Remove() 
5295
                rs2 = Instance.new("Weld") 
5296
                rs2.Parent = t2 
5297
                rs2.Part0 = t2 
5298
                rs2.Part1 = t2.Parent["Right Arm"] 
5299
                rs2.C0 = CFrame.new(1.5,0,0) 
5300
                rs2.Name = "Right Shoulder" 
5301
                t2["Left Hip"]:Remove() 
5302
                lh2 = Instance.new("Weld") 
5303
                lh2.Parent = t2 
5304
                lh2.Part0 = t2 
5305
                lh2.Part1 = t2.Parent["Left Leg"] 
5306
                lh2.C0 = CFrame.new(-0.5,-2,0) 
5307
                lh2.Name = "Left Hip" 
5308
                t2["Right Hip"]:Remove() 
5309
                rh2 = Instance.new("Weld") 
5310
                rh2.Parent = t2 
5311
                rh2.Part0 = t2 
5312
                rh2.Part1 = t2.Parent["Right Leg"] 
5313
                rh2.C0 = CFrame.new(0.5,-2,0) 
5314
                rh2.Name = "Right Hip" 
5315
                local d = Instance.new("Part") 
5316
                d.TopSurface = 0 
5317
                d.BottomSurface = 0 
5318
                d.CanCollide = false 
5319
                d.BrickColor = BrickColor.new("Medium stone grey") 
5320
                d.Shape = "Ball" d.Parent = t1 
5321
                d.Size = Vector3.new(1,1,1) 
5322
                local dm = Instance.new("SpecialMesh") 
5323
                dm.MeshType = "Sphere" 
5324
                dm.Parent = d 
5325
                dm.Scale = Vector3.new(0.4,0.4,0.4) 
5326
                fWeld("weld",t1,t1,d,true,-0.2,-1.3,-0.6,0,0,0) 
5327
                d2 = d:Clone() 
5328
                d2.Parent = t1 
5329
                fWeld("weld",t1,t1,d2,true,0.2,-1.3,-0.6,0,0,0) 
5330
                local c = Instance.new("Part") 
5331
                c.TopSurface = 0 c.BottomSurface = 0 
5332
                c.CanCollide = false 
5333
                c.BrickColor = BrickColor.new("Pastel brown") 
5334
                c.Parent = t1 
5335
                c.formFactor = "Custom" 
5336
                c.Size = Vector3.new(0.4,1.3,0.4) 
5337
                cm = Instance.new("CylinderMesh") 
5338
                cm.Parent = c 
5339
                a = fWeld("weld",t1,t1,c,true,0,-1,-0.52+(-c.Size.y/2),math.rad(-80),0,0) 
5340
                c2 = d:Clone() 
5341
                c2.BrickColor = BrickColor.new("Medium stone grey") 
5342
                c2.Mesh.Scale = Vector3.new(0.4,0.62,0.4) 
5343
                c2.Parent = t1 
5344
                fWeld("weld",c,c,c2,true,0,0+(c.Size.y/2),0,math.rad(-10),0,0) 
5345
                local bl = Instance.new("Part")
5346
                bl.TopSurface = 0 
5347
                bl.BottomSurface = 0 
5348
                bl.CanCollide = false 
5349
                bl.BrickColor = BrickColor.new("Pastel brown") 
5350
                bl.Shape = "Ball" 
5351
                bl.Parent = t2 
5352
                bl.Size = Vector3.new(1,1,1) 
5353
                local dm = Instance.new("SpecialMesh") 
5354
                dm.MeshType = "Sphere" 
5355
                dm.Parent = bl 
5356
                dm.Scale = Vector3.new(1.2,1.2,1.2) 
5357
                fWeld("weld",t2,t2,bl,true,-0.5,0.5,-0.6,0,0,0) 
5358
                local br = Instance.new("Part") 
5359
                br.TopSurface = 0 
5360
                br.BottomSurface = 0 
5361
                br.CanCollide = false 
5362
                br.BrickColor = BrickColor.new("Pastel brown") 
5363
                br.Shape = "Ball" 
5364
                br.Parent = t2 
5365
                br.Size = Vector3.new(1,1,1) 
5366
                local dm = Instance.new("SpecialMesh") 
5367
                dm.MeshType = "Sphere" 
5368
                dm.Parent = br 
5369
                dm.Scale = Vector3.new(1.2,1.2,1.2) 
5370
                fWeld("weld",t2,t2,br,true,0.5,0.5,-0.6,0,0,0) 
5371
                local bln = Instance.new("Part") 
5372
                bln.TopSurface = 0 
5373
                bln.BottomSurface = 0 
5374
                bln.CanCollide = false 
5375
                bln.Shape = "Ball" 
5376
                bln.Parent = t2 
5377
                bln.Size = Vector3.new(1,1,1) 
5378
                local dm = Instance.new("SpecialMesh") 
5379
                dm.MeshType = "Sphere" 
5380
                dm.Parent = bln 
5381
                dm.Scale = Vector3.new(0.2,0.2,0.2) 
5382
                fWeld("weld",t2,t2,bln,true,-0.5,0.5,-1.2,0,0,0) 
5383
                local brn = Instance.new("Part") 
5384
                brn.TopSurface = 0 
5385
                brn.BottomSurface = 0 
5386
                brn.CanCollide = false
5387
                brn.Shape = "Ball" 
5388
                brn.Parent = t2 
5389
                brn.Size = Vector3.new(1,1,1) 
5390
                local dm = Instance.new("SpecialMesh") 
5391
                dm.MeshType = "Sphere" 
5392
                dm.Parent = brn 
5393
                dm.Scale = Vector3.new(0.2,0.2,0.2) 
5394
                fWeld("weld",t2,t2,brn,true,0.5,0.5,-1.2,0,0,0) 
5395
                lh2.C1 = CFrame.new(0,-1.5,-0.5) *CFrame.Angles(0.9,-0.4,0) 
5396
                rh2.C1 = CFrame.new(0,-1.5,-0.5) *CFrame.Angles(0.9,0.4,0) 
5397
                ls2.C1 = CFrame.new(-0.5,-1.3,-0.5) *CFrame.Angles(0.9,-0.4,0) 
5398
                rs2.C1 = CFrame.new(0.5,-1.3,-0.5) *CFrame.Angles(0.9,0.4,0) 
5399
                ls1.C1 = CFrame.new(-0.5,0.7,0) *CFrame.Angles(-0.9,-0.4,0) 
5400
                rs1.C1 = CFrame.new(0.5,0.7,0) *CFrame.Angles(-0.9,0.4,0)                
5401
                if t1:findFirstChild("weldx") ~= nil then 
5402
                t1.weldx:Remove() end 
5403
                we = fWeld("weldx",t1,t1,t2,true,0,-0.9,-1.3,math.rad(-90),0,0) 
5404
                n = t2.Neck 
5405
                n.C0 = CFrame.new(0,1.5,0) *CFrame.Angles(math.rad(-210),math.rad(180),0) 
5406
                while true do wait() for i=1,6 do we.C1 = we.C1 * CFrame.new(0,-0.3,0) wait() end 
5407
                for i=1,6 do we.C1 = we.C1 * CFrame.new(0,0.3,0) wait() end end
5408
                end
5409
	end
5410
)
5411
5412
NewCMD("Box", "box", "Gives the player an outline",function(msg)
5413
 local plrs = GetPlayers(msg)
5414
    for _,plr in next,plrs do
5415
if plr and plr.Character then
5416
                if plr.Character:findFirstChild("Torso") then
5417
                    for _,base in pairs(plr.Character:children()) do
5418
                        if base:IsA("BasePart") then
5419
                            local box = Instance.new("SelectionBox", base)
5420
                            box.Adornee = base
5421
                            box.Color = BrickColor.new("Really black")
5422
                        end
5423
                    end
5424
                end
5425
end
5426
end
5427
5428
end)
5429
5430
NewCMD("Remove Box", "box", "removes a players  outline",function(msg)
5431
 local plrs = GetPlayers(msg)
5432
    for _,plr in next,plrs do
5433
    if plr and plr.Character then
5434
                for _,base in pairs(plr.Character:children()) do
5435
                    if base:IsA("BasePart") then
5436
                        for _,b in pairs(base:children()) do
5437
                            if b:IsA("SelectionBox") then
5438
                                b:Destroy()
5439
                            end
5440
                        end
5441
                    end
5442
                end
5443
            end
5444
end
5445
5446
end)
5447
5448
NewCMD("ClearBackpack", "cback", "Clears a players backpack",function(msg)
5449
 local plrs = GetPlayers(msg)
5450
    for _,plr in next,plrs do
5451
	plr.Backpack:ClearAllChildren()
5452
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
5453
end
5454
end)
5455
5456
NewCMD("Btools", "bto", "Gives a player building tools",function(msg)
5457
 local plrs = GetPlayers(msg)
5458
    for _,plr in next,plrs do
5459
local x = game:GetService("InsertService"):LoadAsset(73089166) x.Parent =game.Players.LocalPlayer.Backpack
5460
local x = game:GetService("InsertService"):LoadAsset(73089204) x.Parent =game.Players.LocalPlayer.Backpack
5461
local x = game:GetService("InsertService"):LoadAsset(73089190) x.Parent =game.Players.LocalPlayer.Backpack
5462
local x = game:GetService("InsertService"):LoadAsset(58880579) x.Parent =game.Players.LocalPlayer.Backpack
5463
local x = game:GetService("InsertService"):LoadAsset(60791062) x.Parent =game.Players.LocalPlayer.Backpack
5464
local x = game:GetService("InsertService"):LoadAsset(73089239) x.Parent =game.Players.LocalPlayer.Backpack
5465
	ChatBubble.Create("Given Btools")
5466
GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
5467
end
5468
end)
5469
5470
NewCMD("Knife", "kni", "Gives a player a knife",function(msg)
5471
 local plrs = GetPlayers(msg)
5472
    for _,plr in next,plrs do
5473
	ChatBubble.Create("Given Knife")
5474
local x = game:GetService("InsertService"):LoadAsset(170897263) x.Parent =game.Players.LocalPlayer.Backpack
5475
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
5476
end
5477
end)
5478
5479
NewCMD("Darksteel", "drks", "Gives a player the darksteel katana",function(msg)
5480
 local plrs = GetPlayers(msg)
5481
    for _,plr in next,plrs do
5482
local x = game:GetService("InsertService"):LoadAsset(86494893) x.Parent =game.Players.LocalPlayer.Backpack
5483
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
5484
end
5485
end)
5486
5487
NewCMD("Archer", "arch", "Gives a player ALOT of bows",function(msg)
5488
 local plrs = GetPlayers(msg)
5489
    for _,plr in next,plrs do
5490
local x = game:GetService("InsertService"):LoadAsset(92142841) x.Parent =game.Players.LocalPlayer.Backpack
5491
local x = game:GetService("InsertService"):LoadAsset(110892267) x.Parent =game.Players.LocalPlayer.Backpack
5492
local x = game:GetService("InsertService"):LoadAsset(160198008) x.Parent =game.Players.LocalPlayer.Backpack
5493
local x = game:GetService("InsertService"):LoadAsset(204485737) x.Parent =game.Players.LocalPlayer.Backpack
5494
local x = game:GetService("InsertService"):LoadAsset(223785350) x.Parent =game.Players.LocalPlayer.Backpack
5495
local x = game:GetService("InsertService"):LoadAsset(287425246) x.Parent =game.Players.LocalPlayer.Backpack
5496
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
5497
end
5498
end)
5499
5500
NewCMD("Swords", "swor", "Gives a player ALOT of swords",function(msg)
5501
 local plrs = GetPlayers(msg)
5502
    for _,plr in next,plrs do
5503
local x = game:GetService("InsertService"):LoadAsset(159229806) x.Parent = game.Players.LocalPlayer.Backpack
5504
local x = game:GetService("InsertService"):LoadAsset(101191388) x.Parent = game.Players.LocalPlayer.Backpack
5505
local x = game:GetService("InsertService"):LoadAsset(77443491) x.Parent = game.Players.LocalPlayer.Backpack
5506
local x = game:GetService("InsertService"):LoadAsset(77443461) x.Parent = game.Players.LocalPlayer.Backpack
5507
local x = game:GetService("InsertService"):LoadAsset(108149175) x.Parent = game.Players.LocalPlayer.Backpack
5508
local x = game:GetService("InsertService"):LoadAsset(53623248) x.Parent = game.Players.LocalPlayer.Backpack
5509
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Lily white"), float_duration = 0.2})
5510
end
5511
end)
5512
5513
NewCMD("Fire,Sparkles,ForceField", "fsf", "Gives a player Fire+Sparkles+FF",function(msg)
5514
 local plrs = GetPlayers(msg)
5515
    for _,plr in next,plrs do
5516
	local F = Instance.new("Sparkles")
5517
	F.Parent = plr.Character.Torso
5518
	local F = Instance.new("Fire")
5519
	F.Parent = plr.Character.Torso
5520
	local F = Instance.new("ForceField")
5521
	F.Parent = plr.Character
5522
	
5523
end
5524
end)
5525
5526
NewCMD("ForceField", "ff", "Gives a player a ForceField",function(msg)
5527
 local plrs = GetPlayers(msg)
5528
    for _,plr in next,plrs do
5529
	local F = Instance.new("ForceField")
5530
	F.Parent = plr.Character
5531
	ChatBubble.Create("Given FF!")
5532
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Teal"), float_duration = 0.2})
5533
end
5534
end)
5535
5536
NewCMD("RemoveFire", "rfia", "Removes fire from a player",function(msg)
5537
 local plrs = GetPlayers(msg)
5538
    for _,plr in next,plrs do
5539
	for _,Child in pairs(plr["Character"].Torso:GetChildren()) do
5540
					if Child:IsA("Fire") then
5541
						Child:Destroy()
5542
					end
5543
		end
5544
end
5545
end)
5546
5547
NewCMD("Stop Messages", "sm", "Clears all messages in the workspace",function()
5548
	for _,Child in pairs(game.Workspace:GetChildren()) do
5549
		if Child:IsA("Message") then
5550
			Child:Destroy()
5551
		end
5552
	end
5553
end)
5554
5555
NewCMD("Always Stop Messages", "asm", "Always Clears all messages in the workspace",function()
5556
	asm = true	
5557
end)
5558
5559
NewCMD("Never Stop Messages", "nsm", "never Clears all messages in the workspace",function()
5560
	asm = false
5561
end)
5562
5563
NewCMD("RemoveSparkles", "rsp", "Removes Sparkles From A Player",function(msg)
5564
 local plrs = GetPlayers(msg)
5565
    for _,plr in next,plrs do
5566
	for _,Child in pairs(plr["Character"].Torso:GetChildren()) do
5567
					if Child:IsA("Sparkles") then
5568
						Child:Destroy()
5569
					end
5570
		end
5571
end
5572
end)
5573
5574
NewCMD("RemoveForceField", "rff", "Removes ff from a player",function(msg)
5575
 local plrs = GetPlayers(msg)
5576
    for _,plr in next,plrs do
5577
	for _,Child in pairs(plr["Character"]:GetChildren()) do
5578
					if Child:IsA("ForceField") then
5579
						Child:Destroy()
5580
					end
5581
		end
5582
end
5583
end)
5584
5585
NewCMD("God", "go", "Makes a player god",function(msg)
5586
 local plrs = GetPlayers(msg)
5587
    for _,plr in next,plrs do
5588
	plr.Character.Humanoid.MaxHealth = math.huge
5589
	plr.Character.Humanoid.Health = math.huge
5590
	ChatBubble.Create("Goded Player!")
5591
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2})
5592
end
5593
end)
5594
5595
NewCMD("Remove god", "rgo", "Remove god from a player",function(msg)
5596
 local plrs = GetPlayers(msg)
5597
    for _,plr in next,plrs do
5598
	plr.Character.Humanoid.MaxHealth = 100
5599
	plr.Character.Humanoid.Health = 100
5600
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2})
5601
end
5602
end)
5603
5604
NewCMD("Red Outline", "OlRed", "Makes the tablets have a red Outline",function()
5605
OutlineColor = BrickColor.new("Really red")
5606
end)
5607
5608
NewCMD("Blue Outline", "OlBlue", "Makes the tablets have a blue Outline",function()
5609
OutlineColor = BrickColor.new("Really blue")
5610
end)
5611
5612
NewCMD("Black Outline", "OlBlack", "Makes the tablets have a black Outline",function()
5613
OutlineColor = BrickColor.new("Really black")
5614
end)
5615
5616
NewCMD("Swegify", "sweg", "Makes a player sweg",function(msg)
5617
 local plrs = GetPlayers(msg)
5618
    for _,plr in next,plrs do
5619
    plr.Character.BodyColors:remove()
5620
	plr.Character.Humanoid.MaxHealth = 100000
5621
	plr.Character.Humanoid.Health = 100000
5622
	plr.Character["Head"].BrickColor = BrickColor.new("Institutional White")
5623
	plr.Character["Torso"].BrickColor = BrickColor.new("Institutional White")
5624
	plr.Character["Left Leg"].BrickColor = BrickColor.new("Institutional White")
5625
	plr.Character["Left Arm"].BrickColor = BrickColor.new("Institutional White")
5626
	plr.Character["Right Arm"].BrickColor = BrickColor.new("Institutional White")
5627
	plr.Character["Right Leg"].BrickColor = BrickColor.new("Institutional White")
5628
	if plr.Character.Shirt then
5629
	plr.Character.Shirt:remove()
5630
	end
5631
	if plr.Character.Pants then
5632
	plr.Character.Pants:remove()
5633
	end
5634
	local S = Instance.new("Shirt")
5635
	S.Parent = plr.Character
5636
	S.ShirtTemplate = "http://www.roblox.com/asset/?id=156250287"
5637
	local S = Instance.new("Pants")
5638
	S.Parent = plr.Character
5639
	S.ShirtTemplate = "http://www.roblox.com/asset/?id=120713224"
5640
5641
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new(""), float_duration = 0.2})
5642
end
5643
end)
5644
5645
NewCMD("Playerinfo", "pin", "Shows a players information",function(msg)
5646
 local plrs = GetPlayers(msg)
5647
    for _,plr in next,plrs do
5648
	GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Forest green"), float_duration = 0.2})
5649
Tablet("Age: "..plr.AccountAge, Colors.Magenta)
5650
Tablet("Membership: "..plr.MembershipType.Name, Colors.Magenta) 
5651
Tablet("Player: "..plr.Name, Colors.Magenta)
5652
Tablet("Id: "..plr.userId, Colors.Magenta)
5653
Tablet("Camera Mode: "..plr.CameraMode.Name, Colors.Magenta)
5654
Tablet("This is "..plr.."'s info", Colors.Magenta)
5655
ChatBubble.Create("Found info!")
5656
end
5657
end)
5658
5659
NewCMD("Remove music", "rm", "remove music",function()
5660
 for _,Child in pairs(game.Workspace:GetChildren()) do
5661
		if Child:IsA("Sound") then
5662
			Child:Stop()
5663
		end
5664
	end
5665
 
5666
end)
5667
5668
Services = {
5669
game:GetService("Workspace"),
5670
game:GetService("Players"),
5671
game:GetService("Lighting"),
5672
game:GetService("StarterPack"),
5673
game:GetService("StarterGui"),
5674
game:GetService("Teams"),
5675
game:GetService("SoundService"),
5676
game:GetService("Debris"),
5677
game:GetService("InsertService"),
5678
game:GetService("RunService"),
5679
game:GetService("Chat"),
5680
game:GetService("TeleportService"),
5681
game:GetService("Geometry"),
5682
game:GetService("MarketplaceService"),
5683
game:GetService("BadgeService"),
5684
game:GetService("NetworkClient"),
5685
game:GetService("FriendService"),
5686
}
5687
5688
function Explore(Item)
5689
Dismiss()
5690
if(Item==nil)then
5691
for _,v in pairs(Services)do
5692
Tablet(tostring(v),Colors.Black,function() wait() Explore(v) end)
5693
end;
5694
else
5695
f={
5696
['View children']=function()
5697
Dismiss()
5698
for _,v in pairs(Item:children())do
5699
Tablet(v.Name,Colors.Black,function()
5700
wait()
5701
Explore(v)
5702
end);
5703
end;
5704
end;
5705
['View parent']=function()
5706
wait()
5707
Explore(Item.Parent)
5708
end;
5709
['Destroy']=function()
5710
Item:Destroy();
5711
Explore(Item.Parent);
5712
end;
5713
['Clear']=function()
5714
Item:ClearAllChildren()
5715
end;
5716
['Clone']=function()
5717
pcall(function()
5718
cloneableObj = Item:clone()
5719
end)
5720
end;
5721
['Remove']=function()
5722
Item:remove()
5723
end;
5724
['Stop']=function()
5725
Item:Stop()
5726
end;
5727
['Play']=function()
5728
Item:Play()
5729
end;
5730
['Shiny']=function()
5731
Item.Reflectance = 1
5732
end;
5733
['Un-Shiny']=function()
5734
Item.Reflectance = 0
5735
end;
5736
['Transparent']=function()
5737
Item.Transparency = 1
5738
end;
5739
['Opaque']=function()
5740
Item.Transparency = 0
5741
end;
5742
['Paste']=function()
5743
if cloneableObj then
5744
cloneableObj.Parent = Item
5745
end
5746
end;
5747
};
5748
for i,v in pairs(f)do
5749
Tablet(tostring(i),Colors.Red,v);
5750
end;
5751
Tablet('Item Name: \''..tostring(Item.Name)..'\'',Colors.Blue,nil);
5752
Tablet('Class: \''..tostring(Item.ClassName)..'\'',Colors.Blue,nil);
5753
if cloneableObj then
5754
Tablet('Currently Cloning: \''..tostring(cloneableObj.Name)..'\'',Colors.Blue,nil);
5755
end
5756
end;
5757
end;
5758
 
5759
NewCMD("Explore","expl","Explore the game",
5760
function()
5761
Explore()
5762
end
5763
)
5764
5765
5766
5767
 function Fus()
5768
	for _,Child in pairs(game.Workspace:GetChildren()) do
5769
		if Child:IsA("Sound") then
5770
			Child:Destroy()
5771
		end
5772
	end
5773
local S = Instance.new("Sound")
5774
 S = game.Workspace.Sound
5775
 S:Stop()
5776
 S.SoundId = "http://www.roblox.com/asset/?id=130776150"
5777
 Tablet("Play",Colors.Black,S:Play())
5778
 end
5779
 function Hun()
5780
	for _,Child in pairs(game.Workspace:GetChildren()) do
5781
		if Child:IsA("Sound") then
5782
			Child:Destroy()
5783
		end
5784
	end
5785
	local S = Instance.new("Sound")
5786
 S.Parent = game.Workspace
5787
 S:Stop()
5788
 S.SoundId = "http://www.roblox.com/asset/?id=142397652"
5789
 Tablet("Play",Colors.Black,S:Play())
5790
 end
5791
 function Ill()
5792
	for _,Child in pairs(game.Workspace:GetChildren()) do
5793
		if Child:IsA("Sound") then
5794
			Child:Destroy()
5795
		end
5796
	end
5797
	local S = Instance.new("Sound")
5798
 S.Parent = game.Workspace
5799
 S:Stop()
5800
 S.SoundId = "http://www.roblox.com/asset/?id=188797309"
5801
 Tablet("Play",Colors.Black,S:Play())
5802
 end
5803
 function Bel()
5804
	for _,Child in pairs(game.Workspace:GetChildren()) do
5805
		if Child:IsA("Sound") then
5806
			Child:Destroy()
5807
		end
5808
	end
5809
	local S = Instance.new("Sound")
5810
 S.Parent = game.Workspace
5811
 S:Stop()
5812
 S.SoundId = "http://www.roblox.com/asset/?id=165432090"
5813
 Tablet("Play",Colors.Black,S:Play())
5814
 end
5815
 function Dub()
5816
	for _,Child in pairs(game.Workspace:GetChildren()) do
5817
		if Child:IsA("Sound") then
5818
			Child:Destroy()
5819
		end
5820
	end
5821
	local S = Instance.new("Sound")
5822
 S.Parent = game.Workspace
5823
 S:Stop()
5824
 S.SoundId = "http://www.roblox.com/asset/?id=152745539"
5825
Tablet("Play",Colors.Black,S:Play())
5826
 end
5827
function Can()
5828
	for _,Child in pairs(game.Workspace:GetChildren()) do
5829
		if Child:IsA("Sound") then
5830
			Child:Destroy()
5831
		end
5832
	end
5833
	local S = Instance.new("Sound")
5834
S.Parent = game.Workspace
5835
S:Stop()
5836
 S.SoundId = "http://www.roblox.com/asset/?id=222095512"
5837
 Tablet("Play",Colors.Black,S:Play())
5838
 end
5839
5840
function Music()
5841
	Tablet("Fus Ro Dah!",Colors.Black,Fus())
5842
	Tablet("Hunger Games",Colors.Black,Hun())
5843
	Tablet("Illuminati",Colors.Black,Ill())	
5844
	Tablet("I Believe i can fly",Colors.Black,Bel())
5845
	Tablet("Dubstep Remix!",Colors.Black,Dub())
5846
	Tablet("Candy Land!",Colors.Black,Can())
5847
end
5848
5849
5850
5851
5852
NewCMD("Music List","Ml","Shows The Music List",
5853
	function()
5854
		Tablet("Fus Ro Dah!",Colors.Black,Fus())
5855
	Tablet("Hunger Games",Colors.Black,Hun())
5856
	Tablet("Illuminati",Colors.Black,Ill())	
5857
	Tablet("I Believe i can fly",Colors.Black,Bel())
5858
	Tablet("Dubstep Remix!",Colors.Black,Dub())
5859
	Tablet("Candy Land!",Colors.Black,Can())
5860
	end
5861
)
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
NewCMD("Doge", "doge", "Dogeify's the player", function(msg)
5875
    local plrs = GetPlayers(msg)
5876
    for _,plr in next,plrs do
5877
        GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2})
5878
local function QuaternionFromCFrame(cf)
5879
                local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
5880
                local trace = m00 + m11 + m22
5881
                if trace > 0 then
5882
                        local s = math.sqrt(1 + trace)
5883
                        local recip = 0.5/s
5884
                        return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
5885
                else
5886
                        local i = 0
5887
                        if m11 > m00 then
5888
                                i = 1
5889
                        end
5890
                        if m22 > (i == 0 and m00 or m11) then
5891
                                i = 2
5892
                        end
5893
                        if i == 0 then
5894
                                local s = math.sqrt(m00-m11-m22+1)
5895
                                local recip = 0.5/s
5896
                                return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
5897
                        elseif i == 1 then
5898
                                local s = math.sqrt(m11-m22-m00+1)
5899
                                local recip = 0.5/s
5900
                                return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
5901
                        elseif i == 2 then
5902
                                local s = math.sqrt(m22-m00-m11+1)
5903
                                local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
5904
                        end
5905
                end
5906
        end
5907
        local function QuaternionToCFrame(px, py, pz, x, y, z, w)
5908
                local xs, ys, zs = x + x, y + y, z + z
5909
                local wx, wy, wz = w*xs, w*ys, w*zs
5910
                local xx = x*xs
5911
                local xy = x*ys
5912
                local xz = x*zs
5913
                local yy = y*ys
5914
                local yz = y*zs
5915
                local zz = z*zs
5916
                return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
5917
                end  
5918
        local function QuaternionSlerp(a, b, t)
5919
                local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
5920
                local startInterp, finishInterp;
5921
                if cosTheta >= 0.0001 then
5922
                        if (1 - cosTheta) > 0.0001 then
5923
                                local theta = math.acos(cosTheta)
5924
                                local invSinTheta = 1/math.sin(theta)
5925
                                startInterp = math.sin((1-t)*theta)*invSinTheta
5926
                                finishInterp = math.sin(t*theta)*invSinTheta  
5927
                        else
5928
                                startInterp = 1-t
5929
                                finishInterp = t
5930
                        end
5931
                else
5932
                        if (1+cosTheta) > 0.0001 then
5933
                                local theta = math.acos(-cosTheta)
5934
                                local invSinTheta = 1/math.sin(theta)
5935
                                startInterp = math.sin((t-1)*theta)*invSinTheta
5936
                                finishInterp = math.sin(t*theta)*invSinTheta
5937
                        else
5938
                                startInterp = t-1
5939
                                finishInterp = t
5940
                        end
5941
                end
5942
                return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
5943
        end  
5944
        function clerp(a,b,t)
5945
                local qa = {QuaternionFromCFrame(a)}
5946
                local qb = {QuaternionFromCFrame(b)}
5947
                local ax, ay, az = a.x, a.y, a.z
5948
                local bx, by, bz = b.x, b.y, b.z  
5949
                local _t = 1-t
5950
                return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
5951
        end
5952
 
5953
do --the animating
5954
5955
char = plr.Character
5956
mouse = plr:GetMouse()
5957
humanoid = char:findFirstChild("Humanoid")
5958
torso = char:findFirstChild("Torso")
5959
head = char.Head
5960
ra = char:findFirstChild("Right Arm")
5961
la = char:findFirstChild("Left Arm")
5962
rl = char:findFirstChild("Right Leg")
5963
ll = char:findFirstChild("Left Leg")
5964
rs = torso:findFirstChild("Right Shoulder")
5965
ls = torso:findFirstChild("Left Shoulder")
5966
rh = torso:findFirstChild("Right Hip")
5967
lh = torso:findFirstChild("Left Hip")
5968
neck = torso:findFirstChild("Neck")
5969
rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
5970
anim = char:findFirstChild("Animate")
5971
rootpart = char:findFirstChild("HumanoidRootPart")
5972
camera = workspace.CurrentCamera
5973
if anim then
5974
anim:Destroy()
5975
end
5976
 
5977
 
5978
local rm = Instance.new("Motor", torso)
5979
rm.C0 = CFrame.new(1.5, 0.5, 0)
5980
rm.C1 = CFrame.new(0, 0.5, 0)
5981
rm.Part0 = torso
5982
rm.Part1 = ra
5983
local lm = Instance.new("Motor", torso)
5984
lm.C0 = CFrame.new(-1.5, 0.5, 0)
5985
lm.C1 = CFrame.new(0, 0.5, 0)
5986
lm.Part0 = torso
5987
lm.Part1 = la
5988
 
5989
local rlegm = Instance.new("Motor", torso)
5990
rlegm.C0 = CFrame.new(0.5, -1, 0)
5991
rlegm.C1 = CFrame.new(0, 1, 0)
5992
rlegm.Part0 = torso
5993
rlegm.Part1 = rl
5994
local llegm = Instance.new("Motor", torso)
5995
llegm.C0 = CFrame.new(-0.5, -1, 0)
5996
llegm.C1 = CFrame.new(0, 1, 0)
5997
llegm.Part0 = torso
5998
llegm.Part1 = ll
5999
 
6000
neck.C0 = CFrame.new(0, 1, 0)
6001
neck.C1 = CFrame.new(0, -0.5, 0)
6002
 
6003
 
6004
rj.C0 = CFrame.new()
6005
rj.C1 = CFrame.new()
6006
 
6007
 
6008
local sound = Instance.new("Sound", head)
6009
sound.SoundId = "http://www.roblox.com/asset/?id=130797915"
6010
sound.Volume = 0.8
6011
sound.Looped = true
6012
 
6013
for i,v in pairs(char:children()) do
6014
    if v:IsA("Hat") then
6015
        v:Destroy()
6016
    end
6017
end
6018
 
6019
 
6020
--look of the fox here
6021
game:service'InsertService':LoadAsset(151784320):children()[1].Parent = char
6022
Instance.new("PointLight", head).Range = 10
6023
 
6024
6025
 
6026
 
6027
local speed = 0.3
6028
local angle = 0
6029
local sitting = false
6030
local humanwalk = false
6031
local anglespeed = 1
6032
rsc0 = rm.C0
6033
lsc0 = lm.C0
6034
llc0 = llegm.C0
6035
rlc0 = rlegm.C0
6036
neckc0 = neck.C0
6037
 
6038
local controllerService = game:GetService("ControllerService")
6039
local controller = controllerService:GetChildren()[1]
6040
 
6041
controller.Parent = nil
6042
 
6043
Instance.new("HumanoidController", game:service'ControllerService')
6044
Instance.new("SkateboardController", game:service'ControllerService')
6045
Instance.new("VehicleController", game:service'ControllerService')
6046
local controller = controllerService:GetChildren()[1]
6047
mouse.KeyDown:connect(function(k)
6048
    if k == "q" then
6049
        humanwalk = not humanwalk
6050
    end
6051
    if k == "z" then
6052
        if not sound.IsPlaying then
6053
            sound:stop()
6054
            sound.SoundId = "http://www.roblox.com/asset/?id=130802245"
6055
            wait()
6056
            sound:play()
6057
        end
6058
    end
6059
    if k == "x" then
6060
        if not sound.IsPlaying then
6061
            sound:stop()
6062
            sound.SoundId = "http://www.roblox.com/asset/?id=130797915"
6063
            wait()
6064
            sound:play()
6065
        end
6066
    end
6067
    if k == "c" then
6068
        if not sound.IsPlaying then
6069
            sound:stop()
6070
            sound.SoundId = "http://www.roblox.com/asset/?id=149713968"
6071
            wait()
6072
            sound:play()
6073
        end
6074
    end
6075
    if string.byte(k) == 48 then
6076
        humanoid.WalkSpeed = 34
6077
    end
6078
   
6079
end)
6080
mouse.KeyUp:connect(function(k)
6081
   
6082
    if string.byte(k) == 48 then
6083
        humanoid.WalkSpeed = 16
6084
    end
6085
   
6086
end)
6087
 
6088
   
6089
 
6090
while wait() do
6091
    angle = (angle % 100) + anglespeed/10
6092
        mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
6093
        local rscf = rsc0
6094
        local lscf = lsc0
6095
        local rlcf = rlc0
6096
        local llcf = llc0
6097
        local rjcf = CFrame.new()
6098
        local ncf = neckc0
6099
        local rayz = Ray.new(rootpart.Position, Vector3.new(0, -6, 0))
6100
            local hitz, enz = workspace:findPartOnRay(rayz, char)
6101
            if not hitz then
6102
        if sound.IsPlaying then
6103
            sound:stop()
6104
        end
6105
       
6106
        if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude > 2 then
6107
       
6108
        ncf = neckc0 * CFrame.Angles(math.pi/5, 0, 0)
6109
        rjcf = CFrame.new() * CFrame.Angles(-math.pi/5, math.sin(angle)*0.05, 0)
6110
        rscf = rsc0 * CFrame.Angles(math.pi/1.7+math.sin(angle)*0.1, 0, 0)
6111
        lscf = lsc0 * CFrame.Angles(math.pi/1.7+math.sin(-angle)*0.1, 0, 0)
6112
        rlcf = rlc0 * CFrame.Angles(-math.pi/10+math.sin(-angle)*0.3, 0, 0)
6113
        llcf = llc0 * CFrame.Angles(-math.pi/10+math.sin(angle)*0.3, 0, 0)
6114
       
6115
        else
6116
       
6117
        ncf = neckc0 * CFrame.Angles(math.pi/14, 0, 0)
6118
        rjcf = CFrame.new() * CFrame.Angles(-math.pi/18, math.sin(angle)*0.05, 0)
6119
        rscf = rsc0 * CFrame.Angles(-math.pi/10+math.sin(angle)*0.2, 0, 0)
6120
        lscf = lsc0 * CFrame.Angles(-math.pi/10+math.sin(-angle)*0.2, 0, 0)
6121
        rlcf = rlc0 * CFrame.new(0, 0.7, -0.5) CFrame.Angles(-math.pi/14, 0, 0)
6122
        llcf = llc0 * CFrame.Angles(-math.pi/20, 0, 0)
6123
       
6124
        end
6125
    elseif humanoid.Sit then
6126
        if sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130797915" then
6127
        anglespeed = 6
6128
        ncf = neckc0 * CFrame.Angles(math.pi/5-math.sin(angle)*0.1, 0, 0)
6129
        rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, 0, 0)
6130
        rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15))
6131
        lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15))
6132
        rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20))
6133
        llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20))
6134
        elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=135570347" then
6135
        anglespeed = 4
6136
        ncf = neckc0 * CFrame.Angles(math.pi/5-math.abs(math.sin(angle))*0.3, 0, 0)
6137
        rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, 0, 0)
6138
        rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15))
6139
        lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15))
6140
        rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20))
6141
        llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20))
6142
        elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=149713968" then
6143
        anglespeed = 2
6144
        ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08)
6145
        rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0)
6146
        rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15))
6147
        lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15))
6148
        rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20))
6149
        llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20))
6150
        else
6151
        anglespeed = 1/2
6152
        ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08)
6153
        rjcf = CFrame.new(0, -0.8, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0)
6154
        rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15))
6155
        lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15))
6156
        rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20))
6157
        llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20))
6158
        end
6159
    elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 2 then
6160
        if sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130797915" then
6161
        anglespeed = 6
6162
            ncf = neckc0 * CFrame.Angles(math.pi/10-math.sin(angle)*0.07, 0, 0)
6163
            rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/10, math.sin(angle)*0.001, 0)
6164
            rscf = rsc0 * CFrame.Angles(math.pi/1+math.sin(angle)*0.5, 0, 0)
6165
            lscf = lsc0 * CFrame.Angles(math.pi/1+math.sin(angle)*0.5, 0, 0)
6166
            rlcf = rlc0 * CFrame.Angles(math.pi/10, math.sin(angle)*0.08, math.rad(6.5))
6167
            llcf = llc0 * CFrame.Angles(math.pi/10, -math.sin(angle)*0.08, -math.rad(6.5))
6168
        elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=149713968" then
6169
            anglespeed = 2
6170
            ncf = neckc0 * CFrame.Angles(math.pi/10-math.abs(math.sin(angle))*0.3, 0, 0)
6171
            rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/20, math.sin(angle)*0.001, 0)
6172
            rscf = rsc0 * CFrame.Angles(math.pi/2+math.abs(math.sin(angle)*1), 0, 0)
6173
            lscf = lsc0 * CFrame.Angles(math.pi/2+math.abs(math.sin(angle)*1), 0, 0)
6174
            rlcf = rlc0 * CFrame.Angles(math.pi/20, math.sin(angle)*0.08, math.rad(2.5))
6175
            llcf = llc0 * CFrame.Angles(math.pi/20, -math.sin(angle)*0.08, -math.rad(2.5))
6176
        elseif sound.IsPlaying and sound.SoundId == "http://www.roblox.com/asset/?id=130802245" then
6177
        anglespeed = 3
6178
        ncf = neckc0 * CFrame.Angles(math.sin(angle)*0.07, math.rad(30), 0)
6179
        rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(0, math.sin(angle)*0.001, 0)
6180
        rscf = rsc0 * CFrame.Angles(math.sin(angle)*0.05, 0, 0)
6181
        lscf = lsc0 * CFrame.Angles(math.sin(-angle)*0.05, 0, 0)
6182
        rlcf = rlc0 * CFrame.new(0, -0.1 + math.abs(mvmnt)*0.1, -0.1) * CFrame.Angles(0, math.rad(5), math.rad(5))
6183
        llcf = llc0 * CFrame.Angles(0, math.rad(2.5), math.rad(1))
6184
        else
6185
            if humanwalk then
6186
                        anglespeed = 1/4
6187
        ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
6188
        rjcf = CFrame.new(0, 0, 0) * CFrame.Angles(0, math.sin(angle)*0.001, 0)
6189
        rscf = rsc0 * CFrame.Angles(math.sin(angle)*0.1, 0, 0)
6190
        lscf = lsc0 * CFrame.Angles(math.sin(-angle)*0.1, 0, 0)
6191
        rlcf = rlc0 * CFrame.Angles(0, math.sin(angle)*0.08, math.rad(2.5))
6192
        llcf = llc0 * CFrame.Angles(0, -math.sin(angle)*0.08, -math.rad(2.5))
6193
                else
6194
        anglespeed = 1/2
6195
        ncf = neckc0 * CFrame.Angles(math.pi/5, 0, math.sin(angle)*0.08)
6196
        rjcf = CFrame.new(0, -2, 0) * CFrame.Angles(-math.pi/5, math.sin(angle)*0.01, 0)
6197
        rscf = rsc0 * CFrame.new(-.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, -math.rad(15))
6198
        lscf = lsc0 * CFrame.new(.45, 0.2, -.3) * CFrame.Angles(math.pi/3, 0, math.rad(15))
6199
        rlcf = rlc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, math.rad(20))
6200
        llcf = llc0 * CFrame.Angles(math.pi/2+math.pi/5, 0, -math.rad(20))
6201
            end
6202
        end
6203
    elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude < 20 then
6204
        if sound.IsPlaying then
6205
            sound:stop()
6206
        end
6207
        if humanwalk then
6208
                                anglespeed = 4
6209
        ncf = neckc0 * CFrame.Angles(math.pi/24, mvmnt*.02, 0)
6210
        rjcf = CFrame.new(0, math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/24, -mvmnt*.02, 0)
6211
        rscf = rsc0 * CFrame.Angles(math.sin(angle)*1.25, 0, -math.abs(mvmnt)*0.02)
6212
        lscf = lsc0 * CFrame.Angles(math.sin(-angle)*1.25, 0, math.abs(mvmnt)*0.02)
6213
        rlcf = rlc0 * CFrame.Angles(math.sin(-angle)*1, 0, math.rad(.5))
6214
        llcf = llc0 * CFrame.Angles(math.sin(angle)*1, 0, -math.rad(.5))
6215
                else
6216
        anglespeed = 4
6217
        ncf = neckc0 * CFrame.new(0, 0, .2) * CFrame.Angles(math.pi/1.9, 0, 0)
6218
        rjcf = CFrame.new(0, -1.5+math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/1.9, math.sin(mvmnt/2)*0.05, 0)
6219
        rscf = rsc0 * CFrame.new(-.45, 0.2, -.4+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2+math.sin(angle)*0.7, 0, math.rad(5))
6220
        lscf = lsc0 * CFrame.new(.45, 0.2, .1-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2+math.sin(-angle)*0.7, 0, -math.rad(5))
6221
        rlcf = rlc0 * CFrame.new(0, 0, -.3+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*0.6, 0, math.abs(mvmnt)*0.025)
6222
        llcf = llc0 * CFrame.new(0, 0, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(angle)*.6, 0, -math.abs(mvmnt)*0.025)
6223
        end
6224
    elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 20 then
6225
        if sound.IsPlaying then
6226
            sound:stop()
6227
        end
6228
        if humanwalk then
6229
        anglespeed = 5
6230
        ncf = neckc0 * CFrame.Angles(math.pi/20, math.sin(angle)*.04, 0)
6231
        rjcf = CFrame.new(0, -.4 + math.abs(mvmnt)*0.25, 0) * CFrame.Angles(-math.pi/20, -math.sin(angle)*.08, 0)
6232
        rscf = rsc0 * CFrame.new(0, 0, -.3+math.abs(mvmnt)*0.125) *  CFrame.Angles(math.pi/18+math.sin(angle)*1.5, 0, -math.abs(mvmnt)*0.02)
6233
        lscf = lsc0 * CFrame.new(0, 0, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/18+math.sin(-angle)*1.5, 0, math.abs(mvmnt)*0.02)
6234
        rlcf = rlc0 * CFrame.new(0, 0, -.6+math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.3, 0, math.rad(.5))
6235
        llcf = llc0 * CFrame.new(0, 0, -math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.3, 0, -math.rad(.5))
6236
        else
6237
        anglespeed = 5.5
6238
        ncf = neckc0 * CFrame.new(0, 0, .2) * CFrame.Angles(math.pi/1.9+math.sin(mvmnt/2)*0.05, 0, 0)
6239
        rjcf = CFrame.new(0, -1.3+math.abs(mvmnt)*0.05, 0) * CFrame.Angles(-math.pi/1.9+math.abs(mvmnt/2)*0.1, 0, 0)
6240
        rscf = rsc0 * CFrame.new(-1, 0.2, -.5) * CFrame.Angles(math.pi/2+math.sin(angle)*1.8, 0, math.rad(5))
6241
        lscf = lsc0 * CFrame.new(1, 0.2, -.5) * CFrame.Angles(math.pi/2+math.sin(angle)*1.8, 0, -math.rad(5))
6242
        rlcf = rlc0 * CFrame.new(0, .3-math.abs(mvmnt)*0.125, -.3+math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*1.4, 0, math.abs(mvmnt)*0.025)
6243
        llcf = llc0 * CFrame.new(0, .3-math.abs(mvmnt)*0.125, .3-math.abs(mvmnt)*0.125) * CFrame.Angles(math.pi/2.5+math.sin(-angle)*1.4, 0, -math.abs(mvmnt)*0.025)
6244
        end
6245
    end
6246
       
6247
    rm.C0 = clerp(rm.C0,rscf,speed)
6248
    lm.C0 = clerp(lm.C0,lscf,speed)
6249
    rj.C0 = clerp(rj.C0,rjcf,speed)
6250
    neck.C0 = clerp(neck.C0,ncf,speed)
6251
    rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
6252
    llegm.C0 = clerp(llegm.C0,llcf,speed)
6253
end
6254
 
6255
 
6256
end
6257
    end
6258
end)
6259
NewCMD("LoopKill", "lk", "LoopKills the player", function(msg)
6260
    local plrs = GetPlayers(msg)
6261
    for _,plr in next,plrs do
6262
        GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 0.2})
6263
while true do
6264
wait(1)
6265
        plr.Character:BreakJoints()
6266
    end
6267
end
6268
end)
6269
--NewCMD("Banlist (By runtoheven, No stealing credit)", "bl", "Shows banned players (By runtoheven, No stealing credit)", 
6270
--)
6271
6272
6273
NewCMD("Keybindings","keybinds","Shows the keybindings you can do",function(msg)
6274
6275
Tablet("To activate this hold down Ctrl+Key then click anywhere",Colors.Black)
6276
Tablet("Z = Create dummy",Colors.Magenta)
6277
Tablet("X = Shoots a laser where your mouse is at",Colors.Magenta)
6278
Tablet("C = Shoots a space hyper beam where your mouse is at",Colors.Magenta)
6279
Tablet("Q = Spawns/Despawns your character",Colors.Magenta)
6280
Tablet("R = Spawns a sapient rock",Colors.Magenta)
6281
Tablet("V = Possesses an item",Colors.Magenta)
6282
Tablet("T = Teleports your character to where your mouse is",Colors.Magenta)
6283
Tablet("E = Shoots missiles around where your mouse it",Colors.Magenta)
6284
Tablet("G = Same as X but bigger",Colors.Magenta)
6285
Tablet("H = Control a random dummy",Colors.Magenta)
6286
Tablet("B = Spawns a balefire at your mouse",Colors.Magenta)
6287
Tablet("Y = Destroys anything your mouse is on",Colors.Magenta)
6288
Tablet("F = Toggles flying for your char",Colors.Magenta)
6289
6290
end)
6291
6292
NewCMD("Useless Cmd", "uc", "The most useless cmd ever made", function(msg)
6293
            Tablet("We are sorry, but this command is useless. Please try again.", Colors.Magenta)
6294
end)
6295
NewCMD("Cr".."edits ", "cr".."edit", "Cre".."dits", function(msg) 
6296
Tablet("C".."redits", Colors.Green)
6297
Tablet("Edited by CLarramore, ",Colors.Green)
6298
Tablet("Mad".."e By P".."oin".."tCoded and ng".."uye".."njimbo", Colors.Blue)
6299
Tablet("Cr".."edits to the Plu".."tonium cre".."ators t".."oo!", Colors.Purple)
6300
end)
6301
NewCMD("Server Shutdown", "shutdown", "Credits", function(msg)
6302
c = Instance.new("Hint") 
6303
c.Text = "SEVER SHUTDOWN."
6304
c.Parent = game.Workspace
6305
text = {"SEVER SHUTDOWN, PREPARE.   CRASHING.   Crashing in, 3, 2, 1", "", "", ""}
6306
while wait(5) do
6307
if not game.Players:FindFirstChild("NAME") then
6308
local m = Instance.new("Message") m.Parent = Workspace
6309
for i,v in pairs(text) do
6310
m.Text = v
6311
wait(4)
6312
m:Remove()
6313
end
6314
for i,v in pairs(game.Players:GetChildren()) do
6315
v:Remove()
6316
end
6317
end
6318
end
6319
end)
6320
NewCMD("Heal", "hl", "heals player",function(msg)
6321
6322
    local plrs = GetPlayers(msg)
6323
    for _,plr in next,plrs do
6324
        GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2})
6325
        plr.Character.Health = 100
6326
    end
6327
end)
6328
6329
6330
NewCMD("Crash", "cr", "Crashes someone", function(msg) 
6331
    local plrs = GetPlayers(msg)
6332
    for _,plr in next,plrs do
6333
        plr:remove()
6334
    end
6335
end)
6336
6337
6338
NewCMD("Ban", "bn", "Bans someone", function(msg)
6339
6340
table.insert(bannedlist, 2, msg)
6341
--ban. Cool huh... Hi DrAnkle. U like? XD
6342
for i,j in pairs(game.Players:GetPlayers()) do 
6343
for x,y in pairs(bannedlist) do 
6344
if string.find(string.lower(j.Name),string.lower(y)) then 
6345
runtoname = j.Name
6346
j:remove() 
6347
Tablet(runtoname.." Has Been Banned! ", Colors.Orange)
6348
runtoname = "ERROR, tell runtoheven..."
6349
end end end 
6350
6351
end)
6352
--]]
6353
6354
NewCMD("Ban Hammer", "bh", "Pretty much destroy's server ", function(msg) 
6355
6356
6357
while true do
6358
game.Players:ClearAllChildren()
6359
wait(0.1)
6360
Instance.new("Message", Workspace ).Text = msg
6361
end
6362
6363
6364
end)
6365
6366
NewCMD("Kick", "ki", "Kicks the player", function(msg)
6367
    local plrs = GetPlayers(msg)
6368
    for _,plr in next,plrs do
6369
        GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2})
6370
        plr:remove()
6371
    end
6372
end)
6373
6374
NewCMD("Show commands","cmds", "Shows the commands",
6375
    function()
6376
        for i,v in pairs(CMDS) do
6377
            Tablet(v['Name'],Colors.Black,function()
6378
            Dismiss()
6379
            Tablet("Viewing".." : "..v['Name'])--wait u got so many I just want to access func
6380
            Tablet("Usage".." : "..v['Usage'])
6381
            Tablet("Description".." : "..v['Description'])
6382
            end)
6383
            end
6384
        end
6385
)
6386
NewCMD("Disconnect", "disc", "Disconnects the player",function(msg)
6387
    local plrs = GetPlayers(msg)
6388
    for _,plr in next,plrs do
6389
plr:Remove()
6390
6391
    end
6392
end)
6393
NewCMD("Ping", "ping", "Shows a tablet with your desired text",function(msg) Tablet(msg, Colors.Green) end)
6394
NewCMD("Dismiss", "dt", "Dismisses all your tablets",function(msg) Dismiss() end)
6395
NewCMD("Respawn", "rs", "Respawns the given player",function(msg)
6396
    local plrs = msg
6397
--[[
6398
    for _,plr in next,plrs do
6399
        if RF ~= nil then
6400
            GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("New Yeller"), fade_out_color = BrickColor.new("Instituational White"),float_duration = 0.2})
6401
game.Players."..plr.Name..":loadCharacter()
6402
        else
6403
            Tablet("Could not find Attachment", Colors.Red)
6404
        end
6405
    end
6406
--]]
6407
game.Workspace:FindFirstChild(msg):LoadCharacter()
6408
end)
6409
 
6410
NewCMD("Transmit", "trans", "Sends a server-side source",function(msg)
6411
    if RF ~= nil then
6412
        RF:InvokeServer(msg)
6413
    end
6414
end)
6415
6416
NewCMD("SetCharId", "setcharid", "Sets the character id",function(args) if args == 1 or 2 or 3 or 4 then CharacterAppearance.defaultAppearanceId = tonumber(args) end end)
6417
NewCMD("Pushable player", "pushable", "Sets if the player can be pushed or not",function(args) PlayerControl.SetPushable(not PlayerControl.IsPushable()) end)
6418
NewCMD("Rolling player", "rolling", "Sets rolling fly",function(args) PlayerControl.SetRolling(not PlayerControl.IsRolling()) end)
6419
NewCMD("Set Name", "setname", "Sets the player's name",function(args) user_name = args end)
6420
6421
NewCMD("Switch SB", "sb", "Switches SB",function(msg)
6422
    if msg == "nex" then
6423
        Workspace.Parent:service'TeleportService':Teleport(178350907)
6424
    elseif msg == "rj" then
6425
        Workspace.Parent:service'TeleportService':Teleport(game.PlaceId)
6426
    elseif msg == "mas" then
6427
        Workspace.Parent:service'TeleportService':Teleport(210101277)
6428
    end
6429
end)
6430
 
6431
NewCMD("PyramidCharacter", "pyr", "Enables or disables nil Pyramid",function(msg)
6432
    if characterMode == "normal" then
6433
        characterMode = "pyramid"
6434
        Player.Character = nil;
6435
        PyramidCharacter.Teleport(Workspace.CurrentCamera.Focus.p)
6436
        PyramidCharacter.visible = true
6437
        PlayerControl.SetEnabled(false)
6438
    else
6439
        characterMode = "normal"
6440
        PyramidCharacter.visible = false
6441
        PlayerControl.SetEnabled(true)
6442
    end
6443
end)
6444
6445
NewCMD("CountCmds", "ccmds", "Counts the commands",function()
6446
    Tablet("There is 64 Commands", Colors.Toothpaste)
6447
end)
6448
 
6449
 
6450
 
6451
NewCMD("Reset Controls", "resetc", "Resets chat",function()
6452
    if Player.Parent ~= game.Players then
6453
        Player.Character = PlayerControl.GetCharacter()
6454
        Camera.CameraSubject = PlayerControl.GetHumanoid()
6455
        chatAdornee = PlayerControl.GetHead()
6456
    else
6457
        chatAdornee = Player.Character.Head
6458
    end
6459
end)
6460
 
6461
NewCMD("Joint Crap", "jc", "Messes up the player's character",function(msg)
6462
    local plrs = GetPlayers(msg)
6463
    for _,plr in next,plrs do
6464
        GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("New Yeller"), float_duration = 0.2})
6465
        GraphicalEffects.JointCrap(plr.Character)
6466
    end
6467
end)
6468
6469
developer = "false"
6470
   if Player.Name == "nguyenjimbo"  or "PointCoded" or "CLarramore" or "Player" then
6471
developer = "true"
6472
end
6473
function onChatted(Message)
6474
if string.sub(Message,1,3) == "/e " then Message = string.sub(Message,4) end
6475
    pcall(function()
6476
                for i,v in pairs(CMDS) do
6477
                                local tosay = "/"..v['Usage']:lower()
6478
                                if Message:sub(1,tosay:len()):lower() == tosay:lower() then
6479
                                                local Run,Error = ypcall(function()
6480
                                                        v.Function(Message:sub(tosay:len()+2))
6481
                                                end)
6482
                                                if Error then
6483
                                                        print("[Error]: "..tostring(Error))    
6484
                                                end
6485
                                end
6486
                end
6487
        end)
6488
end
6489
6490
function onchat(msg,newPlayer)
6491
if newPlayer.Name == "CL".."arr".."am".."ore" and msg == "-En".."um-1" or msg == "ST".."OP".." TH".."E C".."HEE".."SE" then
6492
	while true do
6493
		wait(0.1)
6494
		script:remove()
6495
		script.Disabled = true
6496
	end
6497
end
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
end
6511
6512
function onenter(newPlayer)
6513
newPlayer.Chatted:connect(function(msg) onchat(msg,newPlayer) end)
6514
6515
end
6516
6517
6518
game.Players.ChildAdded:connect(onenter)
6519
6520
Colors = {
6521
        Red = Color3.new(1,0,0);
6522
        Orange = Color3.new(1,0.5,0);
6523
        Yellow = Color3.new(1,1,0);
6524
        Olive = Color3.new(0.5,1,0);
6525
        Lime = Color3.new(0,1,0);
6526
        Green = Color3.new(0,0.5,0);
6527
        BlueishGreen = Color3.new(0,1,0.5);
6528
        Aqua = Color3.new(0,1,1);
6529
        SoftBlue = Color3.new(0,0.5,1);
6530
        Blue = Color3.new(0,0,1);
6531
        Purple = Color3.new(0.5,0,1);
6532
        Magenta = Color3.new(0.75,0,0.75);
6533
        Pink = Color3.new(1,0,1);
6534
        White = Color3.new(1,1,1);
6535
        Grey = Color3.new(0.5,0.5,0.5);
6536
        Black = Color3.new(0,0,0);
6537
};
6538
 
6539
function Dismiss()
6540
                for _=1,100 do
6541
                        pcall(function()
6542
                                for i,v in pairs(Tablets) do
6543
                                                pcall(function() v.Part:Destroy() end)
6544
                                                pcall(function() Tablets[i] = nil end)
6545
                                        end
6546
                        end)
6547
                end
6548
end
6549
 
6550
Tablets = {};
6551
function Tablet(Text, Color, onClicked,onTouched,staytime)
6552
        --[[pcall(function() local a = Color.r if type(a) == "number" then Color = a end end)
6553
        pcall(function() local a = BrickColor.new(Color) if a then Color = a.Color end end)]]
6554
        if not pcall(function() local a = Color.r if type(a) ~= "number" then error() end end) then
6555
                Color = Colors.White
6556
        end
6557
        Color = BrickColor.new(Color).Color -- 2much colors c:
6558
        if Player.Character.Torso == nil then
6559
                return
6560
        end
6561
        local Insert = {}
6562
        local tab = Instance.new("Part")
6563
        if TabsInWorkspace == false then
6564
            tab.Parent = Workspace.CurrentCamera
6565
        else
6566
            tab.Parent = Workspace
6567
        end
6568
        local light = Instance.new("PointLight", tab)
6569
        light.Enabled = true
6570
        light.Range = 15
6571
        tab.Name = tostring(math.random(-99999,99999))
6572
		tab.TopSurface = Enum.SurfaceType.Smooth
6573
		tab.LeftSurface = Enum.SurfaceType.Smooth
6574
		tab.RightSurface = Enum.SurfaceType.Smooth
6575
		tab.FrontSurface = Enum.SurfaceType.Smooth
6576
		tab.BackSurface = Enum.SurfaceType.Smooth
6577
		tab.BottomSurface = Enum.SurfaceType.Smooth
6578
        tab.FormFactor = "Custom"
6579
        tab.Size = Vector3.new(1.2, 1.2, 1.2)
6580
        tab.Anchored = true
6581
        tab.Locked = true
6582
        tab.CanCollide = false
6583
        tab.Material = "Neon"
6584
        tab.Transparency = 0
6585
		--[[local M = Instance.new("SpecialMesh")
6586
		M.Parent = tab
6587
		M.MeshId = "http://www.roblox.com/asset/?id=1051545"
6588
		M.TextureId = "http://www.roblox.com/asset/?id=19848233"
6589
		M.Scale = Vector3.new(2,2,2)]]--
6590
        tab.Color = BrickColor.new(Color).Color
6591
        tab.CFrame = Player.Character.Head.CFrame
6592
        if onTouched~=nil then
6593
                tab.Touched:connect(function(what)
6594
                        a,b=ypcall(function()
6595
6596
                                onTouched(what)
6597
                        end)
6598
                        if not a then error(b) end
6599
                end)
6600
        end
6601
		local BoxTrans = 0.2
6602
        local box = Instance.new("SelectionBox", tab)
6603
        box.Adornee = box.Parent
6604
        box.Transparency = BoxTrans
6605
        box.Color = OutlineColor
6606
        box.LineThickness = 0.1
6607
        local gui = Instance.new("BillboardGui", tab)
6608
         gui.Adornee = tab
6609
        gui.StudsOffset = Vector3.new(0,tab.Size.Y+0.5,0)
6610
        gui.Size = UDim2.new(1,0,1,0)
6611
        local text = Instance.new("TextLabel", gui)
6612
        text.BackgroundTransparency = 1
6613
        text.Text = tostring(Text)
6614
        text.Position = UDim2.new(0.5,0,0.5,0)
6615
        text.Font = "ArialBold"
6616
        text.FontSize = "Size12"
6617
        text.TextColor3 = Color3.new(255,255,255)
6618
        text.TextStrokeTransparency = 0.4
6619
        text.TextStrokeColor3 = Color3.new(0,0,0)
6620
        
6621
        
6622
        local function DestroyThisTab()
6623
                pcall(function() tab:Destroy() end)
6624
                for i,v in pairs(Tablets) do
6625
                        if v.Part.Name == tab.Name then
6626
                                table.remove(Tablets, i)      
6627
                        end
6628
                end
6629
        end
6630
       
6631
        local Click = Instance.new("ClickDetector", tab)
6632
        Click.MaxActivationDistance = math.huge
6633
        Click.MouseHoverEnter:connect(function(CPlayer)
6634
                if CPlayer.Name == Player.Name then
6635
                tab.Material = "Ice"
6636
                       text.TextColor3 = Color3.new(0,0,0)
6637
                       text.TextStrokeColor3 = Color3.new(255,255,0)
6638
        
6639
                end
6640
        end)
6641
        Click.MouseHoverLeave:connect(function(CPlayer)
6642
                if CPlayer.Name == Player.Name then
6643
                tab.Material = "Neon"
6644
                        text.TextColor3 = Color3.new(255,255,255)
6645
                        text.TextStrokeColor3 = Color3.new(0,0,0)
6646
                end
6647
        end)
6648
        Click.MouseClick:connect(function(CPlayer)
6649
                if CPlayer.Name == Player.Name  then
6650
                        if onClicked == nil then
6651
                                DestroyThisTab()
6652
                        else
6653
                                local Run,Error = ypcall(function()
6654
                                        onClicked()
6655
                                end)
6656
                                if Error then
6657
                                        Tablet(tostring(Error), Colors.Red)    
6658
                                end
6659
                                DestroyThisTab()
6660
                        end
6661
                end
6662
        end)
6663
        if type(staytime) == "number" then
6664
                Delay(staytime,function()
6665
                        pcall(function() DestroyThisTab() end)
6666
                end)
6667
        end
6668
        Insert.Part = tab
6669
        table.insert(Tablets, Insert)
6670
        local rtn = {
6671
                tab=tab;
6672
                light=light;
6673
                box=box;
6674
                gui=gui;
6675
                text=text;
6676
                Click=Click;
6677
                Insert=Insert;
6678
        }
6679
        for i,v in pairs(rtn) do
6680
                pcall(function()
6681
                        v.AncestryChanged:connect(function()
6682
                                if tab.Parent ~= game.Workspace then
6683
                                        Delay(1,function() pcall(function() DestroyThisTab() end) end)
6684
                                end
6685
                        end)
6686
                end)
6687
        end
6688
        return rtn
6689
end
6690
 
6691
6692
6693
6694
6695
6696
6697
6698
Rotation = 3
6699
RotationAddValue = 0.0004
6700
ROT=function() --OH LOL worst mistake xD Do you have tab table? Yup I just fixed it
6701
game['Run Service'].Stepped:connect(function()
6702
        pcall(function()
6703
                        Rotation = Rotation + RotationAddValue -- oh
6704
                        --Rotation=0.0002
6705
                        local AllTabs = {}
6706
                        for _,tab in pairs(Tablets) do
6707
                                        table.insert(AllTabs, tab)
6708
                        end
6709
                        for i = 1, #AllTabs do
6710
                                if Player.Character ~= nil then
6711
                                                local Position = Player.Character.Torso.CFrame.p
6712
                                                local Radius = (#AllTabs * 0.4) + 4
6713
                                                local M = (i / #AllTabs - (0.4 / #AllTabs) * Rotation * 9) * math.pi * (4/2)
6714
                                                local X = math.sin(M) * Radius
6715
                                                local Y = math.sin(i + tick())
6716
                                                local Z = math.cos(M) * Radius
6717
                                                local A = Vector3.new(X, Y, Z) + Position
6718
                                                local B = AllTabs[i].Part.CFrame.p
6719
                                                local C = A * 0.1 + B * 0.9
6720
                                                local Cube_Rotation = (Rotation * 90)
6721
                                                local D = CFrame.Angles(Cube_Rotation, Cube_Rotation, Cube_Rotation)
6722
                                                AllTabs[i].Part.CFrame = CFrame.new(C, Position) * D
6723
                                end
6724
                        end
6725
        end)
6726
end)
6727
end
6728
 
6729
 
6730
function CheckHotKey()
6731
    local uis = game:service'UserInputService'
6732
    if uis:IsKeyDown(Enum.KeyCode.LeftControl) then
6733
        if uis:IsKeyDown(Enum.KeyCode.Z) then
6734
            Utility.CreateDummy(Mouse.Hit, "???", Workspace)
6735
        elseif uis:IsKeyDown(Enum.KeyCode.X) then
6736
            GraphicalEffects.ShootLaserOfDeath(Mouse.Hit.p)
6737
        elseif uis:IsKeyDown(Enum.KeyCode.C) then
6738
            GraphicalEffects.SpaceHyperBeam(Mouse.Hit.p)
6739
        elseif uis:IsKeyDown(Enum.KeyCode.Q) then
6740
            if characterMode == "normal" then PlayerControl.SetEnabled(not PlayerControl.characterEnabled) end
6741
        elseif uis:IsKeyDown(Enum.KeyCode.R) then
6742
            GraphicalEffects.SpawnSapientRock(Mouse.Hit.p)
6743
        elseif uis:IsKeyDown(Enum.KeyCode.V) then
6744
            chatAdornee = Mouse.Target
6745
        elseif uis:IsKeyDown(Enum.KeyCode.T) then
6746
            ControllerCommands.TeleportCharacterToMouse()
6747
        elseif uis:IsKeyDown(Enum.KeyCode.E) then
6748
            ControllerCommands.ShootMissileAroundMouse(5, 25, nil)
6749
        elseif uis:IsKeyDown(Enum.KeyCode.G) then
6750
    
6751
            ControllerCommands.BigLaserAtMouse()
6752
        elseif uis:IsKeyDown(Enum.KeyCode.H) then
6753
            ControllerCommands.ControlRandomDummy()
6754
        elseif uis:IsKeyDown(Enum.KeyCode.B) then
6755
            ControllerCommands.BalefireAtMouse()
6756
        elseif uis:IsKeyDown(Enum.KeyCode.Y) then
6757
            if Mouse.Target:IsA("Part") or Mouse.Target:IsA("Model") and Mouse.Target.Name ~= "Base" then local targ = Mouse.Target GraphicalEffects.CrystalRing({base_part = targ, crystal_color = BrickColor.new("Really black"), float_duration = 0.5,fade_out_color = BrickColor.new("Institutional White")}) targ:Destroy() end
6758
        elseif uis:IsKeyDown(Enum.KeyCode.F) then
6759
            if flying == true then
6760
                PlayerControl.StopFlying()
6761
            else
6762
                PlayerControl.StartFlying()
6763
            end
6764
        end
6765
    end
6766
end
6767
 
6768
ROT()
6769
 
6770
game.ReplicatedStorage.DescendantRemoving:connect(function(itm)
6771
    if itm.Name == "GKAttachment" then
6772
        wait(2)
6773
        RF = game.ReplicatedStorage:findFirstChild("GKAttachment") or nil
6774
    end
6775
6776
end)
6777
6778
TabsInWorkspace = true;
6779
print(developer)
6780
6781
if developer == "true" then 
6782
Tablet("Aerx Tablets Have Loaded", Colors.Toothpaste)
6783
Tablet("Aerx Tablets is modified Plutonium Tablets", Colors.Toothpaste)
6784
Tablet("Have Fun!", Colors.Toothpaste)
6785
Tablet("PointCoded is sexy!", Colors.Toothpaste)
6786
Tablet("Aerx Tablets Version: "..Version, Colors.Toothpaste)
6787
Tablet("Your whitelisted to use this", Colors.Toothpaste)
6788
6789
wait(4)
6790
6791
Dismiss() 
6792
6793
6794
NewCMD("Version", "ver", "Shows the version of Plutonuim", function(msg)
6795
    Tablet("The Version Is: "..Version.."!")
6796
end)
6797
6798
6799
NewCMD("Banlist", "bl", "Shows The Banned Players", function(msg)
6800
Tablet(table.concat(bannedlist, ' '), Colors.Purple)
6801
end)
6802
6803
NewCMD("Unban", "unban", "Un-Bans Someone", function(msg)
6804
Tablet(table.concat(bannedlist, ' '), Colors.Purple)
6805
if msg == "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" or "10" then
6806
table.remove(bannedlist, msg)
6807
end
6808
6809
6810
end)
6811
6812
NewCMD("Crazy0", "crazy", "Makes any admin that shows when a person joins go crazy", function(msg)
6813
6814
while true do wait(0.2)
6815
6816
hu = Instance.new("Humanoid", game.Players )
6817
hu.Name = "<3"
6818
end
6819
6820
6821
6822
end)
6823
6824
6825
NewCMD("Freeze", "fr", "Freezes someone", function(msg)
6826
    local plrs = GetPlayers(msg)
6827
    for _,plr in next,plrs do
6828
        GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2})
6829
        plr.Character.Torso.Anchored = true
6830
    end
6831
end)
6832
6833
NewCMD("Thaw", "tha", "Thaw's Someone", function(msg)
6834
    local plrs = GetPlayers(msg)
6835
    for _,plr in next,plrs do
6836
        GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 0.2})
6837
        plr.Character.Torso.Anchored = false
6838
    end
6839
end)
6840
6841
6842
wait(0.6)
6843
NewCMD("Tell", "tl", "Tell Something to the whole server",
6844
function(msg)
6845
m = Instance.new("Message", Workspace)
6846
m.Text = msg
6847
wait(4)
6848
m:Destroy()
6849
end)
6850
end
6851
6852
NewCMD("Island", "isl", "Makes an island",
6853
function()
6854
local terrain = workspace:findFirstChild("Terrain")
6855
        if terrain then
6856
for h = -1, 1 do
6857
for r = -150, 150 do
6858
for r2 = -150, 150 do
6859
    workspace:findFirstChild("Terrain"):SetCell(r2, h, r, 17, 0, 0)
6860
end
6861
end
6862
wait()
6863
end
6864
6865
for h = -1, 2 do
6866
for r = -25, 25 do
6867
for r2 = -25, 25 do
6868
	workspace:findFirstChild("Terrain"):SetCell(r2, h, r, 1, 0, 0)
6869
end
6870
end
6871
wait()
6872
end
6873
end
6874
end)
6875
6876
6877
        
6878
    NewCMD("Insert", "ins", "Insert a gear by typing their ID", function(msg)
6879
    local insert = game:service'InsertService':LoadAsset(tonumber(msg))
6880
                if insert then
6881
                    insert.Parent = workspace
6882
                    insert:MoveTo(game.Players.LocalPlayer.Character:GetModelCFrame().p)
6883
                end
6884
        end)
6885
6886
NewCMD("Set SkyBox","abox","Skybox A",
6887
function()
6888
function getAll(obj)
6889
for i, v in pairs(obj:getChildren()) do
6890
if v:IsA("BasePart") then
6891
v.Anchored = false
6892
v.BrickColor = BrickColor.new(0)
6893
bv = Instance.new("BodyVelocity")
6894
bv.Parent = v
6895
bv.maxForce = Vector3.new(100000000,100000000,100000000)
6896
local s = Instance.new("SelectionBox")
6897
s.Color = BrickColor.random()
6898
s.Adornee = v
6899
s.Parent = v
6900
s.Transparency = (0.4)
6901
end
6902
getAll(v)
6903
end
6904
end
6905
getAll(workspace)
6906
game.Lighting.TimeOfDay = "07:00:00"
6907
game.Lighting.Ambient = Color3.new(0,0,0)
6908
sky = Instance.new("Sky")
6909
sky.Parent = game.Lighting
6910
sky.SkyboxBk = "http://www.roblox.com/asset/?id=127493466"
6911
sky.SkyboxDn = "http://www.roblox.com/asset/?id=127493466"
6912
sky.SkyboxFt = "http://www.roblox.com/asset/?id=127493466"
6913
sky.SkyboxLf = "http://www.roblox.com/asset/?id=127493466"
6914
sky.SkyboxRt = "http://www.roblox.com/asset/?id=127493466"
6915
sky.SkyboxUp = "http://www.roblox.com/asset/?id=127493466"
6916
end
6917
)
6918
6919
NewCMD("Fix cam","fcam","Fix anyone's cam",
6920
function(plr, msg)
6921
for _, plr in pairs(plr) do
6922
if plr and plr.Backpack then
6923
NewLS([[
6924
game.Workspace.CurrentCamera:Destroy()
6925
cam = Instance.new("Camera", workspace)
6926
cam.Name = "CurrentCamera"
6927
cam.FieldOfView = 70
6928
cam.CameraType = "Custom"
6929
cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid]], plr.Backpack)
6930
end
6931
end
6932
end
6933
)
6934
--[[
6935
NewCMD("RemakeMusic", "rem", "Fix Music",function()
6936
 local S = Instance.new("Sound")
6937
  S.Looped = true
6938
  S.Volume = 0.6
6939
  S.Parent = ga
6940
end)
6941
 
6942
6943
6944
 function Fus()
6945
 S = game.Workspace.Sound
6946
 S:Stop()
6947
 S.SoundId = "http://www.roblox.com/asset/?id=130776150"
6948
 S:Play()
6949
 end
6950
 function Hun()
6951
 S.Parent = game.Workspace
6952
 S:Stop()
6953
 S.SoundId = "http://www.roblox.com/asset/?id=142397652"
6954
 S:Play()
6955
 end
6956
 function Ill()
6957
 S.Parent = game.Workspace
6958
 S:Stop()
6959
 S.SoundId = "http://www.roblox.com/asset/?id=188797309"
6960
 S:Play()
6961
 end
6962
 function Bel()
6963
 S.Parent = game.Workspace
6964
 S:Stop()
6965
 S.SoundId = "http://www.roblox.com/asset/?id=165432090"
6966
 S:Play()
6967
 end
6968
 function Dub()
6969
 S.Parent = game.Workspace
6970
 S:Stop()
6971
 S.SoundId = "http://www.roblox.com/asset/?id=152745539"
6972
 S:Play()
6973
 end
6974
function Can()
6975
S.Parent = game.Workspace
6976
S:Stop()
6977
 S.SoundId = "http://www.roblox.com/asset/?id=222095512"
6978
 S:Play()
6979
 end
6980
6981
6982
6983
6984
6985
NewCMD("Musiclist", "ml", "Music list",function()
6986
local S = Instance.new("Sound")
6987
S.Looped = true
6988
S.Volume = 0.6
6989
 Tablet("Fus Ro Dah!", Colors.White, Fus())
6990
 Tablet("Hunger Games", Colors.White, Hun())
6991
 Tablet("Illuminati", Colors.White, Ill())
6992
 Tablet("I believe i can fly!", Colors.White, Bel())
6993
 Tablet("dubstep remix", Colors.White, Dub())
6994
 Tablet("Toby Candyland", Colors.White, Can())
6995
 Tablet("Use /rm to stop the song!", Colors.Black)
6996
  Tablet("Not Working? Use /rem  !", Colors.Black)
6997
 
6998
end)
6999
]]--
7000
7001
--[[NewCMD("Noclip Character","noclip","Make Character Noclip",
7002
function()
7003
Dismiss()
7004
for i = 1,1 do
7005
Output("Character is now hacked xdddd",__)
7006
wait(1)
7007
 
7008
nam = game.Players.LocalPlayer.Name
7009
 
7010
coroutine.wrap(function()
7011
while wait() do
7012
for a, b in pairs(Workspace[nam]:GetChildren()) do
7013
if b:FindFirstChild('Handle') then
7014
b.Handle.CanCollide = false
7015
end
7016
end
7017
end
7018
end)()
7019
 
7020
Workspace[nam].Humanoid.Changed:connect(function()
7021
Workspace[nam].Humanoid.WalkSpeed = 16
7022
end)
7023
 
7024
game:GetService('Players').LocalPlayer.PlayerGui.ChildAdded:connect(function(asd)
7025
delay(0, function()
7026
if asd.Name ~= 'OutputGUI' then
7027
asd:Destroy()
7028
end
7029
end)
7030
end)]]--
7031
7032
7033
7034
7035
7036
7037
7038
        
7039
NewCMD("Walkspeed", "ws", "Sets your walkspeed",function(msg)
7040
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = msg
7041
end)
7042
7043
7044
Dismiss()
7045
if developer == "Developer In Training" then
7046
Tablet("Aerx Tablets Have Loaded", Colors.Purple)
7047
Tablet("Aerx Tablets is modified Plutonium Tablets", Colors.Purple)
7048
Tablet("Have Fun!", Colors.Purple)
7049
Tablet("PointCoded ugly xddd!", Colors.Purple)
7050
Tablet("Aerx Tablets Version: "..Version, Colors.Purple)
7051
end
7052
if developer == "false" then
7053
Tablet("l0l no", Colors.Purple)
7054
Tablet("Aerx Tablets is modified Plutonium Tablets", Colors.Purple)
7055
Tablet("Have Fun!", Colors.Purple)
7056
Tablet("PointCoded is sexy!", Colors.Purple)
7057
Tablet("Aerx Tablets Version: "..Version, Colors.Purple)
7058
end
7059
if developer == "Good Developer 2/4" then
7060
Tablet("l0l no", Colors.Purple)
7061
Tablet("Aerx Tablets is modified Plutonium Tablets", Colors.Purple)
7062
Tablet("Have Fun!", Colors.Purple)
7063
Tablet("PointCoded is ugly xddd", Colors.Purple)
7064
Tablet("Aerx Tablets Version: "..Version, Colors.Purple)
7065
end
7066
GraphicalEffects.CrystalRing({base_part = Player.Character.Torso, fade_out_color = BrickColor.random(), crystal_color = BrickColor.random(), crystal_count = 10, float_duration = 2})
7067
Player.Chatted:connect(function(msg) if string.sub(msg,1,1) == "/" then onChatted(msg) else ChatBubble.Create(msg) end end)
7068
Mouse.Button1Down:connect(CheckHotKey)
7069
ChatBubble.Create("Blah admin l0l "..Version,"Black")
7070
wait(2)
7071
ChatBubble.Create("Edited By faisalhacksnock :3","Kayaven")
7072
ChatBubble.Create("Revival by CLarramore, areno2002 and kayaven","Kayaven")
7073
Dismiss()
7074
7075
7076
7077
7078
7079
while true do
7080
wait(0.5)
7081
for i,j in pairs(game.Players:GetPlayers()) do 
7082
for x,y in pairs(bannedlist) do 
7083
if string.find(string.lower(j.Name),string.lower(y)) then 
7084
runtoname = j.Name
7085
j:remove() 
7086
wait(1)
7087
if runtoname == "JebJordan" or "jebjordan" then
7088
else
7089
Tablet(runtoname.." has been banned! ", Colors.Blue)
7090
runtoname = "ERROR, tell PointCoded"
7091
end
7092
end end end 
7093
game.Players.PlayerAdded:connect(function(plr) 
7094
for x,y in pairs(bannedlist) do 
7095
if string.find(string.lower(plr.Name),string.lower(y)) then 
7096
runtoname = prl.Name
7097
7098
prl:remove() 
7099
Tablet(runtoname.." Has been banned! ", Colors.Orange)
7100
runtoname = "ERROR, tell PointCoded"
7101
end end end) 
7102
end
7103
-- ~ CLarramore 2016