I Need an Group Rank Script That goes into the Starter Pack when your On a Certain team.. So it would give someone on PD Team That is an SGT an Gun.. Can someone Show one.. Ive tried many.
01 | function onPlayerAdded(Player) |
02 | Player.CharacterAdded:connect( function () onCharacterAdded(Player) end ) |
03 | end |
04 | game.Players.PlayerAdded:connect(onPlayerAdded) |
05 |
06 | function onCharacterAdded(Player) |
07 | for _, Team in ipairs (game.Teams:GetChildren()) do |
08 | if Team.TeamColor = = Player.TeamColor then |
09 | for _, Object in ipairs (Team:GetChildren()) do |
10 | Object:Clone().Parent = Player.Backpack |
11 | end |
12 | break |
13 | end |
14 | end |
15 | end |
16 |
17 | for _, Player in ipairs (game.Players:GetPlayers()) do |
18 | Player.CharacterAdded:connect( function () onCharacterAdded(Player) end ) |
19 | end |
Well, I'd do it this way.
01 | tool = game.ServerStorage [ "Tool name here" ] |
02 | id = 1337 -- Group Id |
03 | pwr = 1 --The Rank of the group. Ranges from 1-255. 255 being the oner |
04 |
05 | game.Players.PlayerAdded:connect( function (plr) |
06 | plr.CharacterAdded:connect( function (char) |
07 | if plr:IsInGroup(id) and (plr:GetRankInGroup(id) > = pwr) and plr.TeamColor = = BrickColor.new( "Really red" ) then -- You can set it to '==' if you want it to be JUST that rank. |
08 | tool:clone().Parent = plr.Backpack |
09 | end |
10 | end ) |
11 | end ) |