Please use 3 backquotes before and after your script to format it.
A Debounce Patterns | Roblox Creator Documentation is meant to keep something like a .Touched object from firing multiple times. You don’t have a wait(x) in your function to do that.
Also you set db to false outside the function, when the function is fired you check for false (good) and immediately set to to true (good) but as mentioned you need a wait(however many seconds) and after that you need to set db to false again.
And I would put the script in the Hitbox itself.
And are you getting the (hit) print the first time?
local db = false
script.Parent.Touched:Connect(function(hit)
if db == false then
db = true
print(hit)
script.Parent.Parent.Part.Anchored = false
wait(1)
db = false
end
end)
Didn’t read correctly lol sorry, how can I get the frame the object was un anchored and the frame the hitbox was hit? and then house can I make it as soon as the box is hit the prop is un anchored?