I am making an obby and have made an script that half of it works and the other one, not so much.
Here is the script:
local debounce1 = false
local StageValue = 0
workspace.Stages.Stage1.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildOfClass("Humanoid") and not debounce1 then
StageValue = StageValue + 1
if StageValue == 1 then
print("this works")
local debounce1 = true
end
end
end)
local debounce2 = false
workspace.Stages.Stage2.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildOfClass("Humanoid") and not debounce2 then
StageValue = StageValue + 1
if StageValue == 2 then
print("this does not get printed i dont know why")
local debounce2 = true
end
end
end)
The script does not give an error it just does not work.
