Solved Need help with variables

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ZsCortzones

Member
Feb 18, 2021
32
1
8
26
It's been a while since I skripted and I've run into a problem I never had before. I'm trying to make a simple command where I can set locations to "deploy" a player to on a map, and the have them randomly teleported to one of ten of the locations, but for some reason I can't get either command to properly work, or even show up in the list of commands; being that whenever I type them they just show up red and say that no command exists under that name. Any Ideas?

upload_2023-1-7_22-35-12.png



Code:
command setdeployment <number>:
    permission: owner.setloc
    trigger:
        send "&aSuccessfully set location %arg-1%!"
        set {deployloc::%arg-1%} to location of player
        
command deploy:
    trigger:
        set {_location} to a random integer between 1 and 10
        teleport player to {deployloc::%_location%}
 
It's been a while since I skripted and I've run into a problem I never had before. I'm trying to make a simple command where I can set locations to "deploy" a player to on a map, and the have them randomly teleported to one of ten of the locations, but for some reason I can't get either command to properly work, or even show up in the list of commands; being that whenever I type them they just show up red and say that no command exists under that name. Any Ideas?

View attachment 7264


Code:
command setdeployment <number>:
    permission: owner.setloc
    trigger:
        send "&aSuccessfully set location %arg-1%!"
        set {deployloc::%arg-1%} to location of player
       
command deploy:
    trigger:
        set {_location} to a random integer between 1 and 10
        teleport player to {deployloc::%_location%}
I've never seen anyone make commands without the '/' before the command name, that might be your issue idk
 
I originally did try it with the / in front, but while searching for a way to randomize variables I found a video tutorial that didn’t use the / and it worked just fine, so I figured that may have been when my problem was, but it didn’t end up change anything
I've never seen anyone make commands without the '/' before the command name, that might be your issue idk
[doublepost=1673256357,1673211874][/doublepost]I figured it out on my own but thank you for trying to help me :emoji_slight_smile:
 
  • Like
Reactions: xdh
Status
Not open for further replies.