So I have a script that makes a GUI Pop up when you press a dialogue
the problem was that I wanted the GUI dissapear when the player is too far from the dialogue
is there any way?
-- // Local script local plr = game.Players.LocalPlayer local part = -- // Target part local max = -- // Max distance local dialogue = -- // Dialog while wait() do if (plr.Character.HumanoidRootPart.Position - part.Position).magnitude <= max then dialogue.Visible = true else dialogue.Visible = false end end
This should work.