Advertisement
KashTheKingYT

Powerup Script

Nov 5th, 2021
1,741
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. local part = script.Parent
  2. local powerupSpeed = 20
  3. local debounce = false
  4. local regularWalkspeed = game.StarterPlayer.CharacterWalkSpeed
  5. local timer = 5
  6.  
  7. part.Touched:Connect(function(hit)
  8.     if hit.Parent:FindFirstChild("Humanoid") and debounce == false
  9.     then
  10.         debounce = true
  11.         part.Transparency = 1
  12.         local char = hit.Parent
  13.         local humanoid = char:WaitForChild("Humanoid")
  14.         humanoid.WalkSpeed = powerupSpeed
  15.         wait(timer)
  16.         humanoid.WalkSpeed = regularWalkspeed
  17.         debounce = false
  18.         part:Destroy()
  19.     end
  20. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement