Jump to content

Skyrim Scripting?


Recommended Posts

Is anyone of you familar with Skyrim Scripting? I seems to get some aid at the Skyrim forum, but I ask here as well, in case. I cannot test this script until tomorrow evening but the thing is, that I will add all stauff i find and want to sell per auto inside a chest in Whiterun, called PekContainerREF, add this script to an activater, a bloody button or handle that I push or drag or whatever, called PekHandleREF.

 

The question is, will this script work? Did I structure it right? This will be my first Skyrim Script ever made, so I feel a bit frustrated right now that i cannot test it until tomorrow... :/

ScriptName PekSellAllThisStuff

Int PekNumberOfItemsinStack
Int PekFormIndex
Int PekGoldValue
Form PekForm

Event OnActivate (ObjectReference PekHandleREF)
	
	PekFormIndex = PekContainer.GetNumItems()

	While PekFormIndex > 0 
		
		PekFormIndex -= 1

		PekForm = Player.GetNthForm(PekFormIndex)
		PekNumberOfItemsinStack = Player.GetItemCount(PekForm)
		PekGoldValue = PekForm.GetGoldValue()
		
		PekGoldValue = PekGoldValue * PekNumberOfItemsinStack 

		Player.RemoveItem(PekForm, PekNumberOfItemsinStack ) 
		Player.Additem(GoldBase, PekGoldValue)
	EndWhile

endEvent
Edited by Pellape
Link to comment
Share on other sites

  • Recently Browsing   0 members

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