If you set ShirtTemplate from script it won’t change shirt because roblox probably has a function to get shirt template then applies shirt template as id if you try to set ShirtTemplate yourself in studio you will see id will change to another but there’s a way to do this which is using HumanoidDescription. Here’s an example:
local id = 6663030466
local Humanoid = workspace.Dummy.Humanoid
local desc = Humanoid:GetAppliedDescription()
desc.Shirt = id
Humanoid:ApplyDescription(desc)
Website IDs will only work while you’re in Studio, but once you actually try to use it in-game the shirt won’t load.
Here’s how a Website ID looks like
It’s 6663030466; However when I insert this ID in a ShirtTemplate, it changes to 6663030462. That happens because Roblox retrieves the AssetID to display the template that was used to make this shirt.
This is a working solution and should be able to work around your issue - but the explanation above sums up why your code wasn’t previously working.
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(Player, text, clothtype)
local team = Player.plot.Value
local plot = workspace:FindFirstChild(team)
if clothtype == "Shirt" then
local desc = plot.Dummy.Humanoid:GetAppliedDescription()
plot.Dummy.HumanoidDescription.Shirt = text
plot.Dummy.Humanoid:ApplyDescription(desc)
print(text)
else
local desc = plot.Dummy.Humanoid:GetAppliedDescription()
plot.Dummy.HumanoidDescription.Pants = text
plot.Dummy.Humanoid:ApplyDescription(desc)
print(text)
end
end)