Hey guys, so this scanner is not working correctly and I have no idea what im doing wrong!
local scanlocation = workspace:GetChildren() knownmodels = {"PalmTree","AppleTree","OrangeTree"} for i,v in pairs(knownmodels) do if scanlocation.Name == v then print("Found Known Model") end end
I have the model called PalmTree in the workspace, yet it's not printing
workspace:GetChildren()
's Name is nil. A better option would be to iterate workspace's children and scan that way.
local knownmodels = {"PalmTree","AppleTree","OrangeTree"} for _,KnownModel in pairs(knownmodels) do for _,WorkspaceChild in pairs(workspace:GetChildren()) do if KnownModel == WorkspaceChild.Name then print("Found Known Model") end end end