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:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Creating and Destroying Tinderboxes
hunchbackproduction Offline
Junior Member

Posts: 36
Threads: 13
Joined: Jul 2013
Reputation: 0
#1
Creating and Destroying Tinderboxes

void PickedUpTinderbox1(string &in asEntity, string &in type)
{
if (GetGlobalVarInt("Tinderboxes") < 20)
{
AddGlobalVarInt("Tinderboxes", 1);
}
if (GetGlobalVarInt("Tinderboxes") == 20)
{
SetMessage("Chemical", "manytinder", 1);
RemoveItem("tinderbox_1");
CreateEntityAtArea("tinderbox_1", "tinderbox.ent", "Player", true);
}
}

Here you can see that my code is supposed to destroy a tinderbox from my inventory and create one in the game world if I pick up a tinderbox and already have 20. In game I have named my tinderboxes "tinderbox_1" all the way to "tinderbox_20". The 21st tinderbox I put in the map to test is named "tinderbox_1"

However when I test this out, no tinderboxes are destoryed in my inventory (The count of tinderboxes shows 21)!
and no tinderbox is spawned in the gameworld...
Only the message informing me I have to many tinderboxes shows up. Any help would be appreciated Big Grin

Scripting level is over 9000!
08-04-2013, 03:54 PM
Website Find


Messages In This Thread
Creating and Destroying Tinderboxes - by hunchbackproduction - 08-04-2013, 03:54 PM



Users browsing this thread: 2 Guest(s)