Trying to make skill point redeem thing {HELP}

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

OneMore

New Member
Jul 16, 2017
7
0
0
22
code_language.skript:
command /redeem [<text>]:
    permission: redeem.player
    trigger:
        if arg-1 is "speed":
            if {skillpoints::%uuid of player%} >= 1:
                set {speed::%uuid of player%} to the player's walk speed
                add 0.1 to {speed::%uuid of player%}
                send "&aYour speed has been slightly increased!" to player
                broadcast "%{speed::%uuid of player%}%"
                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.
 
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_language.skript:
set player's walk speed to {speed::%uuid of player%} #put this after line 7
 
Status
Not open for further replies.