Get item from catalog by ID

What do you want to achieve? Keep it simple and clear!
I want to make Gui which get you item from catalog. When player insert ID of some gear, gear add to my backpack and also hand.
What solutions have you tried so far?
I make this script.

repeat wait() until game.Players.LocalPlayer
script.Parent.FocusLost:connect(function()pcall(function()
		game:GetService("MarketplaceService")
	end)
end)

But idk how to make that item adding to backpack of player?

1 Like

I found a video you can watch:

if you don’t want to watch it, you can do:

game:GetService("InsertService"):LoadAsset(YourIdHere).Parent = Player.Backpack

Thx Ill try this. Hopefully i can did it

Its wrong. Im change your script, but its not working. When im say get item from catalog. I was referring to textbox and inside of this, player can put random ID of gear and get item.

local Player = game.Players.LocalPlayer
game:GetService("InsertService"):LoadAsset(10472779).Parent = Player.Backpack

error

Just to be sure, you cannot get player from a Normal script… You need to use remote events or local script.

Yeah. Ok so im close to answer. Here is some script

local text = script.Parent
local catalog = game:GetService("MarketplaceService")
local backpack = game.Players.LocalPlayer.Backpack

text.FocusLost:Connect(function(press)
	if press then
		game:GetService("InsertService"):LoadAsset(text.Text).Parent = backpack
	end
end)

The only thing is output say this:


How can i use Remote Event can you help pls?

image

This is where you can learn and know how to use remote events. I suggest searching youtube or using the Lua documentation of Remote Events. RemoteEvent | Documentation - Roblox Creator Hub
https://www.youtube.com/watch?v=GwhPXyYKkwU