Silly script problem with levers...

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
azidahaka
Posts: 91
Joined: Fri Apr 13, 2012 9:48 pm

Silly script problem with levers...

Post 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
Ptitscorpion
Posts: 1
Joined: Sat Apr 21, 2012 5:04 pm

Re: Silly script problem with levers...

Post 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
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Silly script problem with levers...

Post by Komag »

just close, not closed (or you can do activate and deactivate)
Finished Dungeons - complete mods to play
azidahaka
Posts: 91
Joined: Fri Apr 13, 2012 9:48 pm

Re: Silly script problem with levers...

Post 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
Post Reply