addHook("PlayerThink", function(player)
	if not (player.mo and player.mo.valid and player.mo.skin == "frontiersclassic" and emeralds > 1) then
	return end
	
	if player.cmd.buttons & BT_CUSTOM2 > 0 then-- if p is pressing Custom2
            player.custom2down = $1 + 1 -- increment custom2 variable
        else
            player.custom2down = 0 -- reset custom2 variable
        end 
	if player.custom2down == 1 and player.cantrick == true then
		P_AddPlayerScore(player, 500)
		player.powers[pw_invulnerability] = 15
		S_StartSound(player.mo, sfx_trck)
	end
end)