234
This commit is contained in:
1 parent
e1459c9834
commit
b48d1f68f6
14 files changed
+51196
-45855
No files matched your search
@@ -76,6 +76,13 @@ Config.Worlds = {
|
||||
}
|
||||
Config.WorldRadius = 260
|
||||
|
||||
-- экран загрузки: при входе в игру и при каждом телепорте игрок уже стоит на месте, сцена прогружается
|
||||
-- и свет локации ставится под ним; картинку видно только после этого (секунды — минимум показа)
|
||||
Config.Loading = {
|
||||
firstJoin = 3,
|
||||
teleport = 2.5,
|
||||
}
|
||||
|
||||
-- лобби: те же поля внешнего вида, что у миров (clock, tint, look, terrainColors); клиент применяет их вне миров
|
||||
Config.Lobby = {
|
||||
id = "Lobby",
|
||||
|
||||
@@ -1165,6 +1165,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
|
||||
@@ -1191,9 +1197,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
|
||||
|
||||
|
||||
@@ -1576,7 +1576,21 @@ local lookDefaults = {}
|
||||
local lookSources = table.clone(Config.Worlds)
|
||||
table.insert(lookSources, Config.Lobby)
|
||||
|
||||
local function applyLook(world)
|
||||
-- смена света: плавно или сразу (за экраном загрузки)
|
||||
local lookTweens = {}
|
||||
local function setLook(obj, goal, instant)
|
||||
if instant then
|
||||
for prop, v in pairs(goal) do
|
||||
obj[prop] = v
|
||||
end
|
||||
else
|
||||
local tw = TweenService:Create(obj, TweenInfo.new(2), goal)
|
||||
table.insert(lookTweens, tw)
|
||||
tw:Play()
|
||||
end
|
||||
end
|
||||
|
||||
local function applyLook(world, instant)
|
||||
-- исходные значения запоминаем до первой правки; эффект мог ещё не прийти с сервера, тогда в следующий раз
|
||||
for _, w in ipairs(lookSources) do
|
||||
for section, props in pairs(w.look or {}) do
|
||||
@@ -1603,18 +1617,23 @@ local function applyLook(world)
|
||||
local kind = typeof(v)
|
||||
if kind == "number" or kind == "Color3" then goal[prop] = v else obj[prop] = v end
|
||||
end
|
||||
TweenService:Create(obj, TweenInfo.new(2), goal):Play()
|
||||
setLook(obj, goal, instant)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function applyAmbience(world)
|
||||
local function applyAmbience(world, instant)
|
||||
-- прошлая плавная смена ещё может идти — она перебила бы новые значения
|
||||
for _, tw in ipairs(lookTweens) do
|
||||
tw:Cancel()
|
||||
end
|
||||
table.clear(lookTweens)
|
||||
world = world or Config.Lobby
|
||||
local clock = (world and world.clock) or 14.5
|
||||
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
||||
setLook(Lighting, { ClockTime = clock }, instant)
|
||||
local cc = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||
if cc then
|
||||
TweenService:Create(cc, TweenInfo.new(2), { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }):Play()
|
||||
setLook(cc, { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }, instant)
|
||||
end
|
||||
-- цвета материалов террейна общие для всей карты, поэтому меняем их только у себя и возвращаем при выходе
|
||||
if not defaultTerrainColors then
|
||||
@@ -1630,12 +1649,12 @@ local function applyAmbience(world)
|
||||
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
||||
if atm then
|
||||
local frost = world and world.id == "World3"
|
||||
TweenService:Create(atm, TweenInfo.new(2), {
|
||||
setLook(atm, {
|
||||
Density = frost and 0.38 or 0.25,
|
||||
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
||||
}):Play()
|
||||
}, instant)
|
||||
end
|
||||
applyLook(world)
|
||||
applyLook(world, instant)
|
||||
snow.Rate = (world and world.id == "World3") and 140 or 0
|
||||
end
|
||||
|
||||
@@ -1691,16 +1710,80 @@ do
|
||||
end)
|
||||
end
|
||||
|
||||
-- экран загрузки (ReplicatedFirst/Loading): при входе и телепорте свет локации ставится, пока он закрывает картинку
|
||||
local loadingGui = player:WaitForChild("PlayerGui"):WaitForChild("LoadingScreen", 10)
|
||||
local function loadingVisible()
|
||||
return loadingGui ~= nil and loadingGui.Enabled
|
||||
end
|
||||
|
||||
local function placeTitle(w)
|
||||
return w and (w.icon .. " " .. w.name) or "🏠 Лобби"
|
||||
end
|
||||
|
||||
local function enterWorld(w, instant)
|
||||
lastWorldId = w and w.id or "lobby"
|
||||
applyAmbience(w, instant)
|
||||
if w then
|
||||
-- название локации — когда экран загрузки уже ушёл
|
||||
task.spawn(function()
|
||||
while loadingVisible() do
|
||||
task.wait(0.1)
|
||||
end
|
||||
notify(w.icon .. " " .. w.name, w.color)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
-- первое появление: ждём персонажа, ставим свет его локации сразу и отпускаем экран загрузки
|
||||
task.spawn(function()
|
||||
local char = player.Character or player.CharacterAdded:Wait()
|
||||
char:WaitForChild("HumanoidRootPart", 30)
|
||||
local w = currentWorld()
|
||||
enterWorld(w, true)
|
||||
if loadingGui then
|
||||
loadingGui:SetAttribute("Title", placeTitle(w))
|
||||
loadingGui:SetAttribute("Ready", true)
|
||||
end
|
||||
end)
|
||||
|
||||
-- телепорт: экран загрузки закрывает картинку, сервер переносит персонажа, свет новой локации ставится сразу
|
||||
local teleportToken = 0
|
||||
local function teleportLoading(targetId, delay)
|
||||
teleportToken += 1
|
||||
local token = teleportToken
|
||||
local target = Config.Find(Config.Worlds, targetId)
|
||||
if loadingGui then
|
||||
local now = os.clock()
|
||||
loadingGui:SetAttribute("Ready", false)
|
||||
loadingGui:SetAttribute("StartAt", now)
|
||||
loadingGui:SetAttribute("MinUntil", now + Config.Loading.teleport)
|
||||
loadingGui:SetAttribute("Title", placeTitle(target))
|
||||
loadingGui:SetAttribute("Visible", true)
|
||||
end
|
||||
task.spawn(function()
|
||||
-- ждём, пока персонаж окажется в новой локации (или сдаёмся через пару секунд)
|
||||
local deadline = os.clock() + delay + 3
|
||||
local w
|
||||
repeat
|
||||
task.wait()
|
||||
w = currentWorld()
|
||||
until (w and w.id or "Lobby") == targetId or os.clock() > deadline or token ~= teleportToken
|
||||
if token ~= teleportToken then
|
||||
return
|
||||
end
|
||||
enterWorld(w, true)
|
||||
if loadingGui then
|
||||
loadingGui:SetAttribute("Ready", true)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
task.spawn(function()
|
||||
while true do
|
||||
local w = currentWorld()
|
||||
local id = w and w.id or "lobby"
|
||||
if id ~= lastWorldId then
|
||||
lastWorldId = id
|
||||
applyAmbience(w)
|
||||
if w then
|
||||
notify(w.icon .. " " .. w.name, w.color)
|
||||
end
|
||||
if id ~= lastWorldId and lastWorldId ~= "none" and not loadingVisible() then
|
||||
enterWorld(w, false) -- без телепорта (например, после возрождения): плавно
|
||||
end
|
||||
local cam = workspace.CurrentCamera
|
||||
if cam then
|
||||
@@ -1785,10 +1868,11 @@ local function guideMarker(name)
|
||||
return m and m.Position
|
||||
end
|
||||
|
||||
-- объект цели подсвечивается голубым (атрибут GuideTarget ставит MapBuilder)
|
||||
-- объект цели обводится мягким светящимся контуром (атрибут GuideTarget ставит MapBuilder);
|
||||
-- Occluded: то, что стоит перед объектом (персонаж на мостике), не перекрашивается
|
||||
local guideHighlight = new("Highlight", {
|
||||
FillColor = Color3.fromRGB(70, 195, 255), OutlineColor = Color3.fromRGB(170, 235, 255),
|
||||
DepthMode = Enum.HighlightDepthMode.AlwaysOnTop, Enabled = false, Parent = guideFolder,
|
||||
FillColor = Color3.fromRGB(150, 225, 255), OutlineColor = Color3.fromRGB(190, 240, 255),
|
||||
DepthMode = Enum.HighlightDepthMode.Occluded, Enabled = false, Parent = guideFolder,
|
||||
})
|
||||
local guideObjects, guideScanAt = {}, {}
|
||||
local function guideObject(key)
|
||||
@@ -2011,8 +2095,8 @@ RunService.RenderStepped:Connect(function()
|
||||
guideHighlight.Enabled = target ~= nil
|
||||
if target then
|
||||
local pulse = (math.sin(os.clock() * 4) + 1) / 2 -- мягкое мигание
|
||||
guideHighlight.FillTransparency = 0.45 + 0.3 * pulse
|
||||
guideHighlight.OutlineTransparency = 0.3 * pulse
|
||||
guideHighlight.FillTransparency = 0.86 + 0.1 * pulse -- лёгкое «дыхание», цвет объекта виден
|
||||
guideHighlight.OutlineTransparency = 0.1 + 0.45 * pulse
|
||||
end
|
||||
if not route or #route == 0 or state ~= "idle" then
|
||||
hideChevrons(1)
|
||||
@@ -2426,6 +2510,8 @@ end)()
|
||||
remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
if action == "Notify" then
|
||||
notify(a, b)
|
||||
elseif action == "TeleportFade" then
|
||||
teleportLoading(a, b)
|
||||
elseif action == "Cast" then
|
||||
setState("waiting")
|
||||
startCastCam(a, b)
|
||||
|
||||
@@ -62,20 +62,29 @@ local function ensure(class, parent, props)
|
||||
return obj
|
||||
end
|
||||
|
||||
-- Базовый свет при запуске игры (совпадает со светом лобби). Под каждую локацию его меняет клиент
|
||||
-- по полям look из FishConfig, пока игрок за экраном загрузки.
|
||||
function Builder.applyLighting()
|
||||
Lighting.ClockTime = 14.5
|
||||
Lighting.Brightness = 2.3
|
||||
Lighting.Ambient = Color3.fromRGB(70, 70, 85)
|
||||
Lighting.OutdoorAmbient = Color3.fromRGB(140, 145, 160)
|
||||
Lighting.EnvironmentDiffuseScale = 0.6
|
||||
Lighting.EnvironmentSpecularScale = 0.8
|
||||
Lighting.ClockTime = 16.3
|
||||
Lighting.Brightness = 2.0
|
||||
Lighting.ExposureCompensation = -0.3
|
||||
Lighting.Ambient = Color3.fromRGB(64, 60, 72)
|
||||
Lighting.OutdoorAmbient = Color3.fromRGB(120, 114, 124)
|
||||
Lighting.ColorShift_Top = Color3.fromRGB(255, 224, 186)
|
||||
Lighting.EnvironmentDiffuseScale = 0.5
|
||||
Lighting.EnvironmentSpecularScale = 0.5
|
||||
Lighting.GlobalShadows = true
|
||||
ensure("Atmosphere", Lighting, {
|
||||
Density = 0.25, Offset = 0.12, Glare = 0, Haze = 0.6,
|
||||
Color = Color3.fromRGB(200, 215, 232), Decay = Color3.fromRGB(110, 140, 175),
|
||||
Density = 0.4, Offset = 0.18, Glare = 0.25, Haze = 1.6,
|
||||
Color = Color3.fromRGB(222, 212, 204), Decay = Color3.fromRGB(186, 160, 150),
|
||||
})
|
||||
ensure("BloomEffect", Lighting, { Intensity = 0.5, Size = 24, Threshold = 1.4 })
|
||||
ensure("ColorCorrectionEffect", Lighting, { Saturation = 0.15, Contrast = 0.06, Brightness = 0.02 })
|
||||
ensure("SunRaysEffect", Lighting, { Intensity = 0.05, Spread = 0.8 })
|
||||
ensure("BloomEffect", Lighting, { Intensity = 0.3, Size = 24, Threshold = 1.8 })
|
||||
ensure("ColorCorrectionEffect", Lighting, {
|
||||
Saturation = 0.18, Contrast = 0.14, Brightness = -0.04, TintColor = Color3.fromRGB(255, 242, 228),
|
||||
})
|
||||
ensure("SunRaysEffect", Lighting, { Intensity = 0.05, Spread = 0.7 })
|
||||
-- размытие дальнего плана включают миры и лобби через look.dof
|
||||
ensure("DepthOfFieldEffect", Lighting, { Enabled = false, FarIntensity = 0.18, FocusDistance = 55, InFocusRadius = 95, NearIntensity = 0 })
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- помощники
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
|
||||
<Item class="LocalScript" referent="RBX1"><Properties><string name="Name">Loading</string><ProtectedString name="Source"><![CDATA[-- Loading (LocalScript) -> ReplicatedFirst
|
||||
-- Экран загрузки. Закрывает картинку при входе в игру и при каждом телепорте: игрок уже стоит на месте,
|
||||
-- сцена прогружается, клиент ставит свет локации — и только потом экран плавно уходит.
|
||||
--
|
||||
-- FishingClient управляет экраном через атрибуты ScreenGui «LoadingScreen»:
|
||||
-- Visible = true — показать (при телепорте);
|
||||
-- Ready = true — свет и террейн локации выставлены;
|
||||
-- StartAt / MinUntil — os.clock() начала и минимального конца показа (полоска заполняется за это время);
|
||||
-- Title — подпись под названием игры (куда идём).
|
||||
-- Экран уходит, когда Ready = true и минимальное время прошло.
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local ReplicatedFirst = game:GetService("ReplicatedFirst")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local RunService = game:GetService("RunService")
|
||||
local TweenService = game:GetService("TweenService")
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
pcall(function() ReplicatedFirst:RemoveDefaultLoadingScreen() end)
|
||||
|
||||
local GOLD = Color3.fromRGB(255, 205, 90)
|
||||
local TIPS = {
|
||||
"Чем реже рыба, тем быстрее бегает метка — нужна точность!",
|
||||
"Улучшай удочку в магазине: рыба клюёт быстрее, удача выше.",
|
||||
"Собери все виды одной редкости — получишь награду в коллекции (C).",
|
||||
"Каждый день заходи за наградой из сундука в лобби.",
|
||||
"Новые миры открываются с уровнем: следи за опытом!",
|
||||
}
|
||||
|
||||
local function new(class, props)
|
||||
local o = Instance.new(class)
|
||||
for k, v in pairs(props) do
|
||||
if k ~= "Parent" then
|
||||
o[k] = v
|
||||
end
|
||||
end
|
||||
o.Parent = props.Parent
|
||||
return o
|
||||
end
|
||||
|
||||
local gui = new("ScreenGui", {
|
||||
Name = "LoadingScreen", ResetOnSpawn = false, IgnoreGuiInset = true, DisplayOrder = 200,
|
||||
ZIndexBehavior = Enum.ZIndexBehavior.Sibling, Parent = player:WaitForChild("PlayerGui"),
|
||||
})
|
||||
-- фон: арт лобби (временная заглушка); пока картинка грузится, виден тёплый закатный градиент
|
||||
local BG_IMAGE = "rbxassetid://118616665961176"
|
||||
local root = new("CanvasGroup", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.fromRGB(255, 190, 120), BorderSizePixel = 0, Parent = gui })
|
||||
new("UIGradient", {
|
||||
Rotation = 90,
|
||||
Color = ColorSequence.new(Color3.fromRGB(120, 200, 255), Color3.fromRGB(255, 170, 110)),
|
||||
Parent = root,
|
||||
})
|
||||
local bg = new("ImageLabel", {
|
||||
Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Image = BG_IMAGE,
|
||||
ScaleType = Enum.ScaleType.Crop, Parent = root,
|
||||
})
|
||||
task.spawn(function()
|
||||
pcall(function() game:GetService("ContentProvider"):PreloadAsync({ bg }) end)
|
||||
end)
|
||||
|
||||
-- плашка снизу: куда идём, полоска загрузки, совет
|
||||
local panel = new("Frame", {
|
||||
AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -28), Size = UDim2.fromOffset(560, 118),
|
||||
BackgroundColor3 = Color3.fromRGB(70, 40, 22), BackgroundTransparency = 0.18, BorderSizePixel = 0, Parent = root,
|
||||
})
|
||||
new("UICorner", { CornerRadius = UDim.new(0, 18), Parent = panel })
|
||||
new("UIStroke", { Color = GOLD, Thickness = 3, Transparency = 0.1, Parent = panel })
|
||||
new("UIGradient", {
|
||||
Rotation = 90,
|
||||
Color = ColorSequence.new(Color3.fromRGB(150, 95, 50), Color3.fromRGB(95, 55, 28)),
|
||||
Parent = panel,
|
||||
})
|
||||
local float = new("TextLabel", {
|
||||
AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(44, 32), Size = UDim2.fromOffset(46, 46),
|
||||
BackgroundTransparency = 1, Text = "🎣", TextScaled = true, Font = Enum.Font.FredokaOne, Parent = panel,
|
||||
})
|
||||
local title = new("TextLabel", {
|
||||
Position = UDim2.fromOffset(78, 12), Size = UDim2.new(1, -96, 0, 38), BackgroundTransparency = 1,
|
||||
Text = "", TextColor3 = Color3.fromRGB(255, 240, 200), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Left,
|
||||
Font = Enum.Font.FredokaOne, Parent = panel,
|
||||
})
|
||||
new("UIStroke", { Color = Color3.fromRGB(60, 30, 10), Thickness = 2, Parent = title })
|
||||
local barBack = new("Frame", {
|
||||
AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 62), Size = UDim2.new(1, -36, 0, 16),
|
||||
BackgroundColor3 = Color3.fromRGB(40, 22, 10), BackgroundTransparency = 0.15, BorderSizePixel = 0, Parent = panel,
|
||||
})
|
||||
new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = barBack })
|
||||
local bar = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = GOLD, BorderSizePixel = 0, Parent = barBack })
|
||||
new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = bar })
|
||||
new("UIGradient", { Color = ColorSequence.new(Color3.fromRGB(255, 230, 120), Color3.fromRGB(255, 160, 60)), Parent = bar })
|
||||
local tip = new("TextLabel", {
|
||||
Position = UDim2.fromOffset(18, 86), Size = UDim2.new(1, -36, 0, 22), BackgroundTransparency = 1,
|
||||
Text = "", TextColor3 = Color3.fromRGB(255, 228, 185), TextScaled = true,
|
||||
Font = Enum.Font.GothamMedium, Parent = panel,
|
||||
})
|
||||
|
||||
local rng = Random.new()
|
||||
local function showTip()
|
||||
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
||||
end
|
||||
|
||||
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
||||
local now = os.clock()
|
||||
gui:SetAttribute("Visible", true)
|
||||
gui:SetAttribute("Ready", false)
|
||||
gui:SetAttribute("StartAt", now)
|
||||
gui:SetAttribute("MinUntil", now + 3)
|
||||
gui:SetAttribute("Title", "Загрузка…")
|
||||
showTip()
|
||||
|
||||
task.spawn(function()
|
||||
if not game:IsLoaded() then
|
||||
game.Loaded:Wait()
|
||||
end
|
||||
local ok, Config = pcall(require, ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
if ok and Config.Loading then
|
||||
gui:SetAttribute("MinUntil", gui:GetAttribute("StartAt") + Config.Loading.firstJoin)
|
||||
end
|
||||
end)
|
||||
|
||||
local hiding = false
|
||||
gui:GetAttributeChangedSignal("Visible"):Connect(function()
|
||||
-- новый телепорт мог прийти, пока экран ещё уходил: тогда возвращаем его
|
||||
if gui:GetAttribute("Visible") and (hiding or not gui.Enabled) then
|
||||
hiding = false
|
||||
showTip()
|
||||
gui.Enabled = true
|
||||
TweenService:Create(root, TweenInfo.new(0.25), { GroupTransparency = 0 }):Play()
|
||||
end
|
||||
end)
|
||||
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
||||
title.Text = gui:GetAttribute("Title") or ""
|
||||
end)
|
||||
title.Text = gui:GetAttribute("Title")
|
||||
|
||||
RunService.RenderStepped:Connect(function()
|
||||
if not gui.Enabled then
|
||||
return
|
||||
end
|
||||
local t = os.clock()
|
||||
float.Rotation = math.sin(t * 2.2) * 12
|
||||
float.Position = UDim2.fromOffset(44, 32 + math.sin(t * 3) * 3)
|
||||
local startAt, minUntil = gui:GetAttribute("StartAt") or t, gui:GetAttribute("MinUntil") or t
|
||||
local p = math.clamp((t - startAt) / math.max(0.01, minUntil - startAt), 0, 1)
|
||||
local ready = gui:GetAttribute("Ready") == true
|
||||
if not ready then
|
||||
p = math.min(p, 0.95) -- пока локация не готова, полоска не доходит до конца
|
||||
end
|
||||
bar.Size = UDim2.fromScale(p, 1)
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
if ready and hrp and t >= minUntil and not hiding then
|
||||
hiding = true
|
||||
local tw = TweenService:Create(root, TweenInfo.new(0.6), { GroupTransparency = 1 })
|
||||
tw.Completed:Connect(function()
|
||||
if hiding then
|
||||
gui.Enabled = false
|
||||
gui:SetAttribute("Visible", false)
|
||||
end
|
||||
end)
|
||||
tw:Play()
|
||||
end
|
||||
end)
|
||||
]]></ProtectedString></Properties></Item>
|
||||
</roblox>
|
||||
+312
-33
@@ -85,6 +85,13 @@ Config.Worlds = {
|
||||
}
|
||||
Config.WorldRadius = 260
|
||||
|
||||
-- экран загрузки: при входе в игру и при каждом телепорте игрок уже стоит на месте, сцена прогружается
|
||||
-- и свет локации ставится под ним; картинку видно только после этого (секунды — минимум показа)
|
||||
Config.Loading = {
|
||||
firstJoin = 3,
|
||||
teleport = 2.5,
|
||||
}
|
||||
|
||||
-- лобби: те же поля внешнего вида, что у миров (clock, tint, look, terrainColors); клиент применяет их вне миров
|
||||
Config.Lobby = {
|
||||
id = "Lobby",
|
||||
@@ -2255,6 +2262,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
|
||||
@@ -2281,9 +2294,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
|
||||
|
||||
@@ -3713,20 +3734,29 @@ local function ensure(class, parent, props)
|
||||
return obj
|
||||
end
|
||||
|
||||
-- Базовый свет при запуске игры (совпадает со светом лобби). Под каждую локацию его меняет клиент
|
||||
-- по полям look из FishConfig, пока игрок за экраном загрузки.
|
||||
function Builder.applyLighting()
|
||||
Lighting.ClockTime = 14.5
|
||||
Lighting.Brightness = 2.3
|
||||
Lighting.Ambient = Color3.fromRGB(70, 70, 85)
|
||||
Lighting.OutdoorAmbient = Color3.fromRGB(140, 145, 160)
|
||||
Lighting.EnvironmentDiffuseScale = 0.6
|
||||
Lighting.EnvironmentSpecularScale = 0.8
|
||||
Lighting.ClockTime = 16.3
|
||||
Lighting.Brightness = 2.0
|
||||
Lighting.ExposureCompensation = -0.3
|
||||
Lighting.Ambient = Color3.fromRGB(64, 60, 72)
|
||||
Lighting.OutdoorAmbient = Color3.fromRGB(120, 114, 124)
|
||||
Lighting.ColorShift_Top = Color3.fromRGB(255, 224, 186)
|
||||
Lighting.EnvironmentDiffuseScale = 0.5
|
||||
Lighting.EnvironmentSpecularScale = 0.5
|
||||
Lighting.GlobalShadows = true
|
||||
ensure("Atmosphere", Lighting, {
|
||||
Density = 0.25, Offset = 0.12, Glare = 0, Haze = 0.6,
|
||||
Color = Color3.fromRGB(200, 215, 232), Decay = Color3.fromRGB(110, 140, 175),
|
||||
Density = 0.4, Offset = 0.18, Glare = 0.25, Haze = 1.6,
|
||||
Color = Color3.fromRGB(222, 212, 204), Decay = Color3.fromRGB(186, 160, 150),
|
||||
})
|
||||
ensure("BloomEffect", Lighting, { Intensity = 0.5, Size = 24, Threshold = 1.4 })
|
||||
ensure("ColorCorrectionEffect", Lighting, { Saturation = 0.15, Contrast = 0.06, Brightness = 0.02 })
|
||||
ensure("SunRaysEffect", Lighting, { Intensity = 0.05, Spread = 0.8 })
|
||||
ensure("BloomEffect", Lighting, { Intensity = 0.3, Size = 24, Threshold = 1.8 })
|
||||
ensure("ColorCorrectionEffect", Lighting, {
|
||||
Saturation = 0.18, Contrast = 0.14, Brightness = -0.04, TintColor = Color3.fromRGB(255, 242, 228),
|
||||
})
|
||||
ensure("SunRaysEffect", Lighting, { Intensity = 0.05, Spread = 0.7 })
|
||||
-- размытие дальнего плана включают миры и лобби через look.dof
|
||||
ensure("DepthOfFieldEffect", Lighting, { Enabled = false, FarIntensity = 0.18, FocusDistance = 55, InFocusRadius = 95, NearIntensity = 0 })
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- помощники
|
||||
@@ -6983,7 +7013,21 @@ local lookDefaults = {}
|
||||
local lookSources = table.clone(Config.Worlds)
|
||||
table.insert(lookSources, Config.Lobby)
|
||||
|
||||
local function applyLook(world)
|
||||
-- смена света: плавно или сразу (за экраном загрузки)
|
||||
local lookTweens = {}
|
||||
local function setLook(obj, goal, instant)
|
||||
if instant then
|
||||
for prop, v in pairs(goal) do
|
||||
obj[prop] = v
|
||||
end
|
||||
else
|
||||
local tw = TweenService:Create(obj, TweenInfo.new(2), goal)
|
||||
table.insert(lookTweens, tw)
|
||||
tw:Play()
|
||||
end
|
||||
end
|
||||
|
||||
local function applyLook(world, instant)
|
||||
-- исходные значения запоминаем до первой правки; эффект мог ещё не прийти с сервера, тогда в следующий раз
|
||||
for _, w in ipairs(lookSources) do
|
||||
for section, props in pairs(w.look or {}) do
|
||||
@@ -7010,18 +7054,23 @@ local function applyLook(world)
|
||||
local kind = typeof(v)
|
||||
if kind == "number" or kind == "Color3" then goal[prop] = v else obj[prop] = v end
|
||||
end
|
||||
TweenService:Create(obj, TweenInfo.new(2), goal):Play()
|
||||
setLook(obj, goal, instant)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function applyAmbience(world)
|
||||
local function applyAmbience(world, instant)
|
||||
-- прошлая плавная смена ещё может идти — она перебила бы новые значения
|
||||
for _, tw in ipairs(lookTweens) do
|
||||
tw:Cancel()
|
||||
end
|
||||
table.clear(lookTweens)
|
||||
world = world or Config.Lobby
|
||||
local clock = (world and world.clock) or 14.5
|
||||
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
||||
setLook(Lighting, { ClockTime = clock }, instant)
|
||||
local cc = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||
if cc then
|
||||
TweenService:Create(cc, TweenInfo.new(2), { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }):Play()
|
||||
setLook(cc, { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }, instant)
|
||||
end
|
||||
-- цвета материалов террейна общие для всей карты, поэтому меняем их только у себя и возвращаем при выходе
|
||||
if not defaultTerrainColors then
|
||||
@@ -7037,12 +7086,12 @@ local function applyAmbience(world)
|
||||
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
||||
if atm then
|
||||
local frost = world and world.id == "World3"
|
||||
TweenService:Create(atm, TweenInfo.new(2), {
|
||||
setLook(atm, {
|
||||
Density = frost and 0.38 or 0.25,
|
||||
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
|
||||
}):Play()
|
||||
}, instant)
|
||||
end
|
||||
applyLook(world)
|
||||
applyLook(world, instant)
|
||||
snow.Rate = (world and world.id == "World3") and 140 or 0
|
||||
end
|
||||
|
||||
@@ -7098,16 +7147,80 @@ do
|
||||
end)
|
||||
end
|
||||
|
||||
-- экран загрузки (ReplicatedFirst/Loading): при входе и телепорте свет локации ставится, пока он закрывает картинку
|
||||
local loadingGui = player:WaitForChild("PlayerGui"):WaitForChild("LoadingScreen", 10)
|
||||
local function loadingVisible()
|
||||
return loadingGui ~= nil and loadingGui.Enabled
|
||||
end
|
||||
|
||||
local function placeTitle(w)
|
||||
return w and (w.icon .. " " .. w.name) or "🏠 Лобби"
|
||||
end
|
||||
|
||||
local function enterWorld(w, instant)
|
||||
lastWorldId = w and w.id or "lobby"
|
||||
applyAmbience(w, instant)
|
||||
if w then
|
||||
-- название локации — когда экран загрузки уже ушёл
|
||||
task.spawn(function()
|
||||
while loadingVisible() do
|
||||
task.wait(0.1)
|
||||
end
|
||||
notify(w.icon .. " " .. w.name, w.color)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
-- первое появление: ждём персонажа, ставим свет его локации сразу и отпускаем экран загрузки
|
||||
task.spawn(function()
|
||||
local char = player.Character or player.CharacterAdded:Wait()
|
||||
char:WaitForChild("HumanoidRootPart", 30)
|
||||
local w = currentWorld()
|
||||
enterWorld(w, true)
|
||||
if loadingGui then
|
||||
loadingGui:SetAttribute("Title", placeTitle(w))
|
||||
loadingGui:SetAttribute("Ready", true)
|
||||
end
|
||||
end)
|
||||
|
||||
-- телепорт: экран загрузки закрывает картинку, сервер переносит персонажа, свет новой локации ставится сразу
|
||||
local teleportToken = 0
|
||||
local function teleportLoading(targetId, delay)
|
||||
teleportToken += 1
|
||||
local token = teleportToken
|
||||
local target = Config.Find(Config.Worlds, targetId)
|
||||
if loadingGui then
|
||||
local now = os.clock()
|
||||
loadingGui:SetAttribute("Ready", false)
|
||||
loadingGui:SetAttribute("StartAt", now)
|
||||
loadingGui:SetAttribute("MinUntil", now + Config.Loading.teleport)
|
||||
loadingGui:SetAttribute("Title", placeTitle(target))
|
||||
loadingGui:SetAttribute("Visible", true)
|
||||
end
|
||||
task.spawn(function()
|
||||
-- ждём, пока персонаж окажется в новой локации (или сдаёмся через пару секунд)
|
||||
local deadline = os.clock() + delay + 3
|
||||
local w
|
||||
repeat
|
||||
task.wait()
|
||||
w = currentWorld()
|
||||
until (w and w.id or "Lobby") == targetId or os.clock() > deadline or token ~= teleportToken
|
||||
if token ~= teleportToken then
|
||||
return
|
||||
end
|
||||
enterWorld(w, true)
|
||||
if loadingGui then
|
||||
loadingGui:SetAttribute("Ready", true)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
task.spawn(function()
|
||||
while true do
|
||||
local w = currentWorld()
|
||||
local id = w and w.id or "lobby"
|
||||
if id ~= lastWorldId then
|
||||
lastWorldId = id
|
||||
applyAmbience(w)
|
||||
if w then
|
||||
notify(w.icon .. " " .. w.name, w.color)
|
||||
end
|
||||
if id ~= lastWorldId and lastWorldId ~= "none" and not loadingVisible() then
|
||||
enterWorld(w, false) -- без телепорта (например, после возрождения): плавно
|
||||
end
|
||||
local cam = workspace.CurrentCamera
|
||||
if cam then
|
||||
@@ -7192,10 +7305,11 @@ local function guideMarker(name)
|
||||
return m and m.Position
|
||||
end
|
||||
|
||||
-- объект цели подсвечивается голубым (атрибут GuideTarget ставит MapBuilder)
|
||||
-- объект цели обводится мягким светящимся контуром (атрибут GuideTarget ставит MapBuilder);
|
||||
-- Occluded: то, что стоит перед объектом (персонаж на мостике), не перекрашивается
|
||||
local guideHighlight = new("Highlight", {
|
||||
FillColor = Color3.fromRGB(70, 195, 255), OutlineColor = Color3.fromRGB(170, 235, 255),
|
||||
DepthMode = Enum.HighlightDepthMode.AlwaysOnTop, Enabled = false, Parent = guideFolder,
|
||||
FillColor = Color3.fromRGB(150, 225, 255), OutlineColor = Color3.fromRGB(190, 240, 255),
|
||||
DepthMode = Enum.HighlightDepthMode.Occluded, Enabled = false, Parent = guideFolder,
|
||||
})
|
||||
local guideObjects, guideScanAt = {}, {}
|
||||
local function guideObject(key)
|
||||
@@ -7418,8 +7532,8 @@ RunService.RenderStepped:Connect(function()
|
||||
guideHighlight.Enabled = target ~= nil
|
||||
if target then
|
||||
local pulse = (math.sin(os.clock() * 4) + 1) / 2 -- мягкое мигание
|
||||
guideHighlight.FillTransparency = 0.45 + 0.3 * pulse
|
||||
guideHighlight.OutlineTransparency = 0.3 * pulse
|
||||
guideHighlight.FillTransparency = 0.86 + 0.1 * pulse -- лёгкое «дыхание», цвет объекта виден
|
||||
guideHighlight.OutlineTransparency = 0.1 + 0.45 * pulse
|
||||
end
|
||||
if not route or #route == 0 or state ~= "idle" then
|
||||
hideChevrons(1)
|
||||
@@ -7833,6 +7947,8 @@ end)()
|
||||
remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
if action == "Notify" then
|
||||
notify(a, b)
|
||||
elseif action == "TeleportFade" then
|
||||
teleportLoading(a, b)
|
||||
elseif action == "Cast" then
|
||||
setState("waiting")
|
||||
startCastCam(a, b)
|
||||
@@ -7924,4 +8040,167 @@ end)
|
||||
|
||||
remote:FireServer("RequestInventory")
|
||||
]=====])
|
||||
print('DONE! 7 scripts installed. Press Play (F5).')
|
||||
make('LocalScript', 'Loading', game.ReplicatedFirst, [=====[-- Loading (LocalScript) -> ReplicatedFirst
|
||||
-- Экран загрузки. Закрывает картинку при входе в игру и при каждом телепорте: игрок уже стоит на месте,
|
||||
-- сцена прогружается, клиент ставит свет локации — и только потом экран плавно уходит.
|
||||
--
|
||||
-- FishingClient управляет экраном через атрибуты ScreenGui «LoadingScreen»:
|
||||
-- Visible = true — показать (при телепорте);
|
||||
-- Ready = true — свет и террейн локации выставлены;
|
||||
-- StartAt / MinUntil — os.clock() начала и минимального конца показа (полоска заполняется за это время);
|
||||
-- Title — подпись под названием игры (куда идём).
|
||||
-- Экран уходит, когда Ready = true и минимальное время прошло.
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local ReplicatedFirst = game:GetService("ReplicatedFirst")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local RunService = game:GetService("RunService")
|
||||
local TweenService = game:GetService("TweenService")
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
pcall(function() ReplicatedFirst:RemoveDefaultLoadingScreen() end)
|
||||
|
||||
local GOLD = Color3.fromRGB(255, 205, 90)
|
||||
local TIPS = {
|
||||
"Чем реже рыба, тем быстрее бегает метка — нужна точность!",
|
||||
"Улучшай удочку в магазине: рыба клюёт быстрее, удача выше.",
|
||||
"Собери все виды одной редкости — получишь награду в коллекции (C).",
|
||||
"Каждый день заходи за наградой из сундука в лобби.",
|
||||
"Новые миры открываются с уровнем: следи за опытом!",
|
||||
}
|
||||
|
||||
local function new(class, props)
|
||||
local o = Instance.new(class)
|
||||
for k, v in pairs(props) do
|
||||
if k ~= "Parent" then
|
||||
o[k] = v
|
||||
end
|
||||
end
|
||||
o.Parent = props.Parent
|
||||
return o
|
||||
end
|
||||
|
||||
local gui = new("ScreenGui", {
|
||||
Name = "LoadingScreen", ResetOnSpawn = false, IgnoreGuiInset = true, DisplayOrder = 200,
|
||||
ZIndexBehavior = Enum.ZIndexBehavior.Sibling, Parent = player:WaitForChild("PlayerGui"),
|
||||
})
|
||||
-- фон: арт лобби (временная заглушка); пока картинка грузится, виден тёплый закатный градиент
|
||||
local BG_IMAGE = "rbxassetid://118616665961176"
|
||||
local root = new("CanvasGroup", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.fromRGB(255, 190, 120), BorderSizePixel = 0, Parent = gui })
|
||||
new("UIGradient", {
|
||||
Rotation = 90,
|
||||
Color = ColorSequence.new(Color3.fromRGB(120, 200, 255), Color3.fromRGB(255, 170, 110)),
|
||||
Parent = root,
|
||||
})
|
||||
local bg = new("ImageLabel", {
|
||||
Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Image = BG_IMAGE,
|
||||
ScaleType = Enum.ScaleType.Crop, Parent = root,
|
||||
})
|
||||
task.spawn(function()
|
||||
pcall(function() game:GetService("ContentProvider"):PreloadAsync({ bg }) end)
|
||||
end)
|
||||
|
||||
-- плашка снизу: куда идём, полоска загрузки, совет
|
||||
local panel = new("Frame", {
|
||||
AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -28), Size = UDim2.fromOffset(560, 118),
|
||||
BackgroundColor3 = Color3.fromRGB(70, 40, 22), BackgroundTransparency = 0.18, BorderSizePixel = 0, Parent = root,
|
||||
})
|
||||
new("UICorner", { CornerRadius = UDim.new(0, 18), Parent = panel })
|
||||
new("UIStroke", { Color = GOLD, Thickness = 3, Transparency = 0.1, Parent = panel })
|
||||
new("UIGradient", {
|
||||
Rotation = 90,
|
||||
Color = ColorSequence.new(Color3.fromRGB(150, 95, 50), Color3.fromRGB(95, 55, 28)),
|
||||
Parent = panel,
|
||||
})
|
||||
local float = new("TextLabel", {
|
||||
AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(44, 32), Size = UDim2.fromOffset(46, 46),
|
||||
BackgroundTransparency = 1, Text = "🎣", TextScaled = true, Font = Enum.Font.FredokaOne, Parent = panel,
|
||||
})
|
||||
local title = new("TextLabel", {
|
||||
Position = UDim2.fromOffset(78, 12), Size = UDim2.new(1, -96, 0, 38), BackgroundTransparency = 1,
|
||||
Text = "", TextColor3 = Color3.fromRGB(255, 240, 200), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Left,
|
||||
Font = Enum.Font.FredokaOne, Parent = panel,
|
||||
})
|
||||
new("UIStroke", { Color = Color3.fromRGB(60, 30, 10), Thickness = 2, Parent = title })
|
||||
local barBack = new("Frame", {
|
||||
AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 62), Size = UDim2.new(1, -36, 0, 16),
|
||||
BackgroundColor3 = Color3.fromRGB(40, 22, 10), BackgroundTransparency = 0.15, BorderSizePixel = 0, Parent = panel,
|
||||
})
|
||||
new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = barBack })
|
||||
local bar = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = GOLD, BorderSizePixel = 0, Parent = barBack })
|
||||
new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = bar })
|
||||
new("UIGradient", { Color = ColorSequence.new(Color3.fromRGB(255, 230, 120), Color3.fromRGB(255, 160, 60)), Parent = bar })
|
||||
local tip = new("TextLabel", {
|
||||
Position = UDim2.fromOffset(18, 86), Size = UDim2.new(1, -36, 0, 22), BackgroundTransparency = 1,
|
||||
Text = "", TextColor3 = Color3.fromRGB(255, 228, 185), TextScaled = true,
|
||||
Font = Enum.Font.GothamMedium, Parent = panel,
|
||||
})
|
||||
|
||||
local rng = Random.new()
|
||||
local function showTip()
|
||||
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
||||
end
|
||||
|
||||
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
||||
local now = os.clock()
|
||||
gui:SetAttribute("Visible", true)
|
||||
gui:SetAttribute("Ready", false)
|
||||
gui:SetAttribute("StartAt", now)
|
||||
gui:SetAttribute("MinUntil", now + 3)
|
||||
gui:SetAttribute("Title", "Загрузка…")
|
||||
showTip()
|
||||
|
||||
task.spawn(function()
|
||||
if not game:IsLoaded() then
|
||||
game.Loaded:Wait()
|
||||
end
|
||||
local ok, Config = pcall(require, ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
if ok and Config.Loading then
|
||||
gui:SetAttribute("MinUntil", gui:GetAttribute("StartAt") + Config.Loading.firstJoin)
|
||||
end
|
||||
end)
|
||||
|
||||
local hiding = false
|
||||
gui:GetAttributeChangedSignal("Visible"):Connect(function()
|
||||
-- новый телепорт мог прийти, пока экран ещё уходил: тогда возвращаем его
|
||||
if gui:GetAttribute("Visible") and (hiding or not gui.Enabled) then
|
||||
hiding = false
|
||||
showTip()
|
||||
gui.Enabled = true
|
||||
TweenService:Create(root, TweenInfo.new(0.25), { GroupTransparency = 0 }):Play()
|
||||
end
|
||||
end)
|
||||
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
||||
title.Text = gui:GetAttribute("Title") or ""
|
||||
end)
|
||||
title.Text = gui:GetAttribute("Title")
|
||||
|
||||
RunService.RenderStepped:Connect(function()
|
||||
if not gui.Enabled then
|
||||
return
|
||||
end
|
||||
local t = os.clock()
|
||||
float.Rotation = math.sin(t * 2.2) * 12
|
||||
float.Position = UDim2.fromOffset(44, 32 + math.sin(t * 3) * 3)
|
||||
local startAt, minUntil = gui:GetAttribute("StartAt") or t, gui:GetAttribute("MinUntil") or t
|
||||
local p = math.clamp((t - startAt) / math.max(0.01, minUntil - startAt), 0, 1)
|
||||
local ready = gui:GetAttribute("Ready") == true
|
||||
if not ready then
|
||||
p = math.min(p, 0.95) -- пока локация не готова, полоска не доходит до конца
|
||||
end
|
||||
bar.Size = UDim2.fromScale(p, 1)
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
if ready and hrp and t >= minUntil and not hiding then
|
||||
hiding = true
|
||||
local tw = TweenService:Create(root, TweenInfo.new(0.6), { GroupTransparency = 1 })
|
||||
tw.Completed:Connect(function()
|
||||
if hiding then
|
||||
gui.Enabled = false
|
||||
gui:SetAttribute("Visible", false)
|
||||
end
|
||||
end)
|
||||
tw:Play()
|
||||
end
|
||||
end)
|
||||
]=====])
|
||||
print('DONE! 8 scripts installed. Press Play (F5).')
|
||||
Reference in new issue
Block a user