Frictional Games Forum (read-only)

Full Version: Whats wrong with this script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I wanted to have my character get scared when looking at something, but it doesnt seem to work, tell me whats wrong with this.
PHP Code:
////////////////////////////
// Run first time starting map
void OnStart()
{
    
SetEntityPlayerLookAtCallback(pigScarePigfalse);
}

void ScarePig(string &in entityint alState)
{
    
GiveSanityDamage(10.0ftrue);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);

You're missing some quotes

SetEntityPlayerLookAtCallback("pig", "ScarePig", false);

Also, with it set false, the player will get scared each time they look at it.
(04-03-2011, 09:35 PM)Russ Money Wrote: [ -> ]You're missing some quotes

SetEntityPlayerLookAtCallback("pig", "ScarePig", false);

wow thanks i feel dumb now haha
Believe me, I do it all the time.
haha, i fixed it, but my guy doesnt get scared when he looks at the entity?, do i need to script my guy to look at the entity or what?
(04-03-2011, 09:38 PM)Itskody Wrote: [ -> ]haha, i fixed it, but my guy doesnt get scared when he looks at the entity?, do i need to script my guy to look at the entity or what?

I'm not really sure, I used the same effect but I used script areas instead of entities.
oh, nvm i got it, thanks tho