КАК сделать телепорт в другую игру в Roblox Studio?

Понравилось видео? Ставь лайк и подписывайся на канал! Музыка: Модульный скрипт: local TeleportService = game:GetService(“TeleportService“) local ATTEMPT_LIMIT = 5 local RETRY_DELAY = 1 local FLOOD_DELAY = 15 local function SafeTeleport(placeId, players, options) local attemptIndex = 0 local success, result -- define pcall results outside of loop so results can be reported later on repeat success, result = pcall(function() return TeleportService:TeleportAsync(placeId, players, options) -- teleport the user in a protected call to prevent erroring end) attemptIndex = 1 if not success then (RETRY_DELAY) end until success or attemptIndex == ATTEMPT_LIMIT -- stop trying to teleport if call was successful, or if retry limit has been reached if not success then warn(result) -- print the failure reason to output end return success, result end local function handleFailedTeleport(player, teleportResult, errorMessage, targetPlaceId, teleportOptions) if teleportResult == then (FLOOD_DELAY) elseif teleportResult == then (RETRY_DELAY) else -- if the teleport is invalid, report the error instead of retrying error((“Invalid teleport [%s]: %s“):format(, errorMessage)) end SafeTeleport(targetPlaceId, {player}, teleportOptions) end :Connect(handleFailedTeleport) return SafeTelepor Скрипт детали телепорта: local Players = game:GetService(“Players“) local ServerScriptService = game:GetService(“ServerScriptService“) local SafeTeleport = require() local TARGET_PLACE_ID = 0 -- replace with your own place ID function Teleporting(player) SafeTeleport(TARGET_PLACE_ID, {player} ) end :Connect(Teleporting)
Back to Top