Advertisement
Irongolen14

Untitled

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