Advertisement
ThatOneGuy561

Untitled

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