For some reason, its searching the number instead of getting the item from the folder.
Here’s a portion of the script:
local GunsFolder = repStor:WaitForChild("Guns")
local items = GunsFolder:GetChildren()
print("start")
local gunSelected = GunsFolder[math.random(1,#items)]:Clone()
You’re trying to index an item in the GunsFolder called “8” when you do GunsFolder[math. bla bla bla
Try to index the item from the itemstable, not from the GunsFolder object.
local gunSelected = items[math.random(1,#items)]:Clone()