Page 1 of 1

Silly script problem with levers...

Posted: Tue Oct 09, 2012 10:09 pm
by azidahaka

Code: Select all

function apri()
    if lever_2:isActivated() == true and
	lever_3:isActivated() == true
	
then
	dungeon_door_iron_8:open()
	else
	dungeon_door_iron_8:closed()
	end
end	
says attempt to call method 'isactivated' (a nil value)
what i did wrong this time? :p i just want to pull 2 lever to open a door

Re: Silly script problem with levers...

Posted: Tue Oct 09, 2012 10:37 pm
by Ptitscorpion
azidahaka wrote:

Code: Select all

function apri()
    if lever_2:isActivated() == true and
	lever_3:isActivated() == true
	
then
	dungeon_door_iron_8:open()
	else
	dungeon_door_iron_8:closed()
	end
end	
says attempt to call method 'isactivated' (a nil value)
what i did wrong this time? :p i just want to pull 2 lever to open a door
Why don't you try this:

if lever_2:getLeverState() == "activated" and
lever_3:getLeverState() == "activated"
then
dungeon_door_iron_8:open()
else
dungeon_door_iron_8:closed()
end
end

Re: Silly script problem with levers...

Posted: Tue Oct 09, 2012 10:45 pm
by Komag
just close, not closed (or you can do activate and deactivate)

Re: Silly script problem with levers...

Posted: Tue Oct 09, 2012 10:46 pm
by azidahaka
thanks it was easier and worked :D no clue why it didn't before... in any case it's "close" not closed :D