--Interact Script
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local deb = false
local gui = plr.PlayerGui.Interact.Background
local dis = 5
while true do wait()
if mouse.Target then
if mouse.Target:FindFirstChild("canInteract") then
local mag = (plr.Character.Torso.Position - mouse.Target.Position)
if mag<=dis then
gui.Visible = true
else
gui.Visible = false
end
else
gui.Visible = false
end
end
end
Error:Players.Player.PlayerGui.interactScript:13: attempt to compare userdata with number

1 comment
I basically want it so that if you are 5 studs away from the door in any angle a gui will pop up