Jump to content

Scripting help!?


MastaWizard

Recommended Posts

Basically i added a script to chickens. I used the Hello world tutorial. So when you click on the chickens it pops up hello world. Is there a way to instead make it when i click on the chicken it gives something out of its inventory. say the meat it has our something custom i added like Chicken Feathers (this script is for the mod i mad so you dont have to kill the chicken for the feathers).

 

Any and all help is much appreciated and i will give credit if you just help me a little bit. ( and i actually get a workable script from your info)

 

Please Help This Noob!

Edited by MastaWizard
Link to comment
Share on other sites

Scriptname ChickenDispenser extends ObjectReference

Event OnActivate(ObjectReference akActionRef)
   Game.GetPlayer().AddItem(FoodChicken, 1, true)
endEvent

 

 

FoodChicken is the editor ID in the CK - FoodChickenCooked for cooked.

 

Change the "1" to whatever amount you want.

 

 

Not sure if this works myself, since I'm a noob as well.

Link to comment
Share on other sites

Can you tell me how you made it so you can activate the chicken? I'm willing to make some tryouts things on them.

 

It would help to post your script so I can help you back.

 

PS: Food Chicken is just an example, you have to define it.

 

add this at beginning of the script:

 

Item Property MyItem Auto ;it doesn't matter the name (MyItem) (It's more of a shortcut after all)

 

then

 

Game.GetPlayer().Additem(MyItem, 1, true) ;true if you with to not show the message that it added the item

 

That is, it should fix your compile error.

 

After that, go to your item to which the script is attached and press Properties, that's where you select what does mean MyItem.

Edited by omega2008
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...