So when the player is in the Region, a Gui becomes visible, but would I have to do to make it false when not in the Region?
region = Region3.new(Vector3.new(0,0,0), Vector3.new(10,10,10)) p = Instance.new("Part",game.Workspace) p.Name = "Region" p.Size = region.Size p.CFrame = region.CFrame p.Transparency = 1 p.CanCollide = false while wait() do for i,v in pairs(game.Workspace:FindPartsInRegion3(region,nil,100)) do if v.Name == "Torso" then print (v.Parent.Name) game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.Visible = true end end end
Create an else statement and be a bit more specific finding the player rather than using "Torso"
local player = game:GetService("Players").LocalPlayer region = Region3.new(Vector3.new(0,0,0), Vector3.new(10,10,10)) p = Instance.new("Part",workspace) p.Name = "Region" p.Size = region.Size p.CFrame = region.CFrame p.Transparency = 1 p.CanCollide = false while wait() do for i,v in pairs(workspace:FindPartsInRegion3(region,nil,100)) do player.PlayerGui.ScreenGui.TextLabel.Visible = false if v.Name == "Torso" and v.Parent.Name==player.Name then print (v.Parent.Name) player.PlayerGui.ScreenGui.TextLabel.Visible = true end end end