SirBeasty Posted April 10, 2018 Share Posted April 10, 2018 I am trying to create a mod, and currently I am trying to get a quest script to work after I pick up a certain item. I have managed to get the item to start the quest when I pick it up, but the quest script won't do what it is supposed to do, which currently is show a message box saying that it started.Here is the script for the item:Scriptname SirBeastEviriGemScript extends ReferenceAlias ;---------VariablesMiscObject Property GhostGem Auto Actor Property Player Auto ;-----EventsEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) If(akNewContainer == Player)debug.messageBox("Item picked up.")if GetOwningQuest().GetStage() < 20GetOwningQuest().setStage(20)EndIfElseIf(akNewContainer != Player)debug.messageBox("Item put away.")if GetOwningQuest().GetStage() > 10GetOwningQuest().setStage(10)EndIfEndIfEndEvent And here is the script for the quest:Scriptname SirBeastEviriBoonQuestScript extends Quest import utility;--------Variables------MiscObject Property GhostGem Auto Perk Property AttackBuff Auto Actor Property Player Auto Int Property Random Auto Int Property coin Auto Quest Property EviriBoonQuest Auto ;----EventsEvent OnStoryAddToPlayer(ObjectReference akOwner, ObjectReference akContainer, Location akLocation, Form akItemBase, \int aiAcquireType)if akItemBase == GhostGemif EviriBoonQuest.getStage() == 20debug.MessageBox("Quest has started")coin = 1While coin == 1Player.AddPerk(AttackBuff)utility.wait(3)random = utility.randomint(1, 5)if random == 1Debug.MessageBox("Perk 1 was added")elseif random == 2Debug.MessageBox("Perk 2 was added")elseif random == 3Debug.MessageBox("Perk 3 was added")elseif random == 4Debug.MessageBox("Perk 4 was added")elseif random == 5Debug.MessageBox("Perk 5 was added")elseDebug.MessageBox("No perk was added")EndIfIf EviriBoonQuest.getStage() == 10coin = 0EndIfEndWhileEndIfEndIfEndEventThank you for the help.Edit: The first script actually doesn't work to start the quest, so I tried to attach another script directly to the item. It worked the first time but not the second time.Scriptname SirBeastEviriTestScript extends ObjectReference import utility;------Variables----------Actor Property Player Auto Perk Property AttackBuff Auto MiscObject Property GhostGem Auto Int Property random AutoInt Property coin AutoQuest Property EviriBoonQuest Auto ;-----EventsEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) EviriBoonQuest.start()If(akNewContainer == Player)debug.messageBox("Item picked up and perk added.")EviriBoonQuest.setStage(20)ElseIf(akNewContainer != Player)debug.messageBox("Item put away and perk removed.")EviriBoonQuest.setStage(10)EndIfEndEvent Link to comment Share on other sites More sharing options...
Recommended Posts