Spawn script

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Kristian Rahbek

New Member
Jun 12, 2018
9
0
1
24
United States
Hello guys! :emoji_slight_smile:
I really need a spawn script. Not just a simple one, but like when you move it cancels. I will be very happy if someone would like to make this for me. The teleportation, should take about 4 secounds. Thanks a lot!
 
i whipped this up quickly.... let me know if you need a little more customization added to it

code_language.skript:
options:
    prefix: &7[&3SPAWN&7]



command /setspawn:
    permission: spawn.set
    permission message: You do not have permission to use this command
    usage: player
    trigger:
        set {spawn} to location of player
        send "{@prefix} - &aSpawn successfully set at: &b%{spawn}%"

on first join:
    teleport player to {spawn}

command /spawn [<player>]:
    permission: spawn.use
    permission message: You do not have permission to use this command
    trigger:
        if arg-1 is set:
            if player has permission "spawn.admin":
                teleport arg-1 to {spawn}
            else:
                send "{@prefix} - &cYou do not have permission to use this command"

        if arg-1 is not set:
            if player does not have permission "spawn.bypass":
                set {_location.%player%.x} to rounded x coord of player
                set {_location.%player%.y} to rounded y coord of player
                set {_location.%player%.z} to rounded z coord of player
                send "{@prefix} - &aTeleporting to spawn, please stand still" to player
                wait 1 second
                if rounded x coord of player is {_location.%player%.x}:
                    if rounded y coord of player is {_location.%player%.y}:
                        if rounded z coord of player is {_location.%player%.z}:
                            wait 1 second
                        else:
                            send "{@prefix} - &cTeleportation canceled... next time stand still"
                            stop
                    else:
                        send "{@prefix} - &cTeleportation canceled... next time stand still"
                        stop
                else:
                    send "{@prefix} - &cTeleportation canceled... next time stand still"
                    stop
                if rounded x coord of player is {_location.%player%.x}:
                    if rounded y coord of player is {_location.%player%.y}:
                        if rounded z coord of player is {_location.%player%.z}:
                            wait 1 second
                        else:
                            send "{@prefix} - &cTeleportation canceled... next time stand still"
                            stop
                    else:
                        send "{@prefix} - &cTeleportation canceled... next time stand still"
                        stop
                else:
                    send "{@prefix} - &cTeleportation canceled... next time stand still"
                    stop
                if rounded x coord of player is {_location.%player%.x}:
                    if rounded y coord of player is {_location.%player%.y}:
                        if rounded z coord of player is {_location.%player%.z}:
                            wait 1 second
                        else:
                            send "{@prefix} - &cTeleportation canceled... next time stand still"
                            stop
                    else:
                        send "{@prefix} - &cTeleportation canceled... next time stand still"
                        stop
                else:
                    send "{@prefix} - &cTeleportation canceled... next time stand still"
                    stop
                if rounded x coord of player is {_location.%player%.x}:
                    if rounded y coord of player is {_location.%player%.y}:
                        if rounded z coord of player is {_location.%player%.z}:
                            teleport player to {spawn}
                            send "{@prefix} - &aYou have been successfully teleported to spawn"
                        else:
                            send "{@prefix} - &cTeleportation canceled... next time stand still"
                            stop
                    else:
                        send "{@prefix} - &cTeleportation canceled... next time stand still"
                        stop
                else:
                    send "{@prefix} - &cTeleportation canceled... next time stand still"
                    stop
            if player has permission "spawn.bypass":
                teleport player to {spawn}
                send "{@prefix} - &aYou have been successfully teleported to spawn"
[doublepost=1528837301,1528837109][/doublepost]oh also the permissions i added are as follows:
spawn.set - Allows admins to set the spawn
spawn.admin - Allows admins to send other players to spawn
spawn.use - Allows players to use the spawn command
spawn.bypass - Allows players to bypass the teleport delay
 
You're welcome. I may make a few changes to clean it up a bit, but i will make sure to forward them to you so you have the most updated version