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