The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A simple key problem.
Asaratha Offline
Junior Member

Posts: 14
Threads: 5
Joined: Jul 2011
Reputation: 0
#1
A simple key problem.

Hey guys!

I used to do scripting a long time ago, and for the past week I've been getting into it again. Although, trying to unlock a door using a key is giving me quite the problem for some reason.

void OnStart()
{
AddUseItemCallback("", "", "key_1", "KeyOnDoor", true);
AddUseItemCallback("", "hidden_key", "hidden_door", "KeyOnHiddenDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); SetEntityPlayerInteractCallback("key_1", "Spawn_Monster", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lockedhall", false, true);
PlaySoundAtEntity("", "unlock_door", "lockedhall", 0, false);
RemoveItem("key_1");
}
void Spawn_Monster(string &in entity)
{
SetEntityActive("grunt", true);
AddEnemyPatrolNode("grunt", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_3", 4, "");
}


That's what I have, although, when I get in game it says "Cannot be used this way".

I'm sorry if I'm doing something obviously wrong, I've just lost all of my skill when it comes to this.
(This post was last modified: 03-06-2012, 10:48 PM by Asaratha.)
03-06-2012, 10:25 PM
Find


Messages In This Thread
A simple key problem. - by Asaratha - 03-06-2012, 10:25 PM
RE: A simple key problem. - by Mackiiboy - 03-06-2012, 10:40 PM
RE: A simple key problem. - by Asaratha - 03-06-2012, 10:48 PM



Users browsing this thread: 2 Guest(s)