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

Retrieve gear from gear id in roblox catalog?

Asked by
stepatron 103
6 years ago
Edited 6 years ago

How would you have a player get gear from the roblox catalog? Is it something like

local itemId = "rbxassetid://123456789"

player.Backpack:GiveItem(itemId)
0
Remove the bracket in line 1. The bracket at the end. Remove it. User#19524 175 — 6y

2 answers

Log in to vote
0
Answered by
Griffi0n 315 Moderation Voter
6 years ago
Edited 6 years ago

Here you go

local InsertService = game:GetService("InsertService")

local GiveItem = function(Player, AssetId)
    local Gear = InsertService:LoadAsset(AssetId):GetChildren()[1]
    local Backpack = Player:WaitForChild("Backpack")
    Gear.Parent = Backpack
    InsertService:ClearAllChildren()
end

-- Example
GiveItem(player, 212641536)
Ad
Log in to vote
-3
Answered by 6 years ago

No, but you can go in the Toolbox and find ROBLOX gear from there.

0
Im just trying to use this for a gear gui stepatron 103 — 6y

Answer this question