Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ ### Invis-While-Crouched v1 ###]]--
- --[[ ### for Phasor v2 by H® Shaft ###]]--
- -- To activate: Press and hold down the crouch the key to remain invisible - when released, you will reappear.
- -- Does not accidentally activate on impact/falling crouch.
- -- Players may still use the powerup active-camouflage when not crouched and it will behave normally.
- -- Related Similar Script: http://pastebin.com/wA06DicK "Crouch-ActiveCamo" which allows players to activate active camouflage by crouching for a [editable] duration.
- -- edit --
- red_allow = true --| Enable for red team set to true, to disable set to false.
- blue_allow = true --| Enable for blue team set to true, to disable set to false.
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(processid, game, persistent)
- checkstance = registertimer(66, "CheckStance")
- end
- function CheckStance(id, count)
- for i = 0,15 do
- if getplayer(i) then
- local m_objectId = getplayerobjectid(i)
- if m_objectId then
- if readbit(getobject(m_objectId) + 0x208, 0) and not isinvehicle(i) then
- OnPlayerCrouch(i)
- elseif readbyte(getobject(m_objectId) + 0x2A0) == 4 then
- OnPlayerStand(i)
- end
- end
- end
- end
- return true
- end
- function OnPlayerCrouch(player)
- if getplayer(player) then
- local team = getteam(player)
- local m_objectId = getplayerobjectid(player)
- if m_objectId then
- if readdword(getobject(m_objectId) + 0x204) == 0x41 then
- if (team == 0 and red_allow) or (team == 1 and blue_allow) then
- applycamo(player, 2)
- end
- end
- end
- end
- end
- function OnPlayerStand(player)
- if getplayer(player) then
- local team = getteam(player)
- local m_objectId = getplayerobjectid(player)
- if m_objectId then
- if readdword(getobject(m_objectId) + 0x204) == 0x51 then
- if (team == 0 and red_allow) or (team == 1 and blue_allow) then
- applycamo(player, 0.1)
- end
- end
- end
- end
- end
- function OnGameEnd(stage)
- if stage == 1 then
- if checkstance then
- removetimer(checkstance)
- checkstance = nil
- end
- end
- end
- -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
- -- Visit http://halorace.org/forum/index.php?topic=514.0 or
- -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement