Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Using RemoteEvents with UserInputService? Client/Server Sided

Its not like I dont know how to make UIS with RemoteEvents, But they don't work... Here is my code:

Client Script w/ UserInputService and RemoteEvent

local RE = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.B  then
RE:FireServer()
end
end)

Server Script:

local RE = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
RE.OnServerEvent:Connect(function()
print("Success")
end)

But the UIS does not React to That. That's why In my First Post, I used the :GetMouse Method

1 answer

✓ Accepted answer

Put the local script somewhere that resides within the client/player — Like StarterPlayerScripts. Put the server script somewhere that resides within the server — Like Workspace.

This discussion is preserved as it was. New answers, comments, and votes are closed.