Hello, I’ve made a table that consists of 5 text labels and for some reason when I try to loop through the table, it doesn’t work and the output doesn’t print any error…
Here is the code:
local reqnum = 0
local labels = {frame.PatientName1,frame.PatientName2,frame.PatientName3,frame.PatientName4,frame.PatientName5}
ReplicatedStorage.HospitalSystem.PatientEvent.OnServerEvent:Connect(function(plr,regiment)
reqnum = reqnum + 1 -- Number of patient request
for i,v in ipairs(labels) do
if reqnum == v.RequestNum then
v.Visible = true
v.Text = plr.Name.."//"..regiment
elseif reqnum > 5 then
print("Too many requests")
end
end
end)
“RequestNum” is a number value inside each one of the 5 text labels.