Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname Script extends Quest
- import Actor
- Actor Player
- WornItem Prefered
- ; Events
- ;---------------------------------------------
- Event OnInit()
- Player = Game.GetPlayer()
- RegisterForRemoteEvent(Player, "OnItemEquipped")
- EndEvent
- Event OnQuestInit()
- Debug.MessageBox("Press 'UP' to store a prefered visual. Press 'Down' to display the currently prefered visual.")
- EndEvent
- Event OnKeyDown(int aiKeyCode)
- If (aiKeyCode == Up)
- StoreVisual()
- ElseIf (aiKeyCode == Down)
- Debug.Notification("The prefered worn item is "+Prefered)
- EndIf
- EndEvent
- Event Actor.OnItemEquipped(Actor sender, Form akBaseObject, ObjectReference akReference)
- If (Prefered)
- ApplyVisual()
- EndIf
- EndEvent
- ; Functions
- ;---------------------------------------------
- Function StoreVisual()
- WornItem worn = Player.GetWornItem(BodySlot)
- If (worn)
- Prefered = worn
- Else
- Debug.Trace("StoreVisual, The 'Prefered' worn item cannot be none.")
- EndIf
- EndFunction
- Function ApplyVisual()
- If (Prefered)
- WornItem worn = Player.GetWornItem(BodySlot)
- worn.ModelName = Prefered.ModelName
- ; (?)
- ; Player.SetWornItem(BodySlot, Prefered)
- Else
- Debug.Trace("ApplyVisual, The 'Prefered' worn item cannot be none.")
- EndIf
- EndFunction
- ; Properties
- ;---------------------------------------------
- Group BipedSlots
- int Property BodySlot = 3 AutoReadOnly
- EndGroup
- Group KeyCodes
- int Property Up = 38 AutoReadOnly
- int Property Down = 40 AutoReadOnly
- EndGroup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement