addHook("PlayerThink", function(player) -- Apply only to Sonic if player.mo and player.mo.valid and player.mo.skin == "sonic" then -- Activate: Press Custom Button 1 (Special Action) + Not currently invincible if (player.cmd.buttons & BT_CUSTOM1) and not (player.powers[pw_invulnerability] > 0) then -- Set invincibility for 1050 tics (Exactly 30 seconds) player.powers[pw_invulnerability] = 1050 -- Play the invincibility power-up sound S_StartSound(player.mo, sfx_itmnm) -- Visual feedback: Glow so you know it's active player.mo.colorized = true print("Archie Invincibility: 30 Seconds Active!") end -- Remove the glow once the 30 seconds run out if player.powers[pw_invulnerability] == 0 then player.mo.colorized = false end end end)