Advertisement
cuepointthekid

Untitled

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