123iamstupid123

Untitled

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