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??

1 comment

0

If the PantsTemplate begins with http://www.roblox.com then, then do PantsTemplate:sub(32) :) #lazyanswer