0 views0 copies0 likes

Zone Entry Notification for Adventure Maps

Universal script

Copy it, then test it in your own Studio place.

UI systems Verified

Script code

26 lines ยท 1.0 KB
Download
local zones = workspace:WaitForChild("MapZones")local player = game:GetService("Players").LocalPlayerlocal gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))gui.ResetOnSpawn = falselocal banner = Instance.new("TextLabel", gui)banner.AnchorPoint, banner.Visible = Vector2.new(0.5, 0), falsebanner.Position, banner.Size = UDim2.fromScale(0.5, 0.1), UDim2.fromOffset(220, 35)local active, untilTime = nil, 0while gui.Parent do	local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")	local found	if root then		for _, zone in zones:GetChildren() do			if not zone:IsA("BasePart") then continue end-- โ€ฆopen Get script for the full source

About this script

Add transparent, anchored zone parts inside Workspace.MapZones and name them with the labels you want to display. The client checks which part contains the player and briefly shows the name when they enter a different zone. Alphabetical order decides overlapping zones. Walk the zone boundary several times during a playtest before placing two notices directly beside each other.

Comments

Share what works, ask questions, or report an issue.

0

Log in to leave a comment.

No comments yet

Be the first to share your thoughts!

Raw Luau source

local zones = workspace:WaitForChild("MapZones")
local player = game:GetService("Players").LocalPlayer
local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
gui.ResetOnSpawn = false
local banner = Instance.new("TextLabel", gui)
banner.AnchorPoint, banner.Visible = Vector2.new(0.5, 0), false
banner.Position, banner.Size = UDim2.fromScale(0.5, 0.1), UDim2.fromOffset(220, 35)
local active, untilTime = nil, 0
while gui.Parent do
	local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
	local found
	if root then
		for _, zone in zones:GetChildren() do
			if not zone:IsA("BasePart") then continue end
			local p, half = zone.CFrame:PointToObjectSpace(root.Position), zone.Size / 2
			if math.abs(p.X) <= half.X and math.abs(p.Y) <= half.Y and math.abs(p.Z) <= half.Z
				and (not found or zone.Name < found.Name) then found = zone end
		end
	end
	if found ~= active then
		active = found
		if found then banner.Text = found.Name; untilTime = os.clock() + 2 end
	end
	banner.Visible = os.clock() < untilTime
	task.wait(0.1)
end