local cons = {}
local enables = {}
for _, v in pairs(garage.SpawnZoneExample:GetChildren()) do
print(garage.SpawnZoneExample:GetChildren())
if not v.Name == "Floor" then
print("reached")
enables[v.Name] = true
cons[v.Name] = v.ClickDetector.MouseClick:Connect(function(plr)
print("clicked")
if plr == winner then
print("destroyed")
v:Destroy()
enables[v.Name] = nil
end
end)
end
end
I am being payed to fix some scripters system and he designed it horribly using references for placement instead of saving the cframe (serialization). Anyways a problem I am occurring is 1. this for loop isn’t running but the rest of the code is running after it. And 2. the detection of the click detector is iffy because an invisible object is clipping it and the way he coded his system was not to remove it. So I ask, how can I ignore transparent objects when handling with click detectors?
EDIT: I fixed the not detection by checking its original memory address instead of the for loops one however the problem still persist, it is unreliable the clickdetectors due to the transparent parts