Here is my script which is not working right now.
And is it possible to make that team only? Like if the player is on the earth green team it does not spawn but when he is on the light blue team it will. Sorry, I'm not the best when it comes to scripting.
game.Players.PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(5090028) == 2 then
local tool = game.ServerStorage["X-26"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 3 then
local tool = game.ServerStorage["X-26"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 4 then
local tool = game.ServerStorage["X-26"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 5 then
local tool = game.ServerStorage["X-26"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 6 then
local tool = game.ServerStorage["X-26"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 7 then
local tool = game.ServerStorage["X-26"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 8 then
local tool = game.ServerStorage["X-26"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
--Flashlight
elseif plr:GetRankInGroup(5090028) == 1 then
local tool = game.ServerStorage["Flashlight"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 2 then
local tool = game.ServerStorage["Flashlight"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 3 then
local tool = game.ServerStorage["Flashlight"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 4 then
local tool = game.ServerStorage["Flashlight"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 5 then
local tool = game.ServerStorage["Flashlight"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 6 then
local tool = game.ServerStorage["X-26"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 7 then
local tool = game.ServerStorage["Flashlight"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 8 then
local tool = game.ServerStorage["Flashlight"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
--Police Baton
elseif plr:GetRankInGroup(5090028) == 2 then
local tool = game.ServerStorage["PoliceBaton"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 3 then
local tool = game.ServerStorage["PoliceBaton"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 4 then
local tool = game.ServerStorage["PoliceBaton"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 5 then
local tool = game.ServerStorage["PoliceBaton"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 6 then
local tool = game.ServerStorage["PoliceBaton"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 7 then
local tool = game.ServerStorage["PoliceBaton"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 8 then
local tool = game.ServerStorage["PoliceBaton"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
--Pepper Spray
elseif plr:GetRankInGroup(5090028) == 2 then
local tool = game.ServerStorage["PepperSpray"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 3 then
local tool = game.ServerStorage["PepperSpray"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 4 then
local tool = game.ServerStorage["PepperSpray"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 5 then
local tool = game.ServerStorage["PepperSpray"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 6 then
local tool = game.ServerStorage["PepperSpray"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 7 then
local tool = game.ServerStorage["PepperSpray"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 8 then
local tool = game.ServerStorage["Glcok 18"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
--Glock
elseif plr:GetRankInGroup(5090028) == 3 then
local tool = game.ServerStorage["Glock 18"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 4 then
local tool = game.ServerStorage["Glock 18"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 5 then
local tool = game.ServerStorage["Glock 18"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 6 then
local tool = game.ServerStorage["Glock 18"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 7 then
local tool = game.ServerStorage["Glock 18"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 8 then
local tool = game.ServerStorage["Glock 18"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
--ACR
elseif plr:GetRankInGroup(5090028) == 3 then
local tool = game.ServerStorage["ACR"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 4 then
local tool = game.ServerStorage["ACR"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 5 then
local tool = game.ServerStorage["ACR"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 6 then
local tool = game.ServerStorage["ACR"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 7 then
local tool = game.ServerStorage["ACR"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
elseif plr:GetRankInGroup(5090028) == 8 then
local tool = game.ServerStorage["ACR"]:Clone()
tool.Parent = plr:WaitForChild("Backpack")
end
end)

2 comments
Oh btw, in this group make sure the rank numbers match the group ranks
Groiup->Roles->Rank. That's what you're trying to compare it to