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

Does this local script work? I am confused with line 3 in this script.

Asked by 8 years ago
1--Local Script
2tool = script.Parent
3tool.Equipped:connect(function()
4game.Players.LocalPlayer.JumpHeight = 100
5end)

I am confused with line 3. Someone please show me the error and make a example that works..

Sorry about my bad English.

0
I bet line 3 will make an error Scripter_Blan 25 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

I think you mean line 4

Local Player gets the player. JumpHeight is not a property of the player. JumpPower is a property of the Humanoid inside the character. To get the character, use .Character on the player. After we get the character we can get the Humanoid. Example,

1--Local Script
2local tool = script.Parent
3 
4tool.Equipped:connect(function()
5    game.Players.LocalPlayer.Character.Humanoid.JumpPower = 100
6end)

Good Luck!

If I helped, please don't forget to accept my answer.
Ad

Answer this question