Hello, i am wondering how I would check if an instance has an attribute, as when i try, it only works if the attribute is set to true I dont know why tho.
local tabled = workspace:GetPartBoundsInBox(hitbox.CFrame, hitbox.Size)
for i, v in tabled do
local parent = v
while parent do
if parent:IsA("Model") and (parent:GetAttribute("Vulnerable") == true or parent:GetAttribute("Vulnerable") == true) then
local highlight = parent:FindFirstChild("Highlight")
print("found")
if highlight then
highlight:Destroy()
end
for i, v in parent:GetChildren() do
if v:IsA("BasePart") then
v.Anchored = false
end
end
parent:SetAttribute("Vulnerable", nil)
destroyedEvent:Fire()
end
parent = parent.Parent
end
end
the whole script works perfectly fine, its just that it only prints "found" if the attribute is true, when i want it to print found when the attribute is there, no matter the value.
Thanks!