lordneverar Posted October 12, 2008 Share Posted October 12, 2008 Im really bad at scripting and I made this script. Its really simple all it is supposed to do is ask the player if they want to give 100 coins to be blessed and if they say yes then it will do it and if they say no then nothing happens. I just dont know how to use the button function... Any help would be great :wallbash: here is the script. scn AltarSeptim short button begin onactivate messagebox "Would you like to donate 1000 gold and recieve a blessing?", "Yes", "No" set button to getbuttonpressedIf ( button == 0 )player.removeitem 000000F 1000cast aaaSeptemCure player endifendif End Link to comment Share on other sites More sharing options...
lordneverar Posted October 12, 2008 Author Share Posted October 12, 2008 hmmm... I tried the script and it didnt work... Could this be because the script is attached to a piece of clothing in-game? (the player isnt wearing it its just laying on the ground) Link to comment Share on other sites More sharing options...
Vagrant0 Posted October 12, 2008 Share Posted October 12, 2008 hmmm... I tried the script and it didnt work... Could this be because the script is attached to a piece of clothing in-game? (the player isnt wearing it its just laying on the ground)It could be that, don't really remember how well inventory items worked with gamemore scripting since there are so few cases where this is what you would want, and attaching such scripts to inventory items can potentially cause bloating if the item is dropped/picked up frequently. But in this case I believe it has more to do with how you've setup the buttons. You need two blocks for a button script, one which initiates the message, and one which runs after the message was shown in order to register what button was pressed, and perform the action. In simple terms, the game cannot retrieve the information about which butto was pressed within the same frame that the message happens. To accomplish this, you may want to just have the item trigger a placed/moved activator within the same cell, which does the message in an activate block, and the detection stuff in a gamemode block, and use some additional variables to control what parts happen only after a choice has been made. Once money is removed, the activator is simply moved back to some holding area. With the inventory item, what you might want to do is use an onequip and menumode block to perform the needed actions. Anything used from inventory will trigger an onequip block, even if that item cannot normally be equipped (misc items). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.