CapsAdmin

Untitled

May 7th, 2011
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. --wind setup here--
  2.  
  3. if CLIENT then
  4.     local ent = ClientsideModel("error.mdl")
  5.     ent:SetNoDraw(true)
  6.    
  7.     local csp = CreateSound(ent, "wind.wav")
  8.    
  9.     hook.Add("Think", "wind_sound_think", function()
  10.         local ply = LocalPlayer()
  11.         if ent:IsValid() then
  12.             ent:SetPos(ply:EyePos() - wind.dir * 50)
  13.            
  14.             csp:ChangeVolume(ply:GetVelocity():Length() / 1000)
  15.         end
  16.     end)
  17. end
  18.  
  19. if SERVER then
  20.     --physics move here
  21. end
Advertisement
Add Comment
Please, Sign In to add comment