How do I exclude a humanoid/ part?

I have a katana, and when it slashes someone, it fires multiple times. I thought of a way to stop this, but adding the humanoid that got slashed into a table, and the katana excludes everything in that table, and when the animation is done playing, it clears the table. How would I go about doing this?

Summary
  • How do I add something to a table?
  • How do I check if something is in a table?

table.insert(tablename,what to add)

table.find(where to find, what to find)

table.remove(where to remove, what to remove)

I just found those lol, but how do I clear a table completely?

1 Like

table = {}

Sets table to empty table

1 Like

table.clear is the better alternative (for arrays) as it preserves the array’s size for later use.
https://developer.roblox.com/en-us/api-reference/lua-docs/table

2 Likes