RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Write me a script that changes the player's color when they reach a certain amount of health"
-- server script local function onCharacterAdded(character) local humanoid = character:WaitForChild("Humanoid") humanoid:GetPropertyChangedSignal("Health"):Connect(function() if humanoid.Health <= 50 then character.Head.BrickColor = BrickColor.new("Bright red") else character.Head.BrickColor = BrickColor.new("Bright blue") end end) end game.Players.PlayerAdded:Connect(function(player) if player.Character then onCharacterAdded(player.Character) end player.CharacterAdded:Connect(onCharacterAdded) end)