Jump to content

Script Help - Compiles fine


senterpat

Recommended Posts

Can somebody please tell me why this script isn't functioning as intended? I don't have much experience with menu options and would greatly appreciate it.

The script is functioning on the first block, but in game it doesn't even seem to register the buttons being pressed. Thanks for any help.

scn patPipeScript


int iButtonIndex	
int iPageNumber	

begin scripteffectstart
	player.additem patpipe 1 1
	ShowMessage patpipeMessage
	Set iPageNumber to 1
end


begin GameMode
	if ipagenumber == 1
	Set iButtonIndex to GetButtonPressed

		if iButtonIndex == 0
			player.cios pattobaccopipe
			playsound cigarettelighter
			player.removeitem pattobacco 1 1
			set ipagenumber to 0
		elseif iButtonIndex == 1
			player.cios patpcppipe
			playsound cigarettelighter
			player.removeitem patpcp 1 1
			set ipagenumber to 2
	
		elseif iButtonIndex == 3
			player.cios patmarijuanapipe
			playsound cigarettelighter
			player.removeitem patmarijuana 1 1
			set ipagenumber to 2
		elseif iButtonIndex == 4
			player.cios patheroinpipe
			playsound cigarettelighter
			player.removeitem patheroin 1 1
			set ipagenumber to 2
		elseif iButtonIndex == 5
			player.cios patamphetaminepipe
			playsound cigarettelighter
			player.removeitem patamphetamine 1 1
			set ipagenumber to 2
		elseif iButtonIndex == 6
			;do nothing
		endif
	endif

end

Link to comment
Share on other sites

The GameMode block type is not processed and will not work in Effect-type scripts. ScriptEffectUpdate (instead of GameMode) might work, though I somewhat doubt that - nonetheless, it would be interesting to try.

The "conventional" way of doing it is by adding a token item that is running an Object-type script with OnAdd + GameMode blocks (just remember to call RemoveMe once the menu is exited).

Link to comment
Share on other sites

  • 3 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...