I want to make the same exact thing as this except, it is not making me do crazy swings like yours. Please help.
Video of whats happening right now:
As you can see, it’s not the smoothest thing ever.
Heres the code:
local Rope = Instance.new("SpringConstraint")
game.ReplicatedStorage.CreatePart.OnServerEvent:Connect(function(player, part, mousepos, isholdingdown)
if isholdingdown == false then
Rope:Destroy()
return
elseif isholdingdown == true then
local A0 = Instance.new('Attachment')
local A1 = Instance.new('Attachment')
A0.Parent = workspace.Terrain
A0.WorldPosition = mousepos
A1.Parent = player.Character.HumanoidRootPart
Rope.Attachment0 = A0
Rope.Attachment1 = A1
Rope.Parent = player.Character
Rope.Visible = true
Rope.LimitsEnabled = true
Rope.Coils = 0
Rope.Thickness = 0.1
Rope.Color = BrickColor.new("Institutional white")
Rope.MaxLength = (player.Character.HumanoidRootPart.Position - part.Position).Magnitude
local BV = Instance.new('BodyVelocity')
local char = player.Character
char:WaitForChild("Humanoid"):GetPropertyChangedSignal("MoveDirection"):Connect(function()
BV.Velocity = player.Character.Humanoid.MoveDirection * 26
BV.MaxForce = Vector3.new(1000000,0,1000000)
end)
BV.Parent = char.HumanoidRootPart
end
end)