Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local part = script.Parent
- local powerupSpeed = 20
- local debounce = false
- local timer = 15
- local particleEmitter = part.ParticleEmitter
- local soundEffect = part.SoundEffect
- part.Touched:Connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") and debounce == false and not hit.Parent:FindFirstChild("Powerup")
- then
- debounce = true
- local powerup = Instance.new("StringValue", hit.Parent)
- powerup.Name = "Powerup"
- part.Transparency = 1
- soundEffect:Play()
- local char = hit.Parent
- local humanoid = char:WaitForChild("Humanoid")
- particleEmitter.Parent = char.HumanoidRootPart
- local humChildren = humanoid:GetChildren()
- for i,child in pairs(humChildren) do
- if child:isA("NumberValue") then
- child.Value = 5
- humanoid.WalkSpeed = 32
- if child.Name == "BodyProportionScale" then
- child.Value = 0
- end
- if child.Name == "BodyTypeScale" then
- child.Value = 0
- end
- end
- end
- wait(timer)
- for i,child in pairs(humChildren) do
- if child:isA("NumberValue") then
- child.Value = 1
- humanoid.WalkSpeed = 16
- if child.Name == "BodyTypeScale" then
- child.Value = 0
- end
- if child.Name == "BodyHeightScale" then
- child.Value = 1.05
- end
- if child.Name == "BodyProportionScale" then
- child.Value = 0
- end
- end
- end
- debounce = false
- particleEmitter:Destroy()
- powerup:Destroy()
- part:Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement