--by Braindawg local inWave = false local hintCooldown = false local HudTextParams = { channel = 3, --Channel number 0 - 5, -- Channel 0 is used to display wave explanation, -- Channel 1 is used to display cash in reverse mvm, x = -1, -- X coordinate from 0 to 1, -- -1 for center positon, -- Text is wrapped so it does not overflow the screen y = 0.3, -- Y coordinate from 0 to 1, -- -1 for center positon Text is wrapped so it does not overflow the screen effect = 2, -- 0,1 - fade in/fade out text, -- 2 - typeout text r1 = 100, -- 0 - 255 range, -- The text is rendered additively, black text will not display r2 = 255, -- 0 - 255 range, -- The text is rendered additively, black text will not display g1 = 100, -- 0 - 255 range, -- The text is rendered additively, black text will not display g2 = 255, -- 0 - 255 range, -- The text is rendered additively, black text will not display b1 = 100, -- 0 - 255 range, -- The text is rendered additively, black text will not display b2 = 255, -- 0 - 255 range, -- The text is rendered additively, black text will not display a1 = 100, -- 0 - 255 range, -- 0 - fully visible, 255 - invisible a2 = 0, -- 0 - 255 range, -- 0 - fully visible, 255 - invisible fadeinTime = 0.01, -- Time to fade in text fadeoutTime = 0, -- Time to fade out text holdTime = 5, -- Time the text is fully displayed fxTime = 0.01, -- Time to type a single letter with typeout effect } function OnPlayerConnected(player) -- player.HoldTime = 0 player.InteractWith = "nothing" player.InteractCooldown = false end -- local org = player:GetAbsOrigin() --offset origin to be in front of the player -- local new = Vector(org[1] + 320 , org[2] + 400 , org[3] - 105) -- local dir = Vector(org[1] + 350 , org[2] - 350 , org[3] - 105) -- tempents.Send("Dust" ,{ -- m_vecOrigin = new, -- m_flSize = 300, -- m_flSpeed = 9999, -- m_VecDirection = dir, -- -- m_rgbaColor = Vector(0, 255, 0) -- } , nil) function OnGameTick() if not hintcooldown then hintcooldown = true ButtonHintThink() timer.Simple(5,function () hintcooldown = false end) end for _, player in pairs(ents.GetAllPlayers()) do if player:IsRealPlayer() then if player.m_bUsingActionSlot == 1 and player.InteractCooldown ~= true then -- player.HoldTime = player.HoldTime + 1 --holdtime stuff removed FindButtons() if player.InteractWith ~= "nothing" then nearbutton = ents.FindByName(player.InteractWith) nearbutton:AcceptInput("Press",_,player) player.InteractCooldown = true player.InteractWith = "nothing" -- player.HoldTime = 0 timer.Simple(3, function() player.InteractCooldown = false end) end -- else -- player.HoldTime = 0 end end end end function FindButtons() for _, e in pairs(ents.FindAllByClass("func_button")) do for _, player in pairs(ents.FindInSphere(e:GetAbsOrigin(),50)) do if player:IsRealPlayer() then player.InteractWith = e:GetName() end end end end function ButtonHintThink() for _, g in pairs(ents.FindAllByClass("func_button")) do for _, player in pairs(ents.FindInSphere(g:GetAbsOrigin(),50)) do if player:IsRealPlayer() and player.InteractCooldown == false and g.m_bLocked == false then if g:GetName() == "tutorialbutton" then ents.FindByName("hudhint"):AcceptInput("ShowHudHint",_,player) else player:ShowHudText(HudTextParams,"Press your canteen button to use") end end end end end --effectively OnPlay with all players in the soundscapes radius being the !activator --small room soundscapes overlapping the main outside one means this is only really useful for the tunnel or spawn soundscape. function FindIndoorAreas() for _, s in pairs(ents.FindAllByClass("env_soundscape")) do timer.Simple(1, function() if s.m_soundscapeName == "sawmill.outside" then for _, player in pairs( ents.FindInSphere(s:GetAbsOrigin(),(s.m_flRadius) / 1.7 )) do if player:IsRealPlayer() then player:SetAttributeValue("major move speed bonus","0.5") player:AddCond(15) player:AcceptInput("SetFogController", "mist2") break end end elseif s.m_soundscapeName == "Upward.Inside" then for _, player in pairs( ents.FindInSphere(s:GetAbsOrigin(),(s.m_flRadius) / 2 )) do if player:IsRealPlayer() then player:SetAttributeValue("major move speed bonus","1") player:RemoveCond(15) player:AcceptInput("SetFogController", "mist") break end end -- elseif s.m_soundscapeName == "sawmill.inside" then --indoor building soundscapes, too unreliable -- for _, player in pairs( ents.FindInSphere(s:GetAbsOrigin(),(s.m_flRadius) / 3) ) do -- if player:IsRealPlayer() then -- player:AcceptInput("$DisplayTextChat","{blue} Test") -- break -- end -- end -- end -- elseif s.m_soundscapeName == "sawmill.deepinside" then --spawn -- for _, player in pairs( ents.FindInSphere(s:GetAbsOrigin(),(s.m_flRadius) / 3) ) do -- if player:IsRealPlayer() then -- player:AcceptInput("$DisplayTextChat","{blue} Test") -- break -- end -- end end end) end end