Advertisement
fartfart1555

clarramore

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