Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- robot = world:get_entity(4294967295)
- layer = 1
- local cnt = 0
- function step(count)
- if robot:get_layer() ~= layer then
- --teleport back
- local x,y = robot:get_position()
- robot:warp(x, y, layer)
- if cnt >= 1 then
- --punish the player if he changes layer repeatedly
- local hp, max_hp = robot:get_hp()
- robot:damage(max_hp * 0.99)
- end
- cnt = cnt + 1
- --show warning message
- game:message("Don't change layers!")
- end
- end
- function init()
- --hide "Lua Script" object from the world
- local luaObject = world:get_entity(this:get_id())
- luaObject:hide()
- luaObject:warp(9999999,9999999,(layer + 1)%4)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement