So, basically what I am trying to do is chage the mechanics of a door script I made a few days ago from instead of clicking the door to open it, I want to be able to put my mouse over the door and when I press E on my keyboard it opens. Possibly add a GUI that displays text which says “Press ‘E’ To Open” as well
This is my current main door script that I am using which works perfectly fine but I wish to build on to it.
This script will be a lot more complicated, since it will require client-server communication. Unless this change is absolutely necessary, I wouldn’t suggest it.
However, here’s a quick rundown of what you need to do: Client-side:
-Use :GetMouse() to have access to the mouse’s position
-Use .InputBegan to detect when something is pressed
-If the input’s KeyCode is equal to Enum.KeyCode.E, then
-Get whatever the mouse is on top of with Mouse.Target
-If it exists, use a RemoteEvent to send it to the server
Server-side:
-Detect when the RemoteEvent fires
-Use the mouse’s target to determine the door that is being hovered over (if any)
-CFrame the door like you did above