--by stardustspy local boxFindMin = Vector(-130, -130, -130) local boxFindMax = Vector(130, 130, 130) local PressTimeInSeconds = 180 local PressTimePercentage = 0 local PlayButtonSound = true function FindPlayerHoldingAction(_, activator, object) local findObjectOrigin = object:GetAbsOrigin() local IsNotActive = true if not object or object:IsValid() == false then return end local findPlayersInArea = ents.FindInBox(findObjectOrigin+boxFindMin, findObjectOrigin+boxFindMax) for _, playerInBox in pairs(findPlayersInArea) do playerInBox:AcceptInput("$DisplayTextCenter", "Use your action key to activate the generator!", playerInBox) if playerInBox:IsRealPlayer() == true then if playerInBox:InCond(5) == true or playerInBox:InCond(34) == true then playerInBox:AcceptInput("$DisplayTextCenter", "Cannot activate generator under Ubercharge!", playerInBox) end end if playerInBox:IsRealPlayer() == true and playerInBox.m_bUsingActionSlot == 1 and playerInBox:InCond(5) == false and playerInBox:InCond(34) == false then --print(playerInBox) PressTimeInSeconds = PressTimeInSeconds - 1 PressTimePercentage = PressTimePercentage + (0.95 + 0.20) / 2 playerInBox:AcceptInput("$DisplayTextCenter", "Turning on power generator..."..PressTimePercentage.."%", playerInBox) if PlayButtonSound == true then playerInBox:PlaySoundToSelf("Weapon_Gunslinger.InspectFingerClick") playerInBox:PlaySoundToSelf("Taunt.RocketHoverLoop") PlayButtonSound = false end end if playerInBox:IsRealPlayer() == true and playerInBox.m_bUsingActionSlot == 0 and IsNotActive == true then PressTimeInSeconds = 180 PlayButtonSound = true PressTimePercentage = 0 end end if PressTimeInSeconds <= 0 then --print("timer has been set to 0!") object:AcceptInput("FireUser2", nil, object) PressTimeInSeconds = 180 PlayButtonSound = true PressTimePercentage = 0 FindPlayersInBox = nil IsNotActive = false end function OnWaveInit(wave) PressTimeInSeconds = 180 PlayButtonSound = true PressTimePercentage = 0 FindPlayersInBox = nil end end