[help] updating text labels to all players in-game

need help on updating scores on text labels after a round ends
(after a round finished the labels are staying default and not updating)

im using a localscript on the screengui with the script below also using remove event:

local remoteEvent = game.ReplicatedStorage:WaitForChild(“UpdatePointsEvent”)

local function updatePoints(bluePoints, redPoints)

local screenGui = script.Parent – Altere para a referência correta ao ScreenGui

local bluePointsLabel = screenGui:WaitForChild(“BluePointsLabel”)

local redPointsLabel = screenGui:WaitForChild(“RedPointsLabel”) –

bluePointsLabel.Text = ": " … bluePoints

redPointsLabel.Text = ": " … redPoints

end

remoteEvent.OnClientEvent:Connect(updatePoints)

how im adding points in server script service:

if not roundEnded then
roundEnded = true
print(“Red Team won.”)
addPointsToTeam(“RedTeam”)
movePlayersToLobby()
respawnPlayers()

In the code you showed, you never fired the remote event.

-- add this to the server script
game.ReplicatedStorage:WaitForChild("UpdatePointsEvent"):FireAllClients(-- parameters)

tysm bro, actually worked!! :stuck_out_tongue:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.