I've been trying to get this team thing to work for my group. I was trying to make the scripts, and I tried adding a leaderboard script. Then I changed all the spawn teams to non-neutral, because it kept putting us in neutral instead of the group. I don't know what happens when a non-group member tries to join, but for me, it kicks me under the map and killing me. Below are my scripts:

Team Script:

local Id = (3849303) 
game.Players.PlayerAdded:Connect(function(Plr)
	if Plr:IsInGroup(Id) then
		Plr.TeamColor=BrickColor.new("Bright red") --Color of our team
	else
		Plr.TeamColor=BrickColor.new("Lime green") --Color of civilian team
	end	
end)

You can walk into the hostile spawn to change into them, but we will add a GUI soon.

Leaderboard Script:

local GroupID = (3849303)

game.Players.PlayerAdded:connect(function(player)
 local stats = Instance.new("IntValue", player)
 stats.Name = "leaderstats"

 local RankDisplay = Instance.new("StringValue", stats)
 RankDisplay.Name = "Ranks"
 RankDisplay.Value = player:GetRoleInGroup(GroupID)
end)

local ArmyID = (3838939)

game.Players.PlayerAdded:connect(function(player)
 local stats = Instance.new("IntValue", player)
 stats.Name = "leaderstats"

local RankDisplay = Instance.new("StringValue", stats)
 RankDisplay.Name = "Army Ranks"
 RankDisplay.Value = player:GetRoleInGroup(GroupID)
end)

I don't understand what I'm doing wrong. Is it the scripts or the fact that there are no neutral teams? Or is it something else?

edit: Is it because I have FE on?

3 comments

0

Is there a SpawnLocation for both teams?

0

Yes, five for my team, one for the other team.

0

It works if I set them to neutral, but puts me on a team, neutral, which I do not have in explorer.