/rankupall

Discussion in 'Skript' started by TrifleTower, Apr 23, 2017.

  1. Hey,

    I want a skript so people can rankup from A to free rank with one command (Pex)

    I want it so if they are already free, they can't do it.

    Code (Text):
    command /rankupall:
            permission: dg.rankupall
            usage: /rankupall
            trigger:
                if player's balance is more than or equal to 3900000000000000:
                    execute console command "pex user %player% group set Free"
                    execute console command "eco take 3900000000000000"
                    message "&c&l+ &eCongratulations, you've been ranked up to Free."
                    stop
                else:
                    message "&c&lYou do not have enough money to do this!"
    That's my code at the moment.

    Thanks!
     
  2. Use the "if player's rank contains "Free":" event (I think there is one)
     
  3. I need to so only A ranks can do it.
     
  4. mathhulk

    mathhulk Retired Moderator
    Retired

    Use the following to check the player's current rank via PEX (requires skAction):
    Code (Text):
    if player's group is "A":
    Then, add it to your script by doing the following:
    Code (Text):
    command /rankupall:
            permission: dg.rankupall
            usage: /rankupall
            trigger:
                  if player's group is not "A":
                         send "You must be in group A."
                  else if player's balance is less than 3900000000000000:
                         send "You must have more money."
                  else:
                         execute console command "pex user %player% group set Free"
                         execute console command "eco take 3900000000000000"
                         send "You have ranked up to free."
     
  5. Dude, I would use SharpSK instead of skAction and remove that console command executions:
    Code (Text):
    if groups of player contains "A":
        if player's balance is greater than (390 * 10 ^ 12):
            pex add group "Free" to player
            pex remove group "A" from player
            remove (390 * 10 ^ 12) from player's balance
     
    There is no problem on use console commands though.
     
  6. Thanks a lot!

    How can I make it so I can display someones Pex group in chat. So like if someone did /mygroup it would say...

    Your Group Is: *PEX GROUP*

    Thanks!
    TrifleTower
     
  7. You can make that using {rank.%player%} if you're declaring a variable for every rank you have.
    But you can try skAction, and use "group". Like: message "your group is: %group%"
     
  8. You can maybe try to use this. As im a new skript dev, i dont really know what you can do with it and what you cannon, so i dont know if you can display 'variables' in messages. Also, if this skript actually works, it wont update until the player leaves and joins back.

    Code (Text):
    on join:
        if player has permission "group.admin":
            set {rank.%player%} to "admin"
        if player has permission "group.moderator":
            set {rank.%player%} to "moderator"
           
    on leave:
        delete {rank.%player%}
       
    command /mygroup:
        trigger:
            send "Your rank is: {rank.%player}"
     
  9. Actually it's easier to just check the players group instead of a permission they have.
     
  10. But checking for a specific perm is still possible ;)
     
  11. Yeah but it's annoying having to add a permission to a group. Why not do it with ease? ;)
     
  12. I know im hijacking a thread right now, but brett, you know a periodical time event smaller than 1 tick ? Im making a GUI that has a "loading screen" and its set to add 1 black tile every 1 tick, but i need this delay even smaller.
     
  13. Try 0.5 ticks or 0.05 seconds.
     
  14. anything smaller than 1 tick doesnt seem to work