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
Item triggering a script
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#11
RE: Item triggering a script

You're missing some critical parts of your script there boy. Lemme patch it up for ya.

PHP Code: (Select All)
void DaggerLoopCheck(string &in a
{
    if(
GetPlayerHealth() > 99SetPlayerHealth(98.0f); //prevents regeneration
    
if(!HasItem("CustomDaggerItem")) funcPlayerUsedTheItem(); //checks the item

    
AddTimer("dagger123"1.0f"DaggerLoopCheck"); //loops itself
}

void funcPlayerUsedTheItem() 
{
    
//code
    
RemoveTimer("dagger123");


(This post was last modified: 06-02-2016, 11:20 PM by Mudbill.)
06-02-2016, 11:19 PM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#12
RE: Item triggering a script

whatever, I think he can totally fill in the blanks.

06-03-2016, 12:24 AM
Find
Darkfire Offline
Senior Member

Posts: 371
Threads: 22
Joined: May 2014
Reputation: 15
#13
RE: Item triggering a script

Thanks for help, everything works. I set player's health to 80 and for some reason it doesn't regenerate, so no need for a loop. I wanted the knife to damage the player, but when in the model editor I set the amount of health added to -25, it did nothing. So instead I made it to +10 and set a function that hurts the player when their health increases, and then added rest of the stuff I wanted.

Ps. No code because I'm writing from a phone Tongue

(This post was last modified: 06-05-2016, 10:00 PM by Darkfire.)
06-05-2016, 09:59 PM
Find




Users browsing this thread: 1 Guest(s)