The setup is kind of like a dunk tank. You push a button then a trapdoor opens. When I click the button, 5 times out of 10, it doesn’t work. I want my trapdoor to always unanchor. The chair doesn’t do anything.

I don’t know what to try to fix it.
This is the script:
local clickDetector = Instance.new("ClickDetector",script.Parent)
clickDetector.MouseClick:connect(function()
for _,v in pairs(game.Workspace.Drop:GetChildren()) do
if v:IsA("BasePart") then
v.Anchored = false
end
end
end)
Please help!
this is repost bc i didn’t get a solution last time
i copied and pasted your script and it worked perfectly for me, the only thing I can think of is that you have multiple things in workspace called drop. If that is the case I would recommend parenting the script to the model and refrencing the model through script.Parent and the button through script.Parent.Button.
Hope this helps!
i tried it and it didn’t work, can you send me the script with the script.Parent?
also I filtered and drop was the only drop there.
I have deleted the script from my world, but I tried your exact script with your exact example and it went perfectly fine for me so idk. There is one thing though: your script is instancing a new click detector even though there already is one in the part. Perhaps the original clickdetector is overriding the new one. Try either deleting the old one before testing or not making a new one and connecting the click function to the old one instead.
1 Like