Advertisement
HR_Shaft

Crouch-ActiveCamo v1 for Phasor v2

Apr 21st, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. --[[ ###      Crouch-ActiveCamo     ###]]--
  2. --[[ ### for Phasor v2 by H® Shaft  ###]]--
  3.  
  4. invis_time = 30     --| Time in seconds for duration of invisibility/active-camouflage
  5.  
  6. -- don't edit --
  7. crouch = {}
  8.  
  9. function GetRequiredVersion()
  10.     return 200
  11. end
  12.  
  13. function OnScriptLoad(process, game, persistent)
  14.  
  15. end
  16.  
  17. function OnPlayerCrouch(player)
  18.     if getplayer(player) then
  19.         local m_objectId = getplayerobjectid(player)
  20.         if m_objectId then
  21.             if readdword(getobject(m_objectId) + 0x204) ~= 0x51 then
  22.                 applycamo(player, invis_time)
  23.             end
  24.         end
  25.     end
  26. end
  27.  
  28. function OnClientUpdate(player)
  29.     if getplayer(player) then
  30.         local m_objectId = getplayerobjectid(player)
  31.         if m_objectId then
  32.             local obj_crouch = readbyte(getobject(m_objectId) + 0x2A0)
  33.             local id = resolveplayer(player)       
  34.             if obj_crouch == 3 and crouch[id] == nil then
  35.                 crouch[id] = OnPlayerCrouch(player)
  36.             elseif obj_crouch ~= 3 and crouch[id] ~= nil then
  37.                 crouch[id] = nil
  38.             end
  39.         end
  40.     end
  41. end
  42.  
  43. -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
  44. -- Visit http://halorace.org/forum/index.php?topic=514.0 or
  45. -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement