- Code: Select all
message(object, $message, delay, data )
*if message = "*", then the message is sent to all objects in the scene.
*data - any data, a string, number, Vec3, etc.
- Code: Select all
function ResiveMessage(message, extra)
end
Example:
-- Player script
- Code: Select all
function onUpdate( timeDelta )
if (input.keyDown("f")==1) then
message(getEntityIDFromTag("flashlight"), "ON", 0)
end
end
-- flashlight script
- Code: Select all
function ResiveMessage(message, extra)
if (message == "ON") then
--the activation code of the flashlight
end
end