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

How to Make a Block Display a Message (Press E to...) Player Presses the Key Which Runs a Script?

Asked by 6 years ago

I'm trying to figure out how to make it so when a player is in a specific radius away from a specific block (say 5 studs or so) a message shows on screen such as, "Press E to..."

When the player presses the key (E) it runs a script (such as teleporting the player).

The reason I need this is because I'm trying to make a door that when you walk up to it, it shows a message "Press E to go Inside." When the player presses E it teleports them to another location (which acts like the inside of the building).

Block Radius -> Message -> Player presses key -> Runs a script.

1 answer

Log in to vote
0
Answered by 6 years ago

This would include Magnitude and ContextActionService.

There are other services other than ContextActionService but I find it more useful because it allows for different device support.

Click these links for the wiki page for them! ^-^

Magnitude

ContextActionService

Magnitude is for detecting distance between two parts, or distances between many depending on what you want it for.

ContextActionService is basically input from keyboards, joysticks, etc. (I am not fully sure on the full capabilities of this service but I know the essentials)

Ad

Answer this question