Hello, what I'm trying to do is make an arrest tool that teleports a person to a jail if the tool handle touches him. At first, it kept putting the person in jail a lot of times, so I put a BoolValue. The BoolValue says that if the BoolValue is false, and the tool touches a person, he will get teleported and the BoolValue will become true. After 10 seconds it becomes false. The problem is that when I unequip it, the value won't go back to false anymore, rendering the tool useless.
tool = script.Parent
Arrest = script.Parent.Arrest
function touch(hit)
h = hit.Parent
g = h:findFirstChild("Humanoid")
if Arrest.Value == false then
Arrest.Value = true
if (g ~= nil) then
h:MoveTo(game.workspace.Jail.Position)
wait(10)
Arrest.Value = false
end
end
end
function sel()
tool.Handle.Touched:connect(touch)
end
tool.Equipped:connect(sel)
