if Player.Players.Added:Connect(function(plr) if Player.GlassPTCase.Collided = true then Player.Humanoid.Shirt = --Shirt code end end)end
1 You don't need an "if" at the start.
2 Its game.Players and to see if they were added its PlayerAdded.
3 I would also recommend to delete the shirt or replace the id if they have one or make one if the player has no shirt and put the id in it so if they don't have a shirt on, they would still have the shirt.
4 Also, the shirt is not in the humanoid and Player ~= to the character. If you want to get the character you would need to do plr.Character .
5 And when you put in the function (plr), it gives you the player that joined but in the script you use "Player" which is ~= plr unless its in a localscript and you did game.Players.LocalPlayer but still, idk why you would put (plr) if you don't need it and same thing with the function.
if Player.Players.Added:Connect(function(plr) --Mistake number : 1, 2, 5 if Player.GlassPTCase.Collided = true then --Mistake number: 4, honestly I don't know what this is supposed to do Player.Humanoid.Shirt = --Shirt code -- Change number : 3 end end)
If you do all these changes the script will look like this.
game.Players.PlayerAdded:Connect(function(plr) if plr.GlassPTCase.Collided = true then plr.Character.Shirt = --Shirt code end end)
But honestly, I don't know what that script is really supposed to do but I am sure it would still not work. If you want to know if someone touched the part you would use .Touched and not "Collided?". If I had to do it, this is how it would look like:
local part = script.Parent --anything local id = "anything" part.Touched:Connect(function(Hit) local Find = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid") if Find then local shirt = Find.Parent:FindFirstChildOfClass("Shirt") if not shirt then Instance.new("Shirt", Find.Parent) end Hit.Parent.Shirt.ShirtTemplate = id end end)
That way, when you touch the part, its looking if a shirt exists, if not then it creates one and then it changes the id of the shirt.