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?
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?
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
Thanks
np
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
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