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.
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.
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
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)
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.
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
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