Advertisement
DarkScriptZEditors

Untitled

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