local g=game.Players.LocalPlayer local V=g:GetMouse()local S=script.Parent local I=false local J=game.ReplicatedStorage.Events.Etc.Detain S.Activated:Connect(function()if not I then if V.Target then if(V.Target.Position-g.Character.HumanoidRootPart.Position).Magnitude<10 then J:FireServer("\067\117\102\102",V.Target)end end else I=false J:FireServer("\085\110\067\117\102\102")end end)S.Unequipped:Connect(function()if I==true then J:FireServer("\085\110\067\117\102\102")end I=false end)J.OnClientEvent:Connect(function(g)wait(.5)if g=="\085\115\101"then I=true end end)


local Player = game.Players.LocalPlayer
local Mouse  = Player:GetMouse()
local Tool   = script.Parent
local Using  = false
local RemoteEvent = game.ReplicatedStorage.Events.Etc.Detain

Tool.Activated:Connect(function()
	if not Using then
		if Mouse.Target then
			if (Mouse.Target.Position-Player.Character.HumanoidRootPart.Position).Magnitude < 10 then 
			RemoteEvent:FireServer('Cuff', Mouse.Target)
			end
		end
	else 
		Using = false
		RemoteEvent:FireServer('UnCuff')
	end
end)
Tool.Unequipped:Connect(function()
if Using == true then
RemoteEvent:FireServer('UnCuff')
end
Using = false

end)
RemoteEvent.OnClientEvent:Connect(function( state )
wait(.5)
	if state == 'Use' then
		Using = true
	end
end)
