Jump to content

Activator Script Help


Jiddle

Recommended Posts

Okay, so I added an activator(Red box) to my cell. I want it to do so that if the player walks into the red box, he will get 1 gold and a sound will play.

So I added a new script to the activator, and wrote this:

 

Scriptname MyScript extends ObjectReference 
 
event OnTriggerEnter(objectReference akActionRef)
	
	Game.GetPlayer().AddItem(Gold001, 1) ; Add one gold to the Player
	MySound.Play(Self) ; Play the sound
		
endEvent

Sound Property MySound Auto

 

But when I tried it in-game, nothing happened when I walked into it the first time, but after that the sound played every time I did. But I never got any coins!

I went like Whaaaat? :wacko: So I started to look for where I had made a mistake. Here is the mindf***: If I remove the MySound.Play line from the script, the sound still plays! But if I remove the script from the activator, it does not play.

I have no clue what to do, and what is causing this..

 

Anyone know what may be the problem?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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