So I'm trying to make a rope go from one person's hand to the other hand. I got that down.
However, when I make the function run to make the constraint rope, they get a swep that becomes active with a "normal" holdtype (Both hands at their side).
My problem is the rope gets the position of the bones like they are both at the side of the person body. Is there a way to get the position of the bones based on the angle the bones are manipulated at? Or any other solutions?
[code]
local RBS = {}
RBS.LHand = ply:LookupBone("ValveBiped.Bip01_L_Hand")
RBS.RHand = ply:LookupBone("ValveBiped.Bip01_R_Hand")
ply:ManipulateBoneAngles(RBS.LShoulder, Angle(25,0,0))
ply:ManipulateBoneAngles(RBS.RShoulder, Angle(-25,0,0))
ply:ManipulateBoneAngles(RBS.LUpArm, Angle(-10,0,0))
ply:ManipulateBoneAngles(RBS.RUpArm, Angle(10,0,0))
ply:ManipulateBoneAngles(RBS.LFArm, Angle(50,0,0))
ply:ManipulateBoneAngles(RBS.RFArm, Angle(-50,0,0))
ply:ManipulateBoneAngles(RBS.LHand, Angle(0,-15,70))
ply:ManipulateBoneAngles(RBS.RHand, Angle(0,-15,-70))
local function JSBoneVec(num) -- Returns the vector instead of angle and vector
local vec, ang = ply:GetBonePosition(num)
return vec
end
-- Makes a nice "rope" bewtween the two hands.
constraint.Rope(
ply, -- Marks ent starting
ply, -- Marks ent ending
0, -- Ragdoll shit
0, -- Ragdoll shit
ply:LocalToWorld(JSBoneVec(RBS.LHand)), -- Left hand pos
ply:LocalToWorld(JSBoneVec(RBS.RHand)), -- Right hand pos
JSBoneVec(RBS.LHand):Distance(JSBoneVec(RBS.RHand)), -- Gets distance from left hand to right hand
0, -- 0 Add length
0, -- Make it unbreakable
10, -- Width of rope
"cable/rope" -- Materail of the rope
)
[/code]
[IMG]https://i.gyazo.com/1caf6a3b4ba4863b2d1deb1ea5f7fe1e.png[/IMG]
I'd suggest [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/DrawBeam]render.DrawBeam[/url] Because I don't think you can constraint ropes to players without hacking
[QUOTE=Kevlon;52565653]I'd suggest [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/DrawBeam]render.DrawBeam[/url] Because I don't think you can constraint ropes to players without hacking[/QUOTE]
Didn't I just say I could?
Using constraints like that is just bad practice ¯\_(ツ)_/¯
[QUOTE=Kevlon;52565667]Using constraints like that is just bad practice ¯\_(ツ)_/¯[/QUOTE]
Well, I'd rather use it like that. Using the client side drawbeam means I'll have to network. I don't want to network.
An easy way of doing it would just be [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetNWBool]Entity:SetNWBool[/url]
Since it also allows you do do more shit
[QUOTE=Kevlon;52565680]An easy way of doing it would just be [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetNWBool]Entity:SetNWBool[/url]
Since it also allows you do do more shit[/QUOTE]
Yea, but I would network back and forth for everyone to see it.
I updated the problem btw, I have a new problem now.
Yeah, you shouldn't use constraints like that. It is still networked internally, so I don't know what you're trying to save, exactly.
w/e Guess I'll use drawbeam
Sorry, you need to Log In to post a reply to this thread.