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

How do I script keybindings to ELS lighting in a vehicle?

So I have recently gotten into scripting lighting for police cars and stuff. I haven't seemed to figure out how to script it so when the player is in the car they can activate the lights with a key bind. J for example. So the player enters the vehicle, they hit J the key bind script tells the lighting script to activate. What would I type into the key bind script to make it work?

1 answer

The Rblox dev hub is your friend here! More specifically, UserInputService

Get this service, then you can do all sorts of stuff with it! You can add a variable to prevent it from firing if you're not in a cart, etc.

When using this service, you can use InputBegan with it. This fires whenever a player presses a valid KeyCode.

Review all of this and you'll be ready to do what you want in no time!

Feel free to comment if you need further help :)

2 comments

0

Do I need to add a script or is it all in UserInputService?

0

You'll need to add a script in some place, for example, Server Script Storage.

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