Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script wont work? My script is where you get boosted jumpower when you click button.

Asked by 6 years ago
Edited 6 years ago

My script is where you get boosted jumpower when you click button. Can you please help me? Fix my script?

Here is script in the button:

script.Parent.Touched:connect(function(plr)
        plr.JumpPower=90

What am i doing wrong?

0
that doesn't work for guis though, it only works for base parts, to do that for gui, you have to use the MouseButton1Click event theking48989987 2147 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

The problem here is that JumpPower isn't a property of the player object, it is a property of the humanoid, something like this might work :

script.Parent.Touched:connect(function(hit)
    local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
    if plr then
        plr.Character.Humanoid.JumpPower=90
    end
end)

Also: you forgot to close the event with an end), and the argument of the function in the Touched event isn't the player that touched an object, it is the thing that touched the object

0
Thanks Bowser_Films -50 — 6y
0
np theking48989987 2147 — 6y
Ad

Answer this question