How to make debounce local

I have a teleporter system, and I made a debounce so that the player cannot teleport multiple times, but it seems like the debounce counts for all players. Would there be a way to make the debounce local?

Code:

local db = false
local tp = "TpToBrick2"
function TpFunc(hit)
	if game.Workspace.TpTo:findFirstChild(tp) and not db then 
		local Pos = game.Workspace.TpTo:FindFirstChild(tp)
		db = true
		hit.Parent:moveTo(Pos.Position) 
		wait(2)
		db = false
	end 
end 
script.Parent.Touched:connect(TpFunc)

Use a table for debouncing

local db = {}
local tp = "TpToBrick2"
function TpFunc(hit)
	local char = hit.Parent
	local Pos = game.Workspace.TpTo:FindFirstChild(tp)
	if Pos and char:FindFirstChild("Humanoid") and not db[char.Name] then 
		db[char.Name] = true
		hit.Parent:moveTo(Pos.Position) 
		wait(2)
		db[char.Name] = false
	end 
end 
script.Parent.Touched:connect(TpFunc)
2 Likes