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
A Scripting Question
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#1
Question  A Scripting Question

I'm trying to make a local variable integer to check to see if the player picked something up and if they didn't, to display a message once they enter an area.

Eh, here's the code:

void OnStart()
{
AddLocalVarInt("LeverTouchCheck", 0);
SetEntityPlayerInteractCallback("lever_small_lever_1", "LeverCheck", true);
AddEntityCollideCallback("Player", "ScriptArea_4", "MissingLever", true, 1);
}

void MissingLever(string &in asParent, string &in asChild, int alState)
{
If (GetLocalVarInt("LeverTouchCheck") == 0)
{
SetMessage("Message", "Hint04", 4);
}
}

void LeverCheck(string &in asEntity)
{
    SetLocalVarInt("LeverTouchCheck", 1);
}

The error report is confusing... I could have sworn it changed a few times in awkward ways. I hope you can help. :/

04-23-2011, 05:27 AM
Find


Messages In This Thread
A Scripting Question - by Kyle - 04-23-2011, 05:27 AM
RE: A Scripting Question - by laser50 - 04-23-2011, 10:22 AM
RE: A Scripting Question - by Pandemoneus - 04-23-2011, 12:19 PM
RE: A Scripting Question - by Kyle - 04-23-2011, 03:10 PM



Users browsing this thread: 3 Guest(s)