hello, my code gets a random Jobid of the current running servers of a chosen place with an ignorelist of jobids. I want to know if I callbacks for when it choses a Jobid that is in the ignorelist.
local GetRandomJobId = function()
local JSONDecode = HttpService:JSONDecode(HttpService:GetAsync(string.format("https://games.roblox.com/v1/games/%s/servers/Public?sortOrder=Asc&limit=100", tostring(PlaceId))))
local JobId = JSONDecode.data[math.random(1, table.getn(JSONDecode.data))].id
if table.find(JobIds, JobId) then
repeat
JobId = JSONDecode.data[math.random(1, table.getn(JSONDecode.data))].id
until not table.find(JobIds, JobId)
return JobId
else
return JobId
end
end
in my current code I am using a repeat until but is this the best way to do it?