Here you go:
Code:
freeslot(
"S_HANGON_2")
states[S_HANGON_2] = {SPR_HANG, 0, 1, A_CapeChase, FRACUNIT*0, FRACUNIT*0, S_HANGON_2}
addHook("MobjThinker", function(mobj)
local player = mobj.player
if not (player.pflags & PF_NIGHTSMODE) //No Nights Mode Hanger
if (player.pflags & PF_CARRIED or player.pflags & PF_GLIDING) //Gliders and carried players get a hanger
if player.hang == nil
player.hang = P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_BLACKEGGMAN_MISSILE)
player.hang.target = player.mo
if not (player.pflags & PF_CARRIED & PF_GLIDING)
if not player.hang == nil
P_RemoveObj(player.hang) //Removing the hanger if you aren't gliding/being carried
player.hang = nil
end
end
end
end
end)