Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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?

1 comment

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

1 answer

✓ Accepted answer

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

2 comments

0

Thanks

0

np

This discussion is preserved as it was. New answers, comments, and votes are closed.