Advertisement
MLGDragonz

Untitled

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