Hello, I’ve got a small question about the use of local variables. I am trying to make it so that the collection changes only after the player collects a certain amount of points. I have it set up that once this point number is achieved local canenter changes from false to true. Now I just need to execute…
if message_id == hash("collision_response") and canenter = true then
print("checkpoint")
msg.post("loader:/go#loader", "level_two")
end
This does not seem to be working. Thanks for the help!
Unfortunately, there is not enough info to help you.
I would recommend you add print(message_id) at line 8, to make sure you receive all the messages you need and with the right message names (“can enter”, “collision_response”). Also, check if your code works without canenter variable.
One more option is to use Debugger and breakpoints, hot help you to understand what did you miss.