So I'm setting a NumberValue as being the value of the players health. the following code is what I've done to do this:
local Player = game.Players.LocalPlayer
local Char = Player.Character
local Health = Char.Humanoid.Health
while true do
script.Parent.Value = Health
wait()
end
It works in studio, but for some reason, it doesn't work when using the roblox client. It just comes up saying that Char is a nil value. This is a local script in a custom health bar GUI, with the parent being a numbervalue. Can anyone help me out?

1 comment
Thanks for that. There was a slight bug with the first line. I added a new variable called 'Players' and set it as game:GetService("Players") and edited 'Player' to be 'Players.LocalPlayer'.