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:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help If HasItem Help
3gamers Offline
Junior Member

Posts: 10
Threads: 6
Joined: Oct 2013
Reputation: 0
#1
If HasItem Help

Have a script area set up in a dark room. When the Player enters the script area without the lantern in their inventory then I want to play the voice over warning the Player to turn around.

Conversely, if the Player has the lantern when entering the script area, I want the level door to 'unlock'.

Here is the script I have, I'm not sure if it will even work, but the only error I'm getting in 'Unexpected end of line'.

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_needlight", "Needlantern", "true", 1);
}

void Needlantern(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates)
{
if (bool HasItem"lantern")
{
SetLevelDoorLocked("leveldoortomain", false);
}
else if (bool HasItem"lantern")
{
PlaySoundAtEntity("", "VOICEOVERFILEHERE.ogg", "Player", 0, false);
}
}

Thankful for any comments.
05-29-2016, 08:08 PM
Find


Messages In This Thread
If HasItem Help - by 3gamers - 05-29-2016, 08:08 PM
RE: If HasItem Help - by Darkfire - 05-29-2016, 09:21 PM
RE: If HasItem Help - by TimProzz - 06-02-2016, 10:39 AM



Users browsing this thread: 1 Guest(s)