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

How can I change the JumpPower value of a humanoid with FE on?

Asked by
Kegani 31
6 years ago

Hello

I am currently attempting (even though I really suck at FE) to change the JumpPower value of all players in the server. Without FE on, I'd use this script: (note I'm using a GUI)

for _, player in pairs(game.Players:GetPlayers()) do
    if player.Character then
        local h = player.Character:FindFirstChild("Humanoid")
        h.JumpPower = 50
    end
end

Now I tried using this:

function hello(ahnon)
    return game.Workspace[ahnon].Humanoid.JumpPower == 0
end

game.ReplicatedStorage.parto.OnServerInvoke = hello

The script above is located and workspace, I have a remotefunction located in replicatedstorage named "parto" and the screengui with the script is located in startergui.

I also got this error after http://prntscr.com/ja1ogv

Thanks

1 answer

Log in to vote
0
Answered by
Avigant 2374 Moderation Voter Community Moderator
6 years ago

You should choose better variable names than things like hello or h or ahnon. Besides that, you don't need a RemoteFunction. Why return the jump power? What's the point of that, the client can access it just fine.

The error is caused by you trying to index game.Workspace with the player's player object. To get the player's character, just index player.Character (and make sure it's not nil).

Anyway, because Roblox default character networking is insecure and client-authoritative, you can simply change the jump power client-side with no need to get the server involved.

Ad

Answer this question