I know there must be some silly error I have in this code so can someone please help me identify it?
local talkAreas = game.Workspace:WaitForChild("TalkRegions")
local Found = false
while wait(1) do
for i, v in pairs(talkAreas:GetChildren()) do
found = false
local region = Region3.new(v.Position - (v.Size / 2), v.Position + (v.Size / 2))
local parts = game.Workspace:FindPartsInRegion3WithWhiteList(region, game.Players.LocalPlayer.Character:GetDescendants())
for _, part in pairs(parts) do
if part:FindFirstAncestor(game.Players.LocalPlayer.Name) then
print("PlayerIsThere")
Found = true
break
else
Found = false
print("PlayerNotFoundInRegionUBot")
end
end
if Found == true then
if script.Parent.Talk.TalkIndication.Visible == false then
script.Parent.Talk.TalkIndication.Visible = true
break
end
else
print("NahFam")
script.Parent.Talk.TalkIndication.Visible = false
end
end
end
