Hey all,
I am running some code that will detect if you have a certain ShirtGraphic (t-shirt) and if you don’t, then it will kill you, if you do, then it will print “Disguised.” My code prints disguised WHEN THE PROPER CONDITIONS ARE MET, however, if they aren’t, it prints nothing nor does it (seemingly) execute code.
disguisePart.Touched:Connect(function(touched)
if touched.Parent:IsA("Model") and touched.Parent:FindFirstChild("Humanoid") then
if touched.Parent:FindFirstChild("shirtDetection") then
local shirtId = touched.Parent:WaitForChild("shirtDetection").Graphic
if string.find(shirtId, "my id") then
print("Disguise")
else
print("Must've not disguised, killing".. touched.Parent.Name)
touched.Parent:BreakJoints()
end
end
end
end)
What’s strange is how scripting the else part is usually easier because it’s whatever didn’t happen (usually), but this time its not running. My logic is right on this one, but the else statement won’t run. (as stated previously, if the player is “disguised,” then it does print “disguised.” If the player isn’t disguised, meaning they do not have the shirt, then it doesn’t print or kill the player/break the joints of the model