New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Still have questions? Join our Discord server and get real time help.
Log in to vote

Can I set JumpPower and Health from StarterPlayerScripts in FE?

Asked by
Scaii_0 131
1 year ago

So I have a script in the StarterPlayerScripts, and it basically finds some values and sets the JumpPower and Health to that:

local p = game.Players.LocalPlayer

local hs = p:WaitForChild("Stats").HealthStat.Value
local js = p:WaitForChild("Stats").JumpStat.Value
print('values found')

    print('character found')

local hu = c:WaitForChild("Humanoid")
print('humanoid found')

hu.MaxHealth = hs + 100
hu.Health = hu.MaxHealth
print('health set')

hu.JumpPower = (js/10) + 50
print('jump set')


So, in game it does print 'jump set' and 'health set' but when I check the values, they remain the same.

Would I have to use a script in StarterCharacter and use RemoteEvents? If so could you provide me with the changes I would have to make.

Thank you.

Yeah you'd have to use events. MachoPiggies 455 — 1y

2 answers

Log in to vote
Answered by 1 year ago

Assuming you're using filtering enabled, they're staying the same because they're only changing locally. To change the values "officially", you have to do it from a serverscript.

  1. Either subscribe to the "PlayerAdded" event in a serverscript, and then subscribe to that player's "CharacterAdded" event, changing the values of the humanoid from there,


Make a script in "StarterCharacterScripts" (Serverside of course), and then edit the humanoid values. Though, in order to get the humanoid, you have to do this line of code first:

local humanoid = script.Parent:WaitForChild("Humanoid")

This is because everytime a player's character is loaded, this script will be parented to that player's character. :WaitForChild("Humanoid") is optional, but recommended, since the humanoid could have a chance of loading late, thus making the script think of it as "nil", causing an error.

Log in to vote
Answered by
Zuraax 45
1 year ago

You should put this script into PlayerStarterCharacter as it's modifying Humanoid properties

Answer this question