No idea, this is a part of the script and the only reaseon i can see the error is because i printed it out, this is the full script:
local SeekTargets = coroutine.create(function()
local Part = Instance.new("WedgePart")
Part.CanCollide = false
Part.Transparency = 0.9
Part.Size = Vector3.new(3, 30, 30)
Part.Position = script.Parent.Position + script.Parent.CFrame.LookVector * Vector2.new(30,30).Magnitude
Part.Orientation = script.Parent.Orientation + Vector3.new(0, 45, 90)
Part.Anchored = true
Part.Parent = workspace
wait(0.1)
local Parts = Part:GetTouchingParts()
Part:Destroy()
return Parts
end)
while true do
local success , result = coroutine.resume(SeekTargets)
print(success , result)
if result and success == true then
local ray = workspace:Raycast(script.Parent.Position , result[math.random(1,#result)].Position)
script.Parent.Parent.Humanoid:Move(-ray.Direction)
end
wait(0.5)
end
Ah okay, could you try calling it as normal instead of in the coroutine? I’m looking over your script and I can’t see any instance of you calling a table value but maybe I’m skipping over something. You can put it back to a coroutine after.
I can’t use it in the statement at all, because i can’t check if the table has things in it because i get the error “Attempt to call a nil value”
How could i check if the table is empty then?