Advertisement
FiveRoNer

admin

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