I made a part of a function that will kill someone if they do not have the name of the third letter and above of a model. The model in question would be called TB[Name], but this script kills everyone regardless of their name. Here is the script:
local nm = hit.Parent.Parent.Name local tb = script.Parent.Parent.Name if nm ~= tb:sub(3) then hit.Parent.Humanoid:TakeDamage(100) script.Parent.hit:Play() wait(1) end end
There are no errors in the output. Am I using :sub
correctly?