Why teleportation script doesnt work?
Heres the whole script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "guardvoice", "Voicetrigger", true, 1);
AddUseItemCallback("", "stone_hammer_1", "BreakArea", "break1", true);
AddEntityCollideCallback("Player", "VIEW", "Voicetrigger2", true, 1);
AddEntityCollideCallback("Player", "ROT", "Voicetrigger3", true, 1);
SetEntityCallbackFunc("Pot of blood", "BoneSawItem");
}
void Voicetrigger(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "guardconversation4.snt", "whinyguard2", 128, false);
}
void break1(string &in asItem, string &in asEntity)
{
SetEntityActive("breakablewall", false);
SetEntityActive("brokenwall", true);
SetEntityActive("whinyguard3", true);
SetEntityActive("sword", true);
SetEntityActive("block_box_1", true);
SetEntityActive("guardlook", true);
SetEntityActive("brick1", true);
SetEntityActive("brick2", true);
SetEntityActive("brick3", true);
PlaySoundAtEntity("", "away.snt", "Player", 22, false);
SetEntityActive("guardtorch", true);
PlaySoundAtEntity("", "break_wood_metal3", "Player", 1, false);
StartPlayerLookAt("guardlook", 6, 6, "");
AddTimer("look01", 4, "Timer_1");
}
void Timer_1(string &in asTimer)
{
StopPlayerLookAt();
}
void Voicetrigger2(string &in asParent, string &in asChild, int alState)
{
PlayMusic("hall.ogg", true, 1.0f, 1.0f, 1, false);
}
void Voicetrigger3(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "youcanrot.snt", "Player", 16, false);
SetEntityActive("whinyguard4", true);
SetEntityActive("sword2", true);
SetEntityActive("guardtorch2", true);
SetEntityActive("block_box_2", true);
}
void BoneSawItem(string &in asEntity, string &in type)
{
StartScreenShake(1, 1, 1, 1);
AddTimer("Timer_2", (10), "TELEPORT");
AddEntityCollideCallback("Player", "playerteleport", "TELEPORT", true, 1);
FadeOut(10);
}
void TELEPORT(string &in asParent, string &in asChild, int alState)
{
TeleportPlayer("PlayerStartArea_5");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic(".ogg", true, 1.0f, 1.0f, 1, false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
When I put the fade in inside TELEPORT's brackets,it worked.But the teleportation doesnt work...
|