tostring not working? [Solved]
I have a problem with tostring. I keep getting the error: bad argument #2 to 'match' (string expected, got Object).
My code is:
01 | local part = script.Parent |
02 | local model = part.Parent |
04 | local wsChildren = workspace:GetChildren() |
07 | local h = hit.Parent:findFirstChild( "Humanoid" ) |
08 | local hString = tostring (h.Parent) |
09 | if h ~ = nil and not running then |
11 | for x = 1 , #wsChildren do |
12 | if tostring (x):match(hString) ~ = nil then |
I have also tried string.match but the same error happens.