Advertisement
Guest User

Book add script

a guest
Sep 23rd, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. Scriptname mskd_itemMenu extends ObjectReference
  2. {Menu for custom items}
  3.  
  4. Message Property Question Auto
  5. {Menu description}
  6. Message Property SacDef Auto
  7. Message Property MTel01 Auto
  8. Message Property MTel02 Auto
  9. Message Property MTel03 Auto
  10. Message Property GHToil Auto
  11. Message Property BosGam Auto
  12. ;Various buttons, like menu, message items I made in Creation Kit.
  13.  
  14. Book Property mskd_SacredDefiance Auto
  15. Book Property mskd_ManyTell01 Auto
  16. Book Property mskd_ManyTell02 Auto
  17. Book Property mskd_ManyTell03 Auto
  18. Book Property mskd_GoodHonestToil Auto
  19. Book Property mskd_BosmerianGambit Auto
  20. ;The script doesn't know about game objects unless I name each one specifically, so Book does that.
  21. ;I also tried MiscObject, it ran but didn't add to inventory. BookItem and BookObject fail to compile.
  22.  
  23. int Button
  24. ;Keeps track of the button index, that is, which of the question messagebox options is chosen
  25.  
  26.  
  27. EVENT onActivate(objectReference akActionRef)
  28. ;" akActionRef is a variable name you will be using in the script below. It holds the reference of the actor that activated the object this script is attached to. For clarity, you should leave it named as is."
  29.  
  30. If akActionRef == Game.GetPlayer()
  31. ;Checking if the variable 'akActionRef ' is the player.
  32.  
  33. Button = question.show()
  34. ;Display the 'question' text, get the index number of the item ('button') chosen.
  35.  
  36. if button == 0
  37. SacDef.show()
  38. ;Keep this option showing while the rest disappear and the action happens, like in conversations.
  39. Game.GetPlayer().AddItem(mskd_SacredDefiance,1,true)
  40. ;Place item in player inventory.
  41.  
  42. elseif button == 1
  43. MTel01.show()
  44. Game.GetPlayer().AddItem(mskd_ManyTell01,1,true)
  45.  
  46. elseif button == 2
  47. MTel02.show()
  48. Game.GetPlayer().AddItem(mskd_ManyTell02,1,true)
  49.  
  50. elseif button == 3
  51. ;MTel03.show()
  52. Game.GetPlayer().AddItem(mskd_ManyTell03,1,true)
  53.  
  54. elseif button == 4
  55. GHToil.show()
  56. Game.GetPlayer().AddItem(mskd_GoodHonestToil,1,true)
  57.  
  58. elseif button == 5
  59. BosGam.show()
  60. Game.GetPlayer().AddItem(mskd_BosmerianGambit,1,true)
  61. endif
  62. ;No more if/elsif/else statements on this level.
  63. Endif
  64. endEVENT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement