Advertisement
astronaut32

rainbowsoul

Dec 20th, 2016
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1.  
  2. rs = game:GetService'RunService'
  3. plrs = game:GetService'Players'
  4. lp = plrs.LocalPlayer
  5. c = lp.Character
  6. root = lp.Character.HumanoidRootPart
  7. human = c.Humanoid
  8. FPS = 0
  9. inf = 0
  10. opos1 = Vector3.new()
  11. opos2 = Vector3.new()
  12. opos3 = Vector3.new()
  13. waves = Instance.new("Model", c)
  14. res = Instance.new("Model", c)
  15. local function a()
  16. local t=tick();
  17. local l=t%1*3;
  18. local t=.5*math.pi*(l%1);
  19. if l<1 then
  20. return Color3.new(1,1-math.cos(t),1-math.sin(t));
  21. elseif l<2 then
  22. return Color3.new(1-math.sin(t),1,1-math.cos(t));
  23. else
  24. return Color3.new(1-math.cos(t),1-math.sin(t),1);
  25. end;
  26. end;
  27. speedParts = function()
  28. for i = 1, 4 do
  29. local pos = Vector3.new(math.sin(math.rad(inf + 360 * i)) * 2, math.sin(math.rad(inf + 260 * i) + math.pi / 2) * 2, -c.HumanoidRootPart.Velocity / 5) * (math.sin(tick()) + 2)
  30. local CFramepos = root.CFrame:toWorldSpace(CFrame.new(pos)).p
  31. local opos
  32. if i == 1 then
  33. opos = opos1
  34. elseif i == 2 then
  35. opos = opos2
  36. else
  37. opos = opos3
  38. end
  39. if human.MoveDirection ~= Vector3.new(0, 0, 0) then
  40. local e
  41. if #res:children() <= 3 then
  42. e = Instance.new("Part")
  43. else
  44. e = res:FindFirstChild("Trail")
  45. end
  46. e.Parent = waves
  47. e.Anchored = true
  48. e.CanCollide = false
  49. e.Transparency = 0
  50. e.Material = "Neon"
  51. e.Name = "Trail"
  52. e.Color = a();
  53. e.Size = Vector3.new(.2, (CFramepos - opos).magnitude, .2)
  54. e.CFrame = CFrame.new((CFramepos + opos) / 2, opos) * CFrame.Angles(math.pi / 2, 0, 0)
  55. end
  56. if i == 1 then
  57. opos1 = CFramepos
  58. elseif i == 2 then
  59. opos2 = CFramepos
  60. else
  61. opos3 = CFramepos
  62. end
  63. end
  64. end
  65.  
  66. rs.RenderStepped:connect(function()
  67. FPS = 1 / rs.RenderStepped:wait()
  68. for i, v in pairs (waves:children()) do
  69. v.Transparency = v.Transparency + .05 / (FPS / 60)
  70. if v.Transparency >= .98 then
  71. v.Transparency = 1
  72. v.Parent = res
  73. end
  74. end
  75. inf = inf + (8 + root.Velocity.magnitude / 15) / (FPS / 60)
  76. speedParts()
  77. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement