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