Jump to content

multiple spawn locations


BOXEY

Recommended Posts

i am trying to make a server that has many spawn and will randomly pick one for the person to go and i can get 1 to work but 2 cant

here is my code

command /addspawn:
    permission: spawn.add
    trigger:
        add 1 to {number}
        set {spawnloc::%{number}%} to location of player
        add {spawnloc::%{number}%} to {spawns::*}
        send "&a → &7There Are Currently %{number}%&7 Spawn Locations Set"
        send "&a → &7%{spawnloc::%{number}%}%&7 IS Now A Spawn Location"

command /clearspawns:
    permission: spawn.clear
    trigger:
        set {number} to 0
        delete {spawns::*}
        send "&c → &7Cleared Spawn Loctions"
        send "&c → &7If This Says <none> You Have Cleared All Spawn locations"
        send "&c → &7%{spawns::*}%"


command /spawn:
    trigger:
        set {SpawnPlace} to random number between 1 and {number}
        send "&a → &7Please Wait 3 Second's To Br Teleported"
        wait 1 real second
        send "&a → &7Please Wait 2 Second's To Br Teleported"
        wait 1 real second
        send "&a → &7Please Wait 1 Second's To Br Teleported"\
        wait 1 real second
        teleport player to {spawnloc::%{SpawnPlace}%}

command /listspawns:
    permission: spawn.list
    trigger:
        send "&a → &7%{spawns::*}%"

command /number:
    permission: spawn.num
    trigger:
        send "&a → &7%{number}%"

 

Link to comment
Share on other sites

4 minutes ago, Boxmonkey said:

i am trying to make a server that has many spawn and will randomly pick one for the person to go and i can get 1 to work but 2 cant

here is my code


command /addspawn:
    permission: spawn.add
    trigger:
        add 1 to {number}
        set {spawnloc::%{number}%} to location of player
        add {spawnloc::%{number}%} to {spawns::*}
        send "&a → &7There Are Currently %{number}%&7 Spawn Locations Set"
        send "&a → &7%{spawnloc::%{number}%}%&7 IS Now A Spawn Location"

command /clearspawns:
    permission: spawn.clear
    trigger:
        set {number} to 0
        delete {spawns::*}
        send "&c → &7Cleared Spawn Loctions"
        send "&c → &7If This Says <none> You Have Cleared All Spawn locations"
        send "&c → &7%{spawns::*}%"


command /spawn:
    trigger:
        set {SpawnPlace} to random number between 1 and {number}
        send "&a → &7Please Wait 3 Second's To Br Teleported"
        wait 1 real second
        send "&a → &7Please Wait 2 Second's To Br Teleported"
        wait 1 real second
        send "&a → &7Please Wait 1 Second's To Br Teleported"\
        wait 1 real second
        teleport player to {spawnloc::%{SpawnPlace}%}

command /listspawns:
    permission: spawn.list
    trigger:
        send "&a → &7%{spawns::*}%"

command /number:
    permission: spawn.num
    trigger:
        send "&a → &7%{number}%"

 

so i added a line that sends the number and the number is 1.47 and i only want it to be a whole number

Link to comment
Share on other sites

5 minutes ago, Boxmonkey said:

so i added a line that sends the number and the number is 1.47 and i only want it to be a whole number

use random integer. like 
set {var} to random integer between 0 and 10
 

Integers are whole numbers

Edited by _Tarna_
  • Thanks 1

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev

---------------------------------------------------------

[VIP] - 7/27/2020

Community Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now

---------------------------------------------------------

image.png.70849a9b84e0347ce107b8e3eaee312c.pngimage.png.2111009afbd8bef10966ba9ede35a199.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...