Changing textLabel text through server script?

I’m trying to announce the winner of the round to all players on the server but for some reason, I can’t get the formatting right in this line (I think)

	winnerAnnouncement.Text = ("The winner is", name)

full code:

		local canCollect = true
		local winnerAnnouncement = game.StarterGui.ScreenGui.WinnerAnnoucement
		while canCollect == true do 
			if #list <= 1 then
				canCollect = false
				print("The winner is...", list)
				local player = game:GetService("Players"):GetPlayerFromCharacter(counted_clone.Parent)
				player:WaitForChild("leaderstats").Points.Value = player:WaitForChild("leaderstats").Points.Value + 50
				local name = player.Name
				winnerAnnouncement.Text = ("The winner is", name)
				winnerAnnouncement.Visible = true
1 Like

If you’re trying to make some sort of victory message you can do :FireAllClients()

I see lots of people make this error, you need to assign it to a PlayerGui not the StarterGui.

Should be

winnerAnnouncement.Text = "The winner is "
1 Like

This worked for me thanks haha I figured I was formatting it wrong

1 Like