I’m making a rope system that I have to make the player swing to ther other side of the pole chosen, I tried to do it but I ended up failing!
References :
Code I wrote :
local Pole = findNearestPole()
if not Pole then return end
RopeBool = true
ropeBeam.Attachment1 = Pole.Attachment
local vel = Instance.new("BodyVelocity", HumanoidRootPart)
vel.MaxForce = Vector3.new(10000,10000,10000)
local p1 = HumanoidRootPart.Position
local p2 = (Pole.CFrame*CFrame.new(0,-35,-10)).p
local p3 = (Pole.CFrame*CFrame.new(0,35,-10)).p
local s = 100
for t = 0, 1, 0.1 do
local pos = quadBezier(p1,p2,p3,t)
vel.Velocity = CFrame.new(HumanoidRootPart.Position, pos).LookVector * s
s -= 1
task.wait(0.1)
end
game.Debris:AddItem(vel, 0.125)
RopeBool = false
ropeBeam.Attachment1 = nil