“pantidbox” is Basically a Text Box for I’m using the inserting pantTemplate id.
I’m Using the Changed
for checking The TextBox’s Text Value:
pantidbox.Changed:Connect(getpantid(tonumber(pantidbox.Text)))
getpantid() function:
function getpantid(id)
local sucsess,name = pcall(function()
market:GetProductInfo(id,Enum.InfoType.Asset)
end)
if sucsess then
pantidname.Text = name
testpant.PantsTemplate = id
else
pantidname.Text = "No Pants Selected"
end
end
and I’m Using this function to initilize the UI:
Initilizing Function
function startplugin()
frame2 = Instance.new("Frame",frame1)
frame2.Size = UDim2.new(1,0,0.95,0)
frame2.Position = UDim2.new(0,0,0.05,0)
frame2.BackgroundColor3 = Color3.fromRGB(200,200,200)
frame2.BorderSizePixel = 5
dressbutton = Instance.new("TextButton",frame1)
dressbutton.Size = UDim2.new(0.25,0,0.05,0)
dressbutton.Position = UDim2.new(0,0,0,0)
dressbutton.BackgroundColor3 = frame2.BackgroundColor3
dressbutton.Text = "Clothing"
dressbutton.BorderSizePixel = 0
dressbutton.TextScaled = true
viewf = Instance.new("ViewportFrame",frame2)
viewf.BackgroundColor3 = Color3.fromRGB(150,150,150)
viewf.Size = UDim2.new(0.4,0,0.9,0)
viewf.Position = UDim2.new(0.55,0,0.05,0)
if vfrig ~= nil then vfrig:Destroy() end
vfrig = rig:Clone()
vfrig.Parent = viewf
vfcam = Instance.new("Camera",viewf)
viewf.CurrentCamera = vfcam
local target = Vector3.new(4,4,4)
vfrig:SetPrimaryPartCFrame(CFrame.new(0,0,0))
vfcam.CFrame = CFrame.new(target,vfrig.PrimaryPart.Position)
viewf.ZIndex = 2
viewf.BackgroundTransparency = 1
platformimg = Instance.new("ImageLabel",frame2)
platformimg.Size = UDim2.new(0.4,0,0.9,0)
platformimg.Position = UDim2.new(0.55,0,0.05,0)
platformimg.Image = "rbxassetid://183400826"
rigdisp = Instance.new("TextLabel",frame2)
rigdisp.Size = UDim2.new(0.4,0,0.05,0)
rigdisp.Position = UDim2.new(0.05,0,0.05,0)
rigdisp.Text = vfrig.Name.." RigType:"..(string.match(tostring(vfrig.Humanoid.RigType),"R6") or string.match(tostring(vfrig.Humanoid.RigType),"R15"))
rigdisp.TextScaled = true
rigdisp.BackgroundColor3 = frame2.BackgroundColor3
rigdisp.BorderSizePixel = 0
pantidname = Instance.new("TextLabel",frame2)
pantidname.Text = "No Pants Inserted"
pantidname.Size = UDim2.new(0.4,0,0.075,0)
pantidname.BackgroundColor3 = Color3.fromRGB(175,175,175)
pantidname.Position = UDim2.new(0.05,0,0.2,0)
pantidname.TextScaled = true
pantidname.BorderSizePixel = 0
pantidbox = Instance.new("TextBox",frame2)
pantidbox.PlaceholderText = "Insert ID..."
pantidbox.Text = ""
pantidbox.Size = UDim2.new(0.4,0,0.05,0)
pantidbox.BackgroundColor3 = Color3.fromRGB(150,150,150)
pantidbox.Position = UDim2.new(0.05,0,0.275,0)
pantidbox.TextScaled = true
pantidbox.BorderSizePixel = 0
if not vfrig:FindFirstChildOfClass("Pants") then
testpant = Instance.new("Pants",vfrig)
testpant.Name = "Pants"
end
end
btw Everything shows up correctly,But the plugin recognizes “pantidbox” is a nil value.