Jump to content

How do you fix 'missing EndOfFile at 'If'' error?


Recommended Posts

Hey! I'm very new to fallout 4 modding, so far my mods have been for new vegas. I don't understand the scripting and I can't get this one to work:

MiscObject Property ClothesResident7Hat Auto
Quest Property BeeDia Auto

If (Game.GetPlayer().GetItemCount(ClothesResident7Hat) >= 1)
  BeeDia.SetStage(20)
endIf

It gets the following error:

missing EndOfFile at 'If'
Can someone explain me how I should do this?
I'm trying to make a quest advance once the player has a Newsboy cap in their inventory.

 

Link to comment
Share on other sites

Hey! I'm very new to fallout 4 modding, so far my mods have been for new vegas. I don't understand the scripting and I can't get this one to work:

 

MiscObject Property ClothesResident7Hat Auto
Quest Property BeeDia Auto

If (Game.GetPlayer().GetItemCount(ClothesResident7Hat) >= 1)
  BeeDia.SetStage(20)
endIf

It gets the following error:

missing EndOfFile at 'If'
Can someone explain me how I should do this?

I'm trying to make a quest advance once the player has a Newsboy cap in their inventory.

 

 

 

If it's a quest script, it should look like this:

 

 

Scriptname MyQuestScript extends Quest Const					; Scriptname: MyQuestScript. Extends: Quest (it's a quest script). Const flag: See the link below.

MiscObject Property ClothesResident7Hat Auto Const				; Property
Quest Property BeeDia Auto Const						; Property


Event OnStageSet(int auiStageID, int auiItemID)					; event recieved when a Stage is set
	If auiStageID == 10						        ; Stage 10 is set
		If (Game.GetPlayer().GetItemCount(ClothesResident7Hat) >= 1)	; if the Player has "ClothesResident7Hat" in their inventory
			BeeDia.SetStage(20)				        ; advance the quest to Stage 20
		EndIf
	EndIf
EndEvent

 

 

 

Read more about "extends" and Const" here.

 

Read more about quest script here.

Edited by LarannKiar
Link to comment
Share on other sites

  • Recently Browsing   0 members

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