//A quick debug message to see if the script gets activated. ClientPrint(null,3,"DEBUG: Script activated\n"); ::DebugMessage <- function() { ClientPrint(null,3,"DEBUG: Script active\n"); } ::SaveTankSpeed <- function() { //First, we grab the speed of the tank, and save it in a variable. //Printing it too to see if it gets the right value. ClientPrint(null,3,"DEBUG: Saving tank speed...\n"); ::tankSpeed <- NetProps.GetPropFloat(self, "m_speed"); if (tankSpeed) { ClientPrint(null,3,format("DEBUG: Tank speed is %d\n", tankSpeed)); } } ::CheckTankSpeed <- function() { ClientPrint(null,3,"DEBUG: Checking tank speed...\n"); if (tankSpeed) { ClientPrint(null,3,format("DEBUG: Tank speed is %d\n", tankSpeed)); } } //Now, we do the following: //1) Set the tank's speed to 0 with no delay. //2) Reset the tank's speed to its original value once the door is open. //The "self" argument here is used to re-define the !activator, don't worry. //tankSpeed is saved as a "float", but EntFire wants the parameter to be a string, //so we turn it into a string, too. ::ResetTankSpeed <- function() { ClientPrint(null,3,"DEBUG: Resetting tank speed...\n"); EntFire("!activator", "SetSpeed", "0", 0, self); EntFire("!activator", "SetSpeed", tostring(tankSpeed), 4.018, self); }