I'm trying to make a local script inside of the PlayerGui go into game.Workspace and find "Map1" or "Map2" model and this script isn't working on that part.
local found = game.Workspace:FindFirstChild("Model")
while true do
wait(2.5)
if found.Name == "Map1" or found.Name == "Map2" then
script.Parent.MapEnabled=true
elseif found.Name == "" then
script.Parent.MapEnabled=false
end
end

2 comments
What is it doing wrong?
10:34:59.602 - Players.Player.PlayerGui.Script:4: attempt to index local 'found' (a nil value) 10:34:59.603 - Stack Begin 10:34:59.603 - Script 'Players.Player.PlayerGui.Script', Line 4 10:34:59.603 - Stack End