Script is not showing correct value for Ieaderstats

Script always shows 0 for height.Value any ideas on how to fix this?

Server Script in StarterCharacterScripts:

local char = script.Parent
local humanoid = char:WaitForChild("Humanoid")
local plr = game.Players:GetPlayerFromCharacter(char)
local height = plr:WaitForChild("leaderstats"):WaitForChild("Essence")

local function Doheight()
    print(height.Value) -- This is what shows 0 even though height.Value is actually higher
    if height.Value > 50 then
        humanoid.HipHeight = height.Value / 25
    else
        humanoid.HipHeight = 2
    end
end

height:GetPropertyChangedSignal("Value"):Connect(Doheight)

Doheight()

Thank you

Are you changing the height on the server side?

no it changes on a local script… Is that the issue?

yes, local changes do not replicate to the server unless under extremely special circumstances

(an example of such circumstance is the player.Character’s location, thats one of the only things that actually replicate from client to server from what I know)

Thank you so much, that helped me a lot

1 Like