Iv done it before and have the same thing. All the sudden it doesnt work. i tried many things. but the two mains things were this code
UIS = game:GetService("UserInputService") UIS.InputBegan:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.M then print("hi") --print(Input.Name) --print(Input.Parent.Name) end end)
and i tried it in a normal script and local script. both in workspace. also tried putting both in starterpack. it does not print hi when i press m in testing mode. please help
Put it in starter player scripts.
Here's an example of what you could do:
game:GetService("UserInputService").InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.M then local Event = Instance.new("RemoteEvent") Event.Name = "MKeyPressed" Event:FireServer() end end)