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

Trouble making simple increased JumpPower Script. Any Solutions?

Asked by 3 years ago
Edited 3 years ago

Hello, script newbie here.

I am trying to tinker with the humanoid properties of the player, one of them being "JumpPower". I tried making a script that when the spacebar is pressed down, it increases the player's jump height by 30 studs. It did not execute the code at all when I pressed down the spacebar, I tried what I could to figure it out, then searched for solutions to this problem online to no avail.

Here is the code block:

UserInputService = game:GetService("UserInputService")
local humanjump = game.Workspace:FindFirstChild("Humanoid")

UserInputService.InputBegan:Connect(function(input,gameProcessedEvent)

    if input.KeyCode == Enum.KeyCode.Space and humanjump then
        input.humanjump.JumpPower = 30
    end
end)

What am I missing here? Do let me know.

2
The Humanoid is in the character, not workspace. If you're in a local script, just use game.Players.LocalPlayer.Character LightningLIon58 49 — 3y
0
their is no point for all of this "and humanjump....input.humanjump.JumpPower = 30"...........simply just write(after then) game.Players.LocalPlayer.Character.Humanoid.JumpPower = 30 SEPTEMBERKING2_0 0 — 3y

Answer this question