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 Make an item appear after smashing plates?
Yare Offline
Junior Member

Posts: 22
Threads: 2
Joined: Mar 2013
Reputation: 0
#2
RE: Make an item appear after smashing plates?

Firstly I also though of GetPropHealth, but then something else came to my mind. I think you will only need:
SetEntityCallbackFunc(string& asName, string& asCallback);
It has various types of interaction: “OnPickup”, “Break”, “OnIgnite”. So far I only tried "OnIgnite", but I think "Break" should work well. So you add this Callback for every plate that should be broken. The function for every of them should be like this:

void FUNCTION(string &in asEntity, string &in type)
{
    if(type == "Break")
        {
            AddLocalVarInt("VAR NAME", 1);
            if (GetLocalVarInt("VAR NAME") == x) SetEntityActive("KEY NAME", true);
        }
}

Obviously, don't forget about declaring variable first. "x" is the number of plates that should be broken. Try this and tell me if that works or not.
04-18-2013, 05:14 PM
Find


Messages In This Thread
RE: Make an item appear after smashing plates? - by Yare - 04-18-2013, 05:14 PM



Users browsing this thread: 1 Guest(s)