Where can I put this script at? and is it supposed to be local or not?
local Lives = 5
game:GetService('Players').PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
Lives = Lives - 1
if Lives == 1 then
game.StarterGui:SetCore("ChatMakeSystemMessage",
{
Text = player.DisplayName.."(@"..player.Name..") now has".. Lives.. " Life!",
Color = Color3.fromRGB(120, 0, 0),
Font = Enum.Font.SourceSansBold,
TextSize = 18,
})
else
game.StarterGui:SetCore("ChatMakeSystemMessage",
{
Text = player.DisplayName.."(@"..player.Name..") now has".. Lives.. " Lives!",
Color = Color3.fromRGB(math.random(0,255), math.random(0,255), math.random(0,255)),
Font = Enum.Font.SourceSansBold,
TextSize = 18,
})
end
if Lives == 0 then
game.StarterGui:SetCore("ChatMakeSystemMessage",
{
Text = "💀 "..player.DisplayName.."(@"..player.Name..") has died. 💀",
Color = Color3.fromRGB(0, 0, 0),
Font = Enum.Font.SourceSansBold,
TextSize = 18,
})
end
end)
end)
end)