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
--Local Script
tool = script.Parent
tool.Equipped:connect(function()
game.Players.LocalPlayer.JumpHeight = 100
end)

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,

--Local Script
local tool = script.Parent

tool.Equipped:connect(function()
    game.Players.LocalPlayer.Character.Humanoid.JumpPower = 100
end)

Good Luck!

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

Answer this question