I'm trying to force the player to get moved into a room after a separator has finished scrolling towards South.
But it causes this error:
Code (lua) Select
function sub_separator_h:on_activated(3)
-- slide down.
local hero = self:get_game():get_hero()
sol.audio.play_sound("explosion")
-- Create movement.
local dir = 3
hero:freeze()
local m = sol.movement.create("straight")
m:set_speed(90)
m:set_angle(dir*math.pi/2)
m:set_max_distance(32)
m:start(hero)
function m:on_obstacle_reached()
hero:unfreeze()
end
function m:on_finished()
hero:unfreeze()
end
end
But it causes this error:
QuoteError: Failed to load script 'maps/testlevel': [string "maps/testlevel.lua"]:41: <name> or '...' expected near '3'Line 41 is the beginning of the script here. The documentation for Separators suggests "on_activated(direction4)" only needs a number referring to the proper direction (in this case South), but I don't know how to write it so it won't throw this error.