Proximity Prompt TP acting weird

Hey Developers.

I’m trying to make a proximity prompt that TP’s you to a destination.

Currently I have two TP pads, and using the following script to TP threw them.

local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
	player.Character.HumanoidRootPart.Position = workspace["TP Pads"]:WaitForChild("Destination2").Position -- Change "Teleportpart" To your part name
end)

Even though the script is looking fine, I can only TP to the first destination, and not back…

local ProximityPrompt = script.Parent
ProximityPrompt.Triggered:Connect(function(player)
	player.Character.HumanoidRootPart.Position = workspace["TP Pads"]:WaitForChild("Destination").Position -- Change "Teleportpart" To your part name
end)

Please help.

Is there a part called Destination2 in TP Pads and a part called Destination in TP pads?

Yes, I have a folder in workspace called TP Pads, with the new parts inside them.

Are you able to send an RBXL for me to test locally? I don’t see an issue with the code itself.

Is the script even running? Try printing it when it’s triggered
Also I recommend using workspace:FindFirstChild(“TP Pads”) instead

Let’s try a template.

I have seen some people experience very strange bugs, and they all occur with the Triggered event. I’m not sure what’s going on.


Create one part inside Workspace, and create a ProximityPrompt. Don’t rename it or do anything else. And put the script inside the Part.

local part = script.Parent
local prompt = part:FindFirstChildOfClass("ProximityPrompt")

value = false

prompt.Triggered:Connect(function(player)
    
    if value == false then
        player.Character:PivotTo(CFrame.new(0,10,0))
    else
        player.Character:PivotTo(CFrame.new(0,0,0))
    end
    
    print(value)
    
    value = not value
    
end)

Thank you so much, my problem with my current ones wouldn’t let me TP back after tping once, after I just set the CFrame accordingly it works perfect!

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