Zipline Troubles!

Heyo everyone! I have been recently trying to script a zipline on roblox, and I made a topic trying to get some ideas on how I can achieve this. I decided to make a simple zipline using tweening and welds, but something weird happens. Whenever the player’s character is on the zipline, he/she is welded far away from the part.

Script:

local tweenservice = game:GetService("TweenService")

local isonzip = false

local line = script.Parent.Line
local finish = script.Parent.End
local start = script.Parent.Start
local slider = script.Slider
local sliderpart = slider.SliderPart
local movingsliderpart = slider.Part

start.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		isonzip = true
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		local character = hit.Parent
		local humanoid = hit.Parent.Humanoid
		local weld = Instance.new("Weld")
		weld.Part0 = character.Head
		weld.C0 = character.Head.CFrame:inverse()
		weld.Part1 = sliderpart
		weld.C1 = sliderpart.CFrame:inverse()
		weld.Parent = sliderpart
		sliderpart.CFrame = character.Head.CFrame
		local tweeninfo = TweenInfo.new(2)
		local goal = {}
		goal.CFrame = finish.CFrame
		local tween = tweenservice:Create(movingsliderpart, tweeninfo, goal)
		tween:Play()
		wait(2)
		weld:Destroy()
		isonzip = false
	end
end)

Did I do something wrong with the weld?

First of all, tweening and welding wouldn’t work, as if you have 2 parts welded together and then go to one of their properties and change their position they would break.
Further more, I suggest using Forces/Velocities or whatever, as this won’t break.
I suggest either making a model and moving the primary part; SetPrimaryPartCFrame, this is better to tween if you do wish to use tween.

Let me know if it worked out!

2 Likes

Hey, just a friendly reminder, can you close this topic if that’s all. Else if you think you will have some follow up questions keep this topic open. Thanks! :smiley:

1 Like

Oh! Ok how can I close a topic?

Press the 3 dots on a message which is the solution and choose it as your solution.

1 Like