So, I think the problem is the variable in the script I guess? Cause when I see the output its the problem maybe? So here's my script:
Hum = script.Parent.Humanoid statVal = game.Players.LocalPlayer.Stats --Stats is the leaderboard stuff But no need to change it Hum.Health.Changed:connect(function() statVal.Health.Value = Hum.Health end)
Output :
17:09:19.219 - Workspace.Player1.HealthDetect:3: attempt to index field 'Health' (a number value)
Note : Script is inside StarterCharacterScript.
Please answer in the answer bar, not comments.
EDIT For FlaminSparrow : Another problem when I type this code :
Hum = script.Parent.Humanoid statVal = game.Players.LocalPlayer.Stats Hum.HealthChanged:connect(function() statVal.Health.Value = Hum.Health end)
Output :
17:32:03.756 - Players.Player1.PlayerGui.ScreenGui.TabFrame.StatFrame.Health.LocalScript:4: attempt to concatenate global 'HealthPercentage' (a userdata value)
Hum = script.Parent.Humanoid statVal = game.Players.LocalPlayer.Stats statHealth = statVal:WaitForChild('Health') Hum.HealthChanged:connect(function() statHealth.Value = script.parent.Humanoid.Health -- I have had similar problems to this and this is what i did to fix it end)
I do not know if this will work
I am pretty sure you gotta use
Hum.HealthChanged:connect(function() statVal.Health.Value = Hum.Health end)