This script, will only make a sword turn green when the player stabs the opponent and the opponent is not holding the sword and having it equipped. Could someone fix this error?
handle = script.Parent.Handle
handle.Touched:connect(function(part)
if part.Parent:FindFirstChild("Humanoid") and not part.Parent:FindFirstChild("LinkedSword")then
handle.Mesh.VertexColor = Vector3.new(0, 1, 0)
else
handle.Mesh.VertexColor = Vector3.new(1, 1, 1)
end
end)

1 comment
Didn't work.