I am doing a script fuction using addlocals!
Now the script is supposed to check that the player got 2 variable locals, and when he got those 2 then a function will occur which i did here OnEnter:
if(GetLocalVarInt("getit") == 2)
{
SetEntityActive("CaveIn_1", true);
AddDebugMessage("2globalshavebeenfound", true);
}
For the first local, you need to pick up a key which in the callback func of pickup, it will activate this script
void pickkey(string &in asEntity, string &in asType)
{
AddDebugMessage("1global", true);
AddLocalVarInt("getit", 1);
}
And for the 2nd local, you need to use an item on an object by using an adduseitem callback which activates this function here
void animation(string &in asItem, string &in asEntity)
{
RemoveItem(asItem);
AddDebugMessage("1global", true);
CompleteQuest("bucket", "bucket");
CreateParticleSystemAtEntity("splashps", "ps_impact_water_low.ps", asEntity, false);
PlayGuiSound("mizu", 1);
GiveItem("wooden_bucket_filled", "wooden_bucket_filled", "water", "wooden_bucket_filled.tga", 1);
SetMessage("Messages", "bucketss", 2);
AddLocalVarInt("getit", 1);
}
I added a debug message everytime a player gets a variable, also when the 2 are called as I shown on enter but it does not work. The debug message also doesn't play when it checks "if(GetLocalVarInt("getit") == 2)"
Is there anything wrong or missing that is causing this mind blowing error? When in game there are no errors and crashes that occur while testing this.
The map updates and the script too, so no worries.
thnx