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
Script Help Can't get area script to work!
Amphen Offline
Junior Member

Posts: 2
Threads: 1
Joined: Jul 2012
Reputation: 0
#1
Can't get area script to work!

Hellow I'm a new scripter and I really could need some help solving this problem. Confused
In my level editor I've made an area called "ScriptArea_1". When the player enters the area I want a barrel and a sound to appear, but whatever I do it wouldn't work!
Here's my script:
void onstart()
{
AddEntityCollideCallback("player", "ScriptArea_1", "appear", true, 1);
}
void appear(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_scare", "player", 0, false);
SetEntityActive("barrel02", true);
}
If anyone could help me I would be very appreciated!
07-04-2012, 12:09 PM
Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#2
RE: Can't get area script to work!

void onstart()
should be named
void OnStart()
and might as well capitalise "player"
So it is "Player"
just in case

Think, before you speak Google, before you post
(This post was last modified: 07-04-2012, 12:15 PM by Cruzore.)
07-04-2012, 12:14 PM
Find
Amphen Offline
Junior Member

Posts: 2
Threads: 1
Joined: Jul 2012
Reputation: 0
#3
RE: Can't get area script to work!

(07-04-2012, 12:14 PM)FastHunteR Wrote: void onstart()
should be named
void OnStart()
and might as well capitalise "player"
So it is "Player"
just in case
It worked! Thx! Finally I can continue my scripting Big Grin
(This post was last modified: 07-04-2012, 02:52 PM by Amphen.)
07-04-2012, 02:50 PM
Find




Users browsing this thread: 1 Guest(s)