So, when I press ButtonR2 on my gamepad, it fires Button1Down on my mouse.. Why?
It does this both with UserInputService/GetMouse() and ContextActionService
Script:
local uis = game:GetService("UserInputService")
local mouse = game.Players.LocalPlayer:GetMouse()
local cas = game:GetService("ContextActionService")
uis.InputChanged:Connect(function(input)
local key = input.keyCode
if (key == Enum.KeyCode.ButtonR2) then
print("Place")
end
end)
mouse.Button1Down:Connect(function()
print("Break")
end)
function placeBlock()
print("Place")
end
function breakBlock()
print("Break")
end
cas:BindAction("place", placeBlock, false, Enum.KeyCode.ButtonR2, Enum.UserInputType.MouseButton2)
cas:BindAction("break", breakBlock, false, Enum.KeyCode.ButtonL2, Enum.UserInputType.MouseButton1)
