Scriv07

JasperSwitchStatic

Apr 14th, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. ScriptName JasperSwitchStatic Extends ObjectReference
  2. ; v0.1 https://www.reddit.com/r/skyrimmods/comments/4eto2z/better_papyrusscripting_can_you_help/
  3.  
  4. int index = -1
  5. ObjectReference[] Property Statics Auto
  6.  
  7.  
  8. Event OnActivate(ObjectReference akActionRef)
  9. index += 1
  10. SetScheme(Statics, index)
  11. Debug.MessageBox("Activated scheme "+index+" using "+Statics[index].GetName())
  12. Endevent
  13.  
  14.  
  15. Function SetScheme(ObjectReference[] akStatics, int aIndex)
  16. int len = akStatics.Length
  17. int idx = -1
  18. While(idx < len)
  19. idx += 1
  20. If(idx == aIndex)
  21. akStatics[idx].Enable()
  22. Else
  23. akStatics[idx].Disable()
  24. EndIf
  25. EndWhile
  26. EndFunction
Add Comment
Please, Sign In to add comment