Although there is a model within workspace with the name Boat1 this script doesn't identify that it exists for some reason? Any idea of what could be causing this?
function Search()
local X = model:GetChildren()
for i = 1, #X do
Print("WorksUpToHere")
if X.ClassName== "Model" and X.Name == "Boat1" or X.Name == "Boat2" or X.Name == "Boat3" then
if (X.PrimaryPart.Position-t.Position).magnitude <= 29 then
workspace.Sspawn.BrickColor = BrickColor.new("Really black")
clicker.MaxActivationDistance=0
print("Here")
repeat wait() until(X.PrimaryPart.Position-t.Position).magnitude >= 30
print("Over Here")
game.workspace.Sspawn.BrickColor = BrickColor.new("Really red")
clicker.MaxActivationDistance=32
end
end
end
end

1 comment
Alternatively, you could go with a numeric
forloop, like so:local children = model:GetChildren() for i = 0, #children do local child = children[i] print(child.Name, ":", child.ClassName) end. Though you should stick to a genericforloop as it is more straightforward.