Jump to content

.disable NPC doesn't work


Xynion

Recommended Posts

Hey guys!

 

I tried to write a script to hide (or to disable) a (dead) NPC after passing the linked trigger-box. That's my script:

 

ScriptName ZModLetsHideSCRIPT

Short DoOnce

ref ZModDCorpseRef

Begin OnTrigger
	if DoOnce == 0
		ZModDCorpseRef.disable
			set DoOnce to 1
	endif

End

 

I want the corpse to be there and to disappear once (after the player touched the triggerbox), nothing more, but I do not figure out how this might work. I suppose the error to be at the Ref-line (the NPC's ID is ZModDCorpse without Ref), but I'm not sure how to fix this problem.

 

Looking forward for every help!

Link to comment
Share on other sites

You must use the unique reference editor ID (which in this case, if I understand correctly, is 'ZModDCorpse'). ZModDCorpseRef is just a declared variable in your script, but with no assigned value.
Try this script, instead:

scn ZModLetsHideSCRIPT

begin OnTriggerEnter player

	ZModDCorpse.Disable
	Disable
	MarkForDelete

end
Link to comment
Share on other sites

Go to where you placed the corpse in the game world, and double-click on him. By my understanding, if you haven't given him anything in the way of a Reference Editor ID, the game won't know which instance (even if there's only one) you're talking about. Fill in a name for him and then use that in your script in place of ZModDCorpse, and you should be good.

Edited by becauseofreasons
Link to comment
Share on other sites

  • Recently Browsing   0 members

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