Advertisement
InTesting

(Localscript, non-VSB) Try on clothing Gui

May 15th, 2019
1,556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.96 KB | None | 0 0
  1. print'Step 2: Name them "ShirtProductId" or "PantsProductID"'print'Depending pm what type of clothing you are selling.   'print'Step 3: Change their value (found in properties tab)  'print'into your asset id.'local a=game:GetService("Players")[game:GetService("Players").LocalPlayer.Name]local b=Instance.new("ScreenGui",a.PlayerGui)local c=Instance.new("Frame",b)c.Size=UDim2.new(.5,0,.5,0)c.ClipsDescendants=true;c.AnchorPoint=Vector2.new(.5,.5)c.Selectable=true;c.Active=true;c.Draggable=true;local d=Instance.new("TextLabel",c)d.Size=UDim2.new(.5,0,.25,0)d.Text='< Shirt >'local e=Instance.new("TextButton",c)e.Size=d.Size;e.Text='Try on Shirt'local f=Instance.new("TextButton",c)f.Size=d.Size;f.Text='Buy Shirt'local g=Instance.new("TextLabel",c)g.Size=d.Size;g.Text='< Pants >'local h=Instance.new("TextButton",c)h.Size=d.Size;h.Text='Try on Pants'local i=Instance.new("TextButton",c)i.Size=d.Size;i.Text='Buy Pants'local j=Instance.new("TextLabel",c)j.Size=UDim2.new(1,0,.125,0)c.Position=UDim2.new(1.5,0,.5,0)d.Position=UDim2.new(-.5,0,.25,0)e.Position=UDim2.new(-.5,0,.5,0)f.Position=UDim2.new(-.5,0,.75,0)g.Position=UDim2.new(1,0,.25,0)h.Position=UDim2.new(1,0,.5,0)i.Position=UDim2.new(1,0,.75,0)j.Position=UDim2.new(0,0,-.125,0)local function k(l)for m,n in pairs(l:GetDescendants())do if n:IsA'Frame'or n:IsA'TextLabel'or n:IsA'TextBox'or n:IsA'TextButton'then if n:IsA'Frame'then n.BackgroundTransparency=.5 else n.Font=Enum.Font.SciFi;n.TextScaled=true;n.TextColor3=Color3.new(255,255,255)end;n.BackgroundColor3=Color3.new(0,0,0)n.BorderSizePixel=0 end end end;k(b)local o=false;local p=true;local q=false;local r=false;local function s()c:TweenPosition(UDim2.new(.5,0,.5,0))wait(1)if p then j.Text=''j:TweenPosition(UDim2.new(0,0,0,0))wait(1)c.Draggable=true;local t='Try Clothing Gui by CHL'for u=1,t:len()do j.Text=string.sub(t,1,u)wait(.05)end;p=false end;c.Draggable=true end;local function v()d:TweenPosition(UDim2.new(0,0,.25,0))wait(.25)e:TweenPosition(UDim2.new(0,0,.5,0))wait(.25)f:TweenPosition(UDim2.new(0,0,.75,0))wait(.25)end;local function w()g:TweenPosition(UDim2.new(.5,0,.25,0))wait(.25)h:TweenPosition(UDim2.new(.5,0,.5,0))wait(.25)i:TweenPosition(UDim2.new(.5,0,.75,0))wait(.25)end;local function x()d:TweenPosition(UDim2.new(-.5,0,.25,0))wait(.25)e:TweenPosition(UDim2.new(-.5,0,.5,0))wait(.25)f:TweenPosition(UDim2.new(-.5,0,.75,0))wait(.25)end;local function y()g:TweenPosition(UDim2.new(1,0,.25,0))wait(.25)h:TweenPosition(UDim2.new(1,0,.5,0))wait(.25)i:TweenPosition(UDim2.new(1,0,.75,0))wait(.25)end;local function z()c.Draggable=false;if c.Position~=UDim2.new(.5,0,.5,0)and o then c:TweenPosition(UDim2.new(.5,0,.5,0))wait(1)end;c:TweenPosition(UDim2.new(1.5,0,.5,0))end;x()y()z()o=true;local A=game:GetService("Players")local B=A.LocalPlayer:GetMouse()local C=true;local D=nil;local E=nil;local F=nil;local G=nil;B.Button1Down:Connect(function()local H=B.Target;if H and C then if H.Parent then local I=H.Parent;if I:FindFirstChildWhichIsA'Humanoid'and A:GetPlayerFromCharacter(I)==nil and I:FindFirstChild('DisableGui')==nil and(I:FindFirstChildWhichIsA('Shirt')or I:FindFirstChildWhichIsA('Pants'))then C=false;local J=I:FindFirstChildWhichIsA('Shirt')local K=I:FindFirstChildWhichIsA('Pants')if J and K==nil then if I:FindFirstChild'ShirtProductId'then if I:FindFirstChild'ShirtProductId':IsA'IntValue'then if c.Position==UDim2.new(1.5,0,.5,0)then s()end;v()D=J.ShirtTemplate;y()F=I:FindFirstChild'ShirtProductId'.Value else error'Can not find original asset Id of shirt. Insert a int value named "ShirtProductId" and insert the Id in the value.'end else error'Can not find original asset Id of shirt. Insert a int value named "ShirtProductId" and insert the Id in the value.'end elseif J==nil and K then if I:FindFirstChild'PantsProductId'then if I:FindFirstChild'PantsProductId':IsA'IntValue'then if c.Position==UDim2.new(1.5,0,.5,0)then s()end;w()x()E=K.PantsTemplate;G=I:FindFirstChild'PantsProductId'.Value else error'Can not find original asset Id of pants. Insert a int value named "PantsProductId" and insert the Id in the value.'end else error'Can not find original asset Id of pants. Insert a int value named "PantsProductId" and insert the Id in the value.'end elseif J and K then if I:FindFirstChild'PantsProductId'then if I:FindFirstChild'PantsProductId':IsA'IntValue'then if g.Position~=UDim2.new(.5,0,.25,0)then if c.Position==UDim2.new(1.5,0,.5,0)then s()end;w()E=K.PantsTemplate;G=I:FindFirstChild'PantsProductId'.Value end else error'Can not find original asset Id of pants. Insert a int value named "PantsProductId" and insert the Id in the value.'end else error'Can not find original asset Id of shirt. Insert a int value named "ShirtProductId" and insert the Id in the value.'end;if I:FindFirstChild'ShirtProductId'then if I:FindFirstChild'ShirtProductId':IsA'IntValue'then if d.Position~=UDim2.new(0,0,.25,0)then if c.Position==UDim2.new(1.5,0,.5,0)then s()end;v()D=J.ShirtTemplate;F=I:FindFirstChild'ShirtProductId'.Value end else error'Can not find original asset Id of shirt. Insert a int value named "ShirtProductId" and insert the Id in the value.'end else error'Can not find original asset Id of shirt. Insert a int value named "ShirtProductId" and insert the Id in the value.'end end;C=true else if c.Position~=UDim2.new(1.5,0,.5,0)then if d.Position==UDim2.new(0,0,.25,0)then x()end;if g.Position==UDim2.new(.5,0,.25,0)then y()end;z()D=nil;E=nil;G=nil;F=nil end end end end end)local L=game:GetService("MarketplaceService")e.MouseButton1Click:Connect(function()local M=A[A.LocalPlayer.Name].Character;local N=M:FindFirstChildWhichIsA'Shirt'if N then N.ShirtTemplate=D else local O=Instance.new("Shirt",M)O.ShirtTemplate=D end end)h.MouseButton1Click:Connect(function()local M=A[A.LocalPlayer.Name].Character;local P=M:FindFirstChildWhichIsA'Pants'if P then P.PantsTemplate=E else local Q=Instance.new("Pants",M)Q.PantsTemplate=E end end)f.MouseButton1Click:Connect(function()if F~=nil then L:PromptPurchase(A.LocalPlayer,F)end end)i.MouseButton1Click:Connect(function()if G~=nil then L:PromptPurchase(A.LocalPlayer,G)end end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement