First, code:
script.Parent.ClickDetector.MouseClick:connect(function(player) print("clicked! by player " .. player.Name) for _, v in pairs(player.Character:GetChildren()) do print("iterating through player") if v:IsA("Shirt") then print("found shirt at " .. v:GetFullName() .. " with current ShirtTemplate " .. v.ShirtTemplate) v.ShirtTemplate = script.Parent.Parent.Shirt.ShirtTemplate print("changed shirt at " .. v:GetFullName() .. " to ShirtTemplate " .. v.ShirtTemplate) elseif v:IsA("Pants") then print("found pants at " .. v:GetFullName() .. " with current PantsTemplate " .. v.PantsTemplate) v.PantsTemplate = script.Parent.Parent.Pants.PantsTemplate print("changed pants at " .. v:GetFullName() .. " to PantsTemplate " .. v.PantsTemplate) end end end)
This script is placed inside the Torso of a Humanoid model wearing a Shirt and Pants. My aim is to have the player click the Torso to put on the clothes.
It's as if the event isn't even firing - the first print
statement doesn't show up in the console in online mode, whereas in Play Solo mode it functions fine.
It's in a Script, and Filtering is enabled.
I'm very puzzled right now. Any and all help would be greatly appreciated.
Is there a clickdetector in the Torso online? That's the only explanation for this to not be working.
-Goulstem