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

Cannot pass boolean nor nil values through Remote Events?

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

✓ Accepted answer

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)

1 comment

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.

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