Solved Need help with sign text & balance

  • 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 community!

    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.

Kuzifes

Member
Apr 25, 2017
16
0
1
Code:
on rightclick on sign:
    line 1 of the clicked block is "[Region]":
        set {regiontmp} to line 2
        if line 4 is empty:
            set {moneytmp} to line 3
            if player's money is more than or equal to {moneytmp}:
                remove {moneytmp} from player's money
                set line 4 to "%player%"
                execute console command "rg addmember -w %player's world% %{regiontmp}% %player%"
                clear {moneytmp}
                clear {regiontmp}
            else:
                send "&cNot enough money."
                stop trigger
        else:
            send "&cAlready in use."
            stop trigger

Everything is working fine except the money. it keeps saying not enough money, even if the player has enough.

Using newest SkriptLang-version.
 
Because line 3 is a text, therefor your variable is a text, you cant compare a player's balance with a text (Im surprised you're not getting an error for that)
You will need to parse it as a number, ex:
code_language.skript:
set {moneytmp} to line 3 parsed as number
 
Because line 3 is a text, therefor your variable is a text, you cant compare a player's balance with a text (Im surprised you're not getting an error for that)
You will need to parse it as a number, ex:
code_language.skript:
set {moneytmp} to line 3 parsed as number
Thanks :emoji_grinning:
 
Status
Not open for further replies.