SurfaceUI wont change text

local Layers = workspace:WaitForChild("Layers")

local RS = game:GetService("ReplicatedStorage")

local CodeResetStatus = RS:WaitForChild("CodeResetStatus")

local function SetCodePos(Layer,WallSide)
	
	print(WallSide)
	
	if Layer == 1 then
		
		local ChosenPos = UDim2.new(Random.new():NextNumber(0,0.875),0,Random.new():NextNumber(0,0.75),0)

		local ChosenCode = math.random(1000,9999)

		Layers:FindFirstChild(tostring(Layer)):FindFirstChild(WallSide).CodeDisplay.Display.Text = tostring(ChosenCode)

		Layers:FindFirstChild(tostring(Layer)):FindFirstChild(WallSide).CodeDisplay.Display.Position = ChosenPos
		
		Layers:FindFirstChild(tostring(Layer)):FindFirstChild(WallSide).CodeDisplay.Display.Rotation = math.random(-23,23)

		task.delay(10,function()

			Layers:FindFirstChild(tostring(Layer)):FindFirstChild(WallSide).CodeDisplay.Display.Text = ""

		end)
		
	end
	
end

while true do
	
	for Layer = 1,2 do -- 1,#Layers:GetChildren()
		
		local WallSides = {
			"Front";
			"Back";
			"Left";
			"Right";
		}

		local ChosenWallSide = math.random(1,#WallSides)

		SetCodePos(Layer,WallSides[ChosenWallSide])
		
	end
	
	-- Timer
	
	local ResetTime = 540
	
	for i = ResetTime,0,-1 do
		
		local mins = math.floor(i / 60)

		local remainingsecs = i % 60
		
		if math.clamp(i,480,489) == i or math.clamp(i,420,429) == i or math.clamp(i,360,369) == i or math.clamp(i,300,309) == i or math.clamp(i,240,249) == i or math.clamp(i,180,189) == i or math.clamp(i,120,129) == i or math.clamp(i,60,69) == i or math.clamp(i,0,9) == i then
			
			CodeResetStatus.Value = mins .. ":0" .. remainingsecs
			
		else
			
			CodeResetStatus.Value = mins .. ":" .. remainingsecs
			
		end

		task.wait(1)
		
	end
	
end

I am trying to make it change text to a 4 digit random generated number but it will only set the rotation and pos but not the text

Anything in your output at all?

Not sure if I created your objects exactly but I tried your code and it seemed to work outside of the rotation of the textlabel looking odd(this was because I didn’t have background set full transparent) but it did set the text and cleared it after 10 seconds. Are you sure the surfaceGui is facing the way you expect to see the text?

No nothing appears in the output

Yes I. Even manually set the text in test mode

That’s strange. How is it not printing anything, yet your model is still able to rotate?

Try having the script print something like “Line _, Success” for anything involving the Text or numbers associated to see if it is actually getting that far.

Code and paste the script and try replicating what I have for yiurself

I can send you a file of the world if necessary

Attach a simple rbxl file in your message and I’ll take a look.

I fixed the issue for some reason the task.wait() code was causing the issue