Frictional Games Forum (read-only)

Full Version: [SOLVED]Script won't work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
void OnStart()
{

AddEntityCollideCallback("Player", "ScriptArea_1", "OnPlayerCollide_1", true, 1);

}

void OnPlayerCollide_1(string &in asParent, string &in asChild, int alState)
{
StartScreenShake(3, 5, 1, 0.1);
AddTimer("", 2, "Rock_timer");
}

void Rock_timer(string &in asTimer)
{

SetEntityActive("stone_med01_brown_8", true);
StartPlayerLookAt("stone_med01_brown_8", 10, 10, "");
PlaySoundAtEntity("", "break_stairs", "stone_med01_brown_8", 0, false);
PlaySoundAtEntity("", "react_pant", "Player", 0, false);

}

void OnEnter()
{

}

void OnLeave()
{

}

Why doesn't this work?? I don't get it. Most of it is copied, and with changed names. I tried highlighting the different names, and everything seems to be as it should. But nothing happens when i collide with the script area. I've tried copying the name of the area from the editor to the script. Still no luck.

I get no error... just nothing happens.

EDIT: Ok i now tried to set a message, when you start the level. Nothing happens. Apparently the level and the script aren't working together.
But they have identical names (Except for the .map and .hps)

Spoiler below!

[Image: 2dl3edx.png]


EDIT2: Okay i don't know what i did, but i deleted the script, made a new one, exactly the same, restarted amnesia, and now it works...
So no error message pops up now?
There never was... Just nothing happened. The script and the level didn't connect. But its solved now....