Detecting keyboard input from a player from server

Is it possible to detect when a client uses their keyboard from a serverscript?
For context, I’m making a respawn system and need to detect keyboard input to respawn the player. If this is not possible, how can I go about doing the above?

Current Code:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local humanoid = char:WaitForChild("Humanoid")
		local canSpawn = false
		
		humanoid.Died:Connect(function()
			plr.PlayerGui:WaitForChild("DeathGui"):WaitForChild("deathFrame").Visible = true
			
			for i = 30, 0, -1 do

				plr.PlayerGui:WaitForChild("DeathGui"):WaitForChild("deathFrame"):WaitForChild("timer").Text = "You can respawn in "..i
				wait(1)
				if i == 0 then
					local canSpawn = true
					plr.PlayerGui:WaitForChild("DeathGui"):WaitForChild("deathFrame"):WaitForChild("timer").Text = "Press any key to respawn"
					
					--THIS IS WHERE I WANT TO DETECT USER INPUT FROM A SERVER SCRIPT
					
					break
				end
			end
			
		end)
	end)
end)

You have to record the input on the client and send it to the server using remotes.

Ah ok, how would I go about only allowing the user to fire the remote event when the gui says “press any key to respawn” on the client side?

Check if the gui is enabled, if so send the event.

Well whenever you do decide to show that GUI, make it fire the server then and you can limit how many times they can send it on the server, etc.