Advertisement
Smarty6788

Untitled

Oct 7th, 2017
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.55 KB | None | 0 0
  1. local time = tick()
  2. print("Loading Wraith by joalars2...")
  3.  
  4. local plr = game:GetService("Players").LocalPlayer
  5. local mouse,char = plr:GetMouse(),plr.Character
  6.  
  7. local amountGhosts = 5
  8.  
  9. for i,v in pairs(game:GetService("Workspace").CurrentCamera:GetChildren()) do v:Destroy() end
  10.  
  11. local toggle,cd,mcd = false,false,false
  12. local ghosts = {}
  13. local temptab = {}
  14.  
  15. char:WaitForChild("Animate"):Destroy()
  16. char.Humanoid:WaitForChild("Animator"):Destroy()
  17.  
  18. local state = "idle"
  19.  
  20. local gt = false
  21.  
  22. local gyro = Instance.new("BodyGyro",char:WaitForChild("HumanoidRootPart")) --Stops the character from glitching out on enter/exit
  23. gyro.MaxTorque = Vector3.new(0,0,0)
  24. gyro.D = 0
  25. gyro.P = 100000000
  26.  
  27.  
  28. local wCol = BrickColor.new("Really red")
  29. local wCol2 = BrickColor.new("Really black")
  30. local gCol = BrickColor.new("Toothpaste")
  31. local gCol2 = BrickColor.new("Institutional white")
  32.  
  33. function searchAll(m,clear)
  34. if clear then
  35. if clear == true then
  36. for i,v in pairs(temptab) do
  37. table.remove(temptab,1)
  38. end
  39. end
  40. end
  41. for i,v in pairs(m:GetChildren()) do
  42. if v then
  43. local s = v:Clone()
  44. for _,b in pairs(s:GetChildren()) do
  45. b:Destroy()
  46. end
  47. if s:IsA("Part") or s:IsA("WedgePart") or s:IsA("TrussPart") or s:IsA("UnionOperation") then
  48. if s.Name ~= "HumanoidRootPart" then
  49. s.Anchored = true
  50. s.CanCollide = false
  51. s.Transparency = 0.95
  52. s.TopSurface = "Smooth"
  53. s.BottomSurface = "Smooth"
  54. s.FrontSurface = "Smooth"
  55. s.RightSurface = "Smooth"
  56. s.BackSurface = "Smooth"
  57. s.LeftSurface = "Smooth"
  58. if s.Material ~= Enum.Material.Neon then
  59. if gt == true then
  60. s.BrickColor = wCol2
  61. else
  62. s.BrickColor = gCol2
  63. end
  64. else
  65. if gt == true then
  66. s.BrickColor = wCol
  67. else
  68. s.BrickColor = gCol
  69. end
  70. end
  71. for _,c in pairs(v:GetChildren()) do
  72. if c:IsA("SpecialMesh") or c:IsA("CylinderMesh") then
  73. c:Clone().Parent = s
  74. end
  75. end
  76. local objValue = Instance.new("ObjectValue",s)
  77. objValue.Name = "Target"
  78. objValue.Value = v
  79. table.insert(temptab,s)
  80. end
  81. --elseif s:IsA("CharacterMesh") then
  82. --table.insert(temptab,s)
  83. end
  84. --searchAll(v)
  85. end
  86. end
  87. return temptab
  88. end
  89.  
  90. function CreateGhost()
  91. local ghost = Instance.new("Model",game.Workspace)
  92. searchAll(char,true)
  93. ghost.Name = char.Name.."'s Ghost "..#ghosts..#plr.Name
  94. --Instance.new("Humanoid",ghost)
  95. for i,v in pairs(temptab) do
  96. v:Clone().Parent = ghost
  97. end
  98. table.insert(ghosts,ghost)
  99. end
  100.  
  101. function ClearGhosts()
  102. for i,v in pairs(ghosts) do
  103. v:Destroy()
  104. end
  105. for i,v in pairs(ghosts) do
  106. table.remove(ghosts,1)
  107. end
  108. for i,v in pairs(game:GetService("Workspace"):GetChildren()) do
  109. if string.sub(v.Name,1,#plr.Name+9) == plr.Name.."'s Ghost " then
  110. v:Destroy()
  111. end
  112. end
  113. end
  114.  
  115. Instance.new("ForceField",char).Visible = false
  116.  
  117. local e1 = Instance.new("Part",char)
  118. e1.Size = Vector3.new(0.2,0.2,0.2)
  119. e1.TopSurface = "Smooth"
  120. e1.BottomSurface = "Smooth"
  121. e1.Material = "Neon"
  122. e1.Transparency = 1
  123. e1.Anchored = true
  124. e1.CanCollide = false
  125. e1.BrickColor = gCol
  126. e1.CFrame = char.Head.CFrame * CFrame.new(0.15,0.1,-0.6)
  127. local em1 = Instance.new("SpecialMesh",e1)
  128. em1.MeshType = "Sphere"
  129. local e2 = Instance.new("Part",char)
  130. e2.Size = Vector3.new(0.2,0.2,0.2)
  131. e2.TopSurface = "Smooth"
  132. e2.BottomSurface = "Smooth"
  133. e2.Transparency = 1
  134. e2.Material = "Neon"
  135. e2.Anchored = true
  136. e2.CanCollide = false
  137. e2.BrickColor = gCol
  138. e2.CFrame = char.Head.CFrame * CFrame.new(-0.15,0.1,-0.6)
  139. local em2 = Instance.new("SpecialMesh",e2)
  140. em2.MeshType = "Sphere"
  141.  
  142. toggle = true
  143. for i=1,amountGhosts do
  144. CreateGhost()
  145. end
  146. char.Parent = game:GetService("Workspace").CurrentCamera
  147. char:FindFirstChild("Head").Transparency = 1
  148. char:FindFirstChild("Torso").Transparency = 1
  149. char:FindFirstChild("Right Arm").Transparency = 1
  150. char:FindFirstChild("Left Arm").Transparency = 1
  151. char:FindFirstChild("Right Leg").Transparency = 1
  152. char:FindFirstChild("Left Leg").Transparency = 1
  153. for i,v in pairs(char:GetChildren()) do
  154. if v:IsA("Accessory") then
  155. v:FindFirstChild("Handle").Transparency = 1
  156. end
  157. end
  158. char:FindFirstChild("Head"):FindFirstChild("face"):Destroy()
  159.  
  160. local p1 = Instance.new("Part",workspace)
  161. local m1 = Instance.new("SpecialMesh",p1)
  162. m1.MeshType = "Sphere"
  163. m1.Scale = Vector3.new(5,5,5)
  164. p1.Size = Vector3.new(1,1,1)
  165. p1.Anchored = true
  166. p1.CanCollide = false
  167. p1.TopSurface = "Smooth"
  168. p1.BottomSurface = "Smooth"
  169. p1.BrickColor = gCol
  170. p1.Material = "Neon"
  171. local p2 = Instance.new("Part",workspace)
  172. local m2 = Instance.new("SpecialMesh",p2)
  173. m2.MeshType = "Sphere"
  174. m2.Scale = Vector3.new(8,8,8)
  175. p2.Size = Vector3.new(1,1,1)
  176. p2.Anchored = true
  177. p2.CanCollide = false
  178. p2.TopSurface = "Smooth"
  179. p2.BottomSurface = "Smooth"
  180. p2.BrickColor = gCol2
  181. p2.Material = "Neon"
  182. local p3 = Instance.new("Part",workspace)
  183. local m3 = Instance.new("BlockMesh",p3)
  184. m3.Scale = Vector3.new(7,7,7)
  185. p3.Size = Vector3.new(1,1,1)
  186. p3.Transparency = 0.4
  187. p3.Anchored = true
  188. p3.CanCollide = false
  189. p3.TopSurface = "Smooth"
  190. p3.BottomSurface = "Smooth"
  191. p3.BrickColor = gCol
  192. p3.Material = "Neon"
  193. local p4 = Instance.new("Part",workspace)
  194. local m4 = Instance.new("BlockMesh",p4)
  195. m4.Scale = Vector3.new(10,10,10)
  196. p4.Size = Vector3.new(1,1,1)
  197. p4.Transparency = 0.4
  198. p4.Anchored = true
  199. p4.CanCollide = false
  200. p4.TopSurface = "Smooth"
  201. p4.BottomSurface = "Smooth"
  202. p4.BrickColor = gCol2
  203. p4.Material = "Neon"
  204. local currentframe = 0
  205. local frmR
  206.  
  207. frmR = game:GetService("RunService").RenderStepped:connect(function()
  208. currentframe = currentframe + 1
  209. if currentframe < 1*60 then
  210. p1.CFrame = char:WaitForChild("Torso").CFrame
  211. p2.CFrame = char:WaitForChild("Torso").CFrame
  212. p3.CFrame = char:WaitForChild("Torso").CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))
  213. p4.CFrame = char:WaitForChild("Torso").CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))
  214. m1.Scale = m1.Scale + Vector3.new(0.25,0.25,0.25)
  215. m2.Scale = m2.Scale + Vector3.new(0.25,0.25,0.25)
  216. m3.Scale = m3.Scale + Vector3.new(0.25,0.25,0.25)
  217. m4.Scale = m4.Scale + Vector3.new(0.25,0.25,0.25)
  218. p1.Transparency = p1.Transparency + (1/(1*60))
  219. p2.Transparency = p2.Transparency + (1/(1*60))
  220. p3.Transparency = p3.Transparency + (1/(1*60))
  221. p4.Transparency = p4.Transparency + (1/(1*60))
  222. else
  223. p1:Destroy()
  224. p2:Destroy()
  225. p3:Destroy()
  226. p4:Destroy()
  227. frmR:disconnect()
  228. end
  229. end)
  230.  
  231. char.Humanoid.MaxHealth = math.huge
  232. wait()
  233. char.Humanoid.Health = math.huge
  234.  
  235. --[[mouse.KeyDown:connect(function(key)
  236. if key == "r" then
  237. print("R!")
  238. if cd == false then
  239. print("No cooldown!")
  240. cd = true
  241. if toggle == false then
  242. print("Entering godmode")
  243. toggle = true
  244. Instance.new("ForceField",char)
  245. for i=1,amountGhosts do
  246. CreateGhost()
  247. end
  248. char.Parent = game:GetService("Workspace").CurrentCamera
  249. char:FindFirstChild("Head").Transparency = 1
  250. char:FindFirstChild("Torso").Transparency = 1
  251. char:FindFirstChild("Right Arm").Transparency = 1
  252. char:FindFirstChild("Left Arm").Transparency = 1
  253. char:FindFirstChild("Right Leg").Transparency = 1
  254. char:FindFirstChild("Left Leg").Transparency = 1
  255. for i,v in pairs(char:GetChildren()) do
  256. if v:IsA("Accessory") then
  257. v:FindFirstChild("Handle").Transparency = 1
  258. end
  259. end
  260. else
  261. print("Exiting godmode")
  262. toggle = false
  263. for i,v in pairs(ghosts) do
  264. v:Destroy()
  265. end
  266. char.Parent = game:GetService("Workspace")
  267. char:FindFirstChild("ForceField"):Destroy()
  268. char:FindFirstChild("Head").Transparency = 0
  269. char:FindFirstChild("Torso").Transparency = 0
  270. char:FindFirstChild("Right Arm").Transparency = 0
  271. char:FindFirstChild("Left Arm").Transparency = 0
  272. char:FindFirstChild("Right Leg").Transparency = 0
  273. char:FindFirstChild("Left Leg").Transparency = 0
  274. for i,v in pairs(char:GetChildren()) do
  275. if v:IsA("Accessory") then
  276. v:FindFirstChild("Handle").Transparency = 0
  277. end
  278. end
  279. end
  280. cd = false
  281. end
  282. end
  283. end)]]
  284.  
  285. mouse.KeyDown:connect(function(key)
  286. spawn(function()
  287. if key == "f" and toggle == true and mcd == false then
  288. if #ghosts < amountGhosts then
  289. print(#ghosts.."<")
  290. mcd = true
  291.  
  292. ClearGhosts()
  293.  
  294. for i=1,amountGhosts do
  295. CreateGhost()
  296. end
  297. local p1 = Instance.new("Part",workspace)
  298. local m1 = Instance.new("SpecialMesh",p1)
  299. m1.MeshType = "Sphere"
  300. m1.Scale = Vector3.new(7,7,7)
  301. p1.Size = Vector3.new(1,1,1)
  302. p1.Anchored = true
  303. p1.CanCollide = false
  304. p1.TopSurface = "Smooth"
  305. p1.BottomSurface = "Smooth"
  306. if gt == false then
  307. p1.BrickColor = gCol
  308. else
  309. p1.BrickColor = wCol
  310. end
  311. p1.Material = "Neon"
  312. local p2 = Instance.new("Part",workspace)
  313. local m2 = Instance.new("SpecialMesh",p2)
  314. m2.MeshType = "Sphere"
  315. m2.Scale = Vector3.new(9,9,9)
  316. p2.Size = Vector3.new(1,1,1)
  317. p2.Anchored = true
  318. p2.CanCollide = false
  319. p2.TopSurface = "Smooth"
  320. p2.BottomSurface = "Smooth"
  321. if gt == false then
  322. p2.BrickColor = gCol2
  323. else
  324. p2.BrickColor = wCol2
  325. end
  326. p2.Material = "Neon"
  327. local currentframe = 0
  328. local frmR
  329.  
  330. frmR = game:GetService("RunService").RenderStepped:connect(function()
  331. currentframe = currentframe + 1
  332. if currentframe < 0.25*60 then
  333. p1.CFrame = char:WaitForChild("Torso").CFrame
  334. p2.CFrame = char:WaitForChild("Torso").CFrame
  335. p1.Transparency = p1.Transparency + (1/(0.25*60))
  336. p2.Transparency = p2.Transparency + (1/(0.25*60))
  337. else
  338. p1:Destroy()
  339. p2:Destroy()
  340. mcd = false
  341. frmR:disconnect()
  342. end
  343. end)
  344. else
  345. mcd = true
  346.  
  347. ClearGhosts()
  348.  
  349. local p1 = Instance.new("Part",workspace)
  350. local m1 = Instance.new("SpecialMesh",p1)
  351. m1.MeshType = "Sphere"
  352. m1.Scale = Vector3.new(7,7,7)
  353. p1.Size = Vector3.new(1,1,1)
  354. p1.Anchored = true
  355. p1.CanCollide = false
  356. p1.TopSurface = "Smooth"
  357. p1.BottomSurface = "Smooth"
  358. if gt == false then
  359. p1.BrickColor = gCol
  360. else
  361. p1.BrickColor = wCol
  362. end
  363. p1.Material = "Neon"
  364. local p2 = Instance.new("Part",workspace)
  365. local m2 = Instance.new("SpecialMesh",p2)
  366. m2.MeshType = "Sphere"
  367. m2.Scale = Vector3.new(9,9,9)
  368. p2.Size = Vector3.new(1,1,1)
  369. p2.Anchored = true
  370. p2.CanCollide = false
  371. p2.TopSurface = "Smooth"
  372. p2.BottomSurface = "Smooth"
  373. if gt == false then
  374. p2.BrickColor = gCol2
  375. else
  376. p2.BrickColor = wCol2
  377. end
  378. p2.Material = "Neon"
  379. local currentframe = 0
  380. local frmR
  381.  
  382. frmR = game:GetService("RunService").RenderStepped:connect(function()
  383. currentframe = currentframe + 1
  384. if currentframe < 0.25*60 then
  385. p1.CFrame = char:WaitForChild("Torso").CFrame
  386. p2.CFrame = char:WaitForChild("Torso").CFrame
  387. p1.Transparency = p1.Transparency + (1/(0.25*60))
  388. p2.Transparency = p2.Transparency + (1/(0.25*60))
  389. else
  390. p1:Destroy()
  391. p2:Destroy()
  392. mcd = false
  393. frmR:disconnect()
  394. end
  395. end)
  396. end
  397. elseif key == "g" and toggle == true and mcd == false then
  398. if gt == true then
  399. gt = false
  400. local p1 = Instance.new("Part",workspace)
  401. local m1 = Instance.new("SpecialMesh",p1)
  402. m1.MeshType = "Sphere"
  403. m1.Scale = Vector3.new(5,5,5)
  404. p1.Size = Vector3.new(1,1,1)
  405. p1.Anchored = true
  406. p1.CanCollide = false
  407. p1.TopSurface = "Smooth"
  408. p1.BottomSurface = "Smooth"
  409. p1.BrickColor = gCol
  410. p1.Material = "Neon"
  411. local p2 = Instance.new("Part",workspace)
  412. local m2 = Instance.new("SpecialMesh",p2)
  413. m2.MeshType = "Sphere"
  414. m2.Scale = Vector3.new(8,8,8)
  415. p2.Size = Vector3.new(1,1,1)
  416. p2.Anchored = true
  417. p2.CanCollide = false
  418. p2.TopSurface = "Smooth"
  419. p2.BottomSurface = "Smooth"
  420. p2.BrickColor = gCol2
  421. p2.Material = "Neon"
  422. local p3 = Instance.new("Part",workspace)
  423. local m3 = Instance.new("BlockMesh",p3)
  424. m3.Scale = Vector3.new(7,7,7)
  425. p3.Size = Vector3.new(1,1,1)
  426. p3.Transparency = 0.4
  427. p3.Anchored = true
  428. p3.CanCollide = false
  429. p3.TopSurface = "Smooth"
  430. p3.BottomSurface = "Smooth"
  431. p3.BrickColor = gCol
  432. p3.Material = "Neon"
  433. local p4 = Instance.new("Part",workspace)
  434. local m4 = Instance.new("BlockMesh",p4)
  435. m4.Scale = Vector3.new(10,10,10)
  436. p4.Size = Vector3.new(1,1,1)
  437. p4.Transparency = 0.4
  438. p4.Anchored = true
  439. p4.CanCollide = false
  440. p4.TopSurface = "Smooth"
  441. p4.BottomSurface = "Smooth"
  442. p4.BrickColor = gCol2
  443. p4.Material = "Neon"
  444.  
  445. ClearGhosts()
  446.  
  447. for i=1,amountGhosts do
  448. CreateGhost()
  449. end
  450.  
  451. local currentframe = 0
  452. local frmR
  453.  
  454. frmR = game:GetService("RunService").RenderStepped:connect(function()
  455. currentframe = currentframe + 1
  456. if currentframe < 1*60 then
  457. p1.CFrame = char:WaitForChild("Torso").CFrame
  458. p2.CFrame = char:WaitForChild("Torso").CFrame
  459. p3.CFrame = char:WaitForChild("Torso").CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))
  460. p4.CFrame = char:WaitForChild("Torso").CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))
  461. m1.Scale = m1.Scale + Vector3.new(0.25,0.25,0.25)
  462. m2.Scale = m2.Scale + Vector3.new(0.25,0.25,0.25)
  463. m3.Scale = m3.Scale + Vector3.new(0.25,0.25,0.25)
  464. m4.Scale = m4.Scale + Vector3.new(0.25,0.25,0.25)
  465. p1.Transparency = p1.Transparency + (1/(1*60))
  466. p2.Transparency = p2.Transparency + (1/(1*60))
  467. p3.Transparency = p3.Transparency + (1/(1*60))
  468. p4.Transparency = p4.Transparency + (1/(1*60))
  469. else
  470. p1:Destroy()
  471. p2:Destroy()
  472. p3:Destroy()
  473. p4:Destroy()
  474. frmR:disconnect()
  475. end
  476. end)
  477. else
  478. gt = true
  479. local p1 = Instance.new("Part",workspace)
  480. local m1 = Instance.new("SpecialMesh",p1)
  481. m1.MeshType = "Sphere"
  482. m1.Scale = Vector3.new(5,5,5)
  483. p1.Size = Vector3.new(1,1,1)
  484. p1.Anchored = true
  485. p1.CanCollide = false
  486. p1.TopSurface = "Smooth"
  487. p1.BottomSurface = "Smooth"
  488. p1.BrickColor = wCol
  489. p1.Material = "Neon"
  490. local p2 = Instance.new("Part",workspace)
  491. local m2 = Instance.new("SpecialMesh",p2)
  492. m2.MeshType = "Sphere"
  493. m2.Scale = Vector3.new(8,8,8)
  494. p2.Size = Vector3.new(1,1,1)
  495. p2.Anchored = true
  496. p2.CanCollide = false
  497. p2.TopSurface = "Smooth"
  498. p2.BottomSurface = "Smooth"
  499. p2.BrickColor = wCol2
  500. p2.Material = "Neon"
  501. local p3 = Instance.new("Part",workspace)
  502. local m3 = Instance.new("BlockMesh",p3)
  503. m3.Scale = Vector3.new(7,7,7)
  504. p3.Size = Vector3.new(1,1,1)
  505. p3.Transparency = 0.4
  506. p3.Anchored = true
  507. p3.CanCollide = false
  508. p3.TopSurface = "Smooth"
  509. p3.BottomSurface = "Smooth"
  510. p3.BrickColor = wCol
  511. p3.Material = "Neon"
  512. local p4 = Instance.new("Part",workspace)
  513. local m4 = Instance.new("BlockMesh",p4)
  514. m4.Scale = Vector3.new(10,10,10)
  515. p4.Size = Vector3.new(1,1,1)
  516. p4.Transparency = 0.4
  517. p4.Anchored = true
  518. p4.CanCollide = false
  519. p4.TopSurface = "Smooth"
  520. p4.BottomSurface = "Smooth"
  521. p4.BrickColor = wCol2
  522. p4.Material = "Neon"
  523.  
  524. ClearGhosts()
  525.  
  526. for i=1,amountGhosts do
  527. CreateGhost()
  528. end
  529.  
  530. local currentframe = 0
  531. local frmR
  532.  
  533. frmR = game:GetService("RunService").RenderStepped:connect(function()
  534. currentframe = currentframe + 1
  535. if currentframe < 1*60 then
  536. p1.CFrame = char:WaitForChild("Torso").CFrame
  537. p2.CFrame = char:WaitForChild("Torso").CFrame
  538. p3.CFrame = char:WaitForChild("Torso").CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))
  539. p4.CFrame = char:WaitForChild("Torso").CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))
  540. m1.Scale = m1.Scale + Vector3.new(0.25,0.25,0.25)
  541. m2.Scale = m2.Scale + Vector3.new(0.25,0.25,0.25)
  542. m3.Scale = m3.Scale + Vector3.new(0.25,0.25,0.25)
  543. m4.Scale = m4.Scale + Vector3.new(0.25,0.25,0.25)
  544. p1.Transparency = p1.Transparency + (1/(1*60))
  545. p2.Transparency = p2.Transparency + (1/(1*60))
  546. p3.Transparency = p3.Transparency + (1/(1*60))
  547. p4.Transparency = p4.Transparency + (1/(1*60))
  548. else
  549. p1:Destroy()
  550. p2:Destroy()
  551. p3:Destroy()
  552. p4:Destroy()
  553. frmR:disconnect()
  554. end
  555. end)
  556. end
  557. end
  558. end)
  559. end)
  560. local Work = Workspace
  561. local Music = Instance.new("Sound", Work)
  562. Music.SoundId = "rbxassetid://326021130"
  563. Music.Volume = 1
  564. Music.Looped = true
  565. Music:Play()
  566.  
  567. local frm = 0
  568.  
  569. local toRemove = {}
  570.  
  571. game:GetService("RunService").RenderStepped:connect(function()
  572. frm = frm + 1
  573. if char.Parent == game:GetService("Workspace").CurrentCamera then
  574.  
  575. e1.CFrame = char.Head.CFrame * CFrame.new(0.15,0.1,-0.55)
  576. e2.CFrame = char.Head.CFrame * CFrame.new(-0.15,0.1,-0.55)
  577.  
  578. local delay = 0.9
  579.  
  580. for i,v in pairs(ghosts) do
  581. for _,b in pairs(v:GetChildren()) do
  582. if b:IsA("Part") or b:IsA("WedgePart") or b:IsA("TrussPart") or b:IsA("UnionOperation") then
  583. b.CFrame = b.CFrame:lerp(b:FindFirstChild("Target").Value.CFrame,delay)
  584. end
  585. end
  586. delay = delay - (0.5/(#ghosts+1))
  587. end
  588.  
  589. --[[if math.floor(frm/8) == frm/8 then
  590. local isub = 0
  591. for i,v in pairs(ghosts) do
  592. if #v:GetChildren() < 6 then
  593. v:Destroy()
  594. table.remove(ghosts,i - isub)
  595. isub = isub + 1
  596. CreateGhost()
  597. end
  598. end
  599. end]]
  600. end
  601.  
  602. --Animation states
  603.  
  604. local ray = Ray.new(char.HumanoidRootPart.CFrame.p, Vector3.new(0,-3,0).unit*4)
  605. local part,pos,normal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(ray,ghosts,false,true)
  606.  
  607. if state ~= "busy" then
  608. if char.HumanoidRootPart.Velocity.Magnitude <= 0.5 then
  609. state = "idle"
  610. elseif char.HumanoidRootPart.Velocity.Magnitude > 0.5 then
  611. state = "running"
  612. --[[elseif char.HumanoidRootPart.Velocity.Y < 0.1 and not part then
  613. state = "falling"
  614. elseif char.HumanoidRootPart.Velocity.Y >= 0.1 and not part then
  615. state = "jumping"]]
  616. end
  617. char.Humanoid.WalkSpeed = 32
  618. char.Humanoid.JumpPower = 70
  619. end
  620.  
  621. --Actual animations
  622.  
  623. if state == "idle" then
  624. char.HumanoidRootPart.RootJoint.C0 = char.HumanoidRootPart.RootJoint.C0:lerp(CFrame.new(0,1 + (math.cos(tick())/5),0) * CFrame.Angles(math.rad(80 + math.cos(tick())*4),math.rad(180),math.rad(0)),0.06)
  625. char.Torso["Right Hip"].C0 = char.Torso["Right Hip"].C0:lerp(CFrame.new(0.5,-0.1 + (math.cos((tick())*2)/10),-0.2) * CFrame.Angles(math.rad(-20),math.rad(0),math.rad(0)),0.06)
  626. char.Torso["Left Hip"].C0 = char.Torso["Left Hip"].C0:lerp(CFrame.new(-0.5,-0.5 + (math.cos((tick()-0.5)*2)/6),0.3) * CFrame.Angles(math.rad(-10),math.rad(0),math.rad(0)),0.06)
  627. char.Torso["Right Shoulder"].C0 = char.Torso["Right Shoulder"].C0:lerp(CFrame.new(1.5,0.43 + (math.cos((tick()-0.5)*1.5)/30),-0.6) * CFrame.Angles(math.rad(math.cos((tick())*2)*10),math.rad(0),math.rad(math.cos(tick()/3)*3)),0.06)
  628. char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0:lerp(CFrame.new(-1.5,0.3 + (math.cos((tick()-0.5)*1.5)/30),-0.6) * CFrame.Angles(math.rad(-15 + math.cos((tick()))*7),math.rad(0),math.rad(math.cos(tick()/2)*4)),0.06)
  629. char.Torso.Neck.C0 = char.Torso.Neck.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(90 + math.cos(tick()*1.5)*6),math.rad(180),math.rad(0)),0.06)
  630. elseif state == "running" then
  631. char.HumanoidRootPart.RootJoint.C0 = char.HumanoidRootPart.RootJoint.C0:lerp(CFrame.new(0,1 + (math.cos(tick())/5),0) * CFrame.Angles(math.rad(65 + math.cos(tick())*4),math.rad(180),math.rad(-char.HumanoidRootPart.RotVelocity.Y*10)),0.06)
  632. char.Torso["Right Hip"].C0 = char.Torso["Right Hip"].C0:lerp(CFrame.new(0.5,-0.1 + (math.cos((tick())*2)/10),-0.2) * CFrame.Angles(math.rad(-20),math.rad(0),math.rad(0)),0.06)
  633. char.Torso["Left Hip"].C0 = char.Torso["Left Hip"].C0:lerp(CFrame.new(-0.5,-0.5 + (math.cos((tick()-0.5)*2)/6),0.3) * CFrame.Angles(math.rad(-10),math.rad(0),math.rad(0)),0.06)
  634. char.Torso["Right Shoulder"].C0 = char.Torso["Right Shoulder"].C0:lerp(CFrame.new(1.5,0.70 + (math.cos((tick()-0.5)*1.5)/30),-0.4) * CFrame.Angles(math.rad(50 + math.cos((tick())*2)*10),math.rad(0),math.rad(math.cos(tick()/3)*3)),0.06)
  635. char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0:lerp(CFrame.new(-1.5,0.3 + (math.cos((tick()-0.5)*1.5)/30),-0.4) * CFrame.Angles(math.rad(-35 + math.cos((tick()))*7),math.rad(0),math.rad(math.cos(tick()/2)*4)),0.06)
  636. char.Torso.Neck.C0 = char.Torso.Neck.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(90 + math.cos(tick()*1.5)*6),math.rad(180),math.rad(0)),0.06)
  637. end
  638. end)
  639.  
  640. char.Humanoid.Died:connect(function()
  641. toggle = false
  642.  
  643. ClearGhosts()
  644.  
  645. char.Parent = game.Workspace
  646. char.Parent = game:GetService("Workspace")
  647. char:FindFirstChild("ForceField"):Destroy()
  648. char:FindFirstChild("Head").Transparency = 0
  649. char:FindFirstChild("Torso").Transparency = 0
  650. char:FindFirstChild("Right Arm").Transparency = 0
  651. char:FindFirstChild("Left Arm").Transparency = 0
  652. char:FindFirstChild("Right Leg").Transparency = 0
  653. char:FindFirstChild("Left Leg").Transparency = 0
  654. for i,v in pairs(char:GetChildren()) do
  655. if v:IsA("Accessory") then
  656. v:FindFirstChild("Handle").Transparency = 0
  657. end
  658. end
  659. for i,v in pairs(game:GetService("Workspace").CurrentCamera:GetChildren()) do v:Destroy() end
  660. plr:LoadCharacter()
  661. end)
  662.  
  663. local msgidGlob = 0
  664. local state = true
  665. local font = "Arcade"
  666. local tcol = Color3.fromRGB(255,217,0)
  667. local tscol = Color3.fromRGB(0,0,0)
  668. local fsiz = 28
  669. local tr = true
  670. local tsr = false
  671. local fade = 2
  672.  
  673. local p = Instance.new("Part",game.Workspace)
  674. p.Size = Vector3.new(0.2,0.2,0.2)
  675. p.Transparency = 1
  676. p.Anchored = true
  677. p.CanCollide = false
  678. p.Name = "Msg"
  679. p.CFrame = plr.Character:WaitForChild("Head").CFrame + Vector3.new(0,2.25,0)
  680.  
  681. local r = 255
  682. local b = 0
  683. local g = 0
  684.  
  685. plr.Chatted:connect(function(c)
  686. msgidGlob = msgidGlob + 1
  687. local curMsgId = msgidGlob
  688. if string.lower(c) == "!disable" then
  689. state = false
  690. elseif string.lower(c) == "!enable" then
  691. state = true
  692. elseif string.lower(string.sub(c,1,6)) == "!font " then
  693. local old = font
  694. font = string.sub(c,7,#c) or old
  695. elseif string.lower(string.sub(c,1,8)) == "!tcolor " then
  696. if string.lower(string.sub(c,9,#c)) == "rainbow" then
  697. tr = true
  698. else
  699. tr = false
  700. local old = tcol
  701. tcol = Color3.fromRGB(string.sub(c,9,11),string.sub(c,13,15),string.sub(c,17,19)) or old
  702. end
  703. elseif string.lower(string.sub(c,1,9)) == "!tscolor " then
  704. if string.sub(c,10,#c) == "rainbow" then
  705. tsr = true
  706. else
  707. tsr = false
  708. local old = tscol
  709. tscol = Color3.fromRGB(string.sub(c,10,12),string.sub(c,14,16),string.sub(c,18,20)) or old
  710. end
  711. elseif string.lower(string.sub(c,1,6)) == "!size " then
  712. local old = fsiz
  713. fsiz = string.sub(c,7,#c) or old
  714. elseif string.lower(string.sub(c,1,6)) == "!fade " then
  715. local old = fade
  716. fade = string.sub(c,7,#c) or old
  717. end
  718. if plr.Character and state == true then
  719. if plr.Character:FindFirstChild("Head") then
  720. for i,v in pairs(p:GetChildren()) do
  721. if v:IsA("BillboardGui") and v.Name == "J2CMSG" then
  722. v:Destroy()
  723. end
  724. end
  725. local bbgui = Instance.new("BillboardGui",p)
  726. bbgui.Name = "J2CMSG"
  727. bbgui.AlwaysOnTop = true
  728. bbgui.ExtentsOffsetWorldSpace = Vector3.new(0,4.5,0)
  729. bbgui.Size = UDim2.new(0.2,0,0.14,0)
  730. local tl = Instance.new("TextLabel",bbgui)
  731. tl.BackgroundTransparency = 1
  732. tl.BorderSizePixel = 0
  733. tl.Size = UDim2.new(1,0,10,0)
  734. tl.Position = UDim2.new(0,0,-5,0)
  735. tl.Font = font or "SciFi"
  736. tl.FontSize = "Size"..fsiz or "Size36"
  737. tl.TextColor3 = tcol
  738. tl.TextScaled = false
  739. tl.TextWrapped = false
  740. tl.TextStrokeColor3 = tscol
  741. tl.TextStrokeTransparency = 0
  742.  
  743. game:GetService("RunService").RenderStepped:connect(function()
  744. if tr then
  745. if tl.Parent ~= nil then
  746. tl.TextColor3 = Color3.fromRGB(r,g,b)
  747. end
  748. end
  749. end)
  750.  
  751. for i=1,#c do
  752. if msgidGlob == curMsgId then
  753. tl.Text = string.sub(c,1,i)
  754. if string.sub(c,i,i) ~= " " then
  755. end
  756. wait()
  757. end
  758. end
  759. wait(fade)
  760. if msgidGlob == curMsgId then
  761. for i=1,10 do
  762. if msgidGlob == curMsgId then
  763. tl.TextTransparency = tl.TextTransparency + 0.1
  764. tl.TextStrokeTransparency = tl.TextStrokeTransparency + 0.1
  765. tl.Position = tl.Position + UDim2.new(0,0,0,-3)
  766. wait()
  767. end
  768. end
  769. if msgidGlob == curMsgId then
  770. bbgui:Destroy()
  771. end
  772. end
  773. end
  774. end
  775. end)
  776.  
  777. coroutine.resume(coroutine.create(function()
  778. while wait() do
  779. for i=0,255,10 do g = i wait() end
  780. for i=255,0,-10 do r = i wait() end
  781. for i=0,255,10 do b = i wait() end
  782. for i=255,0,-10 do g = i wait() end
  783. for i=0,255,10 do r = i wait() end
  784. for i=255,0,-10 do b = i wait() end
  785. end
  786. end))
  787.  
  788. game:GetService("RunService").RenderStepped:connect(function()
  789. if p.Parent ~= nil then
  790. p.CFrame = p.CFrame:lerp(plr.Character:WaitForChild("Head").CFrame + Vector3.new(0,2.25,0),0.16)
  791. else
  792. p = Instance.new("Part",game.Workspace)
  793. p.Size = Vector3.new(0.2,0.2,0.2)
  794. p.Transparency = 1
  795. p.Anchored = true
  796. p.CanCollide = false
  797. p.Name = "Msg"
  798. p.CFrame = plr.Character:WaitForChild("Head").CFrame + Vector3.new(0,2.25,0)
  799. end
  800. end)
  801.  
  802. print("Ghost loaded! Time elapsed: "..tick() - time)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement