Animations do not work

Hi there,
I made a zipline script similar to the JToH one but the zipline animation don’t work.
I searched on online tutorials to make the animation work but I didn’t found how to fix this.
This this the zipline script. It is in a local script and its parent is the zipline part.

local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService('UserInputService')

local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://3268037702"

return function()
	local parent = script.Parent
	local propelVelocity = parent.PropelVelocity.Value
	local EPC = parent.PC
	EPC.UpperLimit = parent.Lenght.Size.Z
	parent.Lenght:Destroy()
	
	local riding = false
	--decoRope.Color =  script.Parent.BrickColor--BrickColor.new("Really black")

	local R1 = Instance.new("Attachment",parent)
	R1.Position = Vector3.new(0,0,-EPC.UpperLimit)
	
	local decoRope = Instance.new("RopeConstraint",parent)
	decoRope.Length = EPC.UpperLimit-1
	decoRope.Visible = true
	decoRope.Thickness = 0.25
	decoRope.Attachment0 = parent.Start
	decoRope.Attachment1 = R1
	--DecoRope.Name = "DecoRope"
	--local val
	--if script.Parent:FindFirstChild("ButtonActivated") ~= nil then
	--	val=Instance.new('BoolValue',script.Parent)
	--	val.Name='Activated'
	--end
	script.Parent.Touched:Connect(function(part)
		local char = part.Parent
		local plr = game.Players:GetPlayerFromCharacter(char)
		local human = char:FindFirstChild("Humanoid")

	--	if part.Parent:FindFirstChild("Humanoid") and not (val and not val.Value) and plr == game.Players.LocalPlayer then
		if riding or not human then return end
		
		local hrp = char:FindFirstChild("HumanoidRootPart")

		riding = true
		
		local ropeBar = Instance.new("Part",parent)
		ropeBar.Size = Vector3.new(4,0.5,0.5)
		ropeBar.CanCollide = false
		ropeBar.CFrame = hrp.CFrame * CFrame.new(0,2.75,0)

		local ropeGuide = Instance.new("Part",parent)
		ropeGuide.Size = Vector3.new(1,1,1)
		ropeGuide.CanCollide = false
		ropeGuide.Transparency = 1
		ropeGuide.CFrame = parent.CFrame

		local P1 = Instance.new("Attachment",ropeGuide)
		local P2 = Instance.new("Attachment",ropeBar)
		
		local rope = Instance.new("RopeConstraint",ropeGuide)
		rope.Length = 8
		rope.Visible = true
		rope.Attachment0 = P1
		rope.Attachment1 = P2

		local A2 = Instance.new("Attachment",ropeGuide)
		
		local weld = Instance.new("WeldConstraint",ropeBar)
		weld.Part0 = hrp
		weld.Part1 = ropeBar
		
		local PC = EPC:Clone()
		PC.Parent = parent
		PC.Attachment1 = A2
		
		if propelVelocity ~= 0 then
			local bodyVelocity=Instance.new('BodyVelocity',ropeGuide)
			bodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
			bodyVelocity.Velocity = parent.CFrame.LookVector*propelVelocity
			bodyVelocity.P = 100
		end

		local bodyGyro=Instance.new('BodyGyro',ropeBar)
		bodyGyro.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
		bodyGyro.CFrame = parent.CFrame

	--			RopeBar.CustomPhysicalProperties = PhysicalProperties.new(10,0,0)
	--			RopeBar.Color = script.Parent.Color
	--			RopeGuide.Color=script.Parent.Color
	--			RopeGuide.CustomPhysicalProperties = PhysicalProperties.new(20,0,0) 

	--			Rope.Color = script.Parent.BrickColor--BrickColor.new("Really black")

	--			if PV~=0 then
	--				BV.Parent = RopeGuide
	--			end
		
		local animator = human:WaitForChild("Animator")
		local track = animator:LoadAnimation(animation)
		track:Play()
		
		local disconnect = false
		if not parent.CannotDismount.Value then
			UserInputService.JumpRequest:Connect(function()
				disconnect=true
			end)
		end
		
		repeat wait()
			human.PlatformStand = true
		until human.Health <= 0 or disconnect or PC.CurrentPosition >= PC.UpperLimit
	--			if PC then PC:Destroy() end
		weld:Destroy()
		riding = false
	--			if not autodisconnect then
	--				PC.Attachment1=nil
	--			end
	--			BG:Destroy()
		ropeBar:Destroy()
		ropeGuide:Destroy()
		track:Stop()
		track:Destroy()

		human.PlatformStand = false
		human:ChangeState'Jumping'
	end)
end

Can you help me please?

sorry for the insanely late reply over a year but i’m pretty sure it doesn’t work because you dont have permissions to use it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.