My spawns wont work.
I have a script where if you are in my group it puts you on that team:
function onPlayerEntered(plyr) if plyr:IsInGroup(1195141) then plyr.TeamColor = BrickColor.new("Cyan") end end game.Players.PlayerAdded:connect(onPlayerEntered)
But if you are not in the group. It makes you spawn on the Raiders's spawn but the team is still my group.. Does anyone know how to fix this?
This may be due to the "Raiders" team having the "AllowTeamChangeOnTouch" set to true that would be located under properties in a spawn.
Perhaps we could implement what Tkdriver said using the following code. However, you will need to manually set the team name in the variable 'groupteam'.
local groupteam = 'Xepitus'; local groupid = 1195141; local group_spawn = game.Workspace['Xepitus Spawn']; game.Players.PlayerAdded:connect(function(_) local r = false; local s = false; repeat s,r = pcall(function() return plr.Backpack~=nil end); until r==true; if not(_:IsInGroup(groupid)) then return end; _.TeamColor = game:service'Teams'[groupteam].TeamColor; _:MoveTo(group_spawn.Position,group_spawn); end);
Hope this helped! :)