[FIXED]Players can't equip shirts from my customization menu

You can write your topic however you want, but you need to answer these questions:

What I am Trying To Make

Hello, I am trying to add a clothing GUI to my game where players can change their shirts or pants, Basically a customization GUI. When they first join the game.

The Issue

I have run the script multiple times and tried to solve the problem but apparently it just won't work. Every time when I click on the Shirt Button it doesn't the player does not equip the shirt.

Solutions I Have Tried

I have watched YouTube videos, I have asked my friends on discord, I have also read the whole Output tab in Roblox Studio but I just can't solve this

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

game.ReplicatedStorage.Events.ShirtEvent1.OnServerEvent:connect(function(plr)
	
local char = plr.Character

char:findFirstChild("Shirt").ShirtTemplate = "http://www.roblox.com/asset/?id=5008248562"

end)

Please help me and don’t just give me the answer because if I run to this problem next time I won’t be able to fix it on my own so please Tell me how to fix it thank you very much.

1 Like

Spelling error, i suggest you fix that.

@dibblydubblydooIt still won’t work I tried fixing the spelling error

Did you add the mousclick event when the player clicks the gui? And did you actually equip it to the shirt child insude the character?

Yes i have done all of that. I have tried most possible and Common Sense solutions but they just stay the same @dibblydubblydoo

Instead of using local char = plr.Character you should use
local char = plr.Character or plr.CharacterAdded:Wait()
if its don’t work tell me the output.

@Beez_upim sorry to bother you but I tried them both the script is just not working.
is there any other solutions you think would work.

Try changing the shirts properties inside the shirt object inside the model.

I am not using a model it is a player they can pick shirts and i have added GUI’s but when they click on them it doesn’t change their Shirt it stays the same

So i did it and its worked so the problem is that “Shirt” did’nt load you used FindFirstChild but Shirt is not here use
char:WaitForChild(“Shirt”).ShirtTemplate = “http://www.roblox.com/asset/?id=5008248562”

Ok so the problem is because my Avatar is not wearing a shirt and i wore a shirt and it worked but is there a way to Force them to wear a shirt once clicked?
@Beez_up

Yeah you can check if there is a shirt by using an if statement else add a shirt by using Instance.new(“Shirt”)

ok thank you could you type the code for me please?
@Beez_up

game.ReplicatedStorage.Events.ShirtEvent1.OnServerEvent:Connect(function(plr)
	
local char = plr.Character
if char:FindFirstChild("Shirt") then else
local s = Instance.new("Shirt")
s.Parent = char
end
char:FindFirstChild("Shirt").ShirtTemplate = "rbxassetid://5008248562"

end)
1 Like

Please do not ask that on this category. This category is not a do-my-work category. You should be using the advice that developers are giving you and turning this into fix attempts first and asking for help based on what you’ve attempted and debugged. Consult existing resources, such as the Developer Hub, for API help.

1 Like

I wasnt really trying to make them do my work ive been on this problem for hours so i said that out of frustration and im sorry

Don’t throw away what FindFirstChild returns.

local char = plr.Character
if not char then return end

local shirt = char:FindFirstChildWhichIsA("Shirt")

if not shirt then
    shirt = Instance.new("Shirt")
    shirt.Parent = char
end

shirt.ShirtTemplate = "rbxassetid://5008248562"

and now I’ve looked at the word “shirt” too much, and it doesn’t look like a real word anymore

Can you show us the script that fires the event?(Code of it.)

It still does not work what I am trying to do is force people to wear a shirt because some people like to not wear any clothes and change their skin tone, but I want people to be forced to wear clothes once they click on a shirt in-game @ClockworkSquirrel

script.Parent.MouseButton1Click:connect(function()

game.ReplicatedStorage.Events.ShirtEvent1:FireServer()`

end)