wait(0.1) local groupid = script.Configuration.GroupID local players = game:GetService('Players') local player = game.Players.LocalPlayer local config = script.Configuration local shirt = script.Configuration.Shirt local pants = script.Configuration.Pants function SpawnClothes(Players) if Players:IsInGroup(groupid.Value) then for i,v in pairs(Players.Character:getChildren()) do if v.className == "Shirt" or v.className == "Pants" then v:remove() end end script.Configuaration.Shirt:Clone() shirt.Parent = Players.Character script.Configuaration.Pants:Clone() pants.Parent = Players.Character end end function PlayerRespawned(Player) SpawnClothes(Player) Player.Changed:connect(function(property) if (property == "Character") then SpawnClothes(Player) end end) end game.Players.ChildAdded:connect(PlayerRespawned)
Can someone tell me why this won't work?
Might have been just a simple error. Is the configuration in the script or a parent? If not, I would do; Then, put shirts and pants in the script. Also, put your group ID in the if Playerz:IsInGroup(0) then
function SpawnClothes(Playerz) if Playerz:IsInGroup(80738) then --Group ID for i,v in pairs(Playerz.Character:getChildren()) do if v.className == "Shirt" or v.className == "Pants" then v:remove() end end Shirt = script.Shirt:clone() Shirt.Parent = Playerz.Character Pants = script.Pants:clone() Pants.Parent = Playerz.Character end end function PlayerRespawned(Player) SpawnClothes(Player) Player.Changed:connect(function(property) if (property == "Character") then SpawnClothes(Player) end end) end game.Players.ChildAdded:connect(PlayerRespawned)