I'm having trouble with teleporting a part to a local player


local BombPlaceEvent = ReplicatedStorage:WaitForChild("BombPlaceEvent")
local UserInputService = game:GetService("UserInputService")
local ActionKey = Enum.KeyCode.E

UserInputService.InputBegan:connect(function(input)
	if input.KeyCode == ActionKey then
		BombPlaceEvent:FireServer()
    end
end

UserInputType only tells you if it’s a mouse click or a gamepad button or a keyboard key:

https://developer.roblox.com/en-us/api-reference/event/UserInputService/InputBegan

Making it KeyCode detects key pressed

2 Likes

It might return an error so check if input type = Enum.UserInputType.Keyboard

1 Like

This worked! Thank you so much!

1 Like