Mummy opens door
Posted: Wed Nov 12, 2014 11:09 am
Hi guys need help on this. I am using a mummy to walk towards a door, when mummy gets to the door, the door opens and he walks through the door end. I have tried this and the mummy does walk to the door but does not open the door and the mummy does not walk through the door way.
So I know the mummy can walk to dungeon_door_wooden_1, I need to get him to walk through. I think he may have to go to a new object.
Mummy Object:
Script in editor:
So I know the mummy can walk to dungeon_door_wooden_1, I need to get him to walk through. I think he may have to go to a new object.
Mummy Object:
Code: Select all
--- Mummy opens door with Lever ---
defineObject{
name = "mummy_test_1",
baseObject = "mummy",
components = {
{
class = 'Brain',
onThink = function(self)
Monster_To_Room.script.onThink(self)
end,
}
}
}
Code: Select all
function onThink(self)
--print(state)
if state == "begin" and self.partyLastSeen ~= 0 then
if self:goTo("dungeon_door_wooden_1") then
state = "closed"
end
end
if state == "closed" then
dungeon_door_wooden_1.door:open() ---Somewhere here I need the mummy to walk through door maybe to new object---
state = "end"
end
end