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