Compare commits

...
17 Commits
Author SHA1 Message Date
heyshawtyy 73a2db8bb8 update 2026-11-04 13:32:09 +05:00
heyshawtyy 9fcbd8bc0b Update 2026-11-04 13:31:09 +05:00
listik 1ff7ef7e83 234 2026-11-04 00:09:13 +03:00
listik b48d1f68f6 234 2026-11-04 00:01:19 +03:00
listik e1459c9834 234 2026-11-03 23:22:03 +03:00
listik 1ff2a46e1e 3 2026-11-03 23:04:01 +03:00
listik 134940f76d 12 2026-11-03 23:03:51 +03:00
listik 5dfded2fe1 12 2026-11-03 22:43:09 +03:00
listik 86cb60fde0 1 2026-11-03 22:25:03 +03:00
listik 631a6c03e4 1 2026-11-03 20:42:40 +03:00
listik 5722b6180a 12 2026-11-03 20:32:39 +03:00
listik 8cf3be75c2 12 2026-11-03 19:56:18 +03:00
Leshyi 3402fe5edb 12 2026-11-03 14:48:26 +03:00
Leshyi 860a6d2220 12 2026-11-03 14:47:14 +03:00
Leshyi eade0cd2ae 12 2026-11-03 13:45:36 +03:00
listik 9682ed0987 1 2026-11-03 09:50:13 +03:00
listik 306cbfcbef 12 2026-11-03 09:40:50 +03:00
38 changed files with 3702640 additions and 8380 deletions

No files matched your search

+2
View File
@@ -6,3 +6,5 @@
# Rojo / инструменты
sourcemap.json
rojo.exe
backups/
+9
View File
@@ -0,0 +1,9 @@
{
"mcpServers": {
"Roblox_Studio": {
"type": "stdio",
"command": "cmd.exe",
"args": ["/c", "cd /d %LOCALAPPDATA%\\Roblox && .\\mcp.bat"]
}
}
}
BIN
View File
Binary file not shown.
+3677084 -3389
View File
File diff suppressed because it is too large. Load diff
+20
View File
@@ -17,6 +17,26 @@ default.project.json проект Rojo
Откройте `Fishing.rbxlx` в Roblox Studio (**File → Open from File…** или двойной клик) и нажмите **Play** (F5).
Файл собирается из `src/` командой `powershell -ExecutionPolicy Bypass -File build.ps1` (в git он не попадает — см. `.gitignore`).
## Карта собирается один раз в Studio и правится руками
Лобби и все миры строит модуль `src/ServerScriptService/WorldBuilder.lua` («Тихое озеро» он берёт из `World1Builder.lua`). Порядок:
1. Откройте плейс в Studio и подключите Rojo (**Plugins → Rojo → Connect**).
2. В **Command Bar** выполните:
```lua
require(game.ServerScriptService.WorldBuilder:Clone()).bake()
```
В `Workspace` появится папка `FishingMap` (лобби и миры: детали и модели), а на месте миров — террейн.
3. Сохраните плейс (**Ctrl+S**). Дальше двигайте, удаляйте и добавляйте объекты как обычно, в том числе модели из Toolbox. Игра возьмёт карту из плейса и не будет генерировать её заново.
Повторный `bake()` стирает `FishingMap` и террейн миров и строит всё заново, ручные правки при этом пропадут. Исключение — «Тихое озеро» (`FishingMap/World1Map`): его `bake()` переносит в новую карту как есть, вместе с террейном. Чтобы собрать и его заново, сначала удалите `World1Map`.
Цвета материалов террейна общие на весь плейс, и в нём сохранены цвета «Тихого озера» (зелёный `Snow`). Поэтому в редакторе снег Ледяного фьорда тоже зелёный, а в игре его перекрашивает `terrainColors` мира в `FishConfig.lua`.
NPC в редакторе показаны полупрозрачными фигурами (`NpcSpot`, `World1NpcSeller`, `World1NpcGrandpa`): при запуске на их место встаёт персонаж, имя и цвета берутся из атрибутов детали. Доски с атрибутом `Bestiary` получают список рыб из `FishConfig` при каждом запуске. Не удаляйте маркеры (`LobbySpawn`, `World1Spawn`, `World2Spawn`, `World3Spawn`, `Guide*`), двигать их можно. Если меняете форму озера, поправьте круги `lakes` у мира в `FishConfig.lua`: по ним игра решает, где вода.
После сборки карты `build.ps1` больше не перезаписывает `Fishing.rbxlx`: скрипты приходят через Rojo. Команда `build.ps1 -Force` пересоздаёт плейс с нуля и **стирает** собранную карту.
## Установка в свой плейс без Rojo
1. Откройте плейс в Roblox Studio (например, шаблон **Baseplate**).
+20 -5
View File
@@ -1,5 +1,9 @@
# Builds Fishing.rbxlx (place file for Roblox Studio) and install/* from src/.
# Run: powershell -ExecutionPolicy Bypass -File build.ps1
# Fishing.rbxlx is created only if it does not exist yet: after the map is baked in Studio
# (WorldBuilder) the place file holds the hand-edited map, and scripts reach it via Rojo.
# Use -Force to recreate it from scratch (this DELETES the map built in Studio).
param([switch]$Force)
$root = $PSScriptRoot
$enc = New-Object System.Text.UTF8Encoding($false)
@@ -9,7 +13,10 @@ $scripts = @(
@{ Name = 'GameModels'; Class = 'ModuleScript'; Service = 'ReplicatedStorage'; Path = 'src\ReplicatedStorage\GameModels.lua'; Rbxmx = '2_GameModels_ReplicatedStorage.rbxmx' },
@{ Name = 'MapBuilder'; Class = 'Script'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\MapBuilder.server.lua'; Rbxmx = '3_MapBuilder_ServerScriptService.rbxmx' },
@{ Name = 'GameServer'; Class = 'Script'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\GameServer.server.lua'; Rbxmx = '4_GameServer_ServerScriptService.rbxmx' },
@{ Name = 'FishingClient'; Class = 'LocalScript'; Service = 'StarterPlayerScripts'; Path = 'src\StarterPlayer\StarterPlayerScripts\FishingClient.client.lua'; Rbxmx = '5_FishingClient_StarterPlayerScripts.rbxmx' }
@{ Name = 'World1Builder'; Class = 'ModuleScript'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\World1Builder.lua'; Rbxmx = '6_World1Builder_ServerScriptService.rbxmx' },
@{ Name = 'WorldBuilder'; Class = 'ModuleScript'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\WorldBuilder.lua'; Rbxmx = '7_WorldBuilder_ServerScriptService.rbxmx' },
@{ Name = 'FishingClient'; Class = 'LocalScript'; Service = 'StarterPlayerScripts'; Path = 'src\StarterPlayer\StarterPlayerScripts\FishingClient.client.lua'; Rbxmx = '5_FishingClient_StarterPlayerScripts.rbxmx' },
@{ Name = 'Loading'; Class = 'LocalScript'; Service = 'ReplicatedFirst'; Path = 'src\ReplicatedFirst\Loading.client.lua'; Rbxmx = '8_Loading_ReplicatedFirst.rbxmx' }
)
$header = '<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">'
@@ -30,18 +37,26 @@ function ServiceItem($class, $children) {
$rs = ($scripts | Where-Object { $_.Service -eq 'ReplicatedStorage' } | ForEach-Object { ScriptItem $_ }) -join ''
$sss = ($scripts | Where-Object { $_.Service -eq 'ServerScriptService' } | ForEach-Object { ScriptItem $_ }) -join ''
$sps = ($scripts | Where-Object { $_.Service -eq 'StarterPlayerScripts' } | ForEach-Object { ScriptItem $_ }) -join ''
$rf = ($scripts | Where-Object { $_.Service -eq 'ReplicatedFirst' } | ForEach-Object { ScriptItem $_ }) -join ''
$place = $header + "`n" +
(ServiceItem 'ReplicatedFirst' $rf) +
(ServiceItem 'ReplicatedStorage' $rs) +
(ServiceItem 'ServerScriptService' $sss) +
(ServiceItem 'StarterPlayer' (ServiceItem 'StarterPlayerScripts' $sps)) +
"</roblox>`n"
[System.IO.File]::WriteAllText((Join-Path $root 'Fishing.rbxlx'), $place, $enc)
$placePath = Join-Path $root 'Fishing.rbxlx'
if ($Force -or -not (Test-Path $placePath)) {
[System.IO.File]::WriteAllText($placePath, $place, $enc)
Write-Host "Built Fishing.rbxlx"
} else {
Write-Host "Fishing.rbxlx already exists - left untouched (it holds the map built in Studio; scripts come via Rojo). Use -Force to recreate."
}
# --- install/*.rbxmx and install/INSTALL.lua ---
$installDir = Join-Path $root 'install'
New-Item -ItemType Directory -Force $installDir | Out-Null
$parents = @{ ReplicatedStorage = 'game.ReplicatedStorage'; ServerScriptService = 'game.ServerScriptService'; StarterPlayerScripts = 'game.StarterPlayer.StarterPlayerScripts' }
$parents = @{ ReplicatedStorage = 'game.ReplicatedStorage'; ServerScriptService = 'game.ServerScriptService'; StarterPlayerScripts = 'game.StarterPlayer.StarterPlayerScripts'; ReplicatedFirst = 'game.ReplicatedFirst' }
$sb = New-Object System.Text.StringBuilder
[void]$sb.Append("local function make(class, name, parent, src)`n local old = parent:FindFirstChild(name)`n if old then old:Destroy() end`n local s = Instance.new(class)`n s.Name = name`n s.Source = src`n s.Parent = parent`nend`nlocal oldMap = workspace:FindFirstChild('FishingMap')`nif oldMap then oldMap:Destroy() end`n")
foreach ($s in $scripts) {
@@ -52,7 +67,7 @@ foreach ($s in $scripts) {
$xml = $header + "`n" + (ScriptItem $s) + "</roblox>`n"
[System.IO.File]::WriteAllText((Join-Path $installDir $s.Rbxmx), $xml, $enc)
}
[void]$sb.Append("print('DONE! 5 scripts installed. Press Play (F5).')`n")
[void]$sb.Append("print('DONE! $($scripts.Count) scripts installed. Press Play (F5).')`n")
[System.IO.File]::WriteAllText((Join-Path $installDir 'INSTALL.lua'), $sb.ToString(), $enc)
Write-Host "Built Fishing.rbxlx and install/"
Write-Host "Built install/"
+3
View File
@@ -2,6 +2,9 @@
"name": "Fishing",
"tree": {
"$className": "DataModel",
"ReplicatedFirst": {
"$path": "src/ReplicatedFirst"
},
"ReplicatedStorage": {
"$path": "src/ReplicatedStorage"
},
+135
View File
@@ -0,0 +1,135 @@
# Гильдия рыбаков, экономика и новый стиль интерфейса
Дизайн-документ. Утверждён пользователем 2026-11-04. Фокус — лобби и Мир 1 «Тихое озеро».
Цель: Мир 1 занимает **1,5–3 часа**, каждые 5–10 минут игрок что-то получает, игра не утомляет.
---
## 1. Валюты
| Валюта | Ключ в данных | Откуда | На что |
|---|---|---|---|
| 🪙 **Серебро** (основная) | `coins` (не переименовывать в данных, только в интерфейсе) | продажа рыбы, заказы, задания | удочки, сумки, улучшения, наживка |
| 🦪 **Жемчуг** (редкая) | `pearls` | мутации (Блестящая 1, Золотая 3, Радужная 10), босс 5, ежедневка (7-й день 5), повышение ранга 10, иногда заказы | премиум-наживка, переброс заказов (2), слоты ловушек, позже — зачарования и косметика |
| 📜 **Печати гильдии** (репутация) | `seals` | только заказы гильдии и испытания | копятся для повышения ранга (не тратятся) |
Во всём интерфейсе «монеты/💰» → «серебро/🪙».
---
## 2. Гильдия рыбаков (стержень прогрессии)
Атмосфера — гильдия авантюристов из аниме: ранги-буквы, доска заказов, испытание на ранг, жетон над головой.
### Ранги
| Буква | Ранг | Печатей (всего) | Испытание на ранг | Открывает |
|---|---|---|---|---|
| F | Ученик | 0 | — | Мир 1, доска заказов (3 заказа) |
| E | Подмастерье | 30 | Сдать 5 окуней | **автоловля**, 4-й заказ на доске |
| D | Рыбак | 120 | Поймать «Редкую» рыбу в дождь или грозу | **Мир 2** (+ уровень 8), **ловушки** (1 шт) |
| C | Опытный рыбак | 350 | Нанести урон боссу озера (участие в победе) | ловушки 2 шт, скидка у торговцев 5% |
| B | Мастер | 900 | Собрать коллекцию Мира 1 полностью | **Мир 3** (+ уровень 18), ловушки 3 шт |
| A | Магистр | 2000 | Поймать «Эпическую» ночью | титул «Магистр», скидка 10% |
| S | Легенда | 4500 | Поймать «Мифическую» рыбу | золотой жетон, автоловля без штрафа к редкости |
- Печати копятся → при достаточном количестве у **главы гильдии** берётся **испытание** → после выполнения — церемония: фанфары, конфетти, +10 жемчуга, объявление на сервер «⚔ Игрок X получил ранг D!».
- **Жетон ранга над головой** (BillboardGui): буква в щите цвета ранга (F серый, E зелёный, D синий, C фиолетовый, B красный, A золотой, S радужный).
- Миры теперь требуют **и уровень, и ранг**.
### Глава гильдии (NPC)
Имя: **Старейшина Ворон** — седой рыбак с повязкой на глазу. Реплики с характером (наставник из аниме). Стоит в здании гильдии в лобби.
### Здание гильдии в лобби
Средневековый дом с вывеской «⚓ ГИЛЬДИЯ РЫБАКОВ», знамёна гильдии, **доска заказов** (пергаменты на доске), стол главы. Карта лобби уже собрана в Studio (`Workspace.FishingMap`) — строить в плейсе и сохранить, не ломая существующее лобби (порталы, лавки, фонтан, точки появления).
---
## 3. Заказы гильдии (доска заказов)
- Личные для каждого игрока, **обновляются каждые 3 часа** (по серверному времени, окно `floor(os.time()/10800)`), можно перебросить один заказ за 2 жемчуга.
- 3 заказа на ранге F, 4 — начиная с E.
- Сложность и награда растут с рангом.
Типы заказов:
| Тип | Пример | Как засчитывается |
|---|---|---|
| deliver | «Сдай 5 карасей» | рыба **забирается из сумки** при сдаче у доски |
| heavy | «Принеси окуня тяжелее 1 кг» | забирается из сумки |
| weather | «Поймай 3 рыбы в дождь» | по ходу рыбалки |
| night | «Поймай 2 необычные рыбы ночью» | по ходу |
| combo | «Набери серию из 6» | по ходу |
| perfect | «5 забросов в зелёную зону» | по ходу |
Награда: печати 5–25 (по сложности), серебро, шанс 20% на 1–3 жемчуга.
---
## 4. Наживка
Лавка наживки — у рыбака на причале Мира 1 и в магазине лобби. Один слот наживки, 1 штука тратится на заброс.
| Наживка | Цена | Эффект |
|---|---|---|
| Червь | 🪙 40 за 10 шт | клюёт на 10% быстрее |
| Мотыль | 🪙 90 за 10 шт | удача +15% |
| Светлячок | 🪙 120 за 10 шт | ночью удача +30% (вместо +10%) |
| Кровавая приманка | 🪙 400 за 10 шт, ранг D | редкие и выше чаще (вес ×1.5) |
| Жемчужная блесна | 🦪 5 за 5 шт | шанс мутаций ×2 |
---
## 5. Автоловля (ранг E)
- Кнопка «🎣 Автоловля» (вкл/выкл). Работает, если игрок стоит у воды с удочкой в руках.
- Сервер сам забрасывает и вытаскивает. Штрафы: удача ×0.6, не выше «Редкой», нет бонуса идеального заброса и серии, каждая поимка на 50% дольше.
- Останавливается при полной сумке, при отходе от воды, при смене мира.
- Ранг S снимает ограничение редкости. Позже — пропуск за робуксы «Опытный подмастерье» (без штрафов).
## 6. Ловушки-вентери (ранг D)
- В окне гильдии: 1–3 ловушки (по рангу, + слоты за жемчуг позже).
- Каждая ловушка приносит 1 рыбу Мира 1 (обычные/необычные) каждые 15 минут, максимум 16 рыб (4 часа). **Работает и офлайн.**
- «Забрать улов» переносит рыбу в сумку (сколько влезет).
## 7. Бонус отдыха
- Пока игрока нет, копится «отдых»: 1 минута двойного опыта за каждые 4 минуты офлайн, максимум 60 минут.
- Тратится, пока игрок ловит. Показывается в HUD («🛌 Отдых ×2 опыт: 23 мин»).
## 8. Кривая уровней
- `XPForLevel(level) = floor(50 * level ^ 1.6)` (было `60 + 60*level`).
- Опыт за рыбу не трогаем. До 8 уровня ≈ 3 600 опыта ≈ 1,5–2 часа вместе с заказами.
- Старые сохранения: уровень игрока не понижать.
---
## 9. Новый стиль интерфейса — «средневековая гильдия»
Вайб — тёплое дерево, пергамент, золотые оковки, багровые ленты. Как в топовых рыболовных плейсах (тёмные панели с золотой рамкой), но **в нашем средневековом стиле**.
### Палитра
| Токен | Цвет | Где |
|---|---|---|
| woodDark | 40, 28, 20 | фон окон |
| wood | 66, 46, 30 | панели, карточки |
| woodLight | 98, 70, 44 | кнопки вкладок |
| parchment | 236, 220, 180 | вставки с текстом (свитки), текст на тёмном |
| ink | 52, 36, 24 | текст на пергаменте |
| gold | 218, 172, 92 | рамки, заголовки, цены |
| goldBright | 255, 214, 120 | акценты |
| crimson | 150, 40, 35 | ленты заголовков, «закрыть», опасные кнопки |
| forest | 64, 112, 62 | «купить», «забрать» |
### Элементы
- **Окно**: деревянная панель, золотая рамка в 2 слоя (тёмная + светлая), ромбики-заклёпки по углам, заголовок на **багровой ленте** с золотым текстом, кнопка закрытия — круглая багровая печать «✕».
- **Кнопки**: дерево с золотой окантовкой; основные действия — зелёные «сургучные», опасные — багровые.
- **Карточки**: тёмное дерево, редкость — цветной камень в углу и цветная полоса.
- **Шрифты**: заголовки — с засечками/каллиграфия (проверить, что есть **кириллица**: кандидаты `Merriweather`, `Oswald`, `Nunito`; декоративные — только если кириллица рендерится), текст — читаемый без засечек. Обязательно проверить русский текст в Studio.
- **Иконки** пока эмодзи; позже пользователь нарисует свои (Photopea/Blockbench).
### Телефон (обязательно)
- `UIScale` по размеру экрана (база 1280×720).
- На узком экране (ширина < 900 или TouchEnabled): боковые кнопки — компактная сетка 2×N у левого края или нижняя панель; окна — почти на весь экран; HUD компактнее; ничего не перекрывает кнопку прыжка (правый низ) и меню Roblox (левый верх).
- Проверить в Studio эмуляторе устройств (iPhone SE, Android 16:9) — ничего не наслаивается.
+25
View File
@@ -0,0 +1,25 @@
# Low-poly landscape — 2026-11-03
The baked scene uses flat, matte MaterialVariants for Snow (olive grass), Salt
(ochre paths), and Slate/Rock (cool gray stone). Color and roughness use the
opaque white Roblox built-in `rbxasset://textures/SelfView/whiteRect.png` map;
normal and metalness maps are empty. Geometry supplies the facets.
## Toolbox credits
- **FracturedSkies** — [Low Poly Rock Pack FREE](https://create.roblox.com/store/asset/2128776869), used for shoreline boulders and cliff foot rocks. Credit is also stored on `World1Map.LowPolyRockwork`.
- **DaveCam456** — [Low-Poly Rocky Cliff](https://create.roblox.com/store/asset/11751641277), used for cliff faces.
- **DaveCam456** — [Low-Poly Rocky Mountain Border](https://create.roblox.com/store/asset/11751636142), used for perimeter ridges.
Imported templates are in `ServerStorage.LandscapeAssetLibrary`; only anchored
geometry is copied into the landscape. No imported scripts are used.
## Reapply
`install/LOW_POLY_LANDSCAPE.lua` applies materials and places rock meshes onto an
existing baked World1Map. It requires the above templates in the asset library.
The source palette and the live FishConfig/FishingClient were updated together
so entering World1 does not restore the old grass colors.
Studio changes must be saved with the place. The filesystem build does not
automatically serialize the edited Terrain or imported meshes from Studio.
+112
View File
@@ -0,0 +1,112 @@
# Модели из Toolbox для локации «Тихое озеро»
Подобраны 2026-11-03 по макету. Как отбирал:
- искал через официальный поиск Creator Store;
- брал только **бесплатные модели без скриптов**;
- у модели должно быть **не меньше 8 лайков**, лайков минимум в 4 раза больше, чем дизлайков;
- каждую модель проверил по превью;
- `tri` — число треугольников, чем меньше, тем легче для FPS.
Ссылка на модель: `https://create.roblox.com/store/asset/<ID>`.
## Основной набор (подходят по стилю)
| Элемент макета | Модель | ID | tri | 👍/👎 | Комментарий |
|---|---|---|---|---|---|
| Сосны (лес, задний план) | Low-Poly Pine Trees Asset Pack | 8559395722 | 26 476 (весь пак) | 67/3 | Ярусные мультяшные ёлки, почти как на макете. Основа леса. |
| Лиственные деревья у воды | Yasu's Stylized Tree Pack | 79689531752352 | 40 144 (весь пак) | 400/0 | Самый популярный стилизованный пак. Брать 2–3 вида. |
| Простая ёлка (дальний фон) | Pine Tree Cartoon | 8611822577 | 276 | 9/1 | Очень лёгкая: для дальних рядов леса. |
| Бревенчатый дом | Log cabin | 4696763099 | 4 424 | 18/2 | Дом из брёвен с крыльцом. Крышу перекрасить в тёмно-зелёный, трубу добавить. |
| Лавка рыбака (скупка) | Shop Stand | 16407780460 | 1 752 | 44/6 | Прилавок под навесом с ящиками. Навес перекрасить в зелёно-кремовую полоску. |
| Лавка (вариант с тентом) | tent market stall | 10970560969 | 40 032 | 10/0 | Полосатый тент как на макете, но тяжёлая. |
| Фонарь на столбе | Low poly Street Lantern | 8990192177 | 700 | 99/1 | Столб с висящим фонарём, ровно как у лавки на макете. |
| Сваи с канатом на причале | Rope-Fence | 7845357309 | 1 344 | 10/0 | Деревянный столб с канатом, похож на кнехты с макета. |
| Причал | Realistic Dock | 1902636966 | 1 104 | 36/4 | Деревянные мостки на сваях. Подойдут для правых мостков. Главный причал лучше оставить нашим: к нему привязаны обучение и заброс. |
| Лодка с вёслами | Boat Model | 9617142471 | 6 404 | 166/34 | Деревянная лодка в мультяшном стиле. |
| Лодка (запасной вариант) | boat | 704501925 | 1 372 | 86/14 | Легче, но проще. |
| Водопад | Low Poly Waterfall | 16444908253 | — | 96/4 | Мультяшный голубой водопад, лучшее совпадение со стилем. |
| Арочный мост над водопадом | Wooden Bridge | 11935185367 | 2 923 | 192/8 | Деревянный арочный мост с перилами, как на макете. |
| Смотровая вышка на холме | Fire Lookout Tower | 937377053 | 44 382 | 18/2 | Деревянная вышка с домиком наверху. Тяжёлая, но она одна. Флаг с рыбой добавить отдельно. |
| Валуны у воды | Low Poly Rock Pack [FREE] | 2128776869 | 750 | 19/1 | Лёгкие серые low-poly камни. |
| Скалы / горы на горизонте | Low-Poly Rocky Mountain Border | 11751636142 | 557 | 74/6 | Серые зубчатые скалы. Годятся и для скалы водопада, и для гор за краем мира (крупно, без коллизии). |
| Камыш (рогоз) | Pond Cattail | 216373354 | 924 | 56/4 | Одобрено Roblox (Endorsed). Ставить группами. |
| Тростник | Reeds | 217647458 | 5 712 | 64/6 | Одобрено Roblox (Endorsed). |
| Кувшинки с цветами | lily pad | 13503798787 | 2 493 | 40/0 | Розовые цветы на листьях. |
| Забор вдоль тропинки | Farm Fence | 4831942116 | 804 | 658/42 | Деревянный забор из жердей. |
| Бочки и ящики | Barrels and Crates | 13018691172 | 18 252 | 50/0 | Бочки и ящики к лавке и на причал. |
| Ящик для снастей | Toolbox | 11464827472 | 464 | 10/0 | Ящик с ручкой. Перекрасить в серо-зелёный. |
| Костёр | Campfire | 1084175510 | 372 | 10/0 | Лёгкий, если нужен костёр у домика. |
## Чего в Toolbox нет — делаем сами из деталей
| Элемент | Как сделать |
|---|---|
| Вывеска с силуэтом рыбы над лавкой | Доска + наш `surfaceText` с эмодзи 🐟 или силуэт из 3–4 Part'ов |
| Тёмно-зелёное знамя с белой рыбой (на столбе и на вышке) | Part `Fabric` тёмно-зелёный + `surfaceText("🐟")` |
| Поплавки и воблеры на прилавке | Маленькие шары `ball()` красно-белые, цветные «рыбки» из 2 Part'ов |
| Дым из труб | `ParticleEmitter` с `rbxasset://textures/particles/smoke_main.dds` |
| Тени рыб под водой | Тёмные полупрозрачные силуэты, медленно плавают (из нашего `Models.buildFish`) |
| Пена и брызги у водопада | Белые сплюснутые шары + `ParticleEmitter` |
## Безопасность — важно
- Модели из Toolbox бывают с **бэкдорами** — скрытыми скриптами, через которые чужой человек может управлять игрой. Пример из этого поиска: модель «Low Poly Log» (117538820047265) в описании пишет «No scripts», а внутри у неё 2 скрипта и звук. **Её не брать.**
- Все модели в таблице выше по данным Creator Store **без скриптов**. Скрипт импорта ниже всё равно удаляет любые скрипты из вставленных моделей.
- После вставки загляните в окно **Output**: скрипт напишет, сколько скриптов удалил. Если у модели из таблицы вдруг найдутся скрипты, её лучше не использовать.
## Как перенести модели в проект
Наш плейс `Fishing.rbxlx` пересобирается из `src/`. Если просто вставить модели в Studio и сохранить, при следующей сборке они пропадут. Поэтому порядок такой.
### Шаг 1. Вставить все модели одной командой
Откройте плейс в Studio, вставьте этот код в **Command Bar** (строка внизу) и нажмите **Enter**. Модели появятся в `ServerStorage → Assets`, все скрипты из них будут удалены.
```lua
local ids = {
PinePack = 8559395722, YasuTrees = 79689531752352, PineCartoon = 8611822577,
LogCabin = 4696763099, ShopStand = 16407780460, StreetLantern = 8990192177,
RopePost = 7845357309, SideDock = 1902636966, Rowboat = 9617142471,
Waterfall = 16444908253, Bridge = 11935185367, Lookout = 937377053,
Rocks = 2128776869, Mountains = 11751636142, Cattail = 216373354, Reeds = 217647458,
LilyPad = 13503798787, Fence = 4831942116, BarrelsCrates = 13018691172,
TackleBox = 11464827472, Campfire = 1084175510,
}
local folder = game.ServerStorage:FindFirstChild("Assets") or Instance.new("Folder")
folder.Name = "Assets"
folder.Parent = game.ServerStorage
for name, id in pairs(ids) do
local ok, objs = pcall(function() return game:GetObjects("rbxassetid://" .. id) end)
if ok and objs[1] then
local m = Instance.new("Model")
m.Name = name
for _, o in ipairs(objs) do o.Parent = m end
local removed = 0
for _, d in ipairs(m:GetDescendants()) do
if d:IsA("LuaSourceContainer") then d:Destroy(); removed += 1 end
end
m.Parent = folder
print(("OK %s (%d) скриптов удалено: %d"):format(name, id, removed))
else
warn("НЕ ВСТАВИЛОСЬ", name, id, objs)
end
end
```
### Шаг 2. Посмотреть и выбрать
Перетащите модели из `ServerStorage/Assets` в Workspace и посмотрите вблизи. Неподходящие удалите.
### Шаг 3. Сохранить в проект
Правый клик по папке `Assets` → **Save to File…** → сохраните как `C:\Fishing\assets\Assets.rbxmx` (формат XML, `.rbxmx`). Дальше я:
- подключу этот файл в `build.ps1` и `default.project.json`, чтобы модели попадали в `ServerStorage` при каждой сборке;
- научу `MapBuilder` расставлять копии моделей по локации (вместо части деталей), с перекраской и масштабом под макет.
## Про производительность
Самые тяжёлые модели в списке: вышка (44 тыс. треугольников), тент-лавка (40 тыс.), пак Yasu (40 тыс. на весь пак). Их ставить по одной штуке.
Много копий можно делать только с лёгких моделей: «Pine Tree Cartoon», камни, камыш.
+117 -14
View File
@@ -13,15 +13,42 @@ Config.Worlds = {
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
clock = 14.5, water = Color3.fromRGB(10, 55, 70),
clock = 16.2,
waterY = 0,
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
lakes = { { 0, -15, 62 }, { -42, 8, 34 }, { 44, 2, 36 }, { 0, 22, 30 }, { 48, -50, 22 } }, -- { x, z, радиус } от центра
-- внешний вид только этого мира (применяет клиент при входе, при выходе возвращает как было)
tint = Color3.fromRGB(255, 247, 236),
-- свет и эффекты: свойства Lighting и его эффектов; чего здесь нет, остаётся как в MapBuilder
look = {
lighting = {
Brightness = 2.6, ExposureCompensation = -0.15,
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,
},
-- дымка вдали: 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 },
-- лёгкое размытие дальнего плана
dof = { Enabled = true, FarIntensity = 0.2, FocusDistance = 60, InFocusRadius = 120, NearIntensity = 0 },
},
-- земля мира залита материалом Snow (ровный, без травинок), дорожки — Salt; здесь они перекрашиваются
terrainColors = {
Snow = Color3.fromRGB(127, 163, 63), Salt = Color3.fromRGB(191, 155, 105),
Rock = Color3.fromRGB(132, 139, 155), Slate = Color3.fromRGB(132, 139, 155),
Mud = Color3.fromRGB(78, 110, 92), Sand = Color3.fromRGB(205, 190, 140),
},
},
{
id = "World2", name = "Тропический остров", icon = "🏝", level = 8, mult = 4,
center = Vector3.new(1500, 0, 0), color = Color3.fromRGB(255, 190, 70),
desc = "Бирюзовое море, пальмы и яркая рифовая рыба.",
clock = 13, water = Color3.fromRGB(35, 175, 185),
clock = 13,
waterY = 0,
sea = 119, -- всё дальше этого радиуса от центра — море
},
@@ -29,7 +56,7 @@ Config.Worlds = {
id = "World3", name = "Ледяной фьорд", icon = "❄", level = 18, mult = 12,
center = Vector3.new(-1500, 0, 0), color = Color3.fromRGB(150, 220, 255),
desc = "Рыбалка в лунках среди льдов и северного сияния.",
clock = 18.3, water = Color3.fromRGB(25, 70, 100),
clock = 18.3,
waterY = 1,
lakes = { { 0, 0, 70 }, { -55, 30, 45 }, { 55, -25, 50 }, { 5, -70, 40 } }, -- подо льдом
holes = {
@@ -37,6 +64,9 @@ Config.Worlds = {
{ -45, 15 }, { 55, -25 }, { 75, -5 }, { 40, -50 }, { 5, -75 }, { -15, -60 }, { 25, -80 },
},
holeRadius = 6,
-- цвета террейна общие на весь плейс, а в нём сохранены цвета «Тихого озера» (зелёный Snow) —
-- поэтому снег фьорда задаём явно
terrainColors = { Snow = Color3.fromRGB(205, 212, 228) },
},
{
id = "World4", name = "Вулкан", icon = "🌋", level = 30, mult = 30, soon = true,
@@ -46,6 +76,43 @@ Config.Worlds = {
}
Config.WorldRadius = 260
-- экран загрузки: при входе в игру и при каждом телепорте игрок уже стоит на месте, сцена прогружается
-- и свет локации ставится под ним; картинку видно только после этого (секунды — минимум показа)
Config.Loading = {
firstJoin = 3,
teleport = 2.5,
}
-- лобби: те же поля внешнего вида, что у миров (clock, tint, look, terrainColors); клиент применяет их вне миров
Config.Lobby = {
id = "Lobby",
clock = 16.3, -- предвечернее солнце: тени длиннее, свет теплее
tint = Color3.fromRGB(255, 242, 228),
look = {
lighting = {
Brightness = 2.0, ExposureCompensation = -0.3,
Ambient = Color3.fromRGB(64, 60, 72), OutdoorAmbient = Color3.fromRGB(120, 114, 124),
ColorShift_Top = Color3.fromRGB(255, 224, 186),
EnvironmentDiffuseScale = 0.5, EnvironmentSpecularScale = 0.5,
GlobalShadows = true,
},
-- тёплая дымка: дальние холмы за скалами тонут в ней
atmosphere = {
Density = 0.4, Offset = 0.18, Haze = 1.6, Glare = 0.25,
Color = Color3.fromRGB(222, 212, 204), Decay = Color3.fromRGB(186, 160, 150),
},
color = { Saturation = 0.18, Contrast = 0.14, Brightness = -0.04 },
bloom = { Intensity = 0.3, Size = 24, Threshold = 1.8 },
sunRays = { Intensity = 0.05, Spread = 0.7 },
dof = { Enabled = true, FarIntensity = 0.18, FocusDistance = 55, InFocusRadius = 95, NearIntensity = 0 },
-- мягкий тонмаппинг вместо Retro: светлая плитка и вывески не выгорают в белое
grading = { TonemapperPreset = Enum.TonemapperPreset.Default },
},
terrainColors = {
Grass = Color3.fromRGB(104, 150, 72), Ground = Color3.fromRGB(120, 98, 74), Rock = Color3.fromRGB(140, 126, 130),
},
}
function Config.WorldAt(pos)
for _, w in ipairs(Config.Worlds) do
if not w.soon then
@@ -283,17 +350,53 @@ Config.CollectionRewards = {
}
Config.MasteryCoins = 5000 -- за весь мир (тоже умножается на mult)
---------------------------------------------------------------- задания
-- coins/xp = награда за 1 единицу цели (умножается на цель и уровень игрока)
Config.Quests = {
{ kind = "catch", text = "Поймай %d рыб", goals = { 10, 20, 35 }, coins = 6, xp = 5 },
{ kind = "rare", text = "Поймай %d рыб редкости «Редкая» и выше", goals = { 1, 2, 3 }, coins = 60, xp = 50 },
{ kind = "epic", text = "Поймай эпическую рыбу или реже", goals = { 1 }, coins = 250, xp = 200 },
{ kind = "mutation", text = "Поймай рыбу с мутацией", goals = { 1 }, coins = 200, xp = 150 },
{ kind = "earn", text = "Заработай %d монет на продаже", goals = { 200, 600, 1500 }, coins = 0.25, xp = 0.2 },
{ kind = "perfect", text = "Сделай %d идеальных подсечек (без промаха)", goals = { 5, 10, 15 }, coins = 15, xp = 12 },
---------------------------------------------------------------- цепочки заданий
-- короткие задания идут по очереди: награда сразу, следующее появляется мгновенно.
-- после последнего шага — бонус цепочки и следующая цепочка; каждый новый круг цели растут
-- coins/xp = награда за 1 единицу цели (умножается на цель и уровень игрока);
-- max — потолок цели, byLevel — цель растёт с уровнем игрока;
-- forms — слово после числа для 1 / 2–4 / 5+ (подставляется вместо второго %s)
local FISH, TIMES = { "рыбу", "рыбы", "рыб" }, { "раз", "раза", "раз" }
Config.QuestKinds = {
catch = { text = "Поймай %d %s", forms = FISH, coins = 5, xp = 4 },
uncommon = { text = "Поймай %d %s «Необычная» или реже", forms = FISH, coins = 18, xp = 14 },
rare = { text = "Поймай %d %s «Редкая» или реже", forms = FISH, coins = 60, xp = 50 },
perfect = { text = "Подсеки %d %s без промаха", forms = TIMES, coins = 10, xp = 8 },
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 },
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 },
},
}
Config.QuestSlots = 3
-- ежедневная награда (7 дней по кругу), монеты растут с уровнем
Config.DailyRewards = {
File diff suppressed because it is too large. Load diff
+260 -76
View File
@@ -42,7 +42,7 @@ local function defaultData()
rod = "Basic", rods = { Basic = true }, rodLevels = {},
bag = "Pouch", bags = { Pouch = true },
items = {}, discovered = {}, claimed = {},
quests = {}, daily = { last = 0, streak = 0 },
chain = { index = 1, step = 1, progress = 0, tier = 0 }, daily = { last = 0, streak = 0 },
boostUntil = 0, boostBonus = 0,
totalCaught = 0, nextUid = 1, receipts = {},
}
@@ -169,13 +169,58 @@ local function sendInventory(player)
end
end
---------------------------------------------------------------- цепочки заданий
local function levelMult(data)
return 1 + (data.level - 1) * 0.25
end
local function currentChain(data)
local c = data.chain
local chain = Config.QuestChains[(c.index - 1) % #Config.QuestChains + 1]
return chain, chain.steps[c.step]
end
local function stepGoal(data, step)
local kind = Config.QuestKinds[step[1]]
local g = step[2] * (1 + Config.QuestTierGrowth * data.chain.tier)
if kind.byLevel then
g *= levelMult(data)
end
g = math.ceil(g)
return kind.max and math.min(g, kind.max) or g
end
local function stepReward(data, step, goal)
local kind = Config.QuestKinds[step[1]]
local m = levelMult(data)
return math.max(10, math.floor(kind.coins * goal * m)), math.max(10, math.floor(kind.xp * goal * m))
end
local function chainBonus(data)
local b = Config.ChainBonus
local m = levelMult(data) * (1 + Config.QuestTierGrowth * data.chain.tier)
return math.floor(b.coins * m), math.floor(b.xp * m), b.potion and Config.Find(Config.Potions, b.potion)
end
local function sendQuests(player)
local data = profiles[player]
if not data then
return
end
local chain = currentChain(data)
local steps = {}
for i, st in ipairs(chain.steps) do
local goal = stepGoal(data, st)
local coins, xp = stepReward(data, st, goal)
steps[i] = { kind = st[1], goal = goal, coins = coins, xp = xp }
end
local bCoins, bXp, potion = chainBonus(data)
local t = today()
remote:FireClient(player, "Quests", data.quests, {
remote:FireClient(player, "Quests", {
name = chain.name, round = data.chain.tier + 1, step = data.chain.step, progress = data.chain.progress,
steps = steps, bonus = { coins = bCoins, xp = bXp, potion = potion and potion.name },
}, {
available = data.daily.last < t,
streak = data.daily.streak,
nextStreak = (data.daily.last == t - 1) and (data.daily.streak % 7 + 1) or ((data.daily.last < t) and 1 or data.daily.streak),
@@ -256,79 +301,54 @@ local function applyPotion(data, bonus, duration)
data.boostUntil = math.max(os.time(), data.boostUntil) + duration
end
---------------------------------------------------------------- задания
---------------------------------------------------------------- задания: прогресс цепочки
local function makeQuest(data, exclude)
local pool = {}
for _, q in ipairs(Config.Quests) do
if not exclude[q.kind] then
table.insert(pool, q)
end
-- у старых сохранений вместо цепочки были три случайных задания
local function ensureChain(data)
if type(data.chain) ~= "table" then
data.chain = { index = 1, step = 1, progress = 0, tier = 0 }
end
if #pool == 0 then
pool = Config.Quests
end
local t = pool[rng:NextInteger(1, #pool)]
local goal = t.goals[rng:NextInteger(1, #t.goals)]
local mult = 1 + (data.level - 1) * 0.25
return {
kind = t.kind, goal = goal, progress = 0,
coins = math.max(10, math.floor(t.coins * goal * mult)),
xp = math.max(10, math.floor(t.xp * goal * mult)),
}
data.quests = nil
end
local function ensureQuests(data)
local kinds = {}
for _, q in ipairs(data.quests) do
kinds[q.kind] = true
end
while #data.quests < Config.QuestSlots do
local q = makeQuest(data, kinds)
kinds[q.kind] = true
table.insert(data.quests, q)
end
end
local function questProgress(player, kind, amount)
-- absolute = true: amount — текущее значение (серия), а не прибавка
local function questProgress(player, kind, amount, absolute)
local data = profiles[player]
if not data then
return
end
local changed = false
for _, q in ipairs(data.quests) do
if q.kind == kind and q.progress < q.goal then
q.progress = math.min(q.goal, q.progress + amount)
changed = true
if q.progress >= q.goal then
notify(player, "📜 Задание готово! (Q)", GOLD)
end
end
end
if changed then
sendQuests(player)
end
end
local function claimQuest(player, index)
local data = profiles[player]
local q = data and type(index) == "number" and data.quests[index]
if not q or q.progress < q.goal then
local chain, step = currentChain(data)
if step[1] ~= kind then
return
end
data.coins += q.coins
addXp(player, data, q.xp)
local kinds = {}
for i, other in ipairs(data.quests) do
if i ~= index then
kinds[other.kind] = true
local c = data.chain
c.progress = absolute and math.max(c.progress, amount) or c.progress + amount
local goal = stepGoal(data, step)
if c.progress >= goal then
-- награда сразу, следующий шаг тоже сразу
local coins, xp = stepReward(data, step, goal)
data.coins += coins
addXp(player, data, xp)
remote:FireClient(player, "QuestDone", kind, goal, coins, xp)
c.step += 1
c.progress = 0
if c.step > #chain.steps then
local bCoins, bXp, potion = chainBonus(data)
data.coins += bCoins
addXp(player, data, bXp)
if potion then
applyPotion(data, potion.bonus, potion.duration)
end
remote:FireClient(player, "ChainDone", chain.name, bCoins, bXp, potion and potion.name)
c.index += 1
c.step = 1
if (c.index - 1) % #Config.QuestChains == 0 then
c.tier += 1
end
end
updateStats(player)
end
kinds[q.kind] = true
data.quests[index] = makeQuest(data, kinds)
updateStats(player)
sendQuests(player)
notify(player, ("📜 Награда: +%d 💰 +%d XP"):format(q.coins, q.xp), GREEN)
end
local function claimDaily(player)
@@ -609,6 +629,34 @@ end
local fishing = {}
-- серия улова (на время игры, не сохраняется)
local combo, comboUntil = {}, {}
local function setCombo(player, n)
combo[player] = n
comboUntil[player] = n > 0 and os.time() + Config.Combo.timeout or nil
player:SetAttribute("Combo", n)
player:SetAttribute("ComboEnds", n > 0 and workspace:GetServerTimeNow() + Config.Combo.timeout or nil)
end
local function breakCombo(player)
if (combo[player] or 0) >= 2 then
remote:FireClient(player, "ComboLost", combo[player])
end
setCombo(player, 0)
end
-- босс озера: { world, def, hp, max, dmg = { [player] = урон } }
local boss = nil
local function bossHit(player, world, dmg)
if not boss or boss.hp <= 0 or not world or world.id ~= boss.world.id then
return
end
boss.hp = math.max(0, boss.hp - dmg)
boss.dmg[player] = (boss.dmg[player] or 0) + dmg
workspace:SetAttribute("BossHP", boss.hp)
remote:FireClient(player, "BossHit", dmg)
questProgress(player, "boss", dmg)
end
-- ищем воду по карте мира из FishConfig (не зависит от террейна) в сторону центра ближайшего озера:
-- сначала на дальности, которую задала сила заброса, потом всё дальше от неё
local function findWater(hrp, world, power)
@@ -813,7 +861,7 @@ local function onCast(player, power)
remote:FireClient(player, "CastFail")
return
end
local s = { stage = "casting", fish = fish, tool = tool }
local s = { stage = "casting", fish = fish, tool = tool, perfect = perfect }
fishing[player] = s
-- замах игрок уже сделал, пока держал кнопку (у себя на клиенте); здесь только бросок вперёд
local throw = { windup = 0.15, flight = 0.35 + dist * 0.018, arc = 2 + dist * 0.3, perfect = perfect }
@@ -876,6 +924,7 @@ local function onCast(player, power)
stopFishing(player, false)
remote:FireClient(player, "Escaped")
notify(player, "🐟 Рыба ушла", RED)
breakCombo(player)
end
end)
end
@@ -904,11 +953,18 @@ local function onCatch(player, success, misses)
gripSequence(tool, { { REST_ANGLE, 0.3 } })
remote:FireClient(player, "Escaped")
notify(player, "🐟 Сорвалась!", RED)
breakCombo(player)
return
end
gripSequence(tool, { { 85, 0.15 }, { REST_ANGLE, 0.45 } })
-- серия: каждая рыба подряд дороже и даёт больше опыта
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)
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,
@@ -934,22 +990,26 @@ local function onCatch(player, success, misses)
if fromPos then
showFishFlight(player, fish, fromPos)
end
remote:FireClient(player, "Caught", fish, { new = isNew, record = isRecord })
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)
if rank >= 2 then
questProgress(player, "uncommon", 1)
end
if rank >= 3 then
questProgress(player, "rare", 1)
end
if rank >= 4 then
questProgress(player, "epic", 1)
end
if fish.mutation then
questProgress(player, "mutation", 1)
end
if misses == 0 then
questProgress(player, "perfect", 1)
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
---------------------------------------------------------------- скупка
@@ -1005,6 +1065,7 @@ local function sellItems(player, filterUid)
updateStats(player)
sendInventory(player)
remote:FireClient(player, "Sold", total, count)
questProgress(player, "sell", count)
questProgress(player, "earn", total)
end
@@ -1038,6 +1099,7 @@ local function buy(player, kind, id)
end
updateStats(player)
notify(player, ("✨ %s улучшена до +%d!"):format(rod.name, lvl + 1), GOLD)
questProgress(player, "buy", 1)
return
end
if kind == "Potion" then
@@ -1057,6 +1119,7 @@ local function buy(player, kind, id)
applyPotion(data, potion.bonus, potion.duration)
updateStats(player)
notify(player, ("🍀 +%d%% удачи, %d мин"):format(potion.bonus * 100, potion.duration / 60), GREEN)
questProgress(player, "buy", 1)
return
end
local list, owned
@@ -1071,6 +1134,7 @@ local function buy(player, kind, id)
if not item then
return
end
local bought = false
if not owned[id] then
if data.level < item.level then
notify(player, "🔒 Нужен ур. " .. item.level, RED)
@@ -1082,6 +1146,7 @@ local function buy(player, kind, id)
end
data.coins -= item.price
owned[id] = true
bought = true
notify(player, "✅ " .. item.name, GREEN)
end
if kind == "Rod" then
@@ -1093,10 +1158,19 @@ local function buy(player, kind, id)
attachBag(player)
end
updateStats(player)
if bought then
questProgress(player, "buy", 1)
end
end
---------------------------------------------------------------- телепорт
local TELEPORT_FADE = 0.3 -- сколько клиент затемняет экран перед переносом
local teleporting = {}
Players.PlayerRemoving:Connect(function(p)
teleporting[p] = nil
end)
local function teleportTo(player, worldId)
local data = profiles[player]
local char = player.Character
@@ -1122,10 +1196,18 @@ local function teleportTo(player, worldId)
markerName = world.id .. "Spawn"
end
local map = workspace:FindFirstChild("FishingMap")
local m = map and map:FindFirstChild(markerName)
if m then
local m = map and map:FindFirstChild(markerName, true) -- маркеры могут лежать в папках уровня (World1Map)
if m and not teleporting[player] then
-- клиент затемняет экран, переносим уже в темноте: свет новой локации ставится до того, как её видно
teleporting[player] = true
stopFishing(player, true)
char:PivotTo(m.CFrame + Vector3.new(0, 3, 0))
remote:FireClient(player, "TeleportFade", worldId, TELEPORT_FADE)
task.wait(TELEPORT_FADE)
teleporting[player] = nil
char = player.Character
if char and char.Parent then
char:PivotTo(m.CFrame + Vector3.new(0, 3, 0))
end
end
end
@@ -1215,8 +1297,6 @@ remote.OnServerEvent:Connect(function(player, action, a, b)
teleportTo(player, a)
elseif action == "ClaimCollection" then
claimCollection(player, a, b)
elseif action == "ClaimQuest" then
claimQuest(player, a)
elseif action == "ClaimDaily" then
claimDaily(player)
elseif action == "RequestInventory" then
@@ -1304,6 +1384,105 @@ task.spawn(function()
end
end)
---------------------------------------------------------------- босс озера
local function playerWorld(p)
local hrp = p.Character and p.Character:FindFirstChild("HumanoidRootPart")
return hrp and Config.WorldAt(hrp.Position)
end
local function setBossAttrs()
workspace:SetAttribute("BossWorld", boss and boss.world.id or nil)
workspace:SetAttribute("BossName", boss and boss.def.name or nil)
workspace:SetAttribute("BossHP", boss and boss.hp or nil)
workspace:SetAttribute("BossMax", boss and boss.max or nil)
workspace:SetAttribute("BossEnds", boss and boss.ends or nil)
end
local function finishBoss(won)
local b = boss
boss = nil
setBossAttrs()
local helpers, best, bestDmg = 0, nil, 0
for p, d in pairs(b.dmg) do
if p.Parent then
helpers += 1
if d > bestDmg then
best, bestDmg = p, d
end
end
end
if not won then
for _, p in ipairs(Players:GetPlayers()) do
remote:FireClient(p, "BossDone", false, b.def.name)
end
return
end
local R = Config.Boss.reward
local fair = b.max / math.max(1, helpers) -- «честная доля» урона на одного
local potion = R.potion and Config.Find(Config.Potions, R.potion)
for p, d in pairs(b.dmg) do
local data = p.Parent and profiles[p]
if data then
local share = 0.4 + 0.6 * math.min(1, d / fair)
local coins = math.floor(R.coins * b.world.mult * share * levelMult(data))
local xp = math.floor(R.xp * b.world.mult * share)
data.coins += coins
addXp(p, data, xp)
if potion then
applyPotion(data, potion.bonus, potion.duration)
end
updateStats(p)
remote:FireClient(p, "BossReward", coins, xp, potion and potion.name)
end
end
for _, p in ipairs(Players:GetPlayers()) do
remote:FireClient(p, "BossDone", true, b.def.name, best and best.DisplayName, bestDmg)
end
end
task.spawn(function()
task.wait(Config.Boss.firstDelay)
while true do
-- мир, где сейчас больше всего игроков
local counts = {}
for _, p in ipairs(Players:GetPlayers()) do
local w = playerWorld(p)
if w and Config.Boss.worlds[w.id] then
counts[w.id] = (counts[w.id] or 0) + 1
end
end
local bestId, n = nil, 0
for id, c in pairs(counts) do
if c > n then
bestId, n = id, c
end
end
if not bestId then
task.wait(30) -- никого нет в мирах: попробуем позже
else
local world = Config.Find(Config.Worlds, bestId)
local max = Config.Boss.hpPerPlayer * n
boss = {
world = world, def = Config.Boss.worlds[bestId], hp = max, max = max, dmg = {},
ends = workspace:GetServerTimeNow() + Config.Boss.duration,
}
setBossAttrs()
for _, p in ipairs(Players:GetPlayers()) do
remote:FireClient(p, "BossStart", boss.def.name, world.icon .. " " .. world.name)
end
local t0 = os.clock()
while boss and boss.hp > 0 and os.clock() - t0 < Config.Boss.duration do
task.wait(0.25)
end
if boss then
finishBoss(boss.hp <= 0)
end
task.wait(Config.Boss.interval)
end
end
end)
---------------------------------------------------------------- игроки
local function onPlayerAdded(player)
@@ -1321,7 +1500,7 @@ local function onPlayerAdded(player)
return
end
loadPasses(player)
ensureQuests(data)
ensureChain(data)
profiles[player] = data
loadedOk[player] = ok
updateStats(player)
@@ -1348,6 +1527,7 @@ end
Players.PlayerRemoving:Connect(function(player)
stopFishing(player, false)
combo[player], comboUntil[player] = nil, nil
saveData(player)
profiles[player] = nil
loadedOk[player] = nil
@@ -1371,6 +1551,10 @@ task.spawn(function()
if data and data.boostUntil > os.time() - 2 then
updateStats(p)
end
-- серия сгорает, если долго нет улова (пока рыба на крючке — ждём)
if comboUntil[p] and os.time() > comboUntil[p] and not fishing[p] then
breakCombo(p)
end
end
if t % 60 == 0 then
for _, p in ipairs(Players:GetPlayers()) do
@@ -334,7 +334,8 @@ 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"):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
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()
@@ -505,7 +506,7 @@ end
---------------------------------------------------------------- данные с сервера
local inventory, discovered, claimed = {}, {}, {}
local quests, daily = {}, { available = false, streak = 0, nextStreak = 1 }
local chain, daily = nil, { available = false, streak = 0, nextStreak = 1 }
---------------------------------------------------------------- магазин
@@ -893,35 +894,55 @@ local questWin = makeWindow("📜 Задания", Color3.fromRGB(200, 140, 40),
local questList = scrollArea(questWin.pages.quests)
local dailyPage = questWin.pages.daily
local function questText(q)
local t = Config.Quests[1]
for _, def in ipairs(Config.Quests) do
if def.kind == q.kind then
t = def
end
local function questText(kind, goal)
local t = Config.QuestKinds[kind]
if not t then
return kind
end
return string.find(t.text, "%%d") and t.text:format(q.goal) or t.text
if t.forms then
local m10, m100 = goal % 10, goal % 100
local i = (m10 == 1 and m100 ~= 11) and 1 or ((m10 >= 2 and m10 <= 4 and (m100 < 12 or m100 > 14)) and 2 or 3)
return t.text:format(goal, t.forms[i])
end
return string.find(t.text, "%%d") and t.text:format(goal) or t.text
end
questWin.render = function(tab)
if tab == "quests" then
clear(questList)
text({ Size = UDim2.new(1, -4, 0, 30), LayoutOrder = 0, Font = BODY2, TextSize = 14, TextColor3 = C.muted, Text = "Выполняй задания — после награды появится новое.", Parent = questList })
for i, q in ipairs(quests) do
local done = q.progress >= q.goal
local row = new("Frame", { Size = UDim2.new(1, -4, 0, 92), BackgroundColor3 = WHITE, LayoutOrder = i, Parent = questList },
{ corner(14), stroke(done and C.green or C.line, 2, done and 0 or 0.45), gradient(C.panel2, C.panel, 90) })
text({ Size = UDim2.new(1, -190, 0, 28), Position = UDim2.fromOffset(16, 8), Font = TITLE, TextSize = 19, Text = questText(q), TextTruncate = Enum.TextTruncate.AtEnd, Parent = row })
progressBar(row, UDim2.fromOffset(16, 42), UDim2.new(1, -200, 0, 14), q.progress / q.goal, done and C.green or C.gold)
text({ Size = UDim2.new(1, -190, 0, 20), Position = UDim2.fromOffset(16, 62), Font = BODY2, TextSize = 13, TextColor3 = C.muted, RichText = true,
Text = ("%s / %s · <font color=\"#FFD45A\">+%s 💰 +%s XP</font>"):format(fmt(q.progress), fmt(q.goal), fmt(q.coins), fmt(q.xp)), Parent = row })
btn({
Size = UDim2.fromOffset(150, 46), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -12, 0.5, 0),
BackgroundColor3 = done and C.green or C.grey, AutoButtonColor = done, Text = done and "🎁 Забрать" or "В процессе", TextSize = 18, Parent = row,
}, done and function()
remote:FireServer("ClaimQuest", i)
end or nil)
if not chain then
return
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,
})
for i, st in ipairs(chain.steps) do
local done, cur = i < chain.step, i == chain.step
local row = new("Frame", { Size = UDim2.new(1, -4, 0, cur and 84 or 56), BackgroundColor3 = WHITE, LayoutOrder = i, Parent = questList },
{ corner(14), stroke(cur and C.gold or (done and C.green or C.line), cur and 3 or 2, (cur or done) and 0 or 0.5), gradient(cur and Color3.fromRGB(70, 60, 30) or C.panel2, C.panel, 90) })
text({
Size = UDim2.new(1, -200, 0, 28), Position = UDim2.fromOffset(16, cur and 8 or 14), Font = TITLE, TextSize = 19,
TextColor3 = (done or cur) and C.text or C.muted, Text = (done and "✅ " or (cur and "▶ " or "🔒 ")) .. questText(st.kind, st.goal),
TextTruncate = Enum.TextTruncate.AtEnd, Parent = row,
})
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,
})
if cur then
progressBar(row, UDim2.fromOffset(16, 44), UDim2.new(1, -110, 0, 16), chain.progress / st.goal, C.gold)
text({ Size = UDim2.fromOffset(80, 20), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -14, 0, 42), Font = TITLE, TextSize = 16,
TextXAlignment = Enum.TextXAlignment.Right, Text = ("%s / %s"):format(fmt(chain.progress), fmt(st.goal)), Parent = row })
end
end
local b = chain.bonus
local row = new("Frame", { Size = UDim2.new(1, -4, 0, 56), BackgroundColor3 = WHITE, LayoutOrder = 100, Parent = questList },
{ 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,
})
elseif tab == "daily" then
clear(dailyPage)
local myLevel = player:GetAttribute("Level") or 1
@@ -1008,13 +1029,8 @@ sideButton(5, "💎", "Донат", nil, Color3.fromRGB(150, 80, 210), function(
end)
local function refreshDots()
local q = false
for _, quest in ipairs(quests) do
if quest.progress >= quest.goal then
q = true
end
end
sideDots["Задания"].Visible = q or daily.available
-- задания цепочки награждаются сами, точка — только для ежедневной награды
sideDots["Задания"].Visible = daily.available
local c = false
for _, w in ipairs(Config.Worlds) do
local zone = Config.Zones[w.id]
@@ -1537,33 +1553,237 @@ local snow = new("ParticleEmitter", {
})
local lastWorldId = "none"
local terrain = workspace.Terrain
local defaultWater = Color3.fromRGB(10, 55, 70)
local function applyAmbience(world)
-- то, что мир может поменять под себя (оттенок, цвета травы и песка); вода не трогается — она из свойств Terrain
local DEFAULT_LOOK = { tint = Color3.new(1, 1, 1) }
local defaultTerrainColors = nil
-- world.look: свет и эффекты мира; при выходе свойства возвращаются к тем, что были до первого входа
local lookTargets = {
lighting = function() return Lighting end,
atmosphere = function() return Lighting:FindFirstChildOfClass("Atmosphere") end,
color = function() return Lighting:FindFirstChildOfClass("ColorCorrectionEffect") end,
bloom = function() return Lighting:FindFirstChildOfClass("BloomEffect") end,
sunRays = function() return Lighting:FindFirstChildOfClass("SunRaysEffect") end,
dof = function()
return Lighting:FindFirstChildOfClass("DepthOfFieldEffect")
or new("DepthOfFieldEffect", { Enabled = false, Parent = Lighting })
end,
grading = function() return Lighting:FindFirstChildOfClass("ColorGradingEffect") end,
}
local lookDefaults = {}
-- лобби настраивается так же, как миры
local lookSources = table.clone(Config.Worlds)
table.insert(lookSources, Config.Lobby)
-- смена света: плавно или сразу (за экраном загрузки)
local lookTweens = {}
local function setLook(obj, goal, instant)
if instant then
for prop, v in pairs(goal) do
obj[prop] = v
end
else
local tw = TweenService:Create(obj, TweenInfo.new(2), goal)
table.insert(lookTweens, tw)
tw:Play()
end
end
local function applyLook(world, instant)
-- исходные значения запоминаем до первой правки; эффект мог ещё не прийти с сервера, тогда в следующий раз
for _, w in ipairs(lookSources) do
for section, props in pairs(w.look or {}) do
local obj = lookTargets[section] and lookTargets[section]()
if obj then
lookDefaults[section] = lookDefaults[section] or {}
for prop in pairs(props) do
if lookDefaults[section][prop] == nil then
lookDefaults[section][prop] = obj[prop]
end
end
end
end
end
local look = (world and world.look) or {}
for section, defaults in pairs(lookDefaults) do
local obj = lookTargets[section]()
if obj then
local goal = {}
for prop, def in pairs(defaults) do
local v = look[section] and look[section][prop]
if v == nil then v = def end
-- плавно меняются только числа и цвета; флаги и режимы (EnumItem) ставим сразу
local kind = typeof(v)
if kind == "number" or kind == "Color3" then goal[prop] = v else obj[prop] = v end
end
setLook(obj, goal, instant)
end
end
end
local function applyAmbience(world, instant)
-- прошлая плавная смена ещё может идти — она перебила бы новые значения
for _, tw in ipairs(lookTweens) do
tw:Cancel()
end
table.clear(lookTweens)
world = world or Config.Lobby
local clock = (world and world.clock) or 14.5
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
terrain.WaterColor = (world and world.water) or defaultWater
setLook(Lighting, { ClockTime = clock }, instant)
local cc = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
if cc then
setLook(cc, { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }, instant)
end
-- цвета материалов террейна общие для всей карты, поэтому меняем их только у себя и возвращаем при выходе
if not defaultTerrainColors then
defaultTerrainColors = {}
for _, name in ipairs({ "Snow", "Salt", "Mud", "Sand", "Rock", "Slate", "Grass", "Ground" }) do
defaultTerrainColors[name] = terrain:GetMaterialColor(Enum.Material[name])
end
end
local colors = (world and world.terrainColors) or {}
for name, def in pairs(defaultTerrainColors) do
terrain:SetMaterialColor(Enum.Material[name], colors[name] or def)
end
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
if atm then
local frost = world and world.id == "World3"
TweenService:Create(atm, TweenInfo.new(2), {
setLook(atm, {
Density = frost and 0.38 or 0.25,
Color = frost and Color3.fromRGB(170, 200, 235) or Color3.fromRGB(200, 215, 232),
}):Play()
}, instant)
end
applyLook(world, instant)
snow.Rate = (world and world.id == "World3") and 140 or 0
end
-- тёмные силуэты рыб под прозрачной водой «Тихого озера», медленно плавают по кругу (только у этого игрока)
do
local w1 = Config.Worlds[1]
local fishList = Config.Zones.World1.fish
local frng = Random.new(11)
local folder = new("Folder", { Name = "FishShadows", Parent = workspace })
local swimmers = {}
for i = 1, 10 do
local l = w1.lakes[(i - 1) % #w1.lakes + 1]
local ok, model = pcall(Models.buildFish, fishList[(i - 1) % #fishList + 1].id, nil, frng:NextNumber(1.3, 2), true)
if ok and model then
for _, d in ipairs(model:GetDescendants()) do
if d:IsA("BasePart") then
d.Color = Color3.fromRGB(22, 70, 74)
d.Material = Enum.Material.SmoothPlastic
d.Transparency = 0.5
d.CanCollide, d.CanQuery, d.CanTouch, d.CastShadow = false, false, false, false
elseif d:IsA("Decal") or d:IsA("ParticleEmitter") or d:IsA("Light") then
d:Destroy()
end
end
model.Parent = folder
table.insert(swimmers, {
model = model,
c = w1.center + Vector3.new(l[1] + frng:NextNumber(-l[3], l[3]) * 0.25, w1.waterY - frng:NextNumber(1.4, 2.4), l[2] + frng:NextNumber(-l[3], l[3]) * 0.25),
r = l[3] * frng:NextNumber(0.25, 0.55), a = frng:NextNumber(0, math.pi * 2),
w = frng:NextNumber(0.08, 0.18) * (frng:NextNumber() < 0.5 and -1 or 1),
})
end
end
local acc = 0
RunService.Heartbeat:Connect(function(dt)
acc += dt
if acc < 1 / 30 then
return
end
local step = acc
acc = 0
local w = currentWorld()
if not (w and w.id == "World1") then
return
end
for _, s in ipairs(swimmers) do
s.a += s.w * step
local pos = s.c + Vector3.new(math.cos(s.a) * s.r, math.sin(s.a * 3) * 0.2, math.sin(s.a) * s.r)
local dir = Vector3.new(-math.sin(s.a), 0, math.cos(s.a)) * math.sign(s.w)
-- голова рыбы смотрит в +X модели, поэтому разворачиваем на 90°
s.model:PivotTo(CFrame.lookAt(pos, pos + dir) * CFrame.Angles(0, math.rad(90), 0))
end
end)
end
-- экран загрузки (ReplicatedFirst/Loading): при входе и телепорте свет локации ставится, пока он закрывает картинку
local loadingGui = player:WaitForChild("PlayerGui"):WaitForChild("LoadingScreen", 10)
local function loadingVisible()
return loadingGui ~= nil and loadingGui.Enabled
end
local function placeTitle(w)
return w and (w.icon .. " " .. w.name) or "🏠 Лобби"
end
local function enterWorld(w, instant)
lastWorldId = w and w.id or "lobby"
applyAmbience(w, instant)
if w then
-- название локации — когда экран загрузки уже ушёл
task.spawn(function()
while loadingVisible() do
task.wait(0.1)
end
notify(w.icon .. " " .. w.name, w.color)
end)
end
end
-- первое появление: ждём персонажа, ставим свет его локации сразу и отпускаем экран загрузки
task.spawn(function()
local char = player.Character or player.CharacterAdded:Wait()
char:WaitForChild("HumanoidRootPart", 30)
local w = currentWorld()
enterWorld(w, true)
if loadingGui then
loadingGui:SetAttribute("Title", placeTitle(w))
loadingGui:SetAttribute("Ready", true)
end
end)
-- телепорт: экран загрузки закрывает картинку, сервер переносит персонажа, свет новой локации ставится сразу
local teleportToken = 0
local function teleportLoading(targetId, delay)
teleportToken += 1
local token = teleportToken
local target = Config.Find(Config.Worlds, targetId)
if loadingGui then
local now = os.clock()
loadingGui:SetAttribute("Ready", false)
loadingGui:SetAttribute("StartAt", now)
loadingGui:SetAttribute("MinUntil", now + Config.Loading.teleport)
loadingGui:SetAttribute("Title", placeTitle(target))
loadingGui:SetAttribute("Visible", true)
end
task.spawn(function()
-- ждём, пока персонаж окажется в новой локации (или сдаёмся через пару секунд)
local deadline = os.clock() + delay + 3
local w
repeat
task.wait()
w = currentWorld()
until (w and w.id or "Lobby") == targetId or os.clock() > deadline or token ~= teleportToken
if token ~= teleportToken then
return
end
enterWorld(w, true)
if loadingGui then
loadingGui:SetAttribute("Ready", true)
end
end)
end
task.spawn(function()
while true do
local w = currentWorld()
local id = w and w.id or "lobby"
if id ~= lastWorldId then
lastWorldId = id
applyAmbience(w)
if w then
notify(w.icon .. " " .. w.name, w.color)
end
if id ~= lastWorldId and lastWorldId ~= "none" and not loadingVisible() then
enterWorld(w, false) -- без телепорта (например, после возрождения): плавно
end
local cam = workspace.CurrentCamera
if cam then
@@ -1587,7 +1807,6 @@ end)
-- белые «стрелки» бегут по земле от игрока к цели текущего шага (см. Config.TutorialDone)
local GUIDE_N, GUIDE_GAP, GUIDE_SPEED = 32, 3, 7 -- сколько стрелок, шаг между ними, скорость бега
local W1 = Config.Worlds[1].center
local guideStep = 0 -- шаг, отправленный на сервер (атрибут Tutorial может прийти чуть позже)
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
@@ -1645,14 +1864,15 @@ end
local function guideMarker(name)
local map = workspace:FindFirstChild("FishingMap")
local m = map and map:FindFirstChild(name)
local m = map and map:FindFirstChild(name, true) -- маркеры могут лежать в папках уровня (World1Map)
return m and m.Position
end
-- объект цели подсвечивается голубым (атрибут GuideTarget ставит MapBuilder)
-- объект цели обводится мягким светящимся контуром (атрибут GuideTarget ставит MapBuilder);
-- Occluded: то, что стоит перед объектом (персонаж на мостике), не перекрашивается
local guideHighlight = new("Highlight", {
FillColor = Color3.fromRGB(70, 195, 255), OutlineColor = Color3.fromRGB(170, 235, 255),
DepthMode = Enum.HighlightDepthMode.AlwaysOnTop, Enabled = false, Parent = guideFolder,
FillColor = Color3.fromRGB(150, 225, 255), OutlineColor = Color3.fromRGB(190, 240, 255),
DepthMode = Enum.HighlightDepthMode.Occluded, Enabled = false, Parent = guideFolder,
})
local guideObjects, guideScanAt = {}, {}
local function guideObject(key)
@@ -1766,6 +1986,25 @@ closeBoardView = function()
advanceTutorial(1)
end
-- скупка «Тихого озера»: ведём к прилавку с подсказкой «Продать» внутри лавки (GuideTarget = "Sell"),
-- поэтому стрелка идёт за лавкой, куда бы её ни переставили; маркер GuideSell — запасной вариант
local function sellTargetW1()
local shop = guideObject("Sell")
if shop then
for _, d in ipairs(shop:GetDescendants()) do
if d:IsA("ProximityPrompt") and d:GetAttribute("Action") == "Sell" then
local p = d.Parent
local at = (p:IsA("BasePart") and p.Position) or (p:IsA("Attachment") and p.WorldPosition)
if at then
return at
end
end
end
return shop:IsA("Model") and shop:GetPivot().Position or shop.Position
end
return guideMarker("GuideSell")
end
-- маршрут для текущего шага: точки ломаной (без игрока), подсказка и что подсветить; nil — линию не показываем
local function guideRoute(step, pos, world)
local inW1 = world and world.id == "World1"
@@ -1776,22 +2015,50 @@ local function guideRoute(step, pos, world)
elseif step == 2 and inW1 then
return { guideMarker("GuideFishSpot") }, "🎣 Зажми ЛКМ у воды", "Pier"
elseif step == 3 and inW1 then
local route = {}
local rel = pos - W1
if math.abs(rel.X) < 6 and rel.Z < 80 then
table.insert(route, W1 + Vector3.new(0, 4.5, 84)) -- сначала сойти с причала
end
table.insert(route, guideMarker("GuideSell"))
return route, "💰 Продай рыбу", "Sell"
return { sellTargetW1() }, "💰 Продай рыбу", "Sell" -- лавка у самого причала, идём напрямую
end
return nil
end
-- ближайшая скупка в этом мире (или в лобби): прилавки с ProximityPrompt Action = "Sell"
local nearestSell
do
local sellSpots, sellScanAt = {}, -math.huge
nearestSell = function(pos, world)
if #sellSpots == 0 and os.clock() - sellScanAt > 3 then
sellScanAt = os.clock()
local map = workspace:FindFirstChild("FishingMap")
for _, d in ipairs(map and map:GetDescendants() or {}) do
if d:IsA("ProximityPrompt") and d:GetAttribute("Action") == "Sell" then
local p = d.Parent
local at = (p:IsA("BasePart") and p.Position) or (p:IsA("Attachment") and p.WorldPosition) or (p:IsA("Model") and p:GetPivot().Position)
if at then
table.insert(sellSpots, at)
end
end
end
end
local best, bestD = nil, nil
for _, at in ipairs(sellSpots) do
if Config.WorldAt(at) == world then
local d = (at - pos).Magnitude
if not bestD or d < bestD then
best, bestD = at, d
end
end
end
return best
end
end
RunService.RenderStepped:Connect(function()
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
local step = tutorialStep()
-- пока сервер не прислал шаг (данные ещё грузятся), ничего не показываем
if not hrp or player:GetAttribute("Tutorial") == nil or step >= Config.TutorialDone then
-- пока сервер не прислал шаг (данные ещё грузятся), обучение не показываем;
-- после обучения линия ведёт к скупщику, когда сумка полна
local tutorialOn = player:GetAttribute("Tutorial") ~= nil and step < Config.TutorialDone
local bagFull = (player:GetAttribute("BagCount") or 0) >= (player:GetAttribute("BagCap") or math.huge)
if not hrp or not (tutorialOn or bagFull) then
guideHint.Visible = false
guideHighlight.Enabled = false
hideChevrons(1)
@@ -1807,7 +2074,9 @@ RunService.RenderStepped:Connect(function()
local world = Config.WorldAt(pos)
-- переходы между шагами
if step <= 1 and world and world.id == "World1" then
if not tutorialOn then
-- обучение пройдено, остаётся только дорога к скупщику
elseif step <= 1 and world and world.id == "World1" then
advanceTutorial(2)
elseif step == 0 then
local board = guideMarker("GuideBoard")
@@ -1824,7 +2093,15 @@ RunService.RenderStepped:Connect(function()
end
step = tutorialStep()
local route, hint, key = guideRoute(step, pos, world)
local route, hint, key
if tutorialOn then
route, hint, key = guideRoute(step, pos, world)
end
if not route and bagFull then
local inW1 = world and world.id == "World1"
local at = (inW1 and sellTargetW1()) or nearestSell(pos, world)
route, hint, key = at and { at } or nil, "🎒 Сумка полна — продай рыбу!", inW1 and "Sell" or nil
end
guideHintText.Text = hint or ""
local showHint = hint ~= nil and state == "idle"
if showHint and (hint ~= lastHint or not guideHint.Visible) then
@@ -1837,8 +2114,8 @@ RunService.RenderStepped:Connect(function()
guideHighlight.Enabled = target ~= nil
if target then
local pulse = (math.sin(os.clock() * 4) + 1) / 2 -- мягкое мигание
guideHighlight.FillTransparency = 0.45 + 0.3 * pulse
guideHighlight.OutlineTransparency = 0.3 * pulse
guideHighlight.FillTransparency = 0.86 + 0.1 * pulse -- лёгкое «дыхание», цвет объекта виден
guideHighlight.OutlineTransparency = 0.1 + 0.45 * pulse
end
if not route or #route == 0 or state ~= "idle" then
hideChevrons(1)
@@ -1891,11 +2168,369 @@ RunService.RenderStepped:Connect(function()
end
end)
---------------------------------------------------------------- цели на экране: серия, трекер, босс, покупка у скупщика
-- в отдельной функции: у основного скрипта почти исчерпан лимит в 200 локальных переменных
local refreshTracker, bestOffer, showOffer
local offerState = { bagWasFull = false } -- была ли сумка полной перед продажей (тогда первым предлагаем сумку побольше)
;(function()
local CENTER = Enum.TextXAlignment.Center
local RIGHT = Enum.TextXAlignment.Right
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,
}, { 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 comboFill = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = FIRE, BorderSizePixel = 0, Parent = comboBack }, { corner(3) })
local function refreshCombo(pop)
local n = player:GetAttribute("Combo") or 0
comboBox.Visible = n > 0
if n > 0 then
-- множитель следующей рыбы (сервер считает так же)
comboMultText.Text = ("🔥 x%.1f"):format(math.min(Config.Combo.max, 1 + Config.Combo.step * n))
comboSub.Text = ("серия %d · не упусти!"):format(n)
if pop then
popIn(comboBox, 0.6)
end
end
end
player:GetAttributeChangedSignal("Combo"):Connect(function()
refreshCombo(true)
end)
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,
}, { new("UIListLayout", { Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
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 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 })
local tracker = new("Frame", { Size = UDim2.fromOffset(300, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundColor3 = WHITE, LayoutOrder = 2, Parent = rightCol }, {
corner(14), stroke(C.line, 2, 0.35), gradient(C.panel2, C.bg, 90),
new("UIPadding", { PaddingLeft = UDim.new(0, 12), PaddingRight = UDim.new(0, 12), PaddingTop = UDim.new(0, 8), PaddingBottom = UDim.new(0, 10) }),
new("UIListLayout", { Padding = UDim.new(0, 6), SortOrder = Enum.SortOrder.LayoutOrder }),
})
text({ Size = UDim2.new(1, 0, 0, 20), LayoutOrder = 0, Font = TITLE, TextSize = 16, TextColor3 = C.muted, Text = "🎯 Цели", Parent = tracker })
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 fill = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = C.gold, BorderSizePixel = 0, Parent = back }, { corner(4) })
if onClick then
root.MouseButton1Click:Connect(onClick)
end
return { root = root, label = label, back = back, fill = fill }
end
local function setLine(line, txt, frac, color)
line.root.Visible = txt ~= nil
if not txt then
return
end
line.label.Text = txt
line.back.Visible = frac ~= nil
line.root.Size = UDim2.new(1, 0, 0, frac and 38 or 22)
if frac then
line.fill.Size = UDim2.fromScale(math.clamp(frac, 0, 1), 1)
line.fill.BackgroundColor3 = color or C.gold
end
end
local questLine = trackerLine(1, function()
questWin.open("quests")
end)
local buyLine = trackerLine(2, function()
shopWin.open("rods")
end)
local dexLine = trackerLine(3, function()
bagWin.open("dex")
end)
local bagLine = trackerLine(4, function()
bagWin.open("fish")
end)
local function plural(n, one, few, many)
local m10, m100 = n % 10, n % 100
if m10 == 1 and m100 ~= 11 then
return one
elseif m10 >= 2 and m10 <= 4 and (m100 < 12 or m100 > 14) then
return few
end
return many
end
-- ближайшая покупка: следующая удочка, а когда все куплены — улучшение текущей
local function buyGoal()
local coins, lvl = player:GetAttribute("Coins") or 0, player:GetAttribute("Level") or 1
local owned = attrSet("OwnedRods")
for _, r in ipairs(Config.Rods) do
if not owned[r.id] then
if lvl < r.level then
return ("🎣 %s · 🔒 нужен ур. %d"):format(r.name, r.level), lvl / r.level, C.blue
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
end
end
local rod = Config.Find(Config.Rods, player:GetAttribute("Rod") or "Basic")
local rl = player:GetAttribute("RodLevel") or 0
if rod and rl < Config.RodUpgrade.maxLevel then
local cost = Config.UpgradeCost(rod, rl)
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
end
return nil
end
-- коллекция текущего мира: ближайшая незакрытая редкость
local function dexGoal()
local w = currentWorld() or Config.Worlds[1]
local zone = Config.Zones[w.id]
if not zone then
return nil
end
for _, rarity in ipairs(Config.RarityOrder) do
local total, found, missing = 0, 0, {}
for _, f in ipairs(zone.fish) do
if f.rarity == rarity then
total += 1
if discovered[f.id] then
found += 1
else
table.insert(missing, f.name)
end
end
end
if total > 0 and not claimed[w.id .. ":" .. rarity] then
local r = Config.Rarities[rarity]
if found >= total then
return ("📖 Награда за «%s» ждёт! (C)"):format(r.name), 1, C.green
end
local left = total - found
local what = left == 1 and ("осталась <b>%s</b>"):format(missing[1]) or ("ещё %d %s"):format(left, plural(left, "вид", "вида", "видов"))
return ("📖 «%s»: %s"):format(r.name, what), found / total, r.color
end
end
return nil
end
local lastQuestKey = nil
refreshTracker = function()
if chain and chain.steps[chain.step] then
local st = chain.steps[chain.step]
setLine(questLine, ("📜 %s · <b>%s/%s</b>"):format(questText(st.kind, st.goal), fmt(chain.progress), fmt(st.goal)), chain.progress / st.goal, C.gold)
local key = chain.name .. chain.step
if key ~= lastQuestKey then
if lastQuestKey then
popIn(questLine.root, 0.6)
end
lastQuestKey = key
end
else
setLine(questLine, nil)
end
setLine(buyLine, buyGoal())
setLine(dexLine, dexGoal())
local count, cap = player:GetAttribute("BagCount") or 0, player:GetAttribute("BagCap") or 10
if count >= cap then
setLine(bagLine, ("<font color=\"#FF8080\">🎒 Сумка полна — продай рыбу!</font>"), 1, C.red)
elseif count >= cap * 0.75 then
setLine(bagLine, ("🎒 Сумка почти полна: %d / %d"):format(count, cap), count / cap, Color3.fromRGB(255, 170, 80))
else
setLine(bagLine, nil)
end
end
task.spawn(function()
while true do
refreshTracker()
task.wait(0.5)
end
end)
-- босс: полоска здоровья и таймер
local function bossWorld()
local id = workspace:GetAttribute("BossWorld")
return id and Config.Find(Config.Worlds, id)
end
RunService.RenderStepped:Connect(function()
if comboBox.Visible then
local ends = player:GetAttribute("ComboEnds")
local left = ends and (ends - workspace:GetServerTimeNow()) or 0
comboFill.Size = UDim2.fromScale(math.clamp(left / Config.Combo.timeout, 0, 1), 1)
comboFill.BackgroundColor3 = left < 15 and C.red or FIRE
end
local bw = bossWorld()
bossBox.Visible = bw ~= nil
if bw then
local hp, max = workspace:GetAttribute("BossHP") or 0, math.max(1, workspace:GetAttribute("BossMax") or 1)
bossTitle.Text = "👑 " .. (workspace:GetAttribute("BossName") or "Босс")
bossTime.Text = timeStr((workspace:GetAttribute("BossEnds") or 0) - workspace:GetServerTimeNow())
bossFill.Size = UDim2.fromScale(math.clamp(hp / max, 0, 1), 1)
bossHpText.Text = ("%d / %d"):format(hp, max)
local here = currentWorld()
bossHint.Text = (here and here.id == bw.id) and "Лови рыбу — каждая бьёт босса! Редкие сильнее" or ("Он в мире «%s» — жми M"):format(bw.name)
end
end)
-- босс в воде: огромная рыба кружит по озеру и выпрыгивает (у каждого игрока своя копия, только для вида)
local bossModel, bossModelWorld = nil, nil
local function bossPath(world)
if world.lakes and not world.holes then
local l = world.lakes[1]
return world.center + Vector3.new(l[1], 0, l[2]), l[3] * 0.5
elseif world.sea then
return world.center, world.sea + 35
end
return nil -- Мир 3: босс подо льдом, его не видно
end
RunService.Heartbeat:Connect(function()
local bw = bossWorld()
local id = bw and bw.id
if id ~= bossModelWorld then
if bossModel then
bossModel:Destroy()
bossModel = nil
end
bossModelWorld = id
local def = id and Config.Boss.worlds[id]
if def and bossPath(bw) then
bossModel = Models.buildFish(def.fish, def.mutation, def.scale, true)
for _, p in ipairs(bossModel:GetDescendants()) do
if p:IsA("BasePart") then
p.CanCollide, p.CanQuery, p.CanTouch = false, false, false
end
end
bossModel.Name = "LakeBoss"
bossModel.Parent = workspace
end
end
if bossModel then
local center, r = bossPath(bw)
local a = os.clock() * 0.35
local pos = center + Vector3.new(math.cos(a) * r, (bw.waterY or 0) - 0.8, math.sin(a) * r)
local jump = os.clock() % 7
if jump < 1.4 then
pos += Vector3.new(0, math.sin(jump / 1.4 * math.pi) * 9, 0)
end
local dir = Vector3.new(-math.sin(a), 0, math.cos(a))
-- голова рыбы смотрит в +X модели, поэтому разворачиваем на 90°
bossModel:PivotTo(CFrame.lookAt(pos, pos + dir) * CFrame.Angles(0, math.rad(90), 0))
end
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,
}, { 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 })
local offerDesc = text({ Size = UDim2.new(1, -250, 0, 44), Position = UDim2.fromOffset(90, 40), Font = BODY2, TextSize = 13, TextColor3 = C.muted, TextWrapped = true, TextYAlignment = Enum.TextYAlignment.Top, Text = "", Parent = offerCard })
local offerItem, offerToken = nil, 0
local function hideOffer()
offerCard.Visible = false
offerItem = nil
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)
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)
bestOffer = function(bagWasFull)
local coins, lvl = player:GetAttribute("Coins") or 0, player:GetAttribute("Level") or 1
local options = {}
local bag = Config.Find(Config.Bags, player:GetAttribute("Bag") or "Pouch")
local ownedBags = attrSet("OwnedBags")
for _, b in ipairs(Config.Bags) do
if not ownedBags[b.id] and b.capacity > (bag and bag.capacity or 0) and lvl >= b.level and coins >= b.price then
table.insert(options, { kind = "Bag", id = b.id, icon = "🎒", title = b.name, price = b.price, prio = bagWasFull and 3 or 1,
desc = ("%d мест вместо %d — реже бегать к скупщику"):format(b.capacity, bag and bag.capacity or 0) })
break
end
end
local ownedRods = attrSet("OwnedRods")
local bestRod = nil
for _, r in ipairs(Config.Rods) do
if not ownedRods[r.id] and lvl >= r.level and coins >= r.price then
bestRod = r -- удочки по возрастанию цены: берём самую сильную из доступных
end
end
if bestRod then
table.insert(options, { kind = "Rod", id = bestRod.id, icon = "🎣", title = bestRod.name, price = bestRod.price, prio = 2,
desc = ("Удача +%d%%, клюёт быстрее, шире зелёная зона"):format(bestRod.luck * 100) })
end
local rod = Config.Find(Config.Rods, player:GetAttribute("Rod") or "Basic")
local rl = player:GetAttribute("RodLevel") or 0
if rod and rl < Config.RodUpgrade.maxLevel then
local cost = Config.UpgradeCost(rod, rl)
if coins >= cost then
table.insert(options, { kind = "Upgrade", id = rod.id, icon = "✨", title = ("%s +%d"):format(rod.name, rl + 1), price = cost, prio = 1.5,
desc = "Больше удачи и шире зелёная зона" })
end
end
local potion = Config.Potions[1]
if coins >= potion.price and (player:GetAttribute("BoostBonus") or 0) == 0 then
table.insert(options, { kind = "Potion", id = potion.id, icon = "🧪", title = potion.name, price = potion.price, prio = 0.5,
desc = ("+%d%% удачи на %d мин"):format(potion.bonus * 100, potion.duration / 60) })
end
table.sort(options, function(x, y)
return x.prio > y.prio
end)
return options[1]
end
showOffer = function(o)
offerToken += 1
local my = offerToken
offerItem = o
offerIcon.Text = o.icon
offerTitle.Text = o.title
offerDesc.Text = o.desc
offerBuy.Text = ("Купить · %s 💰"):format(fmt(o.price))
offerCard.Visible = true
popIn(offerCard, 0.6)
task.delay(9, function()
if my == offerToken then
hideOffer()
end
end)
end
player:GetAttributeChangedSignal("BagCount"):Connect(function()
if (player:GetAttribute("BagCount") or 0) >= (player:GetAttribute("BagCap") or math.huge) then
offerState.bagWasFull = true
end
end)
end)()
---------------------------------------------------------------- события от сервера
remote.OnClientEvent:Connect(function(action, a, b, c)
remote.OnClientEvent:Connect(function(action, a, b, c, d)
if action == "Notify" then
notify(a, b)
elseif action == "TeleportFade" then
teleportLoading(a, b)
elseif action == "Cast" then
setState("waiting")
startCastCam(a, b)
@@ -1927,17 +2562,55 @@ remote.OnClientEvent:Connect(function(action, a, b, c)
end
floatText("+" .. fmt(a) .. " 💰", C.gold)
notify(("💰 +%s"):format(fmt(a)), Color3.fromRGB(120, 255, 140))
-- монеты приходят атрибутом чуть позже события, поэтому предложение — с задержкой
local wasFull = offerState.bagWasFull
offerState.bagWasFull = false
-- продать можно и с заброшенной удочкой; не мешаем только мини-игре поклёвки (она тоже внизу экрана)
task.delay(0.5, function()
local t0 = os.clock()
while state == "bite" and os.clock() - t0 < 10 do
task.wait(0.3)
end
local o = state ~= "bite" and bestOffer(wasFull)
if o then
showOffer(o)
end
end)
elseif action == "Inventory" then
inventory = a or {}
discovered = b or {}
claimed = c or {}
bagWin.refresh()
refreshDots()
refreshTracker()
elseif action == "Quests" then
quests = a or {}
chain = a
daily = b or daily
questWin.refresh()
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)
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)
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)
elseif action == "BossHit" then
floatText(("⚔ -%d боссу"):format(a), Color3.fromRGB(255, 130, 100))
elseif action == "BossDone" then
if a then
notify(("🏆 %s пойман всем сервером!%s"):format(b, c and (" Лучший: " .. c) or ""), C.gold)
else
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))
elseif action == "OpenShop" then
shopWin.open("rods")
elseif action == "OpenQuests" then
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+165
View File
@@ -0,0 +1,165 @@
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<Item class="LocalScript" referent="RBX1"><Properties><string name="Name">Loading</string><ProtectedString name="Source"><![CDATA[-- Loading (LocalScript) -> ReplicatedFirst
-- Экран загрузки. Закрывает картинку при входе в игру и при каждом телепорте: игрок уже стоит на месте,
-- сцена прогружается, клиент ставит свет локации — и только потом экран плавно уходит.
--
-- FishingClient управляет экраном через атрибуты ScreenGui «LoadingScreen»:
-- Visible = true — показать (при телепорте);
-- Ready = true — свет и террейн локации выставлены;
-- StartAt / MinUntil — os.clock() начала и минимального конца показа (полоска заполняется за это время);
-- Title — подпись под названием игры (куда идём).
-- Экран уходит, когда Ready = true и минимальное время прошло.
local Players = game:GetService("Players")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local player = Players.LocalPlayer
pcall(function() ReplicatedFirst:RemoveDefaultLoadingScreen() end)
local GOLD = Color3.fromRGB(255, 205, 90)
local TIPS = {
"Чем реже рыба, тем быстрее бегает метка — нужна точность!",
"Улучшай удочку в магазине: рыба клюёт быстрее, удача выше.",
"Собери все виды одной редкости — получишь награду в коллекции (C).",
"Каждый день заходи за наградой из сундука в лобби.",
"Новые миры открываются с уровнем: следи за опытом!",
}
local function new(class, props)
local o = Instance.new(class)
for k, v in pairs(props) do
if k ~= "Parent" then
o[k] = v
end
end
o.Parent = props.Parent
return o
end
local gui = new("ScreenGui", {
Name = "LoadingScreen", ResetOnSpawn = false, IgnoreGuiInset = true, DisplayOrder = 200,
ZIndexBehavior = Enum.ZIndexBehavior.Sibling, Parent = player:WaitForChild("PlayerGui"),
})
-- фон: арт лобби (временная заглушка); пока картинка грузится, виден тёплый закатный градиент
local BG_IMAGE = "rbxassetid://118616665961176"
local root = new("CanvasGroup", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.fromRGB(255, 190, 120), BorderSizePixel = 0, Parent = gui })
new("UIGradient", {
Rotation = 90,
Color = ColorSequence.new(Color3.fromRGB(120, 200, 255), Color3.fromRGB(255, 170, 110)),
Parent = root,
})
local bg = new("ImageLabel", {
Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Image = BG_IMAGE,
ScaleType = Enum.ScaleType.Crop, Parent = root,
})
task.spawn(function()
pcall(function() game:GetService("ContentProvider"):PreloadAsync({ bg }) end)
end)
-- плашка снизу: куда идём, полоска загрузки, совет
local panel = new("Frame", {
AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -28), Size = UDim2.fromOffset(560, 118),
BackgroundColor3 = Color3.fromRGB(70, 40, 22), BackgroundTransparency = 0.18, BorderSizePixel = 0, Parent = root,
})
new("UICorner", { CornerRadius = UDim.new(0, 18), Parent = panel })
new("UIStroke", { Color = GOLD, Thickness = 3, Transparency = 0.1, Parent = panel })
new("UIGradient", {
Rotation = 90,
Color = ColorSequence.new(Color3.fromRGB(150, 95, 50), Color3.fromRGB(95, 55, 28)),
Parent = panel,
})
local float = new("TextLabel", {
AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(44, 32), Size = UDim2.fromOffset(46, 46),
BackgroundTransparency = 1, Text = "🎣", TextScaled = true, Font = Enum.Font.FredokaOne, Parent = panel,
})
local title = new("TextLabel", {
Position = UDim2.fromOffset(78, 12), Size = UDim2.new(1, -96, 0, 38), BackgroundTransparency = 1,
Text = "", TextColor3 = Color3.fromRGB(255, 240, 200), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Left,
Font = Enum.Font.FredokaOne, Parent = panel,
})
new("UIStroke", { Color = Color3.fromRGB(60, 30, 10), Thickness = 2, Parent = title })
local barBack = new("Frame", {
AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 62), Size = UDim2.new(1, -36, 0, 16),
BackgroundColor3 = Color3.fromRGB(40, 22, 10), BackgroundTransparency = 0.15, BorderSizePixel = 0, Parent = panel,
})
new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = barBack })
local bar = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = GOLD, BorderSizePixel = 0, Parent = barBack })
new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = bar })
new("UIGradient", { Color = ColorSequence.new(Color3.fromRGB(255, 230, 120), Color3.fromRGB(255, 160, 60)), Parent = bar })
local tip = new("TextLabel", {
Position = UDim2.fromOffset(18, 86), Size = UDim2.new(1, -36, 0, 22), BackgroundTransparency = 1,
Text = "", TextColor3 = Color3.fromRGB(255, 228, 185), TextScaled = true,
Font = Enum.Font.GothamMedium, Parent = panel,
})
local rng = Random.new()
local function showTip()
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
end
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
local now = os.clock()
gui:SetAttribute("Visible", true)
gui:SetAttribute("Ready", false)
gui:SetAttribute("StartAt", now)
gui:SetAttribute("MinUntil", now + 3)
gui:SetAttribute("Title", "Загрузка…")
showTip()
task.spawn(function()
if not game:IsLoaded() then
game.Loaded:Wait()
end
local ok, Config = pcall(require, ReplicatedStorage:WaitForChild("FishConfig"))
if ok and Config.Loading then
gui:SetAttribute("MinUntil", gui:GetAttribute("StartAt") + Config.Loading.firstJoin)
end
end)
local hiding = false
gui:GetAttributeChangedSignal("Visible"):Connect(function()
-- новый телепорт мог прийти, пока экран ещё уходил: тогда возвращаем его
if gui:GetAttribute("Visible") and (hiding or not gui.Enabled) then
hiding = false
showTip()
gui.Enabled = true
TweenService:Create(root, TweenInfo.new(0.25), { GroupTransparency = 0 }):Play()
end
end)
gui:GetAttributeChangedSignal("Title"):Connect(function()
title.Text = gui:GetAttribute("Title") or ""
end)
title.Text = gui:GetAttribute("Title")
RunService.RenderStepped:Connect(function()
if not gui.Enabled then
return
end
local t = os.clock()
float.Rotation = math.sin(t * 2.2) * 12
float.Position = UDim2.fromOffset(44, 32 + math.sin(t * 3) * 3)
local startAt, minUntil = gui:GetAttribute("StartAt") or t, gui:GetAttribute("MinUntil") or t
local p = math.clamp((t - startAt) / math.max(0.01, minUntil - startAt), 0, 1)
local ready = gui:GetAttribute("Ready") == true
if not ready then
p = math.min(p, 0.95) -- пока локация не готова, полоска не доходит до конца
end
bar.Size = UDim2.fromScale(p, 1)
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
if ready and hrp and t >= minUntil and not hiding then
hiding = true
local tw = TweenService:Create(root, TweenInfo.new(0.6), { GroupTransparency = 1 })
tw.Completed:Connect(function()
if hiding then
gui.Enabled = false
gui:SetAttribute("Visible", false)
end
end)
tw:Play()
end
end)
]]></ProtectedString></Properties></Item>
</roblox>
+61
View File
@@ -0,0 +1,61 @@
-- Apply after REBUILD_LANDSCAPE.lua in Studio Edit mode.
local V,CF=Vector3.new,CFrame.new
local map=workspace.World1Map
local folder=map.LandscapeDetails
local cabin=map.BigCabin;cabin:ScaleTo(1.65)
local c,s=cabin:GetBoundingBox()
cabin:PivotTo(cabin:GetPivot()+V(-80-c.X,10-(c.Y-s.Y/2),1450-c.Z))
local old=folder:FindFirstChild('CabinRamp');if old then old:Destroy() end
local ramp=Instance.new('Model');ramp.Name='CabinRamp';ramp.Parent=folder
local function part(name,size,cf,color,mat,parent)
local p=Instance.new('Part');p.Name=name;p.Anchored=true;p.Size=size;p.CFrame=cf;p.Color=color;p.Material=mat or Enum.Material.Wood;p.TopSurface=Enum.SurfaceType.Smooth;p.BottomSurface=Enum.SurfaceType.Smooth;p.Parent=parent or ramp;return p
end
local function beam(a,b,w,color,parent)
return part('Rail',V(w,w,(a-b).Magnitude),CFrame.lookAt((a+b)/2,b),color,Enum.Material.Wood,parent)
end
local wood=Color3.fromRGB(137,89,48)
local a,b=V(-68.1,12.15,1457.1),V(-68.1,4.3,1479)
local cf=CFrame.lookAt((a+b)/2,b)
part('WalkableRamp',V(6.5,0.55,(b-a).Magnitude+0.5),cf,wood,Enum.Material.WoodPlanks)
for j=0,16 do
local p=a:Lerp(b,j/16)
local strip=part('CrossPlank',V(6.55,0.12,0.10),CF(p+V(0,0.33,0))*cf.Rotation,Color3.fromRGB(103,65,37))
strip.CanCollide=false
end
for _,side in {-1,1} do
local prev
for j=0,4 do
local p=a:Lerp(b,j/4)+V(side*3,0,0)
part('RampPost',V(0.45,3.5,0.45),CF(p+V(0,1.5,0)),wood)
if prev then beam(prev+V(0,2.9,0),p+V(0,2.9,0),0.32,wood) end
prev=p
end
end
-- Warm lamps at the cabin and along the uphill trail.
for _,p in {V(-65,12,1457),V(-88,7,1530),V(-104,20,1464),V(-93,37,1415),V(-46,60,1385)} do
part('LanternPost',V(0.6,6,0.6),CF(p+V(0,3,0)),wood,nil,folder)
local lamp=part('AmberLantern',V(1.1,1.6,1.1),CF(p+V(0,6,0)),Color3.fromRGB(255,199,99),Enum.Material.Neon,folder)
part('LanternCap',V(1.5,0.3,1.5),CF(p+V(0,6.95,0)),Color3.fromRGB(64,57,41),Enum.Material.Metal,folder)
local light=Instance.new('PointLight');light.Color=lamp.Color;light.Brightness=1.3;light.Range=13;light.Parent=lamp
end
-- Broaden the cascade while retaining its original animation and particles.
local sheet=map.Waterfall:GetChildren()[1]
if not sheet:GetAttribute('LandscapeWidened') then
sheet.Size=V(19,sheet.Size.Y,sheet.Size.Z)
for _,a in sheet:GetChildren() do if a:IsA('Attachment') then a.Position=V(a.Position.X*1.9,a.Position.Y,a.Position.Z) end end
sheet:SetAttribute('LandscapeWidened',true)
end
-- The small waterside cabin sits on the opposite shore, below the lookout.
local small=map.SmallCabin;local sc,ss=small:GetBoundingBox()
small:PivotTo(small:GetPivot()+V(-10-sc.X,5.05-(sc.Y-ss.Y/2),1424-sc.Z))
local bridge=map.Bridge
local low=math.huge
for _,p in bridge:GetDescendants() do
if p:IsA('BasePart') and math.abs(p.Size.Y-0.5)<0.01 then low=math.min(low,p.Position.Y+0.25) end
end
if low<math.huge then bridge:PivotTo(bridge:GetPivot()+V(0,39.1-low,0)) end
local generated=workspace:FindFirstChild('HouseWithRamp')
if generated then generated.Parent=game.ServerStorage end
workspace.CurrentCamera.CFrame=CFrame.lookAt(V(22,14,1570),V(-22,25,1443))
return {rampSlopeDegrees=math.deg(math.atan((a.Y-b.Y)/(a.Z-b.Z)))*-1}
+4160 -1625
View File
File diff suppressed because it is too large. Load diff
+107
View File
@@ -0,0 +1,107 @@
-- Apply to the baked World1Map in Edit mode.
-- Toolbox assets: DaveCam456 / 11751641277; FracturedSkies / 2128776869.
local V,CF=Vector3.new,CFrame.new
local terrain=workspace.Terrain
local map=workspace.World1Map
local lib=game.ServerStorage.LandscapeAssetLibrary
local ms=game:GetService('MaterialService')
for x=-288,287,48 do
terrain:ReplaceMaterial(Region3.new(V(x,-24,1212),V(x+48,160,1788)):ExpandToGrid(4),4,Enum.Material.Rock,Enum.Material.Slate)
task.wait()
end
local colors={Snow=Color3.fromRGB(127,163,63),Salt=Color3.fromRGB(191,155,105),Rock=Color3.fromRGB(132,139,155),Slate=Color3.fromRGB(132,139,155)}
for name,color in colors do
local material=Enum.Material[name]
local variant=ms:FindFirstChild('LowPolyFlat'..name) or Instance.new('MaterialVariant')
variant.Name='LowPolyFlat'..name;variant.BaseMaterial=material
variant.ColorMap='rbxasset://textures/SelfView/whiteRect.png'
variant.RoughnessMap='rbxasset://textures/SelfView/whiteRect.png'
variant.NormalMap='';variant.MetalnessMap='';variant.StudsPerTile=32;variant.Parent=ms
ms:SetBaseMaterialOverride(material,variant.Name);terrain:SetMaterialColor(material,color)
end
local old=map:FindFirstChild('LowPolyRockwork');if old then old:Destroy() end
local folder=Instance.new('Folder');folder.Name='LowPolyRockwork';folder.Parent=map
folder:SetAttribute('CliffCreator','DaveCam456')
folder:SetAttribute('CliffAssetId','11751641277')
folder:SetAttribute('RockCreator','FracturedSkies')
folder:SetAttribute('RockAssetId','2128776869')
local cliff=lib.LowPolyRockyCliff:FindFirstChildWhichIsA('MeshPart',true)
local mountain=lib.MountainBorder:FindFirstChildWhichIsA('MeshPart',true)
local stones={}
for _,p in lib.LowPolyRockPack:GetDescendants() do if p:IsA('MeshPart') then table.insert(stones,p) end end
table.sort(stones,function(a,b) return a.Name<b.Name end)
local rng=Random.new(320)
local function place(source,name,pos,size,angle,color)
local p=source:Clone()
for _,v in p:GetDescendants() do if v:IsA('LuaSourceContainer') or v:IsA('SurfaceAppearance') or v:IsA('Decal') or v:IsA('Texture') then v:Destroy() end end
p.Name=name;p.Anchored=true;p.TextureID='';p.Material=Enum.Material.SmoothPlastic;p.MaterialVariant='';p.Reflectance=0
p.Size=size;p.CFrame=CF(pos)*CFrame.Angles(0,angle or 0,0)
p.Color=color or Color3.fromRGB(130+rng:NextInteger(-7,7),135+rng:NextInteger(-5,5),149+rng:NextInteger(-5,5))
p.Parent=folder;return p
end
-- Broad vertical facets under the grassy lookout and beside the waterfall.
local columns={
{-75,18,1415,23,38,24},{-58,21,1417,26,44,25},{-38,22,1415,25,46,23},{-19,18,1408,24,38,23},
{5,13,1410,22,28,24},
{25,16,1427,23,36,27},{12,13,1423,22,29,26},
{68,17,1425,25,39,29},{85,15,1420,25,34,30},{98,10,1410,24,25,27},
}
for i,p in columns do
place(cliff,'CliffFace_'..i,V(p[1],p[2],p[3]+(i<=5 and 9 or 0)),V(p[4]*(i<=5 and 1.2 or 1),p[5],p[6]*(i<=5 and 1.15 or 1)),i*0.71)
end
-- Large irregular rock silhouettes replace the fine-grained mountain surface.
for i=0,23 do
local a=i*math.pi*2/24
local r=239+17*math.sin(i*2.17)
local radius=66+23*math.sin(i*3.1)^2
local ht=76+43*math.sin(i*1.87)^2
local pos=V(math.cos(a)*r,ht*0.43,1500+math.sin(a)*r)
local mass=place(mountain,'MountainMass_'..i,V(pos.X-math.cos(a)*19,ht*0.51-4,pos.Z-math.sin(a)*19),V(radius*1.95,ht*1.344,radius*2.295),0,Color3.fromRGB(125+i%3*4,136+i%3*3,147+i%3*4))
mass.CFrame=CFrame.lookAt(mass.Position,mass.Position+V(math.cos(a),0,math.sin(a)))
task.wait()
end
local feet={{-64,12,1426,25,30,22},{-44,15,1428,29,35,24},{-25,10,1424,20,24,19},{27,12,1433,24,29,27},{70,15,1430,29,35,30},{92,9,1421,28,25,27}}
for i,a in feet do
place(stones[i],'CliffFootBoulder',V(a[1],a[2],a[3]),V(a[4],a[5],a[6]),i*0.6,Color3.fromRGB(128+i%3*3,132+i%3*3,146+i%3*3))
end
local rp=RaycastParams.new();rp.FilterType=Enum.RaycastFilterType.Include;rp.FilterDescendantsInstances={terrain};rp.IgnoreWater=true
local lakes=require(game.ReplicatedStorage.FishConfig).Worlds[1].lakes
local function gap(x,z)
local g=math.huge
for _,l in lakes do g=math.min(g,math.sqrt((x-l[1])^2+(z-1500-l[2])^2)-l[3]) end
return g
end
-- Discrete clusters, with the dock, ramp, and trail kept open.
for i=1,120 do
local x,z=rng:NextNumber(-112,116),rng:NextNumber(1408,1557)
local g=gap(x,z)
local clear=not (math.abs(x)<27 and z>1530) and not (x< -58 and x> -95 and z>1430 and z<1494) and not (x> -24 and x<8 and z<1440)
if g>-1 and g<7 and clear then
local hit=workspace:Raycast(V(x,180,z),V(0,-230,0),rp)
if hit then
local s=rng:NextNumber(3,7)
place(stones[i%#stones+1],'ShoreBoulder',hit.Position+V(0,s*0.18,0),V(s,s*0.8,s*0.9),rng:NextNumber(0,6.28))
end
end
end
-- Put trees on the new rock surfaces instead of leaving them inside the mountains.
local rockRay=RaycastParams.new();rockRay.FilterType=Enum.RaycastFilterType.Include;rockRay.FilterDescendantsInstances={folder,terrain};rockRay.IgnoreWater=true
local moved=0
for _,tree in map.LandscapeDetails:GetChildren() do
if tree:IsA('Model') and tree.Name=='Pine' then
local c,s=tree:GetBoundingBox()
local base=c.Y-s.Y/2
local hit=workspace:Raycast(V(c.X,220,c.Z),V(0,-260,0),rockRay)
if hit and math.abs(hit.Position.Y-base)>0.5 then tree:PivotTo(tree:GetPivot()+V(0,hit.Position.Y-base-0.3,0));moved+=1 end
end
end
for _,n in {'AssetPreview','MountainPreview'} do local preview=workspace:FindFirstChild(n);if preview then preview:Destroy() end end
map:SetAttribute('LandscapeStyle','LowPolyMatte')
local small=map.SmallCabin
local sc,ss=small:GetBoundingBox()
local shore=workspace:Raycast(V(-8,180,1438),V(0,-220,0),rp)
local sy=math.max(3.5,shore and shore.Position.Y or 3.5)
small:PivotTo(small:GetPivot()+V(-8-sc.X,sy-(sc.Y-ss.Y/2),1438-sc.Z))
return {rocks=#folder:GetChildren(),treesGrounded=moved}
+170
View File
@@ -0,0 +1,170 @@
-- Run in Studio Edit mode. Rebuilds only World1 landscape; keep a scene backup first.
local V, CF = Vector3.new, CFrame.new
local terrain, map = workspace.Terrain, workspace.World1Map
local W = V(0,0,1500)
local lakes = require(game.ReplicatedStorage.FishConfig).Worlds[1].lakes
local path = {{-24,62,4},{-64,52,5},{-87,32,7},{-100,4,10},{-106,-27,17},{-103,-57,27},{-91,-83,37},{-66,-92,46},{-39,-105,54},{-46,-123,60}}
local function gap(x,z)
local g=1e5
for _,l in lakes do g=math.min(g,math.sqrt((x-l[1])^2+(z-l[2])^2)-l[3]) end
return g
end
local function pathInfo(x,z)
local best,h=1e5,4
for i=2,#path do
local a,b=path[i-1],path[i]; local dx,dz=b[1]-a[1],b[2]-a[2]
local t=math.clamp(((x-a[1])*dx+(z-a[2])*dz)/(dx*dx+dz*dz),0,1)
local d=math.sqrt((x-a[1]-dx*t)^2+(z-a[2]-dz*t)^2)
if d<best then best,h=d,a[3]+(b[3]-a[3])*t end
end
return best,h
end
local peaks={}
for i=0,23 do
local a=i*math.pi*2/24
local r=239+17*math.sin(i*2.17)
table.insert(peaks,{math.cos(a)*r,math.sin(a)*r,66+23*math.sin(i*3.1)^2,76+43*math.sin(i*1.87)^2})
end
local function height(x,z)
local g=gap(x,z)
if g<0 then return -10+math.clamp((g+10)/10,0,1)*8 end
local y=4+math.noise(x/48,z/48)*2
for _,p in peaks do
local d=math.sqrt((x-p[1])^2+(z-p[2])^2)/p[3]
y=math.max(y,4+p[4]*math.max(0,1-d)^0.85)
end
local d=math.sqrt(((x+46)/70)^2+((z+123)/64)^2)
y=math.max(y,4+56*math.max(0,1-d^2)^0.7)
-- Broad, grassy summit with a firm level base for the lookout.
if ((x+46)/15)^2+((z+123)/14)^2<1 then y=60 end
-- River escarpment behind the waterfall, with a steep lake-facing wall.
local cliff=math.clamp((x-17)/15,0,1)*math.clamp((112-x)/22,0,1)*math.clamp((-z-68)/12,0,1)*math.clamp((z+172)/28,0,1)
y=math.max(y,4+32*cliff)
local pd,ph=pathInfo(x,z)
local mix=1-math.clamp((pd-4)/9,0,1)
y=y*(1-mix)+ph*mix
-- Level building terrace on the left bank.
local cd=math.sqrt(((x+80)/22)^2+((z+50)/19)^2)
if cd<1.5 then local b=math.clamp((1.5-cd)/0.5,0,1); y=y*(1-b)+10*b end
-- Preserve the low, usable shoreline.
y=4+(y-4)*math.clamp(g/11,0,1)
return y
end
terrain:SetMaterialColor(Enum.Material.Snow,Color3.fromRGB(122,182,74))
terrain:SetMaterialColor(Enum.Material.Salt,Color3.fromRGB(190,153,102))
terrain:SetMaterialColor(Enum.Material.Rock,Color3.fromRGB(111,124,137))
terrain:SetMaterialColor(Enum.Material.Sand,Color3.fromRGB(205,190,140))
terrain.WaterColor=Color3.fromRGB(38,158,157)
terrain.WaterTransparency=0.5
terrain.WaterWaveSize=0.12
terrain.WaterWaveSpeed=8
-- 48-stud chunks keep every WriteVoxels small and allow Studio to repaint.
for x0=-288,287,48 do
for z0=-288,287,48 do
local region=Region3.new(W+V(x0,-24,z0),W+V(x0+48,160,z0+48)):ExpandToGrid(4)
local mats,occ=terrain:ReadVoxels(region,4)
for ix=1,12 do for iz=1,12 do
local x,z=x0+(ix-0.5)*4,z0+(iz-0.5)*4
local h,g=height(x,z)-2,gap(x,z)
local pd=pathInfo(x,z)
local slope=math.max(math.abs(height(x+2,z)-height(x-2,z)),math.abs(height(x,z+2)-height(x,z-2)))/4
for iy=1,46 do
local bottom=-24+(iy-1)*4
local o=math.clamp((h-bottom)/4,0,1)
local m=Enum.Material.Air
if o>0 then
m=Enum.Material.Rock
if bottom>h-7 then
m=(slope>1.05 and h>14) and Enum.Material.Rock or Enum.Material.Snow
if pd<4.5 and g>2 then m=Enum.Material.Salt end
if g<3 then m=Enum.Material.Sand end
end
elseif g<0 and bottom<0 then m=Enum.Material.Water; o=1 end
mats[ix][iy][iz],occ[ix][iy][iz]=m,o
end
end end
terrain:WriteVoxels(region,4,mats,occ)
task.wait()
end
end
local old=map:FindFirstChild('LandscapeDetails'); if old then old:Destroy() end
local details=Instance.new('Folder');details.Name='LandscapeDetails';details.Parent=map
local rng=Random.new(103)
local function part(name,size,cf,color,material,parent)
local p=Instance.new('Part'); p.Name=name;p.Size=size;p.CFrame=cf;p.Color=color;p.Material=material or Enum.Material.SmoothPlastic;p.Anchored=true;p.TopSurface=Enum.SurfaceType.Smooth;p.BottomSurface=Enum.SurfaceType.Smooth;p.Parent=parent or details;return p
end
local wood=Color3.fromRGB(125,78,43)
local function beam(a,b,width,color,parent)
return part('Rail',V(width,width,(b-a).Magnitude),CFrame.lookAt((a+b)/2,b),color or wood,Enum.Material.Wood,parent)
end
-- Move existing assets, keeping game markers and identifiers intact.
local tower=map.Watchtower
local tc,ts=tower:GetBoundingBox()
tower:PivotTo(tower:GetPivot()+V(-46-tc.X,60-(tc.Y-ts.Y/2),1377-tc.Z))
local cabin=map.BigCabin
local bc,bs=cabin:GetBoundingBox()
cabin:PivotTo(cabin:GetPivot()+V(-89-bc.X,8-(bc.Y-bs.Y/2),1512-bc.Z))
local small=map.SmallCabin;local sc,sz=small:GetBoundingBox()
small:PivotTo(small:GetPivot()+V(-24-sc.X,5-(sc.Y-sz.Y/2),1416-sc.Z))
-- An upper river runs beneath the existing bridge to the waterfall lip.
terrain:FillBlock(CF(46,34,1394),V(12,4,54),Enum.Material.Water)
terrain:FillBlock(CF(46,40,1394),V(12,8,54),Enum.Material.Air)
-- Cliff buttresses flank the falling water and support both bridge ends.
for _,b in {{27,17,1422,20,34,24},{68,17,1423,23,34,27}} do
terrain:FillBlock(CF(b[1],b[2],b[3]),V(b[4],b[5],b[6]),Enum.Material.Rock)
terrain:FillBlock(CF(b[1],35,b[3]-5),V(b[4],4,b[6]-10),Enum.Material.Snow)
end
-- Trail fencing follows the graded path, leaving the entrance open.
for i=3,#path do
local a,b=path[i-1],path[i]
local av,bv=V(a[1],a[3],a[2]),V(b[1],b[3],b[2])
local dir=V(b[1]-a[1],0,b[2]-a[2]).Unit;local side=V(-dir.Z,0,dir.X)*6
local steps=math.ceil((bv-av).Magnitude/9)
for _,sign in {-1,1} do
local prev
for j=0,steps do
local p=W+av:Lerp(bv,j/steps)+side*sign
part('TrailPost',V(0.65,3.7,0.65),CF(p+V(0,1.6,0)),wood,Enum.Material.Wood)
if prev then beam(prev+V(0,2.7,0),p+V(0,2.7,0),0.4);beam(prev+V(0,1.3,0),p+V(0,1.3,0),0.3) end
prev=p
end
end
end
-- Restore the established low-poly evergreen style from World1Builder.
local crownRotation=CFrame.Angles(math.rad(-35.264),0,0)*CFrame.Angles(0,0,math.rad(45))
local count=0
for i=1,520 do
local x,z=rng:NextNumber(-235,235),rng:NextNumber(-235,235)
local g=gap(x,z);local pd=pathInfo(x,z);local h=height(x,z)
local blocked=(x>-38 and x<38 and z>42 and z<100) or (math.abs(x+80)<29 and math.abs(z+50)<26) or (math.abs(x+24)<16 and math.abs(z+84)<15) or (math.abs(x+46)<20 and math.abs(z+123)<18) or (x>12 and x<86 and z< -65 and z> -152)
if g>10 and pd>12 and not blocked and h<100 then
local tree=Instance.new('Model');tree.Name='Pine'
local ht=rng:NextNumber(17,32);local p=W+V(x,h-0.5,z)
part('Trunk',V(ht*0.065,ht*0.55,ht*0.065),CF(p+V(0,ht*0.25,0)),Color3.fromRGB(91,65,39),Enum.Material.Wood,tree)
for tier=0,3 do
local s=ht*(0.43-tier*0.075)
local leaf=part('Needles',V(s,s,s),CF(p+V(0,ht*(0.3+tier*0.18),0))*CFrame.Angles(0,i*1.73,0)*crownRotation,Color3.fromRGB(43+tier*11,91+tier*12,51+tier*3),nil,tree)
leaf.CanCollide=false
end
tree.Parent=details;count+=1
end
if i%40==0 then task.wait() end
end
-- Shore rocks and low shrubs frame the lake without hiding the main landmarks.
for i=1,250 do
local x,z=rng:NextNumber(-125,125),rng:NextNumber(-145,90)
local g=gap(x,z);local pd=pathInfo(x,z)
if g>2 and g<13 and pd>9 and not (math.abs(x)<25 and z>35) and not (x>20 and x<78 and z< -60) then
local h=height(x,z);local s=rng:NextNumber(2,6)
local p=part('ShoreRock',V(s,s*0.65,s*0.8),CF(W+V(x,h,z))*CFrame.Angles(0.2,i,0.3),Color3.fromRGB(115,125,132))
if i%2==0 then
for j=1,3 do local q=part('Shrub',V(2.8,2.8,2.8),CF(W+V(x+j*1.1,h+1,z-2)),Color3.fromRGB(91+j*12,138+j*8,51));q.Shape=Enum.PartType.Ball;q.CanCollide=false end
end
end
end
local lighting=game:GetService('Lighting');lighting.ClockTime=15.2;lighting.Brightness=2.5;lighting.Ambient=Color3.fromRGB(125,137,145);lighting.OutdoorAmbient=Color3.fromRGB(145,152,139)
workspace.CurrentCamera.CFrame=CFrame.lookAt(V(8,17,1575),V(-10,25,1435))
map:SetAttribute('LandscapeRevision','ReferenceLandscape_v1')
return {trees=count,details=#details:GetDescendants(),pathPoints=#path}
+37
View File
@@ -0,0 +1,37 @@
-- Requires the generated SpruceTree template, retained in ServerStorage after use.
local source=workspace:FindFirstChild('SpruceTree') or game.ServerStorage:FindFirstChild('SpruceTree')
assert(source,'Generate or restore SpruceTree first')
local template=Instance.new('Model');template.Name='SpruceTemplate'
for _,p in source:GetDescendants() do
if p:IsA('BasePart') then
local q=p:Clone();q.Anchored=true
if q.Name:find('Foliage') then q.CanCollide=false;q.Material=Enum.Material.SmoothPlastic;q.UsePartColor=true end
q.Parent=template
end
end
local templateBounds=template:GetBoundingBox()
template.WorldPivot=CFrame.new(templateBounds.Position)
local rng=Random.new(58)
local folder=workspace.World1Map.LandscapeDetails
local n=0
for _,tree in folder:GetChildren() do
if tree.Name=='Pine' and tree:IsA('Model') then
local trunk=tree:FindFirstChild('Trunk')
if trunk then
local base=trunk.Position-Vector3.new(0,trunk.Size.Y/2,0)
local copy=template:Clone();copy.Name='Pine';copy:ScaleTo(rng:NextNumber(0.75,1.25))
local cf,size=copy:GetBoundingBox()
copy:PivotTo(CFrame.new(base+Vector3.new(0,size.Y/2,0))*CFrame.Angles(0,rng:NextNumber(0,6.28),0))
local c,s=copy:GetBoundingBox();copy:PivotTo(copy:GetPivot()+Vector3.new(base.X-c.X,base.Y-(c.Y-s.Y/2),base.Z-c.Z))
local shade=rng:NextNumber(-0.03,0.04)
for _,p in copy:GetChildren() do
if p.Name:find('Foliage') then local k=tonumber(p.Name:match('%d+')) or 1;p.Color=Color3.fromRGB(50+k*5,95+k*7,44+k*4):Lerp(Color3.fromRGB(120,145,60),math.max(0,shade*7)) end
end
copy.Parent=folder;tree:Destroy();n+=1
if n%25==0 then task.wait() end
end
end
end
template:Destroy();source.Parent=game.ServerStorage
return {replaced=n}
File diff suppressed because it is too large. Load diff
+162
View File
@@ -0,0 +1,162 @@
-- Loading (LocalScript) -> ReplicatedFirst
-- Экран загрузки. Закрывает картинку при входе в игру и при каждом телепорте: игрок уже стоит на месте,
-- сцена прогружается, клиент ставит свет локации — и только потом экран плавно уходит.
--
-- FishingClient управляет экраном через атрибуты ScreenGui «LoadingScreen»:
-- Visible = true — показать (при телепорте);
-- Ready = true — свет и террейн локации выставлены;
-- StartAt / MinUntil — os.clock() начала и минимального конца показа (полоска заполняется за это время);
-- Title — подпись под названием игры (куда идём).
-- Экран уходит, когда Ready = true и минимальное время прошло.
local Players = game:GetService("Players")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local player = Players.LocalPlayer
pcall(function() ReplicatedFirst:RemoveDefaultLoadingScreen() end)
local GOLD = Color3.fromRGB(255, 205, 90)
local TIPS = {
"Чем реже рыба, тем быстрее бегает метка — нужна точность!",
"Улучшай удочку в магазине: рыба клюёт быстрее, удача выше.",
"Собери все виды одной редкости — получишь награду в коллекции (C).",
"Каждый день заходи за наградой из сундука в лобби.",
"Новые миры открываются с уровнем: следи за опытом!",
}
local function new(class, props)
local o = Instance.new(class)
for k, v in pairs(props) do
if k ~= "Parent" then
o[k] = v
end
end
o.Parent = props.Parent
return o
end
local gui = new("ScreenGui", {
Name = "LoadingScreen", ResetOnSpawn = false, IgnoreGuiInset = true, DisplayOrder = 200,
ZIndexBehavior = Enum.ZIndexBehavior.Sibling, Parent = player:WaitForChild("PlayerGui"),
})
-- фон: арт лобби (временная заглушка); пока картинка грузится, виден тёплый закатный градиент
local BG_IMAGE = "rbxassetid://118616665961176"
local root = new("CanvasGroup", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.fromRGB(255, 190, 120), BorderSizePixel = 0, Parent = gui })
new("UIGradient", {
Rotation = 90,
Color = ColorSequence.new(Color3.fromRGB(120, 200, 255), Color3.fromRGB(255, 170, 110)),
Parent = root,
})
local bg = new("ImageLabel", {
Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Image = BG_IMAGE,
ScaleType = Enum.ScaleType.Crop, Parent = root,
})
task.spawn(function()
pcall(function() game:GetService("ContentProvider"):PreloadAsync({ bg }) end)
end)
-- плашка снизу: куда идём, полоска загрузки, совет
local panel = new("Frame", {
AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -28), Size = UDim2.fromOffset(560, 118),
BackgroundColor3 = Color3.fromRGB(70, 40, 22), BackgroundTransparency = 0.18, BorderSizePixel = 0, Parent = root,
})
new("UICorner", { CornerRadius = UDim.new(0, 18), Parent = panel })
new("UIStroke", { Color = GOLD, Thickness = 3, Transparency = 0.1, Parent = panel })
new("UIGradient", {
Rotation = 90,
Color = ColorSequence.new(Color3.fromRGB(150, 95, 50), Color3.fromRGB(95, 55, 28)),
Parent = panel,
})
local float = new("TextLabel", {
AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(44, 32), Size = UDim2.fromOffset(46, 46),
BackgroundTransparency = 1, Text = "🎣", TextScaled = true, Font = Enum.Font.FredokaOne, Parent = panel,
})
local title = new("TextLabel", {
Position = UDim2.fromOffset(78, 12), Size = UDim2.new(1, -96, 0, 38), BackgroundTransparency = 1,
Text = "", TextColor3 = Color3.fromRGB(255, 240, 200), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Left,
Font = Enum.Font.FredokaOne, Parent = panel,
})
new("UIStroke", { Color = Color3.fromRGB(60, 30, 10), Thickness = 2, Parent = title })
local barBack = new("Frame", {
AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 62), Size = UDim2.new(1, -36, 0, 16),
BackgroundColor3 = Color3.fromRGB(40, 22, 10), BackgroundTransparency = 0.15, BorderSizePixel = 0, Parent = panel,
})
new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = barBack })
local bar = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = GOLD, BorderSizePixel = 0, Parent = barBack })
new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = bar })
new("UIGradient", { Color = ColorSequence.new(Color3.fromRGB(255, 230, 120), Color3.fromRGB(255, 160, 60)), Parent = bar })
local tip = new("TextLabel", {
Position = UDim2.fromOffset(18, 86), Size = UDim2.new(1, -36, 0, 22), BackgroundTransparency = 1,
Text = "", TextColor3 = Color3.fromRGB(255, 228, 185), TextScaled = true,
Font = Enum.Font.GothamMedium, Parent = panel,
})
local rng = Random.new()
local function showTip()
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
end
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
local now = os.clock()
gui:SetAttribute("Visible", true)
gui:SetAttribute("Ready", false)
gui:SetAttribute("StartAt", now)
gui:SetAttribute("MinUntil", now + 3)
gui:SetAttribute("Title", "Загрузка…")
showTip()
task.spawn(function()
if not game:IsLoaded() then
game.Loaded:Wait()
end
local ok, Config = pcall(require, ReplicatedStorage:WaitForChild("FishConfig"))
if ok and Config.Loading then
gui:SetAttribute("MinUntil", gui:GetAttribute("StartAt") + Config.Loading.firstJoin)
end
end)
local hiding = false
gui:GetAttributeChangedSignal("Visible"):Connect(function()
-- новый телепорт мог прийти, пока экран ещё уходил: тогда возвращаем его
if gui:GetAttribute("Visible") and (hiding or not gui.Enabled) then
hiding = false
showTip()
gui.Enabled = true
TweenService:Create(root, TweenInfo.new(0.25), { GroupTransparency = 0 }):Play()
end
end)
gui:GetAttributeChangedSignal("Title"):Connect(function()
title.Text = gui:GetAttribute("Title") or ""
end)
title.Text = gui:GetAttribute("Title")
RunService.RenderStepped:Connect(function()
if not gui.Enabled then
return
end
local t = os.clock()
float.Rotation = math.sin(t * 2.2) * 12
float.Position = UDim2.fromOffset(44, 32 + math.sin(t * 3) * 3)
local startAt, minUntil = gui:GetAttribute("StartAt") or t, gui:GetAttribute("MinUntil") or t
local p = math.clamp((t - startAt) / math.max(0.01, minUntil - startAt), 0, 1)
local ready = gui:GetAttribute("Ready") == true
if not ready then
p = math.min(p, 0.95) -- пока локация не готова, полоска не доходит до конца
end
bar.Size = UDim2.fromScale(p, 1)
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
if ready and hrp and t >= minUntil and not hiding then
hiding = true
local tw = TweenService:Create(root, TweenInfo.new(0.6), { GroupTransparency = 1 })
tw.Completed:Connect(function()
if hiding then
gui.Enabled = false
gui:SetAttribute("Visible", false)
end
end)
tw:Play()
end
end)
+356 -22
View File
@@ -12,15 +12,42 @@ Config.Worlds = {
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
clock = 14.5, water = Color3.fromRGB(10, 55, 70),
clock = 16.2,
waterY = 0,
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
lakes = { { 0, -15, 62 }, { -42, 8, 34 }, { 44, 2, 36 }, { 0, 22, 30 }, { 48, -50, 22 } }, -- { x, z, радиус } от центра
-- внешний вид только этого мира (применяет клиент при входе, при выходе возвращает как было)
tint = Color3.fromRGB(255, 247, 236),
-- свет и эффекты: свойства Lighting и его эффектов; чего здесь нет, остаётся как в MapBuilder
look = {
lighting = {
Brightness = 2.6, ExposureCompensation = -0.15,
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,
},
-- дымка вдали: 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 },
-- лёгкое размытие дальнего плана
dof = { Enabled = true, FarIntensity = 0.2, FocusDistance = 60, InFocusRadius = 120, NearIntensity = 0 },
},
-- земля мира залита материалом Snow (ровный, без травинок), дорожки — Salt; здесь они перекрашиваются
terrainColors = {
Snow = Color3.fromRGB(127, 163, 63), Salt = Color3.fromRGB(191, 155, 105),
Rock = Color3.fromRGB(132, 139, 155), Slate = Color3.fromRGB(132, 139, 155),
Mud = Color3.fromRGB(78, 110, 92), Sand = Color3.fromRGB(205, 190, 140),
},
},
{
id = "World2", name = "Тропический остров", icon = "🏝", level = 8, mult = 4,
center = Vector3.new(1500, 0, 0), color = Color3.fromRGB(255, 190, 70),
desc = "Бирюзовое море, пальмы и яркая рифовая рыба.",
clock = 13, water = Color3.fromRGB(35, 175, 185),
clock = 13,
waterY = 0,
sea = 119, -- всё дальше этого радиуса от центра — море
},
@@ -28,7 +55,7 @@ Config.Worlds = {
id = "World3", name = "Ледяной фьорд", icon = "❄", level = 18, mult = 12,
center = Vector3.new(-1500, 0, 0), color = Color3.fromRGB(150, 220, 255),
desc = "Рыбалка в лунках среди льдов и северного сияния.",
clock = 18.3, water = Color3.fromRGB(25, 70, 100),
clock = 18.3,
waterY = 1,
lakes = { { 0, 0, 70 }, { -55, 30, 45 }, { 55, -25, 50 }, { 5, -70, 40 } }, -- подо льдом
holes = {
@@ -36,6 +63,9 @@ Config.Worlds = {
{ -45, 15 }, { 55, -25 }, { 75, -5 }, { 40, -50 }, { 5, -75 }, { -15, -60 }, { 25, -80 },
},
holeRadius = 6,
-- цвета террейна общие на весь плейс, а в нём сохранены цвета «Тихого озера» (зелёный Snow) —
-- поэтому снег фьорда задаём явно
terrainColors = { Snow = Color3.fromRGB(205, 212, 228) },
},
{
id = "World4", name = "Вулкан", icon = "🌋", level = 30, mult = 30, soon = true,
@@ -45,6 +75,43 @@ Config.Worlds = {
}
Config.WorldRadius = 260
-- экран загрузки: при входе в игру и при каждом телепорте игрок уже стоит на месте, сцена прогружается
-- и свет локации ставится под ним; картинку видно только после этого (секунды — минимум показа)
Config.Loading = {
firstJoin = 3,
teleport = 2.5,
}
-- лобби: те же поля внешнего вида, что у миров (clock, tint, look, terrainColors); клиент применяет их вне миров
Config.Lobby = {
id = "Lobby",
clock = 16.3, -- предвечернее солнце: тени длиннее, свет теплее
tint = Color3.fromRGB(255, 242, 228),
look = {
lighting = {
Brightness = 2.0, ExposureCompensation = -0.3,
Ambient = Color3.fromRGB(64, 60, 72), OutdoorAmbient = Color3.fromRGB(120, 114, 124),
ColorShift_Top = Color3.fromRGB(255, 224, 186),
EnvironmentDiffuseScale = 0.5, EnvironmentSpecularScale = 0.5,
GlobalShadows = true,
},
-- тёплая дымка: дальние холмы за скалами тонут в ней
atmosphere = {
Density = 0.4, Offset = 0.18, Haze = 1.6, Glare = 0.25,
Color = Color3.fromRGB(222, 212, 204), Decay = Color3.fromRGB(186, 160, 150),
},
color = { Saturation = 0.18, Contrast = 0.14, Brightness = -0.04 },
bloom = { Intensity = 0.3, Size = 24, Threshold = 1.8 },
sunRays = { Intensity = 0.05, Spread = 0.7 },
dof = { Enabled = true, FarIntensity = 0.18, FocusDistance = 55, InFocusRadius = 95, NearIntensity = 0 },
-- мягкий тонмаппинг вместо Retro: светлая плитка и вывески не выгорают в белое
grading = { TonemapperPreset = Enum.TonemapperPreset.Default },
},
terrainColors = {
Grass = Color3.fromRGB(104, 150, 72), Ground = Color3.fromRGB(120, 98, 74), Rock = Color3.fromRGB(140, 126, 130),
},
}
function Config.WorldAt(pos)
for _, w in ipairs(Config.Worlds) do
if not w.soon then
@@ -282,19 +349,90 @@ Config.CollectionRewards = {
}
Config.MasteryCoins = 5000 -- за весь мир (тоже умножается на mult)
---------------------------------------------------------------- задания
-- coins/xp = награда за 1 единицу цели (умножается на цель и уровень игрока)
Config.Quests = {
{ kind = "catch", text = "Поймай %d рыб", goals = { 10, 20, 35 }, coins = 6, xp = 5 },
{ kind = "rare", text = "Поймай %d рыб редкости «Редкая» и выше", goals = { 1, 2, 3 }, coins = 60, xp = 50 },
{ kind = "epic", text = "Поймай эпическую рыбу или реже", goals = { 1 }, coins = 250, xp = 200 },
{ kind = "mutation", text = "Поймай рыбу с мутацией", goals = { 1 }, coins = 200, xp = 150 },
{ kind = "earn", text = "Заработай %d монет на продаже", goals = { 200, 600, 1500 }, coins = 0.25, xp = 0.2 },
{ kind = "perfect", text = "Сделай %d идеальных подсечек (без промаха)", goals = { 5, 10, 15 }, coins = 15, xp = 12 },
---------------------------------------------------------------- цепочки заданий
-- короткие задания идут по очереди: награда сразу, следующее появляется мгновенно.
-- после последнего шага — бонус цепочки и следующая цепочка; каждый новый круг цели растут
-- coins/xp = награда за 1 единицу цели (умножается на цель и уровень игрока);
-- max — потолок цели, byLevel — цель растёт с уровнем игрока;
-- forms — слово после числа для 1 / 2–4 / 5+ (подставляется вместо второго %s)
local FISH, TIMES = { "рыбу", "рыбы", "рыб" }, { "раз", "раза", "раз" }
Config.QuestKinds = {
catch = { text = "Поймай %d %s", forms = FISH, coins = 5, xp = 4 },
uncommon = { text = "Поймай %d %s «Необычная» или реже", forms = FISH, coins = 18, xp = 14 },
rare = { text = "Поймай %d %s «Редкая» или реже", forms = FISH, coins = 60, xp = 50 },
perfect = { text = "Подсеки %d %s без промаха", forms = TIMES, coins = 10, xp = 8 },
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 },
}
Config.QuestSlots = 3
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" } -- за всю цепочку (растёт с уровнем и кругом)
=======
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" } -- за всю цепочку (растёт с уровнем и кругом)
-- ежедневная награда (7 дней по кругу), монеты растут с уровнем
---------------------------------------------------------------- серия улова
-- каждая рыба подряд без срыва: +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;
-- срыв, ушедшая рыба или 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 },
},
}
-- ежедневная награда (7 дней по кругу), серебро растёт с уровнем
Config.DailyRewards = {
{ coins = 100 },
{ coins = 200 },
@@ -310,25 +448,124 @@ 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
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.
-- Пока 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 = "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 мест в любой сумке" },
}
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 = "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 },
}
@@ -350,8 +587,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
---------------------------------------------------------------- помощники
File diff suppressed because it is too large. Load diff
+838
View File
@@ -0,0 +1,838 @@
-- Guild (ModuleScript) -> ServerScriptService
-- Гильдия рыбаков: ранги F–S, печати и жемчуг, испытания у Старейшины, личные заказы на доске,
-- наживка, ловушки-вентери, бонус отдыха и жетон ранга над головой.
-- Данные игрока хранит GameServer (profiles); он же вызывает отсюда хуки (улов, вход, статы).
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
local Guild = {}
local api -- функции GameServer: profiles, notify, updateStats, addXp, sendInventory, bagCapacity, isNight, weather, remote
local RANKS = Config.Guild.ranks
local GOLD = Color3.fromRGB(255, 214, 120)
local RED = Color3.fromRGB(255, 120, 120)
local GREEN = Color3.fromRGB(150, 230, 130)
function Guild.init(a)
api = a
-- только в Studio: проверки из командной строки/MCP (ServerStorage.GuildDebug:Invoke("get", player, "seals"))
if game:GetService("RunService"):IsStudio() then
local f = Instance.new("BindableFunction")
f.Name = "GuildDebug"
f.OnInvoke = function(op, player, key, value, extra)
local data = api.profiles[player]
if not data then
return nil
end
if op == "get" then
return data[key]
elseif op == "set" then
data[key] = value
api.updateStats(player)
elseif op == "addItem" then
key.uid = data.nextUid
data.nextUid += 1
table.insert(data.items, key)
api.sendInventory(player)
api.updateStats(player)
elseif op == "action" then
Guild.onAction(player, key, value, extra)
elseif op == "orders" then
Guild.refreshOrders(data, player)
return data.orders.list
end
return true
end
f.Parent = game:GetService("ServerStorage")
end
end
---------------------------------------------------------------- данные
-- новые поля (старые сохранения грузятся: чего нет — дополняем)
function Guild.defaults(data)
data.pearls = data.pearls or 0
data.seals = data.seals or 0
data.trial = data.trial -- { rank = номер ранга, progress = n } или nil
if type(data.orders) ~= "table" then
data.orders = { window = -1, list = {} }
end
if type(data.bait) ~= "table" then
data.bait = { equipped = nil, counts = {} }
end
data.bait.counts = data.bait.counts or {}
if type(data.traps) ~= "table" then
data.traps = {}
end
data.rest = data.rest or 0
if not data.rank then
-- сохранение до гильдии: кто уже дошёл до дальних миров, сохраняет к ним доступ
local lvl = data.level or 1
data.rank = (lvl >= 18 and 5) or (lvl >= 8 and 3) or 1
if data.rank > 1 then
data.seals = math.max(data.seals, RANKS[data.rank].seals)
end
end
end
-- данные игрока (для проверок из Studio)
function Guild.profile(player)
return api.profiles[player]
end
function Guild.rank(data)
return RANKS[math.clamp(data.rank or 1, 1, #RANKS)], data.rank or 1
end
local function nearSpot(player, attr)
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
local map = workspace:FindFirstChild("FishingMap")
if not hrp or not map then
return false
end
for _, d in ipairs(map:GetDescendants()) do
if d:IsA("BasePart") and d:GetAttribute(attr) then
if (d.Position - hrp.Position).Magnitude <= Config.Guild.elderDistance then
return true
end
end
end
return false
end
---------------------------------------------------------------- жетон ранга над головой
function Guild.badge(player)
local data = api.profiles[player]
local head = player.Character and player.Character:FindFirstChild("Head")
if not data or not head then
return
end
local r = Guild.rank(data)
local bb = head:FindFirstChild("RankBadge")
if not bb then
bb = Instance.new("BillboardGui")
bb.Name = "RankBadge"
bb.Size = UDim2.fromOffset(46, 52)
bb.StudsOffset = Vector3.new(0, 2.4, 0)
bb.MaxDistance = 70
bb.LightInfluence = 0
bb.Parent = head
-- щит: ромб с золотой каймой и буквой
local shield = Instance.new("Frame")
shield.Name = "Shield"
shield.Size = UDim2.fromOffset(34, 34)
shield.AnchorPoint = Vector2.new(0.5, 0.5)
shield.Position = UDim2.fromScale(0.5, 0.5)
shield.Rotation = 45
shield.Parent = bb
local c = Instance.new("UICorner")
c.CornerRadius = UDim.new(0, 6)
c.Parent = shield
local s = Instance.new("UIStroke")
s.Color = Color3.fromRGB(218, 172, 92)
s.Thickness = 3
s.Parent = shield
local g = Instance.new("UIGradient")
g.Color = ColorSequence.new(Color3.new(1, 1, 1), Color3.fromRGB(150, 150, 150))
g.Rotation = 45
g.Parent = shield
local t = Instance.new("TextLabel")
t.Name = "Letter"
t.Size = UDim2.fromScale(1, 1)
t.BackgroundTransparency = 1
t.FontFace = Font.new("rbxasset://fonts/families/Merriweather.json", Enum.FontWeight.Heavy)
t.TextScaled = true
t.TextColor3 = Color3.new(1, 1, 1)
t.TextStrokeTransparency = 0.2
t.TextStrokeColor3 = Color3.fromRGB(40, 28, 20)
t.ZIndex = 2
t.Parent = bb
end
bb.Shield.BackgroundColor3 = r.color
bb.Shield.UIGradient.Color = r.id == "S"
and ColorSequence.new({
ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 120, 120)), ColorSequenceKeypoint.new(0.35, Color3.fromRGB(255, 230, 120)),
ColorSequenceKeypoint.new(0.7, Color3.fromRGB(120, 230, 255)), ColorSequenceKeypoint.new(1, Color3.fromRGB(220, 130, 255)),
})
or ColorSequence.new(Color3.new(1, 1, 1), Color3.fromRGB(150, 150, 150))
bb.Shield.UIStroke.Color = (r.id == "S" or r.id == "A") and Color3.fromRGB(255, 225, 130) or Color3.fromRGB(218, 172, 92)
bb.Letter.Text = r.id
-- корона VIP — над жетоном
local vip = head:FindFirstChild("VipTag")
if vip then
vip.StudsOffset = Vector3.new(0, 4, 0)
end
end
---------------------------------------------------------------- состояние для клиента
local function orderText(o)
local f = o.fish and Config.FindFish(o.fish)
if o.kind == "deliver" then
return ("Сдай %d × %s"):format(o.count, f and f.name or "?")
elseif o.kind == "heavy" then
return ("Принеси %s тяжелее %.1f кг"):format(f and f.name or "?", o.minW)
elseif o.kind == "weather" then
return ("Поймай %d рыб в дождь или грозу"):format(o.count)
elseif o.kind == "night" then
return ("Поймай %d «Необычных» или реже ночью"):format(o.count)
elseif o.kind == "combo" then
return ("Набери серию из %d рыб"):format(o.count)
elseif o.kind == "perfect" then
return ("Сделай %d забросов в зелёную зону"):format(o.count)
end
return o.kind
end
Guild.orderText = orderText
local function trialState(data)
local nextRank = RANKS[(data.rank or 1) + 1]
if not nextRank then
return nil
end
local active = data.trial and data.trial.rank == data.rank + 1
local t = nextRank.trial
local goal = t.count or 1
local progress = active and data.trial.progress or 0
if t.kind == "dex" then
local zone = Config.Zones[t.world]
goal, progress = #zone.fish, 0
for _, f in ipairs(zone.fish) do
if data.discovered[f.id] then
progress += 1
end
end
end
return {
rank = data.rank + 1, text = t.text, active = active, progress = progress, goal = goal,
ready = data.seals >= nextRank.seals,
}
end
function Guild.sendState(player)
local data = api.profiles[player]
if not data then
return
end
Guild.refreshOrders(data, player)
local list = {}
for i, o in ipairs(data.orders.list) do
list[i] = {
kind = o.kind, text = orderText(o), progress = o.progress, count = o.count, done = o.done,
seals = o.seals, coins = o.coins, pearls = o.pearls, deliver = (o.kind == "deliver" or o.kind == "heavy"),
}
end
local now = os.time()
local traps = {}
for i, t0 in ipairs(data.traps) do
traps[i] = math.min(Config.Traps.max, math.floor((now - t0) / Config.Traps.every))
end
api.remote:FireClient(player, "Guild", {
trial = trialState(data),
orders = list,
ordersEnd = (data.orders.window + 1) * Config.Orders.period,
traps = traps, trapSlots = Guild.rank(data).traps or 0, trapEvery = Config.Traps.every, trapMax = Config.Traps.max,
baits = data.bait.counts, bait = data.bait.equipped,
})
end
-- атрибуты игрока (HUD и окна читают их)
function Guild.attrs(player, data)
local r, idx = Guild.rank(data)
player:SetAttribute("Pearls", data.pearls)
player:SetAttribute("Seals", data.seals)
player:SetAttribute("GuildRank", r.id)
player:SetAttribute("RankIdx", idx)
local nextRank = RANKS[idx + 1]
player:SetAttribute("SealsNext", nextRank and nextRank.seals or nil)
player:SetAttribute("RestLeft", math.floor(data.rest))
player:SetAttribute("Bait", data.bait.equipped)
player:SetAttribute("BaitCount", data.bait.equipped and (data.bait.counts[data.bait.equipped] or 0) or 0)
local ready = 0
for _, t0 in ipairs(data.traps) do
ready += math.min(Config.Traps.max, math.floor((os.time() - t0) / Config.Traps.every))
end
player:SetAttribute("TrapFish", ready)
end
---------------------------------------------------------------- ранги и испытания
local function rankUp(player, data)
data.rank += 1
data.trial = nil
data.pearls += Config.Pearls.rankUp
local r = RANKS[data.rank]
-- новые ловушки начинают копить с этого момента
while #data.traps < (r.traps or 0) do
table.insert(data.traps, os.time())
end
api.remote:FireClient(player, "RankUp", r.id, r.name, r.unlocks, Config.Pearls.rankUp)
for _, p in ipairs(Players:GetPlayers()) do
api.notify(p, ("⚔ %s получил ранг %s — «%s»!"):format(player.DisplayName, r.id, r.name), GOLD)
end
Guild.badge(player)
api.updateStats(player)
Guild.sendState(player)
end
local function trialProgress(player, data, amount)
local st = data.trial
local nextRank = RANKS[data.rank + 1]
if not st or not nextRank or st.rank ~= data.rank + 1 then
return
end
st.progress = (st.progress or 0) + amount
if st.progress >= (nextRank.trial.count or 1) then
rankUp(player, data)
else
Guild.sendState(player)
end
end
local function checkDexTrial(player, data)
local st = data.trial
local nextRank = RANKS[data.rank + 1]
if st and nextRank and st.rank == data.rank + 1 and nextRank.trial.kind == "dex" then
local s = trialState(data)
if s.progress >= s.goal then
rankUp(player, data)
end
end
end
local function takeTrial(player, data)
local nextRank = RANKS[data.rank + 1]
if not nextRank then
api.notify(player, "👑 Ты уже Легенда гильдии!", GOLD)
return
end
if data.seals < nextRank.seals then
api.notify(player, ("📜 Нужно %d печатей (у тебя %d)"):format(nextRank.seals, data.seals), RED)
return
end
if not nearSpot(player, "GuildElder") then
api.notify(player, "⚔ Испытание выдаёт " .. Config.Guild.elder .. " — он в здании гильдии в лобби", Color3.fromRGB(255, 200, 120))
return
end
local t = nextRank.trial
if t.kind == "deliver" then
-- сдать рыбу из сумки сразу, если она есть
local have, keep = 0, {}
for _, item in ipairs(data.items) do
if item.id == t.fish and have < t.count then
have += 1
else
table.insert(keep, item)
end
end
if have < t.count then
local f = Config.FindFish(t.fish)
api.notify(player, ("🐟 Принеси %d × %s (в сумке %d)"):format(t.count, f and f.name or t.fish, have), RED)
data.trial = { rank = data.rank + 1, progress = 0 }
Guild.sendState(player)
return
end
data.items = keep
api.sendInventory(player)
data.trial = { rank = data.rank + 1, progress = 0 }
trialProgress(player, data, t.count)
return
end
if not (data.trial and data.trial.rank == data.rank + 1) then
data.trial = { rank = data.rank + 1, progress = 0 }
api.notify(player, "⚔ Испытание принято: " .. t.text, GOLD)
end
if t.kind == "dex" then
checkDexTrial(player, data)
end
Guild.sendState(player)
end
---------------------------------------------------------------- заказы
local function pick(rng, weights)
local total = 0
for _, w in pairs(weights) do
total += w
end
local roll = rng:NextNumber() * total
for k, w in pairs(weights) do
roll -= w
if roll <= 0 then
return k
end
end
return next(weights)
end
-- рыба для заказов: из миров, куда игрок уже может попасть
local function fishPool(data, rarities)
local pool = {}
for _, w in ipairs(Config.Worlds) do
local zone = Config.Zones[w.id]
local needRank = Config.Guild.worldRank[w.id] or 1
if zone and not w.soon and data.level >= w.level and data.rank >= needRank then
for _, f in ipairs(zone.fish) do
if rarities[f.rarity] then
table.insert(pool, f)
end
end
end
end
return pool
end
local function makeOrder(data, rng)
local O = Config.Orders
local weights = {}
for k, v in pairs(O.kinds) do
weights[k] = v.weight
end
-- порядок ключей в pairs не задан: сортируем, чтобы при одном зерне выпадало одно и то же
local kind
do
local keys = {}
for k in pairs(weights) do
table.insert(keys, k)
end
table.sort(keys)
local total = 0
for _, k in ipairs(keys) do
total += weights[k]
end
local roll = rng:NextNumber() * total
for _, k in ipairs(keys) do
roll -= weights[k]
if roll <= 0 then
kind = k
break
end
end
kind = kind or keys[1]
end
local r = data.rank or 1
local hard = rng:NextNumber() -- сложность заказа 0..1
local o = { kind = kind, progress = 0, done = false }
if kind == "deliver" then
local pool = fishPool(data, r >= 3 and { Common = true, Uncommon = true, Rare = true } or { Common = true, Uncommon = true })
local f = pool[rng:NextInteger(1, #pool)]
local rank = Config.Rarities[f.rarity].rank
o.fish = f.id
o.count = math.max(1, math.floor((rank == 1 and 5 or (rank == 2 and 3 or 1)) * (0.7 + hard * 0.8) + 0.5))
elseif kind == "heavy" then
local pool = fishPool(data, { Uncommon = true, Rare = true })
local f = pool[rng:NextInteger(1, #pool)]
o.fish = f.id
o.count = 1
o.minW = math.floor((f.minW + (f.maxW - f.minW) * (0.25 + hard * 0.3)) * 10) / 10
elseif kind == "weather" then
o.count = 2 + math.floor(hard * 3) + r
elseif kind == "night" then
o.count = 1 + math.floor(hard * 2) + math.floor(r / 2)
elseif kind == "combo" then
o.count = math.min(15, 4 + math.floor(hard * 4) + r)
elseif kind == "perfect" then
o.count = 3 + math.floor(hard * 4) + r
end
local s = O.kinds[kind].seals
o.seals = math.floor(s[1] + (s[2] - s[1]) * hard + 0.5) + (r - 1) * 2
o.coins = math.floor(o.seals * O.coinsPerSeal * (1 + 0.5 * (r - 1)))
o.pearls = rng:NextNumber() < O.pearlChance and rng:NextInteger(O.pearlsMin, O.pearlsMax) or 0
return o
end
-- новое окно (каждые 3 часа) — новые заказы; на ранге E и выше их 4
function Guild.refreshOrders(data, player)
local window = math.floor(os.time() / Config.Orders.period)
local want = Guild.rank(data).orders
if data.orders.window ~= window then
local seed = ((player and player.UserId or 0) % 100000) * 7919 + window
local rng = Random.new(seed)
data.orders = { window = window, list = {} }
local seen = {}
for i = 1, want do
-- без повторов: один и тот же тип с той же рыбой не выпадает дважды
local o
for _ = 1, 6 do
o = makeOrder(data, rng)
if not seen[o.kind .. (o.fish or "")] then
break
end
end
seen[o.kind .. (o.fish or "")] = true
data.orders.list[i] = o
end
else
-- ранг вырос посреди окна: добавляем недостающий заказ
local seen = {}
for _, o in ipairs(data.orders.list) do
seen[o.kind .. (o.fish or "")] = true
end
while #data.orders.list < want do
local o
for _ = 1, 6 do
o = makeOrder(data, Random.new())
if not seen[o.kind .. (o.fish or "")] then
break
end
end
seen[o.kind .. (o.fish or "")] = true
table.insert(data.orders.list, o)
end
end
end
local function finishOrder(player, data, o)
o.done = true
data.seals += o.seals
data.coins += o.coins
data.pearls += o.pearls
api.notify(player, ("📜 Заказ выполнен! +%d печатей +%d ⚪%s"):format(o.seals, o.coins, o.pearls > 0 and (" +" .. o.pearls .. " 🦪") or ""), GOLD)
api.remote:FireClient(player, "OrderDone")
local nextRank = RANKS[data.rank + 1]
if nextRank and data.seals >= nextRank.seals and data.seals - o.seals < nextRank.seals then
api.notify(player, ("⚔ Печатей хватает на ранг %s! Иди к Старейшине за испытанием"):format(nextRank.id), GOLD)
end
api.updateStats(player)
Guild.sendState(player)
end
local function deliverOrder(player, data, i)
Guild.refreshOrders(data, player)
local o = data.orders.list[i]
if not o or o.done or (o.kind ~= "deliver" and o.kind ~= "heavy") then
return
end
if not nearSpot(player, "OrderBoard") then
api.notify(player, "📜 Рыбу сдают у доски заказов в здании гильдии", Color3.fromRGB(255, 200, 120))
return
end
local need = o.count - o.progress
local keep = {}
-- сдаём сначала самую дешёвую подходящую рыбу
local fit = {}
for _, item in ipairs(data.items) do
if item.id == o.fish and (not o.minW or item.weight >= o.minW) then
table.insert(fit, item)
end
end
table.sort(fit, function(a, b)
return a.value < b.value
end)
local take = {}
for k = 1, math.min(need, #fit) do
take[fit[k].uid] = true
end
local given = 0
for _, item in ipairs(data.items) do
if take[item.uid] then
given += 1
else
table.insert(keep, item)
end
end
if given == 0 then
local f = Config.FindFish(o.fish)
api.notify(player, ("🎒 В сумке нет подходящей рыбы: %s"):format(f and f.name or o.fish), RED)
return
end
data.items = keep
o.progress += given
api.sendInventory(player)
if o.progress >= o.count then
finishOrder(player, data, o)
else
api.updateStats(player)
Guild.sendState(player)
end
end
local function rerollOrder(player, data, i)
Guild.refreshOrders(data, player)
local o = data.orders.list[i]
if not o or o.done then
return
end
local cost = Config.Orders.rerollPearls
if data.pearls < cost then
api.notify(player, ("🦪 Нужно %d жемчуга"):format(cost), RED)
return
end
data.pearls -= cost
data.orders.list[i] = makeOrder(data, Random.new())
api.updateStats(player)
Guild.sendState(player)
end
---------------------------------------------------------------- улов: заказы, испытания, жемчуг
-- ctx: { weather = id, night = bool, perfect = bool (заброс в зелёную зону), streak = n, auto = bool }
function Guild.onCatch(player, data, fish, ctx)
local rank = Config.Rarities[fish.rarity].rank
-- жемчуг за мутацию
local pearls = fish.mutation and Config.Pearls.mutation[fish.mutation] or 0
if pearls > 0 then
data.pearls += pearls
api.notify(player, ("🦪 +%d жемчуга за мутацию!"):format(pearls), Color3.fromRGB(235, 225, 245))
end
local rainy = ctx.weather == "Rain" or ctx.weather == "Storm"
-- заказы «по ходу»
Guild.refreshOrders(data, player)
local changed = false
for _, o in ipairs(data.orders.list) do
if not o.done then
local add = 0
if o.kind == "weather" and rainy then
add = 1
elseif o.kind == "night" and ctx.night and rank >= 2 then
add = 1
elseif o.kind == "perfect" and ctx.perfect then
add = 1
elseif o.kind == "combo" and (ctx.streak or 0) > o.progress then
o.progress = math.min(o.count, ctx.streak)
changed = true
if o.progress >= o.count then
finishOrder(player, data, o)
end
end
if add > 0 then
o.progress = math.min(o.count, o.progress + add)
changed = true
if o.progress >= o.count then
finishOrder(player, data, o)
end
end
end
end
-- испытание
local nextRank = RANKS[data.rank + 1]
if data.trial and nextRank and data.trial.rank == data.rank + 1 then
local t = nextRank.trial
if t.kind == "catch" and rank >= (t.minRank or 1)
and (not t.weathers or t.weathers[ctx.weather])
and (not t.night or ctx.night) then
trialProgress(player, data, 1)
elseif t.kind == "dex" then
checkDexTrial(player, data)
end
end
if changed or pearls > 0 then
Guild.sendState(player)
end
end
-- победа над боссом: испытание ранга C и жемчуг
function Guild.onBossWin(player, data)
data.pearls += Config.Pearls.boss
api.notify(player, ("🦪 +%d жемчуга за босса!"):format(Config.Pearls.boss), Color3.fromRGB(235, 225, 245))
local nextRank = RANKS[data.rank + 1]
if data.trial and nextRank and data.trial.rank == data.rank + 1 and nextRank.trial.kind == "bossWin" then
trialProgress(player, data, 1)
end
end
---------------------------------------------------------------- миры, скидки
function Guild.canEnter(data, worldId)
local need = Config.Guild.worldRank[worldId]
if need and (data.rank or 1) < need then
return false, ("🔒 Нужен ранг гильдии %s"):format(RANKS[need].id)
end
return true
end
function Guild.price(data, price)
local d = Guild.rank(data).discount or 0
return math.floor(price * (1 - d) + 0.5)
end
---------------------------------------------------------------- наживка
function Guild.bait(data)
local id = data.bait.equipped
if id and (data.bait.counts[id] or 0) > 0 then
return Config.Find(Config.Baits, id)
end
return nil
end
-- тратим 1 штуку на заброс; кончилась — слот пустеет
function Guild.useBait(player, data)
local b = Guild.bait(data)
if not b then
return nil
end
data.bait.counts[b.id] -= 1
if data.bait.counts[b.id] <= 0 then
data.bait.counts[b.id] = nil
data.bait.equipped = nil
api.notify(player, b.icon .. " " .. b.name .. " закончился", Color3.fromRGB(255, 200, 120))
end
player:SetAttribute("BaitCount", data.bait.equipped and (data.bait.counts[data.bait.equipped] or 0) or 0)
player:SetAttribute("Bait", data.bait.equipped)
return b
end
local function buyBait(player, data, id)
local b = Config.Find(Config.Baits, id)
if not b then
return
end
if b.rank and data.rank < b.rank then
api.notify(player, ("🔒 Нужен ранг гильдии %s"):format(RANKS[b.rank].id), RED)
return
end
if b.currency == "pearls" then
if data.pearls < b.price then
api.notify(player, ("Нужно %d 🦪"):format(b.price), RED)
return
end
data.pearls -= b.price
else
local price = Guild.price(data, b.price)
if data.coins < price then
api.notify(player, ("Нужно %d ⚪"):format(price), RED)
return
end
data.coins -= price
end
data.bait.counts[b.id] = (data.bait.counts[b.id] or 0) + b.pack
if not Guild.bait(data) then
data.bait.equipped = b.id
end
api.notify(player, ("%s +%d × %s"):format(b.icon, b.pack, b.name), GREEN)
api.updateStats(player)
Guild.sendState(player)
end
local function equipBait(player, data, id)
if id == nil or id == "" then
data.bait.equipped = nil
elseif (data.bait.counts[id] or 0) > 0 then
data.bait.equipped = id
else
return
end
api.updateStats(player)
Guild.sendState(player)
end
---------------------------------------------------------------- ловушки
local function rollTrapFish(rng)
local T = Config.Traps
local rarity = pick(rng, T.rarities)
local pool = {}
for _, f in ipairs(Config.Zones[T.world].fish) do
if f.rarity == rarity then
table.insert(pool, f)
end
end
local f = pool[rng:NextInteger(1, #pool)]
local wf = rng:NextNumber() ^ 2.2
return {
id = f.id, name = f.name, rarity = f.rarity,
weight = math.floor((f.minW + (f.maxW - f.minW) * wf) * 100) / 100,
value = math.floor(f.price * (0.75 + 0.9 * wf) + 0.5),
}
end
local function collectTraps(player, data)
local T = Config.Traps
local now = os.time()
local cap = api.bagCapacity(player, data)
local rng = Random.new()
local got = 0
for i, t0 in ipairs(data.traps) do
local ready = math.min(T.max, math.floor((now - t0) / T.every))
local take = math.min(ready, cap - #data.items)
for _ = 1, take do
local f = rollTrapFish(rng)
f.uid = data.nextUid
data.nextUid += 1
table.insert(data.items, f)
local rec = data.discovered[f.id]
if not rec then
data.discovered[f.id] = { count = 1, best = f.weight }
else
rec.count += 1
end
end
got += take
-- что не влезло, остаётся в ловушке; полная ловушка дальше не копит
local left = ready - take
data.traps[i] = now - left * T.every
end
if got == 0 then
api.notify(player, #data.traps == 0 and "🧺 Ловушки — с ранга D" or ((#data.items >= cap) and "🎒 Сумка полна!" or "🧺 В ловушках пока пусто"), Color3.fromRGB(255, 200, 120))
else
data.totalCaught += got
api.notify(player, ("🧺 Из ловушек: +%d рыб"):format(got), GREEN)
api.sendInventory(player)
end
api.updateStats(player)
Guild.sendState(player)
end
---------------------------------------------------------------- отдых
function Guild.onJoin(player, data)
local last = data.lastOnline
if last and last > 0 then
local away = os.time() - last
data.rest = math.min(Config.Rest.max, (data.rest or 0) + away / Config.Rest.perOffline)
end
-- ловушки по рангу (старые сохранения, ранг выдан миграцией)
while #data.traps < (Guild.rank(data).traps or 0) do
table.insert(data.traps, os.time())
end
end
function Guild.onLeave(data)
data.lastOnline = os.time()
end
-- множитель опыта: двойной, пока есть отдых
function Guild.xpMult(data)
return (data.rest or 0) > 0 and Config.Rest.mult or 1
end
-- отдых тратится секундами, пока игрок рыбачит
function Guild.spendRest(player, data, seconds)
if (data.rest or 0) > 0 then
data.rest = math.max(0, data.rest - seconds)
player:SetAttribute("RestLeft", math.floor(data.rest))
end
end
---------------------------------------------------------------- события от клиента
function Guild.onAction(player, action, a, b)
local data = api.profiles[player]
if not data then
return false
end
if action == "GuildState" then
Guild.sendState(player)
elseif action == "TakeTrial" then
takeTrial(player, data)
elseif action == "DeliverOrder" then
deliverOrder(player, data, tonumber(a))
elseif action == "RerollOrder" then
rerollOrder(player, data, tonumber(a))
elseif action == "BuyBait" then
buyBait(player, data, a)
elseif action == "EquipBait" then
equipBait(player, data, a)
elseif action == "CollectTraps" then
collectTraps(player, data)
else
return false
end
return true
end
return Guild
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,46 @@
-- WeatherServer (Script) -> ServerScriptService
-- Общие для всего сервера время суток и погода. Ничего не рисует — только выставляет атрибуты workspace:
-- DayStart — серверное время начала суток (часы считает Config.ClockAt)
-- Weather — id погоды из Config.Weathers
-- WeatherEnds — когда сменится (workspace:GetServerTimeNow())
-- Небо, дождь, звуки и свет делает клиент (Ambience), бонусы к рыбалке учитывает GameServer.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
local rng = Random.new()
if Config.DayNight.enabled then
workspace:SetAttribute("DayStart", workspace:GetServerTimeNow())
end
local function pickWeather(previous)
local total = 0
for _, w in ipairs(Config.Weathers) do
if w.id ~= previous then
total += w.weight
end
end
local roll = rng:NextNumber() * total
for _, w in ipairs(Config.Weathers) do
if w.id ~= previous then
roll -= w.weight
if roll <= 0 then
return w
end
end
end
return Config.Weathers[1]
end
task.spawn(function()
-- первая погода всегда ясная: новичок видит мир чистым
local current = Config.Weathers[1]
while true do
local duration = rng:NextInteger(current.duration[1], current.duration[2])
workspace:SetAttribute("Weather", current.id)
workspace:SetAttribute("WeatherEnds", workspace:GetServerTimeNow() + duration)
task.wait(duration)
current = pickWeather(current.id)
end
end)
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,336 @@
-- Ambience (LocalScript) -> StarterPlayer > StarterPlayerScripts
-- Атмосфера у этого игрока: время суток, ночной свет, тучи, дождь/снег, молнии, музыка и звуки окружения,
-- плашка «погода и время» на экране. Время и погоду задаёт сервер (WeatherServer) атрибутами workspace.
-- Свет локации (Config.Worlds[*].look) ставит FishingClient; здесь всё накладывается поверх:
-- свои эффекты цвета живут в камере, поэтому не мешают настройкам локаций.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local Lighting = game:GetService("Lighting")
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
local Audio = require(script.Parent:WaitForChild("Audio"))
local player = Players.LocalPlayer
local terrain = workspace.Terrain
local rng = Random.new()
local WHITE = Color3.new(1, 1, 1)
local function new(class, props)
local o = Instance.new(class)
for k, v in pairs(props) do
if k ~= "Parent" then
o[k] = v
end
end
o.Parent = props.Parent
return o
end
local function clockNow()
return Config.ClockAt(workspace:GetServerTimeNow(), workspace:GetAttribute("DayStart"))
end
local function currentPlace()
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
if not hrp then
return nil, "Lobby"
end
local w = Config.WorldAt(hrp.Position)
return w, w and w.id or "Lobby"
end
local function currentWeather()
return Config.WeatherById(workspace:GetAttribute("Weather"))
end
---------------------------------------------------------------- вид погоды
-- cc — поправка цвета поверх света локации; cover/density/cloud — облака; rain — частиц в секунду
local LOOK = {
Clear = { cover = 0.4, density = 0.45, cloud = Color3.fromRGB(255, 255, 255), rain = 0,
cc = { Brightness = 0, Saturation = 0, Contrast = 0, TintColor = WHITE } },
Cloudy = { cover = 0.78, density = 0.6, cloud = Color3.fromRGB(215, 218, 226), rain = 0,
cc = { Brightness = -0.03, Saturation = -0.1, Contrast = 0, TintColor = Color3.fromRGB(236, 239, 246) } },
Rain = { cover = 0.88, density = 0.75, cloud = Color3.fromRGB(165, 170, 182), rain = 350, rainSound = "rainLight",
cc = { Brightness = -0.06, Saturation = -0.18, Contrast = 0.02, TintColor = Color3.fromRGB(214, 224, 240) } },
Storm = { cover = 0.96, density = 0.9, cloud = Color3.fromRGB(105, 110, 124), rain = 900, rainSound = "rainHeavy", lightning = true,
cc = { Brightness = -0.12, Saturation = -0.3, Contrast = 0.06, TintColor = Color3.fromRGB(190, 200, 226) } },
Fog = { cover = 0.6, density = 0.5, cloud = Color3.fromRGB(232, 232, 238), rain = 0,
cc = { Brightness = 0.02, Saturation = -0.22, Contrast = -0.05, TintColor = Color3.fromRGB(234, 238, 242) } },
}
-- эффекты в камере: действуют только у этого игрока и не путаются с эффектами Lighting
local camera = workspace.CurrentCamera
local weatherCC = new("ColorCorrectionEffect", { Name = "WeatherCC", Parent = camera })
local nightCC = new("ColorCorrectionEffect", { Name = "NightCC", Parent = camera })
workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
camera = workspace.CurrentCamera
weatherCC.Parent = camera
nightCC.Parent = camera
end)
local clouds = terrain:FindFirstChildOfClass("Clouds") or new("Clouds", { Parent = terrain })
-- дождь (а во фьорде — снег) сыплется из невидимой плиты над камерой
local rainPart = new("Part", {
Name = "RainFX", Anchored = true, CanCollide = false, CanQuery = false, CanTouch = false,
Transparency = 1, Size = Vector3.new(110, 1, 110), Parent = workspace,
})
local rain = new("ParticleEmitter", {
Texture = "rbxasset://textures/SelfView/whiteRect.png",
Rate = 0, Lifetime = NumberRange.new(1.1, 1.4), Speed = NumberRange.new(55, 70),
EmissionDirection = Enum.NormalId.Bottom, SpreadAngle = Vector2.new(4, 4),
Orientation = Enum.ParticleOrientation.VelocityParallel,
Size = NumberSequence.new(0.07), Squash = NumberSequence.new(2.5),
Color = ColorSequence.new(Color3.fromRGB(200, 215, 235)), Transparency = NumberSequence.new(0.45),
LightInfluence = 1,
Parent = rainPart,
})
local function rainStyle(snowy)
if snowy then
rain.Speed = NumberRange.new(6, 10)
rain.Lifetime = NumberRange.new(5, 7)
rain.Size = NumberSequence.new(0.22)
rain.Squash = NumberSequence.new(0)
rain.SpreadAngle = Vector2.new(25, 25)
rain.Orientation = Enum.ParticleOrientation.FacingCamera
rain.Color = ColorSequence.new(WHITE)
rain.Transparency = NumberSequence.new(0.1)
else
rain.Speed = NumberRange.new(55, 70)
rain.Lifetime = NumberRange.new(1.1, 1.4)
rain.Size = NumberSequence.new(0.07)
rain.Squash = NumberSequence.new(2.5)
rain.SpreadAngle = Vector2.new(4, 4)
rain.Orientation = Enum.ParticleOrientation.VelocityParallel
rain.Color = ColorSequence.new(Color3.fromRGB(200, 215, 235))
rain.Transparency = NumberSequence.new(0.45)
end
end
local appliedWeather, appliedPlace = nil, nil
local function applyWeather(instant)
local w = currentWeather()
local _, placeId = currentPlace()
if appliedWeather == w.id and appliedPlace == placeId and not instant then
return
end
appliedWeather, appliedPlace = w.id, placeId
local look = LOOK[w.id] or LOOK.Clear
local info = TweenInfo.new(instant and 0 or 6)
TweenService:Create(weatherCC, info, look.cc):Play()
TweenService:Create(clouds, info, { Cover = look.cover, Density = look.density }):Play() -- цвет туч ставит главный цикл (с учётом ночи)
local snowy = placeId == "World3"
rainStyle(snowy)
rain.Rate = snowy and look.rain * 0.35 or look.rain
end
---------------------------------------------------------------- молнии
task.spawn(function()
while true do
task.wait(rng:NextNumber(6, 16))
local w = currentWeather()
local _, placeId = currentPlace()
if LOOK[w.id] and LOOK[w.id].lightning and placeId ~= "World3" then
-- двойная вспышка, гром приходит чуть позже (молния далеко)
local base = weatherCC.Brightness
for _ = 1, 2 do
weatherCC.Brightness = base + 0.45
task.wait(0.06)
weatherCC.Brightness = base
task.wait(0.09)
end
local far = rng:NextNumber()
task.delay(0.2 + far * 1.4, function()
local list = Config.Sounds.thunder
Audio.playId(list[rng:NextInteger(1, #list)], 0.9 - far * 0.5, "ambient")
end)
end
end
end)
---------------------------------------------------------------- музыка
local tracks = {}
local function track(name)
if not tracks[name] then
tracks[name] = Audio.loop(name, "music")
end
return tracks[name]
end
local currentTrack = nil
local function musicFor(placeId, night)
if night and placeId ~= "World2" then
return "musicNight"
end
if placeId == "Lobby" then
return (math.floor(workspace:GetServerTimeNow() / 600) % 2 == 0) and "musicLobby" or "musicLobby2"
elseif placeId == "World1" then
return (math.floor(workspace:GetServerTimeNow() / 600) % 2 == 0) and "musicLake" or "musicLake2"
elseif placeId == "World3" then
return "musicNight"
end
return "musicLake2"
end
---------------------------------------------------------------- звуки окружения
local ambient = {}
for _, name in ipairs({ "birdsLake", "birdsPark", "birdsJungle", "crickets", "lakeWater", "wind", "rainLight", "rainHeavy" }) do
ambient[name] = Audio.loop(name, "ambient")
end
-- какие петли и насколько громко звучат сейчас
local function ambientMix(placeId, night, w)
local mix = {}
local day = not night
mix.birdsLake = (day and placeId == "World1") and 1 or 0
mix.birdsPark = (day and placeId == "Lobby") and 1 or 0
mix.birdsJungle = (day and placeId == "World2") and 1 or 0
mix.crickets = (night and placeId ~= "World3") and 1 or 0
mix.lakeWater = (placeId == "World1" or placeId == "World2") and 1 or 0
local wind = 1
if placeId == "World3" then
wind = 2.5
end
if w.id == "Storm" then
wind *= 2
end
mix.wind = wind
local wet = placeId ~= "World3"
mix.rainLight = (wet and w.id == "Rain") and 1 or 0
mix.rainHeavy = (wet and w.id == "Storm") and 1 or 0
-- в дождь птицы прячутся
if w.id == "Rain" or w.id == "Storm" then
mix.birdsLake, mix.birdsPark, mix.birdsJungle = 0, 0, 0
end
return mix
end
-- треск у каждого костра на карте (звук в самом костре: слышно только рядом)
task.spawn(function()
local map = workspace:WaitForChild("FishingMap", 60)
if not map then
return
end
task.wait(3)
local def = Config.Sounds.fire
for _, d in ipairs(map:GetDescendants()) do
if d:IsA("Fire") and d.Parent and d.Parent:IsA("BasePart") then
new("Sound", {
Name = "FireCrackle", SoundId = def.id, Volume = def.volume, Looped = true, Playing = true,
RollOffMode = Enum.RollOffMode.InverseTapered, RollOffMinDistance = 6, RollOffMaxDistance = def.roll or 30,
SoundGroup = Audio.groups.ambient, Parent = d.Parent,
})
end
end
end)
---------------------------------------------------------------- плашка «погода и время»
-- в стиле интерфейса (UiTheme): тёмное дерево с золотой рамкой; масштаб — как у основного интерфейса
local Theme = require(script.Parent:WaitForChild("UiTheme"))
local hud = new("ScreenGui", { Name = "WeatherHud", ResetOnSpawn = false, IgnoreGuiInset = false, Parent = player:WaitForChild("PlayerGui") })
local pill = new("Frame", {
Size = UDim2.fromOffset(230, 48), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 74),
BackgroundColor3 = Theme.C.woodDark, BackgroundTransparency = 0.08, Parent = Theme.followScale(hud),
})
new("UICorner", { CornerRadius = UDim.new(0, 8), Parent = pill })
local pillStroke = new("UIStroke", { Color = Theme.C.goldDark, Thickness = 2, Transparency = 0, Parent = pill })
local line1 = new("TextLabel", {
Size = UDim2.new(1, -16, 0, 24), Position = UDim2.fromOffset(10, 3), BackgroundTransparency = 1,
FontFace = Theme.TITLE_FACE, TextSize = 16, TextColor3 = Theme.C.parchment, TextXAlignment = Enum.TextXAlignment.Left,
Text = "", Parent = pill,
})
local line2 = new("TextLabel", {
Size = UDim2.new(1, -16, 0, 16), Position = UDim2.fromOffset(10, 27), BackgroundTransparency = 1,
FontFace = Theme.BODY2_FACE, TextSize = 12, TextColor3 = Color3.fromRGB(170, 215, 140), TextXAlignment = Enum.TextXAlignment.Left,
Text = "", Parent = pill,
})
local function weatherName(w, placeId)
return (w.names and w.names[placeId]) or w.name
end
local lastShownWeather = nil
local function refreshPill(clock, night, w, placeId)
local h = math.floor(clock)
local m = math.floor((clock - h) * 60)
line1.Text = ("%s %s · %s %02d:%02d"):format(w.icon, weatherName(w, placeId), night and "🌙" or "☀", h, m)
local bonus = {}
if w.desc then
table.insert(bonus, w.desc)
end
if night then
table.insert(bonus, ("Ночь: удача +%d%%"):format(math.floor(Config.DayNight.nightLuck * 100 + 0.5)))
end
line2.Text = #bonus > 0 and table.concat(bonus, " · ") or "Спокойная погода"
if lastShownWeather ~= w.id then
-- погода сменилась: плашка вспыхивает
if lastShownWeather ~= nil then
pillStroke.Color = Color3.fromRGB(255, 220, 120)
pillStroke.Transparency = 0
TweenService:Create(pillStroke, TweenInfo.new(2.5), { Color = Theme.C.goldDark, Transparency = 0 }):Play()
end
lastShownWeather = w.id
end
end
---------------------------------------------------------------- главный цикл
-- часы двигаются каждый кадр (плавно), остальное проверяется раз в полсекунды
RunService.RenderStepped:Connect(function()
if Config.DayNight.enabled then
Lighting.ClockTime = clockNow()
end
if camera then
rainPart.CFrame = CFrame.new(camera.CFrame.Position + Vector3.new(0, 35, 0))
end
end)
workspace:GetAttributeChangedSignal("Weather"):Connect(function()
applyWeather(false)
end)
applyWeather(true)
task.spawn(function()
while true do
local clock = clockNow()
local nightness = Config.DayNight.enabled and Config.Nightness(clock) or 0
local night = nightness >= 0.5
local w = currentWeather()
local _, placeId = currentPlace()
-- ночь: темнее, холоднее, менее насыщенно
nightCC.Brightness = -0.1 * nightness
nightCC.Saturation = -0.18 * nightness
nightCC.TintColor = WHITE:Lerp(Color3.fromRGB(165, 185, 255), nightness)
clouds.Color = (LOOK[w.id] or LOOK.Clear).cloud:Lerp(Color3.fromRGB(40, 45, 60), nightness * 0.8)
applyWeather(false) -- смена локации меняет дождь на снег и обратно
-- музыка: плавная смена трека, в грозу тише
local want = musicFor(placeId, night)
local duck = (w.id == "Storm") and 0.5 or 1
if currentTrack ~= want then
if currentTrack then
Audio.fade(track(currentTrack), 0, 3)
end
currentTrack = want
end
Audio.fade(track(want), duck, 3)
for name, factor in pairs(ambientMix(placeId, night, w)) do
Audio.fade(ambient[name], factor, 3)
end
refreshPill(clock, night, w, placeId)
task.wait(0.5)
end
end)
@@ -0,0 +1,128 @@
-- Audio (ModuleScript) -> StarterPlayer > StarterPlayerScripts
-- Звуки у этого игрока. Три группы громкости: музыка, эффекты и окружение (окружение — по громкости эффектов).
-- Громкость берётся из атрибутов игрока VolMusic / VolSfx (их выставляет и сохраняет сервер).
-- Audio.play(name) — разовый звук из Config.Sounds
-- Audio.loop(name, group) — петля (молчит, пока не вызвать Audio.fade)
-- Audio.fade(sound, factor) — плавно к громкости «базовая × factor» (0 — тишина, звук ставится на паузу)
local Players = game:GetService("Players")
local SoundService = game:GetService("SoundService")
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
local player = Players.LocalPlayer
local rng = Random.new()
local Audio = {}
local function group(name)
local g = SoundService:FindFirstChild(name)
if not g then
g = Instance.new("SoundGroup")
g.Name = name
g.Parent = SoundService
end
return g
end
Audio.groups = {
music = group("MusicGroup"),
sfx = group("SfxGroup"),
ambient = group("AmbientGroup"),
}
local function applyVolumes()
local music = player:GetAttribute("VolMusic") or Config.DefaultVolume.music
local sfx = player:GetAttribute("VolSfx") or Config.DefaultVolume.sfx
Audio.groups.music.Volume = music
Audio.groups.sfx.Volume = sfx
Audio.groups.ambient.Volume = sfx
end
applyVolumes()
player:GetAttributeChangedSignal("VolMusic"):Connect(applyVolumes)
player:GetAttributeChangedSignal("VolSfx"):Connect(applyVolumes)
function Audio.play(name, volumeMult)
local def = Config.Sounds[name]
if not def or not def.id then
return nil
end
local s = Instance.new("Sound")
s.SoundId = def.id
s.Volume = (def.volume or 0.5) * (volumeMult or 1)
if def.pitch then
s.PlaybackSpeed = rng:NextNumber(def.pitch[1], def.pitch[2])
end
s.SoundGroup = Audio.groups.sfx
s.Parent = SoundService
s:Play()
s.Ended:Connect(function()
s:Destroy()
end)
task.delay(30, function()
if s.Parent then
s:Destroy()
end
end)
return s
end
-- разовый звук по прямому id (например, случайный раскат грома из списка)
function Audio.playId(id, volume, groupName)
local s = Instance.new("Sound")
s.SoundId = id
s.Volume = volume or 0.5
s.SoundGroup = Audio.groups[groupName or "sfx"]
s.Parent = SoundService
s:Play()
s.Ended:Connect(function()
s:Destroy()
end)
return s
end
function Audio.loop(name, groupName)
local def = Config.Sounds[name]
if not def then
return nil
end
local s = Instance.new("Sound")
s.Name = name
s.SoundId = def.id
s.Looped = true
s.Volume = 0
s.SoundGroup = Audio.groups[groupName or "ambient"]
s:SetAttribute("BaseVolume", def.volume or 0.5)
s.Parent = SoundService
return s
end
local fades = {}
function Audio.fade(s, factor, time)
if not s then
return
end
local target = (s:GetAttribute("BaseVolume") or 0.5) * (factor or 0)
if fades[s] and fades[s].target == target then
return
end
if fades[s] then
fades[s].tween:Cancel()
end
if target > 0 and not s.IsPlaying then
s:Resume()
if not s.IsPlaying then
s:Play()
end
end
local tw = TweenService:Create(s, TweenInfo.new(time or 2), { Volume = target })
fades[s] = { tween = tw, target = target }
tw.Completed:Connect(function(state)
if state == Enum.PlaybackState.Completed and target <= 0.001 then
s:Pause()
end
end)
tw:Play()
end
return Audio
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,412 @@
-- GuildClient (LocalScript) -> StarterPlayer > StarterPlayerScripts
-- Окно гильдии рыбаков (ранг и испытание, заказы, наживка, ловушки), строка жемчуга и печатей в HUD,
-- кнопки наживки и автоловли, церемония нового ранга. Стиль и помощники — из FishingClient (Theme.kit).
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
local Theme = require(script.Parent:WaitForChild("UiTheme"))
local Audio = require(script.Parent:WaitForChild("Audio"))
local remote = ReplicatedStorage:WaitForChild("GameEvent")
while not Theme.kit do
task.wait(0.1)
end
local K = Theme.kit
local C = Theme.C
local new, text, btn, corner, stroke, gradient = K.new, K.text, K.btn, K.corner, K.stroke, K.gradient
local fmt = K.fmt
local TITLE, BODY2 = K.TITLE, K.BODY2
local RANKS = Config.Guild.ranks
local CENTER, RIGHT = Enum.TextXAlignment.Center, Enum.TextXAlignment.Right
local WHITE = Color3.new(1, 1, 1)
local state = nil -- последнее состояние гильдии от сервера
local function rankOf(idx)
return RANKS[math.clamp(idx or 1, 1, #RANKS)]
end
-- щит ранга: ромб цвета ранга с буквой
local function shield(parent, size, idx, props)
local r = rankOf(idx)
local f = new("Frame", { Size = UDim2.fromOffset(size, size), Rotation = 45, BackgroundColor3 = r.color, Parent = parent },
{ corner(math.floor(size / 6)), stroke(C.gold, math.max(2, size / 14), 0), gradient(WHITE, Color3.fromRGB(150, 150, 150), 45) })
for k, v in pairs(props or {}) do
f[k] = v
end
text({ Size = UDim2.fromScale(1, 1), Rotation = -45, Font = TITLE, TextScaled = true, TextXAlignment = CENTER, Text = r.id,
TextColor3 = WHITE, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.2, Parent = f })
return f
end
---------------------------------------------------------------- окно гильдии
local win = K.makeWindow("⚔ Гильдия рыбаков", C.crimson, {
{ id = "rank", label = "⚔ Ранг" },
{ id = "orders", label = "📜 Заказы" },
{ id = "bait", label = "🐛 Наживка" },
{ id = "traps", label = "🧺 Ловушки" },
})
local lists = {
rank = K.scrollArea(win.pages.rank),
orders = K.scrollArea(win.pages.orders),
bait = K.scrollArea(win.pages.bait),
traps = K.scrollArea(win.pages.traps),
}
-- деревянная карточка-строка
local function card(parent, order, height, strokeColor)
return new("Frame", { Size = UDim2.new(1, -4, 0, height), BackgroundColor3 = WHITE, LayoutOrder = order, Parent = parent },
{ corner(8), stroke(strokeColor or C.goldDark, 2, 0), gradient(C.woodLight, C.wood, 90) })
end
local function rewardText(o)
return ("+%d %s +%s %s%s"):format(o.seals, Theme.SEAL, fmt(o.coins), Theme.SILVER, (o.pearls or 0) > 0 and (" +" .. o.pearls .. " " .. Theme.PEARL) or "")
end
local function renderRank(list)
local idx = player:GetAttribute("RankIdx") or 1
local r = rankOf(idx)
local seals = player:GetAttribute("Seals") or 0
local nextR = RANKS[idx + 1]
-- шапка: щит, звание, печати
local head = card(list, 0, 120, C.gold)
shield(head, 64, idx, { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(62, 60) })
text({ Size = UDim2.new(1, -140, 0, 30), Position = UDim2.fromOffset(122, 10), Font = TITLE, TextSize = 24, TextColor3 = r.color:Lerp(WHITE, 0.35),
Text = ("Ранг %s — %s"):format(r.id, r.name), Parent = head })
text({ Size = UDim2.new(1, -140, 0, 22), Position = UDim2.fromOffset(122, 42), Font = BODY2, TextSize = 15, TextColor3 = C.muted, RichText = true,
Text = ("%s Печати: <b>%s</b>%s %s Жемчуг: <b>%s</b>"):format(Theme.SEAL, fmt(seals), nextR and (" / " .. fmt(nextR.seals)) or "", Theme.PEARL, fmt(player:GetAttribute("Pearls") or 0)),
Parent = head })
if nextR then
K.progressBar(head, UDim2.fromOffset(122, 74), UDim2.new(1, -140, 0, 14), (seals - r.seals) / math.max(1, nextR.seals - r.seals), C.gold)
text({ Size = UDim2.new(1, -140, 0, 18), Position = UDim2.fromOffset(122, 92), Font = BODY2, TextSize = 13, TextColor3 = C.muted,
Text = "Печати дают только заказы гильдии и испытания", Parent = head })
end
-- испытание на следующий ранг
local t = state and state.trial
if t and nextR then
local box = card(list, 1, 96, t.ready and C.goldBright or C.goldDark)
text({ Size = UDim2.new(1, -220, 0, 26), Position = UDim2.fromOffset(16, 10), Font = TITLE, TextSize = 19, TextColor3 = C.goldBright,
Text = ("⚔ Испытание на ранг %s"):format(nextR.id), Parent = box })
text({ Size = UDim2.new(1, -220, 0, 40), Position = UDim2.fromOffset(16, 38), Font = BODY2, TextSize = 15, TextWrapped = true, RichText = true,
TextYAlignment = Enum.TextYAlignment.Top,
Text = t.text .. (t.active and (" <font color=\"" .. Theme.HEX.gold .. "\">" .. t.progress .. " / " .. t.goal .. "</font>") or "")
.. (t.ready and "" or ("\n<font color=\"" .. Theme.HEX.muted .. "\">Сначала накопи " .. fmt(nextR.seals) .. " печатей</font>")),
Parent = box })
local label, color, active
if not t.ready then
label, color, active = "🔒 " .. fmt(nextR.seals) .. " " .. Theme.SEAL, C.grey, false
elseif t.active and nextR.trial.kind == "deliver" then
label, color, active = "🐟 Сдать рыбу", C.green, true
elseif t.active then
label, color, active = "Идёт…", C.grey, false
else
label, color, active = "⚔ Взять", C.crimson, true
end
btn({ Size = UDim2.fromOffset(180, 50), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -14, 0.5, 0), BackgroundColor3 = color,
AutoButtonColor = active, Text = label, TextSize = 18, Parent = box }, active and function()
remote:FireServer("TakeTrial")
end or nil)
end
-- лестница рангов
for i, rr in ipairs(RANKS) do
local here = i == idx
local row = card(list, 10 + i, 58, here and C.gold or nil)
if i > idx then
row.BackgroundTransparency = 0.35
end
shield(row, 30, i, { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(34, 29) })
text({ Size = UDim2.fromOffset(230, 24), Position = UDim2.fromOffset(64, 6), Font = TITLE, TextSize = 17,
TextColor3 = i <= idx and C.text or C.muted, Text = ("%s — %s"):format(rr.id, rr.name), Parent = row })
text({ Size = UDim2.new(1, -200, 0, 20), Position = UDim2.fromOffset(64, 31), Font = BODY2, TextSize = 13, TextColor3 = C.muted,
TextTruncate = Enum.TextTruncate.AtEnd, Text = rr.unlocks, Parent = row })
text({ Size = UDim2.fromOffset(120, 24), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -14, 0, 17), Font = TITLE, TextSize = 16,
TextXAlignment = RIGHT, TextColor3 = i <= idx and C.green:Lerp(WHITE, 0.4) or C.gold,
Text = i <= idx and "✓" or (fmt(rr.seals) .. " " .. Theme.SEAL), Parent = row })
end
end
local function renderOrders(list)
if not state then
return
end
local left = (state.ordersEnd or 0) - workspace:GetServerTimeNow()
local h = math.floor(math.max(0, left) / 3600)
local m = math.floor(math.max(0, left) % 3600 / 60)
text({ Size = UDim2.new(1, -4, 0, 26), LayoutOrder = 0, Font = BODY2, TextSize = 15, TextColor3 = C.muted, RichText = true,
Text = ("Личные заказы гильдии. Новые через <b>%d ч %02d мин</b>. Рыбу сдают у доски заказов в лобби."):format(h, m), Parent = list })
for i, o in ipairs(state.orders) do
local row = card(list, i, 92, o.done and C.green or nil)
text({ Size = UDim2.new(1, -230, 0, 26), Position = UDim2.fromOffset(16, 8), Font = TITLE, TextSize = 18,
TextColor3 = o.done and C.muted or C.text, TextTruncate = Enum.TextTruncate.AtEnd, Text = (o.done and "✅ " or "📜 ") .. o.text, Parent = row })
text({ Size = UDim2.new(1, -230, 0, 20), Position = UDim2.fromOffset(16, 36), Font = BODY2, TextSize = 14, TextColor3 = C.gold,
Text = rewardText(o), Parent = row })
K.progressBar(row, UDim2.fromOffset(16, 64), UDim2.new(1, -310, 0, 12), o.progress / math.max(1, o.count), o.done and C.green or C.gold)
text({ Size = UDim2.fromOffset(70, 18), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -224, 0, 61), Font = TITLE, TextSize = 14,
TextXAlignment = RIGHT, Text = ("%d / %d"):format(o.progress, o.count), Parent = row })
if not o.done then
if o.deliver then
btn({ Size = UDim2.fromOffset(120, 40), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -86, 0, 10), BackgroundColor3 = C.green,
Text = "🐟 Сдать", TextSize = 17, Parent = row }, function()
remote:FireServer("DeliverOrder", i)
end)
end
btn({ Size = UDim2.fromOffset(66, 40), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 10), BackgroundColor3 = C.woodLight,
Text = "🎲 " .. Config.Orders.rerollPearls .. Theme.PEARL, TextSize = 14, Parent = row }, function()
remote:FireServer("RerollOrder", i)
end)
end
end
text({ Size = UDim2.new(1, -4, 0, 24), LayoutOrder = 99, Font = BODY2, TextSize = 13, TextColor3 = C.muted,
Text = ("🎲 — заменить заказ другим за %d %s"):format(Config.Orders.rerollPearls, Theme.PEARL), Parent = list })
end
local function renderBait(list)
local idx = player:GetAttribute("RankIdx") or 1
local coins = player:GetAttribute("Coins") or 0
local pearls = player:GetAttribute("Pearls") or 0
local counts = state and state.baits or {}
local equipped = player:GetAttribute("Bait")
text({ Size = UDim2.new(1, -4, 0, 26), LayoutOrder = 0, Font = BODY2, TextSize = 15, TextColor3 = C.muted,
Text = "Один слот наживки: 1 штука тратится на каждый заброс.", Parent = list })
for i, b in ipairs(Config.Baits) do
local have = counts[b.id] or 0
local locked = b.rank and idx < b.rank
local pearl = b.currency == "pearls"
local row = card(list, i, 84, equipped == b.id and C.goldBright or nil)
text({ Size = UDim2.fromOffset(60, 60), Position = UDim2.fromOffset(10, 12), TextSize = 40, TextXAlignment = CENTER, Text = b.icon, Parent = row })
text({ Size = UDim2.new(1, -330, 0, 26), Position = UDim2.fromOffset(78, 10), Font = TITLE, TextSize = 18,
Text = b.name .. (have > 0 and (" ×" .. have) or ""), Parent = row })
text({ Size = UDim2.new(1, -330, 0, 36), Position = UDim2.fromOffset(78, 38), Font = BODY2, TextSize = 14, TextColor3 = C.muted, TextWrapped = true,
TextYAlignment = Enum.TextYAlignment.Top, Text = b.desc, Parent = row })
local can = (pearl and pearls >= b.price) or (not pearl and coins >= b.price)
btn({
Size = UDim2.fromOffset(130, 42), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -12, 0.5, 0),
BackgroundColor3 = locked and C.grey or (can and C.green or C.woodLight), AutoButtonColor = not locked,
Text = locked and ("🔒 Ранг " .. RANKS[b.rank].id) or (("%s %d · ×%d"):format(pearl and Theme.PEARL or Theme.SILVER, b.price, b.pack)), TextSize = 15, Parent = row,
}, (not locked) and function()
remote:FireServer("BuyBait", b.id)
end or nil)
if have > 0 then
local on = equipped == b.id
btn({
Size = UDim2.fromOffset(100, 42), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -150, 0.5, 0),
BackgroundColor3 = on and C.gold or C.blue, TextColor3 = on and C.ink or C.text, Text = on and "✓ В слоте" or "Взять", TextSize = 15, Parent = row,
}, function()
remote:FireServer("EquipBait", on and "" or b.id)
end)
end
end
end
local function renderTraps(list)
if not state then
return
end
if (state.trapSlots or 0) == 0 then
local box = card(list, 0, 90)
text({ Size = UDim2.new(1, -32, 1, 0), Position = UDim2.fromOffset(16, 0), Font = TITLE, TextSize = 18, TextWrapped = true, TextColor3 = C.muted,
Text = "🔒 Ловушки-вентери открываются с ранга D.\nКаждая сама ловит рыбу «Тихого озера», даже когда ты не в игре.", Parent = box })
return
end
text({ Size = UDim2.new(1, -4, 0, 26), LayoutOrder = 0, Font = BODY2, TextSize = 15, TextColor3 = C.muted,
Text = ("Каждая ловушка: 1 рыба за %d мин, не больше %d. Работает и офлайн."):format(state.trapEvery / 60, state.trapMax), Parent = list })
local total = 0
for i = 1, state.trapSlots do
local n = state.traps[i] or 0
total += n
local row = card(list, i, 64, n >= state.trapMax and C.goldBright or nil)
text({ Size = UDim2.new(1, -40, 0, 26), Position = UDim2.fromOffset(16, 6), Font = TITLE, TextSize = 18,
Text = ("🧺 Ловушка %d: %d / %d рыб%s"):format(i, n, state.trapMax, n >= state.trapMax and " · полная!" or ""), Parent = row })
K.progressBar(row, UDim2.fromOffset(16, 38), UDim2.new(1, -32, 0, 12), n / state.trapMax, C.gold)
end
local b = btn({
Size = UDim2.fromOffset(260, 52), BackgroundColor3 = total > 0 and C.green or C.grey, AutoButtonColor = total > 0,
Text = ("🧺 Забрать улов (%d)"):format(total), TextSize = 19, LayoutOrder = 50, Parent = list,
}, total > 0 and function()
remote:FireServer("CollectTraps")
end or nil)
b.AnchorPoint = Vector2.new(0, 0)
end
win.render = function(tab)
local list = lists[tab]
if not list then
return
end
K.clear(list)
if tab == "rank" then
renderRank(list)
elseif tab == "orders" then
renderOrders(list)
elseif tab == "bait" then
renderBait(list)
elseif tab == "traps" then
renderTraps(list)
end
end
local function openGuild(tab)
remote:FireServer("GuildState")
win.open(tab)
end
K.sideButton(7, "⚔", "Гильдия", "G", C.crimson, function()
if win.isOpen() then
win.close()
else
openGuild()
end
end)
UserInputService.InputBegan:Connect(function(input, processed)
if not processed and input.KeyCode == Enum.KeyCode.G then
if win.isOpen() then
win.close()
else
openGuild()
end
end
end)
---------------------------------------------------------------- HUD: жемчуг, печати, ранг, отдых
local hud = K.hud
hud.Parent.Size = UDim2.fromOffset(290, 198)
local guildLine = text({ Size = UDim2.new(1, 0, 0, 20), Position = UDim2.fromOffset(0, 149), TextSize = 14, Font = BODY2, RichText = true, Text = "", Parent = hud })
-- отдых: строка видна, только пока есть двойной опыт
local restText = text({ Size = UDim2.new(1, 0, 0, 18), Position = UDim2.fromOffset(0, 169), Font = BODY2, TextSize = 13, TextColor3 = Color3.fromRGB(170, 215, 255), Text = "", Parent = hud })
local restPlate = restText
local function refreshHud()
local idx = player:GetAttribute("RankIdx") or 1
local r = rankOf(idx)
local nextSeals = player:GetAttribute("SealsNext")
guildLine.Text = ("<font color=\"#%s\"><b>⚔ %s</b></font> %s %s%s %s %s"):format(r.color:Lerp(WHITE, 0.3):ToHex(), r.id,
Theme.SEAL, fmt(player:GetAttribute("Seals") or 0), nextSeals and ("/" .. fmt(nextSeals)) or "", Theme.PEARL, fmt(player:GetAttribute("Pearls") or 0))
local rest = player:GetAttribute("RestLeft") or 0
restPlate.Visible = rest > 0
restText.Text = ("🛌 Отдых: опыт ×2 ещё %d мин"):format(math.ceil(rest / 60))
end
---------------------------------------------------------------- наживка и автоловля (правый низ, над кнопкой прыжка на телефоне)
local bar = new("Frame", {
Size = UDim2.fromOffset(250, 56), AnchorPoint = Vector2.new(1, 1), Position = UDim2.new(1, -12, 1, -12), BackgroundTransparency = 1, Parent = K.screen,
}, { new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, HorizontalAlignment = Enum.HorizontalAlignment.Right, Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
local baitBtn = btn({ Size = UDim2.fromOffset(110, 52), BackgroundColor3 = C.woodLight, Text = "", TextSize = 16, LayoutOrder = 1, Parent = bar }, function()
openGuild("bait")
end)
local autoBtn = btn({ Size = UDim2.fromOffset(130, 52), BackgroundColor3 = C.woodLight, Text = "", TextSize = 15, LayoutOrder = 2, Visible = false, Parent = bar }, function()
remote:FireServer("AutoFish", not player:GetAttribute("AutoFish"))
end)
Theme.onLayout(function(compact)
-- на телефоне — внизу, левее кнопки прыжка (над ней — панель целей)
bar.Position = compact and UDim2.new(1, -140, 1, -8) or UDim2.new(1, -12, 1, -12)
end)
local function refreshBar()
local id = player:GetAttribute("Bait")
local b = id and Config.Find(Config.Baits, id)
baitBtn.Text = b and ("%s ×%d"):format(b.icon, player:GetAttribute("BaitCount") or 0) or "🐛 Наживка"
baitBtn.BackgroundColor3 = b and C.woodLight or C.wood
local idx = player:GetAttribute("RankIdx") or 1
autoBtn.Visible = rankOf(idx).auto == true
local on = player:GetAttribute("AutoFish") == true
autoBtn.Text = on and "🎣 Авто: ВКЛ" or "🎣 Автоловля"
autoBtn.BackgroundColor3 = on and C.green or C.woodLight
end
---------------------------------------------------------------- церемония нового ранга
local ceremonyGui = new("ScreenGui", { Name = "RankCeremony", ResetOnSpawn = false, IgnoreGuiInset = true, DisplayOrder = 40, Enabled = false, Parent = player:WaitForChild("PlayerGui") })
local function ceremony(letter, name, unlocks, pearls)
ceremonyGui.Enabled = true
local root = Theme.followScale(ceremonyGui)
local dim = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.45, Parent = root })
local _, idx = Config.RankById(letter)
local panel = new("Frame", {
Size = UDim2.fromOffset(520, 300), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), BackgroundColor3 = WHITE, Parent = root,
}, { corner(12), stroke(C.goldDark, 4, 0), Theme.woodGradient(C.wood, C.woodDark) })
Theme.innerBorder(panel, 7, 8, C.gold, 0.2)
Theme.rivets(panel, 12, 8)
text({ Size = UDim2.new(1, 0, 0, 34), Position = UDim2.fromOffset(0, 16), Font = TITLE, TextSize = 26, TextXAlignment = CENTER, TextColor3 = C.goldBright,
TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.2, Text = "⚔ НОВЫЙ РАНГ ГИЛЬДИИ ⚔", Parent = panel })
local sh = shield(panel, 96, idx, { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(260, 118) })
text({ Size = UDim2.new(1, -40, 0, 30), Position = UDim2.fromOffset(20, 180), Font = TITLE, TextSize = 24, TextXAlignment = CENTER,
Text = ("%s — «%s»"):format(letter, name), Parent = panel })
text({ Size = UDim2.new(1, -40, 0, 40), Position = UDim2.fromOffset(20, 212), Font = BODY2, TextSize = 15, TextXAlignment = CENTER, TextWrapped = true,
TextColor3 = C.muted, Text = "Открыто: " .. unlocks, Parent = panel })
text({ Size = UDim2.new(1, -40, 0, 26), Position = UDim2.fromOffset(20, 256), Font = TITLE, TextSize = 19, TextXAlignment = CENTER,
TextColor3 = C.pearl, Text = ("+%d %s"):format(pearls or 0, Theme.PEARL), Parent = panel })
K.popIn(panel, 0.3)
TweenService:Create(sh, TweenInfo.new(1.2, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Rotation = 405 }):Play()
Audio.play("fanfare")
-- конфетти
local colors = { C.goldBright, C.crimson, C.forest, C.parchment, Color3.fromRGB(120, 200, 255) }
for i = 1, 70 do
local p = new("Frame", {
Size = UDim2.fromOffset(math.random(6, 12), math.random(10, 18)), Position = UDim2.new(math.random(), 0, 0, -30),
Rotation = math.random(0, 360), BackgroundColor3 = colors[(i % #colors) + 1], BorderSizePixel = 0, Parent = root,
})
local t = math.random(18, 34) / 10
TweenService:Create(p, TweenInfo.new(t, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
Position = UDim2.new(p.Position.X.Scale + (math.random() - 0.5) * 0.2, 0, 1.1, 0), Rotation = p.Rotation + math.random(-360, 360),
}):Play()
end
task.delay(5, function()
TweenService:Create(dim, TweenInfo.new(0.4), { BackgroundTransparency = 1 }):Play()
task.wait(0.4)
root:Destroy()
ceremonyGui.Enabled = false
end)
end
---------------------------------------------------------------- события
remote.OnClientEvent:Connect(function(action, a, b, c, d)
if action == "Guild" then
state = a
win.refresh()
elseif action == "OpenGuild" then
openGuild(a)
elseif action == "RankUp" then
win.close()
ceremony(a, b, c, d)
elseif action == "OrderDone" then
Audio.play("quest")
end
end)
player.AttributeChanged:Connect(function(name)
if name == "Seals" or name == "Pearls" or name == "RankIdx" or name == "SealsNext" or name == "RestLeft" then
refreshHud()
end
if name == "Bait" or name == "BaitCount" or name == "AutoFish" or name == "RankIdx" then
refreshBar()
end
if (name == "Coins" or name == "Pearls" or name == "Bait") and win.isOpen() and win.current == "bait" then
win.refresh()
end
end)
refreshHud()
refreshBar()
-- таймер заказов и ловушки тикают, пока окно открыто
task.spawn(function()
while true do
task.wait(30)
if win.isOpen() and (win.current == "orders" or win.current == "traps") then
remote:FireServer("GuildState")
end
end
end)
remote:FireServer("GuildState")
@@ -0,0 +1,184 @@
-- UiTheme (ModuleScript) -> StarterPlayer > StarterPlayerScripts
-- Общий стиль интерфейса «средневековая гильдия»: палитра, шрифты с кириллицей,
-- украшения окон (золотая рамка, заклёпки, багровая лента) и масштаб под размер экрана.
local UserInputService = game:GetService("UserInputService")
local Theme = {}
---------------------------------------------------------------- палитра
-- старые ключи (bg, panel, blue…) оставлены, чтобы весь интерфейс перекрасился сразу
local C = {
woodDark = Color3.fromRGB(40, 28, 20),
wood = Color3.fromRGB(66, 46, 30),
woodLight = Color3.fromRGB(98, 70, 44),
parchment = Color3.fromRGB(236, 220, 180),
ink = Color3.fromRGB(52, 36, 24),
gold = Color3.fromRGB(218, 172, 92),
goldBright = Color3.fromRGB(255, 214, 120),
goldDark = Color3.fromRGB(140, 102, 52),
crimson = Color3.fromRGB(150, 40, 35),
forest = Color3.fromRGB(64, 112, 62),
silver = Color3.fromRGB(214, 220, 228),
pearl = Color3.fromRGB(235, 225, 245),
}
C.bg = C.woodDark
C.panel = C.wood
C.panel2 = C.woodLight
C.green = C.forest
C.red = C.crimson
C.blue = Color3.fromRGB(70, 92, 112) -- «сталь»: телепорт, надеть
C.purple = Color3.fromRGB(110, 62, 118)
C.grey = Color3.fromRGB(84, 72, 60)
C.text = C.parchment
C.muted = Color3.fromRGB(192, 172, 136)
C.line = C.goldDark
C.dark = Color3.fromRGB(24, 16, 11) -- подложка полосок прогресса
Theme.C = C
-- цвета для RichText
Theme.HEX = {
gold = "#FFD678",
muted = "#C0AC88",
green = "#9BE08C",
red = "#FF8A7A",
silver = "#DCE2EA",
}
---------------------------------------------------------------- значки валют
-- 🪙 в Roblox не рисуется (квадратик), поэтому серебро — светлый кружок
Theme.SILVER = "⚪"
Theme.PEARL = "🦪"
Theme.SEAL = "📜"
---------------------------------------------------------------- шрифты
-- проверено в Studio: у Merriweather и Nunito есть кириллица (у FredokaOne и Gotham — нет)
local function family(name, weight)
return Font.new("rbxasset://fonts/families/" .. name .. ".json", weight)
end
Theme.TITLE_FACE = family("Merriweather", Enum.FontWeight.Heavy)
Theme.BODY_FACE = family("Nunito", Enum.FontWeight.ExtraBold)
Theme.BODY2_FACE = family("Nunito", Enum.FontWeight.Bold)
Theme.HINT_FACE = family("Nunito", Enum.FontWeight.Heavy)
-- старые Enum.Font в коде подменяются на эти шрифты
Theme.FACES = {
[Enum.Font.FredokaOne] = Theme.TITLE_FACE,
[Enum.Font.GothamBold] = Theme.BODY_FACE,
[Enum.Font.GothamMedium] = Theme.BODY2_FACE,
[Enum.Font.GothamBlack] = Theme.TITLE_FACE,
}
---------------------------------------------------------------- украшения
local function make(class, props)
local o = Instance.new(class)
for k, v in pairs(props) do
if k ~= "Parent" then
o[k] = v
end
end
o.Parent = props.Parent
return o
end
-- ромбики-заклёпки по углам
function Theme.rivets(frame, size, inset, color)
size = size or 10
inset = inset or 6
for _, a in ipairs({ Vector2.new(0, 0), Vector2.new(1, 0), Vector2.new(0, 1), Vector2.new(1, 1) }) do
local r = make("Frame", {
Name = "Rivet", Size = UDim2.fromOffset(size, size), AnchorPoint = Vector2.new(0.5, 0.5), Rotation = 45,
Position = UDim2.new(a.X, a.X == 0 and inset or -inset, a.Y, a.Y == 0 and inset or -inset),
BackgroundColor3 = color or C.gold, BorderSizePixel = 0, ZIndex = 6, Parent = frame,
})
make("UIStroke", { Color = C.ink, Thickness = 1.5, Parent = r })
end
end
-- рамка в 2 слоя: снаружи тёмное золото (UIStroke у самого окна), внутри — светлая тонкая линия
function Theme.innerBorder(frame, inset, radius, color, transparency)
inset = inset or 5
local b = make("Frame", {
Name = "InnerBorder", Size = UDim2.new(1, -inset * 2, 1, -inset * 2), Position = UDim2.fromOffset(inset, inset),
BackgroundTransparency = 1, ZIndex = 1, Parent = frame,
})
make("UICorner", { CornerRadius = UDim.new(0, radius or 8), Parent = b })
make("UIStroke", { Color = color or C.gold, Thickness = 1.5, Transparency = transparency or 0.25, Parent = b })
return b
end
-- деревянная панель: тёплый градиент сверху вниз
function Theme.woodGradient(top, bottom)
return make("UIGradient", { Color = ColorSequence.new(top or C.wood, bottom or C.woodDark), Rotation = 90 })
end
---------------------------------------------------------------- масштаб под экран
-- Весь интерфейс лежит в «холсте» Root: он во столько же раз больше экрана, во сколько уменьшен
-- UIScale. Поэтому вёрстка в пикселях одинакова на любом экране, а на телефоне всё меньше и плотнее.
-- compact — узкий/сенсорный экран: другая раскладка (сетка кнопок, окна на весь экран).
local BASE = Vector2.new(1280, 720)
local BASE_COMPACT = Vector2.new(780, 430)
local listeners = {}
Theme.compact = false
Theme.scale = 1
local function isCompact(size)
return size.X < 900 or UserInputService.TouchEnabled
end
function Theme.onLayout(fn)
table.insert(listeners, fn)
fn(Theme.compact, Theme.scale)
end
function Theme.scaleRoot(screenGui, name)
local root = make("Frame", { Name = name or "Root", BackgroundTransparency = 1, Size = UDim2.fromScale(1, 1), Parent = screenGui })
local uiScale = make("UIScale", { Parent = root })
local function update()
local size = screenGui.AbsoluteSize
if size.X < 2 or size.Y < 2 then
return
end
local compact = isCompact(size)
local base = compact and BASE_COMPACT or BASE
local s = math.clamp(math.min(size.X / base.X, size.Y / base.Y), 0.45, 1)
uiScale.Scale = s
root.Size = UDim2.fromScale(1 / s, 1 / s)
if compact ~= Theme.compact or s ~= Theme.scale then
Theme.compact, Theme.scale = compact, s
for _, fn in ipairs(listeners) do
task.spawn(fn, compact, s)
end
end
end
screenGui:GetPropertyChangedSignal("AbsoluteSize"):Connect(update)
update()
return root
end
-- второй ScreenGui (погода и т.п.) — тот же масштаб, но без своей раскладки
function Theme.followScale(screenGui)
local root = make("Frame", { Name = "Root", BackgroundTransparency = 1, Size = UDim2.fromScale(1, 1), Parent = screenGui })
local uiScale = make("UIScale", { Parent = root })
local function apply(_, s)
uiScale.Scale = s
root.Size = UDim2.fromScale(1 / s, 1 / s)
end
local function update()
local size = screenGui.AbsoluteSize
if size.X < 2 or size.Y < 2 then
return
end
local compact = isCompact(size)
local base = compact and BASE_COMPACT or BASE
apply(compact, math.clamp(math.min(size.X / base.X, size.Y / base.Y), 0.45, 1))
end
screenGui:GetPropertyChangedSignal("AbsoluteSize"):Connect(update)
update()
return root
end
return Theme
+231
View File
@@ -0,0 +1,231 @@
-- Двор гильдии рыбаков в лобби + лавки наживки. Запускать в Studio в режиме редактирования
-- (Command Bar или Studio MCP), потом сохранить плейс (Ctrl+S). Повторный запуск пересобирает только
-- то, что строит этот скрипт (папки FishingMap.GuildHall и FishingMap.BaitShops), остальная карта не трогается.
--
-- Двор — в проходе между двумя домиками на севере лобби: арка с вывеской «⚓ ГИЛЬДИЯ РЫБАКОВ»,
-- знамёна, фонари, доска заказов (атрибут OrderBoard + подсказка Action=Orders),
-- кафедра и место Старейшины Ворона (NpcSpot с атрибутами, GuildElder, Look=Elder, Action=Guild).
local map = workspace:FindFirstChild("FishingMap")
assert(map, "Нет Workspace.FishingMap")
local V = Vector3.new
local FLOOR = 1.02 -- верх дорожки лобби
local X0 = 0.5 -- середина прохода между домиками (x от -4 до 5)
local WOOD = Color3.fromRGB(110, 72, 44)
local DARK = Color3.fromRGB(66, 42, 26)
local GOLD = Color3.fromRGB(214, 160, 70)
local CRIMSON = Color3.fromRGB(150, 40, 35)
local PARCH = Color3.fromRGB(236, 220, 180)
local TITLE_FONT = Font.new("rbxasset://fonts/families/Merriweather.json", Enum.FontWeight.Heavy)
for _, name in ipairs({ "GuildHall", "BaitShops" }) do
local old = map:FindFirstChild(name)
if old then
old:Destroy()
end
end
local hall = Instance.new("Folder")
hall.Name = "GuildHall"
hall.Parent = map
local rng = Random.new(42)
local function shade(c, k)
k = 1 + rng:NextNumber(-k, k)
return Color3.new(math.clamp(c.R * k, 0, 1), math.clamp(c.G * k, 0, 1), math.clamp(c.B * k, 0, 1))
end
local function P(props, parent)
local p = Instance.new(props.ClassName or "Part")
props.ClassName = nil
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
p[k] = v
end
p.Parent = parent or hall
return p
end
local function surfaceText(part, face, text, color, size)
local sg = Instance.new("SurfaceGui")
sg.Face = face
sg.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
sg.PixelsPerStud = 40
sg.LightInfluence = 0
sg.Parent = part
local t = Instance.new("TextLabel")
t.Size = UDim2.fromScale(1, 1)
t.BackgroundTransparency = 1
t.FontFace = TITLE_FONT
t.TextScaled = true
t.TextColor3 = color
t.TextStrokeTransparency = 0.35
t.TextStrokeColor3 = Color3.fromRGB(40, 28, 20)
t.Text = text
t.Parent = sg
local pad = Instance.new("UIPadding")
pad.PaddingLeft, pad.PaddingRight = UDim.new(0.05, 0), UDim.new(0.05, 0)
pad.PaddingTop, pad.PaddingBottom = UDim.new(size or 0.1, 0), UDim.new(size or 0.1, 0)
pad.Parent = t
return t
end
local function billboard(target, text, color, offsetY, width)
local bb = Instance.new("BillboardGui")
bb.Size = UDim2.fromOffset(width or 300, 56)
bb.StudsOffset = V(0, offsetY, 0)
bb.MaxDistance = 160
bb.LightInfluence = 0
bb.Parent = target
local t = Instance.new("TextLabel")
t.Size = UDim2.fromScale(1, 1)
t.BackgroundTransparency = 1
t.FontFace = TITLE_FONT
t.TextScaled = true
t.TextColor3 = color
t.TextStrokeTransparency = 0.15
t.Text = text
t.Parent = bb
return bb
end
local function prompt(target, actionText, objectText, action, dist)
local pp = Instance.new("ProximityPrompt")
pp.ActionText = actionText
pp.ObjectText = objectText
pp.HoldDuration = 0
pp.MaxActivationDistance = dist or 12
pp.RequiresLineOfSight = false
pp:SetAttribute("Action", action)
pp.Parent = target
return pp
end
local function lantern(pos, parent)
P({ Name = "LanternCap", Size = V(1.1, 0.3, 1.1), CFrame = CFrame.new(pos + V(0, 0.75, 0)), Color = DARK }, parent)
local l = P({ Name = "GuildLantern", Size = V(0.8, 1.1, 0.8), CFrame = CFrame.new(pos), Material = Enum.Material.Neon, Color = Color3.fromRGB(255, 205, 130) }, parent)
local light = Instance.new("PointLight")
light.Range = 16
light.Brightness = 1.2
light.Color = Color3.fromRGB(255, 205, 150)
light.Parent = l
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 })
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) })
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)
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 })
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 })
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 })
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) })
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)
-- пергаменты-заказы, приколотые к доске
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),
})
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 })
end
prompt(board, "Заказы гильдии", "Доска заказов", "Orders", 12)
---------------------------------------------------------------- Старейшина Ворон и кафедра
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", "Старейшина Ворон")
elder:SetAttribute("SkinColor", Color3.fromRGB(222, 176, 140))
elder:SetAttribute("ShirtColor", Color3.fromRGB(58, 46, 70))
elder:SetAttribute("PantsColor", Color3.fromRGB(48, 40, 34))
elder:SetAttribute("HatColor", Color3.fromRGB(150, 150, 152))
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
local shops = Instance.new("Folder")
shops.Name = "BaitShops"
shops.Parent = map
local function baitCrate(pos, objectText)
local crate = P({ Name = "BaitCrate", Size = V(2.6, 2.2, 2.2), CFrame = CFrame.new(pos + V(0, 1.1, 0)), Color = shade(WOOD, 0.06) }, shops)
P({ Name = "CrateBand", Size = V(2.7, 0.3, 2.3), CFrame = CFrame.new(pos + V(0, 1.6, 0)), Color = DARK }, shops)
P({ Name = "Worms", Size = V(2.3, 0.2, 1.9), CFrame = CFrame.new(pos + V(0, 2.25, 0)), Color = Color3.fromRGB(96, 66, 46), Material = Enum.Material.Ground }, shops)
for i = 1, 4 do
P({ Name = "Worm", ClassName = "Part", Shape = Enum.PartType.Cylinder, Size = V(0.9, 0.25, 0.25), CanCollide = false,
CFrame = CFrame.new(pos + V(rng:NextNumber(-0.8, 0.8), 2.4, rng:NextNumber(-0.6, 0.6))) * CFrame.Angles(0, rng:NextNumber(0, 6.28), 0),
Color = Color3.fromRGB(210, 120, 120) }, shops)
end
billboard(crate, "🐛 Наживка", Color3.fromRGB(255, 214, 120), 3.2, 180)
prompt(crate, "Наживка", objectText, "Bait", 11)
return crate
end
local function groundAt(x, z)
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.FilterDescendantsInstances = { shops, hall }
local hit = workspace:Raycast(V(x, 80, z), V(0, -160, 0), params)
return hit and hit.Position.Y or FLOOR
end
baitCrate(V(-49.5, groundAt(-49.5, 15), 15), "Лавка Михалыча")
-- у Деда Петровича на причале «Тихого озера»
local grandpa = map:FindFirstChild("World1NpcGrandpa", true)
if grandpa then
local p = grandpa.Position + grandpa.CFrame.RightVector * 3.2
baitCrate(V(p.X, groundAt(p.X, p.Z), p.Z), "Дед Петрович")
end
return ("Двор гильдии: %d деталей, лавок наживки: %d"):format(#hall:GetDescendants(), #shops:GetChildren())
+82
View File
@@ -0,0 +1,82 @@
# Updates the scripts inside Fishing.rbxlx from src/ WITHOUT touching the map.
# Studio must be closed. A backup is saved to backups\ first.
# Run: powershell -ExecutionPolicy Bypass -File update-place.ps1
$ErrorActionPreference = 'Stop'
$root = $PSScriptRoot
$enc = New-Object System.Text.UTF8Encoding($false)
$placePath = Join-Path $root 'Fishing.rbxlx'
if (Test-Path "$placePath.lock") { throw "Roblox Studio has Fishing.rbxlx open. Close Studio first." }
# src folder -> service class in the place
$services = [ordered]@{
'ReplicatedFirst' = 'ReplicatedFirst'
'ReplicatedStorage' = 'ReplicatedStorage'
'ServerScriptService' = 'ServerScriptService'
'StarterPlayer\StarterPlayerScripts' = 'StarterPlayerScripts'
}
$scripts = @()
foreach ($rel in $services.Keys) {
$dir = Join-Path "$root\src" $rel
if (-not (Test-Path $dir)) { continue }
Get-ChildItem $dir -File -Filter *.lua | ForEach-Object {
$n = $_.Name
if ($n -like '*.server.lua') { $class = 'Script'; $name = $n -replace '\.server\.lua$', '' }
elseif ($n -like '*.client.lua') { $class = 'LocalScript'; $name = $n -replace '\.client\.lua$', '' }
else { $class = 'ModuleScript'; $name = $n -replace '\.lua$', '' }
$src = [System.IO.File]::ReadAllText($_.FullName, $enc)
if ($src.Contains(']]>') -or $src.Contains('</Properties>')) { throw "Unsupported text in $n" }
$scripts += @{ Name = $name; Class = $class; Service = $services[$rel]; Source = $src }
}
}
# backup
$backupDir = Join-Path $root 'backups'
New-Item -ItemType Directory -Force $backupDir | Out-Null
$stamp = Get-Date -Format 'yyyyMMdd-HHmmss'
Copy-Item $placePath (Join-Path $backupDir "Fishing-$stamp.rbxlx")
$xml = [System.IO.File]::ReadAllText($placePath, $enc)
foreach ($s in $scripts) {
# all items of this class with this exact name
$pattern = '<Item class="' + $s.Class + '" referent="[^"]+">\s*<Properties>'
$found = @()
foreach ($m in [regex]::Matches($xml, $pattern)) {
$propsEnd = $xml.IndexOf('</Properties>', $m.Index)
$seg = $xml.Substring($m.Index, $propsEnd - $m.Index)
if ($seg -match '<string name="Name">([^<]*)</string>' -and $Matches[1] -eq $s.Name) {
$found += @{ Start = $m.Index; PropsEnd = $propsEnd }
}
}
if ($found.Count -gt 1) { throw "Several $($s.Class) named $($s.Name) in the place - not touching it." }
$cdata = '<![CDATA[' + $s.Source + ']]>'
if ($found.Count -eq 1) {
$f = $found[0]
$seg = $xml.Substring($f.Start, $f.PropsEnd - $f.Start)
$srcTag = [regex]::Match($seg, '<ProtectedString name="Source">[\s\S]*?</ProtectedString>')
$newTag = '<ProtectedString name="Source">' + $cdata + '</ProtectedString>'
if ($srcTag.Success) {
$absStart = $f.Start + $srcTag.Index
$xml = $xml.Substring(0, $absStart) + $newTag + $xml.Substring($absStart + $srcTag.Length)
} else {
$xml = $xml.Substring(0, $f.PropsEnd) + $newTag + $xml.Substring($f.PropsEnd)
}
Write-Host "updated $($s.Service)/$($s.Name)"
} else {
# new script: put it right after the service's own <Properties> block
$svc = [regex]::Match($xml, '<Item class="' + $s.Service + '" referent="[^"]+">\s*<Properties>')
if (-not $svc.Success) { throw "Service $($s.Service) not found in the place." }
$insertAt = $xml.IndexOf('</Properties>', $svc.Index) + '</Properties>'.Length
$ref = 'RBX' + ([guid]::NewGuid().ToString('N').ToUpper())
$item = "`n<Item class=`"$($s.Class)`" referent=`"$ref`"><Properties><string name=`"Name`">$($s.Name)</string><ProtectedString name=`"Source`">$cdata</ProtectedString></Properties></Item>"
$xml = $xml.Substring(0, $insertAt) + $item + $xml.Substring($insertAt)
Write-Host "added $($s.Service)/$($s.Name)"
}
}
[System.IO.File]::WriteAllText($placePath, $xml, $enc)
Write-Host "Done. Backup: backups\Fishing-$stamp.rbxlx"