Here is my code:
local debounce = false
local function Hurt(Part)
if debounce == false then
print "check1"
if Part.Name == "box" then
print "check2"
Part.Position = Vector3.new(0, 3, 0)
debounce = true
game.Workspace.Baseplate.BrickColor = BrickColor.new("Institutional white")
wait(0.5)
game.Workspace.Baseplate.BrickColor = BrickColor.new("Pearl")
debounce = false
end
end
end
script.Parent.Touched:connect(Hurt)
There is a box that the player pushes to touch borders around a specific area. This is the script in the borders. When the box is pushed and touches the border, it works the first time it is pushed to the border, but doesn't work when the box is pushed to the same border again. Any suggestions?

7 comments
yes yes yes yes yes
bruh
You have a couple things in the script that are unconventional, for example 'game.Workspace' instead of 'workspace', 'print "check1"' instead of 'print("check1")', and 'if debounce == false' instead of 'if not debounce'. Try using the above suggestions
As a suggestion maybe put 'print(Part.Name)' under 'print "Check1"'
Alright,
Turns out that this is a collision glitch on roblox. Sorry for wasting your time.
It's ok. Please make a new answer saying "It was just a glitch" and then accept it