Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Hat giver needs an edit, can someone help with the edit?

Asked by 6 years ago

In the script it gives the hat and works fine but I need it to give the hat if in a main group, I currently have two of these setup and I can't figure out how I would remove the 1st Hat. I need ti so if you are in a sub group you get a seperate hat, does anyone know if thats possible with this script? I thought maybe if your in the sub group the hat removes itself on spawn or something but I'm clueless.

local groupId = 0
game.Players.ChildAdded:connect(function(player)
   player.CharacterAdded:connect(function()
      repeat wait() until player.Character
      if player:GetRankInGroup(groupId) = 1 then
         local hat = game.ServerStorage:WaitForChild("Hat")
         local c = hat:Clone()
         c.Parent = player.Character
      end
   end)
end)

Answer this question