local TL = script.Parent
local amount = 25000
local v = game.Workspace["Death Counter"].Team2.Deaths.Value
TL.TextColor = game.Teams.Team2.TeamColor
while true do
TL.Text = amount -v
wait(0.05)
end
The script shows how many lives the team has, but other players can’t see the updated text when a person dies but if someone dies from another team then it updates for everyone.
Is this in a local script? If so just move it to a normal script
Also im not familier with these stuff but wasn’t there an on-death event or something?
You can set up a Humanoid.Died connection to every character that respawns then check if they were on and team and then decrease the value and send a remote event using :FireAllClients to update the text on it
You dont have to do the remote event part you can also use a for i, v in pairs to change each players text value in there guis but I personally like using the remote.
As for the .Died you use it with a .PlayerAdded and CharacterAdded.
ex.
-- server side --
players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
hum.Died:Connect(function()
diedRemote:FireAllClients(char.Team.Value)
end)
end)
end)
-- client --
diedRemote.OnClientEvent:Connect(function(team)
if -check team stuff with the arg then
textLable.Text = thingy
end
end)