Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local points = {}
- local material = Material("cable/rope")
- local entity = nero.GetPlayer("CapsAdmin")
- local length = 20
- for point = 1, length do
- points[point] = {position = entity:GetShootPos(), velocity = Vector(0)}
- end
- --GARBAGE CPOERLERLECOTR
- local Clamp = math.Clamp
- local Max = math.max
- local Vector = Vector
- local Draw = draw.SimpleText
- hook.Add("RenderScreenspaceEffects", "RopePhysics:RenderScreenspaceEffects", function()
- cam.Start3D(EyePos(), EyeAngles())
- render.SetMaterial(material)
- render.StartBeam(length)
- for point = 1, length do
- render.AddBeam(points[point].position,1,1,color_white)
- end
- render.EndBeam()
- cam.End3D()
- points[1].position = entity:GetShootPos() + (entity:GetAimVector() * 100)
- for point = 1, length do
- local position1 = points[Clamp(point-1, 1, length)].position - points[point].position
- local magnitude1 = position1:Length()
- local extension1 = magnitude1 - 10
- print()
- local position2 = points[Clamp(point+1, 1, length)].position - points[point].position
- local magnitude2 = position2:Length()
- local extension2 = magnitude2 - 10
- local velocity = (position1 / magnitude1 * extension1) + (position2 / magnitude2 * extension2) + (Vector(0,0,0) * 0.0001)
- points[point].velocity = points[point].velocity * (velocity * 0.001)
- points[point].position = points[point].position + points[point].velocity
- local pos = points[point].position:ToScreen()
- Draw( point, "ScoreboardText", pos.x, pos.y, color_white, 0, 0 )
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement