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

Best structure for server-side input handling?

I have a server script that checks for input. Think of it as a vehicle. I can't use UserInputService on the server, so I need to somehow pass input from client to server. What would be the cleanest way of doing so?

Do I send a function request from the server script to the client and return input vector? Do I make a local script to check if localPlayer is interacting with the server script and then send remote function? Maybe some better ways? Essentially, I just need to have user input passed into a server script.

P.S when I said "Think of it as a vehicle" I didn't actually mean it is a vehicle. I can't use "seat" component. Please don't suggest.

1 answer

✓ Accepted answer

It depends on what you need to do. Normally I would handle all the input on the client via UserInputService and check to see what function needs to be executed depending on the input. Then simply send this information to the server via a remote event.

When doing this make sure to have safety checks on the server, as exploiters can fire remote events with any parameters they want, so just be sure that what the client is asking for makes sense depending on player's position, player's leaderstats, or whatever it is that's being accessed or altered.

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