Advertisement
robthesnowman

Untitled

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