#read strings as code

1 messages · Page 1 of 1 (latest)

sly briar
#

how can i like read a string as a code?, i wanna give multiple statements for something to happen but is a single object, so i wanna like write in the instance create and then make it be readed all the time, or how could i run the line of code i wrote in the instance create?

fervent haven
#

the answer is you can't, instead you should use a function

    return array_contains(player.inventory, "key");
}```
sly briar
#

and how i run it in the step event?

cold socket
#

It's a method

#
// Step event
show_debug_message(requirement());
#

As long as it's the instance that has defined requirement, then they can use it

fervent haven
#

with it having a return like my example, you can do if requirement() { //do stuff if requirement came back true }