Advertisement
Thefrozen106

Edgy Aerx

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