Create rope between two entitys

Okay, I wanna make a rope between me and what I’m looking at.

My guess was:



for k, v in pairs( player.GetAll() ) do
	ply = v
	ent = ply:GetEyeTrace().Entity
	constraint.Rope( ply, entity, 0, 0, ply:GetLocalPos(), ent:GetLocalPos(), 10, 5, 10, 5, "Cable/cable2", 1 )
end

But I was wrong. If any of you have an idea, please help. :slight_smile:

  • snip not funny -

Try Vector(0, 0, 0) instead of x:GetLocalPos()

Didn’t work :’(



concommand.Add("create_rope",function(ply)
  local ent = ply:GetEyeTrace().Entity
  constraint.Rope(ply,ent,0,0,Vector(0,0,0),Vector(0,0,0),1000,0,0,10,"Cable/cable2",false)
end)


Spawned a barrel, looked at the barrel and entered the cmd and it works. :smile: