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

How do you get the market place id of pants?

Asked by 6 years ago

So I've tried

tonumber(plr.Character:FindFirstChild('Pants').PantsTemplate)


but it returns nil

example:

local plr = game.Players.LocalPlayer

wait(1)

local template = tonumber(plr.Character.Pants.PantsTemplate)
local pantsproduct = game.MarketplaceService:GetProductInfo(template)
print(pantsproduct.AssetTypeId)

it will print an error because it's a nil value

is there any way to get around this WITHOUT having a separate value and or object??

0
If the PantsTemplate begins with `http://www.roblox.com` then, then do `PantsTemplate:sub(32)` :) #lazyanswer TheeDeathCaster 2368 — 6y

Answer this question