Solved Skript /spawn

  • 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!

Evan

Member
Mar 13, 2017
3
0
0
26
Category: Skript

Suggested name: Spawn

What I want:
I am looking for a command /spawn, you would be able to do /setspawn and /spawn would have a cool down of 10 seconds.

Ideas for commands:
/spawn - with a 10 second delay until you get teleported to spawn
/setspawn
/spawn <player> - used to teleport players to spawn



Ideas for permissions: evespawn.spawn - for /spawn

evespawn.admin - for /setspawn & /spawn <player> (used to teleport players to spawn)


When I'd like it by: A reasonable time


If anyone could do this, i'd be great.

Thanks.
 
Would you be able to add a way if people die in the world they get teleported back to spawn?

just add,


code_language.skript:
On Respawn:
    teleport player to {spawn}
 
@Evan
code_language.skript:
command /setspawn:
    permission: spawn.set
    trigger:
        set yaml value "X-Coord" from file "plugins/Spawn/Spawn.yml" to ("%x-coord of player%" parsed as number)
        set yaml value "Y-Coord" from file "plugins/Spawn/Spawn.yml" to ("%y-coord of player%" parsed as number)
        set yaml value "Z-Coord" from file "plugins/Spawn/Spawn.yml" to ("%z-coord of player%" parsed as number)
        message "&7You have set the spawn."
       
command /spawn:
    permission: spawn.use
    trigger:
        set {_x} to yaml value "X-Coord" from file "plugins/Spawn/Spawn.yml"
        set {_y} to yaml value "Y-Coord" from file "plugins/Spawn/Spawn.yml"
        set {_z} to yaml value "Z-Coord" from file "plugins/Spawn/Spawn.yml"
        teleport player to location at {_x} , {_y} , {_z} in world "world"

on respawn:
    make player execute command "/spawn"
 
@Evan
code_language.skript:
command /setspawn:
    permission: spawn.set
    trigger:
        set yaml value "X-Coord" from file "plugins/Spawn/Spawn.yml" to ("%x-coord of player%" parsed as number)
        set yaml value "Y-Coord" from file "plugins/Spawn/Spawn.yml" to ("%y-coord of player%" parsed as number)
        set yaml value "Z-Coord" from file "plugins/Spawn/Spawn.yml" to ("%z-coord of player%" parsed as number)
        message "&7You have set the spawn."
      
command /spawn:
    permission: spawn.use
    trigger:
        set {_x} to yaml value "X-Coord" from file "plugins/Spawn/Spawn.yml"
        set {_y} to yaml value "Y-Coord" from file "plugins/Spawn/Spawn.yml"
        set {_z} to yaml value "Z-Coord" from file "plugins/Spawn/Spawn.yml"
        teleport player to location at {_x} , {_y} , {_z} in world "world"

on respawn:
    make player execute command "/spawn"
Thank you!
 
@YoshYz the coordinates expression already return a number, you don't have to parse it to what it's.