Text Label doesn't update

Hello! I am making a game in which random events happen so to let the player know the event that is happening at the moment I added a Text Label and next to the events script I added that when an event is selected it update the Text Label but when I execute the code, this text just doesn’t appear.
BTW: My code is in a ServerScriptService script.
Here is the code:

--Event selector--
while wait(10) do
	local RandomNumber = math.random(2, 3)
	print(RandomNumber)
	
	if RandomNumber == 1 then
		TallSizeEvent()
		EventUi.SelectedEventLabel.Text = "Someone is taller"
	
	elseif RandomNumber == 2 then
		FatSizeEvent()
		EventUi.SelectedEventLabel.Text = "Someone is fat"
		
	elseif RandomNumber == 3 then
		SmallSizeEvent()
		EventUi.SelectedEventLabel.Text = "Someone is smaller"
	end
end

Any idea how to solve this?
Thanks in advance.

Is this a local script, in the player?

1 Like

You should use Remote Events to update the UIs of all players in the server. This is easily achievable by calling the function RemoteEvent:FireAllClients()

Firstly,

This should be math.random(1,3)

You should do what @ReincarnatedC said, and have the server fire an event to all clients.

1 Like

My code is in a ServerScriptService script.

This should be `math.random(1,3)<
yes you are right, I only put it this way to test the other 2 events