im trying to make a script that gets a table from a datastore,picks a value at random, and returns it. here is the script so far:
script.Parent.RequestAdToShow.OnServerInvoke = function() ds=game:GetService("DataStoreService"):GetDataStore("Impressions","TestService") TestTabledtable=ds:GetAsync("Ads") numb=#TestTable id=math.random(1,numb) line=adtable[id] print(line)--should be the value end
the table allready exists(tested with a plugin) and i get this error:
Workspace.AdService.ViewService:6: bad argument #2 to 'random' (interval is empty)
12:25:37.696 - Script 'Workspace.Part.SurfaceGui.Script', Line 6
12:25:37.698 - Stack End
the length of the table is reported by a print to be 0, but i tested it with a plugin and its at least 6 long i have tried everything i can think of, any ideas?