script.Parent.Players.OnServerEvent:Connect(function(player, Text)
local part2 = game.Workspace:FindFirstChild(Text)
local part1 = game.Workspace:FindFirstChild(player.Name)
if part2 and part2:IsA("BasePart") and part1 and part1:IsA("BasePart") then
local w = Instance.new("RopeConstraint")
w.Parent = part2
w.Name = "ROPEDRAG"
w.Attachment1 = part2
w.Attachment0 = part1
print("Rope attached between", part1.Parent.Name, "and", part2.Parent.Name)
else
print("Invalid parts for rope attachment")
end
end)