Hello, I have my button and I need to do a Parent every time I press the E, what am I doing wrong?

localscript
local player = game.Players.LocalPlayer
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local gui = game.ReplicatedStorage.b1
-- We must get the UserInputService before we can use it
local UserInputService = game:GetService("UserInputService")
-- A sample function providing one usage of InputBegan
local function onInputBegan(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.E then
print("The left mouse button has been pressed!")
local clonedGui = gui:Clone()
clonedGui.Parent = player.PlayerGui
end
end
UserInputService.InputBegan:Connect(onInputBegan)
