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

MIT License

]]

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(0.5)
	if state == "Use" then
		Using = true
	end
end)
