Character not teleporting

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    The first teleporter teleports my character, but the 2nd one won’t.

  2. What is the issue? Include screenshots / videos if possible!
    I believe for my code to be correct, but it still breaks and doesn’t print any errors.

Code:

local TelePoint = script.Parent.Parent.Parent.TelePoint

script.Parent.Triggered:Connect(function(Player)
	print(1)
	local TeleportGui = Player.PlayerGui.Teleport
	local MainFrame = TeleportGui.MainFrame
	local HumanoidRootPart = Player.Character:WaitForChild("HumanoidRootPart")
	
	HumanoidRootPart.Position = Vector3.new(TelePoint.Position.X, TelePoint.Position.Y + 1.5, TelePoint.Position.Z)
end)

Video:

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Yes, I found nothing of relevance.
8 Likes

Have you tried comparing the two teleportation scripts to see what might be the problem?

2 Likes

They are the same code, I duplicated the script and put inside the ProximityPrompt

1 Like

could you add a print before and after the teleport is supposed to happen and send the output when (or if) it runs?

1 Like

Maybe try this.

local TelePoint = script.Parent.Parent.Parent.TelePoint

script.Parent.Triggered:Connect(function(Player)
	print(1)
	local TeleportGui = Player.PlayerGui.Teleport
	local MainFrame = TeleportGui.MainFrame
	local HumanoidRootPart = Player.Character:WaitForChild("HumanoidRootPart")
	
	HumanoidRootPart.Position = TelePoint.Position + Vector3.new(0, 1.5, 0)
end)
2 Likes

I tried, it doesn’t print after script.Parent.Triggered:Connect(function(Player)

1 Like

Could you show us the server console because you’re only showing the client side errors. Your script is running on the server, so we won’t see any server errors, if you show us the client console.

1 Like

It’s the same, nothing on the server.

1 Like

if there are no errors that means you arent actually firing the function

1 Like

I’ve fired the function correctly, and it tends to work, but it breaks sometimes.

1 Like

ok then make a copy of the game and put it here

1 Like

thats the best way of finding the bug

1 Like

Alright, here’s the file:
e.rbxl (64.0 KB)

Also, I tried this. Nothing is different.

1 Like

PivotTo??? :money_mouth_face: :money_mouth_face: :money_mouth_face: :money_mouth_face: :money_mouth_face: :money_mouth_face: Use PivotTo??? :money_mouth_face: :money_mouth_face: :money_mouth_face: CFrame!!! :money_mouth_face: :money_mouth_face: :money_mouth_face:

1 Like

use cframe
char char char char

Works ty :pray:

local TelePoint = script.Parent.Parent.Parent.TelePoint
local Character = Player.Character

script.Parent.Triggered:Connect(function(Player)
	local TeleportGui = Player.PlayerGui.Teleport
	local MainFrame = TeleportGui.MainFrame
	local HumanoidRootPart = Player.Character:WaitForChild("HumanoidRootPart")
	Character:PivotTo(CFrame.new().Rotation + Vector3.new(TelePoint.Position.X, TelePoint.Position.Y + 1.5, TelePoint.Position.Z))
end)

Model:PivotTo(CFrame) :fearful: :scream: :money_mouth_face: :money_mouth_face: :money_mouth_face: CFrame.Rotation + Vector3 :money_mouth_face: :money_mouth_face: :money_mouth_face: :money_mouth_face: WorldPivot Orientation = 0,0,0 :money_mouth_face: :money_mouth_face: :money_mouth_face:

1 Like

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