Advertisement
kakeru012435

equinox

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