Can’t find in list

I’m trying to check if a string is in a list, but it never finds it and there’s no error message.
Puts items in list:
WE ("ad")

Function(WE):
list add (game.endings, ToString(end))

Finds item in list:
x1 = ListContains(game.endings,"ad")
x2 = ListContains(game.endings,"vibe")
if (x1 and x2) {
player.parent = Void1
}

Creation of list:
game.endings = NewStringList()

Thanks in advance!


That looks like it should work.

Are you sure that you've added both items, and that they were in the list before checking?
Was the list initially set to a list? Are you sure there's no code running in between that would remove items or reset the list?


Well, I did all of that. If it could help, I’ll post where I created the list.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums