Updating the PlayerData twice simultaneously is not working #279


  • Waiting
Open
  • BLiTz_BaNe created this issue May 12, 2021

    Hi, There are times that the list of commands from runcmd: are being skipped. For example:

     

    runcmd:
    - $Script$%PlayerData%MinigameTokens>4999
    - $Script$%PlayerData%MinigameTokens-5000
    - /eco give $player 10000
    - '/broadcast 10000 eco give'
    - /record $player received 10000 coins`

    There are times that the player tokens are not being removed. The command is only checking the tokens but didn't remove it.

    Is there any option to improve this?

  • BLiTz_BaNe added a tag Waiting May 12, 2021
  • Caley19_ posted a comment May 12, 2021

    this should work:

     

    runcmd:
    - '$Script$%if%$PlayerData%MinigameTokens%>=5000'
    - '$Script$%PlayerData%MinigameTokens-5000'
    - '/eco give $player 10000'
    - '/bc 10000 eco give'
    - '/record $player received 10000 coins'

    - '$Script$%else%'

    - '$test$&cYou don't have enough coins.'

     

    if you put %if% everything under it will be executed. Cmd stops executing lines if you put another %elseif% or %else% under. No idea why it skips the second line but this should work, I do it like this always.


    Edited May 12, 2021
  • BLiTz_BaNe posted a comment May 12, 2021

    Thank you. It's not really always. But there are times that the second line is being skipped. I can't confirm if the third and fourth are being skipped as well. Let me try this and provide you the details after.

  • BLiTz_BaNe posted a comment May 12, 2021

    Hi, just an update. It seems here that this is not about skipping a line. But instead, on the part where '$Script$%PlayerData%MinigameTokens-5000' is, if you purchase the item twice simultaneously, the second one won't deduct anymore. Making it free item for the second item.

  • BLiTz_BaNe edited title May 12, 2021
  • BLiTz_BaNe posted a comment May 12, 2021

    I think the best way to fix this is to wait for the first process to finish and then proceed to the next process. 

    I noticed as well that if I spam the command which deducts the Playerdata points, there's a scenario that it won't deduct.

  • BLiTz_BaNe posted a comment May 19, 2021

    Just an update. Even tho we wait for a minute to pass for the next deduction to happen, sometimes, the `- $Script$%PlayerData%MinigameTokens-5000` or the `/mycmd-playerdata add` skips. What I meant was if I type that command, there are some scenarios that the playerdata is not being updated. By the way, we are currently using mysql.


To post a comment, please login or register a new account.