Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Group Rank Script For Starterpack?

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.

function onPlayerAdded(Player)
	Player.CharacterAdded:connect(function() onCharacterAdded(Player) end)
end
game.Players.PlayerAdded:connect(onPlayerAdded)

function onCharacterAdded(Player)
	for _, Team in ipairs(game.Teams:GetChildren()) do
		if Team.TeamColor == Player.TeamColor then
			for _, Object in ipairs(Team:GetChildren()) do
				Object:Clone().Parent = Player.Backpack
			end
			break
		end
	end
end

for _, Player in ipairs(game.Players:GetPlayers()) do
	Player.CharacterAdded:connect(function() onCharacterAdded(Player) end)
end

1 answer

Well, I'd do it this way.

tool = game.ServerStorage["Tool name here"]
id = 1337 -- Group Id
pwr = 1 --The Rank of the group. Ranges from 1-255. 255 being the oner

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		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.
			tool:clone().Parent = plr.Backpack
		end
	end)
end)

4 comments

0

Okay, So on the rank... Is that going to give it to like Rank Number 222 and Up? Also is the brick Color The Spawn color?

0

Yes. (You have to edit the pwr variable obviously.) The BrickColor is the TeamColor's BrickColor. You can find that out in Explorer>Teams>The team you desire>Properties>TeamColor

0

Where do you need to have the tools located? Lighting?

0

ServerStorage

This discussion is preserved as it was. New answers, comments, and votes are closed.