(02-03-2015, 06:20 PM)Mudbill Wrote: Not quite there. Let's take a look:
void TimerFunction("PlaySound")
{
RunScript("PlaySoundAtEntity(string &in asTimer", "insanity_imageflash01.snt", "Player", 1, false);
}
Notice that in my example, I left the constructor (which is the line that starts with void) with the part you usually see on the engine scripts page. That's because that's how they must be. Don't edit that. If you see on the script page, it says callback syntax beneath AddTimer. Basically copy/paste that into your script (as long as the name matches).
I just did RunScript(); as an example. RunScript(); doesn't do anything, neither does it exist at the moment. This is where you want to put your own. Replace RunScript(); with whatever you want to run.
It should look more like this:
void TimerFunction(string &in asTimer)
{
PlaySoundAtEntity("", "insanity_imageflash01.snt", "Player", 1, false);
}
If you look closely at the wakeUp() script you have, it features a timer called beginStory().
Yes i noticed that. It works now. At first it played two times. Once at the beginning like before and at the timers que, but i removed it from void OnStart() and now it plays as it should. Thanks for you help. It's not that i want the more experienced to just hand the codes to paste in the script. I want to learn this, but it's really, really hard for me to grasp the logic of it. But i enjoy it at the same time. I guess i'll be back later for another problem, lol.