SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.07k stars 370 forks source link

Skript Crashed while getting player's money #6920

Open zopn333 opened 3 months ago

zopn333 commented 3 months ago

Skript/Server Version

Skript 2.9.0
Paper 1.21-81

Bug Description

It's in my guild system, I wrote a very simple script to make a function to get player's data and cauculate them. It works perfectly on my local test server, but today my player told me it doesn't work. Here is error log and part of script: error.log function.txt

Expected Behavior

It will just get player's money and do other things, but the result is , lead to a broken return of function.

Steps to Reproduce

After players report to me, I reloaded skript and it's fine at begining, then they use the same command and it break down again. I've tested permission, player ID with underline or not, didn't find the cause.

Errors or Screenshots

The result should be like this: 397d6ca47cec4ffaa08d15d3cd0aa26 But player's resule is this: 4c597aebc4dd18d5832c6644d35ee10

Other

No response

Agreement

sovdeeth commented 3 months ago

@UnderscoreTud I'd expect the money to be converted to a double, any ideas?

UnderscoreTud commented 3 months ago

@UnderscoreTud I'd expect the money to be converted to a double, any ideas?

I will take a look later

sovdeeth commented 3 months ago

@zopn333 can you send the full result of /sk info please?

sovdeeth commented 3 months ago

I'm struggling to replicate on 2.9.0 Can anyone else replicate it with the following?

command test:   
    trigger:
        #6920
        set {_money} to player's bank account
        set {_wealth} to {_money} * 0.01
        #6921
        set {fly.price} to 10
        broadcast "%{_money}%, %{_wealth}%, %{fly.price}-(money of player)%"
zopn333 commented 3 months ago

@zopn333 can you send the full result of /sk info please?

微信截图_20240719094605

zopn333 commented 3 months ago

I've found a solution to it, just because {_money} is not a number. I parsed it as number then everything works again. But shouldn't bank account be a number?

sovdeeth commented 3 months ago

well money is technically money, which is like a number but with some info about currency. The weird thing is that we cannot replicate this error at all when we test.