Solved give player {_num} of...

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

Grisen

New Member
Nov 28, 2018
7
0
1
22
So I have this problem where i try to make a withdraw function to my coin skript. The coin skript gives you coins every 300 seconds... but when i try to give player the amount they types it gives me this error:

2 parsed as integer' is not a type (coin.sk, line 48: set {_num} to arg-2 parsed as integer

The code is this:

else if arg-1 is "withdraw":
if {coins.%player%} is greater than arg-2:
set {_num} to arg-2 parsed as integer
give player {_num} of gold ingot named "&6COIN" with lore "&6Rightclick to redeem"
 

Attachments

  • Udklip.PNG
    Udklip.PNG
    11.3 KB · Views: 213
change arg 2 to integer
/command [<text>] [<integer>]

or just delete parsed as integer
 
So I have this problem where i try to make a withdraw function to my coin skript. The coin skript gives you coins every 300 seconds... but when i try to give player the amount they types it gives me this error:

2 parsed as integer' is not a type (coin.sk, line 48: set {_num} to arg-2 parsed as integer

The code is this:

else if arg-1 is "withdraw":
if {coins.%player%} is greater than arg-2:
set {_num} to arg-2 parsed as integer
give player {_num} of gold ingot named "&6COIN" with lore "&6Rightclick to redeem"
If you can, can you send the complete code?

and i dont know if this will work, but try it:
code_language.skript:
else if arg 1 is "withdraw":
    set {_num} to arg 2 parsed as number
    set {_gold} to gold ingot named "&6COIN"
    set line 1 of lore of {_gold} to "&6Rightclick to redeem"
    if {coins.%player%} > {_num}:
        add {_num} of {_gold} to player
 
  • Like
Reactions: Grisen
Status
Not open for further replies.