Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9795cc50e | ||
|
|
dcf89d037a | ||
|
|
eabb45ca51 | ||
|
|
bea9df1ab8 | ||
|
|
15c64d9eb2 | ||
|
|
0972c05e3d | ||
|
|
6673d5b90d | ||
|
|
bae57661a9 | ||
|
|
b6f4ce020a |
No files matched your search
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"enabledMcpjsonServers": ["Roblox_Studio"]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# Developer Products
|
||||
|
||||
| Config key | Name | Description | Price (Robux) | Icon |
|
||||
|---|---|---|---:|---|
|
||||
| Coins1 | Мешок монет | Мгновенно получи 1 000 монет. Количество увеличивается с уровнем персонажа. | 49 | coins-pouch-1000.png |
|
||||
| Coins2 | Сундук монет | Мгновенно получи 5 000 монет. Количество увеличивается с уровнем персонажа. | 199 | coins-chest-5000.png |
|
||||
| Coins3 | Гора золота | Мгновенно получи 20 000 монет. Количество увеличивается с уровнем персонажа. | 599 | coins-mountain-20000.png |
|
||||
| Luck | Супер-зелье удачи | Увеличивает удачу на 200% на 15 минут. | 99 | luck-potion.png |
|
||||
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 1.6 MiB |
@@ -0,0 +1,8 @@
|
||||
# Game Passes
|
||||
|
||||
| Config key | Name | Description | Price (Robux) | Icon |
|
||||
|---|---|---|---:|---|
|
||||
| VIP | VIP | Навсегда: +25% к удаче и монетам, корона над персонажем. | 199 | vip-crown.png |
|
||||
| DoubleCoins | x2 Монеты | Навсегда: продажа каждой рыбы приносит в 2 раза больше монет. | 299 | double-coins.png |
|
||||
| LuckyCharm | Талисман удачи | Навсегда: +50% к удаче при ловле рыбы. | 349 | lucky-charm.png |
|
||||
| BigBag | Бездонная сумка | Навсегда: +100 мест к вместимости любой сумки. | 149 | big-bag.png |
|
||||
|
After Width: | Height: | Size: 2.0 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
@@ -0,0 +1,19 @@
|
||||
# Полный список платных предложений
|
||||
|
||||
## Game Passes
|
||||
|
||||
| Config key | Name | Description | Price (Robux) | Icon |
|
||||
|---|---|---|---:|---|
|
||||
| VIP | VIP | Навсегда: +25% к удаче и монетам, корона над персонажем. | 199 | GamePasses/vip-crown.png |
|
||||
| DoubleCoins | x2 Монеты | Навсегда: продажа каждой рыбы приносит в 2 раза больше монет. | 299 | GamePasses/double-coins.png |
|
||||
| LuckyCharm | Талисман удачи | Навсегда: +50% к удаче при ловле рыбы. | 349 | GamePasses/lucky-charm.png |
|
||||
| BigBag | Бездонная сумка | Навсегда: +100 мест к вместимости любой сумки. | 149 | GamePasses/big-bag.png |
|
||||
|
||||
## Developer Products
|
||||
|
||||
| Config key | Name | Description | Price (Robux) | Icon |
|
||||
|---|---|---|---:|---|
|
||||
| Coins1 | Мешок монет | Мгновенно получи 1 000 монет. Количество увеличивается с уровнем персонажа. | 49 | DeveloperProducts/coins-pouch-1000.png |
|
||||
| Coins2 | Сундук монет | Мгновенно получи 5 000 монет. Количество увеличивается с уровнем персонажа. | 199 | DeveloperProducts/coins-chest-5000.png |
|
||||
| Coins3 | Гора золота | Мгновенно получи 20 000 монет. Количество увеличивается с уровнем персонажа. | 599 | DeveloperProducts/coins-mountain-20000.png |
|
||||
| Luck | Супер-зелье удачи | Увеличивает удачу на 200% на 15 минут. | 99 | DeveloperProducts/luck-potion.png |
|
||||
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 1.9 MiB |
@@ -21,19 +21,23 @@ Config.Worlds = {
|
||||
-- свет и эффекты: свойства Lighting и его эффектов; чего здесь нет, остаётся как в MapBuilder
|
||||
look = {
|
||||
lighting = {
|
||||
Brightness = 2.6, ExposureCompensation = -0.15,
|
||||
-- днём солнце не выжигает светлый песок и траву: яркость и экспозиция ниже
|
||||
Brightness = 2.0, ExposureCompensation = -0.35,
|
||||
Ambient = Color3.fromRGB(62, 66, 84), OutdoorAmbient = Color3.fromRGB(105, 112, 132),
|
||||
ColorShift_Top = Color3.fromRGB(255, 232, 196),
|
||||
EnvironmentDiffuseScale = 0.6, EnvironmentSpecularScale = 0.8,
|
||||
EnvironmentDiffuseScale = 0.5, EnvironmentSpecularScale = 0.6,
|
||||
},
|
||||
-- дымка вдали: Density — сколько тумана, Haze — насколько он плотный у горизонта
|
||||
atmosphere = {
|
||||
Density = 0.38, Offset = 0.1, Haze = 1.2, Glare = 0.15,
|
||||
Color = Color3.fromRGB(188, 204, 224), Decay = Color3.fromRGB(196, 176, 160),
|
||||
},
|
||||
color = { Saturation = 0.28, Contrast = 0.2, Brightness = -0.02 },
|
||||
bloom = { Intensity = 0.45, Size = 28, Threshold = 1.2 },
|
||||
sunRays = { Intensity = 0.06, Spread = 0.6 },
|
||||
color = { Saturation = 0.16, Contrast = 0.12, Brightness = -0.04 },
|
||||
-- свечение только у по-настоящему ярких мест (огни ночью), без ореолов вокруг светлого днём
|
||||
bloom = { Intensity = 0.25, Size = 24, Threshold = 1.9 },
|
||||
sunRays = { Intensity = 0.05, Spread = 0.6 },
|
||||
-- мягкий тонмаппинг: светлое не выгорает в белое
|
||||
grading = { TonemapperPreset = Enum.TonemapperPreset.Default },
|
||||
-- лёгкое размытие дальнего плана
|
||||
dof = { Enabled = true, FarIntensity = 0.2, FocusDistance = 60, InFocusRadius = 120, NearIntensity = 0 },
|
||||
},
|
||||
@@ -76,6 +80,31 @@ Config.Worlds = {
|
||||
}
|
||||
Config.WorldRadius = 260
|
||||
|
||||
-- камера игрока: насколько близко и далеко можно отвести колесом (в studs);
|
||||
-- maxZoom держит обзор внутри локаций — дальше видно край карты
|
||||
Config.Camera = { minZoom = 0.5, maxZoom = 35 }
|
||||
|
||||
-- лента активности (слева внизу у всех игроков) и оповещения о редком улове
|
||||
-- announceRank / announceMutations — крупный баннер со звуком у всех на сервере;
|
||||
-- globalRank / globalMutations — улов уходит и на другие серверы игры (MessagingService);
|
||||
-- lines — сколько строк в ленте, lineTime — сколько секунд строка остаётся видна
|
||||
Config.Feed = {
|
||||
announceRank = 4, announceMutations = { Golden = true, Rainbow = true },
|
||||
globalRank = 5, globalMutations = { Rainbow = true },
|
||||
lines = 6, lineTime = 30,
|
||||
}
|
||||
|
||||
-- доски лидеров в лобби (глобальные, по всем серверам; обновляются раз в refresh секунд).
|
||||
-- attr — атрибут игрока, который считает сервер; store — имя OrderedDataStore (смена имени = новый топ с нуля)
|
||||
Config.Leaderboards = {
|
||||
refresh = 60, size = 10,
|
||||
boards = {
|
||||
{ id = "Donate", title = "💎 Топ донатеров", attr = "RobuxSpent", store = "TopRobux_v1", unit = "R$", color = Color3.fromRGB(205, 140, 255) },
|
||||
{ id = "Earn", title = "⚪ Топ по заработку", attr = "CoinsEarned", store = "TopEarned_v1", unit = "⚪", color = Color3.fromRGB(255, 214, 90) },
|
||||
{ id = "Catch", title = "🎣 Топ рыболовов", attr = "TotalCaught", store = "TopCaught_v1", unit = "🐟", color = Color3.fromRGB(120, 210, 255) },
|
||||
},
|
||||
}
|
||||
|
||||
-- экран загрузки: при входе в игру и при каждом телепорте игрок уже стоит на месте, сцена прогружается
|
||||
-- и свет локации ставится под ним; картинку видно только после этого (секунды — минимум показа)
|
||||
Config.Loading = {
|
||||
@@ -365,7 +394,7 @@ Config.QuestKinds = {
|
||||
perfectCast = { text = "Забрось в зелёную зону %d %s", forms = TIMES, coins = 8, xp = 6 },
|
||||
combo = { text = "Набери серию из %d рыб", coins = 12, xp = 10, max = 15 },
|
||||
sell = { text = "Продай %d %s", forms = FISH, coins = 3, xp = 3 },
|
||||
earn = { text = "Заработай %d 💰 на продаже", coins = 0.25, xp = 0.2, byLevel = true },
|
||||
earn = { text = "Заработай %d ⚪ на продаже", coins = 0.25, xp = 0.2, byLevel = true },
|
||||
buy = { text = "Купи что-нибудь в магазине", coins = 40, xp = 30, max = 1 },
|
||||
boss = { text = "Нанеси боссу %d урона", coins = 15, xp = 12 },
|
||||
}
|
||||
@@ -398,7 +427,7 @@ Config.Boss = {
|
||||
},
|
||||
}
|
||||
|
||||
-- ежедневная награда (7 дней по кругу), монеты растут с уровнем
|
||||
-- ежедневная награда (7 дней по кругу), серебро растёт с уровнем
|
||||
Config.DailyRewards = {
|
||||
{ coins = 100 },
|
||||
{ coins = 200 },
|
||||
@@ -414,26 +443,129 @@ Config.Events = {
|
||||
{ id = "Bite", name = "⚡ Клёвый час", desc = "Рыба клюёт в 2 раза быстрее", duration = 180, speed = 0.5 },
|
||||
{ id = "Luck", name = "🍀 Удачный ветер", desc = "Удача +50% для всех", duration = 180, luck = 0.5 },
|
||||
{ id = "Stars", name = "🌟 Звездопад", desc = "Мутации в 3 раза чаще", duration = 180, mutation = 3 },
|
||||
{ id = "Fair", name = "💰 Рыбная ярмарка", desc = "Рыба продаётся на 50% дороже", duration = 180, sell = 1.5 },
|
||||
{ id = "Fair", name = "🐟 Рыбная ярмарка", desc = "Рыба продаётся на 50% дороже", duration = 180, sell = 1.5 },
|
||||
}
|
||||
Config.EventFirstDelay = 120
|
||||
Config.EventGapMin = 420
|
||||
Config.EventGapMax = 720
|
||||
|
||||
---------------------------------------------------------------- время суток
|
||||
-- одни сутки длятся length секунд реального времени; время общее для всего сервера
|
||||
Config.DayNight = {
|
||||
enabled = true,
|
||||
length = 1200, -- 20 минут на сутки
|
||||
startClock = 9, -- во сколько начинается день при запуске сервера
|
||||
nightLuck = 0.10, -- ночью удача +10%
|
||||
}
|
||||
|
||||
-- время на часах в момент serverTime (workspace:GetServerTimeNow()), dayStart — атрибут workspace "DayStart"
|
||||
function Config.ClockAt(serverTime, dayStart)
|
||||
local d = Config.DayNight
|
||||
return (d.startClock + (serverTime - (dayStart or serverTime)) / d.length * 24) % 24
|
||||
end
|
||||
|
||||
-- 0 днём, 1 глубокой ночью, плавно на рассвете и закате
|
||||
function Config.Nightness(clock)
|
||||
if clock >= 7 and clock <= 17.5 then
|
||||
return 0
|
||||
elseif clock > 17.5 and clock < 20 then
|
||||
return (clock - 17.5) / 2.5
|
||||
elseif clock >= 5 and clock < 7 then
|
||||
return 1 - (clock - 5) / 2
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
function Config.IsNight(clock)
|
||||
return Config.Nightness(clock) >= 0.5
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- погода
|
||||
-- меняется на всём сервере; weight — как часто выпадает, duration — сколько длится (секунды)
|
||||
-- luck / speed / mutation — бонусы к рыбалке, пока погода держится
|
||||
-- names — как погода называется в отдельных мирах (во фьорде вместо дождя снег)
|
||||
Config.Weathers = {
|
||||
{ id = "Clear", name = "Ясно", icon = "☀", weight = 40, duration = { 240, 420 } },
|
||||
{ id = "Cloudy", name = "Пасмурно", icon = "☁", weight = 25, duration = { 180, 360 }, luck = 0.05, desc = "Удача +5%" },
|
||||
{ id = "Rain", name = "Дождь", icon = "🌧", weight = 20, duration = { 150, 300 }, speed = 0.85, desc = "Клюёт на 15% быстрее",
|
||||
names = { World3 = "Снегопад" } },
|
||||
{ id = "Storm", name = "Гроза", icon = "⛈", weight = 8, duration = { 120, 240 }, luck = 0.25, speed = 0.9, desc = "Удача +25%",
|
||||
names = { World3 = "Метель" } },
|
||||
{ id = "Fog", name = "Туман", icon = "🌫", weight = 7, duration = { 150, 300 }, mutation = 1.5, desc = "Мутации ×1.5" },
|
||||
}
|
||||
|
||||
function Config.WeatherById(id)
|
||||
for _, w in ipairs(Config.Weathers) do
|
||||
if w.id == id then
|
||||
return w
|
||||
end
|
||||
end
|
||||
return Config.Weathers[1]
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- звуки
|
||||
-- ID из Creator Store: эффекты — Pro Sound Effects (официальная библиотека Roblox),
|
||||
-- музыка — APM и DistroKid (лицензированы для Roblox). volume — громкость, pitch — разброс высоты
|
||||
local function S(id, volume, extra)
|
||||
local t = extra or {}
|
||||
t.id = "rbxassetid://" .. id
|
||||
t.volume = volume
|
||||
return t
|
||||
end
|
||||
Config.Sounds = {
|
||||
-- музыка
|
||||
musicLobby = S(137023744071437, 0.35), -- The Ancient Lutes | Medieval Tavern Music
|
||||
musicLobby2 = S(116079409060113, 0.35), -- The Lute Lament | Medieval Tavern Music
|
||||
musicLake = S(1838853377, 0.3), -- Harp Fantasy
|
||||
musicLake2 = S(86472274853159, 0.3), -- Calm Fantasy Atmosphere
|
||||
musicNight = S(140195397978848, 0.3), -- Moonlit Meadow Whisper
|
||||
-- окружение (петли)
|
||||
birdsLake = S(9112877174, 0.35), -- Squam Lake 1
|
||||
birdsPark = S(9113444360, 0.25), -- Birds Park 2
|
||||
birdsJungle = S(9114892930, 0.3), -- Jungle Birds Ambience 3
|
||||
crickets = S(9112764573, 0.3), -- Crickets Night 3
|
||||
lakeWater = S(9116203162, 0.25), -- Lake Lap Water Movement 2
|
||||
wind = S(9113286782, 0.18), -- Barstow Wind Light Blustery Low Howl 1
|
||||
rainLight = S(9112852668, 0.45), -- Rain Continuous Drizzle 1
|
||||
rainHeavy = S(9112853287, 0.55), -- Rain Heavy 1
|
||||
fire = S(9112780193, 0.6, { roll = 30 }), -- Fireplace Constant Burning Flame 1 (слышно у костра)
|
||||
thunder = { "rbxassetid://9116282875", "rbxassetid://9116282646", "rbxassetid://9116282791", "rbxassetid://9116282544" },
|
||||
-- рыбалка
|
||||
cast = S(9120718279, 0.5, { pitch = { 0.9, 1.1 } }), -- Whoosh Fast Swish By 1
|
||||
bite = S(9112751536, 0.7, { pitch = { 0.9, 1.15 } }), -- Bubble Bloop High Pitched Cute 1
|
||||
reel = S(9114454019, 0.4), -- Fishing Reel 4 (петля, пока тянешь)
|
||||
catchSplash = S(9119293555, 0.6), -- Small Splash Shallow Water
|
||||
catch = S(9126073001, 0.5), -- Bell Tone Ding
|
||||
fanfare = S(1836473422, 0.45), -- Victory Fanfare Sting (редкая рыба)
|
||||
sparkle = S(9114369623, 0.5), -- Fairy Dust 1 (мутация)
|
||||
escape = S(9117944976, 0.5), -- Puddle Splash 2 (сорвалась)
|
||||
-- интерфейс
|
||||
click = S(15675032796, 0.5), -- Roblox_UI_Small_Click
|
||||
open = S(9117231552, 0.45), -- Paper Scroll Unroll Handle 4
|
||||
coins = S(9113849306, 0.6), -- Coins Or Keys Jingle 1
|
||||
chestHop = S(9120718279, 0.35, { pitch = { 0.7, 0.8 } }), -- Whoosh Fast Swish By 1 (сундук награды подпрыгивает)
|
||||
chestLand = S(9113769181, 0.7, { pitch = { 0.95, 1.05 } }), -- Chair Drop 2: тяжёлый деревянный удар о землю
|
||||
levelUp = S(1840525342, 0.5), -- Harp Glissando (A)
|
||||
quest = S(9126073318, 0.5), -- Bell Tone Ding 2
|
||||
}
|
||||
Config.DefaultVolume = { music = 0.6, sfx = 0.8 }
|
||||
|
||||
---------------------------------------------------------------- донат (Robux)
|
||||
-- ВАЖНО: впиши сюда ID своих пропусков и товаров с create.roblox.com.
|
||||
-- Все товары — Developer Products игры (create.roblox.com → Monetization → Developer Products);
|
||||
-- id — Product ID оттуда, robux — цена для кнопки (должна совпадать с ценой в Roblox).
|
||||
-- Пропуска тоже Developer Products: покупаются один раз, сервер запоминает их в данных игрока навсегда.
|
||||
-- Пока id = 0, кнопка покупки покажет подсказку, что товар не настроен.
|
||||
Config.GamePasses = {
|
||||
{ key = "VIP", id = 0, robux = 199, icon = "👑", name = "VIP", desc = "+25% удачи и монет, корона над головой" },
|
||||
{ key = "DoubleCoins", id = 0, robux = 299, icon = "💰", name = "x2 Монеты", desc = "Вся рыба продаётся в 2 раза дороже" },
|
||||
{ key = "LuckyCharm", id = 0, robux = 349, icon = "🍀", name = "Талисман удачи", desc = "+50% удачи навсегда" },
|
||||
{ key = "BigBag", id = 0, robux = 149, icon = "🎒", name = "Бездонная сумка", desc = "+100 мест в любой сумке" },
|
||||
{ key = "VIP", id = 3728143641, robux = 199, icon = "👑", name = "VIP", desc = "+25% удачи и серебра, корона над головой" },
|
||||
{ key = "DoubleCoins", id = 3728143692, robux = 299, icon = "⚪", name = "x2 Серебро", desc = "Вся рыба продаётся в 2 раза дороже" },
|
||||
{ key = "LuckyCharm", id = 3728143735, robux = 349, icon = "🍀", name = "Талисман удачи", desc = "+50% удачи навсегда" },
|
||||
{ key = "BigBag", id = 3728143773, robux = 149, icon = "🎒", name = "Бездонная сумка", desc = "+100 мест в любой сумке" },
|
||||
}
|
||||
Config.Products = {
|
||||
{ key = "Coins1", id = 0, robux = 49, icon = "🪙", name = "Мешок монет", desc = "+1 000 монет (больше с уровнем)", coins = 1000 },
|
||||
{ key = "Coins2", id = 0, robux = 199, icon = "💰", name = "Сундук монет", desc = "+5 000 монет (больше с уровнем)", coins = 5000 },
|
||||
{ key = "Coins3", id = 0, robux = 599, icon = "🏆", name = "Гора золота", desc = "+20 000 монет (больше с уровнем)", coins = 20000 },
|
||||
{ key = "Luck", id = 0, robux = 99, icon = "🧪", name = "Супер-зелье удачи", desc = "+200% удачи на 15 минут", boost = 2.0, duration = 900 },
|
||||
{ key = "Coins1", id = 3728142264, robux = 49, icon = "👝", name = "Кошель серебра", desc = "+1 000 серебра (больше с уровнем)", coins = 1000 },
|
||||
{ key = "Coins2", id = 3728142848, robux = 199, icon = "⚪", name = "Сундук серебра", desc = "+5 000 серебра (больше с уровнем)", coins = 5000 },
|
||||
{ key = "Coins3", id = 3728142885, robux = 599, icon = "🏆", name = "Гора золота", desc = "+20 000 серебра (больше с уровнем)", coins = 20000 },
|
||||
{ key = "Luck", id = 3728142916, robux = 99, icon = "🧪", name = "Супер-зелье удачи", desc = "+200% удачи на 15 минут", boost = 2.0, duration = 900 },
|
||||
}
|
||||
|
||||
---------------------------------------------------------------- рыбалка
|
||||
@@ -454,8 +586,105 @@ Config.TutorialDone = 4
|
||||
function Config.HitsNeeded(rank)
|
||||
return math.ceil(rank / 2)
|
||||
end
|
||||
-- опыт до следующего уровня: до 8-го ≈ 3 600 (1,5–2 часа вместе с заказами гильдии);
|
||||
-- у старых сохранений уровень не понижается — копится только опыт внутри уровня
|
||||
function Config.XPForLevel(level)
|
||||
return 60 + level * 60
|
||||
return math.floor(50 * level ^ 1.6)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- гильдия рыбаков
|
||||
-- три валюты: серебро (coins в данных), жемчуг (pearls), печати гильдии (seals — копятся для ранга)
|
||||
Config.Pearls = {
|
||||
mutation = { Shiny = 1, Golden = 3, Rainbow = 10 }, -- за пойманную рыбу с мутацией
|
||||
boss = 5, -- за победу над боссом
|
||||
daily7 = 5, -- 7-й день ежедневной награды
|
||||
rankUp = 10, -- за новый ранг
|
||||
}
|
||||
|
||||
-- ранги: seals — сколько печатей нужно накопить, trial — испытание у Старейшины,
|
||||
-- orders — заказов на доске, traps — ловушек, discount — скидка у торговцев
|
||||
-- trial.kind: deliver (сдать рыбу из сумки), catch (поймать с условием), bossWin (участие в победе над боссом),
|
||||
-- dex (собрать коллекцию мира)
|
||||
Config.Guild = {
|
||||
elder = "Старейшина Ворон",
|
||||
ranks = {
|
||||
{ id = "F", name = "Ученик", seals = 0, orders = 3, color = Color3.fromRGB(150, 150, 150),
|
||||
unlocks = "Мир 1, доска заказов" },
|
||||
{ id = "E", name = "Подмастерье", seals = 30, orders = 4, color = Color3.fromRGB(90, 190, 90), auto = true,
|
||||
trial = { kind = "deliver", fish = "Okun", count = 5, text = "Сдать 5 окуней" },
|
||||
unlocks = "🎣 Автоловля, 4-й заказ на доске" },
|
||||
{ id = "D", name = "Рыбак", seals = 120, orders = 4, color = Color3.fromRGB(70, 130, 230), auto = true, traps = 1,
|
||||
trial = { kind = "catch", minRank = 3, weathers = { Rain = true, Storm = true }, count = 1, text = "Поймать «Редкую» рыбу в дождь или грозу" },
|
||||
unlocks = "🏝 Мир 2 (и ур. 8), 🧺 ловушка" },
|
||||
{ id = "C", name = "Опытный рыбак", seals = 350, orders = 4, color = Color3.fromRGB(150, 80, 200), auto = true, traps = 2, discount = 0.05,
|
||||
trial = { kind = "bossWin", count = 1, text = "Помочь одолеть босса озера" },
|
||||
unlocks = "🧺 2 ловушки, скидка у торговцев 5%" },
|
||||
{ id = "B", name = "Мастер", seals = 900, orders = 4, color = Color3.fromRGB(200, 50, 45), auto = true, traps = 3, discount = 0.05,
|
||||
trial = { kind = "dex", world = "World1", text = "Собрать всю коллекцию «Тихого озера»" },
|
||||
unlocks = "❄ Мир 3 (и ур. 18), 🧺 3 ловушки" },
|
||||
{ id = "A", name = "Магистр", seals = 2000, orders = 4, color = Color3.fromRGB(230, 180, 60), auto = true, traps = 3, discount = 0.10,
|
||||
trial = { kind = "catch", minRank = 4, night = true, count = 1, text = "Поймать «Эпическую» рыбу ночью" },
|
||||
unlocks = "Титул «Магистр», скидка 10%" },
|
||||
{ id = "S", name = "Легенда", seals = 4500, orders = 4, color = Color3.fromRGB(255, 120, 200), auto = true, traps = 3, discount = 0.10, autoNoCap = true,
|
||||
trial = { kind = "catch", minRank = 6, count = 1, text = "Поймать «Мифическую» рыбу" },
|
||||
unlocks = "Золотой жетон, автоловля без ограничения редкости" },
|
||||
},
|
||||
-- миры требуют и уровень, и ранг (номер в списке ranks)
|
||||
worldRank = { World2 = 3, World3 = 5 },
|
||||
elderDistance = 22, -- взять испытание / сдать рыбу — рядом со Старейшиной или доской
|
||||
}
|
||||
|
||||
-- заказы гильдии: личные, обновляются каждые period секунд (окно floor(os.time()/period)),
|
||||
-- один заказ можно перебросить за rerollPearls жемчуга. Награда растёт с рангом
|
||||
Config.Orders = {
|
||||
period = 10800,
|
||||
rerollPearls = 2,
|
||||
pearlChance = 0.2, pearlsMin = 1, pearlsMax = 3,
|
||||
coinsPerSeal = 12, -- серебро за заказ = печати × это × (1 + 0.5 · (ранг − 1))
|
||||
-- weight — как часто выпадает; seals — печати {мин, макс}
|
||||
kinds = {
|
||||
deliver = { weight = 3, seals = { 5, 12 } },
|
||||
heavy = { weight = 2, seals = { 8, 16 } },
|
||||
weather = { weight = 1, seals = { 10, 20 } },
|
||||
night = { weight = 1, seals = { 10, 22 } },
|
||||
combo = { weight = 2, seals = { 8, 18 } },
|
||||
perfect = { weight = 2, seals = { 6, 14 } },
|
||||
},
|
||||
}
|
||||
|
||||
-- наживка: 1 слот, 1 штука тратится на заброс. price — за пачку из pack штук; currency = "pearls" — за жемчуг
|
||||
Config.Baits = {
|
||||
{ id = "Worm", name = "Червь", icon = "🐛", price = 40, pack = 10, speed = 0.9, desc = "Клюёт на 10% быстрее" },
|
||||
{ id = "Larva", name = "Мотыль", icon = "🦐", price = 90, pack = 10, luck = 0.15, desc = "Удача +15%" },
|
||||
{ id = "Firefly", name = "Светлячок", icon = "✨", price = 120, pack = 10, nightLuck = 0.30, desc = "Ночью удача +30% (вместо +10%)" },
|
||||
{ id = "Blood", name = "Кровавая приманка", icon = "🩸", price = 400, pack = 10, rareWeight = 1.5, rank = 3, desc = "Редкие и выше попадаются в 1,5 раза чаще" },
|
||||
{ id = "Pearl", name = "Жемчужная блесна", icon = "🦪", price = 5, pack = 5, mutation = 2, currency = "pearls", desc = "Шанс мутаций ×2" },
|
||||
}
|
||||
|
||||
-- автоловля (с ранга E): сервер сам забрасывает и вытаскивает, но со штрафами
|
||||
Config.AutoFish = {
|
||||
luck = 0.6, -- удача ×0.6
|
||||
maxRarity = 3, -- не выше «Редкой» (ранг S снимает)
|
||||
slower = 1.5, -- каждая поимка на 50% дольше
|
||||
reel = 2.5, -- секунд «вываживания» вместо мини-игры
|
||||
}
|
||||
|
||||
-- ловушки-вентери (с ранга D): 1 рыба Мира 1 каждые every секунд, не больше max, копятся и офлайн
|
||||
Config.Traps = {
|
||||
every = 900, max = 16,
|
||||
world = "World1", rarities = { Common = 3, Uncommon = 1 }, -- вес редкостей
|
||||
}
|
||||
|
||||
-- отдых: пока игрока нет, копится двойной опыт — 1 минута за каждые perOffline минут офлайн, не больше max
|
||||
Config.Rest = { perOffline = 4, max = 3600, mult = 2 }
|
||||
|
||||
function Config.RankById(id)
|
||||
for i, r in ipairs(Config.Guild.ranks) do
|
||||
if r.id == id then
|
||||
return r, i
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- помощники
|
||||
|
||||
@@ -14,11 +14,57 @@ local Debris = game:GetService("Debris")
|
||||
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
local Models = require(ReplicatedStorage:WaitForChild("GameModels"))
|
||||
local Guild = require(script.Parent:WaitForChild("Guild"))
|
||||
|
||||
local remote = ReplicatedStorage:FindFirstChild("GameEvent") or Instance.new("RemoteEvent")
|
||||
remote.Name = "GameEvent"
|
||||
remote.Parent = ReplicatedStorage
|
||||
|
||||
---------------------------------------------------------------- лента активности
|
||||
-- события для всех игроков (FishingClient показывает их в ленте и крупным баннером для редкого улова);
|
||||
-- самые редкие уловы уходят и на другие серверы игры через MessagingService (Config.Feed)
|
||||
local MessagingService = game:GetService("MessagingService")
|
||||
local FEED_TOPIC = "FishFeed"
|
||||
|
||||
local function feed(kind, info)
|
||||
remote:FireAllClients("Feed", kind, info)
|
||||
end
|
||||
|
||||
-- подписка — в фоне: SubscribeAsync ждёт ответа сервиса (в неопубликованном плейсе — долго),
|
||||
-- а скрипт должен сразу дойти до загрузки игроков, телепортов и остального
|
||||
task.spawn(function()
|
||||
pcall(function()
|
||||
MessagingService:SubscribeAsync(FEED_TOPIC, function(msg)
|
||||
local d = msg.Data
|
||||
if type(d) == "table" and d.jobId ~= game.JobId then
|
||||
d.remote = true -- улов на другом сервере
|
||||
feed("catch", d)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
-- улов в ленту; big — крупный баннер со звуком у всех, global — ещё и на другие серверы
|
||||
local function feedCatch(player, fish, world)
|
||||
local r = Config.Rarities[fish.rarity]
|
||||
local F = Config.Feed
|
||||
local info = {
|
||||
name = player.DisplayName, userId = player.UserId,
|
||||
fish = fish.name, rarity = fish.rarity, mutation = fish.mutation, value = fish.value,
|
||||
world = world and (world.icon .. " " .. world.name) or nil,
|
||||
big = r.rank >= F.announceRank or F.announceMutations[fish.mutation or ""] == true,
|
||||
}
|
||||
feed("catch", info)
|
||||
if r.rank >= F.globalRank or F.globalMutations[fish.mutation or ""] then
|
||||
info.jobId = game.JobId
|
||||
task.spawn(function()
|
||||
pcall(function()
|
||||
MessagingService:PublishAsync(FEED_TOPIC, info)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
local rng = Random.new()
|
||||
local GOLD = Color3.fromRGB(255, 220, 80)
|
||||
local RED = Color3.fromRGB(255, 120, 120)
|
||||
@@ -45,6 +91,11 @@ local function defaultData()
|
||||
chain = { index = 1, step = 1, progress = 0, tier = 0 }, daily = { last = 0, streak = 0 },
|
||||
boostUntil = 0, boostBonus = 0,
|
||||
totalCaught = 0, nextUid = 1, receipts = {},
|
||||
passes = {}, -- купленные пропуска (Developer Products): [key] = true
|
||||
coinsEarned = 0, robuxSpent = 0, -- для досок лидеров: всего выручено за рыбу и потрачено Robux
|
||||
settings = { music = Config.DefaultVolume.music, sfx = Config.DefaultVolume.sfx },
|
||||
-- гильдия: жемчуг, печати, отдых (ранг, заказы, наживку, ловушки дополняет Guild.defaults)
|
||||
pearls = 0, seals = 0, rest = 0,
|
||||
}
|
||||
end
|
||||
|
||||
@@ -87,16 +138,12 @@ local function hasPass(player, key)
|
||||
return passes[player] ~= nil and passes[player][key] == true
|
||||
end
|
||||
|
||||
local function loadPasses(player)
|
||||
-- пропуска продаются как Developer Products, поэтому владение хранится в данных игрока, а не в Roblox
|
||||
local function loadPasses(player, data)
|
||||
passes[player] = {}
|
||||
for _, gp in ipairs(Config.GamePasses) do
|
||||
if gp.id and gp.id > 0 then
|
||||
local ok, owns = pcall(function()
|
||||
return MarketplaceService:UserOwnsGamePassAsync(player.UserId, gp.id)
|
||||
end)
|
||||
if ok and owns then
|
||||
passes[player][gp.key] = true
|
||||
end
|
||||
if data.passes[gp.key] then
|
||||
passes[player][gp.key] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -106,6 +153,17 @@ local function ev(field, default)
|
||||
return (currentEvent and currentEvent[field]) or default
|
||||
end
|
||||
|
||||
-- погода и время суток (их ведёт WeatherServer через атрибуты workspace)
|
||||
local function weather()
|
||||
return Config.WeatherById(workspace:GetAttribute("Weather"))
|
||||
end
|
||||
local function isNight()
|
||||
if not Config.DayNight.enabled then
|
||||
return false
|
||||
end
|
||||
return Config.IsNight(Config.ClockAt(workspace:GetServerTimeNow(), workspace:GetAttribute("DayStart")))
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- расчёты
|
||||
|
||||
local function rodLevel(data, rodId)
|
||||
@@ -135,7 +193,7 @@ local function totalLuck(player, data)
|
||||
if hasPass(player, "LuckyCharm") then
|
||||
l += 0.5
|
||||
end
|
||||
return l + ev("luck", 0)
|
||||
return l + ev("luck", 0) + (weather().luck or 0) + (isNight() and Config.DayNight.nightLuck or 0)
|
||||
end
|
||||
|
||||
local function bagCapacity(player, data)
|
||||
@@ -265,14 +323,20 @@ local function updateStats(player)
|
||||
player:SetAttribute("BoostBonus", boostActive(data))
|
||||
player:SetAttribute("BoostLeft", math.max(0, data.boostUntil - os.time()))
|
||||
player:SetAttribute("TotalCaught", data.totalCaught)
|
||||
player:SetAttribute("CoinsEarned", data.coinsEarned)
|
||||
-- когда откроется следующая ежедневная награда (0 — уже доступна); по ней сундук в лобби прыгает только для тех,
|
||||
-- кому есть что забрать
|
||||
player:SetAttribute("DailyNextAt", data.daily.last >= today() and (data.daily.last + 1) * 86400 or 0)
|
||||
player:SetAttribute("RobuxSpent", data.robuxSpent)
|
||||
-- шаг обучения (линия-подсказка); у старых игроков без поля, уже ловивших рыбу, обучение пройдено
|
||||
player:SetAttribute("Tutorial", data.tutorial or (data.totalCaught > 0 and Config.TutorialDone or 0))
|
||||
player:SetAttribute("Mastery", masteryCount(data))
|
||||
player:SetAttribute("Passes", table.concat(ps, ","))
|
||||
Guild.attrs(player, data)
|
||||
|
||||
local ls = player:FindFirstChild("leaderstats")
|
||||
if ls then
|
||||
ls["Монеты"].Value = data.coins
|
||||
ls["Серебро"].Value = data.coins
|
||||
ls["Уровень"].Value = data.level
|
||||
ls["Улов"].Value = data.totalCaught
|
||||
end
|
||||
@@ -288,6 +352,7 @@ local function addXp(player, data, amount)
|
||||
end
|
||||
if leveled then
|
||||
notify(player, "⭐ Уровень " .. data.level .. "!", GOLD)
|
||||
feed("level", { name = player.DisplayName, userId = player.UserId, level = data.level })
|
||||
for _, w in ipairs(Config.Worlds) do
|
||||
if w.level == data.level and not w.soon then
|
||||
notify(player, "🌍 Открыт: " .. w.icon .. " " .. w.name, w.color)
|
||||
@@ -296,6 +361,11 @@ local function addXp(player, data, amount)
|
||||
end
|
||||
end
|
||||
|
||||
Guild.init({
|
||||
profiles = profiles, notify = notify, updateStats = updateStats, addXp = addXp, sendInventory = sendInventory,
|
||||
bagCapacity = bagCapacity, isNight = isNight, weather = weather, remote = remote,
|
||||
})
|
||||
|
||||
local function applyPotion(data, bonus, duration)
|
||||
data.boostBonus = math.max(boostActive(data), bonus)
|
||||
data.boostUntil = math.max(os.time(), data.boostUntil) + duration
|
||||
@@ -374,9 +444,13 @@ local function claimDaily(player)
|
||||
end
|
||||
end
|
||||
data.daily = { last = t, streak = streak }
|
||||
if streak == 7 then
|
||||
data.pearls += Config.Pearls.daily7
|
||||
extra ..= (" + %d 🦪"):format(Config.Pearls.daily7)
|
||||
end
|
||||
updateStats(player)
|
||||
sendQuests(player)
|
||||
notify(player, ("🎁 День %d: +%d 💰%s"):format(streak, coins, extra), GOLD)
|
||||
notify(player, ("🎁 День %d: +%d ⚪%s"):format(streak, coins, extra), GOLD)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- коллекция
|
||||
@@ -402,7 +476,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
if rarity == "Master" then
|
||||
local coins = Config.MasteryCoins * world.mult
|
||||
data.coins += coins
|
||||
notify(player, ("🏆 «%s» собран! +%d 💰"):format(world.name, coins), GOLD)
|
||||
notify(player, ("🏆 «%s» собран! +%d ⚪"):format(world.name, coins), GOLD)
|
||||
else
|
||||
local r = Config.CollectionRewards[rarity]
|
||||
if not r then
|
||||
@@ -410,7 +484,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
end
|
||||
data.coins += r.coins * world.mult
|
||||
addXp(player, data, r.xp * world.mult)
|
||||
notify(player, ("📖 +%d 💰 +%d XP"):format(r.coins * world.mult, r.xp * world.mult), GREEN)
|
||||
notify(player, ("📖 +%d ⚪ +%d XP"):format(r.coins * world.mult, r.xp * world.mult), GREEN)
|
||||
end
|
||||
updateStats(player)
|
||||
sendInventory(player)
|
||||
@@ -734,12 +808,19 @@ local function stopFishing(player, tellClient)
|
||||
end
|
||||
end
|
||||
|
||||
local function rollFish(player, data, worldId, luckMult)
|
||||
-- mods: { bait = наживка из Config.Baits, maxRank = потолок редкости (автоловля) }
|
||||
local function rollFish(player, data, worldId, luckMult, mods)
|
||||
local zone = Config.Zones[worldId]
|
||||
if not zone then
|
||||
return nil
|
||||
end
|
||||
local luck = totalLuck(player, data) * (luckMult or 1)
|
||||
mods = mods or {}
|
||||
local bait = mods.bait
|
||||
local base = totalLuck(player, data) + (bait and bait.luck or 0)
|
||||
if bait and bait.nightLuck and isNight() then
|
||||
base += bait.nightLuck - Config.DayNight.nightLuck -- светлячок: ночью +30% вместо обычных +10%
|
||||
end
|
||||
local luck = base * (luckMult or 1)
|
||||
local bonus = luck - 1
|
||||
local weights, total = {}, 0
|
||||
for i, f in ipairs(zone.fish) do
|
||||
@@ -748,6 +829,12 @@ local function rollFish(player, data, worldId, luckMult)
|
||||
if r.rank == 1 then
|
||||
w = r.weight / math.max(1, luck)
|
||||
end
|
||||
if bait and bait.rareWeight and r.rank >= 3 then
|
||||
w *= bait.rareWeight
|
||||
end
|
||||
if mods.maxRank and r.rank > mods.maxRank then
|
||||
w = 0
|
||||
end
|
||||
weights[i] = w
|
||||
total += w
|
||||
end
|
||||
@@ -762,7 +849,7 @@ local function rollFish(player, data, worldId, luckMult)
|
||||
end
|
||||
local mutation = nil
|
||||
for _, m in ipairs(Config.Mutations) do
|
||||
if rng:NextNumber() < m.chance * luck * ev("mutation", 1) then
|
||||
if rng:NextNumber() < m.chance * luck * ev("mutation", 1) * (weather().mutation or 1) * (bait and bait.mutation or 1) then
|
||||
mutation = m
|
||||
break
|
||||
end
|
||||
@@ -818,12 +905,21 @@ local function flyBobber(s, tool, target, dur, arc)
|
||||
end
|
||||
end
|
||||
|
||||
local autoFishing = {} -- [player] = токен работающей автоловли
|
||||
local setAutoFish, grantFish -- объявлены ниже
|
||||
|
||||
local function onCast(player, power)
|
||||
power = math.clamp(tonumber(power) or 0.6, 0, 1)
|
||||
local data = profiles[player]
|
||||
if not data then
|
||||
return
|
||||
end
|
||||
if autoFishing[player] then
|
||||
-- клик удочкой во время автоловли — выключить её
|
||||
setAutoFish(player, false)
|
||||
remote:FireClient(player, "CastFail")
|
||||
return
|
||||
end
|
||||
if fishing[player] then
|
||||
stopFishing(player, true)
|
||||
return
|
||||
@@ -856,7 +952,8 @@ local function onCast(player, power)
|
||||
|
||||
local stats = Config.RodStats(data.rod, rodLevel(data))
|
||||
local perfect = power >= Config.CastPerfect[1] and power <= Config.CastPerfect[2]
|
||||
local fish = rollFish(player, data, world.id, perfect and Config.CastPerfectLuck or 1)
|
||||
local bait = Guild.useBait(player, data) -- 1 штука наживки на заброс
|
||||
local fish = rollFish(player, data, world.id, perfect and Config.CastPerfectLuck or 1, { bait = bait })
|
||||
if not fish then
|
||||
remote:FireClient(player, "CastFail")
|
||||
return
|
||||
@@ -886,7 +983,7 @@ local function onCast(player, power)
|
||||
end
|
||||
s.stage = "waiting"
|
||||
|
||||
local waitTime = rng:NextNumber(Config.BiteTimeMin, Config.BiteTimeMax) * stats.speed * ev("speed", 1)
|
||||
local waitTime = rng:NextNumber(Config.BiteTimeMin, Config.BiteTimeMax) * stats.speed * ev("speed", 1) * (weather().speed or 1) * (bait and bait.speed or 1)
|
||||
task.wait(waitTime)
|
||||
if fishing[player] ~= s then
|
||||
return
|
||||
@@ -957,14 +1054,22 @@ local function onCatch(player, success, misses)
|
||||
return
|
||||
end
|
||||
gripSequence(tool, { { 85, 0.15 }, { REST_ANGLE, 0.45 } })
|
||||
grantFish(player, data, s.fish, { perfect = s.perfect, misses = misses, fromPos = fromPos })
|
||||
end
|
||||
|
||||
-- серия: каждая рыба подряд дороже и даёт больше опыта
|
||||
local fish = s.fish
|
||||
-- рыба поймана (руками или автоловлей): в сумку, опыт, коллекция, задания, гильдия, босс.
|
||||
-- ctx: { perfect, misses, fromPos, auto }; у автоловли нет серии и бонусов за точность
|
||||
grantFish = function(player, data, fish, ctx)
|
||||
local streak = combo[player] or 0
|
||||
local comboMult = math.min(Config.Combo.max, 1 + Config.Combo.step * streak)
|
||||
fish.value = math.floor(fish.value * comboMult + 0.5)
|
||||
fish.xp = math.floor(fish.xp * comboMult + 0.5)
|
||||
setCombo(player, streak + 1)
|
||||
local comboMult = 1
|
||||
if not ctx.auto then
|
||||
-- серия: каждая рыба подряд дороже и даёт больше опыта
|
||||
comboMult = math.min(Config.Combo.max, 1 + Config.Combo.step * streak)
|
||||
fish.value = math.floor(fish.value * comboMult + 0.5)
|
||||
fish.xp = math.floor(fish.xp * comboMult + 0.5)
|
||||
setCombo(player, streak + 1)
|
||||
end
|
||||
fish.xp = math.floor(fish.xp * Guild.xpMult(data)) -- бонус отдыха: двойной опыт
|
||||
table.insert(data.items, {
|
||||
uid = data.nextUid, id = fish.id, name = fish.name, rarity = fish.rarity,
|
||||
weight = fish.weight, value = fish.value, mutation = fish.mutation,
|
||||
@@ -987,10 +1092,14 @@ local function onCatch(player, success, misses)
|
||||
addXp(player, data, fish.xp * (isNew and 2 or 1))
|
||||
updateStats(player)
|
||||
sendInventory(player)
|
||||
if fromPos then
|
||||
showFishFlight(player, fish, fromPos)
|
||||
if ctx.fromPos then
|
||||
showFishFlight(player, fish, ctx.fromPos)
|
||||
end
|
||||
remote:FireClient(player, "Caught", fish, { new = isNew, record = isRecord, combo = comboMult, streak = ctx.auto and 0 or streak + 1, auto = ctx.auto })
|
||||
do
|
||||
local h = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
feedCatch(player, fish, h and Config.WorldAt(h.Position))
|
||||
end
|
||||
remote:FireClient(player, "Caught", fish, { new = isNew, record = isRecord, combo = comboMult, streak = streak + 1 })
|
||||
|
||||
local rank = Config.Rarities[fish.rarity].rank
|
||||
questProgress(player, "catch", 1)
|
||||
@@ -1000,16 +1109,160 @@ local function onCatch(player, success, misses)
|
||||
if rank >= 3 then
|
||||
questProgress(player, "rare", 1)
|
||||
end
|
||||
if misses == 0 then
|
||||
questProgress(player, "perfect", 1)
|
||||
if not ctx.auto then
|
||||
if ctx.misses == 0 then
|
||||
questProgress(player, "perfect", 1)
|
||||
end
|
||||
if ctx.perfect then
|
||||
questProgress(player, "perfectCast", 1)
|
||||
end
|
||||
questProgress(player, "combo", streak + 1, true)
|
||||
end
|
||||
if s.perfect then
|
||||
questProgress(player, "perfectCast", 1)
|
||||
end
|
||||
questProgress(player, "combo", streak + 1, true)
|
||||
Guild.onCatch(player, data, fish, {
|
||||
weather = workspace:GetAttribute("Weather"), night = isNight(),
|
||||
perfect = ctx.perfect and not ctx.auto, streak = (not ctx.auto) and streak + 1 or 0,
|
||||
})
|
||||
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
bossHit(player, hrp and Config.WorldAt(hrp.Position), rank + (misses == 0 and 1 or 0))
|
||||
bossHit(player, hrp and Config.WorldAt(hrp.Position), rank + (ctx.misses == 0 and 1 or 0))
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- автоловля (с ранга E)
|
||||
-- сервер сам забрасывает и вытаскивает: удача ×0.6, не выше «Редкой», без серии и бонуса заброса,
|
||||
-- каждая поимка на 50% дольше. Стоп — полная сумка, отошёл от места, сменил мир, убрал удочку
|
||||
|
||||
local function autoFishLoop(player, token)
|
||||
local A = Config.AutoFish
|
||||
local home = nil -- где включили: отошёл дальше 10 studs или сменил мир — стоп
|
||||
local function stop(reason)
|
||||
if autoFishing[player] == token then
|
||||
setAutoFish(player, false, reason)
|
||||
end
|
||||
end
|
||||
while autoFishing[player] == token do
|
||||
local data = profiles[player]
|
||||
local char = player.Character
|
||||
local hrp = char and char:FindFirstChild("HumanoidRootPart")
|
||||
local tool = char and char:FindFirstChildOfClass("Tool")
|
||||
if not data or not hrp then
|
||||
return stop(nil)
|
||||
end
|
||||
if not tool or not tool:GetAttribute("IsRod") then
|
||||
return stop("🎣 Автоловля: возьми удочку в руки")
|
||||
end
|
||||
local world = Config.WorldAt(hrp.Position)
|
||||
if not world or Config.CanCastFrom(world, hrp.Position) ~= true then
|
||||
return stop("🌊 Автоловля: встань у воды")
|
||||
end
|
||||
home = home or { pos = hrp.Position, world = world.id }
|
||||
if world.id ~= home.world or (hrp.Position - home.pos).Magnitude > 10 then
|
||||
return stop("🎣 Автоловля остановлена: ты отошёл")
|
||||
end
|
||||
if #data.items >= bagCapacity(player, data) then
|
||||
return stop("🎒 Сумка полна — автоловля остановлена")
|
||||
end
|
||||
local target, dist = findWater(hrp, world, 0.6)
|
||||
if not target then
|
||||
return stop("🌊 Автоловля: встань у воды")
|
||||
end
|
||||
if fishing[player] then
|
||||
task.wait(0.5)
|
||||
continue
|
||||
end
|
||||
|
||||
local bait = Guild.useBait(player, data)
|
||||
local fish = rollFish(player, data, world.id, A.luck, { bait = bait, maxRank = (not Guild.rank(data).autoNoCap) and A.maxRarity or nil })
|
||||
local s = { stage = "casting", fish = fish, tool = tool, auto = true }
|
||||
fishing[player] = s
|
||||
local splashAt = target + Vector3.new(0, 0.15, 0)
|
||||
local tw = tweenGrip(tool, 8, 0.15)
|
||||
if tw then
|
||||
tw.Completed:Wait()
|
||||
end
|
||||
if fishing[player] == s then
|
||||
flyBobber(s, tool, splashAt, 0.35 + dist * 0.018, 2 + dist * 0.3)
|
||||
tweenGrip(tool, REST_ANGLE - 5, 0.4)
|
||||
end
|
||||
if fishing[player] ~= s then
|
||||
if s.bobber then
|
||||
s.bobber:Destroy()
|
||||
end
|
||||
continue
|
||||
end
|
||||
s.stage = "waiting"
|
||||
local stats = Config.RodStats(data.rod, rodLevel(data))
|
||||
local waitTime = rng:NextNumber(Config.BiteTimeMin, Config.BiteTimeMax) * stats.speed * ev("speed", 1)
|
||||
* (weather().speed or 1) * (bait and bait.speed or 1) * A.slower
|
||||
local t0, bit = os.clock(), false
|
||||
while fishing[player] == s and autoFishing[player] == token and os.clock() - t0 < waitTime + A.reel do
|
||||
local h = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
if not h or (h.Position - home.pos).Magnitude > 10 then
|
||||
break
|
||||
end
|
||||
if not bit and os.clock() - t0 >= waitTime then
|
||||
-- клюёт: всплеск и удочка дёргается до конца «вываживания»
|
||||
bit = true
|
||||
if s.bobber and s.bobber.PrimaryPart then
|
||||
splash(s.bobber.PrimaryPart, 25)
|
||||
playSound(s.bobber.PrimaryPart, SPLASH_SOUND, 0.35)
|
||||
end
|
||||
end
|
||||
if bit then
|
||||
tweenGrip(tool, (math.floor(os.clock() * 8) % 2 == 0) and 38 or 18, 0.12)
|
||||
end
|
||||
task.wait(0.13)
|
||||
end
|
||||
if fishing[player] ~= s or autoFishing[player] ~= token or not bit or os.clock() - t0 < waitTime + A.reel - 0.05 then
|
||||
if fishing[player] == s then
|
||||
stopFishing(player, false)
|
||||
end
|
||||
continue -- наверху цикла проверим, почему прервались (отошёл, выключил)
|
||||
end
|
||||
fishing[player] = nil
|
||||
local fromPos = s.bobber and s.bobber.PrimaryPart and s.bobber.PrimaryPart.Position
|
||||
if s.bobber then
|
||||
s.bobber:Destroy()
|
||||
end
|
||||
gripSequence(tool, { { 85, 0.15 }, { REST_ANGLE, 0.45 } })
|
||||
grantFish(player, data, fish, { auto = true, fromPos = fromPos })
|
||||
task.wait(1.2)
|
||||
end
|
||||
end
|
||||
|
||||
setAutoFish = function(player, on, reason)
|
||||
local data = profiles[player]
|
||||
if on then
|
||||
if not data then
|
||||
return
|
||||
end
|
||||
if not Guild.rank(data).auto then
|
||||
notify(player, "🔒 Автоловля — с ранга гильдии E", RED)
|
||||
player:SetAttribute("AutoFish", false)
|
||||
return
|
||||
end
|
||||
if autoFishing[player] then
|
||||
return
|
||||
end
|
||||
if fishing[player] then
|
||||
stopFishing(player, true)
|
||||
end
|
||||
local token = {}
|
||||
autoFishing[player] = token
|
||||
player:SetAttribute("AutoFish", true)
|
||||
notify(player, "🎣 Автоловля включена", GREEN)
|
||||
task.spawn(autoFishLoop, player, token)
|
||||
else
|
||||
player:SetAttribute("AutoFish", false)
|
||||
if not autoFishing[player] then
|
||||
return
|
||||
end
|
||||
autoFishing[player] = nil
|
||||
local s = fishing[player]
|
||||
if s and s.auto then
|
||||
stopFishing(player, false)
|
||||
end
|
||||
notify(player, reason or "🎣 Автоловля выключена", Color3.fromRGB(255, 200, 120))
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- скупка
|
||||
@@ -1062,6 +1315,7 @@ local function sellItems(player, filterUid)
|
||||
end
|
||||
data.items = keep
|
||||
data.coins += total
|
||||
data.coinsEarned += total
|
||||
updateStats(player)
|
||||
sendInventory(player)
|
||||
remote:FireClient(player, "Sold", total, count)
|
||||
@@ -1086,9 +1340,9 @@ local function buy(player, kind, id)
|
||||
notify(player, "★★★★★ Максимум", GOLD)
|
||||
return
|
||||
end
|
||||
local cost = Config.UpgradeCost(rod, lvl)
|
||||
local cost = Guild.price(data, Config.UpgradeCost(rod, lvl)) -- скидка ранга гильдии
|
||||
if data.coins < cost then
|
||||
notify(player, "Нужно " .. cost .. " 💰", RED)
|
||||
notify(player, "Нужно " .. cost .. " ⚪", RED)
|
||||
return
|
||||
end
|
||||
data.coins -= cost
|
||||
@@ -1111,11 +1365,12 @@ local function buy(player, kind, id)
|
||||
notify(player, "🔒 Нужен ур. " .. potion.level, RED)
|
||||
return
|
||||
end
|
||||
if data.coins < potion.price then
|
||||
notify(player, "Нужно " .. potion.price .. " 💰", RED)
|
||||
local price = Guild.price(data, potion.price)
|
||||
if data.coins < price then
|
||||
notify(player, "Нужно " .. price .. " ⚪", RED)
|
||||
return
|
||||
end
|
||||
data.coins -= potion.price
|
||||
data.coins -= price
|
||||
applyPotion(data, potion.bonus, potion.duration)
|
||||
updateStats(player)
|
||||
notify(player, ("🍀 +%d%% удачи, %d мин"):format(potion.bonus * 100, potion.duration / 60), GREEN)
|
||||
@@ -1140,11 +1395,12 @@ local function buy(player, kind, id)
|
||||
notify(player, "🔒 Нужен ур. " .. item.level, RED)
|
||||
return
|
||||
end
|
||||
if data.coins < item.price then
|
||||
notify(player, "Нужно " .. item.price .. " 💰", RED)
|
||||
local price = Guild.price(data, item.price)
|
||||
if data.coins < price then
|
||||
notify(player, "Нужно " .. price .. " ⚪", RED)
|
||||
return
|
||||
end
|
||||
data.coins -= item.price
|
||||
data.coins -= price
|
||||
owned[id] = true
|
||||
bought = true
|
||||
notify(player, "✅ " .. item.name, GREEN)
|
||||
@@ -1193,6 +1449,11 @@ local function teleportTo(player, worldId)
|
||||
notify(player, ("🔒 %s: ур. %d"):format(world.name, world.level), RED)
|
||||
return
|
||||
end
|
||||
local okRank, why = Guild.canEnter(data, world.id)
|
||||
if not okRank then
|
||||
notify(player, why, RED)
|
||||
return
|
||||
end
|
||||
markerName = world.id .. "Spawn"
|
||||
end
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
@@ -1256,6 +1517,10 @@ ProximityPromptService.PromptTriggered:Connect(function(prompt, player)
|
||||
remote:FireClient(player, "OpenRobux", "passes")
|
||||
elseif action == "RobuxProducts" then
|
||||
remote:FireClient(player, "OpenRobux", "products")
|
||||
elseif action == "Guild" or action == "Orders" or action == "Bait" or action == "Traps" then
|
||||
-- Старейшина, доска заказов, лавка наживки: окно гильдии на нужной вкладке
|
||||
Guild.sendState(player)
|
||||
remote:FireClient(player, "OpenGuild", ({ Guild = "rank", Orders = "orders", Bait = "bait", Traps = "traps" })[action])
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -1285,13 +1550,13 @@ remote.OnServerEvent:Connect(function(player, action, a, b)
|
||||
if nearSeller(player) then
|
||||
sellItems(player, a)
|
||||
else
|
||||
notify(player, "💰 Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "⚪ Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
end
|
||||
elseif action == "SellAll" then
|
||||
if nearSeller(player) then
|
||||
sellItems(player, nil)
|
||||
else
|
||||
notify(player, "💰 Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
notify(player, "⚪ Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
end
|
||||
elseif action == "Teleport" then
|
||||
teleportTo(player, a)
|
||||
@@ -1302,27 +1567,38 @@ remote.OnServerEvent:Connect(function(player, action, a, b)
|
||||
elseif action == "RequestInventory" then
|
||||
sendInventory(player)
|
||||
sendQuests(player)
|
||||
elseif action == "Settings" then
|
||||
-- громкость музыки и эффектов (0..1), сохраняется вместе с прогрессом
|
||||
local data = profiles[player]
|
||||
local music, sfx = tonumber(a), tonumber(b)
|
||||
if data and music and sfx then
|
||||
data.settings = { music = math.clamp(music, 0, 1), sfx = math.clamp(sfx, 0, 1) }
|
||||
player:SetAttribute("VolMusic", data.settings.music)
|
||||
player:SetAttribute("VolSfx", data.settings.sfx)
|
||||
end
|
||||
elseif action == "AutoFish" then
|
||||
setAutoFish(player, a == true)
|
||||
else
|
||||
Guild.onAction(player, action, a, b)
|
||||
end
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- донат
|
||||
|
||||
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, passId, purchased)
|
||||
if not purchased then
|
||||
return
|
||||
end
|
||||
for _, gp in ipairs(Config.GamePasses) do
|
||||
if gp.id == passId then
|
||||
passes[player] = passes[player] or {}
|
||||
passes[player][gp.key] = true
|
||||
notify(player, "✅ " .. gp.icon .. " " .. gp.name, GOLD)
|
||||
if gp.key == "VIP" then
|
||||
vipTag(player)
|
||||
end
|
||||
updateStats(player)
|
||||
-- все покупки — Developer Products: и наборы (Config.Products), и пропуска навсегда (Config.GamePasses)
|
||||
local function findProduct(productId)
|
||||
for _, p in ipairs(Config.Products) do
|
||||
if p.id == productId then
|
||||
return p, false
|
||||
end
|
||||
end
|
||||
end)
|
||||
for _, gp in ipairs(Config.GamePasses) do
|
||||
if gp.id == productId then
|
||||
return gp, true
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
MarketplaceService.ProcessReceipt = function(info)
|
||||
local player = Players:GetPlayerByUserId(info.PlayerId)
|
||||
@@ -1335,19 +1611,26 @@ MarketplaceService.ProcessReceipt = function(info)
|
||||
return Enum.ProductPurchaseDecision.PurchaseGranted
|
||||
end
|
||||
end
|
||||
local product
|
||||
for _, p in ipairs(Config.Products) do
|
||||
if p.id == info.ProductId then
|
||||
product = p
|
||||
end
|
||||
end
|
||||
local product, isPass = findProduct(info.ProductId)
|
||||
if not product then
|
||||
warn("ProcessReceipt: неизвестный товар " .. tostring(info.ProductId))
|
||||
return Enum.ProductPurchaseDecision.NotProcessedYet
|
||||
end
|
||||
data.robuxSpent += info.CurrencySpent or product.robux or 0
|
||||
feed("buy", { name = player.DisplayName, userId = player.UserId, item = product.icon .. " " .. product.name })
|
||||
if isPass then
|
||||
data.passes[product.key] = true
|
||||
passes[player] = passes[player] or {}
|
||||
passes[player][product.key] = true
|
||||
notify(player, "✅ " .. product.icon .. " " .. product.name .. " — навсегда!", GOLD)
|
||||
if product.key == "VIP" then
|
||||
vipTag(player)
|
||||
end
|
||||
end
|
||||
if product.coins then
|
||||
local coins = math.floor(product.coins * (1 + (data.level - 1) * 0.15))
|
||||
data.coins += coins
|
||||
notify(player, ("Спасибо! +%d 💰"):format(coins), GOLD)
|
||||
notify(player, ("Спасибо! +%d ⚪"):format(coins), GOLD)
|
||||
end
|
||||
if product.boost then
|
||||
applyPotion(data, product.boost, product.duration)
|
||||
@@ -1432,6 +1715,7 @@ local function finishBoss(won)
|
||||
if potion then
|
||||
applyPotion(data, potion.bonus, potion.duration)
|
||||
end
|
||||
Guild.onBossWin(p, data)
|
||||
updateStats(p)
|
||||
remote:FireClient(p, "BossReward", coins, xp, potion and potion.name)
|
||||
end
|
||||
@@ -1486,10 +1770,13 @@ end)
|
||||
---------------------------------------------------------------- игроки
|
||||
|
||||
local function onPlayerAdded(player)
|
||||
-- камеру нельзя отвести так далеко, чтобы заглянуть за скалы и край карты
|
||||
player.CameraMinZoomDistance = Config.Camera.minZoom
|
||||
player.CameraMaxZoomDistance = Config.Camera.maxZoom
|
||||
local ls = Instance.new("Folder")
|
||||
ls.Name = "leaderstats"
|
||||
ls.Parent = player
|
||||
for _, name in ipairs({ "Монеты", "Уровень", "Улов" }) do
|
||||
for _, name in ipairs({ "Серебро", "Уровень", "Улов" }) do
|
||||
local v = Instance.new("IntValue")
|
||||
v.Name = name
|
||||
v.Parent = ls
|
||||
@@ -1499,13 +1786,19 @@ local function onPlayerAdded(player)
|
||||
if not player.Parent then
|
||||
return
|
||||
end
|
||||
loadPasses(player)
|
||||
loadPasses(player, data)
|
||||
ensureChain(data)
|
||||
Guild.defaults(data)
|
||||
Guild.onJoin(player, data)
|
||||
profiles[player] = data
|
||||
loadedOk[player] = ok
|
||||
local settings = type(data.settings) == "table" and data.settings or {}
|
||||
player:SetAttribute("VolMusic", tonumber(settings.music) or Config.DefaultVolume.music)
|
||||
player:SetAttribute("VolSfx", tonumber(settings.sfx) or Config.DefaultVolume.sfx)
|
||||
updateStats(player)
|
||||
sendInventory(player)
|
||||
sendQuests(player)
|
||||
Guild.sendState(player)
|
||||
|
||||
local function onCharacter()
|
||||
stopFishing(player, false)
|
||||
@@ -1513,6 +1806,7 @@ local function onPlayerAdded(player)
|
||||
giveRodTool(player)
|
||||
attachBag(player)
|
||||
vipTag(player)
|
||||
Guild.badge(player)
|
||||
end
|
||||
player.CharacterAdded:Connect(onCharacter)
|
||||
if player.Character then
|
||||
@@ -1528,6 +1822,10 @@ end
|
||||
Players.PlayerRemoving:Connect(function(player)
|
||||
stopFishing(player, false)
|
||||
combo[player], comboUntil[player] = nil, nil
|
||||
autoFishing[player] = nil
|
||||
if profiles[player] then
|
||||
Guild.onLeave(profiles[player])
|
||||
end
|
||||
saveData(player)
|
||||
profiles[player] = nil
|
||||
loadedOk[player] = nil
|
||||
@@ -1536,21 +1834,42 @@ end)
|
||||
|
||||
game:BindToClose(function()
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
if profiles[p] then
|
||||
Guild.onLeave(profiles[p])
|
||||
end
|
||||
saveData(p)
|
||||
end
|
||||
end)
|
||||
|
||||
-- погода и ночь меняют удачу: пересчитываем её у всех, когда они меняются
|
||||
local function refreshAllStats()
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
updateStats(p)
|
||||
end
|
||||
end
|
||||
workspace:GetAttributeChangedSignal("Weather"):Connect(refreshAllStats)
|
||||
|
||||
-- таймер зелий + автосохранение
|
||||
task.spawn(function()
|
||||
local t = 0
|
||||
local wasNight = isNight()
|
||||
while true do
|
||||
task.wait(1)
|
||||
t += 1
|
||||
local night = isNight()
|
||||
if night ~= wasNight then
|
||||
wasNight = night
|
||||
refreshAllStats()
|
||||
end
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
local data = profiles[p]
|
||||
if data and data.boostUntil > os.time() - 2 then
|
||||
updateStats(p)
|
||||
end
|
||||
-- бонус отдыха тратится, пока игрок рыбачит
|
||||
if data and (fishing[p] or autoFishing[p]) then
|
||||
Guild.spendRest(p, data, 1)
|
||||
end
|
||||
-- серия сгорает, если долго нет улова (пока рыба на крючке — ждём)
|
||||
if comboUntil[p] and os.time() > comboUntil[p] and not fishing[p] then
|
||||
breakCombo(p)
|
||||
|
||||
@@ -14,29 +14,19 @@ local Lighting = game:GetService("Lighting")
|
||||
local player = Players.LocalPlayer
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
local Models = require(ReplicatedStorage:WaitForChild("GameModels"))
|
||||
local Audio = require(script.Parent:WaitForChild("Audio"))
|
||||
local remote = ReplicatedStorage:WaitForChild("GameEvent")
|
||||
local reelSound = Audio.loop("reel", "sfx") -- трещотка катушки, пока идёт вываживание
|
||||
|
||||
---------------------------------------------------------------- стиль
|
||||
|
||||
local C = {
|
||||
bg = Color3.fromRGB(18, 24, 40),
|
||||
panel = Color3.fromRGB(30, 38, 62),
|
||||
panel2 = Color3.fromRGB(44, 56, 90),
|
||||
gold = Color3.fromRGB(255, 200, 70),
|
||||
green = Color3.fromRGB(60, 190, 95),
|
||||
blue = Color3.fromRGB(60, 135, 230),
|
||||
red = Color3.fromRGB(215, 65, 65),
|
||||
purple = Color3.fromRGB(150, 90, 220),
|
||||
grey = Color3.fromRGB(75, 82, 102),
|
||||
text = Color3.new(1, 1, 1),
|
||||
muted = Color3.fromRGB(170, 180, 205),
|
||||
line = Color3.fromRGB(90, 110, 165),
|
||||
}
|
||||
local TITLE = Enum.Font.FredokaOne
|
||||
-- палитра, шрифты и украшения — в модуле UiTheme («средневековая гильдия»)
|
||||
local Theme = require(script.Parent:WaitForChild("UiTheme"))
|
||||
local C = Theme.C
|
||||
local TITLE = Enum.Font.FredokaOne -- в new() подменяется на шрифт с кириллицей (Theme.FACES)
|
||||
local BODY = Enum.Font.GothamBold
|
||||
local BODY2 = Enum.Font.GothamMedium
|
||||
local WHITE, BLACK = Color3.new(1, 1, 1), Color3.new(0, 0, 0)
|
||||
local DING = "rbxasset://sounds/electronicpingshort.wav"
|
||||
|
||||
---------------------------------------------------------------- помощники UI
|
||||
|
||||
@@ -46,6 +36,8 @@ local function new(class, props, children)
|
||||
for k, v in pairs(props or {}) do
|
||||
if k == "Parent" then
|
||||
parent = v
|
||||
elseif k == "Font" and Theme.FACES[v] then
|
||||
obj.FontFace = Theme.FACES[v]
|
||||
else
|
||||
obj[k] = v
|
||||
end
|
||||
@@ -78,13 +70,20 @@ local function text(props)
|
||||
return new("TextLabel", d)
|
||||
end
|
||||
local function btn(props, onClick)
|
||||
local d = { AutoButtonColor = true, Font = TITLE, TextColor3 = C.text, TextSize = 18, BackgroundColor3 = C.blue, Text = "" }
|
||||
-- дерево/сургуч с золотой окантовкой; цвет кнопки задаёт BackgroundColor3, градиент даёт объём
|
||||
local d = { AutoButtonColor = true, Font = TITLE, TextColor3 = C.text, TextSize = 18, BackgroundColor3 = C.blue, Text = "", TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.55 }
|
||||
for k, v in pairs(props) do
|
||||
d[k] = v
|
||||
end
|
||||
local b = new("TextButton", d, { corner(10), new("UIGradient", { Color = ColorSequence.new(WHITE, Color3.fromRGB(195, 195, 195)), Rotation = 90 }) })
|
||||
local b = new("TextButton", d, {
|
||||
corner(8), new("UIGradient", { Color = ColorSequence.new(Color3.fromRGB(255, 240, 215), Color3.fromRGB(165, 150, 135)), Rotation = 90 }),
|
||||
new("UIStroke", { Color = C.gold, Thickness = 1.5, Transparency = 0.15, ApplyStrokeMode = Enum.ApplyStrokeMode.Border }),
|
||||
})
|
||||
if onClick then
|
||||
b.MouseButton1Click:Connect(onClick)
|
||||
b.MouseButton1Click:Connect(function(...)
|
||||
Audio.play("click")
|
||||
onClick(...)
|
||||
end)
|
||||
end
|
||||
return b
|
||||
end
|
||||
@@ -149,9 +148,7 @@ local function viewport(parent, model, dir, zoom)
|
||||
vf.CurrentCamera = cam
|
||||
return vf
|
||||
end
|
||||
local FISH_VIEW = Vector3.new(0.12, 0.15, 1)
|
||||
local ROD_VIEW = Vector3.new(1, 0.1, 0.05)
|
||||
local BAG_VIEW = Vector3.new(0.6, 0.25, 1)
|
||||
local VIEW = { fish = Vector3.new(0.12, 0.15, 1), rod = Vector3.new(1, 0.1, 0.05), bag = Vector3.new(0.6, 0.25, 1) }
|
||||
|
||||
local function silhouette(model)
|
||||
for _, p in ipairs(model:GetDescendants()) do
|
||||
@@ -171,44 +168,56 @@ local gui = new("ScreenGui", {
|
||||
Name = "FishingUI", ResetOnSpawn = false, IgnoreGuiInset = false,
|
||||
ZIndexBehavior = Enum.ZIndexBehavior.Sibling, Parent = player:WaitForChild("PlayerGui"),
|
||||
})
|
||||
-- холст с масштабом под экран: всё ниже кладём в него, а не прямо в ScreenGui
|
||||
local screen = Theme.scaleRoot(gui)
|
||||
|
||||
---------------------------------------------------------------- HUD
|
||||
|
||||
-- hud — содержимое; его родитель — деревянная панель с рамкой и заклёпками (её двигает раскладка)
|
||||
local hud = new("Frame", {
|
||||
Size = UDim2.fromOffset(290, 172), Position = UDim2.fromOffset(12, 10), BackgroundColor3 = WHITE, Parent = gui,
|
||||
}, { corner(16), stroke(C.line, 2, 0.35), gradient(C.panel2, C.bg, 90),
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 14), PaddingRight = UDim.new(0, 14), PaddingTop = UDim.new(0, 10) }) })
|
||||
local coinsText = text({ Size = UDim2.new(1, 0, 0, 32), Font = TITLE, TextSize = 30, TextColor3 = C.gold, Text = "💰 0", TextStrokeTransparency = 0.6, Parent = hud })
|
||||
local lvlBadge = new("Frame", { Size = UDim2.fromOffset(36, 36), Position = UDim2.fromOffset(0, 38), BackgroundColor3 = WHITE, Parent = hud },
|
||||
{ corner(18), gradient(Color3.fromRGB(255, 225, 110), Color3.fromRGB(235, 145, 30), 90), stroke(Color3.fromRGB(120, 70, 10), 2, 0.2) })
|
||||
local lvlText = text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 19, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = Color3.fromRGB(70, 40, 0), Text = "1", Parent = lvlBadge })
|
||||
local xpBack = new("Frame", { Size = UDim2.new(1, -46, 0, 18), Position = UDim2.fromOffset(46, 47), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = hud }, { corner(9) })
|
||||
local xpFill = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = WHITE, Parent = xpBack }, { corner(9), gradient(Color3.fromRGB(110, 225, 255), Color3.fromRGB(60, 110, 255), 0) })
|
||||
local xpText = text({ Size = UDim2.fromScale(1, 1), TextSize = 12, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 2, Text = "", TextStrokeTransparency = 0.5, Parent = xpBack })
|
||||
local luckText = text({ Size = UDim2.new(1, 0, 0, 22), Position = UDim2.fromOffset(0, 82), TextSize = 16, RichText = true, TextColor3 = Color3.fromRGB(130, 255, 150), Text = "", Parent = hud })
|
||||
local bagText = text({ Size = UDim2.new(1, 0, 0, 20), Position = UDim2.fromOffset(0, 106), TextSize = 14, Font = BODY2, Text = "", Parent = hud })
|
||||
local rodText = text({ Size = UDim2.new(1, 0, 0, 20), Position = UDim2.fromOffset(0, 128), TextSize = 14, Font = BODY2, TextColor3 = C.muted, RichText = true, Text = "", Parent = hud })
|
||||
Size = UDim2.new(1, -28, 1, -10), Position = UDim2.fromOffset(14, 10), BackgroundTransparency = 1,
|
||||
Parent = new("Frame", {
|
||||
Name = "Hud", Size = UDim2.fromOffset(290, 172), Position = UDim2.fromOffset(12, 10), BackgroundColor3 = WHITE, Parent = screen,
|
||||
}, { corner(10), stroke(C.goldDark, 2.5, 0), Theme.woodGradient(C.wood, C.woodDark) }),
|
||||
})
|
||||
Theme.innerBorder(hud.Parent, 5, 7, C.gold, 0.5)
|
||||
Theme.rivets(hud.Parent, 8, 6)
|
||||
local H = {} -- элементы HUD (в таблице: у скрипта лимит 200 локальных переменных)
|
||||
H.coins = text({ Size = UDim2.new(1, 0, 0, 32), Font = TITLE, TextSize = 28, TextColor3 = C.silver, Text = "⚪ 0", TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = hud })
|
||||
H.lvlBadge = new("Frame", { Size = UDim2.fromOffset(36, 36), Position = UDim2.fromOffset(0, 38), BackgroundColor3 = WHITE, Rotation = 45, Parent = hud },
|
||||
{ corner(6), gradient(C.goldBright, C.goldDark, 90), stroke(C.ink, 2, 0.1) })
|
||||
H.lvl = text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 17, Rotation = -45, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.ink, Text = "1", Parent = H.lvlBadge })
|
||||
H.xpBack = new("Frame", { Size = UDim2.new(1, -46, 0, 18), Position = UDim2.fromOffset(46, 47), BackgroundColor3 = C.dark, Parent = hud }, { corner(4), stroke(C.goldDark, 1.5, 0.2) })
|
||||
H.xpFill = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = WHITE, Parent = H.xpBack }, { corner(4), gradient(C.goldBright, Color3.fromRGB(196, 128, 48), 0) })
|
||||
H.xpText = text({ Size = UDim2.fromScale(1, 1), TextSize = 12, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 2, Text = "", TextStrokeTransparency = 0.5, Parent = H.xpBack })
|
||||
H.luck = text({ Size = UDim2.new(1, 0, 0, 22), Position = UDim2.fromOffset(0, 82), TextSize = 16, RichText = true, TextColor3 = Color3.fromRGB(130, 255, 150), Text = "", Parent = hud })
|
||||
H.bag = text({ Size = UDim2.new(1, 0, 0, 20), Position = UDim2.fromOffset(0, 106), TextSize = 14, Font = BODY2, Text = "", Parent = hud })
|
||||
H.rod = text({ Size = UDim2.new(1, 0, 0, 20), Position = UDim2.fromOffset(0, 128), TextSize = 14, Font = BODY2, TextColor3 = C.muted, RichText = true, Text = "", Parent = hud })
|
||||
|
||||
-- баннер события (справа сверху)
|
||||
local eventBanner = new("Frame", {
|
||||
Size = UDim2.fromOffset(280, 58), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 10),
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = screen,
|
||||
}, { corner(14), stroke(C.gold, 2, 0.1), gradient(Color3.fromRGB(90, 60, 20), C.bg, 90) })
|
||||
local eventTitle = text({ Size = UDim2.new(1, -20, 0, 26), Position = UDim2.fromOffset(12, 4), Font = TITLE, TextSize = 19, TextColor3 = C.gold, Text = "", Parent = eventBanner })
|
||||
local eventDesc = text({ Size = UDim2.new(1, -20, 0, 20), Position = UDim2.fromOffset(12, 30), Font = BODY2, TextSize = 13, TextColor3 = C.text, Text = "", Parent = eventBanner })
|
||||
|
||||
-- кнопки слева
|
||||
-- столбик на компьютере, сетка 2×N на телефоне (раскладка — в applyLayout ниже)
|
||||
local side = new("Frame", {
|
||||
Size = UDim2.fromOffset(70, 380), AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 12, 0.5, 60),
|
||||
BackgroundTransparency = 1, Parent = gui,
|
||||
}, { new("UIListLayout", { Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
BackgroundTransparency = 1, Parent = screen,
|
||||
}, { new("UIGridLayout", { CellSize = UDim2.fromOffset(68, 68), CellPadding = UDim2.fromOffset(8, 8), FillDirectionMaxCells = 1, SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
|
||||
local sideDots = {}
|
||||
local function sideButton(order, icon, label, key, color, onClick)
|
||||
local b = btn({ Size = UDim2.fromOffset(68, 68), BackgroundColor3 = color, LayoutOrder = order, Parent = side }, onClick)
|
||||
stroke(color:Lerp(BLACK, 0.45), 3).Parent = b
|
||||
text({ Size = UDim2.new(1, 0, 0, 36), Position = UDim2.fromOffset(0, 3), TextSize = 28, TextXAlignment = Enum.TextXAlignment.Center, Text = icon, Parent = b })
|
||||
text({ Size = UDim2.new(1, 0, 0, 18), Position = UDim2.fromOffset(0, 44), Font = TITLE, TextSize = 13, TextXAlignment = Enum.TextXAlignment.Center, Text = label, TextStrokeTransparency = 0.5, Parent = b })
|
||||
-- деревянная плитка; цвет раздела — полоска-лента снизу
|
||||
local b = btn({ Size = UDim2.fromOffset(68, 68), BackgroundColor3 = C.woodLight, LayoutOrder = order, Parent = side }, onClick)
|
||||
b:FindFirstChildOfClass("UIStroke").Color = C.goldDark
|
||||
b:FindFirstChildOfClass("UIStroke").Thickness = 2.5
|
||||
new("Frame", { Size = UDim2.new(1, -10, 0, 4), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -4), BackgroundColor3 = color, BorderSizePixel = 0, Parent = b }, { corner(2) })
|
||||
text({ Size = UDim2.fromScale(1, 0.5), Position = UDim2.fromScale(0, 0.06), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = icon, Parent = b })
|
||||
text({ Size = UDim2.fromScale(1, 0.24), Position = UDim2.fromScale(0, 0.6), Font = TITLE, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = label, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = b })
|
||||
if key and not UserInputService.TouchEnabled then
|
||||
local tag = new("Frame", { Size = UDim2.fromOffset(20, 20), Position = UDim2.new(1, -14, 0, -6), BackgroundColor3 = C.bg, Parent = b }, { corner(6), stroke(C.gold, 1.5) })
|
||||
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.gold, Text = key, Parent = tag })
|
||||
@@ -227,11 +236,12 @@ local SOFT_EDGES = NumberSequence.new({
|
||||
NumberSequenceKeypoint.new(0.82, 0.62), NumberSequenceKeypoint.new(1, 1),
|
||||
})
|
||||
-- жирный округлый шрифт с кириллицей (у FredokaOne кириллицы нет — Roblox подставляет тонкий шрифт)
|
||||
local HINT_FONT = Font.new("rbxasset://fonts/families/Nunito.json", Enum.FontWeight.Heavy)
|
||||
-- плашка-дымка (Frame) с текстом внутри; градиент только на плашке, на текст он не действует
|
||||
local HINT_FONT = Theme.HINT_FACE
|
||||
-- плашка-дымка (Frame) с текстом внутри; градиент только на плашке, на текст он не действует.
|
||||
-- Цвет — тёмное дерево
|
||||
local function softPlate(props, textProps)
|
||||
local plate = new("Frame", props)
|
||||
plate.BackgroundColor3 = BLACK
|
||||
plate.BackgroundColor3 = C.woodDark
|
||||
plate.BackgroundTransparency = 0
|
||||
corner(30).Parent = plate
|
||||
new("UIGradient", { Transparency = SOFT_EDGES, Parent = plate })
|
||||
@@ -257,7 +267,7 @@ end
|
||||
-- уведомления — под подсказкой обучения, которая стоит в самом верху
|
||||
local toasts = new("Frame", {
|
||||
Size = UDim2.new(0, 900, 0, 200), AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 84),
|
||||
BackgroundTransparency = 1, Parent = gui,
|
||||
BackgroundTransparency = 1, ZIndex = 30, Parent = screen,
|
||||
}, { new("UIListLayout", { Padding = UDim.new(0, 6), HorizontalAlignment = Enum.HorizontalAlignment.Center, SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
local toastOrder = 0
|
||||
local toastTimers = {}
|
||||
@@ -287,8 +297,8 @@ local function notify(msg, color)
|
||||
items[1]:Destroy()
|
||||
end
|
||||
local t, l = softPlate(
|
||||
{ Size = UDim2.new(0, 0, 0, 54), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = toastOrder, Parent = toasts },
|
||||
{ TextSize = 30, TextColor3 = color or WHITE, Text = msg }
|
||||
{ Size = UDim2.new(0, 0, 0, 44), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = toastOrder, Parent = toasts },
|
||||
{ TextSize = 24, TextColor3 = color or C.text, Text = msg }
|
||||
)
|
||||
popIn(t)
|
||||
t:SetAttribute("Msg", msg)
|
||||
@@ -306,8 +316,10 @@ end
|
||||
-- карточка пойманной рыбы
|
||||
local catchCard = new("Frame", {
|
||||
Size = UDim2.fromOffset(400, 128), AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, -220),
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
}, { corner(18) })
|
||||
BackgroundColor3 = WHITE, Visible = false, ZIndex = 25, Parent = screen,
|
||||
}, { corner(10) })
|
||||
Theme.innerBorder(catchCard, 6, 6, C.gold, 0.5)
|
||||
Theme.rivets(catchCard, 8, 6)
|
||||
local catchStroke = stroke(WHITE, 3)
|
||||
catchStroke.Parent = catchCard
|
||||
local catchGrad = gradient(C.panel2, C.bg, 90)
|
||||
@@ -319,13 +331,24 @@ local catchInfo = text({ Size = UDim2.new(1, -160, 0, 20), Position = UDim2.from
|
||||
local catchValue = text({ Size = UDim2.new(1, -160, 0, 26), Position = UDim2.fromOffset(152, 90), Font = TITLE, TextSize = 21, TextColor3 = C.gold, Text = "", Parent = catchCard })
|
||||
local catchToken = 0
|
||||
|
||||
-- уведомления и карточка улова — в одной колонке сверху: пока карточка видна, уведомления уходят под неё
|
||||
H.toastBaseY = 84
|
||||
function H.placeToasts(cardShown)
|
||||
local y = H.toastBaseY
|
||||
if cardShown then
|
||||
local sc = catchCard:FindFirstChildOfClass("UIScale")
|
||||
y = 120 + catchCard.Size.Y.Offset * (sc and sc.Scale or 1) + 10
|
||||
end
|
||||
TweenService:Create(toasts, TweenInfo.new(0.3, Enum.EasingStyle.Quad), { Position = UDim2.new(0.5, 0, 0, y) }):Play()
|
||||
end
|
||||
|
||||
local function showCatch(fish, extra)
|
||||
catchToken += 1
|
||||
local my = catchToken
|
||||
local r = Config.Rarities[fish.rarity]
|
||||
local mut = fish.mutation and Config.Find(Config.Mutations, fish.mutation)
|
||||
clear(catchView)
|
||||
viewport(catchView, Models.buildFish(fish.id, fish.mutation, 1, true), FISH_VIEW, 0.75)
|
||||
viewport(catchView, Models.buildFish(fish.id, fish.mutation, 1, true), VIEW.fish, 0.75)
|
||||
catchStroke.Color = mut and mut.color or r.color
|
||||
catchGrad.Color = ColorSequence.new(r.color:Lerp(C.bg, 0.55), C.bg)
|
||||
catchHeader.Text = extra and extra.new and "🆕 НОВЫЙ ВИД! Опыт x2" or (extra and extra.record and "🏆 НОВЫЙ РЕКОРД!" or "ПОЙМАНА РЫБА")
|
||||
@@ -334,14 +357,16 @@ local function showCatch(fish, extra)
|
||||
catchName.TextColor3 = r.color
|
||||
catchInfo.Text = ("<font color=\"%s\">%s</font>%s · %.2f кг"):format(
|
||||
hex(r.color), r.name, mut and (" · <font color=\"" .. hex(mut.color) .. "\">" .. mut.name .. " x" .. mut.mult .. "</font>") or "", fish.weight)
|
||||
catchValue.Text = ("💰 %s ⭐ +%d XP%s"):format(fmt(fish.value), fish.xp * ((extra and extra.new) and 2 or 1),
|
||||
catchValue.Text = ("⚪ %s ⭐ +%d XP%s"):format(fmt(fish.value), fish.xp * ((extra and extra.new) and 2 or 1),
|
||||
(extra and extra.combo and extra.combo > 1.001) and (" 🔥 x%.1f"):format(extra.combo) or "")
|
||||
catchCard.Visible = true
|
||||
H.placeToasts(true)
|
||||
TweenService:Create(catchCard, TweenInfo.new(0.45, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Position = UDim2.new(0.5, 0, 0, 120) }):Play()
|
||||
task.delay(3.4, function()
|
||||
if my == catchToken then
|
||||
local tw = TweenService:Create(catchCard, TweenInfo.new(0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.In), { Position = UDim2.new(0.5, 0, 0, -220) })
|
||||
tw:Play()
|
||||
H.placeToasts(false)
|
||||
tw.Completed:Wait()
|
||||
if my == catchToken then
|
||||
catchCard.Visible = false
|
||||
@@ -354,7 +379,7 @@ local function floatText(msg, color)
|
||||
local l = text({
|
||||
Size = UDim2.fromOffset(400, 60), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.42),
|
||||
Font = TITLE, TextSize = 46, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = color,
|
||||
TextStrokeTransparency = 0.2, Text = msg, Parent = gui,
|
||||
TextStrokeTransparency = 0.2, Text = msg, Parent = screen,
|
||||
})
|
||||
TweenService:Create(l, TweenInfo.new(1.4, Enum.EasingStyle.Quad), { Position = UDim2.fromScale(0.5, 0.3), TextTransparency = 1, TextStrokeTransparency = 1 }):Play()
|
||||
task.delay(1.5, function()
|
||||
@@ -366,22 +391,24 @@ end
|
||||
|
||||
-- вверху, на месте подсказки обучения (она во время рыбалки скрыта)
|
||||
local statusLabel = softPlate(
|
||||
{ Size = UDim2.fromOffset(0, 64), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 12), Visible = false, Parent = gui },
|
||||
{ Size = UDim2.fromOffset(0, 64), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 12), Visible = false, Parent = screen },
|
||||
{ TextSize = 36, Text = "🎣 Ждём клёв…" }
|
||||
)
|
||||
wobble(statusLabel, 1.2, 1.4)
|
||||
local mgFrame = new("Frame", {
|
||||
Size = UDim2.fromOffset(480, 124), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -100),
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
}, { corner(16), stroke(C.gold, 2.5, 0.1), gradient(C.panel2, C.bg, 90) })
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = screen,
|
||||
}, { corner(10), stroke(C.goldDark, 3, 0), Theme.woodGradient(C.wood, C.woodDark) })
|
||||
Theme.innerBorder(mgFrame, 5, 7, C.gold, 0.4)
|
||||
Theme.rivets(mgFrame, 9, 6)
|
||||
text({
|
||||
Size = UDim2.new(1, 0, 0, 30), Position = UDim2.fromOffset(0, 6), Font = TITLE, TextSize = 24,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.gold, TextStrokeTransparency = 0.5,
|
||||
Text = "❗ КЛЮЁТ! Кликай, когда метка в зелёной зоне", Parent = mgFrame,
|
||||
Size = UDim2.new(1, 0, 0, 30), Position = UDim2.fromOffset(0, 6), Font = TITLE, TextSize = 22,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.goldBright, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3,
|
||||
Text = UserInputService.TouchEnabled and "❗ КЛЮЁТ! Жми, когда метка в зелёной зоне" or "❗ КЛЮЁТ! Кликай, когда метка в зелёной зоне", Parent = mgFrame,
|
||||
})
|
||||
local bar = new("Frame", { Size = UDim2.new(1, -30, 0, 36), Position = UDim2.fromOffset(15, 42), BackgroundColor3 = Color3.fromRGB(22, 28, 46), ClipsDescendants = true, Parent = mgFrame }, { corner(9), stroke(BLACK, 1.5, 0.4) })
|
||||
local zoneF = new("Frame", { Size = UDim2.fromScale(0.25, 1), BackgroundColor3 = WHITE, BorderSizePixel = 0, Parent = bar }, { gradient(Color3.fromRGB(130, 245, 150), Color3.fromRGB(35, 165, 75), 90) })
|
||||
local markerF = new("Frame", { Size = UDim2.new(0, 8, 1, 4), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0, 0.5), BackgroundColor3 = WHITE, ZIndex = 3, Parent = bar }, { corner(4), stroke(BLACK, 2) })
|
||||
local bar = new("Frame", { Size = UDim2.new(1, -30, 0, 36), Position = UDim2.fromOffset(15, 42), BackgroundColor3 = C.dark, ClipsDescendants = true, Parent = mgFrame }, { corner(5), stroke(C.goldDark, 2, 0) })
|
||||
local zoneF = new("Frame", { Size = UDim2.fromScale(0.25, 1), BackgroundColor3 = WHITE, BorderSizePixel = 0, Parent = bar }, { gradient(Color3.fromRGB(150, 220, 110), Color3.fromRGB(56, 116, 52), 90) })
|
||||
local markerF = new("Frame", { Size = UDim2.new(0, 8, 1, 4), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0, 0.5), BackgroundColor3 = C.parchment, ZIndex = 3, Parent = bar }, { corner(3), stroke(C.ink, 2) })
|
||||
local pipsText = text({ Size = UDim2.new(0.5, -15, 0, 24), Position = UDim2.fromOffset(15, 84), Font = TITLE, TextSize = 19, RichText = true, Text = "", Parent = mgFrame })
|
||||
local missText = text({ Size = UDim2.new(0.5, -15, 0, 24), Position = UDim2.new(0.5, 0, 0, 84), Font = TITLE, TextSize = 19, TextXAlignment = Enum.TextXAlignment.Right, RichText = true, Text = "", Parent = mgFrame })
|
||||
local timeBar = new("Frame", { Size = UDim2.new(1, -30, 0, 5), Position = UDim2.fromOffset(15, 112), BackgroundColor3 = C.gold, BorderSizePixel = 0, Parent = mgFrame }, { corner(3) })
|
||||
@@ -392,31 +419,54 @@ local openWindow = nil
|
||||
|
||||
local function makeWindow(title, accent, tabs)
|
||||
local w = { pages = {}, tabButtons = {}, current = nil }
|
||||
-- деревянная панель, золотая рамка в 2 слоя, ромбики-заклёпки, заголовок на багровой ленте,
|
||||
-- закрытие — круглая багровая печать. accent — цвет раздела: тонкая полоска под лентой
|
||||
local frame = new("Frame", {
|
||||
Size = UDim2.fromScale(0.92, 0.82), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.53),
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
}, { corner(20), stroke(accent, 3, 0.05), gradient(C.panel, C.bg, 90), new("UISizeConstraint", { MaxSize = Vector2.new(760, 540) }) })
|
||||
BackgroundColor3 = WHITE, Visible = false, ZIndex = 20, Parent = screen, -- поверх HUD, целей и подсказок
|
||||
}, { corner(12), stroke(C.goldDark, 4, 0), Theme.woodGradient(C.wood, C.woodDark), new("UISizeConstraint", { MaxSize = Vector2.new(760, 540) }) })
|
||||
Theme.innerBorder(frame, 7, 8, C.gold, 0.2)
|
||||
Theme.rivets(frame, 12, 8)
|
||||
local scale = new("UIScale", { Parent = frame })
|
||||
local header = new("Frame", { Size = UDim2.new(1, 0, 0, 56), BackgroundColor3 = WHITE, Parent = frame }, { corner(20), gradient(accent, accent:Lerp(BLACK, 0.35), 90) })
|
||||
new("Frame", { Size = UDim2.new(1, 0, 0, 20), Position = UDim2.new(0, 0, 1, -20), BackgroundColor3 = accent:Lerp(BLACK, 0.3), BorderSizePixel = 0, Parent = header })
|
||||
text({ Size = UDim2.new(1, -80, 1, 0), Position = UDim2.fromOffset(20, 0), Font = TITLE, TextSize = 30, Text = title, TextStrokeTransparency = 0.5, ZIndex = 2, Parent = header })
|
||||
btn({ Size = UDim2.fromOffset(42, 42), Position = UDim2.new(1, -52, 0, 7), BackgroundColor3 = C.red, Text = "✕", TextSize = 22, ZIndex = 3, Parent = header }, function()
|
||||
local header = new("Frame", { Size = UDim2.new(1, 0, 0, 56), BackgroundTransparency = 1, Parent = frame })
|
||||
-- багровая лента по центру, ширина — по тексту
|
||||
local ribbon = new("Frame", {
|
||||
Size = UDim2.new(0, 0, 0, 44), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 8),
|
||||
BackgroundColor3 = WHITE, ZIndex = 3, Parent = header,
|
||||
}, { corner(4), gradient(Color3.fromRGB(184, 58, 48), Color3.fromRGB(118, 28, 26), 90), stroke(C.gold, 2, 0),
|
||||
new("UIListLayout", { HorizontalAlignment = Enum.HorizontalAlignment.Center, VerticalAlignment = Enum.VerticalAlignment.Center }),
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 36), PaddingRight = UDim.new(0, 36) }) })
|
||||
text({ Size = UDim2.fromScale(0, 1), AutomaticSize = Enum.AutomaticSize.X, Font = TITLE, TextSize = 24, TextXAlignment = Enum.TextXAlignment.Center,
|
||||
TextColor3 = C.goldBright, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.2, Text = title, ZIndex = 4, Parent = ribbon })
|
||||
new("Frame", { Size = UDim2.new(0, 120, 0, 3), AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 1, 2), BackgroundColor3 = accent, BorderSizePixel = 0, Parent = header }, { corner(2) })
|
||||
local closeB = btn({ Size = UDim2.fromOffset(44, 44), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(1, -24, 0, 22), BackgroundColor3 = C.crimson, Text = "×", TextSize = 30, TextColor3 = C.goldBright, ZIndex = 7, Parent = frame }, function()
|
||||
w.close()
|
||||
end)
|
||||
closeB:FindFirstChildOfClass("UICorner").CornerRadius = UDim.new(1, 0)
|
||||
closeB:FindFirstChildOfClass("UIStroke").Thickness = 2.5
|
||||
local hasTabs = #tabs > 1
|
||||
local tabBar = new("Frame", { Size = UDim2.new(1, -28, 0, 42), Position = UDim2.fromOffset(14, 66), BackgroundTransparency = 1, Visible = hasTabs, Parent = frame },
|
||||
local tabBar = new("Frame", { Size = UDim2.new(1, -36, 0, 40), Position = UDim2.fromOffset(18, 68), BackgroundTransparency = 1, Visible = hasTabs, Parent = frame },
|
||||
{ new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
local top = hasTabs and 116 or 68
|
||||
local body = new("Frame", { Size = UDim2.new(1, -28, 1, -(top + 12)), Position = UDim2.fromOffset(14, top), BackgroundTransparency = 1, Parent = frame })
|
||||
local top = hasTabs and 118 or 70
|
||||
local body = new("Frame", { Size = UDim2.new(1, -36, 1, -(top + 16)), Position = UDim2.fromOffset(18, top), BackgroundTransparency = 1, Parent = frame })
|
||||
w.frame = frame
|
||||
-- на телефоне окно почти на весь экран
|
||||
Theme.onLayout(function(compact)
|
||||
frame.Size = compact and UDim2.new(1, -16, 1, -12) or UDim2.fromScale(0.92, 0.82)
|
||||
frame.UISizeConstraint.MaxSize = compact and Vector2.new(1100, 640) or Vector2.new(760, 540)
|
||||
frame.Position = compact and UDim2.fromScale(0.5, 0.5) or UDim2.fromScale(0.5, 0.53)
|
||||
end)
|
||||
|
||||
function w.setTab(id)
|
||||
w.current = id
|
||||
for k, page in pairs(w.pages) do
|
||||
page.Visible = (k == id)
|
||||
end
|
||||
-- выбранная вкладка — золотая с тёмными буквами, остальные — светлое дерево
|
||||
for k, b in pairs(w.tabButtons) do
|
||||
b.BackgroundColor3 = (k == id) and accent or C.panel2
|
||||
b.BackgroundColor3 = (k == id) and C.gold or C.woodLight
|
||||
b.TextColor3 = (k == id) and C.ink or C.text
|
||||
b.TextStrokeTransparency = (k == id) and 1 or 0.55
|
||||
end
|
||||
if w.render then
|
||||
w.render(id)
|
||||
@@ -433,6 +483,9 @@ local function makeWindow(title, accent, tabs)
|
||||
openWindow.close()
|
||||
end
|
||||
openWindow = w
|
||||
if not frame.Visible then
|
||||
Audio.play("open")
|
||||
end
|
||||
frame.Visible = true
|
||||
scale.Scale = 0.85
|
||||
TweenService:Create(scale, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Scale = 1 }):Play()
|
||||
@@ -498,11 +551,19 @@ local function itemRow(parent, order, o)
|
||||
end
|
||||
|
||||
local function progressBar(parent, pos, size, frac, color)
|
||||
local back = new("Frame", { Size = size, Position = pos, BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = parent }, { corner(7) })
|
||||
local back = new("Frame", { Size = size, Position = pos, BackgroundColor3 = C.dark, Parent = parent }, { corner(7) })
|
||||
new("Frame", { Size = UDim2.fromScale(math.clamp(frac, 0, 1), 1), BackgroundColor3 = color, Parent = back }, { corner(7) })
|
||||
return back
|
||||
end
|
||||
|
||||
-- помощники интерфейса для других скриптов (GuildClient): тот же стиль окон, кнопок и уведомлений
|
||||
Theme.kit = {
|
||||
new = new, text = text, btn = btn, corner = corner, stroke = stroke, gradient = gradient, clear = clear,
|
||||
makeWindow = makeWindow, scrollArea = scrollArea, itemRow = itemRow, progressBar = progressBar,
|
||||
sideButton = sideButton, notify = notify, popIn = popIn, fmt = fmt, timeStr = timeStr,
|
||||
screen = screen, hud = hud, TITLE = TITLE, BODY = BODY, BODY2 = BODY2,
|
||||
}
|
||||
|
||||
---------------------------------------------------------------- данные с сервера
|
||||
|
||||
local inventory, discovered, claimed = {}, {}, {}
|
||||
@@ -530,7 +591,7 @@ local function buyButton(price, level, myLevel, coins)
|
||||
if myLevel < level then
|
||||
return "🔒 Ур. " .. level, C.grey, false
|
||||
end
|
||||
return "💰 " .. fmt(price), coins >= price and C.green or Color3.fromRGB(150, 95, 60), true
|
||||
return "⚪ " .. fmt(price), coins >= price and C.green or Color3.fromRGB(150, 95, 60), true
|
||||
end
|
||||
|
||||
shopWin.render = function(tab)
|
||||
@@ -557,7 +618,7 @@ shopWin.render = function(tab)
|
||||
bText, bColor, active = buyButton(rod.price, rod.level, myLevel, coins)
|
||||
end
|
||||
itemRow(list, i, {
|
||||
model = Models.buildRod(rod.id, lv, true), dir = ROD_VIEW, zoom = 0.6,
|
||||
model = Models.buildRod(rod.id, lv, true), dir = VIEW.rod, zoom = 0.6,
|
||||
title = rod.name .. (owned[rod.id] and (" <font color=\"#FFD45A\">" .. stars(lv) .. "</font>") or ""),
|
||||
lines = statLine(Config.RodStats(rod.id, lv)) .. "\n" .. (owned[rod.id] and "Куплена" or ("Нужен уровень " .. rod.level)),
|
||||
strokeColor = equipped and C.gold or nil,
|
||||
@@ -592,7 +653,7 @@ shopWin.render = function(tab)
|
||||
end
|
||||
local cost = Config.UpgradeCost(rod, lv)
|
||||
itemRow(list, order, {
|
||||
model = Models.buildRod(rod.id, lv, true), dir = ROD_VIEW, zoom = 0.6,
|
||||
model = Models.buildRod(rod.id, lv, true), dir = VIEW.rod, zoom = 0.6,
|
||||
title = rod.name .. " <font color=\"#FFD45A\">" .. stars(lv) .. "</font>",
|
||||
lines = lines,
|
||||
strokeColor = player:GetAttribute("Rod") == rod.id and C.gold or nil,
|
||||
@@ -619,7 +680,7 @@ shopWin.render = function(tab)
|
||||
bText, bColor, active = buyButton(bag.price, bag.level, myLevel, coins)
|
||||
end
|
||||
itemRow(list, i, {
|
||||
model = Models.buildBag(bag.id, true), dir = BAG_VIEW, zoom = 0.8,
|
||||
model = Models.buildBag(bag.id, true), dir = VIEW.bag, zoom = 0.8,
|
||||
title = bag.name,
|
||||
lines = ("🎒 Вмещает <b>%d</b> рыб%s\n%s"):format(bag.capacity + bonus, bonus > 0 and " (с пропуском)" or "", owned[bag.id] and "Куплена" or ("Нужен уровень " .. bag.level)),
|
||||
strokeColor = equipped and C.gold or nil,
|
||||
@@ -642,7 +703,7 @@ shopWin.render = function(tab)
|
||||
table.insert(mutLine, ("<font color=\"%s\">%s %.1f%%</font>"):format(hex(m.color), m.name, math.min(100, m.chance * total / 100 * ((event and event.mutation) or 1) * 100)))
|
||||
end
|
||||
local lines = {
|
||||
("<font size=\"24\" face=\"FredokaOne\" color=\"#7CFF9A\">🍀 Твоя удача: %d%%</font>"):format(total),
|
||||
("<font size=\"24\" color=\"#7CFF9A\">🍀 Твоя удача: %d%%</font>"):format(total),
|
||||
("Базовая 100%% · 🎣 Удочка +%d%% · ✨ Улучшения +%d%%"):format(math.floor(rod.luck * 100 + 0.5), math.floor(lv * Config.RodUpgrade.luckPerLevel * 100 + 0.5)),
|
||||
("⭐ Уровень +%d%% · 🏆 Мастерство миров +%d%%"):format(math.floor(((player:GetAttribute("Level") or 1) - 1) * Config.LuckPerPlayerLevel * 100 + 0.5), math.floor((player:GetAttribute("Mastery") or 0) * Config.MasteryLuck * 100 + 0.5)),
|
||||
("🧪 Зелье +%d%%%s · 👑 Пропуска +%d%%%s"):format(math.floor(boost * 100 + 0.5), boost > 0 and (" (" .. timeStr(player:GetAttribute("BoostLeft") or 0) .. ")") or "",
|
||||
@@ -676,7 +737,7 @@ local bagWin = makeWindow("🎒 Сумка", Color3.fromRGB(60, 140, 220), {
|
||||
|
||||
local fishHeader = new("Frame", { Size = UDim2.new(1, 0, 0, 50), BackgroundColor3 = WHITE, Parent = bagWin.pages.fish }, { corner(12), gradient(C.panel2, C.panel, 90) })
|
||||
local fishSummary = text({ Size = UDim2.new(1, -200, 1, 0), Position = UDim2.fromOffset(14, 0), Font = TITLE, TextSize = 19, RichText = true, Text = "", Parent = fishHeader })
|
||||
btn({ Size = UDim2.fromOffset(170, 38), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -8, 0.5, 0), BackgroundColor3 = C.green, Text = "💰 Продать всё", TextSize = 18, Parent = fishHeader }, function()
|
||||
btn({ Size = UDim2.fromOffset(170, 38), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -8, 0.5, 0), BackgroundColor3 = C.green, Text = "⚪ Продать всё", TextSize = 18, Parent = fishHeader }, function()
|
||||
remote:FireServer("SellAll")
|
||||
end)
|
||||
local fishGrid = scrollArea(bagWin.pages.fish, UDim2.fromOffset(132, 176), 60)
|
||||
@@ -688,8 +749,13 @@ local dexList = scrollArea(bagWin.pages.dex, nil, 46)
|
||||
local dexTabButtons = {}
|
||||
|
||||
local function fishCard(parent, order, rarityColor, strokeColor)
|
||||
return new("Frame", { BackgroundColor3 = WHITE, LayoutOrder = order, Parent = parent },
|
||||
{ corner(14), stroke(strokeColor or rarityColor, 2.5, 0.05), gradient(rarityColor:Lerp(C.bg, 0.55), C.panel, 90) })
|
||||
-- тёмное дерево; редкость — цветная полоса сверху и камень в углу, мутация — цвет рамки
|
||||
local card = new("Frame", { BackgroundColor3 = WHITE, LayoutOrder = order, Parent = parent },
|
||||
{ corner(8), stroke(strokeColor or C.goldDark, strokeColor and 2.5 or 2, 0), gradient(rarityColor:Lerp(C.woodDark, 0.78), C.woodDark, 90) })
|
||||
new("Frame", { Size = UDim2.new(1, -16, 0, 4), AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 3), BackgroundColor3 = rarityColor, BorderSizePixel = 0, Parent = card }, { corner(2) })
|
||||
new("Frame", { Size = UDim2.fromOffset(12, 12), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(1, -11, 0, 13), Rotation = 45, BackgroundColor3 = rarityColor, ZIndex = 5, Parent = card },
|
||||
{ stroke(C.ink, 1.5), gradient(WHITE, Color3.fromRGB(150, 150, 150), 90) })
|
||||
return card
|
||||
end
|
||||
|
||||
local function rewardButton(parent, state, label, onClick)
|
||||
@@ -719,7 +785,7 @@ local function renderDex()
|
||||
{ corner(12), stroke(C.gold, 2, 0.3), gradient(Color3.fromRGB(70, 55, 20), C.panel, 90) })
|
||||
text({
|
||||
Size = UDim2.new(1, -180, 1, 0), Position = UDim2.fromOffset(14, 0), Font = TITLE, TextSize = 17, RichText = true, TextWrapped = true,
|
||||
Text = ("%s %s — <font color=\"#FFD45A\">%d / %d</font>\n<font size=\"13\" color=\"#AAB4CD\">Собери всех: +%s 💰 и +%d%% удачи навсегда</font>"):format(
|
||||
Text = ("%s %s — <font color=\"#FFD45A\">%d / %d</font>\n<font size=\"13\" color=\"#C0AC88\">Собери всех: +%s ⚪ и +%d%% удачи навсегда</font>"):format(
|
||||
world.icon, world.name, found, #all, fmt(Config.MasteryCoins * world.mult), math.floor(Config.MasteryLuck * 100 + 0.5)),
|
||||
Parent = head,
|
||||
})
|
||||
@@ -751,7 +817,7 @@ local function renderDex()
|
||||
local reward = Config.CollectionRewards[rarity]
|
||||
text({
|
||||
Size = UDim2.new(1, -180, 1, 0), Position = UDim2.fromOffset(12, 0), Font = TITLE, TextSize = 17, RichText = true,
|
||||
Text = ("<font color=\"%s\">%s</font> %d/%d <font size=\"13\" color=\"#AAB4CD\">+%s 💰 +%s XP</font>"):format(
|
||||
Text = ("<font color=\"%s\">%s</font> %d/%d <font size=\"13\" color=\"#C0AC88\">+%s ⚪ +%s XP</font>"):format(
|
||||
hex(r.color), r.name, have, #group, fmt(reward.coins * world.mult), fmt(reward.xp * world.mult)),
|
||||
Parent = hdr,
|
||||
})
|
||||
@@ -767,7 +833,7 @@ local function renderDex()
|
||||
local card = fishCard(grid, i, rec and r.color or C.grey)
|
||||
local view = new("Frame", { Size = UDim2.new(1, -12, 0, 76), Position = UDim2.fromOffset(6, 6), BackgroundTransparency = 1, Parent = card })
|
||||
local model = Models.buildFish(f.id, nil, 1, true)
|
||||
viewport(view, rec and model or silhouette(model), FISH_VIEW, 0.72)
|
||||
viewport(view, rec and model or silhouette(model), VIEW.fish, 0.72)
|
||||
text({ Size = UDim2.new(1, -10, 0, 20), Position = UDim2.fromOffset(6, 84), Font = TITLE, TextSize = 15, TextColor3 = rec and r.color or C.muted, Text = rec and f.name or "???", TextTruncate = Enum.TextTruncate.AtEnd, Parent = card })
|
||||
text({
|
||||
Size = UDim2.new(1, -10, 0, 40), Position = UDim2.fromOffset(6, 104), Font = BODY2, TextSize = 12, TextColor3 = C.muted, TextWrapped = true,
|
||||
@@ -795,7 +861,7 @@ bagWin.render = function(tab)
|
||||
for _, it in ipairs(inventory) do
|
||||
total += it.value
|
||||
end
|
||||
fishSummary.Text = ("🐟 %d / %d · <font color=\"#FFD45A\">💰 ≈%s</font>"):format(#inventory, player:GetAttribute("BagCap") or 0, fmt(player:GetAttribute("BagValue") or total))
|
||||
fishSummary.Text = ("🐟 %d / %d · <font color=\"#FFD45A\">⚪ ≈%s</font>"):format(#inventory, player:GetAttribute("BagCap") or 0, fmt(player:GetAttribute("BagValue") or total))
|
||||
if #inventory == 0 then
|
||||
text({ Size = UDim2.fromOffset(400, 60), Font = TITLE, TextSize = 20, TextColor3 = C.muted, TextWrapped = true, Text = "Сумка пуста. Иди к воде и поймай рыбу! 🎣", Parent = fishGrid })
|
||||
return
|
||||
@@ -809,7 +875,7 @@ bagWin.render = function(tab)
|
||||
local mut = it.mutation and Config.Find(Config.Mutations, it.mutation)
|
||||
local card = fishCard(fishGrid, i, r.color, mut and mut.color)
|
||||
local view = new("Frame", { Size = UDim2.new(1, -12, 0, 84), Position = UDim2.fromOffset(6, 6), BackgroundTransparency = 1, Parent = card })
|
||||
viewport(view, Models.buildFish(it.id, it.mutation, 1, true), FISH_VIEW, 0.72)
|
||||
viewport(view, Models.buildFish(it.id, it.mutation, 1, true), VIEW.fish, 0.72)
|
||||
if mut then
|
||||
local tag = new("Frame", { Size = UDim2.fromOffset(0, 20), AutomaticSize = Enum.AutomaticSize.X, Position = UDim2.fromOffset(6, 6), BackgroundColor3 = mut.color, ZIndex = 3, Parent = card },
|
||||
{ corner(6), new("UIPadding", { PaddingLeft = UDim.new(0, 6), PaddingRight = UDim.new(0, 6) }) })
|
||||
@@ -817,7 +883,7 @@ bagWin.render = function(tab)
|
||||
end
|
||||
text({ Size = UDim2.new(1, -10, 0, 20), Position = UDim2.fromOffset(6, 92), Font = TITLE, TextSize = 16, TextColor3 = r.color, Text = it.name, TextTruncate = Enum.TextTruncate.AtEnd, Parent = card })
|
||||
text({ Size = UDim2.new(1, -10, 0, 16), Position = UDim2.fromOffset(6, 112), Font = BODY2, TextSize = 13, TextColor3 = C.muted, Text = ("%.2f кг · %s"):format(it.weight, r.name), Parent = card })
|
||||
btn({ Size = UDim2.new(1, -12, 0, 32), Position = UDim2.fromOffset(6, 136), BackgroundColor3 = C.green, Text = "💰 " .. fmt(it.value), TextSize = 17, Parent = card }, function()
|
||||
btn({ Size = UDim2.new(1, -12, 0, 32), Position = UDim2.fromOffset(6, 136), BackgroundColor3 = C.green, Text = "⚪ " .. fmt(it.value), TextSize = 17, Parent = card }, function()
|
||||
remote:FireServer("SellOne", it.uid)
|
||||
end)
|
||||
end
|
||||
@@ -866,6 +932,8 @@ worldsWin.render = function()
|
||||
bText, bColor, active = "Скоро…", C.grey, false
|
||||
elseif myLevel < w.level then
|
||||
bText, bColor, active = "🔒 Ур. " .. w.level, C.grey, false
|
||||
elseif (Config.Guild.worldRank[w.id] or 1) > (player:GetAttribute("RankIdx") or 1) then
|
||||
bText, bColor, active = "🔒 Ранг " .. Config.Guild.ranks[Config.Guild.worldRank[w.id]].id, C.grey, false
|
||||
elseif here and here.id == w.id then
|
||||
bText, bColor, active = "Вы здесь", C.grey, false
|
||||
else
|
||||
@@ -874,7 +942,8 @@ worldsWin.render = function()
|
||||
itemRow(worldsList, i, {
|
||||
icon = w.icon, iconBg = w.color:Lerp(C.bg, 0.6),
|
||||
title = w.name, titleColor = w.color,
|
||||
lines = w.desc .. "\n" .. (w.soon and "В разработке" or ("Уровень: %d · Рыб поймано: %d / %d · Награды x%d"):format(w.level, found, total, w.mult)),
|
||||
lines = w.desc .. "\n" .. (w.soon and "В разработке" or ("Уровень: %d%s · Рыб поймано: %d / %d · Награды x%d"):format(w.level,
|
||||
Config.Guild.worldRank[w.id] and (", ранг " .. Config.Guild.ranks[Config.Guild.worldRank[w.id]].id) or "", found, total, w.mult)),
|
||||
strokeColor = (here and here.id == w.id) and C.gold or nil,
|
||||
buttonText = bText, buttonColor = bColor, active = active,
|
||||
onClick = function()
|
||||
@@ -915,7 +984,7 @@ questWin.render = function(tab)
|
||||
end
|
||||
text({
|
||||
Size = UDim2.new(1, -4, 0, 30), LayoutOrder = 0, Font = TITLE, TextSize = 22, RichText = true,
|
||||
Text = ("%s <font color=\"#AAB4CD\" size=\"15\">круг %d · награда сразу, следующее задание — тоже</font>"):format(chain.name, chain.round), Parent = questList,
|
||||
Text = ("%s <font color=\"#C0AC88\" size=\"15\">круг %d · награда сразу, следующее задание — тоже</font>"):format(chain.name, chain.round), Parent = questList,
|
||||
})
|
||||
for i, st in ipairs(chain.steps) do
|
||||
local done, cur = i < chain.step, i == chain.step
|
||||
@@ -928,7 +997,7 @@ questWin.render = function(tab)
|
||||
})
|
||||
text({
|
||||
Size = UDim2.fromOffset(180, 28), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -14, 0, cur and 8 or 14), Font = TITLE, TextSize = 17,
|
||||
TextXAlignment = Enum.TextXAlignment.Right, TextColor3 = done and C.muted or C.gold, Text = ("+%s 💰 +%s XP"):format(fmt(st.coins), fmt(st.xp)), Parent = row,
|
||||
TextXAlignment = Enum.TextXAlignment.Right, TextColor3 = done and C.muted or C.gold, Text = ("+%s ⚪ +%s XP"):format(fmt(st.coins), fmt(st.xp)), Parent = row,
|
||||
})
|
||||
if cur then
|
||||
progressBar(row, UDim2.fromOffset(16, 44), UDim2.new(1, -110, 0, 16), chain.progress / st.goal, C.gold)
|
||||
@@ -941,7 +1010,7 @@ questWin.render = function(tab)
|
||||
{ corner(14), stroke(C.purple, 2, 0.2), gradient(Color3.fromRGB(70, 40, 100), C.panel, 90) })
|
||||
text({
|
||||
Size = UDim2.new(1, -32, 1, 0), Position = UDim2.fromOffset(16, 0), Font = TITLE, TextSize = 18, RichText = true,
|
||||
Text = ("🎁 За всю цепочку: <font color=\"#FFD45A\">+%s 💰 +%s XP</font>%s"):format(fmt(b.coins), fmt(b.xp), b.potion and (" + " .. b.potion) or ""), Parent = row,
|
||||
Text = ("🎁 За всю цепочку: <font color=\"#FFD45A\">+%s ⚪ +%s XP</font>%s"):format(fmt(b.coins), fmt(b.xp), b.potion and (" + " .. b.potion) or ""), Parent = row,
|
||||
})
|
||||
elseif tab == "daily" then
|
||||
clear(dailyPage)
|
||||
@@ -958,10 +1027,10 @@ questWin.render = function(tab)
|
||||
local cell = new("Frame", { BackgroundColor3 = WHITE, Parent = row },
|
||||
{ corner(12), stroke(isNext and C.gold or C.line, isNext and 3 or 2, isNext and 0 or 0.4), gradient(isNext and Color3.fromRGB(90, 70, 20) or C.panel2, C.panel, 90) })
|
||||
text({ Size = UDim2.new(1, 0, 0, 24), Position = UDim2.fromOffset(0, 6), Font = TITLE, TextSize = 15, TextXAlignment = Enum.TextXAlignment.Center, Text = "День " .. d, Parent = cell })
|
||||
text({ Size = UDim2.new(1, 0, 0, 44), Position = UDim2.fromOffset(0, 32), TextSize = 32, TextXAlignment = Enum.TextXAlignment.Center, Text = passed and "✅" or (r.potion and "🧪" or "💰"), Parent = cell })
|
||||
text({ Size = UDim2.new(1, 0, 0, 44), Position = UDim2.fromOffset(0, 32), TextSize = 32, TextXAlignment = Enum.TextXAlignment.Center, Text = passed and "✅" or (r.potion and "🧪" or "⚪"), Parent = cell })
|
||||
text({
|
||||
Size = UDim2.new(1, -6, 0, 50), Position = UDim2.fromOffset(3, 80), Font = BODY2, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Center, TextWrapped = true, TextColor3 = C.gold,
|
||||
Text = fmt(r.coins * (1 + (myLevel - 1) * 0.2)) .. " 💰" .. (r.potion and "\n+ зелье" or ""), Parent = cell,
|
||||
Text = fmt(r.coins * (1 + (myLevel - 1) * 0.2)) .. " ⚪" .. (r.potion and "\n+ зелье" or ""), Parent = cell,
|
||||
})
|
||||
end
|
||||
btn({
|
||||
@@ -978,7 +1047,7 @@ end
|
||||
|
||||
local robuxWin = makeWindow("💎 Премиум", Color3.fromRGB(150, 80, 210), {
|
||||
{ id = "passes", label = "👑 Пропуска" },
|
||||
{ id = "products", label = "🪙 Наборы" },
|
||||
{ id = "products", label = "⚪ Наборы" },
|
||||
})
|
||||
local robuxLists = { passes = scrollArea(robuxWin.pages.passes), products = scrollArea(robuxWin.pages.products) }
|
||||
|
||||
@@ -1000,16 +1069,57 @@ robuxWin.render = function(tab)
|
||||
notify("⚙ Товар не настроен", Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
if tab == "passes" then
|
||||
MarketplaceService:PromptGamePassPurchase(player, it.id)
|
||||
else
|
||||
MarketplaceService:PromptProductPurchase(player, it.id)
|
||||
end
|
||||
-- и наборы, и пропуска — Developer Products; пропуск сервер запоминает навсегда
|
||||
MarketplaceService:PromptProductPurchase(player, it.id)
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- настройки звука
|
||||
|
||||
local settingsWin = makeWindow("⚙ Настройки", Color3.fromRGB(150, 120, 80), { { id = "sound", label = "Звук" } })
|
||||
local settingsPage = settingsWin.pages.sound
|
||||
local volumes = {
|
||||
music = player:GetAttribute("VolMusic") or Config.DefaultVolume.music,
|
||||
sfx = player:GetAttribute("VolSfx") or Config.DefaultVolume.sfx,
|
||||
}
|
||||
|
||||
local function setVolume(key, value)
|
||||
volumes[key] = math.clamp(math.floor(value * 10 + 0.5) / 10, 0, 1)
|
||||
-- сразу у себя (слышно без задержки), сервер сохранит и подтвердит
|
||||
player:SetAttribute(key == "music" and "VolMusic" or "VolSfx", volumes[key])
|
||||
remote:FireServer("Settings", volumes.music, volumes.sfx)
|
||||
settingsWin.refresh()
|
||||
end
|
||||
|
||||
settingsWin.render = function()
|
||||
clear(settingsPage)
|
||||
for i, row in ipairs({ { "music", "🎵 Музыка" }, { "sfx", "🔊 Звуки и окружение" } }) do
|
||||
local key, label = row[1], row[2]
|
||||
local f = new("Frame", { Size = UDim2.new(1, -4, 0, 70), Position = UDim2.fromOffset(0, (i - 1) * 82), BackgroundColor3 = WHITE, Parent = settingsPage },
|
||||
{ corner(14), stroke(C.line, 2, 0.45), gradient(C.panel2, C.panel, 90) })
|
||||
text({ Size = UDim2.new(1, -260, 1, 0), Position = UDim2.fromOffset(18, 0), Font = TITLE, TextSize = 21, Text = label, Parent = f })
|
||||
btn({ Size = UDim2.fromOffset(52, 46), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -170, 0.5, 0), BackgroundColor3 = C.grey, Text = "−", TextSize = 26, Parent = f }, function()
|
||||
setVolume(key, volumes[key] - 0.1)
|
||||
end)
|
||||
text({ Size = UDim2.fromOffset(90, 46), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -74, 0.5, 0), Font = TITLE, TextSize = 22,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.gold, Text = math.floor(volumes[key] * 100 + 0.5) .. "%", Parent = f })
|
||||
btn({ Size = UDim2.fromOffset(52, 46), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -14, 0.5, 0), BackgroundColor3 = C.green, Text = "+", TextSize = 26, Parent = f }, function()
|
||||
setVolume(key, volumes[key] + 0.1)
|
||||
end)
|
||||
end
|
||||
end
|
||||
-- сервер прислал сохранённую громкость
|
||||
player:GetAttributeChangedSignal("VolMusic"):Connect(function()
|
||||
volumes.music = player:GetAttribute("VolMusic") or volumes.music
|
||||
settingsWin.refresh()
|
||||
end)
|
||||
player:GetAttributeChangedSignal("VolSfx"):Connect(function()
|
||||
volumes.sfx = player:GetAttribute("VolSfx") or volumes.sfx
|
||||
settingsWin.refresh()
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- боковые кнопки
|
||||
|
||||
sideButton(1, "🎒", "Сумка", "B", Color3.fromRGB(60, 140, 220), function()
|
||||
@@ -1027,6 +1137,39 @@ end)
|
||||
sideButton(5, "💎", "Донат", nil, Color3.fromRGB(150, 80, 210), function()
|
||||
robuxWin.toggle()
|
||||
end)
|
||||
sideButton(6, "⚙", "Звук", nil, Color3.fromRGB(150, 120, 80), function()
|
||||
settingsWin.toggle()
|
||||
end)
|
||||
|
||||
-- раскладка: компьютер — как раньше; телефон — HUD и кнопки компактнее, кнопки сеткой 3×N под HUD
|
||||
-- (левый низ свободен под джойстик, правый низ — под кнопку прыжка)
|
||||
do
|
||||
local function scaleOf(obj)
|
||||
local sc = obj:FindFirstChild("LayoutScale") or new("UIScale", { Name = "LayoutScale", Parent = obj })
|
||||
return sc
|
||||
end
|
||||
local grid = side:FindFirstChildOfClass("UIGridLayout")
|
||||
Theme.onLayout(function(compact)
|
||||
scaleOf(hud.Parent).Scale = compact and 0.82 or 1
|
||||
hud.Parent.Position = compact and UDim2.fromOffset(8, 6) or UDim2.fromOffset(12, 10)
|
||||
grid.CellSize = compact and UDim2.fromOffset(52, 52) or UDim2.fromOffset(62, 62)
|
||||
grid.CellPadding = compact and UDim2.fromOffset(6, 6) or UDim2.fromOffset(6, 6)
|
||||
grid.FillDirectionMaxCells = compact and 3 or 1
|
||||
side.AnchorPoint = Vector2.zero
|
||||
-- под HUD (он выше на строку гильдии — её добавляет GuildClient)
|
||||
side.Position = compact and UDim2.fromOffset(8, 172) or UDim2.fromOffset(12, 216)
|
||||
side.Size = compact and UDim2.fromOffset(170, 240) or UDim2.fromOffset(70, 480)
|
||||
toasts.Size = compact and UDim2.fromOffset(640, 200) or UDim2.fromOffset(900, 200)
|
||||
H.toastBaseY = compact and 66 or 84
|
||||
toasts.Position = UDim2.new(0.5, 0, 0, H.toastBaseY)
|
||||
scaleOf(toasts).Scale = compact and 0.75 or 1
|
||||
scaleOf(catchCard).Scale = compact and 0.8 or 1
|
||||
scaleOf(mgFrame).Scale = compact and 0.85 or 1
|
||||
mgFrame.Position = compact and UDim2.new(0.5, 0, 1, -60) or UDim2.new(0.5, 0, 1, -100)
|
||||
scaleOf(eventBanner).Scale = compact and 0.8 or 1
|
||||
statusLabel:FindFirstChildOfClass("TextLabel").TextSize = compact and 28 or 36
|
||||
end)
|
||||
end
|
||||
|
||||
local function refreshDots()
|
||||
-- задания цепочки награждаются сами, точка — только для ежедневной награды
|
||||
@@ -1059,18 +1202,18 @@ end
|
||||
local function refreshHud()
|
||||
local xp = player:GetAttribute("XP") or 0
|
||||
local need = player:GetAttribute("XPNeed") or 100
|
||||
coinsText.Text = "💰 " .. fmt(player:GetAttribute("Coins") or 0)
|
||||
lvlText.Text = tostring(player:GetAttribute("Level") or 1)
|
||||
xpText.Text = ("%d / %d XP"):format(xp, need)
|
||||
TweenService:Create(xpFill, TweenInfo.new(0.3), { Size = UDim2.fromScale(math.clamp(xp / need, 0, 1), 1) }):Play()
|
||||
H.coins.Text = "⚪ " .. fmt(player:GetAttribute("Coins") or 0)
|
||||
H.lvl.Text = tostring(player:GetAttribute("Level") or 1)
|
||||
H.xpText.Text = ("%d / %d XP"):format(xp, need)
|
||||
TweenService:Create(H.xpFill, TweenInfo.new(0.3), { Size = UDim2.fromScale(math.clamp(xp / need, 0, 1), 1) }):Play()
|
||||
local boost = player:GetAttribute("BoostBonus") or 0
|
||||
luckText.Text = ("🍀 Удача <b>%d%%</b>%s"):format(player:GetAttribute("Luck") or 100,
|
||||
H.luck.Text = ("🍀 Удача <b>%d%%</b>%s"):format(player:GetAttribute("Luck") or 100,
|
||||
boost > 0 and (" <font color=\"#FFD45A\">🧪 +%d%% %s</font>"):format(boost * 100, timeStr(player:GetAttribute("BoostLeft") or 0)) or "")
|
||||
local count, cap = player:GetAttribute("BagCount") or 0, player:GetAttribute("BagCap") or 10
|
||||
bagText.Text = ("🎒 %d / %d · ≈ %s 💰"):format(count, cap, fmt(player:GetAttribute("BagValue") or 0))
|
||||
bagText.TextColor3 = count >= cap and Color3.fromRGB(255, 120, 120) or C.text
|
||||
H.bag.Text = ("🎒 %d / %d · ≈ %s ⚪"):format(count, cap, fmt(player:GetAttribute("BagValue") or 0))
|
||||
H.bag.TextColor3 = count >= cap and Color3.fromRGB(255, 120, 120) or C.text
|
||||
local rod = Config.Find(Config.Rods, player:GetAttribute("Rod") or "Basic")
|
||||
rodText.Text = ("🎣 %s <font color=\"#FFD45A\">%s</font>"):format(rod and rod.name or "", stars(player:GetAttribute("RodLevel") or 0))
|
||||
H.rod.Text = ("🎣 %s <font color=\"#FFD45A\">%s</font>"):format(rod and rod.name or "", stars(player:GetAttribute("RodLevel") or 0))
|
||||
end
|
||||
|
||||
local pending = false
|
||||
@@ -1150,7 +1293,7 @@ end
|
||||
---------------------------------------------------------------- заброс: зарядка, шкала силы, наклон удочки
|
||||
-- держишь ЛКМ — сила растёт, удочка уходит назад; отпустил — бросок на дальность по силе
|
||||
|
||||
local REST_ANGLE, BACK_ANGLE = 30, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
||||
local REST_ANGLE, BACK_ANGLE = 42, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
||||
local function gripCF(angle)
|
||||
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
|
||||
end
|
||||
@@ -1173,7 +1316,7 @@ end
|
||||
local GAUGE_R, GAUGE_DEG, GAUGE_N = 190, 110, 32
|
||||
local gauge = new("Frame", {
|
||||
Size = UDim2.fromOffset(150, 280), AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0.57, 0, 0.48, 0),
|
||||
BackgroundTransparency = 1, Visible = false, Parent = gui,
|
||||
BackgroundTransparency = 1, Visible = false, Parent = screen,
|
||||
})
|
||||
local GAUGE_C = Vector2.new(110 - GAUGE_R, 140) -- центр окружности левее рамки: дуга выгнута вправо
|
||||
local function arcPoint(v, r)
|
||||
@@ -1358,6 +1501,7 @@ local function setState(s)
|
||||
charge = nil
|
||||
end
|
||||
state = s
|
||||
Audio.fade(reelSound, s == "bite" and 1 or 0, s == "bite" and 0.2 or 0.4)
|
||||
statusLabel.Visible = (s == "waiting")
|
||||
mgFrame.Visible = (s == "bite")
|
||||
gauge.Visible = (s == "charging")
|
||||
@@ -1376,12 +1520,12 @@ local function setState(s)
|
||||
end
|
||||
end
|
||||
local function updatePips()
|
||||
pipsText.Text = "🎯 " .. string.rep("<font color=\"#7CFF9A\">●</font>", mg.hits) .. string.rep("<font color=\"#5A6480\">●</font>", mg.need - mg.hits)
|
||||
missText.Text = string.rep("<font color=\"#5A6480\">✖</font>", mg.misses) .. string.rep("❤️", mg.maxMisses - mg.misses)
|
||||
pipsText.Text = "🎯 " .. string.rep("<font color=\"#7CFF9A\">●</font>", mg.hits) .. string.rep("<font color=\"#6E5A44\">●</font>", mg.need - mg.hits)
|
||||
missText.Text = string.rep("<font color=\"#6E5A44\">✖</font>", mg.misses) .. string.rep("❤️", mg.maxMisses - mg.misses)
|
||||
end
|
||||
local function flash(color)
|
||||
bar.BackgroundColor3 = color
|
||||
TweenService:Create(bar, TweenInfo.new(0.35), { BackgroundColor3 = Color3.fromRGB(22, 28, 46) }):Play()
|
||||
TweenService:Create(bar, TweenInfo.new(0.35), { BackgroundColor3 = C.dark }):Play()
|
||||
end
|
||||
local function placeZone()
|
||||
mg.zoneStart = math.random() * (1 - mg.zoneWidth)
|
||||
@@ -1455,6 +1599,24 @@ local function onActivate()
|
||||
end
|
||||
end
|
||||
|
||||
-- клик пришёлся на видимый элемент интерфейса (кнопка, панель, картинка), а не в мир
|
||||
local GuiService = game:GetService("GuiService")
|
||||
local function pointerOverGui()
|
||||
local pos = UserInputService:GetMouseLocation() - GuiService:GetGuiInset()
|
||||
for _, g in ipairs(player.PlayerGui:GetGuiObjectsAtPosition(pos.X, pos.Y)) do
|
||||
if g.Visible and (g:IsA("GuiButton") or g:IsA("TextBox") or g.BackgroundTransparency < 0.95
|
||||
or (g:IsA("ImageLabel") and g.ImageTransparency < 0.95)) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- пока открыто любое окно (сумка, магазин, настройки, гильдия...), клики по удочке не работают
|
||||
local function menuOpen()
|
||||
return openWindow ~= nil and openWindow.isOpen()
|
||||
end
|
||||
|
||||
local hooked = setmetatable({}, { __mode = "k" })
|
||||
local function hookTool(tool)
|
||||
if hooked[tool] or not tool:IsA("Tool") or not tool:GetAttribute("IsRod") then
|
||||
@@ -1462,7 +1624,13 @@ local function hookTool(tool)
|
||||
end
|
||||
hooked[tool] = true
|
||||
tool.Activated:Connect(function()
|
||||
if menuOpen() then
|
||||
return
|
||||
end
|
||||
if state == "idle" then
|
||||
if pointerOverGui() then
|
||||
return -- нажали кнопку или панель интерфейса — это не заброс
|
||||
end
|
||||
startCharge(tool)
|
||||
else
|
||||
onActivate()
|
||||
@@ -1590,6 +1758,17 @@ local function setLook(obj, goal, instant)
|
||||
end
|
||||
end
|
||||
|
||||
-- погода сгущает дымку поверх настроек локации (туман — сильно, дождь и гроза — слегка)
|
||||
local WEATHER_ATMO = {
|
||||
Fog = { Density = 0.22, Haze = 1.5 },
|
||||
Rain = { Density = 0.06, Haze = 0.4 },
|
||||
Storm = { Density = 0.12, Haze = 0.8 },
|
||||
}
|
||||
local function weatherAtmo(prop)
|
||||
local add = WEATHER_ATMO[workspace:GetAttribute("Weather") or ""]
|
||||
return (add and add[prop]) or 0
|
||||
end
|
||||
|
||||
local function applyLook(world, instant)
|
||||
-- исходные значения запоминаем до первой правки; эффект мог ещё не прийти с сервера, тогда в следующий раз
|
||||
for _, w in ipairs(lookSources) do
|
||||
@@ -1613,6 +1792,9 @@ local function applyLook(world, instant)
|
||||
for prop, def in pairs(defaults) do
|
||||
local v = look[section] and look[section][prop]
|
||||
if v == nil then v = def end
|
||||
if section == "atmosphere" and typeof(v) == "number" then
|
||||
v += weatherAtmo(prop)
|
||||
end
|
||||
-- плавно меняются только числа и цвета; флаги и режимы (EnumItem) ставим сразу
|
||||
local kind = typeof(v)
|
||||
if kind == "number" or kind == "Color3" then goal[prop] = v else obj[prop] = v end
|
||||
@@ -1629,8 +1811,10 @@ local function applyAmbience(world, instant)
|
||||
end
|
||||
table.clear(lookTweens)
|
||||
world = world or Config.Lobby
|
||||
local clock = (world and world.clock) or 14.5
|
||||
setLook(Lighting, { ClockTime = clock }, instant)
|
||||
-- при смене суток часы двигает Ambience; иначе у каждой локации своё время
|
||||
if not Config.DayNight.enabled then
|
||||
setLook(Lighting, { ClockTime = (world and world.clock) or 14.5 }, instant)
|
||||
end
|
||||
local cc = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||
if cc then
|
||||
setLook(cc, { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }, instant)
|
||||
@@ -1734,6 +1918,25 @@ local function enterWorld(w, instant)
|
||||
end
|
||||
end
|
||||
|
||||
-- погода сменилась: плавно пересчитываем дымку текущей локации
|
||||
workspace:GetAttributeChangedSignal("Weather"):Connect(function()
|
||||
if lastWorldId ~= "none" and not loadingVisible() then
|
||||
applyAmbience(currentWorld(), false)
|
||||
end
|
||||
end)
|
||||
|
||||
-- новый уровень — арфа
|
||||
do
|
||||
local lastLevel = player:GetAttribute("Level")
|
||||
player:GetAttributeChangedSignal("Level"):Connect(function()
|
||||
local lv = player:GetAttribute("Level")
|
||||
if lastLevel and lv and lv > lastLevel then
|
||||
Audio.play("levelUp")
|
||||
end
|
||||
lastLevel = lv
|
||||
end)
|
||||
end
|
||||
|
||||
-- первое появление: ждём персонажа, ставим свет его локации сразу и отпускаем экран загрузки
|
||||
task.spawn(function()
|
||||
local char = player.Character or player.CharacterAdded:Wait()
|
||||
@@ -1811,10 +2014,13 @@ local guideStep = 0 -- шаг, отправленный на сервер (ат
|
||||
|
||||
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
|
||||
local guideHint, guideHintText = softPlate(
|
||||
{ Size = UDim2.fromOffset(0, 70), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 10), Visible = false, Parent = gui },
|
||||
{ Size = UDim2.fromOffset(0, 70), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 10), Visible = false, Parent = screen },
|
||||
{ TextSize = 42, Text = "" }
|
||||
)
|
||||
wobble(guideHint, 1.2, 1.6)
|
||||
Theme.onLayout(function(compact)
|
||||
guideHintText.TextSize = compact and 30 or 42
|
||||
end)
|
||||
local lastHint = nil
|
||||
|
||||
local guideFolder = new("Folder", { Name = "TutorialGuide", Parent = workspace })
|
||||
@@ -2015,7 +2221,7 @@ local function guideRoute(step, pos, world)
|
||||
elseif step == 2 and inW1 then
|
||||
return { guideMarker("GuideFishSpot") }, "🎣 Зажми ЛКМ у воды", "Pier"
|
||||
elseif step == 3 and inW1 then
|
||||
return { sellTargetW1() }, "💰 Продай рыбу", "Sell" -- лавка у самого причала, идём напрямую
|
||||
return { sellTargetW1() }, "⚪ Продай рыбу", "Sell" -- лавка у самого причала, идём напрямую
|
||||
end
|
||||
return nil
|
||||
end
|
||||
@@ -2180,11 +2386,11 @@ local FIRE = Color3.fromRGB(255, 150, 60)
|
||||
|
||||
-- серия улова — справа от HUD; полоска показывает, сколько осталось до того, как серия сгорит
|
||||
local comboBox = new("Frame", {
|
||||
Size = UDim2.fromOffset(140, 66), Position = UDim2.fromOffset(310, 10), BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
Size = UDim2.fromOffset(140, 66), Position = UDim2.fromOffset(310, 10), BackgroundColor3 = WHITE, Visible = false, Parent = screen,
|
||||
}, { corner(14), stroke(FIRE, 2, 0.1), gradient(Color3.fromRGB(110, 50, 20), C.bg, 90) })
|
||||
local comboMultText = text({ Size = UDim2.new(1, 0, 0, 34), Position = UDim2.fromOffset(0, 3), Font = TITLE, TextSize = 28, TextXAlignment = CENTER, TextColor3 = Color3.fromRGB(255, 195, 95), TextStrokeTransparency = 0.5, Text = "", Parent = comboBox })
|
||||
local comboSub = text({ Size = UDim2.new(1, 0, 0, 16), Position = UDim2.fromOffset(0, 36), Font = BODY2, TextSize = 12, TextXAlignment = CENTER, TextColor3 = C.muted, Text = "", Parent = comboBox })
|
||||
local comboBack = new("Frame", { Size = UDim2.new(1, -20, 0, 5), Position = UDim2.new(0, 10, 1, -10), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = comboBox }, { corner(3) })
|
||||
local comboBack = new("Frame", { Size = UDim2.new(1, -20, 0, 5), Position = UDim2.new(0, 10, 1, -10), BackgroundColor3 = C.dark, Parent = comboBox }, { corner(3) })
|
||||
local comboFill = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = FIRE, BorderSizePixel = 0, Parent = comboBack }, { corner(3) })
|
||||
|
||||
local function refreshCombo(pop)
|
||||
@@ -2207,14 +2413,23 @@ refreshCombo(false)
|
||||
-- правая колонка: босс и цели
|
||||
local rightCol = new("Frame", {
|
||||
Size = UDim2.fromOffset(300, 0), AutomaticSize = Enum.AutomaticSize.Y, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -12, 0.5, 10),
|
||||
BackgroundTransparency = 1, Parent = gui,
|
||||
BackgroundTransparency = 1, Parent = screen,
|
||||
}, { new("UIListLayout", { Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
|
||||
-- на телефоне колонка выше и мельче, чтобы не заходить на кнопку прыжка; серия — правее компактного HUD
|
||||
local rightScale = new("UIScale", { Parent = rightCol })
|
||||
Theme.onLayout(function(compact)
|
||||
rightScale.Scale = compact and 0.8 or 1
|
||||
rightCol.AnchorPoint = compact and Vector2.new(1, 0) or Vector2.new(1, 0.5)
|
||||
rightCol.Position = compact and UDim2.new(1, -8, 0, 128) or UDim2.new(1, -12, 0.5, 10)
|
||||
comboBox.Position = compact and UDim2.fromOffset(254, 6) or UDim2.fromOffset(310, 10)
|
||||
end)
|
||||
|
||||
local bossBox = new("Frame", { Size = UDim2.fromOffset(300, 78), BackgroundColor3 = WHITE, Visible = false, LayoutOrder = 1, Parent = rightCol },
|
||||
{ corner(14), stroke(C.red, 2.5, 0.05), gradient(Color3.fromRGB(110, 30, 40), C.bg, 90) })
|
||||
local bossTitle = text({ Size = UDim2.new(1, -80, 0, 24), Position = UDim2.fromOffset(12, 5), Font = TITLE, TextSize = 18, TextColor3 = Color3.fromRGB(255, 205, 120), TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = bossBox })
|
||||
local bossTime = text({ Size = UDim2.fromOffset(60, 24), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 5), Font = TITLE, TextSize = 17, TextXAlignment = RIGHT, Text = "", Parent = bossBox })
|
||||
local bossBack = new("Frame", { Size = UDim2.new(1, -24, 0, 18), Position = UDim2.fromOffset(12, 32), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = bossBox }, { corner(9) })
|
||||
local bossBack = new("Frame", { Size = UDim2.new(1, -24, 0, 18), Position = UDim2.fromOffset(12, 32), BackgroundColor3 = C.dark, Parent = bossBox }, { corner(9) })
|
||||
local bossFill = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = WHITE, Parent = bossBack }, { corner(9), gradient(Color3.fromRGB(255, 120, 90), Color3.fromRGB(190, 30, 50), 0) })
|
||||
local bossHpText = text({ Size = UDim2.fromScale(1, 1), TextSize = 12, TextXAlignment = CENTER, ZIndex = 2, TextStrokeTransparency = 0.5, Text = "", Parent = bossBack })
|
||||
local bossHint = text({ Size = UDim2.new(1, -24, 0, 18), Position = UDim2.fromOffset(12, 54), Font = BODY2, TextSize = 12, TextColor3 = C.muted, Text = "", Parent = bossBox })
|
||||
@@ -2229,7 +2444,7 @@ text({ Size = UDim2.new(1, 0, 0, 20), LayoutOrder = 0, Font = TITLE, TextSize =
|
||||
local function trackerLine(order, onClick)
|
||||
local root = new("TextButton", { Size = UDim2.new(1, 0, 0, 38), BackgroundTransparency = 1, AutoButtonColor = false, Text = "", LayoutOrder = order, Parent = tracker })
|
||||
local label = text({ Size = UDim2.new(1, 0, 0, 22), Font = BODY, TextSize = 14, RichText = true, TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = root })
|
||||
local back = new("Frame", { Size = UDim2.new(1, 0, 0, 8), Position = UDim2.fromOffset(0, 26), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = root }, { corner(4) })
|
||||
local back = new("Frame", { Size = UDim2.new(1, 0, 0, 8), Position = UDim2.fromOffset(0, 26), BackgroundColor3 = C.dark, Parent = root }, { corner(4) })
|
||||
local fill = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = C.gold, BorderSizePixel = 0, Parent = back }, { corner(4) })
|
||||
if onClick then
|
||||
root.MouseButton1Click:Connect(onClick)
|
||||
@@ -2284,7 +2499,7 @@ local function buyGoal()
|
||||
elseif coins >= r.price then
|
||||
return ("🎣 <b>%s</b> — можно купить!"):format(r.name), 1, C.green
|
||||
end
|
||||
return ("🎣 До «%s»: ещё <b>%s</b> 💰"):format(r.name, fmt(r.price - coins)), coins / r.price, C.gold
|
||||
return ("🎣 До «%s»: ещё <b>%s</b> ⚪"):format(r.name, fmt(r.price - coins)), coins / r.price, C.gold
|
||||
end
|
||||
end
|
||||
local rod = Config.Find(Config.Rods, player:GetAttribute("Rod") or "Basic")
|
||||
@@ -2294,7 +2509,7 @@ local function buyGoal()
|
||||
if coins >= cost then
|
||||
return ("✨ Улучшение до +%d — можно купить!"):format(rl + 1), 1, C.green
|
||||
end
|
||||
return ("✨ До улучшения +%d: ещё <b>%s</b> 💰"):format(rl + 1, fmt(cost - coins)), coins / cost, C.gold
|
||||
return ("✨ До улучшения +%d: ещё <b>%s</b> ⚪"):format(rl + 1, fmt(cost - coins)), coins / cost, C.gold
|
||||
end
|
||||
return nil
|
||||
end
|
||||
@@ -2438,7 +2653,7 @@ end)
|
||||
-- у скупщика после продажи: предложение купить то, на что уже хватает
|
||||
local offerCard = new("Frame", {
|
||||
Size = UDim2.fromOffset(440, 96), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -110),
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = screen,
|
||||
}, { corner(16), stroke(C.green, 2.5, 0.05), gradient(Color3.fromRGB(30, 85, 55), C.bg, 90) })
|
||||
local offerIcon = text({ Size = UDim2.fromOffset(70, 70), Position = UDim2.fromOffset(12, 13), TextSize = 46, TextXAlignment = CENTER, Text = "", Parent = offerCard })
|
||||
local offerTitle = text({ Size = UDim2.new(1, -250, 0, 26), Position = UDim2.fromOffset(90, 12), Font = TITLE, TextSize = 19, TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = offerCard })
|
||||
@@ -2451,11 +2666,11 @@ end
|
||||
local offerBuy = btn({ Size = UDim2.fromOffset(146, 52), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -14, 0.5, 0), BackgroundColor3 = C.green, TextSize = 18, Text = "", Parent = offerCard }, function()
|
||||
if offerItem then
|
||||
remote:FireServer("Buy", offerItem.kind, offerItem.id)
|
||||
playUiSound(DING, 0.5)
|
||||
Audio.play("coins")
|
||||
end
|
||||
hideOffer()
|
||||
end)
|
||||
btn({ Size = UDim2.fromOffset(26, 26), Position = UDim2.new(1, -18, 0, -8), BackgroundColor3 = C.red, Text = "✕", TextSize = 14, Parent = offerCard }, hideOffer)
|
||||
btn({ Size = UDim2.fromOffset(26, 26), Position = UDim2.new(1, -18, 0, -8), BackgroundColor3 = C.red, Text = "×", TextSize = 22, Parent = offerCard }, hideOffer)
|
||||
|
||||
bestOffer = function(bagWasFull)
|
||||
local coins, lvl = player:GetAttribute("Coins") or 0, player:GetAttribute("Level") or 1
|
||||
@@ -2507,7 +2722,7 @@ showOffer = function(o)
|
||||
offerIcon.Text = o.icon
|
||||
offerTitle.Text = o.title
|
||||
offerDesc.Text = o.desc
|
||||
offerBuy.Text = ("Купить · %s 💰"):format(fmt(o.price))
|
||||
offerBuy.Text = ("Купить · %s ⚪"):format(fmt(o.price))
|
||||
offerCard.Visible = true
|
||||
popIn(offerCard, 0.6)
|
||||
task.delay(9, function()
|
||||
@@ -2532,9 +2747,13 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
elseif action == "TeleportFade" then
|
||||
teleportLoading(a, b)
|
||||
elseif action == "Cast" then
|
||||
Audio.play("cast")
|
||||
setState("waiting")
|
||||
startCastCam(a, b)
|
||||
elseif action == "CastFail" or action == "Cancel" or action == "Escaped" then
|
||||
if action == "Escaped" then
|
||||
Audio.play("escape")
|
||||
end
|
||||
if action == "CastFail" and castTool and castTool.Parent then
|
||||
castTool.Grip = gripCF(REST_ANGLE) -- сервер удочку не трогал, а у нас она в замахе
|
||||
end
|
||||
@@ -2551,17 +2770,24 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
mg.pos, mg.dir = 0, 1
|
||||
placeZone()
|
||||
updatePips()
|
||||
Audio.play("bite")
|
||||
setState("bite")
|
||||
elseif action == "Caught" then
|
||||
setState("idle")
|
||||
showCatch(a, b)
|
||||
playUiSound(DING, 0.5)
|
||||
Audio.play("catchSplash")
|
||||
local r = Config.Rarities[a.rarity]
|
||||
Audio.play((r and r.rank >= 4) and "fanfare" or "catch")
|
||||
if a.mutation then
|
||||
Audio.play("sparkle")
|
||||
end
|
||||
elseif action == "Sold" then
|
||||
Audio.play("coins")
|
||||
if tutorialStep() == 3 then
|
||||
advanceTutorial(Config.TutorialDone)
|
||||
end
|
||||
floatText("+" .. fmt(a) .. " 💰", C.gold)
|
||||
notify(("💰 +%s"):format(fmt(a)), Color3.fromRGB(120, 255, 140))
|
||||
floatText("+" .. fmt(a) .. " ⚪", C.gold)
|
||||
notify(("⚪ +%s"):format(fmt(a)), Color3.fromRGB(120, 255, 140))
|
||||
-- монеты приходят атрибутом чуть позже события, поэтому предложение — с задержкой
|
||||
local wasFull = offerState.bagWasFull
|
||||
offerState.bagWasFull = false
|
||||
@@ -2590,17 +2816,17 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
refreshDots()
|
||||
refreshTracker()
|
||||
elseif action == "QuestDone" then
|
||||
notify(("✅ %s +%s 💰 +%s XP"):format(questText(a, b), fmt(c), fmt(d or 0)), Color3.fromRGB(120, 255, 140))
|
||||
playUiSound(DING, 0.6)
|
||||
notify(("✅ %s +%s ⚪ +%s XP"):format(questText(a, b), fmt(c), fmt(d or 0)), Color3.fromRGB(120, 255, 140))
|
||||
Audio.play("quest")
|
||||
elseif action == "ChainDone" then
|
||||
floatText("🏆 Цепочка пройдена!", C.gold)
|
||||
notify(("🎁 %s: +%s 💰 +%s XP%s"):format(a, fmt(b), fmt(c), d and (" + " .. d) or ""), C.gold)
|
||||
playUiSound(DING, 0.8)
|
||||
notify(("🎁 %s: +%s ⚪ +%s XP%s"):format(a, fmt(b), fmt(c), d and (" + " .. d) or ""), C.gold)
|
||||
Audio.play("fanfare")
|
||||
elseif action == "ComboLost" then
|
||||
notify(("💔 Серия из %d прервана"):format(a), Color3.fromRGB(255, 130, 110))
|
||||
elseif action == "BossStart" then
|
||||
notify(("👑 %s в мире «%s»! Ловите всем сервером"):format(a, b), C.gold)
|
||||
playUiSound(DING, 0.8)
|
||||
Audio.play("quest")
|
||||
elseif action == "BossHit" then
|
||||
floatText(("⚔ -%d боссу"):format(a), Color3.fromRGB(255, 130, 100))
|
||||
elseif action == "BossDone" then
|
||||
@@ -2610,7 +2836,7 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
notify(("🌊 %s ушёл на глубину…"):format(b), C.muted)
|
||||
end
|
||||
elseif action == "BossReward" then
|
||||
notify(("🎁 За босса: +%s 💰 +%s XP%s"):format(fmt(a), fmt(b), c and (" + " .. c) or ""), Color3.fromRGB(120, 255, 140))
|
||||
notify(("🎁 За босса: +%s ⚪ +%s XP%s"):format(fmt(a), fmt(b), c and (" + " .. c) or ""), Color3.fromRGB(120, 255, 140))
|
||||
elseif action == "OpenShop" then
|
||||
shopWin.open("rods")
|
||||
elseif action == "OpenQuests" then
|
||||
|
||||
@@ -701,6 +701,125 @@ function Builder.stallParts(cf, parent)
|
||||
return list
|
||||
end
|
||||
|
||||
-- Доска лидеров (low poly): два столба, двускатная крыша, табличка с названием, фонарики и экран на rows строк.
|
||||
-- cf стоит на полу и смотрит LookVector на зрителей. Строки Row1…RowN заполняет Leaderboards.server.lua.
|
||||
function Builder.leaderboard(cf, board, rows, parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "Leaderboard_" .. board.id
|
||||
model:SetAttribute("Leaderboard", board.id)
|
||||
local function part(props)
|
||||
local p = Instance.new(props.Class or "Part")
|
||||
p.Anchored = true
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
p.Material = Enum.Material.SmoothPlastic
|
||||
for k, v in pairs(props) do
|
||||
if k ~= "Class" and k ~= "At" then
|
||||
p[k] = v
|
||||
end
|
||||
end
|
||||
p.CFrame = cf * props.At
|
||||
p.Parent = model
|
||||
return p
|
||||
end
|
||||
local WOOD, DARK, TRIM = Color3.fromRGB(122, 82, 50), Color3.fromRGB(58, 38, 26), Color3.fromRGB(176, 122, 66)
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
part({ Name = "Foot", Size = V(2.2, 1, 2.2), At = CFrame.new(s * 6.6, 0.5, 0), Color = Color3.fromRGB(128, 118, 122) })
|
||||
part({ Name = "Post", Size = V(1.3, 16.5, 1.3), At = CFrame.new(s * 6.6, 8.25, 0), Color = WOOD })
|
||||
-- фонарик на столбе
|
||||
local lamp = part({ Name = "Lantern", Size = V(0.9, 1.2, 0.9), At = CFrame.new(s * 6.6, 14.2, -0.95),
|
||||
Material = Enum.Material.Neon, Color = Color3.fromRGB(255, 196, 110), CanCollide = false })
|
||||
part({ Name = "LanternCap", Size = V(1.2, 0.3, 1.2), At = CFrame.new(s * 6.6, 14.95, -0.95), Color = DARK, CanCollide = false })
|
||||
local light = Instance.new("PointLight")
|
||||
light.Range, light.Brightness, light.Color = 12, 0.9, Color3.fromRGB(255, 190, 110)
|
||||
light.Parent = lamp
|
||||
end
|
||||
local screen = part({ Name = "Screen", Size = V(12, 9.6, 0.5), At = CFrame.new(0, 9.4, 0), Color = DARK })
|
||||
part({ Name = "Trim", Size = V(13.4, 0.6, 0.8), At = CFrame.new(0, 14.5, 0), Color = TRIM })
|
||||
part({ Name = "Trim", Size = V(13.4, 0.6, 0.8), At = CFrame.new(0, 4.3, 0), Color = TRIM })
|
||||
local plaque = part({ Name = "Plaque", Size = V(11, 2.3, 0.7), At = CFrame.new(0, 16.2, -0.1), Color = WOOD })
|
||||
part({ Name = "PlaqueTrim", Size = V(11.6, 2.8, 0.5), At = CFrame.new(0, 16.2, 0.15), Color = TRIM })
|
||||
-- двускатная крыша
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
part({ Name = "Roof", Size = V(8, 0.5, 2.6), At = CFrame.new(s * 3.55, 18.35, 0) * CFrame.Angles(0, 0, math.rad(-s * 17)),
|
||||
Color = Color3.fromRGB(150, 70, 52) })
|
||||
end
|
||||
|
||||
-- заголовок
|
||||
local titleGui = Instance.new("SurfaceGui")
|
||||
titleGui.Face = Enum.NormalId.Front
|
||||
titleGui.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
|
||||
titleGui.PixelsPerStud = 40
|
||||
titleGui.LightInfluence = 0
|
||||
titleGui.Parent = plaque
|
||||
local title = Instance.new("TextLabel")
|
||||
title.Size = UDim2.new(1, -16, 1, -8)
|
||||
title.Position = UDim2.fromOffset(8, 4)
|
||||
title.BackgroundTransparency = 1
|
||||
title.Font = Enum.Font.FredokaOne
|
||||
title.TextScaled = true
|
||||
title.Text = board.title
|
||||
title.TextColor3 = board.color
|
||||
title.Parent = titleGui
|
||||
local ts = Instance.new("UIStroke")
|
||||
ts.Color, ts.Thickness = Color3.fromRGB(40, 22, 10), 3
|
||||
ts.Parent = title
|
||||
|
||||
-- строки топа
|
||||
local gui = Instance.new("SurfaceGui")
|
||||
gui.Name = "Rows"
|
||||
gui.Face = Enum.NormalId.Front
|
||||
gui.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
|
||||
gui.PixelsPerStud = 40
|
||||
gui.LightInfluence = 0.2
|
||||
gui.Parent = screen
|
||||
local list = Instance.new("Frame")
|
||||
list.Size = UDim2.new(1, -24, 1, -20)
|
||||
list.Position = UDim2.fromOffset(12, 10)
|
||||
list.BackgroundTransparency = 1
|
||||
list.Parent = gui
|
||||
local layout = Instance.new("UIListLayout")
|
||||
layout.Padding = UDim.new(0, 3)
|
||||
layout.SortOrder = Enum.SortOrder.LayoutOrder
|
||||
layout.Parent = list
|
||||
local RANK_COLOR = { Color3.fromRGB(255, 210, 80), Color3.fromRGB(215, 225, 235), Color3.fromRGB(230, 150, 90) }
|
||||
for i = 1, rows do
|
||||
local row = Instance.new("Frame")
|
||||
row.Name = "Row" .. i
|
||||
row.LayoutOrder = i
|
||||
row.Size = UDim2.new(1, 0, 1 / rows, -3)
|
||||
row.BackgroundColor3 = Color3.fromRGB(255, 240, 210)
|
||||
row.BackgroundTransparency = (i % 2 == 0) and 0.94 or 0.88
|
||||
row.BorderSizePixel = 0
|
||||
row.Parent = list
|
||||
local corner = Instance.new("UICorner")
|
||||
corner.CornerRadius = UDim.new(0, 6)
|
||||
corner.Parent = row
|
||||
local color = RANK_COLOR[i] or Color3.fromRGB(245, 232, 205)
|
||||
local function label(name, pos, size, align, text)
|
||||
local t = Instance.new("TextLabel")
|
||||
t.Name = name
|
||||
t.Position, t.Size = pos, size
|
||||
t.BackgroundTransparency = 1
|
||||
t.Font = Enum.Font.FredokaOne
|
||||
t.TextScaled = true
|
||||
t.TextXAlignment = align
|
||||
t.TextColor3 = color
|
||||
t.Text = text
|
||||
t.Parent = row
|
||||
return t
|
||||
end
|
||||
label("Rank", UDim2.new(0, 6, 0.1, 0), UDim2.new(0, 46, 0.8, 0), Enum.TextXAlignment.Center, ({ "🥇", "🥈", "🥉" })[i] or (i .. "."))
|
||||
label("PlayerName", UDim2.new(0, 58, 0.12, 0), UDim2.new(0.58, -58, 0.76, 0), Enum.TextXAlignment.Left, "—")
|
||||
label("Value", UDim2.new(0.58, 0, 0.12, 0), UDim2.new(0.42, -8, 0.76, 0), Enum.TextXAlignment.Right, "")
|
||||
end
|
||||
-- опора модели — экран, точка опоры на земле под центром доски и без наклона:
|
||||
-- иначе Studio берёт поворот случайной детали (ската крыши) и стрелки инструментов встают наискосок
|
||||
model.PrimaryPart = screen
|
||||
screen.PivotOffset = CFrame.new(0, -9.4, 0)
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
|
||||
-- лавка: cf стоит на полу, сторона -Z смотрит на покупателей
|
||||
local function stall(cf, opt)
|
||||
local function at(x, y, z)
|
||||
@@ -1017,6 +1136,12 @@ function Builder.build()
|
||||
lobbyTrees()
|
||||
lobbyRockPlants()
|
||||
lobbyHills()
|
||||
-- доски лидеров у подножия скал напротив точки появления
|
||||
for i, b in ipairs(Config.Leaderboards.boards) do
|
||||
local a = math.rad(({ 220, 270, 320 })[i] or 270)
|
||||
local p = V(math.cos(a) * 71, FLOOR, math.sin(a) * 71)
|
||||
Builder.leaderboard(CFrame.lookAt(p, V(0, FLOOR, 0)), b, Config.Leaderboards.size, map)
|
||||
end
|
||||
|
||||
-- магазин (запад) и скупка (восток)
|
||||
stall(CFrame.lookAt(V(-62, FLOOR, 0), V(0, FLOOR, 0)), {
|
||||
@@ -1153,12 +1278,31 @@ function Builder.build()
|
||||
-- сундук с ежедневной наградой
|
||||
do
|
||||
local cf = CFrame.lookAt(V(14, FLOOR, 34), V(0, FLOOR, 50))
|
||||
local base = P({ Size = V(5, 3, 3.2), CFrame = cf * CFrame.new(0, 1.5, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 90, 50) })
|
||||
P({ Shape = Enum.PartType.Cylinder, Size = V(5, 3.2, 3.2), CFrame = cf * CFrame.new(0, 3, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(160, 105, 60) })
|
||||
for _, x in ipairs({ -1.8, 1.8 }) do
|
||||
P({ Size = V(0.4, 4.9, 3.4), CFrame = cf * CFrame.new(x, 2.3, 0), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 200, 60) })
|
||||
local template = ServerStorage:FindFirstChild("DailyChestTemplate")
|
||||
local base
|
||||
if template and template:IsA("Model") then
|
||||
-- low poly сундук (Base, Lid, Coins, Lock; замок по +Z модели, опора — низ по центру);
|
||||
-- его анимирует ChestAnimation.client.lua, подсказка и подпись — на невидимой детали
|
||||
local chest = template:Clone()
|
||||
chest.Name = "DailyChest"
|
||||
chest:SetAttribute("DailyChest", true)
|
||||
chest:PivotTo(cf * CFrame.Angles(0, math.pi, 0))
|
||||
for _, p in ipairs(chest:GetDescendants()) do
|
||||
if p:IsA("BasePart") then
|
||||
p.Anchored = true
|
||||
p.CanCollide = p.Name == "Base"
|
||||
end
|
||||
end
|
||||
chest.Parent = map
|
||||
base = P({ Name = "DailyChestPrompt", Size = V(5, 3, 3.2), CFrame = cf * CFrame.new(0, 1.5, 0), Transparency = 1, CanCollide = false })
|
||||
else
|
||||
base = P({ Size = V(5, 3, 3.2), CFrame = cf * CFrame.new(0, 1.5, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 90, 50) })
|
||||
P({ Shape = Enum.PartType.Cylinder, Size = V(5, 3.2, 3.2), CFrame = cf * CFrame.new(0, 3, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(160, 105, 60) })
|
||||
for _, x in ipairs({ -1.8, 1.8 }) do
|
||||
P({ Size = V(0.4, 4.9, 3.4), CFrame = cf * CFrame.new(x, 2.3, 0), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 200, 60) })
|
||||
end
|
||||
P({ Size = V(0.9, 1.1, 0.3), CFrame = cf * CFrame.new(0, 2.8, -1.7), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 220, 90) })
|
||||
end
|
||||
P({ Size = V(0.9, 1.1, 0.3), CFrame = cf * CFrame.new(0, 2.8, -1.7), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 220, 90) })
|
||||
local sp = Instance.new("ParticleEmitter")
|
||||
sp.Texture = "rbxasset://textures/particles/sparkles_main.dds"
|
||||
sp.Rate = 8
|
||||
@@ -1795,6 +1939,7 @@ local function spawnNpc(spot, parent)
|
||||
return nil
|
||||
end
|
||||
rig.Name = name
|
||||
rig:SetAttribute("Npc", true) -- по нему клиент находит NPC (взгляд на игрока, приветствие), сервер — включает idle
|
||||
local hum = rig:FindFirstChildOfClass("Humanoid")
|
||||
hum.DisplayName = name
|
||||
hum.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
|
||||
@@ -1828,9 +1973,29 @@ local function spawnNpc(spot, parent)
|
||||
w.C0 = head.CFrame:Inverse() * p.CFrame
|
||||
w.Parent = p
|
||||
p.Parent = rig
|
||||
return p
|
||||
end
|
||||
if spot:GetAttribute("Look") == "Elder" then
|
||||
-- Старейшина Ворон: седые волосы и борода (цвет HatColor), чёрная повязка на глазу
|
||||
local function elderPart(size, offset, color, shape)
|
||||
local p = hatPart(size, offset, shape or Enum.PartType.Block)
|
||||
p.Color = color
|
||||
p.Material = Enum.Material.SmoothPlastic
|
||||
end
|
||||
elderPart(V(1.25, 0.35, 1.25), CFrame.new(0, 0.55, 0.05), colors.hat)
|
||||
elderPart(V(1.0, 0.75, 0.35), CFrame.new(0, -0.55, -0.5), colors.hat)
|
||||
elderPart(V(0.32, 0.3, 0.08), CFrame.new(0.22, 0.12, -0.6), Color3.fromRGB(20, 20, 22))
|
||||
elderPart(V(1.24, 0.08, 1.24), CFrame.new(0, 0.18, 0) * CFrame.Angles(0, 0, math.rad(-12)), Color3.fromRGB(20, 20, 22))
|
||||
elseif spot:GetAttribute("Look") == "Scarf" then
|
||||
-- платок (цвет HatColor): макушка и узелок сзади
|
||||
local s = hatPart(V(1.3, 0.5, 1.3), CFrame.new(0, 0.42, 0.05), Enum.PartType.Block)
|
||||
s.Material = Enum.Material.SmoothPlastic
|
||||
local k = hatPart(V(0.4, 0.4, 0.3), CFrame.new(0, 0.05, 0.62), Enum.PartType.Block)
|
||||
k.Material = Enum.Material.SmoothPlastic
|
||||
else
|
||||
hatPart(V(0.15, 2.0, 2.0), CFrame.new(0, 0.55, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
hatPart(V(0.6, 1.35, 1.35), CFrame.new(0, 0.85, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
end
|
||||
hatPart(V(0.15, 2.0, 2.0), CFrame.new(0, 0.55, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
hatPart(V(0.6, 1.35, 1.35), CFrame.new(0, 0.85, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
end
|
||||
local action = spot:GetAttribute("NpcAction")
|
||||
if action then
|
||||
@@ -1838,6 +2003,7 @@ local function spawnNpc(spot, parent)
|
||||
end
|
||||
return rig
|
||||
end
|
||||
Builder.spawnNpc = spawnNpc -- жители лобби (LobbyLife.server.lua) создаются так же
|
||||
|
||||
-- NPC встают на свои детали-места, доски «кто водится» получают актуальный список рыб
|
||||
function Builder.prepareRuntime(root)
|
||||
@@ -1855,6 +2021,23 @@ function Builder.prepareRuntime(root)
|
||||
spot.Transparency = 1
|
||||
spawnNpc(spot, root)
|
||||
end
|
||||
-- порталы лобби двигают в Studio за модель (PortalModel_WorldN); невидимый якорь с подсказкой и подписью
|
||||
-- (Portal_WorldN) и маркер стрелки обучения (GuidePortal, перед порталом в мир 1) встают к модели
|
||||
for _, model in ipairs(root:GetChildren()) do
|
||||
local id = model.Name:match("^PortalModel_(World%d)$")
|
||||
local anchor = id and root:FindFirstChild("Portal_" .. id)
|
||||
if model:IsA("Model") and anchor then
|
||||
local cf, size = model:GetBoundingBox()
|
||||
anchor.CFrame = CFrame.new(cf.Position.X, cf.Position.Y - size.Y / 2 + 10, cf.Position.Z) * (anchor.CFrame - anchor.Position)
|
||||
local marker = id == "World1" and root:FindFirstChild("GuidePortal", true)
|
||||
if marker then
|
||||
local flat = V(cf.Position.X, 0, cf.Position.Z)
|
||||
local outward = flat.Magnitude > 0.1 and flat.Unit or V(0, 0, 1)
|
||||
local p = flat + outward * 5.7
|
||||
marker.CFrame = CFrame.new(p.X, marker.Position.Y, p.Z) * (marker.CFrame - marker.Position)
|
||||
end
|
||||
end
|
||||
end
|
||||
for _, board in ipairs(boards) do
|
||||
writeBestiary(board)
|
||||
end
|
||||
|
||||
@@ -43,13 +43,18 @@ 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 })
|
||||
-- фон: заставка «Рыболовная лихорадка»; пока картинка грузится, виден голубой градиент.
|
||||
-- Градиент — на отдельной подложке: UIGradient на самой CanvasGroup тонирует всё содержимое и затемнял картинку.
|
||||
-- Свет и цветокоррекция сцены на экранный интерфейс не действуют, их не трогаем.
|
||||
local BG_IMAGE = "rbxassetid://82266337853896" -- осветлённая и более насыщенная версия заставки
|
||||
-- обычный Frame, а не CanvasGroup: CanvasGroup рендерит содержимое в текстуру пониженного разрешения — картинка мылится.
|
||||
-- Плавное появление/исчезновение делаем сами (setFade ниже).
|
||||
local root = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, BorderSizePixel = 0, Parent = gui })
|
||||
local backdrop = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, Parent = root })
|
||||
new("UIGradient", {
|
||||
Rotation = 90,
|
||||
Color = ColorSequence.new(Color3.fromRGB(120, 200, 255), Color3.fromRGB(255, 170, 110)),
|
||||
Parent = root,
|
||||
Color = ColorSequence.new(Color3.fromRGB(70, 140, 230), Color3.fromRGB(40, 70, 150)),
|
||||
Parent = backdrop,
|
||||
})
|
||||
local bg = new("ImageLabel", {
|
||||
Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Image = BG_IMAGE,
|
||||
@@ -62,13 +67,14 @@ 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,
|
||||
BackgroundColor3 = Color3.new(1, 1, 1), BackgroundTransparency = 0.12, 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)),
|
||||
Color = ColorSequence.new(Color3.fromRGB(40, 66, 140), Color3.fromRGB(20, 32, 78)),
|
||||
Parent = panel,
|
||||
})
|
||||
local float = new("TextLabel", {
|
||||
@@ -80,10 +86,10 @@ local title = new("TextLabel", {
|
||||
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 })
|
||||
new("UIStroke", { Color = Color3.fromRGB(15, 22, 55), 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,
|
||||
BackgroundColor3 = Color3.fromRGB(10, 16, 40), 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 })
|
||||
@@ -91,7 +97,7 @@ 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,
|
||||
Text = "", TextColor3 = Color3.fromRGB(205, 222, 255), TextScaled = true,
|
||||
Font = Enum.Font.GothamMedium, Parent = panel,
|
||||
})
|
||||
|
||||
@@ -100,6 +106,74 @@ local function showTip()
|
||||
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
||||
end
|
||||
|
||||
-- плавность без CanvasGroup: запоминаем исходную прозрачность каждого элемента и смешиваем её с 1
|
||||
local fadeProps = { "BackgroundTransparency", "ImageTransparency", "TextTransparency", "TextStrokeTransparency" }
|
||||
local fadeItems = {}
|
||||
for _, o in ipairs(root:GetDescendants()) do
|
||||
local orig = {}
|
||||
for _, prop in ipairs(o:IsA("UIStroke") and { "Transparency" } or fadeProps) do
|
||||
local ok, v = pcall(function() return o[prop] end)
|
||||
if ok and type(v) == "number" then
|
||||
orig[prop] = v
|
||||
end
|
||||
end
|
||||
if next(orig) then
|
||||
fadeItems[o] = orig
|
||||
end
|
||||
end
|
||||
local fadeValue = Instance.new("NumberValue") -- 0 — экран виден, 1 — прозрачен
|
||||
local function setFade(a)
|
||||
for o, orig in pairs(fadeItems) do
|
||||
for prop, v in pairs(orig) do
|
||||
o[prop] = v + (1 - v) * a
|
||||
end
|
||||
end
|
||||
end
|
||||
fadeValue.Changed:Connect(setFade)
|
||||
local function fadeTo(a, time)
|
||||
local tw = TweenService:Create(fadeValue, TweenInfo.new(time), { Value = a })
|
||||
tw:Play()
|
||||
return tw
|
||||
end
|
||||
|
||||
-- HUD Roblox (хотбар, чат, список игроков, верхняя панель) рисуется поверх любых ScreenGui — прячем на время загрузки
|
||||
-- и возвращаем как было (FishingClient сам выключает его у таблички, поэтому сохраняем состояние каждого типа)
|
||||
local StarterGui = game:GetService("StarterGui")
|
||||
local savedCore = nil -- [CoreGuiType] = было ли включено до загрузки; nil — HUD сейчас не спрятан
|
||||
local coreGen = 0
|
||||
local function setCoreHidden(hidden)
|
||||
if hidden == (savedCore ~= nil) then
|
||||
return
|
||||
end
|
||||
local snapshot
|
||||
if hidden then
|
||||
savedCore = {}
|
||||
for _, t in ipairs(Enum.CoreGuiType:GetEnumItems()) do
|
||||
local ok, on = pcall(function() return StarterGui:GetCoreGuiEnabled(t) end)
|
||||
if t ~= Enum.CoreGuiType.All and ok then
|
||||
savedCore[t] = on
|
||||
end
|
||||
end
|
||||
snapshot = savedCore
|
||||
else
|
||||
snapshot, savedCore = savedCore, nil
|
||||
end
|
||||
coreGen += 1
|
||||
local gen = coreGen
|
||||
-- верхняя панель (меню Roblox); в новых версиях может не поддерживаться — тогда просто пропускаем
|
||||
task.spawn(function()
|
||||
for _ = 1, 20 do
|
||||
if gen ~= coreGen or pcall(function() StarterGui:SetCore("TopbarEnabled", not hidden) end) then
|
||||
return
|
||||
end
|
||||
task.wait(0.25) -- в первые кадры CoreScripts ещё не готовы и SetCore падает
|
||||
end
|
||||
end)
|
||||
for t, on in pairs(snapshot) do
|
||||
pcall(function() StarterGui:SetCoreGuiEnabled(t, (not hidden) and on) end)
|
||||
end
|
||||
end
|
||||
|
||||
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
||||
local now = os.clock()
|
||||
gui:SetAttribute("Visible", true)
|
||||
@@ -108,6 +182,7 @@ gui:SetAttribute("StartAt", now)
|
||||
gui:SetAttribute("MinUntil", now + 3)
|
||||
gui:SetAttribute("Title", "Загрузка…")
|
||||
showTip()
|
||||
setCoreHidden(true)
|
||||
|
||||
task.spawn(function()
|
||||
if not game:IsLoaded() then
|
||||
@@ -122,11 +197,12 @@ end)
|
||||
local hiding = false
|
||||
gui:GetAttributeChangedSignal("Visible"):Connect(function()
|
||||
-- новый телепорт мог прийти, пока экран ещё уходил: тогда возвращаем его
|
||||
if gui:GetAttribute("Visible") and (hiding or not gui.Enabled) then
|
||||
if gui:GetAttribute("Visible") then
|
||||
hiding = false
|
||||
showTip()
|
||||
gui.Enabled = true
|
||||
TweenService:Create(root, TweenInfo.new(0.25), { GroupTransparency = 0 }):Play()
|
||||
setCoreHidden(true)
|
||||
fadeTo(0, 0.25)
|
||||
end
|
||||
end)
|
||||
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
||||
@@ -151,14 +227,13 @@ RunService.RenderStepped:Connect(function()
|
||||
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
|
||||
fadeTo(1, 0.6).Completed:Connect(function(state)
|
||||
if hiding and state == Enum.PlaybackState.Completed then
|
||||
gui.Enabled = false
|
||||
gui:SetAttribute("Visible", false)
|
||||
setCoreHidden(false)
|
||||
end
|
||||
end)
|
||||
tw:Play()
|
||||
end
|
||||
end)
|
||||
]]></ProtectedString></Properties></Item>
|
||||
|
||||
@@ -42,13 +42,18 @@ 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 })
|
||||
-- фон: заставка «Рыболовная лихорадка»; пока картинка грузится, виден голубой градиент.
|
||||
-- Градиент — на отдельной подложке: UIGradient на самой CanvasGroup тонирует всё содержимое и затемнял картинку.
|
||||
-- Свет и цветокоррекция сцены на экранный интерфейс не действуют, их не трогаем.
|
||||
local BG_IMAGE = "rbxassetid://82266337853896" -- осветлённая и более насыщенная версия заставки
|
||||
-- обычный Frame, а не CanvasGroup: CanvasGroup рендерит содержимое в текстуру пониженного разрешения — картинка мылится.
|
||||
-- Плавное появление/исчезновение делаем сами (setFade ниже).
|
||||
local root = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, BorderSizePixel = 0, Parent = gui })
|
||||
local backdrop = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, Parent = root })
|
||||
new("UIGradient", {
|
||||
Rotation = 90,
|
||||
Color = ColorSequence.new(Color3.fromRGB(120, 200, 255), Color3.fromRGB(255, 170, 110)),
|
||||
Parent = root,
|
||||
Color = ColorSequence.new(Color3.fromRGB(70, 140, 230), Color3.fromRGB(40, 70, 150)),
|
||||
Parent = backdrop,
|
||||
})
|
||||
local bg = new("ImageLabel", {
|
||||
Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Image = BG_IMAGE,
|
||||
@@ -61,13 +66,14 @@ 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,
|
||||
BackgroundColor3 = Color3.new(1, 1, 1), BackgroundTransparency = 0.12, 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)),
|
||||
Color = ColorSequence.new(Color3.fromRGB(40, 66, 140), Color3.fromRGB(20, 32, 78)),
|
||||
Parent = panel,
|
||||
})
|
||||
local float = new("TextLabel", {
|
||||
@@ -79,10 +85,10 @@ local title = new("TextLabel", {
|
||||
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 })
|
||||
new("UIStroke", { Color = Color3.fromRGB(15, 22, 55), 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,
|
||||
BackgroundColor3 = Color3.fromRGB(10, 16, 40), 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 })
|
||||
@@ -90,7 +96,7 @@ 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,
|
||||
Text = "", TextColor3 = Color3.fromRGB(205, 222, 255), TextScaled = true,
|
||||
Font = Enum.Font.GothamMedium, Parent = panel,
|
||||
})
|
||||
|
||||
@@ -99,6 +105,74 @@ local function showTip()
|
||||
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
||||
end
|
||||
|
||||
-- плавность без CanvasGroup: запоминаем исходную прозрачность каждого элемента и смешиваем её с 1
|
||||
local fadeProps = { "BackgroundTransparency", "ImageTransparency", "TextTransparency", "TextStrokeTransparency" }
|
||||
local fadeItems = {}
|
||||
for _, o in ipairs(root:GetDescendants()) do
|
||||
local orig = {}
|
||||
for _, prop in ipairs(o:IsA("UIStroke") and { "Transparency" } or fadeProps) do
|
||||
local ok, v = pcall(function() return o[prop] end)
|
||||
if ok and type(v) == "number" then
|
||||
orig[prop] = v
|
||||
end
|
||||
end
|
||||
if next(orig) then
|
||||
fadeItems[o] = orig
|
||||
end
|
||||
end
|
||||
local fadeValue = Instance.new("NumberValue") -- 0 — экран виден, 1 — прозрачен
|
||||
local function setFade(a)
|
||||
for o, orig in pairs(fadeItems) do
|
||||
for prop, v in pairs(orig) do
|
||||
o[prop] = v + (1 - v) * a
|
||||
end
|
||||
end
|
||||
end
|
||||
fadeValue.Changed:Connect(setFade)
|
||||
local function fadeTo(a, time)
|
||||
local tw = TweenService:Create(fadeValue, TweenInfo.new(time), { Value = a })
|
||||
tw:Play()
|
||||
return tw
|
||||
end
|
||||
|
||||
-- HUD Roblox (хотбар, чат, список игроков, верхняя панель) рисуется поверх любых ScreenGui — прячем на время загрузки
|
||||
-- и возвращаем как было (FishingClient сам выключает его у таблички, поэтому сохраняем состояние каждого типа)
|
||||
local StarterGui = game:GetService("StarterGui")
|
||||
local savedCore = nil -- [CoreGuiType] = было ли включено до загрузки; nil — HUD сейчас не спрятан
|
||||
local coreGen = 0
|
||||
local function setCoreHidden(hidden)
|
||||
if hidden == (savedCore ~= nil) then
|
||||
return
|
||||
end
|
||||
local snapshot
|
||||
if hidden then
|
||||
savedCore = {}
|
||||
for _, t in ipairs(Enum.CoreGuiType:GetEnumItems()) do
|
||||
local ok, on = pcall(function() return StarterGui:GetCoreGuiEnabled(t) end)
|
||||
if t ~= Enum.CoreGuiType.All and ok then
|
||||
savedCore[t] = on
|
||||
end
|
||||
end
|
||||
snapshot = savedCore
|
||||
else
|
||||
snapshot, savedCore = savedCore, nil
|
||||
end
|
||||
coreGen += 1
|
||||
local gen = coreGen
|
||||
-- верхняя панель (меню Roblox); в новых версиях может не поддерживаться — тогда просто пропускаем
|
||||
task.spawn(function()
|
||||
for _ = 1, 20 do
|
||||
if gen ~= coreGen or pcall(function() StarterGui:SetCore("TopbarEnabled", not hidden) end) then
|
||||
return
|
||||
end
|
||||
task.wait(0.25) -- в первые кадры CoreScripts ещё не готовы и SetCore падает
|
||||
end
|
||||
end)
|
||||
for t, on in pairs(snapshot) do
|
||||
pcall(function() StarterGui:SetCoreGuiEnabled(t, (not hidden) and on) end)
|
||||
end
|
||||
end
|
||||
|
||||
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
||||
local now = os.clock()
|
||||
gui:SetAttribute("Visible", true)
|
||||
@@ -107,6 +181,7 @@ gui:SetAttribute("StartAt", now)
|
||||
gui:SetAttribute("MinUntil", now + 3)
|
||||
gui:SetAttribute("Title", "Загрузка…")
|
||||
showTip()
|
||||
setCoreHidden(true)
|
||||
|
||||
task.spawn(function()
|
||||
if not game:IsLoaded() then
|
||||
@@ -121,11 +196,12 @@ end)
|
||||
local hiding = false
|
||||
gui:GetAttributeChangedSignal("Visible"):Connect(function()
|
||||
-- новый телепорт мог прийти, пока экран ещё уходил: тогда возвращаем его
|
||||
if gui:GetAttribute("Visible") and (hiding or not gui.Enabled) then
|
||||
if gui:GetAttribute("Visible") then
|
||||
hiding = false
|
||||
showTip()
|
||||
gui.Enabled = true
|
||||
TweenService:Create(root, TweenInfo.new(0.25), { GroupTransparency = 0 }):Play()
|
||||
setCoreHidden(true)
|
||||
fadeTo(0, 0.25)
|
||||
end
|
||||
end)
|
||||
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
||||
@@ -150,13 +226,12 @@ RunService.RenderStepped:Connect(function()
|
||||
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
|
||||
fadeTo(1, 0.6).Completed:Connect(function(state)
|
||||
if hiding and state == Enum.PlaybackState.Completed then
|
||||
gui.Enabled = false
|
||||
gui:SetAttribute("Visible", false)
|
||||
setCoreHidden(false)
|
||||
end
|
||||
end)
|
||||
tw:Play()
|
||||
end
|
||||
end)
|
||||
@@ -20,19 +20,23 @@ Config.Worlds = {
|
||||
-- свет и эффекты: свойства Lighting и его эффектов; чего здесь нет, остаётся как в MapBuilder
|
||||
look = {
|
||||
lighting = {
|
||||
Brightness = 2.6, ExposureCompensation = -0.15,
|
||||
-- днём солнце не выжигает светлый песок и траву: яркость и экспозиция ниже
|
||||
Brightness = 2.0, ExposureCompensation = -0.35,
|
||||
Ambient = Color3.fromRGB(62, 66, 84), OutdoorAmbient = Color3.fromRGB(105, 112, 132),
|
||||
ColorShift_Top = Color3.fromRGB(255, 232, 196),
|
||||
EnvironmentDiffuseScale = 0.6, EnvironmentSpecularScale = 0.8,
|
||||
EnvironmentDiffuseScale = 0.5, EnvironmentSpecularScale = 0.6,
|
||||
},
|
||||
-- дымка вдали: Density — сколько тумана, Haze — насколько он плотный у горизонта
|
||||
atmosphere = {
|
||||
Density = 0.38, Offset = 0.1, Haze = 1.2, Glare = 0.15,
|
||||
Color = Color3.fromRGB(188, 204, 224), Decay = Color3.fromRGB(196, 176, 160),
|
||||
},
|
||||
color = { Saturation = 0.28, Contrast = 0.2, Brightness = -0.02 },
|
||||
bloom = { Intensity = 0.45, Size = 28, Threshold = 1.2 },
|
||||
sunRays = { Intensity = 0.06, Spread = 0.6 },
|
||||
color = { Saturation = 0.16, Contrast = 0.12, Brightness = -0.04 },
|
||||
-- свечение только у по-настоящему ярких мест (огни ночью), без ореолов вокруг светлого днём
|
||||
bloom = { Intensity = 0.25, Size = 24, Threshold = 1.9 },
|
||||
sunRays = { Intensity = 0.05, Spread = 0.6 },
|
||||
-- мягкий тонмаппинг: светлое не выгорает в белое
|
||||
grading = { TonemapperPreset = Enum.TonemapperPreset.Default },
|
||||
-- лёгкое размытие дальнего плана
|
||||
dof = { Enabled = true, FarIntensity = 0.2, FocusDistance = 60, InFocusRadius = 120, NearIntensity = 0 },
|
||||
},
|
||||
@@ -75,6 +79,31 @@ Config.Worlds = {
|
||||
}
|
||||
Config.WorldRadius = 260
|
||||
|
||||
-- камера игрока: насколько близко и далеко можно отвести колесом (в studs);
|
||||
-- maxZoom держит обзор внутри локаций — дальше видно край карты
|
||||
Config.Camera = { minZoom = 0.5, maxZoom = 35 }
|
||||
|
||||
-- лента активности (слева внизу у всех игроков) и оповещения о редком улове
|
||||
-- announceRank / announceMutations — крупный баннер со звуком у всех на сервере;
|
||||
-- globalRank / globalMutations — улов уходит и на другие серверы игры (MessagingService);
|
||||
-- lines — сколько строк в ленте, lineTime — сколько секунд строка остаётся видна
|
||||
Config.Feed = {
|
||||
announceRank = 4, announceMutations = { Golden = true, Rainbow = true },
|
||||
globalRank = 5, globalMutations = { Rainbow = true },
|
||||
lines = 6, lineTime = 30,
|
||||
}
|
||||
|
||||
-- доски лидеров в лобби (глобальные, по всем серверам; обновляются раз в refresh секунд).
|
||||
-- attr — атрибут игрока, который считает сервер; store — имя OrderedDataStore (смена имени = новый топ с нуля)
|
||||
Config.Leaderboards = {
|
||||
refresh = 60, size = 10,
|
||||
boards = {
|
||||
{ id = "Donate", title = "💎 Топ донатеров", attr = "RobuxSpent", store = "TopRobux_v1", unit = "R$", color = Color3.fromRGB(205, 140, 255) },
|
||||
{ id = "Earn", title = "⚪ Топ по заработку", attr = "CoinsEarned", store = "TopEarned_v1", unit = "⚪", color = Color3.fromRGB(255, 214, 90) },
|
||||
{ id = "Catch", title = "🎣 Топ рыболовов", attr = "TotalCaught", store = "TopCaught_v1", unit = "🐟", color = Color3.fromRGB(120, 210, 255) },
|
||||
},
|
||||
}
|
||||
|
||||
-- экран загрузки: при входе в игру и при каждом телепорте игрок уже стоит на месте, сцена прогружается
|
||||
-- и свет локации ставится под ним; картинку видно только после этого (секунды — минимум показа)
|
||||
Config.Loading = {
|
||||
@@ -301,16 +330,17 @@ Config.Zones = {
|
||||
}
|
||||
|
||||
---------------------------------------------------------------- удочки
|
||||
-- luck = бонус удачи, speed = множитель ожидания клёва (меньше = быстрее), zone = ширина зелёной зоны
|
||||
-- luck = бонус удачи, speed = множитель ожидания клёва (меньше = быстрее), zone = ширина зелёной зоны,
|
||||
-- icon = картинка удочки в хотбаре (Tool.TextureId)
|
||||
Config.Rods = {
|
||||
{ id = "Basic", name = "Старая удочка", price = 0, level = 1, luck = 0.00, speed = 1.00, zone = 0.22, upgradeCost = 40, style = "wood" },
|
||||
{ id = "Bamboo", name = "Бамбуковая удочка", price = 150, level = 3, luck = 0.15, speed = 0.88, zone = 0.25, upgradeCost = 120, style = "bamboo" },
|
||||
{ id = "Fiberglass", name = "Стеклопластиковая", price = 600, level = 5, luck = 0.30, speed = 0.78, zone = 0.27, upgradeCost = 300, style = "glass" },
|
||||
{ id = "Carbon", name = "Карбоновая удочка", price = 1800, level = 8, luck = 0.55, speed = 0.68, zone = 0.29, upgradeCost = 700, style = "carbon" },
|
||||
{ id = "Coral", name = "Коралловая удочка", price = 4500, level = 10, luck = 0.80, speed = 0.62, zone = 0.31, upgradeCost = 1300, style = "coral" },
|
||||
{ id = "Golden", name = "Золотая удочка", price = 9000, level = 13, luck = 1.00, speed = 0.56, zone = 0.33, upgradeCost = 2200, style = "gold" },
|
||||
{ id = "Frost", name = "Ледяная удочка", price = 25000, level = 18, luck = 1.40, speed = 0.50, zone = 0.35, upgradeCost = 5000, style = "frost" },
|
||||
{ id = "Legend", name = "Удочка Легенды", price = 75000, level = 25, luck = 2.00, speed = 0.42, zone = 0.38, upgradeCost = 12000, style = "legend" },
|
||||
{ id = "Basic", name = "Старая удочка", price = 0, level = 1, luck = 0.00, speed = 1.00, zone = 0.22, upgradeCost = 40, style = "wood", icon = "rbxassetid://83350883185349" },
|
||||
{ id = "Bamboo", name = "Бамбуковая удочка", price = 150, level = 3, luck = 0.15, speed = 0.88, zone = 0.25, upgradeCost = 120, style = "bamboo", icon = "rbxassetid://98615001898640" },
|
||||
{ id = "Fiberglass", name = "Стеклопластиковая", price = 600, level = 5, luck = 0.30, speed = 0.78, zone = 0.27, upgradeCost = 300, style = "glass", icon = "rbxassetid://100031752289540" },
|
||||
{ id = "Carbon", name = "Карбоновая удочка", price = 1800, level = 8, luck = 0.55, speed = 0.68, zone = 0.29, upgradeCost = 700, style = "carbon", icon = "rbxassetid://71788597596034" },
|
||||
{ id = "Coral", name = "Коралловая удочка", price = 4500, level = 10, luck = 0.80, speed = 0.62, zone = 0.31, upgradeCost = 1300, style = "coral", icon = "rbxassetid://139114393074237" },
|
||||
{ id = "Golden", name = "Золотая удочка", price = 9000, level = 13, luck = 1.00, speed = 0.56, zone = 0.33, upgradeCost = 2200, style = "gold", icon = "rbxassetid://83212298735071" },
|
||||
{ id = "Frost", name = "Ледяная удочка", price = 25000, level = 18, luck = 1.40, speed = 0.50, zone = 0.35, upgradeCost = 5000, style = "frost", icon = "rbxassetid://134579643216329" },
|
||||
{ id = "Legend", name = "Удочка Легенды", price = 75000, level = 25, luck = 2.00, speed = 0.42, zone = 0.38, upgradeCost = 12000, style = "legend", icon = "rbxassetid://84863811378769" },
|
||||
}
|
||||
|
||||
Config.RodUpgrade = { maxLevel = 5, luckPerLevel = 0.08, zonePerLevel = 0.012, speedPerLevel = 0.96 }
|
||||
@@ -364,7 +394,6 @@ Config.QuestKinds = {
|
||||
perfectCast = { text = "Забрось в зелёную зону %d %s", forms = TIMES, coins = 8, xp = 6 },
|
||||
combo = { text = "Набери серию из %d рыб", coins = 12, xp = 10, max = 15 },
|
||||
sell = { text = "Продай %d %s", forms = FISH, coins = 3, xp = 3 },
|
||||
<<<<<<< HEAD
|
||||
earn = { text = "Заработай %d ⚪ на продаже", coins = 0.25, xp = 0.2, byLevel = true },
|
||||
buy = { text = "Купи что-нибудь в магазине", coins = 40, xp = 30, max = 1 },
|
||||
boss = { text = "Нанеси боссу %d урона", coins = 15, xp = 12 },
|
||||
@@ -377,40 +406,6 @@ Config.QuestChains = {
|
||||
}
|
||||
Config.QuestTierGrowth = 0.5 -- каждый следующий круг цепочек: цели ×(1 + 0.5 · номер круга)
|
||||
Config.ChainBonus = { coins = 120, xp = 100, potion = "Luck1" } -- за всю цепочку (растёт с уровнем и кругом)
|
||||
=======
|
||||
earn = { text = "Заработай %d 💰 на продаже", coins = 0.25, xp = 0.2, byLevel = true },
|
||||
buy = { text = "Купи что-нибудь в магазине", coins = 40, xp = 30, max = 1 },
|
||||
boss = { text = "Нанеси боссу %d урона", coins = 15, xp = 12 },
|
||||
}
|
||||
Config.QuestChains = {
|
||||
{ name = "🎣 Утренний клёв", steps = { { "catch", 3 }, { "perfectCast", 2 }, { "sell", 3 }, { "catch", 5 }, { "uncommon", 1 } } },
|
||||
{ name = "🔥 Без промаха", steps = { { "perfect", 3 }, { "combo", 3 }, { "catch", 6 }, { "earn", 80 }, { "combo", 5 } } },
|
||||
{ name = "💎 Охота за редкостью", steps = { { "uncommon", 3 }, { "perfectCast", 3 }, { "rare", 1 }, { "sell", 8 }, { "buy", 1 } } },
|
||||
{ name = "🏆 Мастер озера", steps = { { "combo", 6 }, { "catch", 10 }, { "perfect", 6 }, { "rare", 2 }, { "earn", 300 } } },
|
||||
}
|
||||
Config.QuestTierGrowth = 0.5 -- каждый следующий круг цепочек: цели ×(1 + 0.5 · номер круга)
|
||||
Config.ChainBonus = { coins = 120, xp = 100, potion = "Luck1" } -- за всю цепочку (растёт с уровнем и кругом)
|
||||
|
||||
---------------------------------------------------------------- серия улова
|
||||
-- каждая рыба подряд без срыва: +10% к цене и опыту следующей, до ×2;
|
||||
-- срыв, ушедшая рыба или timeout секунд без улова — серия сгорает
|
||||
Config.Combo = { step = 0.1, max = 2.0, timeout = 90 }
|
||||
|
||||
---------------------------------------------------------------- босс озера
|
||||
-- раз в interval секунд в мир, где больше всего игроков, приплывает босс. Его ловят всем сервером:
|
||||
-- каждая пойманная там рыба наносит урон = ранг редкости (+1 за подсечку без промаха).
|
||||
-- Если за duration секунд урона хватило — награда всем, кто помог (× mult мира, минимум 40% за малый вклад)
|
||||
Config.Boss = {
|
||||
firstDelay = 240, interval = 600, duration = 180,
|
||||
hpPerPlayer = 12,
|
||||
reward = { coins = 300, xp = 250, potion = "Luck1" },
|
||||
worlds = {
|
||||
World1 = { name = "Сом-великан", fish = "Som", mutation = "Golden", scale = 5 },
|
||||
World2 = { name = "Королевская акула", fish = "Shark", mutation = "Golden", scale = 3 },
|
||||
World3 = { name = "Ледяной левиафан", fish = "Leviathan", mutation = "Rainbow", scale = 2.5 },
|
||||
},
|
||||
}
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
|
||||
---------------------------------------------------------------- серия улова
|
||||
-- каждая рыба подряд без срыва: +10% к цене и опыту следующей, до ×2;
|
||||
@@ -548,25 +543,29 @@ Config.Sounds = {
|
||||
click = S(15675032796, 0.5), -- Roblox_UI_Small_Click
|
||||
open = S(9117231552, 0.45), -- Paper Scroll Unroll Handle 4
|
||||
coins = S(9113849306, 0.6), -- Coins Or Keys Jingle 1
|
||||
chestHop = S(9120718279, 0.35, { pitch = { 0.7, 0.8 } }), -- Whoosh Fast Swish By 1 (сундук награды подпрыгивает)
|
||||
chestLand = S(9113769181, 0.7, { pitch = { 0.95, 1.05 } }), -- Chair Drop 2: тяжёлый деревянный удар о землю
|
||||
levelUp = S(1840525342, 0.5), -- Harp Glissando (A)
|
||||
quest = S(9126073318, 0.5), -- Bell Tone Ding 2
|
||||
}
|
||||
Config.DefaultVolume = { music = 0.6, sfx = 0.8 }
|
||||
|
||||
---------------------------------------------------------------- донат (Robux)
|
||||
-- ВАЖНО: впиши сюда ID своих пропусков и товаров с create.roblox.com.
|
||||
-- Все товары — Developer Products игры (create.roblox.com → Monetization → Developer Products);
|
||||
-- id — Product ID оттуда, robux — цена для кнопки (должна совпадать с ценой в Roblox).
|
||||
-- Пропуска тоже Developer Products: покупаются один раз, сервер запоминает их в данных игрока навсегда.
|
||||
-- Пока id = 0, кнопка покупки покажет подсказку, что товар не настроен.
|
||||
Config.GamePasses = {
|
||||
{ key = "VIP", id = 0, robux = 199, icon = "👑", name = "VIP", desc = "+25% удачи и серебра, корона над головой" },
|
||||
{ key = "DoubleCoins", id = 0, robux = 299, icon = "⚪", name = "x2 Серебро", desc = "Вся рыба продаётся в 2 раза дороже" },
|
||||
{ key = "LuckyCharm", id = 0, robux = 349, icon = "🍀", name = "Талисман удачи", desc = "+50% удачи навсегда" },
|
||||
{ key = "BigBag", id = 0, robux = 149, icon = "🎒", name = "Бездонная сумка", desc = "+100 мест в любой сумке" },
|
||||
{ key = "VIP", id = 3728143641, robux = 199, icon = "👑", name = "VIP", desc = "+25% удачи и серебра, корона над головой" },
|
||||
{ key = "DoubleCoins", id = 3728143692, robux = 299, icon = "⚪", name = "x2 Серебро", desc = "Вся рыба продаётся в 2 раза дороже" },
|
||||
{ key = "LuckyCharm", id = 3728143735, robux = 349, icon = "🍀", name = "Талисман удачи", desc = "+50% удачи навсегда" },
|
||||
{ key = "BigBag", id = 3728143773, robux = 149, icon = "🎒", name = "Бездонная сумка", desc = "+100 мест в любой сумке" },
|
||||
}
|
||||
Config.Products = {
|
||||
{ key = "Coins1", id = 0, robux = 49, icon = "👝", name = "Кошель серебра", desc = "+1 000 серебра (больше с уровнем)", coins = 1000 },
|
||||
{ key = "Coins2", id = 0, robux = 199, icon = "⚪", name = "Сундук серебра", desc = "+5 000 серебра (больше с уровнем)", coins = 5000 },
|
||||
{ key = "Coins3", id = 0, robux = 599, icon = "🏆", name = "Гора золота", desc = "+20 000 серебра (больше с уровнем)", coins = 20000 },
|
||||
{ key = "Luck", id = 0, robux = 99, icon = "🧪", name = "Супер-зелье удачи", desc = "+200% удачи на 15 минут", boost = 2.0, duration = 900 },
|
||||
{ key = "Coins1", id = 3728142264, robux = 49, icon = "👝", name = "Кошель серебра", desc = "+1 000 серебра (больше с уровнем)", coins = 1000 },
|
||||
{ key = "Coins2", id = 3728142848, robux = 199, icon = "⚪", name = "Сундук серебра", desc = "+5 000 серебра (больше с уровнем)", coins = 5000 },
|
||||
{ key = "Coins3", id = 3728142885, robux = 599, icon = "🏆", name = "Гора золота", desc = "+20 000 серебра (больше с уровнем)", coins = 20000 },
|
||||
{ key = "Luck", id = 3728142916, robux = 99, icon = "🧪", name = "Супер-зелье удачи", desc = "+200% удачи на 15 минут", boost = 2.0, duration = 900 },
|
||||
}
|
||||
|
||||
---------------------------------------------------------------- рыбалка
|
||||
|
||||
@@ -115,7 +115,7 @@ local function sparkles(parent, color, rate)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- удочки
|
||||
-- Рука в (0,0,0), удочка смотрит в -Z и изгибается вверх (+Y).
|
||||
-- Рука в (0,0,0), удочка смотрит в -Z почти прямо, кончик слегка провисает вниз (-Y).
|
||||
|
||||
local STYLES = {
|
||||
wood = { blank = C(125, 90, 60), mat = Enum.Material.Wood, grip = C(80, 55, 35), gripMat = Enum.Material.Fabric, wrap = C(175, 175, 175), reel = C(95, 95, 100) },
|
||||
@@ -176,8 +176,8 @@ function M.buildRod(rodId, upgradeLevel, anchored)
|
||||
cyl(model, V(0.24, -0.68, -0.58), V(0.5, -0.86, -0.58), 0.07, { Color = st.reel, Material = METAL })
|
||||
ball(model, V(0.54, -0.9, -0.5), 0.19, { Color = st.grip, Material = SP })
|
||||
|
||||
-- бланк: 8 колен с плавным изгибом и шарами на стыках
|
||||
local angles = { 6, 9, 12, 16, 20, 25, 30, 36 }
|
||||
-- бланк: 8 колен, почти прямой, к кончику плавно провисает; шары на стыках
|
||||
local angles = { 0, -1, -2, -3, -5, -7, -9, -12 }
|
||||
local lengths = { 1.2, 1.15, 1.1, 1.0, 0.95, 0.9, 0.85, 0.8 }
|
||||
local p = V(0, 0, -1.55)
|
||||
local lastSeg
|
||||
|
||||
@@ -19,6 +19,51 @@ local remote = ReplicatedStorage:FindFirstChild("GameEvent") or Instance.new("Re
|
||||
remote.Name = "GameEvent"
|
||||
remote.Parent = ReplicatedStorage
|
||||
|
||||
---------------------------------------------------------------- лента активности
|
||||
-- события для всех игроков (FishingClient показывает их в ленте и крупным баннером для редкого улова);
|
||||
-- самые редкие уловы уходят и на другие серверы игры через MessagingService (Config.Feed)
|
||||
local MessagingService = game:GetService("MessagingService")
|
||||
local FEED_TOPIC = "FishFeed"
|
||||
|
||||
local function feed(kind, info)
|
||||
remote:FireAllClients("Feed", kind, info)
|
||||
end
|
||||
|
||||
-- подписка — в фоне: SubscribeAsync ждёт ответа сервиса (в неопубликованном плейсе — долго),
|
||||
-- а скрипт должен сразу дойти до загрузки игроков, телепортов и остального
|
||||
task.spawn(function()
|
||||
pcall(function()
|
||||
MessagingService:SubscribeAsync(FEED_TOPIC, function(msg)
|
||||
local d = msg.Data
|
||||
if type(d) == "table" and d.jobId ~= game.JobId then
|
||||
d.remote = true -- улов на другом сервере
|
||||
feed("catch", d)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
-- улов в ленту; big — крупный баннер со звуком у всех, global — ещё и на другие серверы
|
||||
local function feedCatch(player, fish, world)
|
||||
local r = Config.Rarities[fish.rarity]
|
||||
local F = Config.Feed
|
||||
local info = {
|
||||
name = player.DisplayName, userId = player.UserId,
|
||||
fish = fish.name, rarity = fish.rarity, mutation = fish.mutation, value = fish.value,
|
||||
world = world and (world.icon .. " " .. world.name) or nil,
|
||||
big = r.rank >= F.announceRank or F.announceMutations[fish.mutation or ""] == true,
|
||||
}
|
||||
feed("catch", info)
|
||||
if r.rank >= F.globalRank or F.globalMutations[fish.mutation or ""] then
|
||||
info.jobId = game.JobId
|
||||
task.spawn(function()
|
||||
pcall(function()
|
||||
MessagingService:PublishAsync(FEED_TOPIC, info)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
local rng = Random.new()
|
||||
local GOLD = Color3.fromRGB(255, 220, 80)
|
||||
local RED = Color3.fromRGB(255, 120, 120)
|
||||
@@ -45,6 +90,8 @@ local function defaultData()
|
||||
chain = { index = 1, step = 1, progress = 0, tier = 0 }, daily = { last = 0, streak = 0 },
|
||||
boostUntil = 0, boostBonus = 0,
|
||||
totalCaught = 0, nextUid = 1, receipts = {},
|
||||
passes = {}, -- купленные пропуска (Developer Products): [key] = true
|
||||
coinsEarned = 0, robuxSpent = 0, -- для досок лидеров: всего выручено за рыбу и потрачено Robux
|
||||
settings = { music = Config.DefaultVolume.music, sfx = Config.DefaultVolume.sfx },
|
||||
-- гильдия: жемчуг, печати, отдых (ранг, заказы, наживку, ловушки дополняет Guild.defaults)
|
||||
pearls = 0, seals = 0, rest = 0,
|
||||
@@ -90,16 +137,12 @@ local function hasPass(player, key)
|
||||
return passes[player] ~= nil and passes[player][key] == true
|
||||
end
|
||||
|
||||
local function loadPasses(player)
|
||||
-- пропуска продаются как Developer Products, поэтому владение хранится в данных игрока, а не в Roblox
|
||||
local function loadPasses(player, data)
|
||||
passes[player] = {}
|
||||
for _, gp in ipairs(Config.GamePasses) do
|
||||
if gp.id and gp.id > 0 then
|
||||
local ok, owns = pcall(function()
|
||||
return MarketplaceService:UserOwnsGamePassAsync(player.UserId, gp.id)
|
||||
end)
|
||||
if ok and owns then
|
||||
passes[player][gp.key] = true
|
||||
end
|
||||
if data.passes[gp.key] then
|
||||
passes[player][gp.key] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -279,6 +322,11 @@ local function updateStats(player)
|
||||
player:SetAttribute("BoostBonus", boostActive(data))
|
||||
player:SetAttribute("BoostLeft", math.max(0, data.boostUntil - os.time()))
|
||||
player:SetAttribute("TotalCaught", data.totalCaught)
|
||||
player:SetAttribute("CoinsEarned", data.coinsEarned)
|
||||
-- когда откроется следующая ежедневная награда (0 — уже доступна); по ней сундук в лобби прыгает только для тех,
|
||||
-- кому есть что забрать
|
||||
player:SetAttribute("DailyNextAt", data.daily.last >= today() and (data.daily.last + 1) * 86400 or 0)
|
||||
player:SetAttribute("RobuxSpent", data.robuxSpent)
|
||||
-- шаг обучения (линия-подсказка); у старых игроков без поля, уже ловивших рыбу, обучение пройдено
|
||||
player:SetAttribute("Tutorial", data.tutorial or (data.totalCaught > 0 and Config.TutorialDone or 0))
|
||||
player:SetAttribute("Mastery", masteryCount(data))
|
||||
@@ -303,6 +351,7 @@ local function addXp(player, data, amount)
|
||||
end
|
||||
if leveled then
|
||||
notify(player, "⭐ Уровень " .. data.level .. "!", GOLD)
|
||||
feed("level", { name = player.DisplayName, userId = player.UserId, level = data.level })
|
||||
for _, w in ipairs(Config.Worlds) do
|
||||
if w.level == data.level and not w.soon then
|
||||
notify(player, "🌍 Открыт: " .. w.icon .. " " .. w.name, w.color)
|
||||
@@ -426,11 +475,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
if rarity == "Master" then
|
||||
local coins = Config.MasteryCoins * world.mult
|
||||
data.coins += coins
|
||||
<<<<<<< HEAD
|
||||
notify(player, ("🏆 «%s» собран! +%d ⚪"):format(world.name, coins), GOLD)
|
||||
=======
|
||||
notify(player, ("🏆 «%s» собран! +%d 💰"):format(world.name, coins), GOLD)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
else
|
||||
local r = Config.CollectionRewards[rarity]
|
||||
if not r then
|
||||
@@ -438,11 +483,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
end
|
||||
data.coins += r.coins * world.mult
|
||||
addXp(player, data, r.xp * world.mult)
|
||||
<<<<<<< HEAD
|
||||
notify(player, ("📖 +%d ⚪ +%d XP"):format(r.coins * world.mult, r.xp * world.mult), GREEN)
|
||||
=======
|
||||
notify(player, ("📖 +%d 💰 +%d XP"):format(r.coins * world.mult, r.xp * world.mult), GREEN)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
updateStats(player)
|
||||
sendInventory(player)
|
||||
@@ -450,7 +491,7 @@ end
|
||||
|
||||
---------------------------------------------------------------- удочка, сумка, VIP на персонаже
|
||||
|
||||
local REST_ANGLE = 30
|
||||
local REST_ANGLE = 42 -- удочка в покое: рукоять под ~42° вверх-вперёд, кончик провисает до ~30°
|
||||
local function gripCF(angle)
|
||||
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
|
||||
end
|
||||
@@ -504,6 +545,7 @@ local function giveRodTool(player)
|
||||
local tool = Instance.new("Tool")
|
||||
tool.Name = rod.name .. (lvl > 0 and (" +" .. lvl) or "")
|
||||
tool.ToolTip = "Кликни у воды, чтобы закинуть"
|
||||
tool.TextureId = rod.icon or ""
|
||||
tool.CanBeDropped = false
|
||||
tool.Grip = gripCF(REST_ANGLE)
|
||||
tool:SetAttribute("IsRod", true)
|
||||
@@ -766,17 +808,12 @@ local function stopFishing(player, tellClient)
|
||||
end
|
||||
end
|
||||
|
||||
<<<<<<< HEAD
|
||||
-- mods: { bait = наживка из Config.Baits, maxRank = потолок редкости (автоловля) }
|
||||
local function rollFish(player, data, worldId, luckMult, mods)
|
||||
=======
|
||||
local function rollFish(player, data, worldId, luckMult)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local zone = Config.Zones[worldId]
|
||||
if not zone then
|
||||
return nil
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
mods = mods or {}
|
||||
local bait = mods.bait
|
||||
local base = totalLuck(player, data) + (bait and bait.luck or 0)
|
||||
@@ -784,9 +821,6 @@ local function rollFish(player, data, worldId, luckMult)
|
||||
base += bait.nightLuck - Config.DayNight.nightLuck -- светлячок: ночью +30% вместо обычных +10%
|
||||
end
|
||||
local luck = base * (luckMult or 1)
|
||||
=======
|
||||
local luck = totalLuck(player, data) * (luckMult or 1)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local bonus = luck - 1
|
||||
local weights, total = {}, 0
|
||||
for i, f in ipairs(zone.fish) do
|
||||
@@ -871,12 +905,9 @@ local function flyBobber(s, tool, target, dur, arc)
|
||||
end
|
||||
end
|
||||
|
||||
<<<<<<< HEAD
|
||||
local autoFishing = {} -- [player] = токен работающей автоловли
|
||||
local setAutoFish, grantFish -- объявлены ниже
|
||||
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local function onCast(player, power)
|
||||
power = math.clamp(tonumber(power) or 0.6, 0, 1)
|
||||
local data = profiles[player]
|
||||
@@ -921,12 +952,8 @@ local function onCast(player, power)
|
||||
|
||||
local stats = Config.RodStats(data.rod, rodLevel(data))
|
||||
local perfect = power >= Config.CastPerfect[1] and power <= Config.CastPerfect[2]
|
||||
<<<<<<< HEAD
|
||||
local bait = Guild.useBait(player, data) -- 1 штука наживки на заброс
|
||||
local fish = rollFish(player, data, world.id, perfect and Config.CastPerfectLuck or 1, { bait = bait })
|
||||
=======
|
||||
local fish = rollFish(player, data, world.id, perfect and Config.CastPerfectLuck or 1)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
if not fish then
|
||||
remote:FireClient(player, "CastFail")
|
||||
return
|
||||
@@ -1030,7 +1057,6 @@ local function onCatch(player, success, misses)
|
||||
grantFish(player, data, s.fish, { perfect = s.perfect, misses = misses, fromPos = fromPos })
|
||||
end
|
||||
|
||||
<<<<<<< HEAD
|
||||
-- рыба поймана (руками или автоловлей): в сумку, опыт, коллекция, задания, гильдия, босс.
|
||||
-- ctx: { perfect, misses, fromPos, auto }; у автоловли нет серии и бонусов за точность
|
||||
grantFish = function(player, data, fish, ctx)
|
||||
@@ -1044,15 +1070,6 @@ grantFish = function(player, data, fish, ctx)
|
||||
setCombo(player, streak + 1)
|
||||
end
|
||||
fish.xp = math.floor(fish.xp * Guild.xpMult(data)) -- бонус отдыха: двойной опыт
|
||||
=======
|
||||
-- серия: каждая рыба подряд дороже и даёт больше опыта
|
||||
local fish = s.fish
|
||||
local streak = combo[player] or 0
|
||||
local comboMult = math.min(Config.Combo.max, 1 + Config.Combo.step * streak)
|
||||
fish.value = math.floor(fish.value * comboMult + 0.5)
|
||||
fish.xp = math.floor(fish.xp * comboMult + 0.5)
|
||||
setCombo(player, streak + 1)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
table.insert(data.items, {
|
||||
uid = data.nextUid, id = fish.id, name = fish.name, rarity = fish.rarity,
|
||||
weight = fish.weight, value = fish.value, mutation = fish.mutation,
|
||||
@@ -1078,11 +1095,11 @@ grantFish = function(player, data, fish, ctx)
|
||||
if ctx.fromPos then
|
||||
showFishFlight(player, fish, ctx.fromPos)
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
remote:FireClient(player, "Caught", fish, { new = isNew, record = isRecord, combo = comboMult, streak = ctx.auto and 0 or streak + 1, auto = ctx.auto })
|
||||
=======
|
||||
remote:FireClient(player, "Caught", fish, { new = isNew, record = isRecord, combo = comboMult, streak = streak + 1 })
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
do
|
||||
local h = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
feedCatch(player, fish, h and Config.WorldAt(h.Position))
|
||||
end
|
||||
|
||||
local rank = Config.Rarities[fish.rarity].rank
|
||||
questProgress(player, "catch", 1)
|
||||
@@ -1092,7 +1109,6 @@ grantFish = function(player, data, fish, ctx)
|
||||
if rank >= 3 then
|
||||
questProgress(player, "rare", 1)
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
if not ctx.auto then
|
||||
if ctx.misses == 0 then
|
||||
questProgress(player, "perfect", 1)
|
||||
@@ -1246,18 +1262,7 @@ setAutoFish = function(player, on, reason)
|
||||
stopFishing(player, false)
|
||||
end
|
||||
notify(player, reason or "🎣 Автоловля выключена", Color3.fromRGB(255, 200, 120))
|
||||
=======
|
||||
if misses == 0 then
|
||||
questProgress(player, "perfect", 1)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
if s.perfect then
|
||||
questProgress(player, "perfectCast", 1)
|
||||
end
|
||||
questProgress(player, "combo", streak + 1, true)
|
||||
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
bossHit(player, hrp and Config.WorldAt(hrp.Position), rank + (misses == 0 and 1 or 0))
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- скупка
|
||||
@@ -1310,6 +1315,7 @@ local function sellItems(player, filterUid)
|
||||
end
|
||||
data.items = keep
|
||||
data.coins += total
|
||||
data.coinsEarned += total
|
||||
updateStats(player)
|
||||
sendInventory(player)
|
||||
remote:FireClient(player, "Sold", total, count)
|
||||
@@ -1336,11 +1342,7 @@ local function buy(player, kind, id)
|
||||
end
|
||||
local cost = Guild.price(data, Config.UpgradeCost(rod, lvl)) -- скидка ранга гильдии
|
||||
if data.coins < cost then
|
||||
<<<<<<< HEAD
|
||||
notify(player, "Нужно " .. cost .. " ⚪", RED)
|
||||
=======
|
||||
notify(player, "Нужно " .. cost .. " 💰", RED)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
return
|
||||
end
|
||||
data.coins -= cost
|
||||
@@ -1363,14 +1365,9 @@ local function buy(player, kind, id)
|
||||
notify(player, "🔒 Нужен ур. " .. potion.level, RED)
|
||||
return
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
local price = Guild.price(data, potion.price)
|
||||
if data.coins < price then
|
||||
notify(player, "Нужно " .. price .. " ⚪", RED)
|
||||
=======
|
||||
if data.coins < potion.price then
|
||||
notify(player, "Нужно " .. potion.price .. " 💰", RED)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
return
|
||||
end
|
||||
data.coins -= price
|
||||
@@ -1398,14 +1395,9 @@ local function buy(player, kind, id)
|
||||
notify(player, "🔒 Нужен ур. " .. item.level, RED)
|
||||
return
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
local price = Guild.price(data, item.price)
|
||||
if data.coins < price then
|
||||
notify(player, "Нужно " .. price .. " ⚪", RED)
|
||||
=======
|
||||
if data.coins < item.price then
|
||||
notify(player, "Нужно " .. item.price .. " 💰", RED)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
return
|
||||
end
|
||||
data.coins -= price
|
||||
@@ -1455,14 +1447,11 @@ local function teleportTo(player, worldId)
|
||||
end
|
||||
if data.level < world.level then
|
||||
notify(player, ("🔒 %s: ур. %d"):format(world.name, world.level), RED)
|
||||
<<<<<<< HEAD
|
||||
return
|
||||
end
|
||||
local okRank, why = Guild.canEnter(data, world.id)
|
||||
if not okRank then
|
||||
notify(player, why, RED)
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
return
|
||||
end
|
||||
markerName = world.id .. "Spawn"
|
||||
@@ -1561,21 +1550,13 @@ remote.OnServerEvent:Connect(function(player, action, a, b)
|
||||
if nearSeller(player) then
|
||||
sellItems(player, a)
|
||||
else
|
||||
<<<<<<< HEAD
|
||||
notify(player, "⚪ Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
=======
|
||||
notify(player, "💰 Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
elseif action == "SellAll" then
|
||||
if nearSeller(player) then
|
||||
sellItems(player, nil)
|
||||
else
|
||||
<<<<<<< HEAD
|
||||
notify(player, "⚪ Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
=======
|
||||
notify(player, "💰 Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
elseif action == "Teleport" then
|
||||
teleportTo(player, a)
|
||||
@@ -1604,22 +1585,20 @@ end)
|
||||
|
||||
---------------------------------------------------------------- донат
|
||||
|
||||
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, passId, purchased)
|
||||
if not purchased then
|
||||
return
|
||||
end
|
||||
for _, gp in ipairs(Config.GamePasses) do
|
||||
if gp.id == passId then
|
||||
passes[player] = passes[player] or {}
|
||||
passes[player][gp.key] = true
|
||||
notify(player, "✅ " .. gp.icon .. " " .. gp.name, GOLD)
|
||||
if gp.key == "VIP" then
|
||||
vipTag(player)
|
||||
end
|
||||
updateStats(player)
|
||||
-- все покупки — Developer Products: и наборы (Config.Products), и пропуска навсегда (Config.GamePasses)
|
||||
local function findProduct(productId)
|
||||
for _, p in ipairs(Config.Products) do
|
||||
if p.id == productId then
|
||||
return p, false
|
||||
end
|
||||
end
|
||||
end)
|
||||
for _, gp in ipairs(Config.GamePasses) do
|
||||
if gp.id == productId then
|
||||
return gp, true
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
MarketplaceService.ProcessReceipt = function(info)
|
||||
local player = Players:GetPlayerByUserId(info.PlayerId)
|
||||
@@ -1632,15 +1611,22 @@ MarketplaceService.ProcessReceipt = function(info)
|
||||
return Enum.ProductPurchaseDecision.PurchaseGranted
|
||||
end
|
||||
end
|
||||
local product
|
||||
for _, p in ipairs(Config.Products) do
|
||||
if p.id == info.ProductId then
|
||||
product = p
|
||||
end
|
||||
end
|
||||
local product, isPass = findProduct(info.ProductId)
|
||||
if not product then
|
||||
warn("ProcessReceipt: неизвестный товар " .. tostring(info.ProductId))
|
||||
return Enum.ProductPurchaseDecision.NotProcessedYet
|
||||
end
|
||||
data.robuxSpent += info.CurrencySpent or product.robux or 0
|
||||
feed("buy", { name = player.DisplayName, userId = player.UserId, item = product.icon .. " " .. product.name })
|
||||
if isPass then
|
||||
data.passes[product.key] = true
|
||||
passes[player] = passes[player] or {}
|
||||
passes[player][product.key] = true
|
||||
notify(player, "✅ " .. product.icon .. " " .. product.name .. " — навсегда!", GOLD)
|
||||
if product.key == "VIP" then
|
||||
vipTag(player)
|
||||
end
|
||||
end
|
||||
if product.coins then
|
||||
local coins = math.floor(product.coins * (1 + (data.level - 1) * 0.15))
|
||||
data.coins += coins
|
||||
@@ -1729,10 +1715,7 @@ local function finishBoss(won)
|
||||
if potion then
|
||||
applyPotion(data, potion.bonus, potion.duration)
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
Guild.onBossWin(p, data)
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
updateStats(p)
|
||||
remote:FireClient(p, "BossReward", coins, xp, potion and potion.name)
|
||||
end
|
||||
@@ -1787,6 +1770,9 @@ end)
|
||||
---------------------------------------------------------------- игроки
|
||||
|
||||
local function onPlayerAdded(player)
|
||||
-- камеру нельзя отвести так далеко, чтобы заглянуть за скалы и край карты
|
||||
player.CameraMinZoomDistance = Config.Camera.minZoom
|
||||
player.CameraMaxZoomDistance = Config.Camera.maxZoom
|
||||
local ls = Instance.new("Folder")
|
||||
ls.Name = "leaderstats"
|
||||
ls.Parent = player
|
||||
@@ -1800,13 +1786,10 @@ local function onPlayerAdded(player)
|
||||
if not player.Parent then
|
||||
return
|
||||
end
|
||||
loadPasses(player)
|
||||
loadPasses(player, data)
|
||||
ensureChain(data)
|
||||
<<<<<<< HEAD
|
||||
Guild.defaults(data)
|
||||
Guild.onJoin(player, data)
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
profiles[player] = data
|
||||
loadedOk[player] = ok
|
||||
local settings = type(data.settings) == "table" and data.settings or {}
|
||||
@@ -1839,13 +1822,10 @@ end
|
||||
Players.PlayerRemoving:Connect(function(player)
|
||||
stopFishing(player, false)
|
||||
combo[player], comboUntil[player] = nil, nil
|
||||
<<<<<<< HEAD
|
||||
autoFishing[player] = nil
|
||||
if profiles[player] then
|
||||
Guild.onLeave(profiles[player])
|
||||
end
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
saveData(player)
|
||||
profiles[player] = nil
|
||||
loadedOk[player] = nil
|
||||
@@ -1886,13 +1866,10 @@ task.spawn(function()
|
||||
if data and data.boostUntil > os.time() - 2 then
|
||||
updateStats(p)
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
-- бонус отдыха тратится, пока игрок рыбачит
|
||||
if data and (fishing[p] or autoFishing[p]) then
|
||||
Guild.spendRest(p, data, 1)
|
||||
end
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
-- серия сгорает, если долго нет улова (пока рыба на крючке — ждём)
|
||||
if comboUntil[p] and os.time() > comboUntil[p] and not fishing[p] then
|
||||
breakCombo(p)
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
-- Leaderboards (Script) -> ServerScriptService
|
||||
-- Доски лидеров в лобби: топ донатеров, по заработку и по улову (Config.Leaderboards).
|
||||
-- Значения берутся из атрибутов игроков (их ведёт GameServer) и раз в refresh секунд пишутся в OrderedDataStore,
|
||||
-- оттуда же читается глобальный топ. Игроки, которые сейчас на сервере, показываются со свежими значениями сразу;
|
||||
-- без доступа к DataStore (Studio без API) доски показывают только их.
|
||||
-- Доски на карте — модели с атрибутом Leaderboard = id и строками Row1…RowN (их строит WorldBuilder.leaderboard).
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local DataStoreService = game:GetService("DataStoreService")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
local L = Config.Leaderboards
|
||||
|
||||
local stores = {}
|
||||
for _, b in ipairs(L.boards) do
|
||||
pcall(function()
|
||||
stores[b.id] = DataStoreService:GetOrderedDataStore(b.store)
|
||||
end)
|
||||
end
|
||||
|
||||
local written = {} -- [userId][boardId] = последнее записанное значение (не пишем без изменений)
|
||||
local names = {} -- [userId] = имя
|
||||
|
||||
local function nameOf(userId)
|
||||
if names[userId] then
|
||||
return names[userId]
|
||||
end
|
||||
local ok, name = pcall(function()
|
||||
return Players:GetNameFromUserIdAsync(userId)
|
||||
end)
|
||||
names[userId] = ok and name or ("Игрок " .. userId)
|
||||
return names[userId]
|
||||
end
|
||||
|
||||
local function fmt(n)
|
||||
local s = tostring(math.floor(n))
|
||||
local out = s:reverse():gsub("(%d%d%d)", "%1 "):reverse()
|
||||
return (out:gsub("^ ", ""))
|
||||
end
|
||||
|
||||
local function writePlayer(player)
|
||||
for _, b in ipairs(L.boards) do
|
||||
local store = stores[b.id]
|
||||
local value = math.floor(tonumber(player:GetAttribute(b.attr)) or 0)
|
||||
written[player.UserId] = written[player.UserId] or {}
|
||||
if store and value > 0 and written[player.UserId][b.id] ~= value then
|
||||
local ok = pcall(function()
|
||||
store:SetAsync(tostring(player.UserId), value)
|
||||
end)
|
||||
if ok then
|
||||
written[player.UserId][b.id] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function readTop(b)
|
||||
local list = {}
|
||||
local store = stores[b.id]
|
||||
if store then
|
||||
pcall(function()
|
||||
local page = store:GetSortedAsync(false, L.size):GetCurrentPage()
|
||||
for _, e in ipairs(page) do
|
||||
table.insert(list, { userId = tonumber(e.key), value = e.value })
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- игроки на сервере: их значения свежее записанных
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
local value = math.floor(tonumber(p:GetAttribute(b.attr)) or 0)
|
||||
if value > 0 then
|
||||
local found = false
|
||||
for _, e in ipairs(list) do
|
||||
if e.userId == p.UserId then
|
||||
e.value = math.max(e.value, value)
|
||||
found = true
|
||||
end
|
||||
end
|
||||
if not found then
|
||||
table.insert(list, { userId = p.UserId, value = value })
|
||||
end
|
||||
names[p.UserId] = p.Name
|
||||
end
|
||||
end
|
||||
table.sort(list, function(a, c) return a.value > c.value end)
|
||||
return list
|
||||
end
|
||||
|
||||
local MEDAL = { "🥇", "🥈", "🥉" }
|
||||
local function render(b, list)
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
if not map then
|
||||
return
|
||||
end
|
||||
for _, model in ipairs(map:GetDescendants()) do
|
||||
if model:GetAttribute("Leaderboard") == b.id then
|
||||
for i = 1, L.size do
|
||||
local row = model:FindFirstChild("Row" .. i, true)
|
||||
if row then
|
||||
local e = list[i]
|
||||
row.Rank.Text = MEDAL[i] or (i .. ".")
|
||||
row.PlayerName.Text = e and nameOf(e.userId) or "—"
|
||||
row.Value.Text = e and (fmt(e.value) .. " " .. b.unit) or ""
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function refresh()
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
writePlayer(p)
|
||||
end
|
||||
for _, b in ipairs(L.boards) do
|
||||
render(b, readTop(b))
|
||||
end
|
||||
end
|
||||
|
||||
Players.PlayerRemoving:Connect(function(p)
|
||||
writePlayer(p)
|
||||
written[p.UserId] = nil
|
||||
end)
|
||||
|
||||
game:BindToClose(function()
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
writePlayer(p)
|
||||
end
|
||||
end)
|
||||
|
||||
task.spawn(function()
|
||||
task.wait(5) -- дать GameServer загрузить данные игроков
|
||||
while true do
|
||||
refresh()
|
||||
task.wait(L.refresh)
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,256 @@
|
||||
-- LobbyLife (Script) -> ServerScriptService
|
||||
-- Живое лобби (общее для всех игроков): у всех NPC играет idle-анимация, по площади гуляют жители —
|
||||
-- рыбак с удочкой на плече и бабушка с корзинкой. Маршруты считает PathfindingService, поэтому
|
||||
-- жители обходят лавки, фонтан и порталы. Остальное оживление — на клиенте (LobbyLife.client.lua).
|
||||
|
||||
local PathfindingService = game:GetService("PathfindingService")
|
||||
local ServerScriptService = game:GetService("ServerScriptService")
|
||||
|
||||
local WorldBuilder = require(ServerScriptService:WaitForChild("WorldBuilder"))
|
||||
|
||||
local ANIM = {
|
||||
idle = "rbxassetid://507766666", -- стандартные R15-анимации Roblox
|
||||
walk = "rbxassetid://507777826",
|
||||
}
|
||||
local FLOOR = 1
|
||||
-- куда ходят жители (x, z на площади лобби); между точками путь ищет PathfindingService
|
||||
local POINTS = {
|
||||
{ 28, 8 }, { -28, -8 }, { 0, 32 }, { 0, -32 }, { 30, 25 }, { -30, 25 }, { 30, -24 }, { -30, -24 },
|
||||
{ 45, 12 }, { -45, -12 }, { 12, 45 }, { -22, 40 }, { 22, -42 }, { -42, 20 },
|
||||
}
|
||||
local WALKERS = {
|
||||
{ name = "Рыбак Фёдор", skin = Color3.fromRGB(226, 176, 140), shirt = Color3.fromRGB(70, 110, 150), pants = Color3.fromRGB(60, 62, 70),
|
||||
hat = Color3.fromRGB(110, 120, 70), look = nil, prop = "rod", speed = 7 },
|
||||
{ name = "Бабушка Нюра", skin = Color3.fromRGB(240, 200, 170), shirt = Color3.fromRGB(170, 70, 90), pants = Color3.fromRGB(90, 60, 80),
|
||||
hat = Color3.fromRGB(235, 220, 120), look = "Scarf", prop = "basket", speed = 5 },
|
||||
}
|
||||
|
||||
local rng = Random.new()
|
||||
|
||||
---------------------------------------------------------------- куда жителям нельзя
|
||||
-- Поиск пути Roblox забирается на низкие препятствия (чаша фонтана, скамейки, основания порталов)
|
||||
-- и ведёт жителей поверху. Поэтому вокруг всего, что стоит на площади на уровне роста, ставим невидимые
|
||||
-- «стены»: CanCollide = true, но в своей группе столкновений, которая ни с чем не сталкивается —
|
||||
-- поиск пути видит в них препятствие, а игроки, жители и лучи (CanQuery = false) проходят насквозь.
|
||||
local LOBBY_R = 76 -- зоны — только на площади лобби
|
||||
local noWalk = {} -- { center, half } по мировым осям — чтобы выкинуть точки маршрута, попавшие внутрь
|
||||
|
||||
local function inside(pos)
|
||||
for _, z in ipairs(noWalk) do
|
||||
if math.abs(pos.X - z.center.X) <= z.half.X and math.abs(pos.Z - z.center.Z) <= z.half.Z then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- габариты повёрнутой коробки по мировым осям (половины): у лежащих цилиндров и повёрнутых лавок
|
||||
-- локальные оси не совпадают с мировыми, поэтому зону строим по проекции на пол
|
||||
local function worldHalf(cf, size)
|
||||
local r, u, b = cf.RightVector, cf.UpVector, cf.LookVector
|
||||
local h = size / 2
|
||||
return Vector3.new(
|
||||
math.abs(r.X) * h.X + math.abs(u.X) * h.Y + math.abs(b.X) * h.Z,
|
||||
math.abs(r.Y) * h.X + math.abs(u.Y) * h.Y + math.abs(b.Y) * h.Z,
|
||||
math.abs(r.Z) * h.X + math.abs(u.Z) * h.Y + math.abs(b.Z) * h.Z)
|
||||
end
|
||||
|
||||
local function buildNoWalk(map)
|
||||
local PhysicsService = game:GetService("PhysicsService")
|
||||
pcall(function()
|
||||
PhysicsService:RegisterCollisionGroup("NpcNoWalk")
|
||||
end)
|
||||
for _, g in ipairs(PhysicsService:GetRegisteredCollisionGroups()) do
|
||||
PhysicsService:CollisionGroupSetCollidable("NpcNoWalk", g.name, false)
|
||||
end
|
||||
local folder = Instance.new("Folder")
|
||||
folder.Name = "NpcNoWalk"
|
||||
local function block(cf, size)
|
||||
local c, e = cf.Position, worldHalf(cf, size)
|
||||
-- только то, что стоит на полу на уровне роста и на самой площади
|
||||
if c.Y - e.Y > FLOOR + 6 or c.Y + e.Y < FLOOR + 0.6 or Vector3.new(c.X, 0, c.Z).Magnitude > LOBBY_R then
|
||||
return
|
||||
end
|
||||
local size2 = Vector3.new(e.X * 2 + 1.5, 10, e.Z * 2 + 1.5) -- небольшой запас: жители не трутся о края
|
||||
local p = Instance.new("Part")
|
||||
p.Name = "NoWalk"
|
||||
p.Anchored, p.CanCollide, p.CanQuery, p.CanTouch = true, true, false, false
|
||||
p.CollisionGroup = "NpcNoWalk" -- ни с чем не сталкивается, но поиск пути её видит
|
||||
p.Transparency = 1
|
||||
p.Size = size2
|
||||
p.CFrame = CFrame.new(c.X, FLOOR + 5, c.Z)
|
||||
p.Parent = folder
|
||||
table.insert(noWalk, { center = p.Position, half = size2 / 2 })
|
||||
end
|
||||
local skip = {
|
||||
LobbyCliffs = true, LobbyCliffDecor = true, LobbyCliffFoot = true, LobbyForest = true, LobbyTrees = true,
|
||||
LobbyRockPlants = true, LobbyHillForest = true, LobbyHaze = true, FishingZones = true, World1Map = true,
|
||||
}
|
||||
local function consider(inst)
|
||||
if inst:IsA("Model") then
|
||||
if inst:FindFirstChildOfClass("Humanoid") or inst:GetAttribute("Npc") then
|
||||
return
|
||||
end
|
||||
local cf, size = inst:GetBoundingBox()
|
||||
block(cf, size)
|
||||
elseif inst:IsA("BasePart") and inst.Transparency < 0.95 then
|
||||
block(inst.CFrame, inst.Size)
|
||||
end
|
||||
end
|
||||
for _, c in ipairs(map:GetChildren()) do
|
||||
if not skip[c.Name] and not c:IsA("Folder") then
|
||||
consider(c)
|
||||
end
|
||||
end
|
||||
-- модели, поставленные на площадь руками (фонтан, декор из Toolbox)
|
||||
for _, c in ipairs(workspace:GetChildren()) do
|
||||
if c ~= map and (c:IsA("Model") or c:IsA("BasePart")) and not c:IsA("Terrain") then
|
||||
consider(c)
|
||||
end
|
||||
end
|
||||
folder.Parent = workspace
|
||||
end
|
||||
|
||||
local function loadAnim(hum, id)
|
||||
local animator = hum:FindFirstChildOfClass("Animator")
|
||||
if not animator then
|
||||
animator = Instance.new("Animator")
|
||||
animator.Parent = hum
|
||||
end
|
||||
local a = Instance.new("Animation")
|
||||
a.AnimationId = id
|
||||
return animator:LoadAnimation(a)
|
||||
end
|
||||
|
||||
local function startIdle(rig)
|
||||
local hum = rig:FindFirstChildOfClass("Humanoid")
|
||||
if hum and not rig:GetAttribute("IdleOn") then
|
||||
rig:SetAttribute("IdleOn", true)
|
||||
local ok, track = pcall(loadAnim, hum, ANIM.idle)
|
||||
if ok then
|
||||
track.Looped = true
|
||||
track:Play(0.3, 1, rng:NextNumber(0.85, 1.1))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- реквизит в руках / за спиной: приваривается к части тела
|
||||
local function prop(rig, kind)
|
||||
local function piece(partName, size, color, offset, shape)
|
||||
local body = rig:FindFirstChild(partName)
|
||||
if not body then
|
||||
return
|
||||
end
|
||||
local p = Instance.new("Part")
|
||||
p.Shape = shape or Enum.PartType.Block
|
||||
p.Size = size
|
||||
p.Color = color
|
||||
p.Material = Enum.Material.SmoothPlastic
|
||||
p.CanCollide, p.CanQuery, p.CanTouch, p.Massless = false, false, false, true
|
||||
p.CFrame = body.CFrame * offset
|
||||
local w = Instance.new("WeldConstraint")
|
||||
w.Part0, w.Part1 = body, p
|
||||
w.Parent = p
|
||||
p.Parent = rig
|
||||
end
|
||||
if kind == "rod" then
|
||||
-- удочка на плече: длинное удилище наискосок за спиной и катушка
|
||||
piece("UpperTorso", Vector3.new(0.18, 7, 0.18), Color3.fromRGB(120, 80, 45),
|
||||
CFrame.new(0.4, 1.2, 0.65) * CFrame.Angles(math.rad(-25), 0, math.rad(-30)), Enum.PartType.Block)
|
||||
piece("UpperTorso", Vector3.new(0.5, 0.5, 0.35), Color3.fromRGB(60, 60, 66), CFrame.new(0.9, 0.2, 0.75))
|
||||
elseif kind == "basket" then
|
||||
-- корзинка в руке: короб и ручка
|
||||
piece("RightHand", Vector3.new(1.1, 0.7, 0.8), Color3.fromRGB(170, 120, 60), CFrame.new(0, -0.7, 0))
|
||||
piece("RightHand", Vector3.new(0.12, 0.6, 0.6), Color3.fromRGB(140, 95, 45), CFrame.new(0, -0.15, 0))
|
||||
piece("RightHand", Vector3.new(0.9, 0.18, 0.6), Color3.fromRGB(240, 120, 90), CFrame.new(0, -0.28, 0)) -- яблоки сверху
|
||||
end
|
||||
end
|
||||
|
||||
local function walker(def, map)
|
||||
if #POINTS < 2 then
|
||||
warn("LobbyLife: свободных точек маршрута меньше двух, жители не гуляют")
|
||||
return
|
||||
end
|
||||
local start = POINTS[rng:NextInteger(1, #POINTS)]
|
||||
local spot = Instance.new("Part")
|
||||
spot.CFrame = CFrame.new(start[1], FLOOR + 3, start[2])
|
||||
spot:SetAttribute("NpcName", def.name)
|
||||
spot:SetAttribute("SkinColor", def.skin)
|
||||
spot:SetAttribute("ShirtColor", def.shirt)
|
||||
spot:SetAttribute("PantsColor", def.pants)
|
||||
spot:SetAttribute("HatColor", def.hat)
|
||||
if def.look then
|
||||
spot:SetAttribute("Look", def.look)
|
||||
end
|
||||
local rig = WorldBuilder.spawnNpc(spot, map)
|
||||
spot:Destroy()
|
||||
if not rig then
|
||||
return
|
||||
end
|
||||
rig:SetAttribute("Walker", true)
|
||||
prop(rig, def.prop)
|
||||
local hum = rig:FindFirstChildOfClass("Humanoid")
|
||||
local root = rig:FindFirstChild("HumanoidRootPart")
|
||||
hum.WalkSpeed = def.speed
|
||||
hum.NameDisplayDistance = 35
|
||||
root.Anchored = false
|
||||
pcall(function() root:SetNetworkOwner(nil) end) -- двигает сервер, у всех одинаково
|
||||
startIdle(rig)
|
||||
local walk = loadAnim(hum, ANIM.walk)
|
||||
walk.Looped = true
|
||||
|
||||
task.spawn(function()
|
||||
while rig.Parent do
|
||||
local p = POINTS[rng:NextInteger(1, #POINTS)]
|
||||
local target = Vector3.new(p[1], FLOOR + 2, p[2])
|
||||
if (target - root.Position).Magnitude > 8 then
|
||||
local path = PathfindingService:CreatePath({ AgentRadius = 2, AgentHeight = 5, AgentCanJump = false })
|
||||
local ok = pcall(function()
|
||||
path:ComputeAsync(root.Position, target)
|
||||
end)
|
||||
if ok and path.Status == Enum.PathStatus.Success then
|
||||
walk:Play(0.25, 1, def.speed / 8)
|
||||
for _, wp in ipairs(path:GetWaypoints()) do
|
||||
if not rig.Parent then
|
||||
return
|
||||
end
|
||||
hum:MoveTo(wp.Position)
|
||||
local reached = hum.MoveToFinished:Wait()
|
||||
if not reached then
|
||||
break -- застрял: выберем другую точку
|
||||
end
|
||||
end
|
||||
walk:Stop(0.3)
|
||||
end
|
||||
end
|
||||
task.wait(rng:NextNumber(3, 8)) -- постоял, посмотрел по сторонам
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local map = workspace:WaitForChild("FishingMap")
|
||||
task.wait(2) -- MapBuilder расставляет NPC
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:IsA("Model") and d:GetAttribute("Npc") then
|
||||
startIdle(d)
|
||||
end
|
||||
end
|
||||
map.DescendantAdded:Connect(function(d)
|
||||
if d:IsA("Model") then
|
||||
task.defer(function()
|
||||
if d:GetAttribute("Npc") then
|
||||
startIdle(d)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
buildNoWalk(map)
|
||||
-- точки маршрута, оказавшиеся внутри препятствий (например, на месте передвинутой лавки), не используем
|
||||
for i = #POINTS, 1, -1 do
|
||||
if inside(Vector3.new(POINTS[i][1], FLOOR, POINTS[i][2])) then
|
||||
table.remove(POINTS, i)
|
||||
end
|
||||
end
|
||||
for _, def in ipairs(WALKERS) do
|
||||
walker(def, map)
|
||||
end
|
||||
@@ -700,6 +700,125 @@ function Builder.stallParts(cf, parent)
|
||||
return list
|
||||
end
|
||||
|
||||
-- Доска лидеров (low poly): два столба, двускатная крыша, табличка с названием, фонарики и экран на rows строк.
|
||||
-- cf стоит на полу и смотрит LookVector на зрителей. Строки Row1…RowN заполняет Leaderboards.server.lua.
|
||||
function Builder.leaderboard(cf, board, rows, parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "Leaderboard_" .. board.id
|
||||
model:SetAttribute("Leaderboard", board.id)
|
||||
local function part(props)
|
||||
local p = Instance.new(props.Class or "Part")
|
||||
p.Anchored = true
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
p.Material = Enum.Material.SmoothPlastic
|
||||
for k, v in pairs(props) do
|
||||
if k ~= "Class" and k ~= "At" then
|
||||
p[k] = v
|
||||
end
|
||||
end
|
||||
p.CFrame = cf * props.At
|
||||
p.Parent = model
|
||||
return p
|
||||
end
|
||||
local WOOD, DARK, TRIM = Color3.fromRGB(122, 82, 50), Color3.fromRGB(58, 38, 26), Color3.fromRGB(176, 122, 66)
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
part({ Name = "Foot", Size = V(2.2, 1, 2.2), At = CFrame.new(s * 6.6, 0.5, 0), Color = Color3.fromRGB(128, 118, 122) })
|
||||
part({ Name = "Post", Size = V(1.3, 16.5, 1.3), At = CFrame.new(s * 6.6, 8.25, 0), Color = WOOD })
|
||||
-- фонарик на столбе
|
||||
local lamp = part({ Name = "Lantern", Size = V(0.9, 1.2, 0.9), At = CFrame.new(s * 6.6, 14.2, -0.95),
|
||||
Material = Enum.Material.Neon, Color = Color3.fromRGB(255, 196, 110), CanCollide = false })
|
||||
part({ Name = "LanternCap", Size = V(1.2, 0.3, 1.2), At = CFrame.new(s * 6.6, 14.95, -0.95), Color = DARK, CanCollide = false })
|
||||
local light = Instance.new("PointLight")
|
||||
light.Range, light.Brightness, light.Color = 12, 0.9, Color3.fromRGB(255, 190, 110)
|
||||
light.Parent = lamp
|
||||
end
|
||||
local screen = part({ Name = "Screen", Size = V(12, 9.6, 0.5), At = CFrame.new(0, 9.4, 0), Color = DARK })
|
||||
part({ Name = "Trim", Size = V(13.4, 0.6, 0.8), At = CFrame.new(0, 14.5, 0), Color = TRIM })
|
||||
part({ Name = "Trim", Size = V(13.4, 0.6, 0.8), At = CFrame.new(0, 4.3, 0), Color = TRIM })
|
||||
local plaque = part({ Name = "Plaque", Size = V(11, 2.3, 0.7), At = CFrame.new(0, 16.2, -0.1), Color = WOOD })
|
||||
part({ Name = "PlaqueTrim", Size = V(11.6, 2.8, 0.5), At = CFrame.new(0, 16.2, 0.15), Color = TRIM })
|
||||
-- двускатная крыша
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
part({ Name = "Roof", Size = V(8, 0.5, 2.6), At = CFrame.new(s * 3.55, 18.35, 0) * CFrame.Angles(0, 0, math.rad(-s * 17)),
|
||||
Color = Color3.fromRGB(150, 70, 52) })
|
||||
end
|
||||
|
||||
-- заголовок
|
||||
local titleGui = Instance.new("SurfaceGui")
|
||||
titleGui.Face = Enum.NormalId.Front
|
||||
titleGui.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
|
||||
titleGui.PixelsPerStud = 40
|
||||
titleGui.LightInfluence = 0
|
||||
titleGui.Parent = plaque
|
||||
local title = Instance.new("TextLabel")
|
||||
title.Size = UDim2.new(1, -16, 1, -8)
|
||||
title.Position = UDim2.fromOffset(8, 4)
|
||||
title.BackgroundTransparency = 1
|
||||
title.Font = Enum.Font.FredokaOne
|
||||
title.TextScaled = true
|
||||
title.Text = board.title
|
||||
title.TextColor3 = board.color
|
||||
title.Parent = titleGui
|
||||
local ts = Instance.new("UIStroke")
|
||||
ts.Color, ts.Thickness = Color3.fromRGB(40, 22, 10), 3
|
||||
ts.Parent = title
|
||||
|
||||
-- строки топа
|
||||
local gui = Instance.new("SurfaceGui")
|
||||
gui.Name = "Rows"
|
||||
gui.Face = Enum.NormalId.Front
|
||||
gui.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
|
||||
gui.PixelsPerStud = 40
|
||||
gui.LightInfluence = 0.2
|
||||
gui.Parent = screen
|
||||
local list = Instance.new("Frame")
|
||||
list.Size = UDim2.new(1, -24, 1, -20)
|
||||
list.Position = UDim2.fromOffset(12, 10)
|
||||
list.BackgroundTransparency = 1
|
||||
list.Parent = gui
|
||||
local layout = Instance.new("UIListLayout")
|
||||
layout.Padding = UDim.new(0, 3)
|
||||
layout.SortOrder = Enum.SortOrder.LayoutOrder
|
||||
layout.Parent = list
|
||||
local RANK_COLOR = { Color3.fromRGB(255, 210, 80), Color3.fromRGB(215, 225, 235), Color3.fromRGB(230, 150, 90) }
|
||||
for i = 1, rows do
|
||||
local row = Instance.new("Frame")
|
||||
row.Name = "Row" .. i
|
||||
row.LayoutOrder = i
|
||||
row.Size = UDim2.new(1, 0, 1 / rows, -3)
|
||||
row.BackgroundColor3 = Color3.fromRGB(255, 240, 210)
|
||||
row.BackgroundTransparency = (i % 2 == 0) and 0.94 or 0.88
|
||||
row.BorderSizePixel = 0
|
||||
row.Parent = list
|
||||
local corner = Instance.new("UICorner")
|
||||
corner.CornerRadius = UDim.new(0, 6)
|
||||
corner.Parent = row
|
||||
local color = RANK_COLOR[i] or Color3.fromRGB(245, 232, 205)
|
||||
local function label(name, pos, size, align, text)
|
||||
local t = Instance.new("TextLabel")
|
||||
t.Name = name
|
||||
t.Position, t.Size = pos, size
|
||||
t.BackgroundTransparency = 1
|
||||
t.Font = Enum.Font.FredokaOne
|
||||
t.TextScaled = true
|
||||
t.TextXAlignment = align
|
||||
t.TextColor3 = color
|
||||
t.Text = text
|
||||
t.Parent = row
|
||||
return t
|
||||
end
|
||||
label("Rank", UDim2.new(0, 6, 0.1, 0), UDim2.new(0, 46, 0.8, 0), Enum.TextXAlignment.Center, ({ "🥇", "🥈", "🥉" })[i] or (i .. "."))
|
||||
label("PlayerName", UDim2.new(0, 58, 0.12, 0), UDim2.new(0.58, -58, 0.76, 0), Enum.TextXAlignment.Left, "—")
|
||||
label("Value", UDim2.new(0.58, 0, 0.12, 0), UDim2.new(0.42, -8, 0.76, 0), Enum.TextXAlignment.Right, "")
|
||||
end
|
||||
-- опора модели — экран, точка опоры на земле под центром доски и без наклона:
|
||||
-- иначе Studio берёт поворот случайной детали (ската крыши) и стрелки инструментов встают наискосок
|
||||
model.PrimaryPart = screen
|
||||
screen.PivotOffset = CFrame.new(0, -9.4, 0)
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
|
||||
-- лавка: cf стоит на полу, сторона -Z смотрит на покупателей
|
||||
local function stall(cf, opt)
|
||||
local function at(x, y, z)
|
||||
@@ -1016,6 +1135,12 @@ function Builder.build()
|
||||
lobbyTrees()
|
||||
lobbyRockPlants()
|
||||
lobbyHills()
|
||||
-- доски лидеров у подножия скал напротив точки появления
|
||||
for i, b in ipairs(Config.Leaderboards.boards) do
|
||||
local a = math.rad(({ 220, 270, 320 })[i] or 270)
|
||||
local p = V(math.cos(a) * 71, FLOOR, math.sin(a) * 71)
|
||||
Builder.leaderboard(CFrame.lookAt(p, V(0, FLOOR, 0)), b, Config.Leaderboards.size, map)
|
||||
end
|
||||
|
||||
-- магазин (запад) и скупка (восток)
|
||||
stall(CFrame.lookAt(V(-62, FLOOR, 0), V(0, FLOOR, 0)), {
|
||||
@@ -1152,12 +1277,31 @@ function Builder.build()
|
||||
-- сундук с ежедневной наградой
|
||||
do
|
||||
local cf = CFrame.lookAt(V(14, FLOOR, 34), V(0, FLOOR, 50))
|
||||
local base = P({ Size = V(5, 3, 3.2), CFrame = cf * CFrame.new(0, 1.5, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 90, 50) })
|
||||
P({ Shape = Enum.PartType.Cylinder, Size = V(5, 3.2, 3.2), CFrame = cf * CFrame.new(0, 3, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(160, 105, 60) })
|
||||
for _, x in ipairs({ -1.8, 1.8 }) do
|
||||
P({ Size = V(0.4, 4.9, 3.4), CFrame = cf * CFrame.new(x, 2.3, 0), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 200, 60) })
|
||||
local template = ServerStorage:FindFirstChild("DailyChestTemplate")
|
||||
local base
|
||||
if template and template:IsA("Model") then
|
||||
-- low poly сундук (Base, Lid, Coins, Lock; замок по +Z модели, опора — низ по центру);
|
||||
-- его анимирует ChestAnimation.client.lua, подсказка и подпись — на невидимой детали
|
||||
local chest = template:Clone()
|
||||
chest.Name = "DailyChest"
|
||||
chest:SetAttribute("DailyChest", true)
|
||||
chest:PivotTo(cf * CFrame.Angles(0, math.pi, 0))
|
||||
for _, p in ipairs(chest:GetDescendants()) do
|
||||
if p:IsA("BasePart") then
|
||||
p.Anchored = true
|
||||
p.CanCollide = p.Name == "Base"
|
||||
end
|
||||
end
|
||||
chest.Parent = map
|
||||
base = P({ Name = "DailyChestPrompt", Size = V(5, 3, 3.2), CFrame = cf * CFrame.new(0, 1.5, 0), Transparency = 1, CanCollide = false })
|
||||
else
|
||||
base = P({ Size = V(5, 3, 3.2), CFrame = cf * CFrame.new(0, 1.5, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 90, 50) })
|
||||
P({ Shape = Enum.PartType.Cylinder, Size = V(5, 3.2, 3.2), CFrame = cf * CFrame.new(0, 3, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(160, 105, 60) })
|
||||
for _, x in ipairs({ -1.8, 1.8 }) do
|
||||
P({ Size = V(0.4, 4.9, 3.4), CFrame = cf * CFrame.new(x, 2.3, 0), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 200, 60) })
|
||||
end
|
||||
P({ Size = V(0.9, 1.1, 0.3), CFrame = cf * CFrame.new(0, 2.8, -1.7), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 220, 90) })
|
||||
end
|
||||
P({ Size = V(0.9, 1.1, 0.3), CFrame = cf * CFrame.new(0, 2.8, -1.7), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 220, 90) })
|
||||
local sp = Instance.new("ParticleEmitter")
|
||||
sp.Texture = "rbxasset://textures/particles/sparkles_main.dds"
|
||||
sp.Rate = 8
|
||||
@@ -1794,6 +1938,7 @@ local function spawnNpc(spot, parent)
|
||||
return nil
|
||||
end
|
||||
rig.Name = name
|
||||
rig:SetAttribute("Npc", true) -- по нему клиент находит NPC (взгляд на игрока, приветствие), сервер — включает idle
|
||||
local hum = rig:FindFirstChildOfClass("Humanoid")
|
||||
hum.DisplayName = name
|
||||
hum.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
|
||||
@@ -1827,7 +1972,6 @@ local function spawnNpc(spot, parent)
|
||||
w.C0 = head.CFrame:Inverse() * p.CFrame
|
||||
w.Parent = p
|
||||
p.Parent = rig
|
||||
<<<<<<< HEAD
|
||||
return p
|
||||
end
|
||||
if spot:GetAttribute("Look") == "Elder" then
|
||||
@@ -1841,15 +1985,16 @@ local function spawnNpc(spot, parent)
|
||||
elderPart(V(1.0, 0.75, 0.35), CFrame.new(0, -0.55, -0.5), colors.hat)
|
||||
elderPart(V(0.32, 0.3, 0.08), CFrame.new(0.22, 0.12, -0.6), Color3.fromRGB(20, 20, 22))
|
||||
elderPart(V(1.24, 0.08, 1.24), CFrame.new(0, 0.18, 0) * CFrame.Angles(0, 0, math.rad(-12)), Color3.fromRGB(20, 20, 22))
|
||||
elseif spot:GetAttribute("Look") == "Scarf" then
|
||||
-- платок (цвет HatColor): макушка и узелок сзади
|
||||
local s = hatPart(V(1.3, 0.5, 1.3), CFrame.new(0, 0.42, 0.05), Enum.PartType.Block)
|
||||
s.Material = Enum.Material.SmoothPlastic
|
||||
local k = hatPart(V(0.4, 0.4, 0.3), CFrame.new(0, 0.05, 0.62), Enum.PartType.Block)
|
||||
k.Material = Enum.Material.SmoothPlastic
|
||||
else
|
||||
hatPart(V(0.15, 2.0, 2.0), CFrame.new(0, 0.55, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
hatPart(V(0.6, 1.35, 1.35), CFrame.new(0, 0.85, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
end
|
||||
=======
|
||||
end
|
||||
hatPart(V(0.15, 2.0, 2.0), CFrame.new(0, 0.55, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
hatPart(V(0.6, 1.35, 1.35), CFrame.new(0, 0.85, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
local action = spot:GetAttribute("NpcAction")
|
||||
if action then
|
||||
@@ -1857,6 +2002,7 @@ local function spawnNpc(spot, parent)
|
||||
end
|
||||
return rig
|
||||
end
|
||||
Builder.spawnNpc = spawnNpc -- жители лобби (LobbyLife.server.lua) создаются так же
|
||||
|
||||
-- NPC встают на свои детали-места, доски «кто водится» получают актуальный список рыб
|
||||
function Builder.prepareRuntime(root)
|
||||
@@ -1874,6 +2020,23 @@ function Builder.prepareRuntime(root)
|
||||
spot.Transparency = 1
|
||||
spawnNpc(spot, root)
|
||||
end
|
||||
-- порталы лобби двигают в Studio за модель (PortalModel_WorldN); невидимый якорь с подсказкой и подписью
|
||||
-- (Portal_WorldN) и маркер стрелки обучения (GuidePortal, перед порталом в мир 1) встают к модели
|
||||
for _, model in ipairs(root:GetChildren()) do
|
||||
local id = model.Name:match("^PortalModel_(World%d)$")
|
||||
local anchor = id and root:FindFirstChild("Portal_" .. id)
|
||||
if model:IsA("Model") and anchor then
|
||||
local cf, size = model:GetBoundingBox()
|
||||
anchor.CFrame = CFrame.new(cf.Position.X, cf.Position.Y - size.Y / 2 + 10, cf.Position.Z) * (anchor.CFrame - anchor.Position)
|
||||
local marker = id == "World1" and root:FindFirstChild("GuidePortal", true)
|
||||
if marker then
|
||||
local flat = V(cf.Position.X, 0, cf.Position.Z)
|
||||
local outward = flat.Magnitude > 0.1 and flat.Unit or V(0, 0, 1)
|
||||
local p = flat + outward * 5.7
|
||||
marker.CFrame = CFrame.new(p.X, marker.Position.Y, p.Z) * (marker.CFrame - marker.Position)
|
||||
end
|
||||
end
|
||||
end
|
||||
for _, board in ipairs(boards) do
|
||||
writeBestiary(board)
|
||||
end
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
-- ActivityFeed (LocalScript) -> StarterPlayer > StarterPlayerScripts
|
||||
-- Постоянная активность на экране: лента событий игроков (уловы, уровни, покупки) и крупный баннер
|
||||
-- со звуком, когда кто-то ловит редкую или мутировавшую рыбу. События шлёт GameServer: remote "Feed".
|
||||
-- Самые редкие уловы приходят и с других серверов (помечены 🌍). Настройки — Config.Feed.
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local TweenService = game:GetService("TweenService")
|
||||
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
local Audio = require(script.Parent:WaitForChild("Audio"))
|
||||
local Theme = require(script.Parent:WaitForChild("UiTheme"))
|
||||
local C = Theme.C
|
||||
local F = Config.Feed
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
local remote = ReplicatedStorage:WaitForChild("GameEvent")
|
||||
|
||||
local function new(class, props, children)
|
||||
local o = Instance.new(class)
|
||||
for k, v in pairs(props) do
|
||||
if k ~= "Parent" then
|
||||
o[k] = v
|
||||
end
|
||||
end
|
||||
for _, c in ipairs(children or {}) do
|
||||
c.Parent = o
|
||||
end
|
||||
o.Parent = props.Parent
|
||||
return o
|
||||
end
|
||||
local function fmt(n)
|
||||
local s = tostring(math.floor(n))
|
||||
local out = s:reverse():gsub("(%d%d%d)", "%1 "):reverse()
|
||||
return (out:gsub("^ ", ""))
|
||||
end
|
||||
local function hex(c)
|
||||
return string.format("#%02X%02X%02X", c.R * 255, c.G * 255, c.B * 255)
|
||||
end
|
||||
local function esc(s)
|
||||
return (tostring(s):gsub("&", "&"):gsub("<", "<"):gsub(">", ">"))
|
||||
end
|
||||
|
||||
local gui = new("ScreenGui", { Name = "ActivityFeed", ResetOnSpawn = false, DisplayOrder = 5, Parent = player:WaitForChild("PlayerGui") })
|
||||
local root = Theme.followScale(gui)
|
||||
|
||||
---------------------------------------------------------------- лента
|
||||
|
||||
local list = new("Frame", { BackgroundTransparency = 1, Parent = root }, {
|
||||
new("UIListLayout", { Padding = UDim.new(0, 4), SortOrder = Enum.SortOrder.LayoutOrder, VerticalAlignment = Enum.VerticalAlignment.Bottom }),
|
||||
})
|
||||
local maxLines = F.lines
|
||||
Theme.onLayout(function(compact)
|
||||
if compact then
|
||||
-- телефон: справа под плашкой погоды (слева внизу — джойстик)
|
||||
list.AnchorPoint = Vector2.new(1, 0)
|
||||
list.Position = UDim2.new(1, -12, 0, 130)
|
||||
list.Size = UDim2.fromOffset(300, 4 * 30)
|
||||
maxLines = 4
|
||||
else
|
||||
list.AnchorPoint = Vector2.new(0, 1)
|
||||
list.Position = UDim2.new(0, 12, 1, -14)
|
||||
list.Size = UDim2.fromOffset(420, F.lines * 30)
|
||||
maxLines = F.lines
|
||||
end
|
||||
end)
|
||||
|
||||
local order = 0
|
||||
local function line(richText)
|
||||
order += 1
|
||||
local rows = {}
|
||||
for _, c in ipairs(list:GetChildren()) do
|
||||
if c:IsA("Frame") then
|
||||
table.insert(rows, c)
|
||||
end
|
||||
end
|
||||
table.sort(rows, function(a, b) return a.LayoutOrder < b.LayoutOrder end)
|
||||
while #rows >= maxLines do
|
||||
table.remove(rows, 1):Destroy()
|
||||
end
|
||||
local row = new("Frame", {
|
||||
Size = UDim2.fromOffset(0, 26), AutomaticSize = Enum.AutomaticSize.X, BackgroundColor3 = C.woodDark,
|
||||
BackgroundTransparency = 0.25, LayoutOrder = order, Parent = list,
|
||||
}, {
|
||||
new("UICorner", { CornerRadius = UDim.new(0, 8) }),
|
||||
new("UIStroke", { Color = C.goldDark, Thickness = 1, Transparency = 0.5 }),
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 10), PaddingRight = UDim.new(0, 10) }),
|
||||
})
|
||||
local label = new("TextLabel", {
|
||||
Size = UDim2.fromScale(0, 1), AutomaticSize = Enum.AutomaticSize.X, BackgroundTransparency = 1,
|
||||
FontFace = Theme.BODY2_FACE, TextSize = 15, TextColor3 = C.text, RichText = true, Text = richText,
|
||||
TextXAlignment = Enum.TextXAlignment.Left, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.6, Parent = row,
|
||||
})
|
||||
-- появляется плавно, через lineTime так же уходит
|
||||
row.BackgroundTransparency, label.TextTransparency = 1, 1
|
||||
TweenService:Create(row, TweenInfo.new(0.3), { BackgroundTransparency = 0.25 }):Play()
|
||||
TweenService:Create(label, TweenInfo.new(0.3), { TextTransparency = 0 }):Play()
|
||||
task.delay(F.lineTime, function()
|
||||
if row.Parent then
|
||||
TweenService:Create(row, TweenInfo.new(0.6), { BackgroundTransparency = 1 }):Play()
|
||||
TweenService:Create(label, TweenInfo.new(0.6), { TextTransparency = 1, TextStrokeTransparency = 1 }):Play()
|
||||
task.wait(0.65)
|
||||
row:Destroy()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- баннер редкого улова
|
||||
|
||||
local banner = new("Frame", {
|
||||
-- внизу над полосой подсечки (она занимает 100…224 px от низа): верх экрана — для своих уведомлений и карточки улова
|
||||
Size = UDim2.fromOffset(560, 92), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -240),
|
||||
BackgroundColor3 = Color3.new(1, 1, 1), Visible = false, ZIndex = 20, Parent = root,
|
||||
}, { new("UICorner", { CornerRadius = UDim.new(0, 12) }), Theme.woodGradient(C.wood, C.woodDark) })
|
||||
local bannerStroke = new("UIStroke", { Thickness = 3, Color = C.gold, Parent = banner })
|
||||
Theme.innerBorder(banner, 5, 8, C.gold, 0.45)
|
||||
Theme.rivets(banner, 8, 6)
|
||||
local bannerScale = new("UIScale", { Parent = banner })
|
||||
local bTop = new("TextLabel", {
|
||||
Size = UDim2.new(1, -30, 0, 20), Position = UDim2.fromOffset(15, 8), BackgroundTransparency = 1, ZIndex = 21,
|
||||
FontFace = Theme.BODY_FACE, TextSize = 15, TextColor3 = C.muted, Text = "", Parent = banner,
|
||||
})
|
||||
local bMain = new("TextLabel", {
|
||||
Size = UDim2.new(1, -30, 0, 34), Position = UDim2.fromOffset(15, 28), BackgroundTransparency = 1, ZIndex = 21,
|
||||
FontFace = Theme.TITLE_FACE, TextSize = 26, TextColor3 = C.text, RichText = true, TextScaled = true, Text = "",
|
||||
TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.4, Parent = banner,
|
||||
})
|
||||
new("UITextSizeConstraint", { MaxTextSize = 26, Parent = bMain })
|
||||
local bSub = new("TextLabel", {
|
||||
Size = UDim2.new(1, -30, 0, 20), Position = UDim2.fromOffset(15, 64), BackgroundTransparency = 1, ZIndex = 21,
|
||||
FontFace = Theme.BODY2_FACE, TextSize = 15, TextColor3 = C.text, RichText = true, Text = "", Parent = banner,
|
||||
})
|
||||
|
||||
local queue, showing = {}, false
|
||||
local function showNext()
|
||||
local info = table.remove(queue, 1)
|
||||
if not info then
|
||||
showing = false
|
||||
return
|
||||
end
|
||||
showing = true
|
||||
local r = Config.Rarities[info.rarity] or Config.Rarities.Common
|
||||
local mut = info.mutation and Config.Find(Config.Mutations, info.mutation)
|
||||
local color = mut and mut.color or r.color
|
||||
bannerStroke.Color = color
|
||||
bTop.Text = info.remote and "🌍 УЛОВ НА ДРУГОМ СЕРВЕРЕ" or "🌟 РЕДКИЙ УЛОВ"
|
||||
bTop.TextColor3 = color
|
||||
-- мутация — отдельной меткой: её название в женском роде («Золотая» рыба), а у рыбы может быть любой
|
||||
bMain.Text = ("<b>%s</b> поймал <font color=\"%s\">%s</font>%s!"):format(esc(info.name), hex(color),
|
||||
esc(info.fish), mut and (" <font color=\"%s\">✦ %s</font>"):format(hex(mut.color), mut.name) or "")
|
||||
bSub.Text = ("<font color=\"%s\">%s</font> · %s %s%s"):format(hex(r.color), r.name, fmt(info.value or 0), Theme.SILVER,
|
||||
info.world and (" · " .. info.world) or "")
|
||||
banner.Visible = true
|
||||
bannerScale.Scale = 0.4
|
||||
TweenService:Create(bannerScale, TweenInfo.new(0.45, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Scale = 1 }):Play()
|
||||
-- звук: легендарная, мифическая и радужная — фанфары, остальное — искристый звон
|
||||
local grand = r.rank >= 5 or info.mutation == "Rainbow"
|
||||
Audio.play(grand and "fanfare" or "sparkle")
|
||||
task.delay(4.2, function()
|
||||
TweenService:Create(bannerScale, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.In), { Scale = 0 }):Play()
|
||||
task.wait(0.3)
|
||||
banner.Visible = false
|
||||
showNext()
|
||||
end)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- события
|
||||
|
||||
local RANK_ICON = { "🎣", "🎣", "🐟", "✨", "🌟", "💫" }
|
||||
remote.OnClientEvent:Connect(function(action, kind, info)
|
||||
if action ~= "Feed" or type(info) ~= "table" then
|
||||
return
|
||||
end
|
||||
local who = ("<b>%s</b>"):format(esc(info.name or "?"))
|
||||
if kind == "catch" then
|
||||
local r = Config.Rarities[info.rarity] or Config.Rarities.Common
|
||||
local mut = info.mutation and Config.Find(Config.Mutations, info.mutation)
|
||||
local color = mut and mut.color or r.color
|
||||
line(("%s%s %s поймал <font color=\"%s\">%s</font>%s%s"):format(
|
||||
info.remote and "🌍 " or "", RANK_ICON[r.rank] or "🎣", who, hex(color), esc(info.fish),
|
||||
mut and (" <font color=\"%s\">✦ %s</font>"):format(hex(mut.color), mut.name) or "",
|
||||
r.rank >= 3 and (" <font color=\"%s\">· %s</font>"):format(hex(r.color), r.name) or ""))
|
||||
-- свой улов игрок и так видит крупно — баннер только про других
|
||||
if info.big and info.userId ~= player.UserId then
|
||||
table.insert(queue, info)
|
||||
if not showing then
|
||||
showNext()
|
||||
end
|
||||
end
|
||||
elseif kind == "level" then
|
||||
line(("⭐ %s достиг уровня <font color=\"%s\">%d</font>"):format(who, Theme.HEX.gold, info.level or 0))
|
||||
elseif kind == "buy" then
|
||||
line(("💎 %s купил %s"):format(who, esc(info.item or "")))
|
||||
end
|
||||
end)
|
||||
@@ -66,6 +66,7 @@ local LOOK = {
|
||||
local camera = workspace.CurrentCamera
|
||||
local weatherCC = new("ColorCorrectionEffect", { Name = "WeatherCC", Parent = camera })
|
||||
local nightCC = new("ColorCorrectionEffect", { Name = "NightCC", Parent = camera })
|
||||
-- цветокоррекция действует только на 3D-сцену, экран загрузки она не затемняет — выключать её на время загрузки не нужно
|
||||
workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
|
||||
camera = workspace.CurrentCamera
|
||||
weatherCC.Parent = camera
|
||||
@@ -282,6 +283,63 @@ local function refreshPill(clock, night, w, placeId)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- фонари: днём погашены, к ночи зажигаются
|
||||
-- лампа — небольшая неоновая деталь со светом внутри (фонари площади, лавок, досок лидеров, домиков).
|
||||
-- Днём неон и свет дают пересвет и ореолы, поэтому лампа становится матовым тёплым стеклом без света.
|
||||
-- Порталы и прочее крупное свечение не трогаем.
|
||||
|
||||
local LAMP_ON_AT = 0.3 -- с какой «ночности» (0 — день, 1 — ночь) фонари зажигаются
|
||||
local lamps, lampScanAt, lampsLit = {}, -math.huge, nil
|
||||
|
||||
local function scanLamps()
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
if not map then
|
||||
return
|
||||
end
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:IsA("Light") and d.Parent:IsA("BasePart") and not lamps[d.Parent] then
|
||||
local bulb = d.Parent
|
||||
local s = bulb.Size
|
||||
if bulb.Material == Enum.Material.Neon and math.max(s.X, s.Y, s.Z) <= 2.5 then
|
||||
lamps[bulb] = { color = bulb.Color, lights = {} }
|
||||
end
|
||||
end
|
||||
end
|
||||
for bulb, l in pairs(lamps) do
|
||||
table.clear(l.lights)
|
||||
for _, c in ipairs(bulb:GetChildren()) do
|
||||
if c:IsA("Light") then
|
||||
table.insert(l.lights, c)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function updateLamps(nightness)
|
||||
if os.clock() - lampScanAt > 10 then
|
||||
lampScanAt = os.clock()
|
||||
scanLamps()
|
||||
lampsLit = nil -- новые лампы — применить ещё раз
|
||||
end
|
||||
local lit = nightness >= LAMP_ON_AT
|
||||
if lit == lampsLit then
|
||||
return
|
||||
end
|
||||
lampsLit = lit
|
||||
for bulb, l in pairs(lamps) do
|
||||
if bulb.Parent then
|
||||
bulb.Material = lit and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
-- погашенная лампа — тёплое матовое стекло чуть темнее горящей
|
||||
bulb.Color = lit and l.color or l.color:Lerp(Color3.fromRGB(150, 120, 90), 0.35)
|
||||
for _, light in ipairs(l.lights) do
|
||||
light.Enabled = lit
|
||||
end
|
||||
else
|
||||
lamps[bulb] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- главный цикл
|
||||
|
||||
-- часы двигаются каждый кадр (плавно), остальное проверяется раз в полсекунды
|
||||
@@ -304,6 +362,7 @@ task.spawn(function()
|
||||
local clock = clockNow()
|
||||
local nightness = Config.DayNight.enabled and Config.Nightness(clock) or 0
|
||||
local night = nightness >= 0.5
|
||||
updateLamps(nightness)
|
||||
local w = currentWeather()
|
||||
local _, placeId = currentPlace()
|
||||
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
-- ChestAnimation (LocalScript) -> StarterPlayer > StarterPlayerScripts
|
||||
-- Сундук ежедневной награды (модель с атрибутом DailyChest: Base, Lid, Coins, Lock) оживает у каждого игрока:
|
||||
-- подпрыгивает, на падении крышка откидывается, после удара о землю монеты подскакивают, крышка остаётся
|
||||
-- приоткрытой, потом плавно возвращается. На ударе — глухой стук, звон монет и облачко пыли.
|
||||
-- Анимация только на клиенте: сервер сундук не двигает.
|
||||
|
||||
local RunService = game:GetService("RunService")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
local Audio = require(script.Parent:WaitForChild("Audio"))
|
||||
|
||||
local HOP = 2.1 -- высота прыжка, studs
|
||||
local LID_FALL = 32 -- на сколько градусов откидывается крышка в падении
|
||||
local LID_REST = 14 -- приоткрыта после приземления
|
||||
local COIN_HOP = 0.55 -- подскок монет
|
||||
local PERIOD = 5 -- секунд на весь цикл (прыжок + пауза)
|
||||
local VIEW_DIST = 150 -- дальше камеры не анимируем
|
||||
|
||||
-- 0..1: прыжок вверх, падение, приземление, удержание, закрытие крышки
|
||||
local T_UP, T_DOWN, T_LAND, T_HOLD, T_CLOSE = 0.34, 0.3, 0.5, 2.3, 0.7
|
||||
local T_IMPACT = T_UP + T_DOWN -- момент удара о землю
|
||||
|
||||
local function easeOut(x) return 1 - (1 - x) ^ 2 end
|
||||
local function easeIn(x) return x * x end
|
||||
local function smooth(x) return x * x * (3 - 2 * x) end
|
||||
|
||||
local chest, rest, fx
|
||||
|
||||
-- звуки идут от самого сундука (слышно рядом), громкость — по настройке «Звуки»
|
||||
local function sound(name, parent)
|
||||
local def = Config.Sounds[name]
|
||||
local s = Instance.new("Sound")
|
||||
s.Name = name
|
||||
s.SoundId = def.id
|
||||
s.Volume = def.volume or 0.5
|
||||
s.RollOffMode = Enum.RollOffMode.InverseTapered
|
||||
s.RollOffMinDistance, s.RollOffMaxDistance = 10, 70
|
||||
s.SoundGroup = Audio.groups.sfx
|
||||
s.Parent = parent
|
||||
return s, def.pitch
|
||||
end
|
||||
|
||||
local rng = Random.new()
|
||||
local function play(entry)
|
||||
local s, pitch = entry[1], entry[2]
|
||||
if pitch then
|
||||
s.PlaybackSpeed = rng:NextNumber(pitch[1], pitch[2])
|
||||
end
|
||||
s:Play()
|
||||
end
|
||||
|
||||
-- пыль от удара: низкое облачко, разлетается в стороны и быстро оседает
|
||||
local function makeDust(base)
|
||||
local att = Instance.new("Attachment")
|
||||
att.Name = "ChestDust"
|
||||
att.Position = Vector3.new(0, -base.Size.Y / 2 + 0.15, 0)
|
||||
att.Parent = base
|
||||
local pe = Instance.new("ParticleEmitter")
|
||||
pe.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||
pe.Rate = 0
|
||||
pe.Color = ColorSequence.new(Color3.fromRGB(222, 202, 168), Color3.fromRGB(196, 176, 146))
|
||||
pe.LightInfluence = 0.8
|
||||
pe.Lifetime = NumberRange.new(0.6, 1.1)
|
||||
pe.Speed = NumberRange.new(7, 11)
|
||||
pe.Drag = 6
|
||||
pe.SpreadAngle = Vector2.new(86, 86) -- почти горизонтально во все стороны
|
||||
pe.Acceleration = Vector3.new(0, 1.2, 0)
|
||||
pe.Rotation = NumberRange.new(0, 360)
|
||||
pe.RotSpeed = NumberRange.new(-60, 60)
|
||||
pe.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.7), NumberSequenceKeypoint.new(0.4, 1.8), NumberSequenceKeypoint.new(1, 2.6) })
|
||||
pe.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.35), NumberSequenceKeypoint.new(0.6, 0.7), NumberSequenceKeypoint.new(1, 1) })
|
||||
pe.EmissionDirection = Enum.NormalId.Top
|
||||
pe.Parent = att
|
||||
return pe
|
||||
end
|
||||
|
||||
local function bind(model)
|
||||
local base, lid = model:FindFirstChild("Base"), model:FindFirstChild("Lid")
|
||||
if not (base and lid) then
|
||||
return
|
||||
end
|
||||
local pivot = model:GetPivot()
|
||||
local function rel(name)
|
||||
local p = model:FindFirstChild(name)
|
||||
return p and { part = p, cf = pivot:ToObjectSpace(p.CFrame) }
|
||||
end
|
||||
-- петли крышки — задняя верхняя кромка корпуса (замок спереди, по +Z модели)
|
||||
local hinge = pivot:ToObjectSpace(base.CFrame * CFrame.new(0, base.Size.Y / 2, -base.Size.Z / 2))
|
||||
chest = model
|
||||
fx = {
|
||||
hop = { sound("chestHop", base) },
|
||||
land = { sound("chestLand", base) },
|
||||
coins = { sound("coins", base) },
|
||||
dust = makeDust(base),
|
||||
}
|
||||
rest = {
|
||||
pivot = pivot, hinge = CFrame.new(hinge.Position),
|
||||
base = rel("Base"), lid = rel("Lid"), lock = rel("Lock"), coins = rel("Coins"),
|
||||
}
|
||||
end
|
||||
|
||||
local function findChest()
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
if not map then
|
||||
return
|
||||
end
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:IsA("Model") and d:GetAttribute("DailyChest") then
|
||||
bind(d)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- поза в момент t цикла: подъём корпуса, угол крышки (градусы), подскок монет
|
||||
local function pose(t)
|
||||
local h, lid, coin = 0, 0, 0
|
||||
if t < T_UP then
|
||||
h = HOP * easeOut(t / T_UP)
|
||||
elseif t < T_UP + T_DOWN then
|
||||
local u = (t - T_UP) / T_DOWN
|
||||
h = HOP * (1 - easeIn(u))
|
||||
lid = LID_FALL * easeOut(u) -- крышку подбрасывает воздухом
|
||||
else
|
||||
local t2 = t - T_UP - T_DOWN
|
||||
if t2 < T_LAND then
|
||||
local u = t2 / T_LAND
|
||||
coin = COIN_HOP * math.sin(math.pi * u) -- монеты подскакивают от удара
|
||||
-- крышка с лёгким «отскоком» оседает в приоткрытое положение
|
||||
lid = LID_REST + (LID_FALL - LID_REST) * (1 - smooth(u)) + 4 * math.sin(math.pi * u * 2) * (1 - u)
|
||||
h = 0.12 * math.sin(math.pi * math.min(1, u * 2)) -- маленький отскок корпуса
|
||||
elseif t2 < T_LAND + T_HOLD then
|
||||
lid = LID_REST
|
||||
elseif t2 < T_LAND + T_HOLD + T_CLOSE then
|
||||
lid = LID_REST * (1 - smooth((t2 - T_LAND - T_HOLD) / T_CLOSE))
|
||||
end
|
||||
end
|
||||
return h, lid, coin
|
||||
end
|
||||
|
||||
local function apply(h, lidDeg, coin)
|
||||
local r = rest
|
||||
local p = r.pivot * CFrame.new(0, h, 0)
|
||||
r.base.part.CFrame = p * r.base.cf
|
||||
-- крышка и замок поворачиваются вокруг петель (минус — передняя кромка идёт вверх)
|
||||
local open = r.hinge * CFrame.Angles(-math.rad(lidDeg), 0, 0) * r.hinge:Inverse()
|
||||
r.lid.part.CFrame = p * open * r.lid.cf
|
||||
if r.lock then
|
||||
r.lock.part.CFrame = p * open * r.lock.cf
|
||||
end
|
||||
if r.coins then
|
||||
r.coins.part.CFrame = p * CFrame.new(0, coin, 0) * r.coins.cf
|
||||
end
|
||||
end
|
||||
|
||||
-- прыгает только для тех, кому есть что забрать: DailyNextAt (ставит сервер) — когда откроется следующая
|
||||
-- награда, 0 — уже доступна. Забрал — сундук доигрывает текущий прыжок и замирает до следующего дня.
|
||||
local player = game:GetService("Players").LocalPlayer
|
||||
local function rewardReady()
|
||||
local nextAt = player:GetAttribute("DailyNextAt")
|
||||
return nextAt ~= nil and workspace:GetServerTimeNow() >= nextAt
|
||||
end
|
||||
|
||||
local scanAt = -math.huge
|
||||
local cycleT = nil -- время внутри текущего цикла; nil — сундук стоит
|
||||
local resting = false
|
||||
RunService.RenderStepped:Connect(function(dt)
|
||||
if not chest or not chest.Parent then
|
||||
chest = nil
|
||||
if os.clock() - scanAt > 3 then
|
||||
scanAt = os.clock()
|
||||
findChest()
|
||||
end
|
||||
return
|
||||
end
|
||||
local cam = workspace.CurrentCamera
|
||||
if cam and (cam.CFrame.Position - rest.pivot.Position).Magnitude > VIEW_DIST then
|
||||
return
|
||||
end
|
||||
if not cycleT then
|
||||
if not rewardReady() then
|
||||
if not resting then
|
||||
resting = true
|
||||
apply(0, 0, 0) -- стоит закрытый, как в редакторе
|
||||
end
|
||||
return
|
||||
end
|
||||
cycleT, resting = 0, false
|
||||
play(fx.hop)
|
||||
end
|
||||
local prev = cycleT
|
||||
cycleT += dt
|
||||
-- удар о землю
|
||||
if prev < T_IMPACT and cycleT >= T_IMPACT then
|
||||
play(fx.land)
|
||||
task.delay(0.08, play, fx.coins) -- монеты звенят чуть позже удара, когда подпрыгивают
|
||||
fx.dust:Emit(26)
|
||||
end
|
||||
if cycleT >= PERIOD then
|
||||
cycleT = nil -- цикл закончен; следующий начнётся, только если награда всё ещё доступна
|
||||
apply(0, 0, 0)
|
||||
return
|
||||
end
|
||||
apply(pose(cycleT))
|
||||
end)
|
||||
@@ -235,20 +235,12 @@ local SOFT_EDGES = NumberSequence.new({
|
||||
NumberSequenceKeypoint.new(0.82, 0.62), NumberSequenceKeypoint.new(1, 1),
|
||||
})
|
||||
-- жирный округлый шрифт с кириллицей (у FredokaOne кириллицы нет — Roblox подставляет тонкий шрифт)
|
||||
<<<<<<< HEAD
|
||||
local HINT_FONT = Theme.HINT_FACE
|
||||
-- плашка-дымка (Frame) с текстом внутри; градиент только на плашке, на текст он не действует.
|
||||
-- Цвет — тёмное дерево
|
||||
local function softPlate(props, textProps)
|
||||
local plate = new("Frame", props)
|
||||
plate.BackgroundColor3 = C.woodDark
|
||||
=======
|
||||
local HINT_FONT = Font.new("rbxasset://fonts/families/Nunito.json", Enum.FontWeight.Heavy)
|
||||
-- плашка-дымка (Frame) с текстом внутри; градиент только на плашке, на текст он не действует
|
||||
local function softPlate(props, textProps)
|
||||
local plate = new("Frame", props)
|
||||
plate.BackgroundColor3 = BLACK
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
plate.BackgroundTransparency = 0
|
||||
corner(30).Parent = plate
|
||||
new("UIGradient", { Transparency = SOFT_EDGES, Parent = plate })
|
||||
@@ -274,11 +266,7 @@ end
|
||||
-- уведомления — под подсказкой обучения, которая стоит в самом верху
|
||||
local toasts = new("Frame", {
|
||||
Size = UDim2.new(0, 900, 0, 200), AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 84),
|
||||
<<<<<<< HEAD
|
||||
BackgroundTransparency = 1, ZIndex = 30, Parent = screen,
|
||||
=======
|
||||
BackgroundTransparency = 1, Parent = gui,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
}, { new("UIListLayout", { Padding = UDim.new(0, 6), HorizontalAlignment = Enum.HorizontalAlignment.Center, SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
local toastOrder = 0
|
||||
local toastTimers = {}
|
||||
@@ -308,12 +296,8 @@ local function notify(msg, color)
|
||||
items[1]:Destroy()
|
||||
end
|
||||
local t, l = softPlate(
|
||||
{ Size = UDim2.new(0, 0, 0, 54), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = toastOrder, Parent = toasts },
|
||||
<<<<<<< HEAD
|
||||
{ TextSize = 30, TextColor3 = color or C.text, Text = msg }
|
||||
=======
|
||||
{ TextSize = 30, TextColor3 = color or WHITE, Text = msg }
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
{ Size = UDim2.new(0, 0, 0, 44), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = toastOrder, Parent = toasts },
|
||||
{ TextSize = 24, TextColor3 = color or C.text, Text = msg }
|
||||
)
|
||||
popIn(t)
|
||||
t:SetAttribute("Msg", msg)
|
||||
@@ -346,6 +330,17 @@ local catchInfo = text({ Size = UDim2.new(1, -160, 0, 20), Position = UDim2.from
|
||||
local catchValue = text({ Size = UDim2.new(1, -160, 0, 26), Position = UDim2.fromOffset(152, 90), Font = TITLE, TextSize = 21, TextColor3 = C.gold, Text = "", Parent = catchCard })
|
||||
local catchToken = 0
|
||||
|
||||
-- уведомления и карточка улова — в одной колонке сверху: пока карточка видна, уведомления уходят под неё
|
||||
H.toastBaseY = 84
|
||||
function H.placeToasts(cardShown)
|
||||
local y = H.toastBaseY
|
||||
if cardShown then
|
||||
local sc = catchCard:FindFirstChildOfClass("UIScale")
|
||||
y = 120 + catchCard.Size.Y.Offset * (sc and sc.Scale or 1) + 10
|
||||
end
|
||||
TweenService:Create(toasts, TweenInfo.new(0.3, Enum.EasingStyle.Quad), { Position = UDim2.new(0.5, 0, 0, y) }):Play()
|
||||
end
|
||||
|
||||
local function showCatch(fish, extra)
|
||||
catchToken += 1
|
||||
local my = catchToken
|
||||
@@ -361,18 +356,16 @@ local function showCatch(fish, extra)
|
||||
catchName.TextColor3 = r.color
|
||||
catchInfo.Text = ("<font color=\"%s\">%s</font>%s · %.2f кг"):format(
|
||||
hex(r.color), r.name, mut and (" · <font color=\"" .. hex(mut.color) .. "\">" .. mut.name .. " x" .. mut.mult .. "</font>") or "", fish.weight)
|
||||
<<<<<<< HEAD
|
||||
catchValue.Text = ("⚪ %s ⭐ +%d XP%s"):format(fmt(fish.value), fish.xp * ((extra and extra.new) and 2 or 1),
|
||||
=======
|
||||
catchValue.Text = ("💰 %s ⭐ +%d XP%s"):format(fmt(fish.value), fish.xp * ((extra and extra.new) and 2 or 1),
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
(extra and extra.combo and extra.combo > 1.001) and (" 🔥 x%.1f"):format(extra.combo) or "")
|
||||
catchCard.Visible = true
|
||||
H.placeToasts(true)
|
||||
TweenService:Create(catchCard, TweenInfo.new(0.45, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Position = UDim2.new(0.5, 0, 0, 120) }):Play()
|
||||
task.delay(3.4, function()
|
||||
if my == catchToken then
|
||||
local tw = TweenService:Create(catchCard, TweenInfo.new(0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.In), { Position = UDim2.new(0.5, 0, 0, -220) })
|
||||
tw:Play()
|
||||
H.placeToasts(false)
|
||||
tw.Completed:Wait()
|
||||
if my == catchToken then
|
||||
catchCard.Visible = false
|
||||
@@ -397,11 +390,7 @@ end
|
||||
|
||||
-- вверху, на месте подсказки обучения (она во время рыбалки скрыта)
|
||||
local statusLabel = softPlate(
|
||||
<<<<<<< HEAD
|
||||
{ Size = UDim2.fromOffset(0, 64), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 12), Visible = false, Parent = screen },
|
||||
=======
|
||||
{ Size = UDim2.fromOffset(0, 64), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 12), Visible = false, Parent = gui },
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
{ TextSize = 36, Text = "🎣 Ждём клёв…" }
|
||||
)
|
||||
wobble(statusLabel, 1.2, 1.4)
|
||||
@@ -994,11 +983,7 @@ questWin.render = function(tab)
|
||||
end
|
||||
text({
|
||||
Size = UDim2.new(1, -4, 0, 30), LayoutOrder = 0, Font = TITLE, TextSize = 22, RichText = true,
|
||||
<<<<<<< HEAD
|
||||
Text = ("%s <font color=\"#C0AC88\" size=\"15\">круг %d · награда сразу, следующее задание — тоже</font>"):format(chain.name, chain.round), Parent = questList,
|
||||
=======
|
||||
Text = ("%s <font color=\"#AAB4CD\" size=\"15\">круг %d · награда сразу, следующее задание — тоже</font>"):format(chain.name, chain.round), Parent = questList,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
})
|
||||
for i, st in ipairs(chain.steps) do
|
||||
local done, cur = i < chain.step, i == chain.step
|
||||
@@ -1011,11 +996,7 @@ questWin.render = function(tab)
|
||||
})
|
||||
text({
|
||||
Size = UDim2.fromOffset(180, 28), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -14, 0, cur and 8 or 14), Font = TITLE, TextSize = 17,
|
||||
<<<<<<< HEAD
|
||||
TextXAlignment = Enum.TextXAlignment.Right, TextColor3 = done and C.muted or C.gold, Text = ("+%s ⚪ +%s XP"):format(fmt(st.coins), fmt(st.xp)), Parent = row,
|
||||
=======
|
||||
TextXAlignment = Enum.TextXAlignment.Right, TextColor3 = done and C.muted or C.gold, Text = ("+%s 💰 +%s XP"):format(fmt(st.coins), fmt(st.xp)), Parent = row,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
})
|
||||
if cur then
|
||||
progressBar(row, UDim2.fromOffset(16, 44), UDim2.new(1, -110, 0, 16), chain.progress / st.goal, C.gold)
|
||||
@@ -1028,11 +1009,7 @@ questWin.render = function(tab)
|
||||
{ corner(14), stroke(C.purple, 2, 0.2), gradient(Color3.fromRGB(70, 40, 100), C.panel, 90) })
|
||||
text({
|
||||
Size = UDim2.new(1, -32, 1, 0), Position = UDim2.fromOffset(16, 0), Font = TITLE, TextSize = 18, RichText = true,
|
||||
<<<<<<< HEAD
|
||||
Text = ("🎁 За всю цепочку: <font color=\"#FFD45A\">+%s ⚪ +%s XP</font>%s"):format(fmt(b.coins), fmt(b.xp), b.potion and (" + " .. b.potion) or ""), Parent = row,
|
||||
=======
|
||||
Text = ("🎁 За всю цепочку: <font color=\"#FFD45A\">+%s 💰 +%s XP</font>%s"):format(fmt(b.coins), fmt(b.xp), b.potion and (" + " .. b.potion) or ""), Parent = row,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
})
|
||||
elseif tab == "daily" then
|
||||
clear(dailyPage)
|
||||
@@ -1091,11 +1068,8 @@ robuxWin.render = function(tab)
|
||||
notify("⚙ Товар не настроен", Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
if tab == "passes" then
|
||||
MarketplaceService:PromptGamePassPurchase(player, it.id)
|
||||
else
|
||||
MarketplaceService:PromptProductPurchase(player, it.id)
|
||||
end
|
||||
-- и наборы, и пропуска — Developer Products; пропуск сервер запоминает навсегда
|
||||
MarketplaceService:PromptProductPurchase(player, it.id)
|
||||
end,
|
||||
})
|
||||
end
|
||||
@@ -1185,7 +1159,8 @@ do
|
||||
side.Position = compact and UDim2.fromOffset(8, 172) or UDim2.fromOffset(12, 216)
|
||||
side.Size = compact and UDim2.fromOffset(170, 240) or UDim2.fromOffset(70, 480)
|
||||
toasts.Size = compact and UDim2.fromOffset(640, 200) or UDim2.fromOffset(900, 200)
|
||||
toasts.Position = compact and UDim2.new(0.5, 0, 0, 66) or UDim2.new(0.5, 0, 0, 84)
|
||||
H.toastBaseY = compact and 66 or 84
|
||||
toasts.Position = UDim2.new(0.5, 0, 0, H.toastBaseY)
|
||||
scaleOf(toasts).Scale = compact and 0.75 or 1
|
||||
scaleOf(catchCard).Scale = compact and 0.8 or 1
|
||||
scaleOf(mgFrame).Scale = compact and 0.85 or 1
|
||||
@@ -1317,7 +1292,7 @@ end
|
||||
---------------------------------------------------------------- заброс: зарядка, шкала силы, наклон удочки
|
||||
-- держишь ЛКМ — сила растёт, удочка уходит назад; отпустил — бросок на дальность по силе
|
||||
|
||||
local REST_ANGLE, BACK_ANGLE = 30, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
||||
local REST_ANGLE, BACK_ANGLE = 42, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
||||
local function gripCF(angle)
|
||||
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
|
||||
end
|
||||
@@ -1340,11 +1315,7 @@ end
|
||||
local GAUGE_R, GAUGE_DEG, GAUGE_N = 190, 110, 32
|
||||
local gauge = new("Frame", {
|
||||
Size = UDim2.fromOffset(150, 280), AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0.57, 0, 0.48, 0),
|
||||
<<<<<<< HEAD
|
||||
BackgroundTransparency = 1, Visible = false, Parent = screen,
|
||||
=======
|
||||
BackgroundTransparency = 1, Visible = false, Parent = gui,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
})
|
||||
local GAUGE_C = Vector2.new(110 - GAUGE_R, 140) -- центр окружности левее рамки: дуга выгнута вправо
|
||||
local function arcPoint(v, r)
|
||||
@@ -1627,6 +1598,24 @@ local function onActivate()
|
||||
end
|
||||
end
|
||||
|
||||
-- клик пришёлся на видимый элемент интерфейса (кнопка, панель, картинка), а не в мир
|
||||
local GuiService = game:GetService("GuiService")
|
||||
local function pointerOverGui()
|
||||
local pos = UserInputService:GetMouseLocation() - GuiService:GetGuiInset()
|
||||
for _, g in ipairs(player.PlayerGui:GetGuiObjectsAtPosition(pos.X, pos.Y)) do
|
||||
if g.Visible and (g:IsA("GuiButton") or g:IsA("TextBox") or g.BackgroundTransparency < 0.95
|
||||
or (g:IsA("ImageLabel") and g.ImageTransparency < 0.95)) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- пока открыто любое окно (сумка, магазин, настройки, гильдия...), клики по удочке не работают
|
||||
local function menuOpen()
|
||||
return openWindow ~= nil and openWindow.isOpen()
|
||||
end
|
||||
|
||||
local hooked = setmetatable({}, { __mode = "k" })
|
||||
local function hookTool(tool)
|
||||
if hooked[tool] or not tool:IsA("Tool") or not tool:GetAttribute("IsRod") then
|
||||
@@ -1634,7 +1623,13 @@ local function hookTool(tool)
|
||||
end
|
||||
hooked[tool] = true
|
||||
tool.Activated:Connect(function()
|
||||
if menuOpen() then
|
||||
return
|
||||
end
|
||||
if state == "idle" then
|
||||
if pointerOverGui() then
|
||||
return -- нажали кнопку или панель интерфейса — это не заброс
|
||||
end
|
||||
startCharge(tool)
|
||||
else
|
||||
onActivate()
|
||||
@@ -1762,7 +1757,6 @@ local function setLook(obj, goal, instant)
|
||||
end
|
||||
end
|
||||
|
||||
<<<<<<< HEAD
|
||||
-- погода сгущает дымку поверх настроек локации (туман — сильно, дождь и гроза — слегка)
|
||||
local WEATHER_ATMO = {
|
||||
Fog = { Density = 0.22, Haze = 1.5 },
|
||||
@@ -1774,8 +1768,6 @@ local function weatherAtmo(prop)
|
||||
return (add and add[prop]) or 0
|
||||
end
|
||||
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local function applyLook(world, instant)
|
||||
-- исходные значения запоминаем до первой правки; эффект мог ещё не прийти с сервера, тогда в следующий раз
|
||||
for _, w in ipairs(lookSources) do
|
||||
@@ -1799,12 +1791,9 @@ local function applyLook(world, instant)
|
||||
for prop, def in pairs(defaults) do
|
||||
local v = look[section] and look[section][prop]
|
||||
if v == nil then v = def end
|
||||
<<<<<<< HEAD
|
||||
if section == "atmosphere" and typeof(v) == "number" then
|
||||
v += weatherAtmo(prop)
|
||||
end
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
-- плавно меняются только числа и цвета; флаги и режимы (EnumItem) ставим сразу
|
||||
local kind = typeof(v)
|
||||
if kind == "number" or kind == "Color3" then goal[prop] = v else obj[prop] = v end
|
||||
@@ -1821,15 +1810,10 @@ local function applyAmbience(world, instant)
|
||||
end
|
||||
table.clear(lookTweens)
|
||||
world = world or Config.Lobby
|
||||
<<<<<<< HEAD
|
||||
-- при смене суток часы двигает Ambience; иначе у каждой локации своё время
|
||||
if not Config.DayNight.enabled then
|
||||
setLook(Lighting, { ClockTime = (world and world.clock) or 14.5 }, instant)
|
||||
end
|
||||
=======
|
||||
local clock = (world and world.clock) or 14.5
|
||||
setLook(Lighting, { ClockTime = clock }, instant)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local cc = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||
if cc then
|
||||
setLook(cc, { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }, instant)
|
||||
@@ -1933,7 +1917,6 @@ local function enterWorld(w, instant)
|
||||
end
|
||||
end
|
||||
|
||||
<<<<<<< HEAD
|
||||
-- погода сменилась: плавно пересчитываем дымку текущей локации
|
||||
workspace:GetAttributeChangedSignal("Weather"):Connect(function()
|
||||
if lastWorldId ~= "none" and not loadingVisible() then
|
||||
@@ -1953,8 +1936,6 @@ do
|
||||
end)
|
||||
end
|
||||
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
-- первое появление: ждём персонажа, ставим свет его локации сразу и отпускаем экран загрузки
|
||||
task.spawn(function()
|
||||
local char = player.Character or player.CharacterAdded:Wait()
|
||||
@@ -2032,7 +2013,6 @@ local guideStep = 0 -- шаг, отправленный на сервер (ат
|
||||
|
||||
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
|
||||
local guideHint, guideHintText = softPlate(
|
||||
<<<<<<< HEAD
|
||||
{ Size = UDim2.fromOffset(0, 70), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 10), Visible = false, Parent = screen },
|
||||
{ TextSize = 42, Text = "" }
|
||||
)
|
||||
@@ -2040,12 +2020,6 @@ wobble(guideHint, 1.2, 1.6)
|
||||
Theme.onLayout(function(compact)
|
||||
guideHintText.TextSize = compact and 30 or 42
|
||||
end)
|
||||
=======
|
||||
{ Size = UDim2.fromOffset(0, 70), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 10), Visible = false, Parent = gui },
|
||||
{ TextSize = 42, Text = "" }
|
||||
)
|
||||
wobble(guideHint, 1.2, 1.6)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local lastHint = nil
|
||||
|
||||
local guideFolder = new("Folder", { Name = "TutorialGuide", Parent = workspace })
|
||||
@@ -2246,11 +2220,7 @@ local function guideRoute(step, pos, world)
|
||||
elseif step == 2 and inW1 then
|
||||
return { guideMarker("GuideFishSpot") }, "🎣 Зажми ЛКМ у воды", "Pier"
|
||||
elseif step == 3 and inW1 then
|
||||
<<<<<<< HEAD
|
||||
return { sellTargetW1() }, "⚪ Продай рыбу", "Sell" -- лавка у самого причала, идём напрямую
|
||||
=======
|
||||
return { sellTargetW1() }, "💰 Продай рыбу", "Sell" -- лавка у самого причала, идём напрямую
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
return nil
|
||||
end
|
||||
@@ -2415,19 +2385,11 @@ local FIRE = Color3.fromRGB(255, 150, 60)
|
||||
|
||||
-- серия улова — справа от HUD; полоска показывает, сколько осталось до того, как серия сгорит
|
||||
local comboBox = new("Frame", {
|
||||
<<<<<<< HEAD
|
||||
Size = UDim2.fromOffset(140, 66), Position = UDim2.fromOffset(310, 10), BackgroundColor3 = WHITE, Visible = false, Parent = screen,
|
||||
}, { corner(14), stroke(FIRE, 2, 0.1), gradient(Color3.fromRGB(110, 50, 20), C.bg, 90) })
|
||||
local comboMultText = text({ Size = UDim2.new(1, 0, 0, 34), Position = UDim2.fromOffset(0, 3), Font = TITLE, TextSize = 28, TextXAlignment = CENTER, TextColor3 = Color3.fromRGB(255, 195, 95), TextStrokeTransparency = 0.5, Text = "", Parent = comboBox })
|
||||
local comboSub = text({ Size = UDim2.new(1, 0, 0, 16), Position = UDim2.fromOffset(0, 36), Font = BODY2, TextSize = 12, TextXAlignment = CENTER, TextColor3 = C.muted, Text = "", Parent = comboBox })
|
||||
local comboBack = new("Frame", { Size = UDim2.new(1, -20, 0, 5), Position = UDim2.new(0, 10, 1, -10), BackgroundColor3 = C.dark, Parent = comboBox }, { corner(3) })
|
||||
=======
|
||||
Size = UDim2.fromOffset(140, 66), Position = UDim2.fromOffset(310, 10), BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
}, { corner(14), stroke(FIRE, 2, 0.1), gradient(Color3.fromRGB(110, 50, 20), C.bg, 90) })
|
||||
local comboMultText = text({ Size = UDim2.new(1, 0, 0, 34), Position = UDim2.fromOffset(0, 3), Font = TITLE, TextSize = 28, TextXAlignment = CENTER, TextColor3 = Color3.fromRGB(255, 195, 95), TextStrokeTransparency = 0.5, Text = "", Parent = comboBox })
|
||||
local comboSub = text({ Size = UDim2.new(1, 0, 0, 16), Position = UDim2.fromOffset(0, 36), Font = BODY2, TextSize = 12, TextXAlignment = CENTER, TextColor3 = C.muted, Text = "", Parent = comboBox })
|
||||
local comboBack = new("Frame", { Size = UDim2.new(1, -20, 0, 5), Position = UDim2.new(0, 10, 1, -10), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = comboBox }, { corner(3) })
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local comboFill = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = FIRE, BorderSizePixel = 0, Parent = comboBack }, { corner(3) })
|
||||
|
||||
local function refreshCombo(pop)
|
||||
@@ -2450,7 +2412,6 @@ refreshCombo(false)
|
||||
-- правая колонка: босс и цели
|
||||
local rightCol = new("Frame", {
|
||||
Size = UDim2.fromOffset(300, 0), AutomaticSize = Enum.AutomaticSize.Y, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -12, 0.5, 10),
|
||||
<<<<<<< HEAD
|
||||
BackgroundTransparency = 1, Parent = screen,
|
||||
}, { new("UIListLayout", { Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
|
||||
@@ -2463,20 +2424,11 @@ Theme.onLayout(function(compact)
|
||||
comboBox.Position = compact and UDim2.fromOffset(254, 6) or UDim2.fromOffset(310, 10)
|
||||
end)
|
||||
|
||||
=======
|
||||
BackgroundTransparency = 1, Parent = gui,
|
||||
}, { new("UIListLayout", { Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local bossBox = new("Frame", { Size = UDim2.fromOffset(300, 78), BackgroundColor3 = WHITE, Visible = false, LayoutOrder = 1, Parent = rightCol },
|
||||
{ corner(14), stroke(C.red, 2.5, 0.05), gradient(Color3.fromRGB(110, 30, 40), C.bg, 90) })
|
||||
local bossTitle = text({ Size = UDim2.new(1, -80, 0, 24), Position = UDim2.fromOffset(12, 5), Font = TITLE, TextSize = 18, TextColor3 = Color3.fromRGB(255, 205, 120), TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = bossBox })
|
||||
local bossTime = text({ Size = UDim2.fromOffset(60, 24), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 5), Font = TITLE, TextSize = 17, TextXAlignment = RIGHT, Text = "", Parent = bossBox })
|
||||
<<<<<<< HEAD
|
||||
local bossBack = new("Frame", { Size = UDim2.new(1, -24, 0, 18), Position = UDim2.fromOffset(12, 32), BackgroundColor3 = C.dark, Parent = bossBox }, { corner(9) })
|
||||
=======
|
||||
local bossBack = new("Frame", { Size = UDim2.new(1, -24, 0, 18), Position = UDim2.fromOffset(12, 32), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = bossBox }, { corner(9) })
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local bossFill = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = WHITE, Parent = bossBack }, { corner(9), gradient(Color3.fromRGB(255, 120, 90), Color3.fromRGB(190, 30, 50), 0) })
|
||||
local bossHpText = text({ Size = UDim2.fromScale(1, 1), TextSize = 12, TextXAlignment = CENTER, ZIndex = 2, TextStrokeTransparency = 0.5, Text = "", Parent = bossBack })
|
||||
local bossHint = text({ Size = UDim2.new(1, -24, 0, 18), Position = UDim2.fromOffset(12, 54), Font = BODY2, TextSize = 12, TextColor3 = C.muted, Text = "", Parent = bossBox })
|
||||
@@ -2491,11 +2443,7 @@ text({ Size = UDim2.new(1, 0, 0, 20), LayoutOrder = 0, Font = TITLE, TextSize =
|
||||
local function trackerLine(order, onClick)
|
||||
local root = new("TextButton", { Size = UDim2.new(1, 0, 0, 38), BackgroundTransparency = 1, AutoButtonColor = false, Text = "", LayoutOrder = order, Parent = tracker })
|
||||
local label = text({ Size = UDim2.new(1, 0, 0, 22), Font = BODY, TextSize = 14, RichText = true, TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = root })
|
||||
<<<<<<< HEAD
|
||||
local back = new("Frame", { Size = UDim2.new(1, 0, 0, 8), Position = UDim2.fromOffset(0, 26), BackgroundColor3 = C.dark, Parent = root }, { corner(4) })
|
||||
=======
|
||||
local back = new("Frame", { Size = UDim2.new(1, 0, 0, 8), Position = UDim2.fromOffset(0, 26), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = root }, { corner(4) })
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local fill = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = C.gold, BorderSizePixel = 0, Parent = back }, { corner(4) })
|
||||
if onClick then
|
||||
root.MouseButton1Click:Connect(onClick)
|
||||
@@ -2550,11 +2498,7 @@ local function buyGoal()
|
||||
elseif coins >= r.price then
|
||||
return ("🎣 <b>%s</b> — можно купить!"):format(r.name), 1, C.green
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
return ("🎣 До «%s»: ещё <b>%s</b> ⚪"):format(r.name, fmt(r.price - coins)), coins / r.price, C.gold
|
||||
=======
|
||||
return ("🎣 До «%s»: ещё <b>%s</b> 💰"):format(r.name, fmt(r.price - coins)), coins / r.price, C.gold
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
end
|
||||
local rod = Config.Find(Config.Rods, player:GetAttribute("Rod") or "Basic")
|
||||
@@ -2564,11 +2508,7 @@ local function buyGoal()
|
||||
if coins >= cost then
|
||||
return ("✨ Улучшение до +%d — можно купить!"):format(rl + 1), 1, C.green
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
return ("✨ До улучшения +%d: ещё <b>%s</b> ⚪"):format(rl + 1, fmt(cost - coins)), coins / cost, C.gold
|
||||
=======
|
||||
return ("✨ До улучшения +%d: ещё <b>%s</b> 💰"):format(rl + 1, fmt(cost - coins)), coins / cost, C.gold
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
return nil
|
||||
end
|
||||
@@ -2712,11 +2652,7 @@ end)
|
||||
-- у скупщика после продажи: предложение купить то, на что уже хватает
|
||||
local offerCard = new("Frame", {
|
||||
Size = UDim2.fromOffset(440, 96), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -110),
|
||||
<<<<<<< HEAD
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = screen,
|
||||
=======
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
}, { corner(16), stroke(C.green, 2.5, 0.05), gradient(Color3.fromRGB(30, 85, 55), C.bg, 90) })
|
||||
local offerIcon = text({ Size = UDim2.fromOffset(70, 70), Position = UDim2.fromOffset(12, 13), TextSize = 46, TextXAlignment = CENTER, Text = "", Parent = offerCard })
|
||||
local offerTitle = text({ Size = UDim2.new(1, -250, 0, 26), Position = UDim2.fromOffset(90, 12), Font = TITLE, TextSize = 19, TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = offerCard })
|
||||
@@ -2729,19 +2665,11 @@ end
|
||||
local offerBuy = btn({ Size = UDim2.fromOffset(146, 52), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -14, 0.5, 0), BackgroundColor3 = C.green, TextSize = 18, Text = "", Parent = offerCard }, function()
|
||||
if offerItem then
|
||||
remote:FireServer("Buy", offerItem.kind, offerItem.id)
|
||||
<<<<<<< HEAD
|
||||
Audio.play("coins")
|
||||
end
|
||||
hideOffer()
|
||||
end)
|
||||
btn({ Size = UDim2.fromOffset(26, 26), Position = UDim2.new(1, -18, 0, -8), BackgroundColor3 = C.red, Text = "×", TextSize = 22, Parent = offerCard }, hideOffer)
|
||||
=======
|
||||
playUiSound(DING, 0.5)
|
||||
end
|
||||
hideOffer()
|
||||
end)
|
||||
btn({ Size = UDim2.fromOffset(26, 26), Position = UDim2.new(1, -18, 0, -8), BackgroundColor3 = C.red, Text = "✕", TextSize = 14, Parent = offerCard }, hideOffer)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
|
||||
bestOffer = function(bagWasFull)
|
||||
local coins, lvl = player:GetAttribute("Coins") or 0, player:GetAttribute("Level") or 1
|
||||
@@ -2793,11 +2721,7 @@ showOffer = function(o)
|
||||
offerIcon.Text = o.icon
|
||||
offerTitle.Text = o.title
|
||||
offerDesc.Text = o.desc
|
||||
<<<<<<< HEAD
|
||||
offerBuy.Text = ("Купить · %s ⚪"):format(fmt(o.price))
|
||||
=======
|
||||
offerBuy.Text = ("Купить · %s 💰"):format(fmt(o.price))
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
offerCard.Visible = true
|
||||
popIn(offerCard, 0.6)
|
||||
task.delay(9, function()
|
||||
@@ -2826,12 +2750,9 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
setState("waiting")
|
||||
startCastCam(a, b)
|
||||
elseif action == "CastFail" or action == "Cancel" or action == "Escaped" then
|
||||
<<<<<<< HEAD
|
||||
if action == "Escaped" then
|
||||
Audio.play("escape")
|
||||
end
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
if action == "CastFail" and castTool and castTool.Parent then
|
||||
castTool.Grip = gripCF(REST_ANGLE) -- сервер удочку не трогал, а у нас она в замахе
|
||||
end
|
||||
@@ -2860,20 +2781,12 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
Audio.play("sparkle")
|
||||
end
|
||||
elseif action == "Sold" then
|
||||
<<<<<<< HEAD
|
||||
Audio.play("coins")
|
||||
if tutorialStep() == 3 then
|
||||
advanceTutorial(Config.TutorialDone)
|
||||
end
|
||||
floatText("+" .. fmt(a) .. " ⚪", C.gold)
|
||||
notify(("⚪ +%s"):format(fmt(a)), Color3.fromRGB(120, 255, 140))
|
||||
=======
|
||||
if tutorialStep() == 3 then
|
||||
advanceTutorial(Config.TutorialDone)
|
||||
end
|
||||
floatText("+" .. fmt(a) .. " 💰", C.gold)
|
||||
notify(("💰 +%s"):format(fmt(a)), Color3.fromRGB(120, 255, 140))
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
-- монеты приходят атрибутом чуть позже события, поэтому предложение — с задержкой
|
||||
local wasFull = offerState.bagWasFull
|
||||
offerState.bagWasFull = false
|
||||
@@ -2902,30 +2815,17 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
refreshDots()
|
||||
refreshTracker()
|
||||
elseif action == "QuestDone" then
|
||||
<<<<<<< HEAD
|
||||
notify(("✅ %s +%s ⚪ +%s XP"):format(questText(a, b), fmt(c), fmt(d or 0)), Color3.fromRGB(120, 255, 140))
|
||||
Audio.play("quest")
|
||||
elseif action == "ChainDone" then
|
||||
floatText("🏆 Цепочка пройдена!", C.gold)
|
||||
notify(("🎁 %s: +%s ⚪ +%s XP%s"):format(a, fmt(b), fmt(c), d and (" + " .. d) or ""), C.gold)
|
||||
Audio.play("fanfare")
|
||||
=======
|
||||
notify(("✅ %s +%s 💰 +%s XP"):format(questText(a, b), fmt(c), fmt(d or 0)), Color3.fromRGB(120, 255, 140))
|
||||
playUiSound(DING, 0.6)
|
||||
elseif action == "ChainDone" then
|
||||
floatText("🏆 Цепочка пройдена!", C.gold)
|
||||
notify(("🎁 %s: +%s 💰 +%s XP%s"):format(a, fmt(b), fmt(c), d and (" + " .. d) or ""), C.gold)
|
||||
playUiSound(DING, 0.8)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
elseif action == "ComboLost" then
|
||||
notify(("💔 Серия из %d прервана"):format(a), Color3.fromRGB(255, 130, 110))
|
||||
elseif action == "BossStart" then
|
||||
notify(("👑 %s в мире «%s»! Ловите всем сервером"):format(a, b), C.gold)
|
||||
<<<<<<< HEAD
|
||||
Audio.play("quest")
|
||||
=======
|
||||
playUiSound(DING, 0.8)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
elseif action == "BossHit" then
|
||||
floatText(("⚔ -%d боссу"):format(a), Color3.fromRGB(255, 130, 100))
|
||||
elseif action == "BossDone" then
|
||||
@@ -2935,11 +2835,7 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
notify(("🌊 %s ушёл на глубину…"):format(b), C.muted)
|
||||
end
|
||||
elseif action == "BossReward" then
|
||||
<<<<<<< HEAD
|
||||
notify(("🎁 За босса: +%s ⚪ +%s XP%s"):format(fmt(a), fmt(b), c and (" + " .. c) or ""), Color3.fromRGB(120, 255, 140))
|
||||
=======
|
||||
notify(("🎁 За босса: +%s 💰 +%s XP%s"):format(fmt(a), fmt(b), c and (" + " .. c) or ""), Color3.fromRGB(120, 255, 140))
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
elseif action == "OpenShop" then
|
||||
shopWin.open("rods")
|
||||
elseif action == "OpenQuests" then
|
||||
|
||||
@@ -0,0 +1,479 @@
|
||||
-- LobbyLife (LocalScript) -> StarterPlayer > StarterPlayerScripts
|
||||
-- Живое лобби у этого игрока (всё — на клиенте, сервер не нагружается):
|
||||
-- NPC поворачивают голову к игроку и машут, когда он подходит;
|
||||
-- кот ходит за игроком по площади, а один — ложится у фонтана;
|
||||
-- чайки над скалами, бабочки у цветов, ночью — светлячки у фонарей и клумб;
|
||||
-- деревья, трава, цветы и кусты колышутся от ветра (только рядом с камерой), с деревьев падают листья.
|
||||
-- Общие для всех вещи (idle NPC, гуляющие жители) — в LobbyLife.server.lua.
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local RunService = game:GetService("RunService")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
local V = Vector3.new
|
||||
local rng = Random.new()
|
||||
local LOBBY = V(0, 1, 0) -- центр лобби, пол на высоте 1
|
||||
local LOBBY_VIEW = 170 -- дальше камеры от центра лобби — ничего не анимируем
|
||||
local WAVE_ANIM = "rbxassetid://507770239"
|
||||
local LEAF_TEXTURE = "rbxassetid://138319345672122"
|
||||
|
||||
local map = workspace:WaitForChild("FishingMap")
|
||||
local fx = Instance.new("Folder")
|
||||
fx.Name = "LobbyLifeFX"
|
||||
fx.Parent = workspace
|
||||
|
||||
local function part(props)
|
||||
local p = Instance.new(props.Class or "Part")
|
||||
p.Anchored = true
|
||||
p.CanCollide, p.CanQuery, p.CanTouch, p.CastShadow = false, false, false, false
|
||||
p.Material = Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
for k, v in pairs(props) do
|
||||
if k ~= "Class" then
|
||||
p[k] = v
|
||||
end
|
||||
end
|
||||
p.Parent = props.Parent or fx
|
||||
return p
|
||||
end
|
||||
|
||||
local function camPos()
|
||||
local cam = workspace.CurrentCamera
|
||||
return cam and cam.CFrame.Position or LOBBY
|
||||
end
|
||||
local function myRoot()
|
||||
return player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- NPC: взгляд и приветствие
|
||||
|
||||
local npcs = {}
|
||||
local function scanNpcs()
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:IsA("Model") and d:GetAttribute("Npc") and not npcs[d] then
|
||||
local head = d:FindFirstChild("Head")
|
||||
local neck = head and head:FindFirstChild("Neck")
|
||||
local torso = d:FindFirstChild("UpperTorso")
|
||||
if neck and neck:IsA("Motor6D") and torso then
|
||||
npcs[d] = { neck = neck, c0 = neck.C0, torso = torso, head = head, yaw = 0, pitch = 0, waveAt = -math.huge }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function wave(rig, info)
|
||||
local hum = rig:FindFirstChildOfClass("Humanoid")
|
||||
local animator = hum and hum:FindFirstChildOfClass("Animator")
|
||||
if not animator then
|
||||
return
|
||||
end
|
||||
if not info.waveTrack then
|
||||
local a = Instance.new("Animation")
|
||||
a.AnimationId = WAVE_ANIM
|
||||
local ok, track = pcall(function() return animator:LoadAnimation(a) end)
|
||||
info.waveTrack = ok and track or false
|
||||
end
|
||||
if info.waveTrack then
|
||||
info.waveTrack.Priority = Enum.AnimationPriority.Action
|
||||
info.waveTrack:Play(0.2)
|
||||
end
|
||||
end
|
||||
|
||||
local function updateNpcs(dt)
|
||||
local root = myRoot()
|
||||
local myHead = player.Character and player.Character:FindFirstChild("Head")
|
||||
local now = os.clock()
|
||||
for rig, n in pairs(npcs) do
|
||||
if not rig.Parent then
|
||||
npcs[rig] = nil
|
||||
else
|
||||
local wantYaw, wantPitch = 0, 0
|
||||
local dist = root and (root.Position - n.head.Position).Magnitude or math.huge
|
||||
if myHead and dist < 24 then
|
||||
-- куда смотреть: в системе координат торса, лицо — по -Z
|
||||
local rel = n.torso.CFrame:PointToObjectSpace(myHead.Position)
|
||||
local headRel = n.torso.CFrame:PointToObjectSpace(n.head.Position)
|
||||
local d = rel - headRel
|
||||
wantYaw = math.clamp(math.atan2(-d.X, -d.Z), math.rad(-70), math.rad(70))
|
||||
wantPitch = math.clamp(math.atan2(d.Y, math.sqrt(d.X * d.X + d.Z * d.Z)), math.rad(-20), math.rad(30))
|
||||
-- голову к игроку, только если он перед NPC, а не за спиной
|
||||
if math.abs(math.atan2(-d.X, -d.Z)) > math.rad(110) then
|
||||
wantYaw, wantPitch = 0, 0
|
||||
end
|
||||
-- подошёл близко — помахать (не чаще раза в 25 секунд)
|
||||
if dist < 11 and now - n.waveAt > 25 then
|
||||
n.waveAt = now
|
||||
wave(rig, n)
|
||||
end
|
||||
end
|
||||
local k = math.min(1, dt * 4)
|
||||
n.yaw += (wantYaw - n.yaw) * k
|
||||
n.pitch += (wantPitch - n.pitch) * k
|
||||
n.neck.C0 = n.c0 * CFrame.Angles(0, n.yaw, 0) * CFrame.Angles(n.pitch, 0, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- кот
|
||||
|
||||
local cat = {}
|
||||
do
|
||||
local GINGER, WHITE, PINK = Color3.fromRGB(232, 150, 70), Color3.fromRGB(245, 238, 228), Color3.fromRGB(240, 150, 160)
|
||||
cat.body = part({ Size = V(1.3, 1.0, 2.3), Color = GINGER })
|
||||
cat.belly = part({ Size = V(1.0, 0.3, 1.9), Color = WHITE })
|
||||
cat.head = part({ Size = V(1.15, 1.0, 1.0), Color = GINGER })
|
||||
cat.muzzle = part({ Size = V(0.6, 0.35, 0.25), Color = WHITE })
|
||||
cat.nose = part({ Size = V(0.18, 0.12, 0.08), Color = PINK })
|
||||
cat.eyes = {
|
||||
part({ Size = V(0.16, 0.2, 0.05), Color = Color3.fromRGB(40, 40, 30) }),
|
||||
part({ Size = V(0.16, 0.2, 0.05), Color = Color3.fromRGB(40, 40, 30) }),
|
||||
}
|
||||
cat.ears = {
|
||||
part({ Class = "WedgePart", Size = V(0.3, 0.45, 0.35), Color = GINGER }),
|
||||
part({ Class = "WedgePart", Size = V(0.3, 0.45, 0.35), Color = GINGER }),
|
||||
}
|
||||
cat.legs = {}
|
||||
for i = 1, 4 do
|
||||
cat.legs[i] = part({ Size = V(0.32, 0.7, 0.32), Color = (i <= 2) and WHITE or GINGER })
|
||||
end
|
||||
cat.tail = {}
|
||||
for i = 1, 5 do
|
||||
cat.tail[i] = part({ Size = V(0.24, 0.24, 0.42), Color = (i == 5) and WHITE or GINGER })
|
||||
end
|
||||
cat.pos = LOBBY + V(10, 0, 12)
|
||||
cat.dir = V(0, 0, -1)
|
||||
cat.speed = 0
|
||||
cat.lying = 0 -- 0 стоит … 1 лежит
|
||||
cat.walk = 0 -- фаза шага
|
||||
cat.home = LOBBY + V(-9, 0, 13) -- лежанка у фонтана
|
||||
end
|
||||
|
||||
local function catTarget(root)
|
||||
if root and (root.Position - LOBBY).Magnitude < 70 and (root.Position - cat.pos).Magnitude < 40 then
|
||||
-- за игроком: держится чуть сбоку и позади
|
||||
local look = root.CFrame.LookVector
|
||||
local side = root.CFrame.RightVector
|
||||
return V(root.Position.X, LOBBY.Y, root.Position.Z) - look * 3 + side * 2.2, 3.5, true
|
||||
end
|
||||
return cat.home, 0.5, false
|
||||
end
|
||||
|
||||
local function updateCat(dt, t)
|
||||
local root = myRoot()
|
||||
local target, stopDist, following = catTarget(root)
|
||||
local flat = V(target.X - cat.pos.X, 0, target.Z - cat.pos.Z)
|
||||
local dist = flat.Magnitude
|
||||
local want = 0
|
||||
if dist > stopDist then
|
||||
want = math.clamp(dist * 1.2, 4, following and 15 or 6) -- догоняет бегом, домой идёт шагом
|
||||
end
|
||||
cat.speed += (want - cat.speed) * math.min(1, dt * 5)
|
||||
if dist > 0.05 and cat.speed > 0.2 then
|
||||
cat.dir = cat.dir:Lerp(flat.Unit, math.min(1, dt * 6)).Unit
|
||||
local step = math.min(dist, cat.speed * dt)
|
||||
cat.pos += cat.dir * step
|
||||
end
|
||||
-- не заходим в чашу фонтана и на прилавки
|
||||
local r = V(cat.pos.X, 0, cat.pos.Z).Magnitude
|
||||
if r < 14 then
|
||||
cat.pos = LOBBY + V(cat.pos.X, 0, cat.pos.Z).Unit * 14
|
||||
elseif r > 54 then
|
||||
cat.pos = LOBBY + V(cat.pos.X, 0, cat.pos.Z).Unit * 54
|
||||
end
|
||||
local resting = not following and dist <= 0.6 and cat.speed < 0.5
|
||||
cat.lying += ((resting and 1 or 0) - cat.lying) * math.min(1, dt * 2)
|
||||
cat.walk += cat.speed * dt * 2.2
|
||||
|
||||
local L = cat.lying
|
||||
local base = CFrame.lookAt(cat.pos, cat.pos + cat.dir) -- -Z — нос
|
||||
local bob = math.abs(math.sin(cat.walk)) * 0.08 * math.min(1, cat.speed / 4)
|
||||
local bodyY = 1.05 - 0.55 * L + bob
|
||||
local body = base * CFrame.new(0, bodyY, 0)
|
||||
cat.body.CFrame = body
|
||||
cat.belly.CFrame = body * CFrame.new(0, -0.4, 0)
|
||||
local headTurn = L > 0.5 and math.sin(t * 0.4) * 0.3 or 0
|
||||
local head = body * CFrame.new(0, 0.55 - 0.25 * L, -1.35) * CFrame.Angles(0, headTurn, 0)
|
||||
cat.head.CFrame = head
|
||||
cat.muzzle.CFrame = head * CFrame.new(0, -0.18, -0.55)
|
||||
cat.nose.CFrame = head * CFrame.new(0, -0.02, -0.66)
|
||||
cat.eyes[1].CFrame = head * CFrame.new(-0.25, 0.12, -0.51)
|
||||
cat.eyes[2].CFrame = head * CFrame.new(0.25, 0.12, -0.51)
|
||||
cat.ears[1].CFrame = head * CFrame.new(-0.35, 0.68, 0.05) * CFrame.Angles(0, math.pi, 0)
|
||||
cat.ears[2].CFrame = head * CFrame.new(0.35, 0.68, 0.05) * CFrame.Angles(0, math.pi, 0)
|
||||
-- лапы: шагают попеременно, лёжа прячутся под корпус
|
||||
local swing = math.sin(cat.walk) * 0.6 * math.min(1, cat.speed / 3)
|
||||
local legPos = { { -0.42, -0.85 }, { 0.42, -0.85 }, { -0.42, 0.85 }, { 0.42, 0.85 } }
|
||||
for i, lp in ipairs(legPos) do
|
||||
local s = ((i == 1 or i == 4) and swing or -swing)
|
||||
cat.legs[i].CFrame = body * CFrame.new(lp[1], -0.5 - 0.15 * (1 - L) + 0.25 * L, lp[2]) * CFrame.Angles(s, 0, 0)
|
||||
* CFrame.new(0, -0.25 * (1 - L), 0)
|
||||
end
|
||||
-- хвост: цепочка сегментов, кончик покачивается
|
||||
local tcf = body * CFrame.new(0, 0.3, 1.15) * CFrame.Angles(math.rad(35 - 25 * L), 0, 0)
|
||||
for i, seg in ipairs(cat.tail) do
|
||||
local sway = math.sin(t * 2.2 - i * 0.6) * (0.18 + 0.05 * i)
|
||||
tcf = tcf * CFrame.Angles(math.rad(10), sway, 0) * CFrame.new(0, 0, 0.38)
|
||||
seg.CFrame = tcf
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- чайки
|
||||
|
||||
local gulls = {}
|
||||
for i = 1, 4 do
|
||||
local g = {
|
||||
body = part({ Size = V(0.7, 0.6, 1.9), Color = Color3.fromRGB(245, 245, 248) }),
|
||||
head = part({ Size = V(0.5, 0.5, 0.55), Color = Color3.fromRGB(250, 250, 252) }),
|
||||
beak = part({ Size = V(0.15, 0.15, 0.45), Color = Color3.fromRGB(245, 180, 60) }),
|
||||
wings = { part({ Size = V(2.4, 0.1, 0.9), Color = Color3.fromRGB(205, 210, 220) }), part({ Size = V(2.4, 0.1, 0.9), Color = Color3.fromRGB(205, 210, 220) }) },
|
||||
tips = { part({ Size = V(0.8, 0.1, 0.7), Color = Color3.fromRGB(60, 62, 70) }), part({ Size = V(0.8, 0.1, 0.7), Color = Color3.fromRGB(60, 62, 70) }) },
|
||||
r = rng:NextNumber(70, 115), h = rng:NextNumber(52, 78), w = rng:NextNumber(0.1, 0.17) * (i % 2 == 0 and 1 or -1),
|
||||
a = rng:NextNumber(0, math.pi * 2), flap = rng:NextNumber(0, 10),
|
||||
}
|
||||
gulls[i] = g
|
||||
end
|
||||
|
||||
local function updateGulls(dt, t)
|
||||
for _, g in ipairs(gulls) do
|
||||
g.a += g.w * dt
|
||||
local r = g.r + math.sin(t * 0.13 + g.a) * 12
|
||||
local pos = V(math.cos(g.a) * r, g.h + math.sin(t * 0.4 + g.r) * 4, math.sin(g.a) * r)
|
||||
local ahead = V(math.cos(g.a + 0.05 * math.sign(g.w)) * r, pos.Y, math.sin(g.a + 0.05 * math.sign(g.w)) * r)
|
||||
local bank = -math.sign(g.w) * math.rad(18)
|
||||
local cf = CFrame.lookAt(pos, ahead) * CFrame.Angles(0, 0, bank)
|
||||
-- машет крыльями урывками, потом планирует
|
||||
local flapping = math.sin(t * 0.5 + g.flap) > 0.2
|
||||
local wing = flapping and math.sin(t * 9 + g.flap) * math.rad(35) or math.rad(4)
|
||||
g.body.CFrame = cf
|
||||
g.head.CFrame = cf * CFrame.new(0, 0.25, -1.05)
|
||||
g.beak.CFrame = cf * CFrame.new(0, 0.2, -1.5)
|
||||
for s = 1, 2 do
|
||||
local side = (s == 1) and -1 or 1
|
||||
local hinge = cf * CFrame.new(side * 0.35, 0.15, -0.1) * CFrame.Angles(0, 0, side * wing)
|
||||
g.wings[s].CFrame = hinge * CFrame.new(side * 1.2, 0, 0)
|
||||
g.tips[s].CFrame = hinge * CFrame.new(side * 2.4, 0, 0.05) * CFrame.Angles(0, 0, side * wing * 0.5) * CFrame.new(side * 0.35, 0, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- бабочки и светлячки
|
||||
|
||||
local butterflies = {}
|
||||
local fireflyEmitters = {}
|
||||
local function setupFlowersFX()
|
||||
local anchors = {}
|
||||
local foot = map:FindFirstChild("LobbyCliffFoot")
|
||||
local flowers = foot and foot:FindFirstChild("Flowers")
|
||||
if flowers then
|
||||
for _, f in ipairs(flowers:GetChildren()) do
|
||||
table.insert(anchors, f:GetPivot().Position)
|
||||
end
|
||||
end
|
||||
if #anchors == 0 then
|
||||
for i = 1, 12 do
|
||||
local a = i / 12 * math.pi * 2
|
||||
table.insert(anchors, LOBBY + V(math.cos(a) * 70, 0, math.sin(a) * 70))
|
||||
end
|
||||
end
|
||||
local COLORS = { Color3.fromRGB(255, 200, 80), Color3.fromRGB(255, 255, 255), Color3.fromRGB(150, 200, 255), Color3.fromRGB(255, 150, 200), Color3.fromRGB(255, 160, 70) }
|
||||
for i = 1, 16 do
|
||||
local anchor = anchors[rng:NextInteger(1, #anchors)]
|
||||
local c = COLORS[rng:NextInteger(1, #COLORS)]
|
||||
table.insert(butterflies, {
|
||||
anchor = V(anchor.X, LOBBY.Y, anchor.Z), seed = rng:NextNumber(0, 100),
|
||||
body = part({ Size = V(0.08, 0.08, 0.4), Color = Color3.fromRGB(50, 40, 35) }),
|
||||
wings = { part({ Size = V(0.45, 0.04, 0.4), Color = c }), part({ Size = V(0.45, 0.04, 0.4), Color = c }) },
|
||||
})
|
||||
end
|
||||
-- светлячки: у фонарей лобби и у клумб, светятся только ночью
|
||||
local spots = {}
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:IsA("PointLight") and d.Parent:IsA("BasePart") then
|
||||
local p = d.Parent.Position
|
||||
if (V(p.X, 0, p.Z)).Magnitude < 80 and p.Y < 20 then
|
||||
table.insert(spots, p - V(0, 3, 0))
|
||||
end
|
||||
end
|
||||
end
|
||||
for i = 1, math.min(10, #anchors) do
|
||||
table.insert(spots, anchors[rng:NextInteger(1, #anchors)] + V(0, 1.5, 0))
|
||||
end
|
||||
for _, p in ipairs(spots) do
|
||||
local box = part({ Size = V(6, 3, 6), Transparency = 1, CFrame = CFrame.new(p) })
|
||||
local pe = Instance.new("ParticleEmitter")
|
||||
pe.Texture = "rbxasset://textures/particles/sparkles_main.dds"
|
||||
pe.Color = ColorSequence.new(Color3.fromRGB(220, 255, 120))
|
||||
pe.LightEmission = 1
|
||||
pe.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(0.2, 0.22), NumberSequenceKeypoint.new(0.8, 0.22), NumberSequenceKeypoint.new(1, 0) })
|
||||
pe.Lifetime = NumberRange.new(3, 5)
|
||||
pe.Rate = 1.5
|
||||
pe.Speed = NumberRange.new(0.3, 0.8)
|
||||
pe.SpreadAngle = Vector2.new(180, 180)
|
||||
pe.Acceleration = V(0, 0.15, 0)
|
||||
pe.Shape = Enum.ParticleEmitterShape.Box
|
||||
pe.Enabled = false
|
||||
pe.Parent = box
|
||||
table.insert(fireflyEmitters, pe)
|
||||
end
|
||||
end
|
||||
|
||||
local function updateButterflies(dt, t)
|
||||
for _, b in ipairs(butterflies) do
|
||||
local s = b.seed
|
||||
local off = V(math.sin(t * 0.37 + s) * 2.6 + math.sin(t * 0.9 + s * 2) * 0.8, 1.6 + math.sin(t * 0.7 + s) * 0.9 + 0.5,
|
||||
math.cos(t * 0.31 + s) * 2.6 + math.cos(t * 1.1 + s) * 0.8)
|
||||
local pos = b.anchor + off
|
||||
local vel = V(math.cos(t * 0.37 + s) * 0.37 * 2.6, 0, -math.sin(t * 0.31 + s) * 0.31 * 2.6)
|
||||
local cf = CFrame.lookAt(pos, pos + (vel.Magnitude > 0.01 and vel or V(0, 0, -1)))
|
||||
local flap = math.sin(t * 17 + s) * math.rad(60) + math.rad(15)
|
||||
b.body.CFrame = cf
|
||||
b.wings[1].CFrame = cf * CFrame.Angles(0, 0, flap) * CFrame.new(-0.24, 0, 0)
|
||||
b.wings[2].CFrame = cf * CFrame.Angles(0, 0, -flap) * CFrame.new(0.24, 0, 0)
|
||||
end
|
||||
end
|
||||
|
||||
local nightCheckAt = 0
|
||||
local function updateFireflies(t)
|
||||
if t - nightCheckAt < 1 then
|
||||
return
|
||||
end
|
||||
nightCheckAt = t
|
||||
local night = false
|
||||
if Config.DayNight and Config.DayNight.enabled and Config.Nightness and Config.ClockAt then
|
||||
local clock = Config.ClockAt(workspace:GetServerTimeNow(), workspace:GetAttribute("DayStart"))
|
||||
night = Config.Nightness(clock) > 0.4
|
||||
end
|
||||
for _, pe in ipairs(fireflyEmitters) do
|
||||
pe.Enabled = night
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- ветер: деревья, трава, цветы, кусты
|
||||
|
||||
local swayers = {}
|
||||
local function addSway(model, amp, freq, range)
|
||||
local parts, rel = {}, {}
|
||||
local cf, size = model:GetBoundingBox()
|
||||
local base = CFrame.new(cf.Position.X, cf.Position.Y - size.Y / 2, cf.Position.Z)
|
||||
for _, p in ipairs(model:GetDescendants()) do
|
||||
if p:IsA("BasePart") then
|
||||
table.insert(parts, p)
|
||||
table.insert(rel, base:ToObjectSpace(p.CFrame))
|
||||
end
|
||||
end
|
||||
if #parts > 0 then
|
||||
table.insert(swayers, {
|
||||
parts = parts, rel = rel, base = base, amp = math.rad(amp) * rng:NextNumber(0.8, 1.2),
|
||||
freq = freq * rng:NextNumber(0.85, 1.15), phase = rng:NextNumber(0, math.pi * 2), range = range,
|
||||
height = size.Y,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
local leafTrees = {}
|
||||
local function setupSway()
|
||||
local function each(folder, amp, freq, range, leaves)
|
||||
if not folder then
|
||||
return
|
||||
end
|
||||
for _, m in ipairs(folder:GetChildren()) do
|
||||
if m:IsA("Model") then
|
||||
addSway(m, amp, freq, range)
|
||||
if leaves then
|
||||
table.insert(leafTrees, m)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- амплитуда (градусы) и частота (качаний в секунду): деревья — чуть заметно и медленно, трава — живее
|
||||
each(map:FindFirstChild("LobbyTrees"), 0.6, 0.32, 130, true)
|
||||
each(map:FindFirstChild("LobbyForest"), 0.6, 0.32, 130, true)
|
||||
local foot = map:FindFirstChild("LobbyCliffFoot")
|
||||
if foot then
|
||||
each(foot:FindFirstChild("Grass"), 2.8, 0.8, 50)
|
||||
each(foot:FindFirstChild("Flowers"), 3.2, 0.85, 50)
|
||||
each(foot:FindFirstChild("Bushes"), 1, 0.5, 60)
|
||||
end
|
||||
-- падающие листья: у ближайших к площади деревьев, из объёма кроны
|
||||
table.sort(leafTrees, function(a, b)
|
||||
return V(a:GetPivot().Position.X, 0, a:GetPivot().Position.Z).Magnitude < V(b:GetPivot().Position.X, 0, b:GetPivot().Position.Z).Magnitude
|
||||
end)
|
||||
for i = 1, math.min(24, #leafTrees) do
|
||||
local cf, size = leafTrees[i]:GetBoundingBox()
|
||||
local crown = part({ Size = V(size.X * 0.8, size.Y * 0.35, size.Z * 0.8), Transparency = 1, CFrame = cf * CFrame.new(0, size.Y * 0.2, 0) })
|
||||
local pe = Instance.new("ParticleEmitter")
|
||||
pe.Texture = LEAF_TEXTURE
|
||||
pe.Color = ColorSequence.new(Color3.fromRGB(255, 255, 255), Color3.fromRGB(255, 235, 170))
|
||||
pe.Size = NumberSequence.new(0.45)
|
||||
pe.Lifetime = NumberRange.new(6, 9)
|
||||
pe.Rate = 0.15
|
||||
pe.Speed = NumberRange.new(0.2, 0.6)
|
||||
pe.Acceleration = V(0.6, -1.1, 0.2)
|
||||
pe.Drag = 0.6
|
||||
pe.Rotation = NumberRange.new(0, 360)
|
||||
pe.RotSpeed = NumberRange.new(-140, 140)
|
||||
pe.Orientation = Enum.ParticleOrientation.VelocityPerpendicular
|
||||
pe.Shape = Enum.ParticleEmitterShape.Box
|
||||
pe.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.08, 0), NumberSequenceKeypoint.new(0.85, 0), NumberSequenceKeypoint.new(1, 1) })
|
||||
pe.LightInfluence = 1
|
||||
pe.Parent = crown
|
||||
end
|
||||
end
|
||||
|
||||
local swayAcc = 0
|
||||
local bulkParts, bulkCFrames = {}, {}
|
||||
local function updateSway(dt, t)
|
||||
swayAcc += dt
|
||||
if swayAcc < 1 / 30 then
|
||||
return
|
||||
end
|
||||
swayAcc = 0
|
||||
local cam = camPos()
|
||||
-- порывы: ветер то стихает, то усиливается
|
||||
local gust = 0.75 + 0.2 * math.sin(t * 0.23) + 0.08 * math.sin(t * 0.71)
|
||||
table.clear(bulkParts)
|
||||
table.clear(bulkCFrames)
|
||||
for _, s in ipairs(swayers) do
|
||||
if (s.base.Position - cam).Magnitude < s.range then
|
||||
local a = s.amp * gust
|
||||
local ax = a * math.sin(t * s.freq * math.pi * 2 + s.phase)
|
||||
local az = a * 0.6 * math.sin(t * s.freq * math.pi * 1.3 + s.phase * 1.7) + a * 0.2 -- лёгкий наклон по ветру
|
||||
local pose = s.base * CFrame.Angles(ax, 0, az)
|
||||
for i, p in ipairs(s.parts) do
|
||||
table.insert(bulkParts, p)
|
||||
table.insert(bulkCFrames, pose * s.rel[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
if #bulkParts > 0 then
|
||||
workspace:BulkMoveTo(bulkParts, bulkCFrames, Enum.BulkMoveMode.FireCFrameChanged)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- запуск
|
||||
|
||||
task.wait(3) -- карта и NPC успевают появиться
|
||||
scanNpcs()
|
||||
setupFlowersFX()
|
||||
setupSway()
|
||||
local scanAt = os.clock()
|
||||
local t0 = os.clock()
|
||||
RunService.RenderStepped:Connect(function(dt)
|
||||
local t = os.clock() - t0
|
||||
if os.clock() - scanAt > 5 then
|
||||
scanAt = os.clock()
|
||||
scanNpcs()
|
||||
end
|
||||
updateNpcs(dt)
|
||||
if (camPos() - LOBBY).Magnitude > LOBBY_VIEW then
|
||||
return -- игрок в другом мире: лобби не анимируем
|
||||
end
|
||||
updateCat(dt, t)
|
||||
updateGulls(dt, t)
|
||||
updateButterflies(dt, t)
|
||||
updateFireflies(t)
|
||||
updateSway(dt, t)
|
||||
end)
|
||||
@@ -1,17 +1,42 @@
|
||||
-- Двор гильдии рыбаков в лобби + лавки наживки. Запускать в Studio в режиме редактирования
|
||||
-- Дом гильдии рыбаков в лобби + лавки наживки. Запускать в Studio в режиме редактирования
|
||||
-- (Command Bar или Studio MCP), потом сохранить плейс (Ctrl+S). Повторный запуск пересобирает только
|
||||
-- то, что строит этот скрипт (папки FishingMap.GuildHall и FishingMap.BaitShops), остальная карта не трогается.
|
||||
--
|
||||
-- Двор — в проходе между двумя домиками на севере лобби: арка с вывеской «⚓ ГИЛЬДИЯ РЫБАКОВ»,
|
||||
-- знамёна, фонари, доска заказов (атрибут OrderBoard + подсказка Action=Orders),
|
||||
-- кафедра и место Старейшины Ворона (NpcSpot с атрибутами, GuildElder, Look=Elder, Action=Guild).
|
||||
-- Гильдия занимает правый из двух домиков на севере лобби (Workspace.GuildHouse — тот же дом из набора,
|
||||
-- что и левый). Перед его фасадом: вывеска «⚓ ГИЛЬДИЯ РЫБАКОВ», знамёна, фонари, стойка и место
|
||||
-- Старейшины Ворона (NpcSpot с атрибутами, GuildElder, Look=Elder, Action=Guild) и доска заказов
|
||||
-- (атрибут OrderBoard + подсказка Action=Orders).
|
||||
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
assert(map, "Нет Workspace.FishingMap")
|
||||
|
||||
local V = Vector3.new
|
||||
local FLOOR = 1.02 -- верх дорожки лобби
|
||||
local X0 = 0.5 -- середина прохода между домиками (x от -4 до 5)
|
||||
|
||||
-- правый домик: при первом запуске это безымянная Workspace.Model справа от прохода
|
||||
local house = workspace:FindFirstChild("GuildHouse")
|
||||
if not house then
|
||||
for _, c in ipairs(workspace:GetChildren()) do
|
||||
if c:IsA("Model") and c.Name == "Model" then
|
||||
local cf, size = c:GetBoundingBox()
|
||||
if cf.X > 10 and cf.X < 40 and cf.Z < -40 and cf.Z > -70 and size.X > 30 then
|
||||
house = c
|
||||
end
|
||||
end
|
||||
end
|
||||
assert(house, "Не найден правый домик лобби")
|
||||
house.Name = "GuildHouse"
|
||||
end
|
||||
|
||||
-- фасад, смотрящий на площадь (+Z): ищем лучом
|
||||
local houseCF = house:GetBoundingBox()
|
||||
local X0 = houseCF.X - 1.7 -- середина стены (без крыльца)
|
||||
local probe = RaycastParams.new()
|
||||
probe.FilterType = Enum.RaycastFilterType.Include
|
||||
probe.FilterDescendantsInstances = { house }
|
||||
local facadeHit = workspace:Raycast(V(X0, FLOOR + 6, -20), V(0, 0, -40), probe)
|
||||
assert(facadeHit, "Не найден фасад домика гильдии")
|
||||
local FZ = facadeHit.Position.Z -- плоскость фасада
|
||||
|
||||
local WOOD = Color3.fromRGB(110, 72, 44)
|
||||
local DARK = Color3.fromRGB(66, 42, 26)
|
||||
@@ -114,64 +139,88 @@ local function lantern(pos, parent)
|
||||
light.Parent = l
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- арка с вывеской
|
||||
-- большой куст из набора домика стоит там, где стойка: сдвигаем его левее (один раз)
|
||||
local bush = house:FindFirstChild("Object.5989")
|
||||
if bush and bush.Position.X > houseCF.X - 9 then
|
||||
bush.CFrame = bush.CFrame - V(4, 0, 0)
|
||||
end
|
||||
|
||||
local ZA = -34 -- арка перед фасадами домиков
|
||||
for _, x in ipairs({ -4.2, 5.2 }) do
|
||||
P({ Name = "ArchPost", Size = V(1.4, 15, 1.4), CFrame = CFrame.new(x, FLOOR + 7.5, ZA), Color = shade(DARK, 0.05) })
|
||||
P({ Name = "ArchFoot", Size = V(2, 1, 2), CFrame = CFrame.new(x, FLOOR + 0.5, ZA), Color = Color3.fromRGB(120, 112, 104), Material = Enum.Material.Slate })
|
||||
-- знамя гильдии на столбе
|
||||
local banner = P({ Name = "GuildBanner", Size = V(2.4, 6, 0.2), CFrame = CFrame.new(x, FLOOR + 8.5, ZA + 0.85), Color = CRIMSON, Material = Enum.Material.Fabric, CanCollide = false })
|
||||
P({ Name = "BannerRod", Size = V(3, 0.25, 0.25), CFrame = CFrame.new(x, FLOOR + 11.6, ZA + 0.85), Color = GOLD })
|
||||
P({ Name = "BannerTrim", Size = V(2.4, 0.3, 0.22), CFrame = CFrame.new(x, FLOOR + 5.6, ZA + 0.86), Color = GOLD, CanCollide = false })
|
||||
---------------------------------------------------------------- знамёна по углам фасада
|
||||
|
||||
for _, x in ipairs({ X0 - 9.2, X0 + 9.2 }) do
|
||||
P({ Name = "BannerRod", Size = V(3.2, 0.25, 0.25), CFrame = CFrame.new(x, FLOOR + 13.4, FZ + 0.5), Color = GOLD })
|
||||
local banner = P({ Name = "GuildBanner", Size = V(2.6, 6.8, 0.2), CFrame = CFrame.new(x, FLOOR + 9.9, FZ + 0.5), Color = CRIMSON, Material = Enum.Material.Fabric, CanCollide = false })
|
||||
P({ Name = "BannerTrim", Size = V(2.6, 0.3, 0.22), CFrame = CFrame.new(x, FLOOR + 6.6, FZ + 0.51), Color = GOLD, CanCollide = false })
|
||||
surfaceText(banner, Enum.NormalId.Back, "⚓", Color3.fromRGB(255, 214, 120), 0.25)
|
||||
end
|
||||
P({ Name = "ArchBeam", Size = V(12, 1.4, 1.6), CFrame = CFrame.new(X0, FLOOR + 14.6, ZA), Color = DARK })
|
||||
P({ Name = "ArchRidge", Size = V(13, 0.6, 2.6), CFrame = CFrame.new(X0, FLOOR + 19.1, ZA), Color = shade(CRIMSON, 0.04) })
|
||||
P({ Name = "SignFrame", Size = V(11.6, 3.9, 0.3), CFrame = CFrame.new(X0, FLOOR + 17, ZA + 0.2), Color = GOLD })
|
||||
local sign = P({ Name = "GuildSign", Size = V(11, 3.3, 0.5), CFrame = CFrame.new(X0, FLOOR + 17, ZA + 0.45), Color = Color3.fromRGB(70, 45, 30) })
|
||||
|
||||
---------------------------------------------------------------- стойка Старейшины перед фасадом
|
||||
|
||||
local DZ = FZ + 5.6 -- стойка
|
||||
local EZ = FZ + 2.8 -- Старейшина за стойкой
|
||||
P({ Name = "GuildDesk", Size = V(9, 3.4, 1.8), CFrame = CFrame.new(X0, FLOOR + 1.7, DZ), Color = DARK })
|
||||
P({ Name = "DeskTop", Size = V(9.6, 0.3, 2.4), CFrame = CFrame.new(X0, FLOOR + 3.55, DZ), Color = WOOD })
|
||||
P({ Name = "DeskTrim", Size = V(9.1, 0.35, 1.9), CFrame = CFrame.new(X0, FLOOR + 0.6, DZ), Color = GOLD })
|
||||
local front = P({ Name = "DeskFront", Size = V(6, 1.6, 0.15), CFrame = CFrame.new(X0, FLOOR + 2, DZ + 0.95), Color = CRIMSON, Material = Enum.Material.Fabric })
|
||||
surfaceText(front, Enum.NormalId.Back, "⚓ F·E·D·C·B·A·S", Color3.fromRGB(255, 214, 120), 0.18)
|
||||
P({ Name = "GuildBook", Size = V(1.6, 0.25, 1.1), CFrame = CFrame.new(X0 - 1.6, FLOOR + 3.85, DZ) * CFrame.Angles(0, math.rad(12), 0), Color = Color3.fromRGB(110, 30, 30) })
|
||||
P({ Name = "BookPages", Size = V(1.5, 0.27, 1.0), CFrame = CFrame.new(X0 - 1.6, FLOOR + 3.87, DZ) * CFrame.Angles(0, math.rad(12), 0), Color = PARCH })
|
||||
P({ Name = "SealBox", Size = V(1.2, 0.7, 0.9), CFrame = CFrame.new(X0 + 2.2, FLOOR + 4.05, DZ), Color = GOLD })
|
||||
P({ Name = "Inkwell", Size = V(0.45, 0.5, 0.45), CFrame = CFrame.new(X0 + 0.4, FLOOR + 3.95, DZ - 0.3), Color = Color3.fromRGB(30, 30, 35) })
|
||||
P({ Name = "Quill", Size = V(0.1, 1.3, 0.1), CFrame = CFrame.new(X0 + 0.5, FLOOR + 4.4, DZ - 0.3) * CFrame.Angles(0, 0, math.rad(-20)), Color = Color3.fromRGB(240, 240, 235), CanCollide = false })
|
||||
-- ворота над стойкой с вывеской: её видно с площади, а не из-под свеса крыши
|
||||
local GATE_H = 11
|
||||
for _, x in ipairs({ X0 - 5.2, X0 + 5.2 }) do
|
||||
P({ Name = "GatePost", Size = V(0.8, GATE_H, 0.8), CFrame = CFrame.new(x, FLOOR + GATE_H / 2, DZ - 0.3), Color = DARK })
|
||||
P({ Name = "GateFoot", Size = V(1.4, 0.8, 1.4), CFrame = CFrame.new(x, FLOOR + 0.4, DZ - 0.3), Color = Color3.fromRGB(120, 112, 104), Material = Enum.Material.Slate })
|
||||
end
|
||||
P({ Name = "GateBeam", Size = V(12, 0.9, 1.2), CFrame = CFrame.new(X0, FLOOR + GATE_H - 0.2, DZ - 0.3), Color = DARK })
|
||||
P({ Name = "SignFrame", Size = V(12.6, 3.9, 0.3), CFrame = CFrame.new(X0, FLOOR + GATE_H + 2, DZ - 0.45), Color = GOLD })
|
||||
local sign = P({ Name = "GuildSign", Size = V(12, 3.3, 0.5), CFrame = CFrame.new(X0, FLOOR + GATE_H + 2, DZ - 0.2), Color = Color3.fromRGB(70, 45, 30) })
|
||||
surfaceText(sign, Enum.NormalId.Back, "⚓ ГИЛЬДИЯ РЫБАКОВ", Color3.fromRGB(255, 214, 120), 0.14)
|
||||
billboard(sign, "⚔ Гильдия рыбаков", Color3.fromRGB(255, 214, 120), 4.2, 320)
|
||||
for _, x in ipairs({ X0 - 4, X0 + 4 }) do
|
||||
P({ Name = "Chain", Size = V(0.15, 1.2, 0.15), CFrame = CFrame.new(x, FLOOR + 13.3, ZA + 0.3), Color = Color3.fromRGB(70, 70, 75), Material = Enum.Material.Metal }, hall)
|
||||
lantern(V(x, FLOOR + 12.2, ZA + 0.3), hall)
|
||||
billboard(sign, "⚔ Гильдия рыбаков", Color3.fromRGB(255, 214, 120), 3.6, 320)
|
||||
for _, x in ipairs({ X0 - 3.6, X0 + 3.6 }) do
|
||||
P({ Name = "Chain", Size = V(0.15, 1.2, 0.15), CFrame = CFrame.new(x, FLOOR + GATE_H - 1.2, DZ - 0.3), Color = Color3.fromRGB(70, 70, 75), Material = Enum.Material.Metal })
|
||||
lantern(V(x, FLOOR + GATE_H - 2.3, DZ - 0.3), hall)
|
||||
end
|
||||
|
||||
-- ковровая дорожка от арки к Старейшине
|
||||
P({ Name = "GuildRug", Size = V(4, 0.1, 22), CFrame = CFrame.new(X0, FLOOR + 0.05, -47), Color = shade(CRIMSON, 0.03), Material = Enum.Material.Fabric, CanCollide = false })
|
||||
-- ковровая дорожка от площади к стойке
|
||||
P({ Name = "GuildRug", Size = V(4, 0.1, 9), CFrame = CFrame.new(X0, FLOOR + 0.05, DZ + 5.6), Color = shade(CRIMSON, 0.03), Material = Enum.Material.Fabric, CanCollide = false })
|
||||
for _, x in ipairs({ X0 - 2.05, X0 + 2.05 }) do
|
||||
P({ Name = "RugTrim", Size = V(0.15, 0.11, 22), CFrame = CFrame.new(x, FLOOR + 0.05, -47), Color = GOLD, CanCollide = false })
|
||||
P({ Name = "RugTrim", Size = V(0.15, 0.11, 9), CFrame = CFrame.new(x, FLOOR + 0.05, DZ + 5.6), Color = GOLD, CanCollide = false })
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- доска заказов (у стены левого домика, лицом к проходу)
|
||||
---------------------------------------------------------------- доска заказов (справа от стойки, лицом к площади)
|
||||
|
||||
local BZ = -46
|
||||
for _, z in ipairs({ BZ - 3.4, BZ + 3.4 }) do
|
||||
P({ Name = "BoardLeg", Size = V(0.5, 8.6, 0.5), CFrame = CFrame.new(-3.3, FLOOR + 4.3, z), Color = DARK })
|
||||
local BX, BZ = X0 + 9.2, FZ + 4.4
|
||||
local boardCF = CFrame.new(BX, FLOOR, BZ) * CFrame.Angles(0, math.rad(-18), 0) -- чуть повёрнута к центру площади
|
||||
local function at(x, y, z)
|
||||
return boardCF * CFrame.new(x, y, z)
|
||||
end
|
||||
local board = P({ Name = "OrderBoard", Size = V(0.4, 4.6, 6.4), CFrame = CFrame.new(-3.2, FLOOR + 5, BZ), Color = Color3.fromRGB(112, 80, 52) })
|
||||
for _, x in ipairs({ -3.4, 3.4 }) do
|
||||
P({ Name = "BoardLeg", Size = V(0.5, 8.6, 0.5), CFrame = at(x, 4.3, -0.1), Color = DARK })
|
||||
end
|
||||
local board = P({ Name = "OrderBoard", Size = V(6.4, 4.6, 0.4), CFrame = at(0, 5, 0), Color = Color3.fromRGB(112, 80, 52) })
|
||||
board:SetAttribute("OrderBoard", true)
|
||||
P({ Name = "BoardFrame", Size = V(0.35, 5.1, 6.9), CFrame = CFrame.new(-3.3, FLOOR + 5, BZ), Color = DARK })
|
||||
P({ Name = "BoardRoof", Size = V(1.8, 0.3, 7.6), CFrame = CFrame.new(-3, FLOOR + 8.9, BZ) * CFrame.Angles(0, 0, math.rad(-14)), Color = Color3.fromRGB(110, 34, 30) })
|
||||
local header = P({ Name = "BoardHeader", Size = V(0.3, 1.1, 6.4), CFrame = CFrame.new(-3.05, FLOOR + 8, BZ), Color = Color3.fromRGB(70, 45, 30) })
|
||||
surfaceText(header, Enum.NormalId.Right, "📜 ДОСКА ЗАКАЗОВ", Color3.fromRGB(255, 214, 120), 0.12)
|
||||
P({ Name = "BoardFrame", Size = V(6.9, 5.1, 0.35), CFrame = at(0, 5, -0.1), Color = DARK })
|
||||
P({ Name = "BoardRoof", Size = V(7.6, 0.3, 1.8), CFrame = at(0, 8.9, 0.2) * CFrame.Angles(math.rad(14), 0, 0), Color = Color3.fromRGB(110, 34, 30) })
|
||||
local header = P({ Name = "BoardHeader", Size = V(6.4, 1.1, 0.3), CFrame = at(0, 8, 0.15), Color = Color3.fromRGB(70, 45, 30) })
|
||||
surfaceText(header, Enum.NormalId.Back, "📜 ДОСКА ЗАКАЗОВ", Color3.fromRGB(255, 214, 120), 0.12)
|
||||
-- пергаменты-заказы, приколотые к доске
|
||||
for i, spot in ipairs({ { 6.2, -2.1 }, { 6.0, 0.1 }, { 6.3, 2.2 }, { 4.0, -1.2 }, { 3.8, 1.1 }, { 3.9, 2.6 } }) do
|
||||
local note = P({
|
||||
Name = "OrderNote", Size = V(0.06, 1.7, 1.35), Color = shade(PARCH, 0.05), CanCollide = false,
|
||||
CFrame = CFrame.new(-2.97, FLOOR + spot[1] - 0.6, BZ + spot[2]) * CFrame.Angles(math.rad(rng:NextNumber(-8, 8)), 0, 0),
|
||||
Name = "OrderNote", Size = V(1.35, 1.7, 0.06), Color = shade(PARCH, 0.05), CanCollide = false,
|
||||
CFrame = at(spot[2], spot[1] - 0.6, 0.23) * CFrame.Angles(0, 0, math.rad(rng:NextNumber(-8, 8))),
|
||||
})
|
||||
P({ Name = "Pin", Size = V(0.12, 0.2, 0.2), CFrame = note.CFrame * CFrame.new(0.05, 0.65, 0), Color = (i % 2 == 0) and CRIMSON or GOLD, CanCollide = false })
|
||||
P({ Name = "Pin", Size = V(0.2, 0.2, 0.12), CFrame = note.CFrame * CFrame.new(0, 0.65, 0.05), Color = (i % 2 == 0) and CRIMSON or GOLD, CanCollide = false })
|
||||
end
|
||||
prompt(board, "Заказы гильдии", "Доска заказов", "Orders", 12)
|
||||
-- бочка у доски
|
||||
P({ Name = "Barrel", ClassName = "Part", Shape = Enum.PartType.Cylinder, Size = V(3, 2.4, 2.4), CFrame = at(4.7, 1.5, 0.4) * CFrame.Angles(0, 0, math.rad(90)), Color = shade(WOOD, 0.08) })
|
||||
P({ Name = "BarrelBand", ClassName = "Part", Shape = Enum.PartType.Cylinder, Size = V(0.3, 2.55, 2.55), CFrame = at(4.7, 1.5, 0.4) * CFrame.Angles(0, 0, math.rad(90)), Color = DARK })
|
||||
|
||||
---------------------------------------------------------------- Старейшина Ворон и кафедра
|
||||
---------------------------------------------------------------- Старейшина Ворон
|
||||
|
||||
local EZ = -60
|
||||
local lectern = P({ Name = "GuildLectern", Size = V(2.6, 3.4, 1.6), CFrame = CFrame.new(X0, FLOOR + 1.7, EZ + 2.6), Color = DARK })
|
||||
P({ Name = "LecternTop", Size = V(3, 0.3, 2), CFrame = CFrame.new(X0, FLOOR + 3.55, EZ + 2.6) * CFrame.Angles(math.rad(-15), 0, 0), Color = WOOD })
|
||||
P({ Name = "GuildBook", Size = V(1.6, 0.25, 1.1), CFrame = CFrame.new(X0, FLOOR + 3.85, EZ + 2.6) * CFrame.Angles(math.rad(-15), 0, 0), Color = Color3.fromRGB(110, 30, 30) })
|
||||
P({ Name = "BookPages", Size = V(1.5, 0.27, 1.0), CFrame = CFrame.new(X0, FLOOR + 3.87, EZ + 2.6) * CFrame.Angles(math.rad(-15), 0, 0), Color = PARCH })
|
||||
local elder = P({ Name = "NpcSpot", Size = V(2, 5, 1), CFrame = CFrame.new(X0, FLOOR + 3, EZ) * CFrame.Angles(0, math.pi, 0),
|
||||
Color = Color3.fromRGB(60, 50, 70), Transparency = 0.5, CanCollide = false, CanQuery = false, CanTouch = false })
|
||||
elder:SetAttribute("NpcName", "Старейшина Ворон")
|
||||
@@ -183,14 +232,6 @@ elder:SetAttribute("NpcAction", "Guild")
|
||||
elder:SetAttribute("NpcActionText", "Гильдия")
|
||||
elder:SetAttribute("Look", "Elder")
|
||||
elder:SetAttribute("GuildElder", true)
|
||||
-- знамя гильдии за спиной Старейшины
|
||||
P({ Name = "BackBannerRod", Size = V(5.4, 0.3, 0.3), CFrame = CFrame.new(X0, FLOOR + 11, EZ - 2.4), Color = GOLD })
|
||||
local back = P({ Name = "GuildBanner", Size = V(4.6, 8, 0.2), CFrame = CFrame.new(X0, FLOOR + 6.9, EZ - 2.4), Color = CRIMSON, Material = Enum.Material.Fabric, CanCollide = false })
|
||||
surfaceText(back, Enum.NormalId.Back, "⚓\nF·E·D·C·B·A·S", Color3.fromRGB(255, 214, 120), 0.12)
|
||||
for _, x in ipairs({ X0 - 2.9, X0 + 2.9 }) do
|
||||
P({ Name = "BannerPole", Size = V(0.4, 11.5, 0.4), CFrame = CFrame.new(x, FLOOR + 5.75, EZ - 2.4), Color = DARK })
|
||||
end
|
||||
lantern(V(X0 - 3.6, FLOOR + 4.2, EZ + 1), hall)
|
||||
|
||||
---------------------------------------------------------------- лавки наживки: у магазина в лобби и у деда на причале Мира 1
|
||||
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
-- Заготовка terrain для локации «Тропический остров». Запускать в Studio в режиме редактирования
|
||||
-- (Command Bar или Studio MCP), потом сохранить плейс (Ctrl+S).
|
||||
-- Сначала очищает весь terrain в квадрате локации (вода и земля), потом строит заново.
|
||||
-- Остальные миры (лобби, другие острова) лежат в 1500 studs отсюда и не затрагиваются.
|
||||
--
|
||||
-- Схема (вид сверху, пропорции как на референсе):
|
||||
-- центр — скалистый остров с плато под вышку и песчаной кромкой;
|
||||
-- лагуна — бирюзовая вода, мелкая у берегов, глубже к середине;
|
||||
-- кольцо по краям — песчаный пляж → трава → скалы-обрывы по периметру;
|
||||
-- на мелководье — несколько каменных островков.
|
||||
|
||||
local Terrain = workspace.Terrain
|
||||
|
||||
local CENTER = Vector3.new(1500, 0, 0) -- FishConfig.Worlds[2].center; CENTER.Y — уровень воды
|
||||
local R_OUTER = 320 -- полуразмер квадрата карты
|
||||
|
||||
-- радиусы зон (в долях от R_OUTER, подобраны под картинку)
|
||||
local R_ISLAND = 0.17 * R_OUTER -- скала центрального острова
|
||||
local R_ISLAND_BEACH = 0.21 * R_OUTER -- песчаная кромка острова
|
||||
local R_SHORE = 0.62 * R_OUTER -- линия берега внешнего кольца
|
||||
local R_GRASS = 0.70 * R_OUTER -- где пляж переходит в траву
|
||||
local R_CLIFF = 0.80 * R_OUTER -- подножие скал по краю
|
||||
|
||||
local ISLAND_TOP = 34 -- высота плато острова над водой
|
||||
local CLIFF_TOP = 70 -- высота обрывов по краю
|
||||
local LAGOON_DEPTH = 14
|
||||
local BOTTOM = -24
|
||||
local CELL = 4
|
||||
|
||||
local ISLETS = { -- {угол°, доля радиуса лагуны, радиус, высота}
|
||||
{ 20, 0.55, 9, 5 },
|
||||
{ 75, 0.70, 7, 4 },
|
||||
{ 140, 0.60, 11, 6 },
|
||||
{ 215, 0.50, 6, 3 },
|
||||
{ 300, 0.65, 10, 5 },
|
||||
{ 330, 0.45, 5, 3 },
|
||||
}
|
||||
|
||||
local function smooth(t)
|
||||
t = math.clamp(t, 0, 1)
|
||||
return t * t * (3 - 2 * t)
|
||||
end
|
||||
|
||||
-- неровные края: радиус «дышит» по углу
|
||||
local function wobble(angle, seed, amp)
|
||||
return 1 + amp * math.noise(math.cos(angle) * 1.7 + seed, math.sin(angle) * 1.7 + seed, seed * 0.37)
|
||||
end
|
||||
|
||||
-- высота поверхности (относительно воды) и материал верхнего слоя
|
||||
local function sample(x, z)
|
||||
local dx, dz = x - CENTER.X, z - CENTER.Z
|
||||
local r = math.sqrt(dx * dx + dz * dz)
|
||||
local a = math.atan2(dz, dx)
|
||||
local detail = math.noise(x / 40, z / 40, 3.1) * 2
|
||||
|
||||
local rIsland = R_ISLAND * wobble(a, 1.3, 0.35)
|
||||
local rIslandBeach = R_ISLAND_BEACH * wobble(a, 1.3, 0.3)
|
||||
local rShore = R_SHORE * wobble(a, 5.7, 0.12)
|
||||
local rGrass = R_GRASS * wobble(a, 5.7, 0.12)
|
||||
local rCliff = R_CLIFF * wobble(a, 9.1, 0.10)
|
||||
|
||||
if r < rIsland then
|
||||
-- плато с крутыми скальными боками
|
||||
local edge = smooth((rIsland - r) / (rIsland * 0.35))
|
||||
local h = 2 + (ISLAND_TOP - 2) * edge + detail
|
||||
return h, (edge > 0.95 and Enum.Material.Grass or Enum.Material.Rock), Enum.Material.Rock
|
||||
elseif r < rIslandBeach then
|
||||
local t = (r - rIsland) / (rIslandBeach - rIsland)
|
||||
return 2 - 4 * t, Enum.Material.Sand, Enum.Material.Sand
|
||||
elseif r < rShore then
|
||||
-- дно лагуны: мелко у берегов, глубже к середине
|
||||
local t = (r - rIslandBeach) / (rShore - rIslandBeach)
|
||||
local depth = LAGOON_DEPTH * math.sin(t * math.pi) ^ 0.6
|
||||
local h = -2 - depth + detail
|
||||
-- каменные островки
|
||||
for _, isl in ipairs(ISLETS) do
|
||||
local ang = math.rad(isl[1])
|
||||
local ir = rIslandBeach + (rShore - rIslandBeach) * isl[2]
|
||||
local ix, iz = math.cos(ang) * ir, math.sin(ang) * ir
|
||||
local d = math.sqrt((dx - ix) ^ 2 + (dz - iz) ^ 2)
|
||||
if d < isl[3] then
|
||||
local k = smooth(1 - d / isl[3])
|
||||
local ih = isl[4] * k + h * (1 - k)
|
||||
if ih > h then
|
||||
return ih, Enum.Material.Rock, Enum.Material.Rock
|
||||
end
|
||||
end
|
||||
end
|
||||
return h, Enum.Material.Sand, Enum.Material.Sand
|
||||
elseif r < rGrass then
|
||||
local t = (r - rShore) / (rGrass - rShore)
|
||||
return -2 + 5 * smooth(t), Enum.Material.Sand, Enum.Material.Sand
|
||||
elseif r < rCliff then
|
||||
local t = (r - rGrass) / (rCliff - rGrass)
|
||||
return 3 + 4 * t + detail, Enum.Material.Grass, Enum.Material.Ground
|
||||
else
|
||||
local t = smooth((r - rCliff) / (R_OUTER * 0.06))
|
||||
local h = 7 + (CLIFF_TOP - 7) * t + detail * 3
|
||||
return h, (t > 0.97 and Enum.Material.Grass or Enum.Material.Rock), Enum.Material.Rock
|
||||
end
|
||||
end
|
||||
|
||||
-- очистка: весь старый terrain локации (с запасом по краям и по высоте)
|
||||
local CLEAR = R_OUTER + 80
|
||||
Terrain:FillBlock(CFrame.new(CENTER + Vector3.new(0, 60, 0)), Vector3.new(CLEAR * 2, 320, CLEAR * 2), Enum.Material.Air)
|
||||
task.wait()
|
||||
|
||||
local water = Enum.Material.Water
|
||||
local rows = 0
|
||||
for x = CENTER.X - R_OUTER, CENTER.X + R_OUTER - CELL, CELL do
|
||||
for z = CENTER.Z - R_OUTER, CENTER.Z + R_OUTER - CELL, CELL do
|
||||
local cx, cz = x + CELL / 2, z + CELL / 2
|
||||
local h, top, under = sample(cx, cz)
|
||||
local yTop = CENTER.Y + h
|
||||
local yBottom = CENTER.Y + BOTTOM
|
||||
-- основание
|
||||
local mid = math.max(yBottom, yTop - 3)
|
||||
if mid > yBottom then
|
||||
Terrain:FillBlock(
|
||||
CFrame.new(cx, (yBottom + mid) / 2, cz),
|
||||
Vector3.new(CELL, mid - yBottom, CELL),
|
||||
under
|
||||
)
|
||||
end
|
||||
-- верхний слой
|
||||
Terrain:FillBlock(CFrame.new(cx, (mid + yTop) / 2, cz), Vector3.new(CELL, math.max(yTop - mid, 1), CELL), top)
|
||||
-- вода до уровня CENTER.Y
|
||||
if yTop < CENTER.Y then
|
||||
Terrain:FillBlock(
|
||||
CFrame.new(cx, (yTop + CENTER.Y) / 2, cz),
|
||||
Vector3.new(CELL, CENTER.Y - yTop, CELL),
|
||||
water
|
||||
)
|
||||
end
|
||||
end
|
||||
rows += 1
|
||||
if rows % 8 == 0 then
|
||||
task.wait()
|
||||
end
|
||||
end
|
||||
|
||||
-- цвет воды (Terrain.WaterColor и т.п.) общий для всех миров, поэтому здесь не меняется
|
||||
|
||||
print("Тропический остров: terrain готов")
|
||||