whenever some person joins it has a chance for this to happen and break the game, it’s unacceptable that it breaks the whole system when it triggers an error so i cant really do much about it the error
I assume when this happens you’re trying to reference health by Player.Health, when the player instance doesn’t have an attribute for health. This means that you’ll have to go to the players humanoid, where the health is located, and fetch it there. For example, it’d look something like such:
local player = -- However you get the player
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:FindFirstChild("Humanoid")
print(hum.Health)
wait(0.5)
repeat wait() until game.Players.LocalPlayer.Character.Humanoid —if it is a server script, you can replace LocalPlayer by Player, plr or whatever it is named
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(chr) -- meants they have a character now
local hum = chr:WaitForChild'Humanoid'
print(hum.Health, hum.MaxHealth, "got Humanoid")
end)
end)
OR
local chr = Player.Character or Player.CharacterAdded:Wait()
local hum = chr:WaitForChild'Humanoid'
print('got humanoid', hum.Health, hum.MaxHealth)