Get spigot on your server if you havent already and download the Skript plugin. When you installed it, go to your server files where it says plugins, then click on the Skript folder, go to scripts folder, then click create file, then name it whatever you want but with a .sk at the end, (ex. spawn.sk) then click create. Then click on that file and copy and paste this text:
command /setspawn:
trigger:
if player is op:
set {global.survival.spawn} to player's position
send "&6Spawn: &7The Global Survival Spawn has been set."
command /spawn:
trigger:
set {_waitedcommandspawn} to difference between {spawn.teleport.%player%.lastused} and now
if {_waitedcommandspawn} is less than 30 seconds:
message "&6Spawn: &7You cannot use this command &7for &a%difference between 30 seconds and {_waitedcommandspawn}%&7."
stop
else:
if {global.survival.spawn} is set:
teleport player to {global.survival.spawn}
set {spawn.teleport.%player%.lastused} to now
send "&6Spawn: &7You was teleported to the Spawn Zone."
else:
if player has op:
send "&6Spawn: &cThere is no spawn. Create one using &e/setspawn"
After that click save, then go back to your minecraft and make sure you joined your server, and run the command: (/sk reload thenameofthefile.sk) and then boom. You can use /setspawn and then use /spawn to tp to that location!