Message Boolean (SOLVED)

How can you do a msg.post with a boolean? Either true or false.
So on the receiver script if the boolean if true then x will happen and if boolean is false then y will happen.

When posting messages you can supply a optional table. You can store your boolean in that table.
msg.post("#script", "portal_active", {active=false})
Then in your on_message check for

if message_id == hash("portal_active") then
  if message.active then
    -- do stuff
  else
    -- do other stuff
  end
end
3 Likes