UserInputService Error

I’m a new coder and have been practicing scripting.
I’m trying to use remote functions to delete a part, however my code has an error where it stops running at if input..KeyCode == Enum.KeyCode.Delete then (there are no output errors though)
full script:
local script:

local repstorage = game:GetService("ReplicatedStorage")
local uis = game:GetService("UserInputService")
local remote = repstorage:WaitForChild("deletepartfunction")
local part = workspace:WaitForChild("delete")
uis.InputBegan:Connect(function(input,gameProcessedEvent)
	if gameProcessedEvent then return end
	if input.KeyCode == Enum.KeyCode.Delete then
		remote:InvokeServer(part)
	end
end)

server script:

local repstorage = game:GetService("ReplicatedStorage")
local remote = repstorage:WaitForChild("deletepartfunction")
local part = workspace:WaitForChild("delete")

remote.OnServerInvoke = function(player,part)
	part:Destroy()
end

any ideas?

Nevermind turns out I needed to use backspace and not delete disregard

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.