1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
script=start 		on:use { 		clear; 		add "You can drive this wagon or store stuff inside."; 		add "What do you want to do?"; 		msgbox "Wagon"; 		local $id; 		$id=current_id(); 		add "exchange 2,$id;"; 		button 0,"Store stuff",19; 		add "ride $id; closemenu; event "ridehorse";"; //error is coming on this line 		button 1,"Drive the wagon",8; 		add "closemenu;"; 		button 2,"Do nothing with this wagon",3; 		freevar $id; 	} 			 	on:ridehorse { 	maxhealth "unit",1,100; 	} 	on:kill { 		 		free "self"; 	} 	on:getoff { 	maxhealth "unit",1,-100; 	} script=end