Im trying to make a SG Skript and im having trouble for the player spawning system, what I mean by that is when the game will start the players need to spawn to a specified location, and I dont really know how to do that.
Code:
options:
prefix: &8[&6SG&8]
on load:
set {survivalgames.%%lobbyplayercounter%%} to "0"
set {%%spawn1%%} to "0"
set {%%spawn2%%} to "0"
on join:
teleport player to {lobby}
add 1 to {survivalgames.%%lobbyplayercounter%%}
on quit:
remove 1 from {survivalgames.%%lobbyplayercounter%%}
every 2 seconds:
if {survivalgames.%%lobbyplayercounter%%} is less than 0:
add 1 to {survivalgames.%%lobbyplayercounter%%}
command sg [<text>]:
permission: sg.admin
trigger:
if arg 1 is not set:
send "&cADMIN COMMANDS"
send " "
send " "
send " "
send "&c/sg setlobby | Sets were the players will spawn when they join the lobby."
send "&c/sg addspawn <id> | Self explanatory, keep in mind the max spawn number is 12."
send "&c/sg adddeathmatchspawn <id> | Same as the previous command, tho this is for the deathmatch spawns."
if arg 1 is "setlobby":
set {lobby} to location of player
send "{@prefix} &aLobby was set at your current location."
if arg 1 is "addspawn":
send "{@prefix} &cUsage: /sg addspawn 1/2/3/4/5/6/7/8/9/10/11/12"
if arg 1 is "addspawn 1":
set {spawn1} to location of player
send "{@prefix} &aSpawn 1 was set to your current location."
if arg 1 is "addspawn 2":
set {spawn2} to location of player
send "{@prefix} &aSpawn 2 was set to your current location."
if arg 1 is "addspawn 3":
set {spawn3} to location of player
send "{@prefix} &aSpawn 3 was set to your current location."
if arg 1 is "addspawn 4":
set {spawn4} to location of player
send "{@prefix} &aSpawn 4 was set to your current location."
if arg 1 is "addspawn 5":
set {spawn5} to location of player
send "{@prefix} &aSpawn 5 was set to your current location."
if arg 1 is "addspawn 6":
set {spawn6} to location of player
send "{@prefix} &aSpawn 6 was set to your current location."
if arg 1 is "addspawn 7":
set {spawn7} to location of player
send "{@prefix} &aSpawn 7 was set to your current location."
if arg 1 is "addspawn 8":
set {spawn8} to location of player
send "{@prefix} &aSpawn 8 was set to your current location."
if arg 1 is "addspawn 9":
set {spawn9} to location of player
send "{@prefix} &aSpawn 9 was set to your current location."
if arg 1 is "addspawn 10":
set {spawn10} to location of player
send "{@prefix} &aSpawn 10 was set to your current location."
if arg 1 is "addspawn 11":
set {spawn11} to location of player
send "{@prefix} &aSpawn 11 was set to your current location."
if arg 1 is "addspawn 12":
set {spawn12} to location of player
send "{@prefix} &aSpawn 12 was set to your current location."
if arg 1 is "forcestart":
broadcast "{@prefix} &aStarted the game. Good luck!"
chance of 50%:
add 1 to {%%spawn1%%}
teleport player to {spawn1}
stop
chance of 50%:
if {%%spawn1%%} is greater than 0:
add 1 to {%%spawn2%%}
teleport player to {spawn2}
stop