Advertisement
Scriv07

Untitled

Feb 17th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. Scriptname Script extends Quest
  2. import Actor
  3.  
  4. Actor Player
  5. WornItem Prefered
  6.  
  7.  
  8. ; Events
  9. ;---------------------------------------------
  10.  
  11. Event OnInit()
  12. Player = Game.GetPlayer()
  13. RegisterForRemoteEvent(Player, "OnItemEquipped")
  14. EndEvent
  15.  
  16. Event OnQuestInit()
  17. Debug.MessageBox("Press 'UP' to store a prefered visual. Press 'Down' to display the currently prefered visual.")
  18. EndEvent
  19.  
  20.  
  21. Event OnKeyDown(int aiKeyCode)
  22. If (aiKeyCode == Up)
  23. StoreVisual()
  24. ElseIf (aiKeyCode == Down)
  25. Debug.Notification("The prefered worn item is "+Prefered)
  26. EndIf
  27. EndEvent
  28.  
  29.  
  30. Event Actor.OnItemEquipped(Actor sender, Form akBaseObject, ObjectReference akReference)
  31. If (Prefered)
  32. ApplyVisual()
  33. EndIf
  34. EndEvent
  35.  
  36.  
  37. ; Functions
  38. ;---------------------------------------------
  39.  
  40. Function StoreVisual()
  41. WornItem worn = Player.GetWornItem(BodySlot)
  42. If (worn)
  43. Prefered = worn
  44. Else
  45. Debug.Trace("StoreVisual, The 'Prefered' worn item cannot be none.")
  46. EndIf
  47. EndFunction
  48.  
  49.  
  50. Function ApplyVisual()
  51. If (Prefered)
  52. WornItem worn = Player.GetWornItem(BodySlot)
  53. worn.ModelName = Prefered.ModelName
  54. ; (?)
  55. ; Player.SetWornItem(BodySlot, worn)
  56. Else
  57. Debug.Trace("ApplyVisual, The 'Prefered' worn item cannot be none.")
  58. EndIf
  59. EndFunction
  60.  
  61.  
  62. ; Properties
  63. ;---------------------------------------------
  64.  
  65. Group BipedSlots
  66. int Property BodySlot = 3 AutoReadOnly
  67. EndGroup
  68.  
  69. Group KeyCodes
  70. int Property Up = 38 AutoReadOnly
  71. int Property Down = 40 AutoReadOnly
  72. EndGroup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement