while true do
wait(.5)
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character
if not character or not character.Parent then
character = player.CharacterAdded:wait()
end
if character.Humanoid.Health == 90 then
script.Parent.Transparency = 0.9
end
end
so thats the coodee, im trying to make a thing to become more transparent when the player's health gets over to 90. its showing an error on line 5 ("local character = player.Character ") the error just shows " attempt to index nil with 'Character' "

1 comment
This is a server script, if you want this part to become invisible only for the player who has 90 health than you should make this a LocalScript and put inside of StarterCharacterScripts