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

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

Asked by 7 years ago

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

Log in to vote
1
Answered by
Versimn 20
7 years ago
Edited 7 years ago

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)
Ad

Answer this question