function onTouchedNotHit(part)
if part.Name == "HitboxForBackStabs" then --//Im Trying To Make It Where If A Part ISNT Named "HitboxForBackStabs" Then This Function Takes Effect, How Do I Do That?
script.Parent.Parent.Parent.Head.MISSPart.BillboardGui.TextLabel.TextTransparency = 0
wait(1.5)
script.Parent.Parent.Parent.Head.MISSPart.BillboardGui.TextLabel.TextTransparency = 1
print("Missed Enemy")
end
end
script.Parent.Touched:connect(onTouchedNotHit)
✓ ANSWER ACCEPTED
Hello!! I was trying to make it where if NOT named "HitboxForBackStabs" THEN the function activates?
1 answer
✓ Accepted answer
Just change the == equals operator to a not equal to operator ~=. This is a little bit confusing since most programming languages' not equal to operator is this != but in LUA it's ~=. The end code would change line 2 to this if part.Name ~= "HitboxForBackStabs" then.
Really hope this helped! If you have any questions just comment on this answer. If this did solve the problem please mark this as the answer. Have a good day!
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
THANK YOU!!!
I didnt know that at all, tysm!!
Np