I’m tethering two players using a RopeConstraint + Beam, but one player gets stuck and can’t move on the client. On the server they seem to move somewhat (they get dragged by the other player but they still can’t move), but locally they’re frozen. (Replication issue?) No errors.
Here’s the rope script:
local Players = game:GetService("Players")
local function createAttachment(character)
local hrp = character:WaitForChild("HumanoidRootPart", 3)
if not hrp then return nil end
local att = hrp:FindFirstChild("RootAttachment")
if not att then
att = Instance.new("Attachment")
att.Name = "RootAttachment"
att.Parent = hrp
end
hrp.Massless = false
return att
end
local function attachRope(player1, player2)
local char1, char2 = player1.Character, player2.Character
if not (char1 and char2) then return end
local att1 = createAttachment(char1)
local att2 = createAttachment(char2)
if not (att1 and att2) then return end
local rope = Instance.new("RopeConstraint")
rope.Visible = false
rope.Attachment0 = att1
rope.Attachment1 = att2
rope.Length = 25
rope.Restitution = 0.2
rope.Thickness = 0.1
rope.Parent = att1.Parent
local beam = Instance.new("Beam")
beam.Attachment0 = att1
beam.Attachment1 = att2
beam.Width0 = 0.2
beam.Width1 = 0.2
beam.Color = ColorSequence.new(Color3.fromRGB(200, 150, 50))
beam.FaceCamera = true
beam.Parent = att1.Parent
end
local function tryAttachPlayer(player)
local mateName = player:FindFirstChild("PrivateValues") and player.PrivateValues:FindFirstChild("Mate")
if not (mateName and mateName.Value ~= "") then return end
local matePlayer = Players:FindFirstChild(mateName.Value)
if not matePlayer then return end
if not matePlayer.Character then matePlayer.CharacterAdded:Wait() end
if not player.Character then player.CharacterAdded:Wait() end
if not (player.Character:FindFirstChild("HumanoidRootPart") and matePlayer.Character:FindFirstChild("HumanoidRootPart")) then
player.Character:WaitForChild("HumanoidRootPart")
matePlayer.Character:WaitForChild("HumanoidRootPart")
end
attachRope(player, matePlayer)
end
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
task.wait(0.5)
tryAttachPlayer(player)
end)
end)
No anchored parts, tried changing rope length, attachments are in HumanoidRootPart, tried parrenting to workspace. Made sure HRP isn’t massless. Tried setting NetworkOwnership to the server.
Any ideas? Could it be a replication issue?