I have this script
--local script-
local UserInputService = game:GetService("UserInputService")
function onKeyPress(inputObject, gameProcessed)
if inputObject.KeyCode == Enum.KeyCode.E then
game.ReplicatedFirst.Button1:FireServer()
end
end
UserInputService.InputBegan:Connect(onKeyPress)
i have tested this with a print statement inside the if statement on line 5 so it is a correct statement but its not firing the event this is the script in the event
--script--
script.Parent.OnServerEvent:Connect(function()
print("e")
end)

2 comments
like you said in chat i needed to move the script to server script service and edit the script
like you said in chat i needed to move the script to server script service and edit the script