Advertisement
Shark_vil

Untitled

Apr 12th, 2021
771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. function ENT:SetELS(on)
  2.     if on == self:GetELS() then return end
  3.     if self.v.IsScar then
  4.         if self.v.SirenIsOn == nil then return end
  5.         if not self.v.SirenSound then return end
  6.         if on then self:SetHorn(false) end
  7.         self.v.SirenIsOn = on
  8.         self.v:SetNWBool("SirenIsOn", on)
  9.         if on then
  10.             self.v.SirenSound:Play()
  11.         else
  12.             self.v.SirenSound:Stop()   
  13.         end
  14.     elseif self.v.IsSimfphyscar then
  15.         local dt = on and 0 or .5
  16.         self.v.emson = not on
  17.         self.v.KeyPressedTime = CurTime() - dt
  18.         numpad.Deactivate(self, KEY_H, false)
  19.     elseif vcmod_main and vcmod_els
  20.     and isfunction(self.v.VC_setELSLights)
  21.     and isfunction(self.v.VC_setELSSound) then
  22.         self.v:VC_setELSLights(on)
  23.         self.v:VC_setELSSound(on)
  24.     elseif Photon
  25.     and isfunction(self.v.ELS_SirenOn)
  26.     and isfunction(self.v.ELS_SirenOff)
  27.     and isfunction(self.v.ELS_LightsOff) then
  28.         if on then
  29.             self.v:ELS_SirenOn()
  30.         else
  31.             self.v:ELS_SirenOff()
  32.             self.v:ELS_LightsOff()
  33.         end
  34.     end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement