See, what I'm trying to do is have a block be swung like a sword, and check if it's already hit that person to prevent from dealing mass amounts of damage.
Here is the basic script, without dealing any damage.
sword = script.Parent mainpart = sword.Blade hitplayers = {} mainpart.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and (hit.Parent.Name[hitplayers]) == nil then table.insert(hitplayers, hit.parent.Name) end end)
Any ideas?
You have to loop through the table.
function InTable(Tab,Val) for _,n in pairs(Tab) do if n == Val then return true end end end if not InTable({1,2,3,4},77) then print("HI") end