I want the player to wear a certain shirt. But it doesn't change it, it just puts it on top and the old shirt doesn't get removed. I don't understand how I'm supposed to remove it. I'm new to scripting and learning :p I appreciate the help
game.ReplicatedStorage.startShirt.OnServerEvent:Connect(function(plr) local char = plr.Character char:WaitForChild("Shirt").ShirtTemplate = game.ReplicatedStorage.Customisation.Shirts.sShirt1.ShirtTemplate end)
If I try to remove it, then it stays in a WaitForChild loop and the new shirt doesn't come on. .-.
Hi! I think I can help with this, although I too am new to scripting so bear with me. You said that when you remove the shirt, your script is stuck in a waitforchild loop. In order to avoid this, try this:
game.ReplicatedStorage.startShirt.OnServerEvent:Connect(function(plr) local char = plr.Character char:WaitForChild("Shirt"):Destroy() local newshirt = game.ReplicatedStorage.Customisation.Shirts.sShirt1:Clone() newshirt.name = "Shirt" newshirt.Parent = char end)
I hope this helps, if it does please remember to make it easier on other people trying to help and accept this answer. Comment with any questions :)