local Pants = script.Pants local Shirt = script.Shirt local GroupID = 6763603 -- Group id here script.Parent.ClickDetector.MouseClick:connect(function(Player) if not Player:IsInGroup(GroupID) then return end if Player:GetRoleInGroup(GroupID) < 50 then return end local Character = Player.Character if Character == nil then return end -- Get new shirt local CharacterShirt = Character:findFirstChild("Shirt") if CharacterShirt then CharacterShirt:Destroy() end Shirt:Clone().Parent = Character -- Get new pants local CharacterPants = Character:findFirstChild("Pants") if CharacterPants then CharacterPants:Destroy() end Pants:Clone().Parent = Character end)
In the output it say's "Workspace.Part.Script:8: attempt to compare string and number"
The reason why your script won't work is actually very simple, by doing Player:GetRoleInGroup it would print out the name of the role they have in the group, if you wanted to get the number corresponding to their role, you would do :GetRankInGroup. If you take this into account, the script would look like this.
local Pants = script.Pants local Shirt = script.Shirt local GroupID = 6763603 -- Group id here script.Parent.ClickDetector.MouseClick:connect(function(Player) if not Player:IsInGroup(GroupID) then return end if Player:GetRankInGroup(GroupID) < 50 then return end local Character = Player.Character if Character == nil then return end -- Get new shirt local CharacterShirt = Character:findFirstChild("Shirt") if CharacterShirt then CharacterShirt:Destroy() end Shirt:Clone().Parent = Character -- Get new pants local CharacterPants = Character:findFirstChild("Pants") if CharacterPants then CharacterPants:Destroy() end Pants:Clone().Parent = Character end)