Tool event on keybind

I’m trying to make it do event inside of if loop, however it doesn’t work with enum.keycode. Console legit not popping any errors neither anything happens.

local userInputService = game:GetService("UserInputService")
userInputService.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType then
		if input.KeyCode == Enum.KeyCode.V then
			-- funny stuff here
        end
    end
end)

you need remotevents for this.

try removing the
if input.UserInputType == Enum.UserInputType then

1 Like

My guess would probably be this line since it’s never true

if input.UserInputType == Enum.UserInputType then

The line is also unnecessary since you don’t check for the type of UserInput anyways.

1 Like