local InsertService = game:GetService("InsertService")
local clothingEvent = game.ReplicatedStorage.remoteEvents.clothingEvent
local clothesData = require(game.ReplicatedStorage.Modules.Data.clothesData)
clothingEvent.OnServerEvent:Connect(function(player, eventtype)
local character = player.Character
local shirt = character:WaitForChild("Shirt")
if eventtype == "Customization" then
for clothesName, clothingData in clothesData do
shirt.ShirtTemplate = InsertService:LoadAsset(tonumber(clothingData.Asset)).Shirt.ShirtTemplate
end
end
end)``` I'm trying to utilize a remote event for my character customization system, but it keeps returning the error code ``Shirt is not a valid member of Model "Model"`` whenever it fires. Might anyone be able to help me solve this? Thanks in advance!
#Shirt is not a valid member of Model "Model"
1 messages · Page 1 of 1 (latest)
its saying InsertService:LoadAsset(tonumber(clothingData.Asset)).Shirt is nil
Do you have any clue why that might be? I'm stumped as to why, as the tonumber is referencing a rbx asset id
how am i supposed to know the contents of whatever random ass asset you put in there?
moreover, why don't you know?
have you checked?
clearly not.
go check.
Why would I ask you that if I didnt already check for myself?
oh, you'd be surprised how often people do dum and lazy things in these threads
Oh dw ive noticed myself xD
i classify this one in the same category as having to ask "are you getting any errors?" twice because you didn't check the output window
and then i have to ask you to screenshot the output window because you didn't read it
why is it the same category?
screenshot your "check" -_-
because you didn't check it well enough.
How do you know that?
i'm a wizard
local InsertService = game:GetService("InsertService")
local clothingEvent = game.ReplicatedStorage.remoteEvents.clothingEvent
local clothesData = require(game.ReplicatedStorage.Modules.Data.clothesData)
clothingEvent.OnServerEvent:Connect(function(player, eventtype)
local character = player.Character
local shirt = character:WaitForChild("Shirt")
if eventtype == "Customization" then
for clothesName, clothingData in clothesData do
shirt.ShirtTemplate = InsertService:LoadAsset(tonumber(clothingData.Asset)).Shirt.ShirtTemplate
print(player:GetChildren())
end
end
end)```
none of that lines up
your check is wrong
what is the assetid of the shirt you're trying to check here
The assetid is 382538059
I originally had it set with rbxasset:// at the front but even with a tonumber it wouldnt work
well nope its not that one
why is this a for loop
for clothesName, clothingData in clothesData do
shirt.ShirtTemplate = ...
end```
are you intending on changing the shirt 100 times in one go?
No thats my bad
why are you flipping through every shirt in your clothesdata
Because I didnt realize thats what it would be doing 😭
i'm sure you can take it from here 
Argument 1 missing or nil
Now I get this error code with the loop removed
also joy you now know at least one of the ids in there does not fit your expected output
well yeah you were using insertservice:loadasset( clothingdata.etc... ) what did you think was going to happen by just simply removing the loop and not replacing it with something else?
sadly computers aren't mystical mind-readers just yet, maybe in a few years. but for now you need to be explicit about literally everything
So if its not a loop that should be used what should I write in its place?
bruh 
I only knew about the loop method allowing for the asset number to be called from another script I had written
this being a customization thing one might expect the player is picking out a shirt from a list
one shirt
not let's see all of them at once
so i would probably expect the client to include the desired shirt in their :FireServer
and then on server you check if it actually exists, if they can wear that specific shirt etc
how you solve that is up to you.
also you are guaranteed that at least one of your shirts won't work because of the error
which one is a task left up to you to figure out
chat whats a pcall