addHook("AbilitySpecial", function(p)
	if (p.noabilities)
		if (p.pflags & PF_THOKKED) then return true end
		S_StartSound(p.mo, sfx_ghosty, p)
		local sex = P_SpawnMobjFromMobj(p.mo, 0, 0, p.mo.height/2, MT_TNTDUST)
		sex.scale = p.mo.scale/2
		sex.flags = $ | MF_NOCLIP
		sex.color = SKINCOLOR_WHITE
		sex.colorized = true
		p.pflags = $ | PF_THOKKED
		return true
	end
end)

addHook("LinedefExecute", function(line, pmo, sector)
	if not pmo.valid then return end
	if not pmo.player then return end
	if not pmo.player.noabilities then pmo.player.noabilities = false end
	pmo.player.noabilities = false
end, "ABILITON")

addHook("LinedefExecute", function(line, pmo, sector)
	if not pmo.valid then return end
	if not pmo.player then return end
	if not pmo.player.noabilities then pmo.player.noabilities = false end
	pmo.player.noabilities = true
end, "ABILIOFF")