How to check if something isn't tagged? (CollectionService)

Hi ,

I’m having trouble trying to identify if an instance doesn’t have a tag. Here is my code:

lefthand.Touched:Connect(function(Object)
	
	if PunchType == 1 and Cooldown == true and Object.Parent:FindFirstChild("Humanoid") and Debounce == false and CS:HasTag("Dropper") == nil then
		Debounce = true
		local HitPlayer = Object.Parent
		Damage(HitPlayer)
	end 
	
end)

I’ve looked around on the forum & read through the CollectionService documentation but cannot find the answer to my question. Thanks for the help :slight_smile:

Believe that you need to include the name of the tag you want to check for, according to the Documentation? I believe HasTag returns a Boolean value whenever it checks if an object has a tag.

…
Object.Parent:FindFirstChild("Humanoid") and Debounce == false and not CS:HasTag(Object, "Dropper") then
…
1 Like

This worked, thank you :pray: I thought it did but I tried “== false” and it didn’t work so I got confused.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.