Files
spawn.sk
Code
1 45
spawn.sk
options:
prefix: &6[Spawn]&r
cooldown: 5
delay: 3
on script load:
send "{@prefix} &aSpawn system loaded!" to console
command /setspawn:
permission: spawn.admin
permission message: &cYou don't have permission to use this command!
trigger:
set {spawn.location} to location of player
set {spawn.world} to world of player
send "{@prefix} &aSpawn location set to your current position!"
send "{@prefix} &7World: &e%world of player%"
send "{@prefix} &7X: &e%x-coordinate of player% &7Y: &e%y-coordinate of player% &7Z: &e%z-coordinate of player%"
command /spawn:
trigger:
if {spawn.location} is not set:
send "{@prefix} &cSpawn location has not been set yet!"
stop
if {spawn.cooldown::%player%} is set:
send "{@prefix} &cPlease wait before using this command again!"
stop
send "{@prefix} &eTeleporting to spawn in {@delay} seconds..."
send "{@prefix} &cDon't move!"
set {_originalLocation} to location of player
wait {@delay} seconds
if distance between {_originalLocation} and location of player is greater than 0.5:
send "{@prefix} &cTeleportation cancelled! You moved!"
stop
teleport player to {spawn.location}
send "{@prefix} &aYou have been teleported to spawn!"
set {spawn.cooldown::%player%} to true
wait {@cooldown} seconds
delete {spawn.cooldown::%player%}