why wont this work?
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local magnitude = (player.Character.Torso.Position - workspace.Door.Root.Position).magnitude
p = 0
while wait() do
if magnitude < 20 then
p = 1
scrn = Instance.new("ScreenGui",player.PlayerGui)
txt = Instance.new("TextLabel",scrn)
txt.BackgroundTransparency = 1
txt.Text = "Click to open door."
txt.Position = UDim2.new(0, 600,0, 500)
txt.Size = UDim2.new(0, 500, 0, 50)
txt.TextScaled = true
txt.TextColor3 = BrickColor.new("White").Color
end
end

1 comment
Thanks for the help :)