local entityname local cooldownTime = 3 local hudCooldown = 0 function checkButton() { for (local player; player = Entities.FindByClassname(player, "player"); ) { for (local button; button = Entities.FindByClassnameWithin(button, "func_rot_button", player.GetLocalOrigin(), 128); ) { if (player.IsUsingActionSlot() && (Time() - cooldownTime > 3) && !IsPlayerABot(player)) { EntFireByHandle(button, "Use" , "" , 0 , null , null); cooldownTime = Time(); } } } } // function findIndoorSoundScapes() // { // for (local player; player = Entities.FindByClassname(player, "player"); ) // { // if (GetPropInt(player, "") == "!sawmill.outside" ) // { // player.RemoveCond(15); // player.RemoveCustomAttribute("major move speed bonus"); // EntFireByHandle(player, "SetFogController" , "mist" , 0 , null , null); // } // else // { // player.AddCond(15); // player.AddCustomAttribute("major move speed bonus", 0.5, 0); // EntFireByHandle(player, "SetFogController" , "mist2" , 0 , null , null); // } // } // } entityname = Entities.FindByClassname(entityname, "tf_gamerules") entityname.ValidateScriptScope() entityname.GetScriptScope().checkButton <- checkButton // entityname.GetScriptScope().findIndoorSoundScapes <- findIndoorSoundScapes AddThinkToEnt(entityname, "checkButton")