Recently go into scripting and wanted to make a character customization menu as my first project, but I can't get it to work. Sorry if there are any obvious errors that I didn't notice!
local plr = script.Parent.Parent.Parent.Parent.Parent local humanoid = script.Parent.Parent.Parent.Parent.Parent:FindFirstChild("Humanoid") function onClicked() if humanoid ~= nil then local shirtchange1 = game.ReplicatedStorage.Shirt1:clone() shirtchange1.Parent = plr if shirtchange1.Parent == plr then plr:FindFirstChild("Shirt"):Destroy() end end end script.Parent.MouseButton1Click:connect(onClicked)
local plr = game.Players.LocalPlayer --Finds the player who launches this script local physicalplr = game.Workspace[plr.Name] -- finds the player in workspace local humanoid =physicalplr:findFirstChild("Humanoid") --finds the humanoid in the player function onClicked() if humanoid ~= nil then local shirtchange1 = game.ReplicatedStorage.Shirt1:clone() shirtchange1.Parent = physicalplr if shirtchange1.Parent == physicalplr then physicalplr:findFirstChild("Shirt"):Destroy() end end end script.Parent.MouseButton1Click:connect(onClicked)