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