littleork Posted June 14, 2012 Share Posted June 14, 2012 Hello everyone I am doing a quest that makes you buy a forge from a npc, once you buy it, I want 300 gold to spawn in a chest every 24 hours. I was helping myself from the spouse quest to try to understand the coding but looks like I hit a wall. What I pretty much did is that on the last stage of my quest, I added alias_mordrin.RegisterForUpdateGameTime(24) mordrin being my chest alias, on the alias I made a forced reference to that chest. On the alias, I have this script Event OnUpdateGameTime() If rpgbsProfit.getstage()==20 mordrin.getreference().additem(gold001,300) EndIf EndEvent But it seems like its not the way the code is suppose to work and I dont really know where to start to search for errors, any help? Thanks in advance Link to comment Share on other sites More sharing options...
steve40 Posted June 14, 2012 Share Posted June 14, 2012 (edited) Try this ScriptName ChestQuestAliasScript extends ReferenceAlias ObjectReference Property gold001 auto Event OnUpdateGameTime() If GetOwningQuest().GetStage() == 20 self.GetRef().AddItem(gold001, 300) EndIf EndEvent After adding this script to the chest alias, you'll need to click the properties button, then auto-fill. Edited June 14, 2012 by steve40 Link to comment Share on other sites More sharing options...
littleork Posted June 14, 2012 Author Share Posted June 14, 2012 Try this ScriptName ChestQuestAliasScript extends ReferenceAlias ObjectReference Property gold001 auto Event OnUpdateGameTime() If GetOwningQuest().GetStage() == 20 self.GetRef().AddItem(gold001, 300) EndIf EndEvent After adding this script to the chest alias, you'll need to click the properties button, then auto-fill. It worked! Thank you so much for your help! I was about to give up on this. Link to comment Share on other sites More sharing options...
Recommended Posts