Ok so I have two scripts for this, the first one is a local script in the players starterGui it fires a remote event called "InputEvent"
local UIS = game:GetService("UserInputService")
function OnInput(Input)
script.Parent.InputEvent:FireServer(2)
end
UIS.InputBegan:connect(OnInput)
This should, connect a Input from the UserInput service and then fire the server with the input two a second script.
local Player
local Connection
function ProInput(ip)
print(ip)
if ip.UserInputType == Enum.UserInputType.MouseButton2 then
print("You clicked")
end
end
Player.PlayerGui.InputEvent.OnServerEvent:connect(ProInput)
When I test it and I do anything with the mouse or keyboard it first prints: Player1 and then says that UserInputType is not a valid member of Player1(which is me in studio). I'm assuming that through the event it gets changed, but how do I fix this

1 comment
Thanks a lot, it worked.