ghostteen14

Untitled

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