iOSdeveloper

Untitled

Jan 29th, 2025
7,403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character or player.CharacterAdded:Wait()
  3. local TweenService = game:GetService("TweenService")
  4.  
  5. -- shits to load the trail
  6. local function createTrailPart(position)
  7. local trailPart = Instance.new("Part")
  8. trailPart.Size = Vector3.new(1, 1, 1)
  9. trailPart.Color = Color3.fromRGB(255, 0, 0)
  10. trailPart.Material = Enum.Material.Neon
  11. trailPart.Anchored = true
  12. trailPart.CanCollide = false
  13. trailPart.Transparency = 0.5
  14. trailPart.Position = position
  15. trailPart.Parent = workspace
  16. return trailPart
  17. end
  18.  
  19.  
  20. local function createTween(part, targetPosition)
  21. local tweenInfo = TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
  22. local tween = TweenService:Create(part, tweenInfo, {Position = targetPosition})
  23. tween:Play()
  24. end
  25.  
  26. -- updates the trail
  27. local function updateTrail()
  28. local trailParts = {}
  29. local trailLength = 10
  30.  
  31.  
  32. for i = 1, trailLength do
  33. local part = createTrailPart(character.HumanoidRootPart.Position)
  34. table.insert(trailParts, part)
  35. end
  36.  
  37.  
  38. while true do
  39. -- Moves thingys
  40. for i = trailLength, 2, -1 do
  41.  
  42. createTween(trailParts[i], trailParts[i - 1].Position)
  43. end
  44.  
  45. -- Moves humanoidd part 🤓
  46. createTween(trailParts[1], character.HumanoidRootPart.Position - character.HumanoidRootPart.CFrame.LookVector * 2)
  47.  
  48. -- the size for the fucking traid :D
  49. for i = 1, trailLength do
  50. trailParts[i].Size = Vector3.new(1, 1, 1) * (1 - (i - 1) / trailLength) -- smth
  51. trailParts[i].Transparency = 0.5 * (1 - (i - 1) / trailLength) -- smth
  52. end
  53.  
  54. -- wait thingy shii
  55. wait(0.1)
  56. end
  57. end
  58.  
  59. updateTrail()
Add Comment
Please, Sign In to add comment