1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Trying to make skill point redeem thing {HELP}

Discussion in 'Skript' started by OneMore, Jul 24, 2017.

Tags:
Thread Status:
Not open for further replies.
  1. OneMore

    OneMore New Member

    Joined:
    Jul 16, 2017
    Messages:
    7
    Likes Received:
    0
    Code (Skript):
    1. command /redeem [<text>]:
    2.     permission: redeem.player
    3.     trigger:
    4.         if arg-1 is "speed":
    5.             if {skillpoints::%uuid of player%} >= 1:
    6.                 set {speed::%uuid of player%} to the player's walk speed
    7.                 add 0.1 to {speed::%uuid of player%}
    8.                 send "&aYour speed has been slightly increased!" to player
    9.                 broadcast "%{speed::%uuid of player%}%"
    10.                 remove 1 from {skillpoints::%uuid of player%}
    So, I am trying to make it so if a player types /redeem speed (and they have 1 skill point) their speed will be increased by 0.1. I tried this code, but even when I try it everything works, execpt the speed stays the same. When I broadcast the variable, it's always "0.3" as the player's speed. If anyone knows how to fix this, please tell me! Thanks in advance.
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    222
    since youre not actually changing the player's walk speed (youre only increasing the variable) , each time you run your command youre just setting {speed::%uuid of player%} back to 0.2 (the default player walk speed) and then adding 0.1 to it, resulting in the variable being 0.3 every time.

    so to fix this you just need to actually change the player's walk speed like so:
    Code (Skript):
    1. set player's walk speed to {speed::%uuid of player%} #put this after line 7
     
Thread Status:
Not open for further replies.

Share This Page

Loading...