local player = game.Players.LocalPlayer local character = player.Character if not character or not character.Parent then character = player.CharacterAdded:wait() print 'charloaded' end game.Players.LocalPlayer.Character.Health:Destroy()
As you can probably see, im trying to delete the health regen script. However whenever this script runs:
14:16:36.233 - Health is not a valid member of Model
I have no idea how that could happen, as even if Health's parent is nil, I believe it wouldn't show a nonexistance error?
You should wait until Health is a member of the Character, using the WaitForChild
function.
local player = game.Players.LocalPlayer --wait until character exists repeat wait() until payer.Character local character = player.Character print('char loaded') --wait until health exists local health = character:WaitForChild('Health') health:Destroy()