Advertisement
Thefrozen106

Model A.E.R.C

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