I want to make a PowerUp part but my script does not work. Why?
This Script is Supposted to make my part give me (Or other player) powers. But when i run through it, i stay the normal speed and jump height.
02 | local PowerUp = script.Parent |
03 | local SpeedUp = PowerUp.SpeedUpAmount.Value |
04 | local JumpPower = PowerUp.JumpPowerAmount.Value |
05 | local Duration = PowerUp.Duration.Value |
09 | local function GivePowers(part) |
10 | local hum = part.Parent:FindFirstChild( "Humaniod" ) |
11 | if hum and CanTouch then |
13 | local OriginalWalkSpeed = hum.WalkSpeed |
14 | local OriginalJumpPower = hum.JumpPower |
15 | hum.WalkSpeed = SpeedUp |
16 | hum.JumpPower = JumpPower |
17 | PowerUp.Transparency = 1.0 |
19 | PowerUp.Transparency = 0.0 |
20 | hum.WalkSpeed = OriginalWalkSpeed |
21 | hum.JumpPower = OriginalJumpPower |
26 | PowerUp.Touched:Connect(GivePowers) |