GiveClothes = function(char)
for i,v in pairs(char:children()) do
if v:IsA("Clothing") then
v:Destroy()
end
end
script.Pants:Clone().Parent = char
script.Shirt:Clone().Parent = char
end
GroupId = 0
RanksThatGetClothing = {"Private"}
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
local allowed = false
for i,v in pairs(RanksThatGetClothing) do
if v:GetRoleInGroup(GroupId) == v then
allowed = true
end
end
if allowed then
GiveClothes(char)
end
end)
end)
This script isn't working, can anyone help? It involves clothing and group ranks/id's
3 answers
First off: Change all of the :connect to :Connect Put it all in a code block so I can see everything else
GiveClothes = function(char)
for i,v in pairs(char:children()) do
if v:IsA("Clothing") then
v:Destroy()
end
end
script.Pants:Clone().Parent = char
script.Shirt:Clone().Parent = char
end
GroupId = 0
RanksThatGetClothing = {"Private"}
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local allowed = false
for i,v in pairs(RanksThatGetClothing) do
if v:GetRoleInGroup(GroupId) == v then
allowed = true
end
end
if allowed then
GiveClothes(char)
end
end)
end)
3 comments
The Pants and Shirt ID isn't the same as the Product ID. For example, if the ID for the pants on the catalog is 78690501, in the script, it wouldn't be the same number. Go on catalog, and subtract 1 from the ID number. Keep doing that until you find the product that has the same name as your pants, but the picture looks different. That is the ID you need. Also, use :GetChildren(), not :children.
I know that there is a pants and shirt object inside the script
And that didn't fix it anyway :/
maybe because you left the group id to 0 ://////////////////////////
1 comment
Still doesn't work
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Change v:GetRoleInGroup(GroupId) to plr:GetRoleInGroup(GroupId)
Does the :children and :connect need changing like it says below?
I got it working! Thank you so much!!!