Xoaxxe May 22nd, 2020 1,555 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- --The first thing you want to do is check if the player is in one of the groups, to do this you would do the following,
- game.Players.PlayerAdded:Connect(function(newPlayer) -- this calls the function whenever a new user joins the game, "newPlayer" could be called anything what matters is that with the PlayerAdded function this is always equal player name
- if newPlayer:IsInGroup(7) then -- here you check if newPlayer is in a specific group, the id "7" would be your group id
- print("This user is in the group.") -- this is what happens if they are in the group
- end -- here they close the if statement
- end) -- here they close the function
- -- now that we have checked if they are in the group we need to decide what happens if they are in the group, I recommend you rename the spawnpoints to something relating to the group name, for example, if the group name is "Group name" then you should rename its spawnpoint to something like "GroupNameSpawn"
- game.Workspace.DefaultSpawn:Destroy() -- the part "game.Workspace.DefaultSpawn" is just the location of the default spawn, ":Destroy()" deletes that part, but just remember to put this in a local script so that it doesn't destroy the spawn for everyone
- local GroupSpawn = Instance.new("SpawnLocation", game.Workspace) -- here we create a new spawn point and set its parent to the workspace, the reason we make it a variable is so that we can edit it more separately from this statement
- GroupSpawn.Name = "GroupSpawn" -- here we change the name of the spawn itself, because before the name was just a variable, and not actually the name of the spawn
- GroupSpawn.Position = Vector3.new(0, 0, 0) -- replace the zero's with the position you want the spawn, if you dont know then place a part where you want it and copy its position and paste it into the (), make sure it is formatted the same as the zeros.
- -- the final result should look sommething like this:
- if newPlayer:IsInGroup(7) then
- local GroupSpawn = Instance.new("SpawnLocation", game.Workspace)
- GroupSpawn.Name = "GroupSpawn"
- GroupSpawn.Position = Vector3.new(0, 0, 0)
- -- make sure that you replace the group id with the group you want it to check for and the vector3 position with the position on the spawn
RAW Paste Data