Can't compare with integer

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

sklaszlo

Member
Mar 9, 2022
1
0
1
34
Hi,
I'm very confused about how to resolve this issue I'm having. Admittedly I'm not having a very easy time working with Skript as I'm much more used to something like Java, albeit having a very basic understanding of it.
I'm having two errors. I do not have any addons. Any help would be extremely appreciated as I've been trying to get this to work for almost 2 hours with no luck.

Code (errors below):
Code:
options:
    achtext: &aAchievement by %loop-player%:&a

variables:
    {ach.%player%.StackGoldBlock} = 0

every 5 seconds:
    loop all players:
        if loop-player's inventory contains 64 of gold block:
            if {ach.%player%.StackGoldBlock} = 0
            send "{@achtext} &fStack of GOLD_BLOCK" to all players
            set {ach.%player%.StackGoldBlock} to 1

Line 10: (gold.sk)
Can't compare 'if if {ach.%player%.StackGoldBlock} = 0' with an integer.
Line: if {ach.%player%.StackGoldBlock} = 0

Line 12: (gold.sk)
There's no player in a periodical event
Line: set {ach.%player%.StackGoldBlock} to 1
 
it tells you the error. There is no %player% in a periodical event. You even used loop-player, why don't you use it inside your variables? Also I'd suggest using list variables
 
Status
Not open for further replies.