Okay, I'm trying to make a GUI that displays the buttons on an elevator. GUI 2 is the panel and button 0 is the first button. My goal is to make it so when the player clicks button 0, the doors close, the command parser waits for 3 seconds, the doors open again, and the character walks out. I've never actually done direct scripting before, so I've probably screwed up some mundane detail:
When I try to test the game, I get a PE03: Parse Error at '2' on that second line. GUI 2 does exist, so I don't understand what the problem is.
One thing that bothers me is that comment that reads "this function is obsolete." Is there a more recent function I should be using? Please help.
#sectionstart interface_click // DO NOT EDIT OR REMOVE THIS LINE function interface_click(2, 0) { // This function is obsolete, from 2.62 and earlier versions. gui[2].Visible = false; // Elevator doors close. object[0].Visible = true; object[0].SetView(9); object[0].Animate(0, 5, eOnce, eBlock); object[0].StopAnimating(); object[0].SetView(11); // Elevator moves. Wait(120); // Elevator doors open. object[0].SetView(10); object[0].Animate(0, 5, eOnce, eBlock); object[0].StopAnimating(); object[0].SetView(12); // Todd exits. character[Todd].Walk(97, 151, eBlock); character[Todd].changeroom(3, 305, 167); }
When I try to test the game, I get a PE03: Parse Error at '2' on that second line. GUI 2 does exist, so I don't understand what the problem is.
One thing that bothers me is that comment that reads "this function is obsolete." Is there a more recent function I should be using? Please help.