Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → modified door cog
modified door cog
2002-12-26, 9:27 AM #1
How do I make it so a door with no keys can only be opened once, and then it is locked forever?
"Intelligent people know of what they speak; fools speak of what they know."

- Minchas Shabbos Pirkei Avos 3:18 / Ethics Of The Fathers
2002-12-26, 11:23 AM #2
Code:
symbols
flex	speed=5.0	desc=speed_of_door
thing	door		desc=main_door_object
message	activate
message	timer
int	opened=0			desc=door_lock_status
sound       dialogue=i00ky73t.wav	desc=kyle_locked
sound       wav0=lvrclik2.wav		desc=door_click
end

#COG code section
code
activate:
if(opened == 0)
{
        movetoframe(door, 1, speed);
	opened = 1;
	SetTimer(5);
}
else
{
	playsoundlocal(dialogue, 1, 0, 132);
	PlaySoundThing(wav0, door, 1.0, -1, -1, 0);
	print("Locked");
}

return;

timer:
	movetoframe(door, 0, speed);
	return;
end

↑ Up to the top!