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