The attachment named attach2 is not spawning in
local repStore = game:GetService("ReplicatedStorage")
local tool = script.Parent
local remote = repStore:WaitForChild("StunDrag")
local module = repStore:WaitForChild("RagDoll_Module")
local attach
local attach2
local rope
local length = 4
local Prompt = script.Parent
local drag = Prompt.Dragging.Value
local Prompt = script.Parent
Prompt.Triggered:Connect(function(plrTrigger)
print("Triggered")
local echaracter = plrTrigger.Character
local Character = Prompt.Parent.Parent
print(drag)
if drag == false --[[and plrTrigger.Character ~= Character ]]then
drag = true
print("Drag")
print(echaracter)
print(plrTrigger)
print("Drag")
attach = Instance.new("Attachment")
attach.Name = "DragAttch"
attach.Parent = Character.HumanoidRootPart
attach.WorldPosition = Character.HumanoidRootPart.Position
attach2 = Instance.new("Attachment")
attach2.Name = "DragAttch2"
attach.Parent = echaracter.HumanoidRootPart
attach.WorldPosition = echaracter.HumanoidRootPart.Position
rope = Instance.new("RopeConstraint")
rope.Parent = Character:FindFirstChild("HumanoidRootPart")
rope.Visible = true
rope.Length = length
rope.Attachment0 = attach
rope.Attachment1 = attach2
rope.WinchEnabled = false
elseif drag == true then
drag = false
print("Let go")
if rope then
rope:Destroy()
attach:Destroy()
attach2:Destroy()
end
end
end)