RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Write me a script that turns the player into the color black when their health reaches 0"
-- server script local function onCharacterAdded(character) local humanoid = character:WaitForChild("Humanoid") humanoid.Died:Connect(function() for _, part in ipairs(character:GetChildren()) do if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then part.BrickColor = BrickColor.new("Black") end end end) end game.Players.PlayerAdded:Connect(function(player) if player.Character then onCharacterAdded(player.Character) end player.CharacterAdded:Connect(onCharacterAdded) end)