Jump to content

Having problems with a script


Recommended Posts

I'm trying to script a moonshine distillery that will produce moonshine with the proper ingredients. I just can't seem to get it to work. I cannot even open a menu when I click on the distillery, and I'm almost positive it has something to do with how I've configured the script.

 

I'm trying to make it so that when you click on the distillery, it asks you if you want to make moonshine with the ingredients. If you select yes (button 0), you'll loose the ingredients and gain a thing of moonshine (granted you have the ingredients on your person). If you select no (button 1), you leave the menu.

 

scn BoozeMoonshineMakerSCRIPT

 

;---------------------------------------------------------------------------------------------------------------------------------------------

 

short hasItems

short button

short checkButtons

 

;---------------------------------------------------------------------------------------------------------------------------------------------

 

Begin onActivate

if IsActionRef player == 1

if (player.GetItemCount DLC04PungaWild > 0) && (player.GetItemCount FissionBattery > 0) && (player.GetItemCount DLC04Yeast > 0)

set hasItems to 1

else

set hasItems to 0

endif

set checkButtons to 1

ShowMessage BoozeMoonshineMakerFirstMsg

endif

End

 

;---------------------------------------------------------------------------------------------------------------------------------------------

 

Begin gameMode

if (checkButtons == 1)

 

set button to getbuttonpressed

 

if button > -1

if button == 0

if hasItems == 1

ShowMessage BoozeMoonshineMakerSuccessMsg

player.additem DLC04FF03Moonshine 1

player.removeitem DLC04PungaWild 1

player.removeitem FissionBattery 1

player.removeitem DLC04Yeast 1

elseif (hasItems == 0)

ShowMessage BoozeMoonshineMakerFailMsg

endif

 

elseif button == 1

;don't do anything

endif

 

set checkButtons to 0

 

endif

endif

 

End

 

This is the last thing I need to do for my quest mod, and I've been tugging out my hair over it. If anyone can help me out, I'll be so damn happy. And if you need any more information, just ask.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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