One error with this is your use of a debounce. A debounce needs to be checked it's value at the start of each group of code you want to run inside of a function.
Another error is that you have game.Workspace.JitterOne:Connect(noclout) which needs some sort of action such as Touched in order to do something.
local debounce = false
function noclout()
if debounce == false then
debounce = true
if workspace.DoorPartOne.Anchored == true then
script.Parent:Play()
wait(7)
end
debounce = false
end
end
workspace.JitterOne.Touched:Connect(noclout)
If I have helped answer your question please remember to accept my answer. If I have messed up please feel free to message me or comment on my answer for what I could have done better. Thanks!
3 comments
Can you explain what JitterOne is? Also, put your script as a lua code, so we can read it faster.
Is this supposed to be an Touched function?
If so, just change game.Workspace.JitterOne:Connect(noclout) to game.Workspace.JitterOne.Touched:Connect(noclout)