Hi im trying to write a script where an npc goes to any goal(part) within a specified range
can u paste the full script please
Its this part i need help with
Hi! I see some strange stuff in script, can you please explain what’s going wrong in details?
Im trying to print the table for debugging purposes.
And what’s going wrong? It returns an error, don’t print anything, prints weird stuff?
It prints weird stuff in the output
If you mean something like this:
then it’s beause you insterting table in table
table.insert(goalparts, {goal})
__________________________^^^
In the dev console it prints encoded garbage,
By doing
{goal}
You’re putting it inside a table. So when you print goal parts, you’re not printing a table of goals, your printing a table of tables.
Unless this is intended, then It should be
table.insert(goalparts, goal)
-- and the print too
print(goalparts, goal)
1 Like