-- Mod by Thedarkedgyhope fell free to reuse idc

addHook("AbilitySpecial", function(player)
	if player.mo.skin == "sonic"     -- What player u are eh?
		player.target = P_LookForEnemies(player, true, true) -- My target is Enemies
		if not P_IsObjectOnGround(player.mo) -- Will not work when player is on ground
          and G_PlatformGametype() -- This just returns the game to the game typer ur playing like coop or match stuff
           and (player.pflags & PF_JUMPED) -- will only work when am jumped
           and (player.cmd.buttons & BT_CUSTOM1) -- will work when ur holding Custom1
          and not  (player.pflags & PF_THOKKED) -- wont work when u used a ability
			if player.target -- is there is any target near me
				P_HomingAttack(player.mo, player.target) -- U yes u ima steal u liver
                S_StartSound(player.mo, sfx_zoom) -- Starts Sound Effect 
                P_SpawnThokMobj(player) -- lets spawn a thok right behing meh
               G_PlatformGametype()
		end
	end	
end
end)