#"The 2nd argument is not a text" error

1 messages · Page 1 of 1 (latest)

sick pine
#

Hello everyone, I get the error "the 2nd argument is not a text" for this Skript. I have been trying to fix it so it may be a mess now. Any help is much appreciated.

`command /kazıkazan [<text>] [<number>]:
trigger:
if arg 2 is set:
if arg 2 is a number:
set {_amount} to arg 2 parsed as integer
else:
send "{@prefix} &cGeçersiz miktar girdiniz." to player
stop
else:
set {_amount} to 1

    if arg 1 is not set:
        send "&b-----&9◀ &Premier&9 ▶&b-----"
        send "&2Bilet &aalmak için &3/kazıkazan bilet &8// &bFiyat: $300"
        send "&5Anahtar &aalmak için &3/kazıkazan anahtar &8// &bFiyat: $10"
        send "&b-----&9◀ &Premier&9 ▶&b-----"
        send "&aEn az ödül: &b$5"
        send "&aEn çok ödül: &b$150000 (150K)"
        stop

    if arg 1 is "bilet":
        set {_cost} to 300 * {_amount}
        if player's balance is greater than or equal to {_cost}:
            give {_amount} of paper named "&cKazı&6Kazan &2Bileti" with lore "&7&oAcaba içinden ne kadar çıkacak?" to player
            execute console command "/eco take %player% %{_cost}%"
            send "{@prefix} &5%{_cost}% &aödeyerek %{_amount}% Kazı Kazan bileti aldın." to player
        else:
            send "{@prefix} &cYeterince paran yok :("

    if arg 1 is "anahtar":
        set {_cost} to 10 * {_amount}
        if player's balance is greater than or equal to {_cost}:
            give {_amount} of lever named "&5Anahtar" with lore "&7&oKazı Kazan biletini kazımaya yarar." to player
            execute console command "/eco take %player% %{_cost}%"
            send "{@prefix} &5%{_cost}% &aödeyerek %{_amount}% Anahtar aldın." to player
        else:
            send "{@prefix} &cYeterince paran yok :("`
gaunt lodge
#

and on what line does it tell you the error is on?
also a couple other things:

  1. Lines 3, 4, and 5 can be combined into 1: set {_amount} to ((arg 2) ? 1)
  2. You don't need to run console commands for changing the player's balance (you just need the Vault plugin): add 1 to player's balance or remove x from player's balance
balmy reef
#

and why parse a number as an integer?