Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a group only spawn?

Asked by 10 years ago

Whenever I attempt to make one it forces every player to join the team (even if they're not in the group)

0
Did you change the teams AutoAssignable to false and can we see the code you are using? Sublimus 992 — 10y

3 answers

Log in to vote
1
Answered by 10 years ago

Try this.

local groupId = 0; --change this to the id of your group
local team = game.Teams['TeamName']; --change "TeamName" to the name of your group team

Game.Players.PlayerAdded:connect(function(p)
    if p:IsInGroup(groupId) then -- check if they're in the group
        p.TeamColor = team.TeamColor -- Set their team to the group team

        repeat wait() until p.Character
        p:LoadCharacter()
    end
end)

EDIT: Make sure the team's AutoAssignable property is set to false

Ad
Log in to vote
0
Answered by 10 years ago

Have the team first not auto-assignable from the team itself, then use a group only team such as

SCRIPT BELOW

local groupId = 123456-- Enter your group number here! 
local groupId = 123456
function RegisterPlayer( player ) 
if CheckInGroup(player, groupId) then 
HoldThreadForCharacter(player) 
player.Character:MoveTo(script.Parent.Position + Vector3.new(0,3,0)) 
end 
end 

function CheckInGroup( player, id ) 
if player:IsInGroup(id) then 
return true 
end 
return false 
end 

function HoldThreadForCharacter( player ) 
repeat wait() until Workspace:FindFirstChild(player.Name) 
end 

Game.Players.PlayerAdded:connect(RegisterPlayer) 
for i,v in pairs(Game.Players:GetPlayers()) do 
RegisterPlayer(v) 
Log in to vote
-1
Answered by 10 years ago

I learned that from this guy http://youtu.be/PiLqpas-guY

Answer this question