Your remote events and server script most likely aren't running in the right places. It seems to be looking like you've parented your serverScript and your remoteEvents together, and they seem to be running on the client.
02 | Here's what your hierarchy should look like: |
04 | local replicatedStorage = game:GetService( "ReplicatedStorage" ) |
06 | local accFwdEvent = replicatedStorage.accFwd |
07 | local accBwdEvent = replicatedStorage.accBwd |
09 | local player = game.Players.LocalPlayer |
10 | local mouse = player:GetMouse() |
12 | local function accelForward() |
13 | accFwdEvent:FireServer( true , 1 ) |
16 | local function accelBackward() |
17 | accBwdEvent:FireServer( false , 1 ) |
20 | game:GetService( "UserInputService" ).InputBegan:Connect( function (inputObject, gameProcessedEvent) |
21 | if inputObject.KeyCode = = Enum.KeyCode.W then |
We use replicatedStorage because the client and the server can both "see" them/have access to them.
02 | local replicatedStorage = game:GetService( "ReplicatedStorage" ) |
04 | local accFwdEvent = replicatedStorage.accFwd |
05 | local accBwdEvent = replicatedStorage.accBwd |
07 | local function printIfConnected() |
08 | print ( "hey you got it right now" ) |
11 | accFwdEvent.OnServerEvent:Connect(printIfConnected) |