#Touched function

1 messages · Page 1 of 1 (latest)

sturdy crag
#
for _, checkpoint in pairs (Checkpoints:GetChildren()) do
    if table.find(TouchedTable, checkpoint) then return end
    
    checkpoint.Touched:Connect(function(part)
        checkpoint.CanTouch = false
        print(TouchedTable) -- here
        if not table.find(TouchedTable, checkpoint) then

            table.insert(TouchedTable, checkpoint)
        end
        
        checkpointManager:OnTouch(part)
        
    end)
end

its should print only 4 times, but I not sure why it prints more than that

vagrant nexus
#

@sturdy crag

#

You didn't add a debounce or something like that.