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

Making a door open on Key1Down event and a gui pops up to show (blank key) to open door?

Asked by 11 years ago

I want to make a key1down event door and when you got up to the door, it shows the key to open the door like "Press e to open door" in a gui way. Can anyone help me with this problem? Thanks.

0
Wait so you make the code for him? He accepts even though KeyDown Event was not included sorry but this feels more like a request. HexC3D 830 — 11y
0
Opinions I tried before. GreekGodOfMLG 244 — 11y

2 answers

Log in to vote
-2
Answered by 11 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

Put this script in the door

01local distanceGUIOpens=10 --Change this to the distance between the door and character you want the gui to stay open
02game.Players.PlayerAdded:connect(function(plr)
03    repeat wait() until plr.Character
04    if (plr.Character.Torso.Position-script.Parent.Position).Magnitude<=distanceGUIOpens then
05        if not plr.PlayerGui:FindFirstChild("DoorGui") then
06            local gui=Instance.new("ScreenGui")
07            local textbox=Instance.new("TextBox")
08            gui.Parent=plr.PlayerGui
09            gui.Name="DoorGui"
10            textbox.Name="DoorGui"
11            textbox.Text='Press "E" to open door'
12            textbox.Parent=gui
13            textbox.BackgroundTransparency=1
14            textbox.Position=UDim2.new(0.5,0,0.2,0)
15            while wait() do
View all 21 lines...

This script should work

0
Woops forgot all about the keydown event sorry........................ 73epic311 13 — 11y
Ad
Log in to vote
0
Answered by 11 years ago

Code?

0
dude i asking a queston, no code ;l GreekGodOfMLG 244 — 11y
0
I know but, it seems that you are asking for someone to make a code for you. You also said you needed help wich I assume you have an error on your code CMVProduction 25 — 11y

Answer this question