Professional Documents
Culture Documents
game:GetService('TweenService'):Create(target,TweenInfo.new(tim,Enum.EasingStyle[st
yle],Enum.EasingDirection[dir]),changes):Play()
end
player.CharacterAdded:Wait();
Cloned.mainFrame.tryonButton.MouseButton1Click:Connect(function()
if Cloned.mainFrame.tryonButton.Text == "TRY-ON" then
local success, er = pcall(function()
game.ReplicatedStorage.toggleTry:FireServer(v.Parent.Parent.Shirt.ShirtTemplate,
false)
end)
if success then
Cloned.mainFrame.tryonButton.Text = "TAKE-OFF"
end
elseif Cloned.mainFrame.tryonButton.Text == "TAKE-OFF"
then
local success, er = pcall(function()
game.ReplicatedStorage.toggleTry:FireServer(StarterShirt, false)
end)
if success then
Cloned.mainFrame.tryonButton.Text = "TRY-ON"
end
end
end)
end
elseif v.Parent.Parent.PantsId.Value ~= 0 and v.Parent.Name:lower()
== "pantsclickable" then
local Cloned =
player.PlayerGui:WaitForChild("template"):Clone();
Cloned.Parent = player.PlayerGui
Cloned.Name = "current"
Cloned.mainFrame.assetImage.Image =
"https://www.roblox.com/Thumbs/Asset.ashx?
width=420&height=420&assetId="..v.Parent.Parent.PantsId.Value
Cloned.Enabled = true
Cloned.mainFrame.tryonButton.MouseButton1Click:Connect(function()
if Cloned.mainFrame.tryonButton.Text == "TRY-ON" then
local success, er = pcall(function()
game.ReplicatedStorage.toggleTry:FireServer(v.Parent.Parent.Pants.PantsTemplate,
true)
end)
if success then
Cloned.mainFrame.tryonButton.Text = "TAKE-OFF"
end
elseif Cloned.mainFrame.tryonButton.Text == "TAKE-OFF"
then
local success, er = pcall(function()
game.ReplicatedStorage.toggleTry:FireServer(StarterPants, true)
end)
if success then
Cloned.mainFrame.tryonButton.Text = "TRY-ON"
end
end
end)
end
end
end
end)
end
end