As an example, the one used in Darkness 2. When you are at a certain distance from the door, if you press a certain key on your keyboard, it will open(If pressed, again it closes, but I can do that part.) How do I go about making a door like this? All help appreciated, Thank You. ~ Xduel
Use magnitude to see how far a player is from a certain object, like so
if (workspace.Player1.Torso.Position - workspace.Part.Position).magnitude > 20 then --then open door end
that will check if the player is 20 studs away from the part named Part in workspace and then do the following code
ScriptingHelpers is not a request site but here is the basics of the code that will detect when the player presses e and then prints that the player has.
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() Mouse.KeyDown:connect(function(Key) if Key == "e" then print("User pressed e") -- enter code here end end)
If you need more help here's the wiki page on taking keyboard input: http://wiki.roblox.com/index.php?title=Taking_keyboard_input