Verse Error 3100

Where is ContainsKey() defined, is that a function you wrote?

if (PlayerDataMap.ContainsKey(Player)): { }

If you’re intending to check if the key exists, and do something if it doesn’t, I think it could be done something like this.

if:
    aPlayer := PlayerDataMap[Player]
then:
    # Do nothing (aPlayer was set successfully)
    block:
else:
   # The rest of your code to do something if there was no entry

There are probably other syntax/styles that accomplish the same thing in Verse (I’ve been using this style so far in my code).

2 Likes