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 Making it so Slime Damage can Kill, need help!
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#7
RE: Making it so Slime Damage can Kill, need help!

(08-15-2014, 08:34 AM)Romulat✪r (✿◠‿◠) Wrote: A float is a decimal number between 0 and 100.

That's not quite true, Rom. 0-100 wouldn't be much use.

A float has the range +/- 3.402823466e+38, or in other words between -340,282,346,600,000,000,000,000,000,000,000,000,000 and 340,282,346,600,000,000,000,000,000,000,000,000,000.

The bigger the number is (in either positive or negative direction) the less precise it becomes.

Also, DaPurpleHippo, try this:

void OnStart()
{
    AddEntityCollideCallback("Player", "checkpoint_00", "Restart", true, 1);
    AddEntityCollideCallback("Player", "damage_zone01", "EnterToxicGas", false, 0);
    SetGlobalVarInt("InToxicGas", 0);
}

void Restart(string &in asParent, string &in asChild, int alState)
{
    CheckPoint("FirstCheckpoint", "respawn_001", "Happening", "DeathCategory", "Deathtext");
}

void EnterToxicGas(string &in asParent, string &in asChild, int alState)
{
    if(alState == 1)
    {
        SetGlobalVarInt("InToxicGas", 1);
        AddTimer("ToxicGasTimer", 0.0f, "ToxicGasCheck");
    }
    else
    {
        SetGlobalVarInt("InToxicGas", 0);
    }
}

void ToxicGasCheck(string &in asTimer)
{
    if(GetGlobalVarInt("InToxicGas") == 1)
    {
        GivePlayerDamage(25.0f, "blood", false, true);
        AddTimer("ToxicGasTimer", 2.0f, "ToxicGasCheck");
    }
}

(This post was last modified: 08-15-2014, 09:00 PM by MrBehemoth.)
08-15-2014, 08:46 PM
Find


Messages In This Thread
RE: Making it so Slime Damage can Kill, need help! - by MrBehemoth - 08-15-2014, 08:46 PM



Users browsing this thread: 1 Guest(s)