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
Simple if -problem
Sazureth Offline
Junior Member

Posts: 20
Threads: 8
Joined: Jan 2012
Reputation: 0
#1
Simple if -problem

Hi, I'm currently practising scripting for my first project and I'm having problems with constantly running a check.
What I want to do is make something happen when player health drops below, let's say 50, but I don't know how to do that.
Where do I have to put the if-structure if I want the check to be ran every update (constantly, so when the health drops stuff happens) without other conditions?

Right now it looks like this. Amnesia gives error complaining about the if.
if (GetPlayerHealth() < 50.0f)
{
    FadeEnemyToSmoke("servant_grunt", true);
}
(This post was last modified: 01-02-2012, 03:56 AM by Sazureth.)
01-02-2012, 01:28 AM
Find


Messages In This Thread
Simple if -problem - by Sazureth - 01-02-2012, 01:28 AM
RE: Simple if -problem - by Linus Ågren - 01-02-2012, 01:40 AM
RE: Simple if -problem - by Sazureth - 01-02-2012, 02:14 AM
RE: Simple if -problem - by Linus Ågren - 01-02-2012, 02:19 AM
RE: Simple if -problem - by Sazureth - 01-02-2012, 02:22 AM
RE: Simple if -problem - by Linus Ågren - 01-02-2012, 02:27 AM
RE: Simple if -problem - by Sazureth - 01-02-2012, 02:33 AM



Users browsing this thread: 1 Guest(s)