Giving a player an item at the start of the game?

Post » Sun Aug 25, 2013 11:59 am

Im currently working on a mod that needs to give players an item when the mod first starts... How do i do something like that?

User avatar
Amanda savory
 
Posts: 3332
Joined: Mon Nov 27, 2006 10:37 am

Post » Sun Aug 25, 2013 3:20 pm

put a script somewhere that suits you and make it go

OnInit ()

Game.GetPlayer().AddItem ( Item, 1 )

endEvent

you'll need your item "item" in a property, it can either be a base item or a reference.

you can also put the item itself somewhere in the world, add a script to it and go

OnInit ()

Game.GetPlayer().AddItem ( ( Self as ObjectReference ) )

endEvent

in this case, you'd not need a property.

edit: might be you'd have to go "( Game.GetPlayer () ).AddItem..." (additional brackets), but i don't actually think so (no ck open right now)

User avatar
sharon
 
Posts: 3449
Joined: Wed Nov 22, 2006 4:59 am

Post » Sun Aug 25, 2013 4:30 pm

Thanks! Do all scripts get the "OnInit()" method called every time the game is started? or just once per new game?

User avatar
Johanna Van Drunick
 
Posts: 3437
Joined: Tue Jun 20, 2006 11:40 am


Return to V - Skyrim