I have been trying to make a keybind Event but fell to because nothing I tried worked, why?
In the script below I am using Remote Event to connect to the keybind script. Tell me if I am doing it wrong.
script [Inside of a brick]
game.ReplicatedStorage.RemoteEvent1.OnServerEvent:Connect(function()
script.Parent.Transparency = 0.5
end)
Local script [Inside of StarterPlayerScript]
local plr = game:GetService("Players").LocalPlayer
local Mouse = plr:GetMouse()
local Key = Enum.KeyCode.E
local UserInputService = game:GetService("UserInputService")
local input = UserInputService.InputBegan:Connect(function(input, gp)
Mouse.KeyDown:Connect(function(k)
if input.KeyCode == Key then
if Mouse.Target and Mouse.Target:FindFirstChild("item") then
game.ReplicatedStorage.RemoteEvent1:FireServer()
end
end
end)
end)
Please Help!

1 comment
Why is there an end) on the 14th line?