Advertisement
DrawingJhon

Trail

Sep 6th, 2021
1,115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. local part = Instance.new("Part", workspace)
  2. part.Anchored = true
  3. part.Size = Vector3.new(1,1,1)
  4. part.TopSurface = "Smooth"
  5. part.BottomSurface = "Smooth"
  6. part.CanCollide = false
  7. part.Color = Color3.fromRGB(1, 0, 0)
  8. part.Material = "Neon"
  9. part.Shape = "Ball"
  10.  
  11. -- Create 2 attachments
  12. local attachment0 = Instance.new("Attachment")
  13. attachment0.Name = "Attachment0"
  14. attachment0.Parent = part
  15. attachment0.Position = Vector3.new(-1,0,0)
  16.  
  17. local attachment1 = Instance.new("Attachment")
  18. attachment1.Name = "Attachment1"
  19. attachment1.Parent = part
  20. attachment1.Position = Vector3.new(1,0,0)
  21.  
  22. -- Create a new Trail
  23. local trail = Instance.new("Trail")
  24. trail.Parent = part
  25. trail.Attachment0 = attachment0
  26. trail.Attachment1 = attachment1
  27. color1 = Color3.new(1, 0, 0)
  28. color2 = Color3.new(255/255,255/255,255/255)
  29. trail.Color = ColorSequence.new(color1, color2)
  30.  
  31. local deg = 0
  32.  
  33. while wait() do
  34.     deg = deg + 1
  35.     local p = Vector3.new(math.cos(tick()*5) * 10, 0, math.sin(tick()*5) * 4)
  36.     part.Position = (CFrame.Angles(0, math.rad(deg), 0) * CFrame.new(p)).Position + owner.Character.HumanoidRootPart.Position
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement