What evert he leaderstats is or if it even changes I want the maxhealth of a player to equal to it. Ive tried many things but I can't seem to change the max health being always = to a leaderstat. My leaderstat script is fine.
local yourplayer = --fill this in local yourleaderstat = --fill this in local stat = game.Players[yourplayer].leaderstats[yourleaderstat] stat:GetPropertyChangedSignal("Value"):Connect(function(val) yourplayer.Character.Humanoid.MaxHealth = stat.Value yourplayer.Character.Humanoid.Health = stat.Value end)
It is difficult to provide a script for you since we have no reference as to what your system is doing, but this may help you.
You could use :GetPropertyChangedSignal
on your LeaderStatValue to determine when it the Value has changed like so:
LeaderStatMaxHealth:GetPropertyChangedSignal("Value"):Connect(function() print("Value has changed") end)
Edit: Since I'm unsure on how comfortable with this you might be I'll link you to an article. https://developer.roblox.com/en-us/api-reference/function/Instance/GetPropertyChangedSignal