Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Whats wrong with this script
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#1
Whats wrong with this script

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: (Select All)
////////////////////////////
// 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);

04-03-2011, 09:33 PM
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#2
RE: Whats wrong with this script

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.
(This post was last modified: 04-03-2011, 09:36 PM by Russ Money.)
04-03-2011, 09:35 PM
Find
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#3
RE: Whats wrong with this script

(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
04-03-2011, 09:35 PM
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#4
RE: Whats wrong with this script

Believe me, I do it all the time.
04-03-2011, 09:37 PM
Find
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#5
RE: Whats wrong with this script

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
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#6
RE: Whats wrong with this script

(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.
04-03-2011, 09:40 PM
Find
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#7
RE: Whats wrong with this script

oh, nvm i got it, thanks tho
04-03-2011, 09:41 PM
Find




Users browsing this thread: 1 Guest(s)