How to make a E to teleport door in roblox studio

Опубликовано: 06 Июль 2026
на канале: AnormalDevRobloxStudio
51
2

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)