Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to cache Roblox catalog gear?

Asked by 8 years ago

Hello, I'm trying to make a Roblox game that references gear from the catalog without adding every single gear into my game into storage.

Is there any way to accomplish this?

If so, can you give some sort of function or something?

Thank you!

0
Do you mean like listing multiple Gear to the UI? xenoslav 7 — 8y
0
I'm thinking of getting a random gear from the catalog, but I'm not trying to sound like I'm making a script request. SpazzMan502 133 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

I've wanted to do something similar before, the best approach I came up with was compiling a complete list of gear ids and putting them in a table so that i could spawn a random gear from that list. The list below is incomplete but just an example as to the setup. The script below would be used to give the player a random gear when they chat "r".

01gears = {99797357, 99797381, 99797403, 99797327, 94794774, 99641902, 99610601, 99119158, 99119198, 97161241, 99254437, 99254358, 99119261, 99254241, 99119240, 83021197, 99254203, 99254164, 92142841, 87361662, 99130630, 99033296, 98411393, 98411436, 98970218, 98341183, 98253651, 98411325, 98253626, 98253592, 98346415, 13745494, 98253569, 98219158, 97932897, 97885552, 97885508, 97885572, 97885289, 97886188, 97756645, 97712291, 97311482, 97161262, 97161295, 96669943, 96669687}
02 
03function onMsg(msg, ply)
04 if msg == "r" then
05for i = 0,10 do
06        local model = game:GetService("InsertService"):LoadAsset(gears[math.random(#gears)])
07        for _,v in pairs(model:GetChildren()) do
08                if v:IsA("Tool") or v:IsA("HopperBin") then
09                    v.Parent = ply.Backpack
10                end
11            end
12        end
13    end
14end
15 
View all 22 lines...
0
Thanks, I'll try to work that into my script. SpazzMan502 133 — 8y
0
How could I change this script so instead of it giving you gear when you chat "r", it'll just give them when you spawn? Cynical_Potatoe 5 — 5y
Ad

Answer this question