I'm trying to make a catalog which allows players to change their clothing. Here's what I've came up with so far, any suggestions on how to make it work?
P.s I haven't been trying to script for long so expect noob mistakes lol
local player = game.Players.LocalPlayer
local shirt = game.ServerStorage:findFirstChild("Shirt")
local pants = game.ServerStorage:findFirstChild("Pants")
debounce = true
function Click()
local clothing = player.Character:GetChildren()
if clothing.className == "Pants" or clothing.className == "Shirt" then
clothing:destroy()
shirt:Clone().Parent = player.Character
pants:Clone().Parent = player.Character
end
end
script.Parent.MouseButton1Down:connect(Click)

2 comments
Perfect! Thank you so much
You should use game.Players.LocalPlayer.Character instead of finding the character by name.