RemoteEvent doesn't work on button click but works on another function

Hi, I made a GUI that simply activates an ability if you either press the button or press the key corresponding to it.
The keyboard key function works however the GUI button click function doesnt fire the remote event. Why is that?

I tried switching it out with MouseButton1Click but that didn’t work either.
LocalScript in the GUI button:

local Button = script.Parent
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local Player = Players.LocalPlayer
local Remote = Button:WaitForChild("RemoteEvent")
local Ready = true


Button.Activated:Connect(function()
	if Ready == true then
		print("Pressed!")
		Ready = false
		Remote:FireServer()
		task.wait(8)
		Ready = true
	end
end)

UIS.InputBegan:Connect(function(input,gameProcessed)
	if input.KeyCode == Enum.KeyCode.Q and gameProcessed == false and Ready == true then
		print("Pressed!")
		Ready = false
		Remote:FireServer()
		task.wait(8)
		Ready = true
	end
end)

Probably something wrong with the button itself.
Make sure Archivable is disabled and Active is enabled. There might also be something in front of the button preventing you from clicking it.

The button doesn’t really have any problems. I think it could be because it’s a GUI cloned into the PlayerGUI?

One thing to mention about buttons, make sure there aren’t any overlaying GuiObjects above this button on the ZIndex with the “Active” property turned on; this will prevent the button from being pressed. (Also whether the button is visible but I assume it is)