Not taking input

Hey, it’s me, back with another bug from my Prison Life remastered game.

So this time, it’s not letting me take input, or i’m just dumb. Here’s the issue in video.

As you can see, it just gets stuck on “Press a key.”;
any fixes? Here’s my code, by the way

local Btn = script.Parent;
--local SwitchFrame = Btn.Frame;

local Taking = false

Btn.MouseButton1Click:Connect(function()
	local UIS = game:GetService("UserInputService");

	Btn.Text = "Press a key.";

	local RecievingInput = true

	local Option;

	UIS.InputBegan:Connect(function(Input, GameProcessed)
		if GameProcessed then return end;
		Taking = true

		if Input.KeyCode and RecievingInput and not Taking then
			Option = tostring(Input.KeyCode):split(".")[3];

			_G.SettingsPlr.SetSetting(
				Btn.Parent:GetAttribute("Device"), Btn.Parent:GetAttribute("Name"), Option
			)

			Btn.Text = Option;
			RecievingInput = false
			Taking = false
		end
	end)
end)

You’re setting Taking to true, then on the if statement 2 lines under it you’re checking if Taking is false. (and not Taking).