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.
Put this script in the door
local distanceGUIOpens=10 --Change this to the distance between the door and character you want the gui to stay open game.Players.PlayerAdded:connect(function(plr) repeat wait() until plr.Character if (plr.Character.Torso.Position-script.Parent.Position).Magnitude<=distanceGUIOpens then if not plr.PlayerGui:FindFirstChild("DoorGui") then local gui=Instance.new("ScreenGui") local textbox=Instance.new("TextBox") gui.Parent=plr.PlayerGui gui.Name="DoorGui" textbox.Name="DoorGui" textbox.Text='Press "E" to open door' textbox.Parent=gui textbox.BackgroundTransparency=1 textbox.Position=UDim2.new(0.5,0,0.2,0) while wait() do if (plr.Character.Torso.Positionscript.Parent.Position).Magnitude>=distanceGUIOpens then gui:Remove() end end end end)
This script should work
Code?