234
This commit is contained in:
1 parent
e1459c9834
commit
b48d1f68f6
14 files changed
+51196
-45855
No files matched your search
@@ -1164,6 +1164,12 @@ end
|
||||
|
||||
---------------------------------------------------------------- телепорт
|
||||
|
||||
local TELEPORT_FADE = 0.3 -- сколько клиент затемняет экран перед переносом
|
||||
local teleporting = {}
|
||||
Players.PlayerRemoving:Connect(function(p)
|
||||
teleporting[p] = nil
|
||||
end)
|
||||
|
||||
local function teleportTo(player, worldId)
|
||||
local data = profiles[player]
|
||||
local char = player.Character
|
||||
@@ -1190,9 +1196,17 @@ local function teleportTo(player, worldId)
|
||||
end
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
local m = map and map:FindFirstChild(markerName, true) -- маркеры могут лежать в папках уровня (World1Map)
|
||||
if m then
|
||||
if m and not teleporting[player] then
|
||||
-- клиент затемняет экран, переносим уже в темноте: свет новой локации ставится до того, как её видно
|
||||
teleporting[player] = true
|
||||
stopFishing(player, true)
|
||||
char:PivotTo(m.CFrame + Vector3.new(0, 3, 0))
|
||||
remote:FireClient(player, "TeleportFade", worldId, TELEPORT_FADE)
|
||||
task.wait(TELEPORT_FADE)
|
||||
teleporting[player] = nil
|
||||
char = player.Character
|
||||
if char and char.Parent then
|
||||
char:PivotTo(m.CFrame + Vector3.new(0, 3, 0))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user