(NOT REQUESTING A SCRIPT BTW) so i want to add a handbrake key input to my car, but since uis does not work on server scripts anymore, what should i use instead? i cant change the script to a local one, it wont work. what should i do? should i use another service? how do i fix it? thanks
Just use them on LocalScripts. They have never "worked" on Server Scripts. They were never made on them, only LocalScripts. You're gonna have to use UserInputService, Mouse.KeyDown shouldn't be used for new work. It's bad and unefficent. Use UserInputService, and if you're making the handbrake for your car, learn RemoteEvents. Not sure what you're asking but this is all the help I can give. So a quick overview, use UserInputService and learn FE stuff. Like RemoteEvents and RemoteFunctions, Remote Events are the MOST useful.
Also quick tip when you're using UserInputService, sometimes people forget to use gameProcessed in their UserInputService and when they do, keys can execute in Chat. Chat is a gameProcessed thing so we can fix that by doing:
--LocalScript local UserInput = game:GetService("UserInputService") UserInput.InputBegan:Connect(function(KeyDown, gameProcessed) --This stops it from executing in chat, make sure you have the "GameProcessed" argument near the keydown argument. if not gameProcessed then if KeyDown.KeyCode == Enum.KeyCode.YourKeyYouWant then --Do something, or fire a remote event. (Learn Remotes) end end end
That will be for when the user taps the key, if you want them to hold it then let go then you'd add something with the UserInput called InputEnded
I will provide the resources for these things to research up on :)