Player does not teleport to the round when on zipline

So I made my own zipline from scratch which would be used within the game. The zipline works using a Motor6d, welds and TeenService. The issue here is that my round system doesn’t seem to teleport the player while the player is ziplining. Is there a way to fix this? I was thinking of different methods but none have yet to pop into my brain.

Video:

Sorry for the lag spikes. That’s all my pc can give me at the moment. If someone could help I would really appreciate it.

I believe the problem is that tweenservice is rapidly incrementing your position further down the zipline, so if you teleport successfuly to the game, you instantly go back to the zipline. Try stopping the tween whenever a game starts. Hope this helps!

1 Like

1 thing could be is that the Weld could be preventing the Character Model from teleporting

When the Zipline is activated, are there any sort of welds being inserted into the Model of your Character? (Workspace.GoodUsername777)

1 Like

Could you show an example of that???

1 Like

tweenname:Cancel() should do the trick. If you show your code I could probably show you where to put it :slight_smile:

1 Like

the welds are welding parts together to the handle, and the Motor 6d is the one connecting with the handle with the player.

1 Like

Adding onto what the others said, it’s most likely because of the zip line moving your position as well as trying to teleport. You could try making a special addition to your teleportation script that makes any players on the zip line eject from it then teleport them. Maybe assign a value to a players character thats currently on a zip line and check for that before teleporting?

1 Like

Ok! I would be glad to show the script:

Zipline

local tweenService = game:GetService("TweenService")
local startZip = script.Parent.Start
local endZip = script.Parent.End
local move = script.Parent.Zipline.Move
local handle = script.Parent.Zipline.BodyAttach
local primary = script.Parent.Zipline.PrimaryPart
local proximityPrompt = move.ProximityPrompt


local function moveItem(item, wp)
	local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Linear,
		Enum.EasingDirection.Out, 0, false, 0)
	local tween = tweenService:Create(item, tweenInfo,
		{Position = wp.Position})
	tween:Play()
	wait(3)
end

wait(5)

proximityPrompt.Triggered:Connect(function(player)
	proximityPrompt.Enabled = false
	local motor = Instance.new("Motor6D")
	motor.Part0 = player.Character.UpperTorso
	motor.Part1 = handle
	motor.Parent = player.Character.UpperTorso
	
	local anim = Instance.new("Animation")
	anim.AnimationId = "rbxassetid://6881429256"
	anim.Parent = script
	
	local animTrack = player.Character.Humanoid:LoadAnimation(anim)
	animTrack:Play()
	moveItem(primary, endZip)
	motor:Destroy()
	animTrack:Stop()
	wait(5)
	primary.Position = startZip.Position
	wait()
	anim:Destroy()
	proximityPrompt.Enabled = true
end)

But how would I be able to find out the round is starting??? What would I have to do with that.

1 Like

Are you firing any sort of event when the round has started? If not you could and then anyone on the zip line when the event is fired would be ejected then teleported.

1 Like

A remote event correct? Would you able to show an example???

1 Like

Well I was thinking more of a bindable event for when your round is starting. I’m assuming your round handler is using a server sided script? You can use a for loop to find any players who are on the zip line and eject them, maybe try making them jump? If you don’t want to do it in your handler script you could try making a bindable event and making a separate script.

For example:
When someone gets on the zip line you add a value to their player, or character, letting us know they’re currently in the zip line and the value would get removed when they exit the zip line. Then when your round starts use a for loop to find all the players who might be on a zip line by checking for the value assigned to them. Then just eject all the players who are on the zip line, maybe by making their characters jump.

Could you share your round handler/teleportation script?

1 Like

I think this is what you are looking for:

Zipline script

local tweenService = game:GetService("TweenService")
local startZip = script.Parent.Start
local endZip = script.Parent.End
local move = script.Parent.Zipline.Move
local handle = script.Parent.Zipline.BodyAttach
local primary = script.Parent.Zipline.PrimaryPart
local proximityPrompt = move.ProximityPrompt

wait(1)

proximityPrompt.Triggered:Connect(function(player)
	proximityPrompt.Enabled = false
	local motor = Instance.new("Motor6D")
	motor.Part0 = player.Character.UpperTorso
	motor.Part1 = handle
	motor.Parent = player.Character.UpperTorso
	
	local anim = Instance.new("Animation")
	anim.AnimationId = "rbxassetid://6881429256"
	anim.Parent = script
	
	local animTrack = player.Character.Humanoid:LoadAnimation(anim)
	animTrack:Play()
	local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Linear,
    Enum.EasingDirection.Out, 0, false, 0)
	local tween = tweenService:Create(item, tweenInfo,
		{Position = wp.Position})
	tween:Play()
	motor:Destroy()
	animTrack:Stop()
    for i = 0, 50, 1 do
        if workspace.roundInProgress.Value == true then
            i = 50
        end
        wait(0.1)
    end
	primary.Position = startZip.Position
	wait()
	anim:Destroy()
    tween:Cancel()
	proximityPrompt.Enabled = true
end)

And then add this to your server script that handles the rounds

put this in the script where the round starts:

workspace.roundInProgress.Value = true

and put this in the script where the round ends:

workspace.roundInProgress.Value = false

And you should be good to go! Maybe teleport the player to the round like a second after changing roundInProgress to true, just to be safe :slight_smile:

Important: add a boolValue called roundInProgress under workspace

1 Like

Um, I think it didn’t exactly solve it. Would you like to see the main game script??? It’s really long so I should share it with you with Pastebin.

1 Like

you can just show the parts that handle the rounds. :grin:

1 Like

If you want to take a glance here:
https://pastebin.com/YhcfytAm

1 Like

Oh whoops. Ok but it’s connected with a module if that’s ok.

I mean the Pastebin is basically it.

1 Like

Ok I think my other reply solved it pretty much.
It is kind of hard to tell what is going on because it looks like you are using a module, but I can try and direct you towards where to put the lines of code I showed above.

The round starts after this line:

gameModule.Countdown(30, 0, -1, status, "A new round is starting in: ")

so that is about where you should set roundInProgress to true.
I can’t tell if you have finished the whole round system and when it should end, but I think you should set roundInProgress to false about where it where it says

gameModule.CheckWinner(status)

I hope this helps!

1 Like

what do you mean workspace.roundInProgress.Value = true Ok wait Im confused…

Edit:
Ok so do I just make a value and just do it like that???

1 Like

yup pretty much. Put a boolValue in workspace, name it roundInProgress, and insert that line in!

Could I put it in Replicated storage???