-
What do you want to achieve?
I’m making a disaster game that checks first if a part is destructable, then unanchors the part if it is. (in this instance a part checks for all the parts insides it and unanchors accordingly) -
What is the issue? Include screenshots / videos if possible!
This script was working a second ago, but it suddenly stopped after I added the extra elseif statements, and the parts arent unanchoring. Every print except the print in the second line in the code doesnt show, and no warnings or errors pop up in the output menu.
Here is the code:
RunService.Heartbeat:Connect(function()
print("is this thing even on") --the only thing that actually shows up in output
local EffectZone = KILL:GetTouchingParts()
for i, part in EffectZone do
print("Part Detected")
if CollectionService:HasTag(part, "Destructable") then
print("Part is Destructable")
if CollectionService:HasTag(part, "Strength4") then
part.Anchored = false
elseif CollectionService:HasTag(part, "Strength3") then
part.Anchored = false
elseif CollectionService:HasTag(part, "Strength2") then
part.Anchored = false
else
CollectionService:HasTag(part, "Strength1")
part.Anchored = false
end
end
end
end)