script.Parent.ShirtRemote.OnServerEvent:Connect(function(plr)
if plr.Character:FindFirstChild("Shirt") then
plr.Character.Shirt = script.Parent.Shirt.Text
end
end)
script.Parent.PantsRemote.OnServerEvent:Connect(function(plr)
if plr.Character:FindFirstChild("Pants") then
plr.Character.Shirt = script.Parent.Pants.Text
end
end)
Assuming that script.Parent.Pants is a textBox, using .Text, won’t work, because it will only change for the client, however you passed the id as a parameter, so I think just putting id as the parameter on the sever will work, like:
script.Parent.ShirtRemote.OnServerEvent:Connect(function(plr, id)
if plr.Character:FindFirstChildWhichIsA("Shirt") then
plr.Character.Shirt = 'rbxassetid://'..id
end
end)
script.Parent.PantsRemote.OnServerEvent:Connect(function(plr, id)
if plr.Character:FindFirstChildWhichIsA("Pants") then
plr.Character.Pants = 'rbxassetid://'..id
end
end)
Whats is the problem?
You dont set rbxassetid:// on the start of ID.
You dont get the id parameter in onserverevent.
You have used FindFirstChild, if the pants or the shirt have other name, your code brokes.