I’m trying to make a prompt, which when triggered, teleports the player to the Teleport part. But this does not work nor output showing any errors. Any solutions?
local prompt = script.Parent.ProximityPrompt
local tpIn = script.Parent.Parent.InPart
local tpOut = script.Parent.Parent.OutPart
local hiding = false
prompt.Triggered:Connect(function(trigger)
local root = trigger.Parent:FindFirstChild("HumanoidRootPart")
if root and hiding == false then
root.CFrame = tpIn.CFrame
hiding = true
elseif root and hiding == true then
root.CFrame = tpOut.CFrame
hiding = false
end
end)