Advertisement
Lolw2ewsdwsdwsws

wdd

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