shieldrestore = {delay = 0,costs = 10}
function shieldrestore:think()
	if game.player.destroyed then return 1 end
	self.delay = self.delay + 1
	if game.player.extracounter>=self.costs and Keyboard.isKeyDown("S") and self.delay>20 and game.player.shield<100 then
		self.delay = 0
		game.player.shield = 100
		game.player.extracounter = game.player.extracounter - self.costs
	end
end

game:addthink(shieldrestore)