This script is supposed to allow a player to try on clothing before they buy it, but the only issue is that the clothing stays on them. I would like to have this script remove the player's pants, put on the pants that will be sold, wait for 5 seconds, then remove those pants and restore the original pants. I believe it sounds a lot more complicated than it should be. Any ideas?
local cd = script.Parent.ClickDetector local pants = script.Parent.Parent.Parent.Char.Pants cd.MouseClick:connect(function(player) if player.Character ~= nil then if player.Character:FindFirstChild("Pants") then player.Character["Pants"]:remove() pants:Clone().Parent = player.Character else pants:Clone().Parent = player.Character end end end)
local cd = script.Parent.ClickDetector local pants = script.Parent.Parent.Parent.Char.Pants cd.MouseClick:connect(function(player) if player.Character ~= nil then if player.Character:FindFirstChild("Pants") then player.Character["Pants"].Parent = game.ServerStorage pants:Clone().Parent = player.Character wait (5) player.Character.Pants:Remove() game.ServerStorage["Pants"].Parent = player.Character else pants:Clone().Parent = player.Character wait (5) player.Character.Pants:Remove() end end end)
I got it!!!!