local teleportDoor = script.Parent
local proximityPrompt = teleportDoor:FindFirstChild("ProximityPrompt")
-- De locatie waar de speler naartoe wordt geteleporteerd
local teleportLocation = game.Workspace.TeleportDestination -- Plaats een object waar spelers naartoe worden geteleporteerd, zoals een "SpawnLocation"
proximityPrompt.Triggered:Connect(function(player)
-- Zorg ervoor dat de speler naar de teleportlocatie gaat
if player and player.Character then
local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
humanoidRootPart.CFrame = teleportLocation.CFrame
end
end
end)