Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Cannot pass boolean nor nil values through Remote Events?

Asked by 7 years ago

So, I am trying to make it so the server can see the UserInputService's events for a player. Here is what I got.

local events = {
        'DeviceAccelerationChanged';
        'DeviceGravityChanged';
        'DeviceRotationChanged'; 
        'GamepadConnected';
        'GamepadDisconnected';
        'InputBegan';
        'InputChanged';
        'InputEnded';
        'JumpRequest';
        'LastInputTypeChanged';
        'TextBoxFocusReleased';
        'TextBoxFocused';
        'TouchEnded';
        'TouchLongPress';
        'TouchMoved';
        'TouchPan';
        'TouchPinch';
        'TouchRotate';
        'TouchStarted';
        'TouchSwipe';
        'TouchTap';
        'TouchTapInWorld';
        'UserCFrameChanged';
        'WindowFocusReleased';
        'WindowFocused';
    }
for _, event in pairs(events) do
    print('Connecting event for '..event)
    userservice[event]:Connect(function(a, b, c, d, e)
        print('An event occured with UserInputService. Name : '..event..'. Data :["'..tostring(a)..'", "'..tostring(b)..'"'..tostring(c)..'", "'..tostring(d)..'"'..tostring(e)..'"]')
        user.Events[event]:FireServer(a, b. c, d, e)
    end)
end

"userservice" is just UserInputService and user is the folder I put the events in. But, whenever I move my mouse, I get Players.YouWillNeverGuessMy.PlayerGui.Services:215: attempt to index local 'b' (a boolean value). This does not error if I fire it through the command bar. Any ideas? Thanks.

1 answer

Log in to vote
2
Answered by
gitrog 326 Moderation Voter
7 years ago
Edited 7 years ago

I think you added a period where you should have used a comma on line 32.

user.Events[event]:FireServer(a, b. c, d, e)

should be

user.Events[event]:FireServer(a, b, c, d, e)
0
Oh, okay, thanks. They really need to separate the commas from the periods. I did the same mistake with a. b but I caught myself. hiimgoodpack 2009 — 7y
Ad

Answer this question