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

How would I make the members of a group spawn at one location, and guests to spawn at another?

I have a base for my group that has walls around it.

I have 2 SpawnLocations, one inside the walls (for members) and one outside the walls (for nonmembers). I know I would probably use IsInGroup to tell which spawn is for which group of people, but not how to define the SpawnLocations.

My guess is it would be something like

if player IsInGroup then --code for spawning them in a certain place

That's all I know, and the stuff I don't know is the stuff I need help with.

1 answer

✓ Accepted answer

What you're looking for are Teams. (heres the link to the wiki page) Once you have your teams and assign each spawn point to them, you should have the following script

local GroupID=0--replace '0' with the group's ID number
game:GetService'Players'.PlayerAdded:connect(function(plr)
	if plr:IsInGroup(GroupID) then
		plr.TeamColor="Bright red"--replace 'Bright red' with the color of the member's team
	end
end)

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