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)
I have seen some people experience very strange bugs, and they all occur with theTriggeredevent. 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)