123iamstupid123

Untitled

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