Well, I'm trying to make a place for a group, and I need to make a group only spawn, and I can't script for nothing, so, if I could get some help?
✓ ANSWER ACCEPTED
How do I make a Group-Only spawn?
1 answer
✓ Accepted answer
You would check if they're in the group that the user is in using the 'IsInGroup' method of Player.
Some code would look like this:
local groupId = 0 -- Replace this with your group Id.
game.Players.PlayerAdded:connect(function(plr)
if plr:IsInGroup(groupId) then
-- Either teleport them to the 'spawn'
-- Or change their TeamColor to a 'Group' Team's TeamColor.
end
end)
EDIT: If you're teleporting them to the spawn, don't forget to wait for the character to load;
plr.CharacterAdded:wait() -- waits for the 'CharacterAdded' event to fire. This would signal that the player's character has loaded and there should be no errors when you teleport them.
This discussion is preserved as it was. New answers, comments, and votes are closed.
