Just forget about FG's script and focus on building your own. Believe me, it's easier because you'll know precisely what's going.
I actually forgot about the coal lever. Instead of the elevator lever, the coal lever should check if the "Coal" variable is equal to 3.
Modify it like so:
void PullCoalLever(string &in asEntity, int alState)
{
if(alState == 1) //Executed if the lever is pulled
{
if(GetLocalVarInt("Coal") == 3)) //Checks to see if all coal is inside
{
AddLocalVarInt("LeverOn", 1); //This is what we'll check when we pull the elevator starting lever
}
}
}
Ok, now the elevator lever will check if LeverOn is equal to 1.
void ElevatorStartFunction(parameters)
{
if(alState == 1) //Executed if the lever is pulled
{
//If it is pulled, checks if repairs are complete
if(GetLocalVarInt("LeverOn") == 1 && GetLocalVarInt("Cogs") == 3)
{
//This block is executed if everything is complete
//Run your machine startup routine here
}
else
{
//This block executes if something isn't finished
}
}
}
That should fix it, given you've declared your callbacks/variables. Unless this isn't the issue you're having. ~.o