Lobby
This commit is contained in:
1 parent
73a2db8bb8
commit
44cf31ce6b
231 files changed
+3396887
-1109081
No files matched your search
@@ -42,13 +42,18 @@ local gui = new("ScreenGui", {
|
||||
Name = "LoadingScreen", ResetOnSpawn = false, IgnoreGuiInset = true, DisplayOrder = 200,
|
||||
ZIndexBehavior = Enum.ZIndexBehavior.Sibling, Parent = player:WaitForChild("PlayerGui"),
|
||||
})
|
||||
-- фон: арт лобби (временная заглушка); пока картинка грузится, виден тёплый закатный градиент
|
||||
local BG_IMAGE = "rbxassetid://118616665961176"
|
||||
local root = new("CanvasGroup", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.fromRGB(255, 190, 120), BorderSizePixel = 0, Parent = gui })
|
||||
-- фон: заставка «Рыболовная лихорадка»; пока картинка грузится, виден голубой градиент.
|
||||
-- Градиент — на отдельной подложке: UIGradient на самой CanvasGroup тонирует всё содержимое и затемнял картинку.
|
||||
-- Свет и цветокоррекция сцены на экранный интерфейс не действуют, их не трогаем.
|
||||
local BG_IMAGE = "rbxassetid://82266337853896" -- осветлённая и более насыщенная версия заставки
|
||||
-- обычный Frame, а не CanvasGroup: CanvasGroup рендерит содержимое в текстуру пониженного разрешения — картинка мылится.
|
||||
-- Плавное появление/исчезновение делаем сами (setFade ниже).
|
||||
local root = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, BorderSizePixel = 0, Parent = gui })
|
||||
local backdrop = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, Parent = root })
|
||||
new("UIGradient", {
|
||||
Rotation = 90,
|
||||
Color = ColorSequence.new(Color3.fromRGB(120, 200, 255), Color3.fromRGB(255, 170, 110)),
|
||||
Parent = root,
|
||||
Color = ColorSequence.new(Color3.fromRGB(70, 140, 230), Color3.fromRGB(40, 70, 150)),
|
||||
Parent = backdrop,
|
||||
})
|
||||
local bg = new("ImageLabel", {
|
||||
Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Image = BG_IMAGE,
|
||||
@@ -61,13 +66,14 @@ end)
|
||||
-- плашка снизу: куда идём, полоска загрузки, совет
|
||||
local panel = new("Frame", {
|
||||
AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -28), Size = UDim2.fromOffset(560, 118),
|
||||
BackgroundColor3 = Color3.fromRGB(70, 40, 22), BackgroundTransparency = 0.18, BorderSizePixel = 0, Parent = root,
|
||||
BackgroundColor3 = Color3.new(1, 1, 1), BackgroundTransparency = 0.12, BorderSizePixel = 0, Parent = root,
|
||||
})
|
||||
new("UICorner", { CornerRadius = UDim.new(0, 18), Parent = panel })
|
||||
new("UIStroke", { Color = GOLD, Thickness = 3, Transparency = 0.1, Parent = panel })
|
||||
-- тёмно-синяя плашка под ночное небо заставки, золотая обводка — как у заголовка
|
||||
new("UIGradient", {
|
||||
Rotation = 90,
|
||||
Color = ColorSequence.new(Color3.fromRGB(150, 95, 50), Color3.fromRGB(95, 55, 28)),
|
||||
Color = ColorSequence.new(Color3.fromRGB(40, 66, 140), Color3.fromRGB(20, 32, 78)),
|
||||
Parent = panel,
|
||||
})
|
||||
local float = new("TextLabel", {
|
||||
@@ -79,10 +85,10 @@ local title = new("TextLabel", {
|
||||
Text = "", TextColor3 = Color3.fromRGB(255, 240, 200), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Left,
|
||||
Font = Enum.Font.FredokaOne, Parent = panel,
|
||||
})
|
||||
new("UIStroke", { Color = Color3.fromRGB(60, 30, 10), Thickness = 2, Parent = title })
|
||||
new("UIStroke", { Color = Color3.fromRGB(15, 22, 55), Thickness = 2, Parent = title })
|
||||
local barBack = new("Frame", {
|
||||
AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 62), Size = UDim2.new(1, -36, 0, 16),
|
||||
BackgroundColor3 = Color3.fromRGB(40, 22, 10), BackgroundTransparency = 0.15, BorderSizePixel = 0, Parent = panel,
|
||||
BackgroundColor3 = Color3.fromRGB(10, 16, 40), BackgroundTransparency = 0.15, BorderSizePixel = 0, Parent = panel,
|
||||
})
|
||||
new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = barBack })
|
||||
local bar = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = GOLD, BorderSizePixel = 0, Parent = barBack })
|
||||
@@ -90,7 +96,7 @@ new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = bar })
|
||||
new("UIGradient", { Color = ColorSequence.new(Color3.fromRGB(255, 230, 120), Color3.fromRGB(255, 160, 60)), Parent = bar })
|
||||
local tip = new("TextLabel", {
|
||||
Position = UDim2.fromOffset(18, 86), Size = UDim2.new(1, -36, 0, 22), BackgroundTransparency = 1,
|
||||
Text = "", TextColor3 = Color3.fromRGB(255, 228, 185), TextScaled = true,
|
||||
Text = "", TextColor3 = Color3.fromRGB(205, 222, 255), TextScaled = true,
|
||||
Font = Enum.Font.GothamMedium, Parent = panel,
|
||||
})
|
||||
|
||||
@@ -99,6 +105,78 @@ local function showTip()
|
||||
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
||||
end
|
||||
|
||||
-- плавность без CanvasGroup: запоминаем исходную прозрачность каждого элемента и смешиваем её с 1
|
||||
local fadeProps = { "BackgroundTransparency", "ImageTransparency", "TextTransparency", "TextStrokeTransparency" }
|
||||
local fadeItems = {}
|
||||
for _, o in ipairs(root:GetDescendants()) do
|
||||
local orig = {}
|
||||
for _, prop in ipairs(o:IsA("UIStroke") and { "Transparency" } or fadeProps) do
|
||||
local ok, v = pcall(function() return o[prop] end)
|
||||
if ok and type(v) == "number" then
|
||||
orig[prop] = v
|
||||
end
|
||||
end
|
||||
if next(orig) then
|
||||
fadeItems[o] = orig
|
||||
end
|
||||
end
|
||||
local fadeValue = Instance.new("NumberValue") -- 0 — экран виден, 1 — прозрачен
|
||||
local function setFade(a)
|
||||
for o, orig in pairs(fadeItems) do
|
||||
for prop, v in pairs(orig) do
|
||||
o[prop] = v + (1 - v) * a
|
||||
end
|
||||
end
|
||||
end
|
||||
fadeValue.Changed:Connect(setFade)
|
||||
local function fadeTo(a, time)
|
||||
local tw = TweenService:Create(fadeValue, TweenInfo.new(time), { Value = a })
|
||||
tw:Play()
|
||||
return tw
|
||||
end
|
||||
|
||||
-- HUD Roblox (хотбар, чат, список игроков, верхняя панель) рисуется поверх любых ScreenGui — прячем на время загрузки
|
||||
-- и возвращаем как было (FishingClient сам выключает его у таблички, поэтому сохраняем состояние каждого типа)
|
||||
local StarterGui = game:GetService("StarterGui")
|
||||
local savedCore = nil -- [CoreGuiType] = было ли включено до загрузки; nil — HUD сейчас не спрятан
|
||||
local coreGen = 0
|
||||
local function setCoreHidden(hidden)
|
||||
if hidden == (savedCore ~= nil) then
|
||||
return
|
||||
end
|
||||
local snapshot
|
||||
if hidden then
|
||||
savedCore = {}
|
||||
for _, t in ipairs(Enum.CoreGuiType:GetEnumItems()) do
|
||||
local ok, on = pcall(function() return StarterGui:GetCoreGuiEnabled(t) end)
|
||||
if t ~= Enum.CoreGuiType.All and ok then
|
||||
savedCore[t] = on
|
||||
end
|
||||
end
|
||||
snapshot = savedCore
|
||||
else
|
||||
snapshot, savedCore = savedCore, nil
|
||||
end
|
||||
coreGen += 1
|
||||
local gen = coreGen
|
||||
-- верхняя панель (меню Roblox); в новых версиях может не поддерживаться — тогда просто пропускаем
|
||||
task.spawn(function()
|
||||
for _ = 1, 20 do
|
||||
if gen ~= coreGen or pcall(function() StarterGui:SetCore("TopbarEnabled", not hidden) end) then
|
||||
return
|
||||
end
|
||||
task.wait(0.25) -- в первые кадры CoreScripts ещё не готовы и SetCore падает
|
||||
end
|
||||
end)
|
||||
for t, on in pairs(snapshot) do
|
||||
-- рюкзак и список игроков Roblox в игре заменены своими (HudBar.client.lua) — их не возвращаем
|
||||
if t == Enum.CoreGuiType.Backpack or t == Enum.CoreGuiType.PlayerList then
|
||||
on = false
|
||||
end
|
||||
pcall(function() StarterGui:SetCoreGuiEnabled(t, (not hidden) and on) end)
|
||||
end
|
||||
end
|
||||
|
||||
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
||||
local now = os.clock()
|
||||
gui:SetAttribute("Visible", true)
|
||||
@@ -107,6 +185,7 @@ gui:SetAttribute("StartAt", now)
|
||||
gui:SetAttribute("MinUntil", now + 3)
|
||||
gui:SetAttribute("Title", "Загрузка…")
|
||||
showTip()
|
||||
setCoreHidden(true)
|
||||
|
||||
task.spawn(function()
|
||||
if not game:IsLoaded() then
|
||||
@@ -121,11 +200,12 @@ end)
|
||||
local hiding = false
|
||||
gui:GetAttributeChangedSignal("Visible"):Connect(function()
|
||||
-- новый телепорт мог прийти, пока экран ещё уходил: тогда возвращаем его
|
||||
if gui:GetAttribute("Visible") and (hiding or not gui.Enabled) then
|
||||
if gui:GetAttribute("Visible") then
|
||||
hiding = false
|
||||
showTip()
|
||||
gui.Enabled = true
|
||||
TweenService:Create(root, TweenInfo.new(0.25), { GroupTransparency = 0 }):Play()
|
||||
setCoreHidden(true)
|
||||
fadeTo(0, 0.25)
|
||||
end
|
||||
end)
|
||||
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
||||
@@ -150,13 +230,12 @@ RunService.RenderStepped:Connect(function()
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
if ready and hrp and t >= minUntil and not hiding then
|
||||
hiding = true
|
||||
local tw = TweenService:Create(root, TweenInfo.new(0.6), { GroupTransparency = 1 })
|
||||
tw.Completed:Connect(function()
|
||||
if hiding then
|
||||
fadeTo(1, 0.6).Completed:Connect(function(state)
|
||||
if hiding and state == Enum.PlaybackState.Completed then
|
||||
gui.Enabled = false
|
||||
gui:SetAttribute("Visible", false)
|
||||
setCoreHidden(false)
|
||||
end
|
||||
end)
|
||||
tw:Play()
|
||||
end
|
||||
end)
|
||||
@@ -20,19 +20,23 @@ Config.Worlds = {
|
||||
-- свет и эффекты: свойства Lighting и его эффектов; чего здесь нет, остаётся как в MapBuilder
|
||||
look = {
|
||||
lighting = {
|
||||
Brightness = 2.6, ExposureCompensation = -0.15,
|
||||
-- днём солнце не выжигает светлый песок и траву: яркость и экспозиция ниже
|
||||
Brightness = 2.0, ExposureCompensation = -0.35,
|
||||
Ambient = Color3.fromRGB(62, 66, 84), OutdoorAmbient = Color3.fromRGB(105, 112, 132),
|
||||
ColorShift_Top = Color3.fromRGB(255, 232, 196),
|
||||
EnvironmentDiffuseScale = 0.6, EnvironmentSpecularScale = 0.8,
|
||||
EnvironmentDiffuseScale = 0.5, EnvironmentSpecularScale = 0.6,
|
||||
},
|
||||
-- дымка вдали: Density — сколько тумана, Haze — насколько он плотный у горизонта
|
||||
atmosphere = {
|
||||
Density = 0.38, Offset = 0.1, Haze = 1.2, Glare = 0.15,
|
||||
Color = Color3.fromRGB(188, 204, 224), Decay = Color3.fromRGB(196, 176, 160),
|
||||
},
|
||||
color = { Saturation = 0.28, Contrast = 0.2, Brightness = -0.02 },
|
||||
bloom = { Intensity = 0.45, Size = 28, Threshold = 1.2 },
|
||||
sunRays = { Intensity = 0.06, Spread = 0.6 },
|
||||
color = { Saturation = 0.16, Contrast = 0.12, Brightness = -0.04 },
|
||||
-- свечение только у по-настоящему ярких мест (огни ночью), без ореолов вокруг светлого днём
|
||||
bloom = { Intensity = 0.25, Size = 24, Threshold = 1.9 },
|
||||
sunRays = { Intensity = 0.05, Spread = 0.6 },
|
||||
-- мягкий тонмаппинг: светлое не выгорает в белое
|
||||
grading = { TonemapperPreset = Enum.TonemapperPreset.Default },
|
||||
-- лёгкое размытие дальнего плана
|
||||
dof = { Enabled = true, FarIntensity = 0.2, FocusDistance = 60, InFocusRadius = 120, NearIntensity = 0 },
|
||||
},
|
||||
@@ -75,6 +79,31 @@ Config.Worlds = {
|
||||
}
|
||||
Config.WorldRadius = 260
|
||||
|
||||
-- камера игрока: насколько близко и далеко можно отвести колесом (в studs);
|
||||
-- maxZoom держит обзор внутри локаций — дальше видно край карты
|
||||
Config.Camera = { minZoom = 0.5, maxZoom = 35 }
|
||||
|
||||
-- лента активности (слева внизу у всех игроков) и оповещения о редком улове
|
||||
-- announceRank / announceMutations — крупный баннер со звуком у всех на сервере;
|
||||
-- globalRank / globalMutations — улов уходит и на другие серверы игры (MessagingService);
|
||||
-- lines — сколько строк в ленте, lineTime — сколько секунд строка остаётся видна
|
||||
Config.Feed = {
|
||||
announceRank = 4, announceMutations = { Golden = true, Rainbow = true },
|
||||
globalRank = 5, globalMutations = { Rainbow = true },
|
||||
lines = 6, lineTime = 30,
|
||||
}
|
||||
|
||||
-- доски лидеров в лобби (глобальные, по всем серверам; обновляются раз в refresh секунд).
|
||||
-- attr — атрибут игрока, который считает сервер; store — имя OrderedDataStore (смена имени = новый топ с нуля)
|
||||
Config.Leaderboards = {
|
||||
refresh = 60, size = 10,
|
||||
boards = {
|
||||
{ id = "Donate", title = "💎 Топ донатеров", attr = "RobuxSpent", store = "TopRobux_v1", unit = "R$", color = Color3.fromRGB(205, 140, 255) },
|
||||
{ id = "Earn", title = "⚪ Топ по заработку", attr = "CoinsEarned", store = "TopEarned_v1", unit = "⚪", color = Color3.fromRGB(255, 214, 90) },
|
||||
{ id = "Catch", title = "🎣 Топ рыболовов", attr = "TotalCaught", store = "TopCaught_v1", unit = "🐟", color = Color3.fromRGB(120, 210, 255) },
|
||||
},
|
||||
}
|
||||
|
||||
-- экран загрузки: при входе в игру и при каждом телепорте игрок уже стоит на месте, сцена прогружается
|
||||
-- и свет локации ставится под ним; картинку видно только после этого (секунды — минимум показа)
|
||||
Config.Loading = {
|
||||
@@ -301,16 +330,17 @@ Config.Zones = {
|
||||
}
|
||||
|
||||
---------------------------------------------------------------- удочки
|
||||
-- luck = бонус удачи, speed = множитель ожидания клёва (меньше = быстрее), zone = ширина зелёной зоны
|
||||
-- luck = бонус удачи, speed = множитель ожидания клёва (меньше = быстрее), zone = ширина зелёной зоны,
|
||||
-- icon = картинка удочки в хотбаре (Tool.TextureId)
|
||||
Config.Rods = {
|
||||
{ id = "Basic", name = "Старая удочка", price = 0, level = 1, luck = 0.00, speed = 1.00, zone = 0.22, upgradeCost = 40, style = "wood" },
|
||||
{ id = "Bamboo", name = "Бамбуковая удочка", price = 150, level = 3, luck = 0.15, speed = 0.88, zone = 0.25, upgradeCost = 120, style = "bamboo" },
|
||||
{ id = "Fiberglass", name = "Стеклопластиковая", price = 600, level = 5, luck = 0.30, speed = 0.78, zone = 0.27, upgradeCost = 300, style = "glass" },
|
||||
{ id = "Carbon", name = "Карбоновая удочка", price = 1800, level = 8, luck = 0.55, speed = 0.68, zone = 0.29, upgradeCost = 700, style = "carbon" },
|
||||
{ id = "Coral", name = "Коралловая удочка", price = 4500, level = 10, luck = 0.80, speed = 0.62, zone = 0.31, upgradeCost = 1300, style = "coral" },
|
||||
{ id = "Golden", name = "Золотая удочка", price = 9000, level = 13, luck = 1.00, speed = 0.56, zone = 0.33, upgradeCost = 2200, style = "gold" },
|
||||
{ id = "Frost", name = "Ледяная удочка", price = 25000, level = 18, luck = 1.40, speed = 0.50, zone = 0.35, upgradeCost = 5000, style = "frost" },
|
||||
{ id = "Legend", name = "Удочка Легенды", price = 75000, level = 25, luck = 2.00, speed = 0.42, zone = 0.38, upgradeCost = 12000, style = "legend" },
|
||||
{ id = "Basic", name = "Старая удочка", price = 0, level = 1, luck = 0.00, speed = 1.00, zone = 0.22, upgradeCost = 40, style = "wood", icon = "rbxassetid://83350883185349" },
|
||||
{ id = "Bamboo", name = "Бамбуковая удочка", price = 150, level = 3, luck = 0.15, speed = 0.88, zone = 0.25, upgradeCost = 120, style = "bamboo", icon = "rbxassetid://98615001898640" },
|
||||
{ id = "Fiberglass", name = "Стеклопластиковая", price = 600, level = 5, luck = 0.30, speed = 0.78, zone = 0.27, upgradeCost = 300, style = "glass", icon = "rbxassetid://100031752289540" },
|
||||
{ id = "Carbon", name = "Карбоновая удочка", price = 1800, level = 8, luck = 0.55, speed = 0.68, zone = 0.29, upgradeCost = 700, style = "carbon", icon = "rbxassetid://71788597596034" },
|
||||
{ id = "Coral", name = "Коралловая удочка", price = 4500, level = 10, luck = 0.80, speed = 0.62, zone = 0.31, upgradeCost = 1300, style = "coral", icon = "rbxassetid://139114393074237" },
|
||||
{ id = "Golden", name = "Золотая удочка", price = 9000, level = 13, luck = 1.00, speed = 0.56, zone = 0.33, upgradeCost = 2200, style = "gold", icon = "rbxassetid://83212298735071" },
|
||||
{ id = "Frost", name = "Ледяная удочка", price = 25000, level = 18, luck = 1.40, speed = 0.50, zone = 0.35, upgradeCost = 5000, style = "frost", icon = "rbxassetid://134579643216329" },
|
||||
{ id = "Legend", name = "Удочка Легенды", price = 75000, level = 25, luck = 2.00, speed = 0.42, zone = 0.38, upgradeCost = 12000, style = "legend", icon = "rbxassetid://84863811378769" },
|
||||
}
|
||||
|
||||
Config.RodUpgrade = { maxLevel = 5, luckPerLevel = 0.08, zonePerLevel = 0.012, speedPerLevel = 0.96 }
|
||||
@@ -364,7 +394,6 @@ Config.QuestKinds = {
|
||||
perfectCast = { text = "Забрось в зелёную зону %d %s", forms = TIMES, coins = 8, xp = 6 },
|
||||
combo = { text = "Набери серию из %d рыб", coins = 12, xp = 10, max = 15 },
|
||||
sell = { text = "Продай %d %s", forms = FISH, coins = 3, xp = 3 },
|
||||
<<<<<<< HEAD
|
||||
earn = { text = "Заработай %d ⚪ на продаже", coins = 0.25, xp = 0.2, byLevel = true },
|
||||
buy = { text = "Купи что-нибудь в магазине", coins = 40, xp = 30, max = 1 },
|
||||
boss = { text = "Нанеси боссу %d урона", coins = 15, xp = 12 },
|
||||
@@ -377,40 +406,6 @@ Config.QuestChains = {
|
||||
}
|
||||
Config.QuestTierGrowth = 0.5 -- каждый следующий круг цепочек: цели ×(1 + 0.5 · номер круга)
|
||||
Config.ChainBonus = { coins = 120, xp = 100, potion = "Luck1" } -- за всю цепочку (растёт с уровнем и кругом)
|
||||
=======
|
||||
earn = { text = "Заработай %d 💰 на продаже", coins = 0.25, xp = 0.2, byLevel = true },
|
||||
buy = { text = "Купи что-нибудь в магазине", coins = 40, xp = 30, max = 1 },
|
||||
boss = { text = "Нанеси боссу %d урона", coins = 15, xp = 12 },
|
||||
}
|
||||
Config.QuestChains = {
|
||||
{ name = "🎣 Утренний клёв", steps = { { "catch", 3 }, { "perfectCast", 2 }, { "sell", 3 }, { "catch", 5 }, { "uncommon", 1 } } },
|
||||
{ name = "🔥 Без промаха", steps = { { "perfect", 3 }, { "combo", 3 }, { "catch", 6 }, { "earn", 80 }, { "combo", 5 } } },
|
||||
{ name = "💎 Охота за редкостью", steps = { { "uncommon", 3 }, { "perfectCast", 3 }, { "rare", 1 }, { "sell", 8 }, { "buy", 1 } } },
|
||||
{ name = "🏆 Мастер озера", steps = { { "combo", 6 }, { "catch", 10 }, { "perfect", 6 }, { "rare", 2 }, { "earn", 300 } } },
|
||||
}
|
||||
Config.QuestTierGrowth = 0.5 -- каждый следующий круг цепочек: цели ×(1 + 0.5 · номер круга)
|
||||
Config.ChainBonus = { coins = 120, xp = 100, potion = "Luck1" } -- за всю цепочку (растёт с уровнем и кругом)
|
||||
|
||||
---------------------------------------------------------------- серия улова
|
||||
-- каждая рыба подряд без срыва: +10% к цене и опыту следующей, до ×2;
|
||||
-- срыв, ушедшая рыба или timeout секунд без улова — серия сгорает
|
||||
Config.Combo = { step = 0.1, max = 2.0, timeout = 90 }
|
||||
|
||||
---------------------------------------------------------------- босс озера
|
||||
-- раз в interval секунд в мир, где больше всего игроков, приплывает босс. Его ловят всем сервером:
|
||||
-- каждая пойманная там рыба наносит урон = ранг редкости (+1 за подсечку без промаха).
|
||||
-- Если за duration секунд урона хватило — награда всем, кто помог (× mult мира, минимум 40% за малый вклад)
|
||||
Config.Boss = {
|
||||
firstDelay = 240, interval = 600, duration = 180,
|
||||
hpPerPlayer = 12,
|
||||
reward = { coins = 300, xp = 250, potion = "Luck1" },
|
||||
worlds = {
|
||||
World1 = { name = "Сом-великан", fish = "Som", mutation = "Golden", scale = 5 },
|
||||
World2 = { name = "Королевская акула", fish = "Shark", mutation = "Golden", scale = 3 },
|
||||
World3 = { name = "Ледяной левиафан", fish = "Leviathan", mutation = "Rainbow", scale = 2.5 },
|
||||
},
|
||||
}
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
|
||||
---------------------------------------------------------------- серия улова
|
||||
-- каждая рыба подряд без срыва: +10% к цене и опыту следующей, до ×2;
|
||||
@@ -548,25 +543,29 @@ Config.Sounds = {
|
||||
click = S(15675032796, 0.5), -- Roblox_UI_Small_Click
|
||||
open = S(9117231552, 0.45), -- Paper Scroll Unroll Handle 4
|
||||
coins = S(9113849306, 0.6), -- Coins Or Keys Jingle 1
|
||||
chestHop = S(9120718279, 0.35, { pitch = { 0.7, 0.8 } }), -- Whoosh Fast Swish By 1 (сундук награды подпрыгивает)
|
||||
chestLand = S(9113769181, 0.7, { pitch = { 0.95, 1.05 } }), -- Chair Drop 2: тяжёлый деревянный удар о землю
|
||||
levelUp = S(1840525342, 0.5), -- Harp Glissando (A)
|
||||
quest = S(9126073318, 0.5), -- Bell Tone Ding 2
|
||||
}
|
||||
Config.DefaultVolume = { music = 0.6, sfx = 0.8 }
|
||||
|
||||
---------------------------------------------------------------- донат (Robux)
|
||||
-- ВАЖНО: впиши сюда ID своих пропусков и товаров с create.roblox.com.
|
||||
-- Все товары — Developer Products игры (create.roblox.com → Monetization → Developer Products);
|
||||
-- id — Product ID оттуда, robux — цена для кнопки (должна совпадать с ценой в Roblox).
|
||||
-- Пропуска тоже Developer Products: покупаются один раз, сервер запоминает их в данных игрока навсегда.
|
||||
-- Пока id = 0, кнопка покупки покажет подсказку, что товар не настроен.
|
||||
Config.GamePasses = {
|
||||
{ key = "VIP", id = 0, robux = 199, icon = "👑", name = "VIP", desc = "+25% удачи и серебра, корона над головой" },
|
||||
{ key = "DoubleCoins", id = 0, robux = 299, icon = "⚪", name = "x2 Серебро", desc = "Вся рыба продаётся в 2 раза дороже" },
|
||||
{ key = "LuckyCharm", id = 0, robux = 349, icon = "🍀", name = "Талисман удачи", desc = "+50% удачи навсегда" },
|
||||
{ key = "BigBag", id = 0, robux = 149, icon = "🎒", name = "Бездонная сумка", desc = "+100 мест в любой сумке" },
|
||||
{ key = "VIP", id = 3728143641, robux = 199, icon = "👑", name = "VIP", desc = "+25% удачи и серебра, корона над головой" },
|
||||
{ key = "DoubleCoins", id = 3728143692, robux = 299, icon = "⚪", name = "x2 Серебро", desc = "Вся рыба продаётся в 2 раза дороже" },
|
||||
{ key = "LuckyCharm", id = 3728143735, robux = 349, icon = "🍀", name = "Талисман удачи", desc = "+50% удачи навсегда" },
|
||||
{ key = "BigBag", id = 3728143773, robux = 149, icon = "🎒", name = "Бездонная сумка", desc = "+100 мест в любой сумке" },
|
||||
}
|
||||
Config.Products = {
|
||||
{ key = "Coins1", id = 0, robux = 49, icon = "👝", name = "Кошель серебра", desc = "+1 000 серебра (больше с уровнем)", coins = 1000 },
|
||||
{ key = "Coins2", id = 0, robux = 199, icon = "⚪", name = "Сундук серебра", desc = "+5 000 серебра (больше с уровнем)", coins = 5000 },
|
||||
{ key = "Coins3", id = 0, robux = 599, icon = "🏆", name = "Гора золота", desc = "+20 000 серебра (больше с уровнем)", coins = 20000 },
|
||||
{ key = "Luck", id = 0, robux = 99, icon = "🧪", name = "Супер-зелье удачи", desc = "+200% удачи на 15 минут", boost = 2.0, duration = 900 },
|
||||
{ key = "Coins1", id = 3728142264, robux = 49, icon = "👝", name = "Кошель серебра", desc = "+1 000 серебра (больше с уровнем)", coins = 1000 },
|
||||
{ key = "Coins2", id = 3728142848, robux = 199, icon = "⚪", name = "Сундук серебра", desc = "+5 000 серебра (больше с уровнем)", coins = 5000 },
|
||||
{ key = "Coins3", id = 3728142885, robux = 599, icon = "🏆", name = "Гора золота", desc = "+20 000 серебра (больше с уровнем)", coins = 20000 },
|
||||
{ key = "Luck", id = 3728142916, robux = 99, icon = "🧪", name = "Супер-зелье удачи", desc = "+200% удачи на 15 минут", boost = 2.0, duration = 900 },
|
||||
}
|
||||
|
||||
---------------------------------------------------------------- рыбалка
|
||||
|
||||
@@ -115,7 +115,7 @@ local function sparkles(parent, color, rate)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- удочки
|
||||
-- Рука в (0,0,0), удочка смотрит в -Z и изгибается вверх (+Y).
|
||||
-- Рука в (0,0,0), удочка смотрит в -Z почти прямо, кончик слегка провисает вниз (-Y).
|
||||
|
||||
local STYLES = {
|
||||
wood = { blank = C(125, 90, 60), mat = Enum.Material.Wood, grip = C(80, 55, 35), gripMat = Enum.Material.Fabric, wrap = C(175, 175, 175), reel = C(95, 95, 100) },
|
||||
@@ -176,8 +176,8 @@ function M.buildRod(rodId, upgradeLevel, anchored)
|
||||
cyl(model, V(0.24, -0.68, -0.58), V(0.5, -0.86, -0.58), 0.07, { Color = st.reel, Material = METAL })
|
||||
ball(model, V(0.54, -0.9, -0.5), 0.19, { Color = st.grip, Material = SP })
|
||||
|
||||
-- бланк: 8 колен с плавным изгибом и шарами на стыках
|
||||
local angles = { 6, 9, 12, 16, 20, 25, 30, 36 }
|
||||
-- бланк: 8 колен, почти прямой, к кончику плавно провисает; шары на стыках
|
||||
local angles = { 0, -1, -2, -3, -5, -7, -9, -12 }
|
||||
local lengths = { 1.2, 1.15, 1.1, 1.0, 0.95, 0.9, 0.85, 0.8 }
|
||||
local p = V(0, 0, -1.55)
|
||||
local lastSeg
|
||||
|
||||
@@ -19,6 +19,51 @@ local remote = ReplicatedStorage:FindFirstChild("GameEvent") or Instance.new("Re
|
||||
remote.Name = "GameEvent"
|
||||
remote.Parent = ReplicatedStorage
|
||||
|
||||
---------------------------------------------------------------- лента активности
|
||||
-- события для всех игроков (FishingClient показывает их в ленте и крупным баннером для редкого улова);
|
||||
-- самые редкие уловы уходят и на другие серверы игры через MessagingService (Config.Feed)
|
||||
local MessagingService = game:GetService("MessagingService")
|
||||
local FEED_TOPIC = "FishFeed"
|
||||
|
||||
local function feed(kind, info)
|
||||
remote:FireAllClients("Feed", kind, info)
|
||||
end
|
||||
|
||||
-- подписка — в фоне: SubscribeAsync ждёт ответа сервиса (в неопубликованном плейсе — долго),
|
||||
-- а скрипт должен сразу дойти до загрузки игроков, телепортов и остального
|
||||
task.spawn(function()
|
||||
pcall(function()
|
||||
MessagingService:SubscribeAsync(FEED_TOPIC, function(msg)
|
||||
local d = msg.Data
|
||||
if type(d) == "table" and d.jobId ~= game.JobId then
|
||||
d.remote = true -- улов на другом сервере
|
||||
feed("catch", d)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
-- улов в ленту; big — крупный баннер со звуком у всех, global — ещё и на другие серверы
|
||||
local function feedCatch(player, fish, world)
|
||||
local r = Config.Rarities[fish.rarity]
|
||||
local F = Config.Feed
|
||||
local info = {
|
||||
name = player.DisplayName, userId = player.UserId,
|
||||
fish = fish.name, rarity = fish.rarity, mutation = fish.mutation, value = fish.value,
|
||||
world = world and (world.icon .. " " .. world.name) or nil,
|
||||
big = r.rank >= F.announceRank or F.announceMutations[fish.mutation or ""] == true,
|
||||
}
|
||||
feed("catch", info)
|
||||
if r.rank >= F.globalRank or F.globalMutations[fish.mutation or ""] then
|
||||
info.jobId = game.JobId
|
||||
task.spawn(function()
|
||||
pcall(function()
|
||||
MessagingService:PublishAsync(FEED_TOPIC, info)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
local rng = Random.new()
|
||||
local GOLD = Color3.fromRGB(255, 220, 80)
|
||||
local RED = Color3.fromRGB(255, 120, 120)
|
||||
@@ -45,6 +90,8 @@ local function defaultData()
|
||||
chain = { index = 1, step = 1, progress = 0, tier = 0 }, daily = { last = 0, streak = 0 },
|
||||
boostUntil = 0, boostBonus = 0,
|
||||
totalCaught = 0, nextUid = 1, receipts = {},
|
||||
passes = {}, -- купленные пропуска (Developer Products): [key] = true
|
||||
coinsEarned = 0, robuxSpent = 0, -- для досок лидеров: всего выручено за рыбу и потрачено Robux
|
||||
settings = { music = Config.DefaultVolume.music, sfx = Config.DefaultVolume.sfx },
|
||||
-- гильдия: жемчуг, печати, отдых (ранг, заказы, наживку, ловушки дополняет Guild.defaults)
|
||||
pearls = 0, seals = 0, rest = 0,
|
||||
@@ -90,16 +137,12 @@ local function hasPass(player, key)
|
||||
return passes[player] ~= nil and passes[player][key] == true
|
||||
end
|
||||
|
||||
local function loadPasses(player)
|
||||
-- пропуска продаются как Developer Products, поэтому владение хранится в данных игрока, а не в Roblox
|
||||
local function loadPasses(player, data)
|
||||
passes[player] = {}
|
||||
for _, gp in ipairs(Config.GamePasses) do
|
||||
if gp.id and gp.id > 0 then
|
||||
local ok, owns = pcall(function()
|
||||
return MarketplaceService:UserOwnsGamePassAsync(player.UserId, gp.id)
|
||||
end)
|
||||
if ok and owns then
|
||||
passes[player][gp.key] = true
|
||||
end
|
||||
if data.passes[gp.key] then
|
||||
passes[player][gp.key] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -279,6 +322,11 @@ local function updateStats(player)
|
||||
player:SetAttribute("BoostBonus", boostActive(data))
|
||||
player:SetAttribute("BoostLeft", math.max(0, data.boostUntil - os.time()))
|
||||
player:SetAttribute("TotalCaught", data.totalCaught)
|
||||
player:SetAttribute("CoinsEarned", data.coinsEarned)
|
||||
-- когда откроется следующая ежедневная награда (0 — уже доступна); по ней сундук в лобби прыгает только для тех,
|
||||
-- кому есть что забрать
|
||||
player:SetAttribute("DailyNextAt", data.daily.last >= today() and (data.daily.last + 1) * 86400 or 0)
|
||||
player:SetAttribute("RobuxSpent", data.robuxSpent)
|
||||
-- шаг обучения (линия-подсказка); у старых игроков без поля, уже ловивших рыбу, обучение пройдено
|
||||
player:SetAttribute("Tutorial", data.tutorial or (data.totalCaught > 0 and Config.TutorialDone or 0))
|
||||
player:SetAttribute("Mastery", masteryCount(data))
|
||||
@@ -303,6 +351,7 @@ local function addXp(player, data, amount)
|
||||
end
|
||||
if leveled then
|
||||
notify(player, "⭐ Уровень " .. data.level .. "!", GOLD)
|
||||
feed("level", { name = player.DisplayName, userId = player.UserId, level = data.level })
|
||||
for _, w in ipairs(Config.Worlds) do
|
||||
if w.level == data.level and not w.soon then
|
||||
notify(player, "🌍 Открыт: " .. w.icon .. " " .. w.name, w.color)
|
||||
@@ -426,11 +475,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
if rarity == "Master" then
|
||||
local coins = Config.MasteryCoins * world.mult
|
||||
data.coins += coins
|
||||
<<<<<<< HEAD
|
||||
notify(player, ("🏆 «%s» собран! +%d ⚪"):format(world.name, coins), GOLD)
|
||||
=======
|
||||
notify(player, ("🏆 «%s» собран! +%d 💰"):format(world.name, coins), GOLD)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
else
|
||||
local r = Config.CollectionRewards[rarity]
|
||||
if not r then
|
||||
@@ -438,11 +483,7 @@ local function claimCollection(player, worldId, rarity)
|
||||
end
|
||||
data.coins += r.coins * world.mult
|
||||
addXp(player, data, r.xp * world.mult)
|
||||
<<<<<<< HEAD
|
||||
notify(player, ("📖 +%d ⚪ +%d XP"):format(r.coins * world.mult, r.xp * world.mult), GREEN)
|
||||
=======
|
||||
notify(player, ("📖 +%d 💰 +%d XP"):format(r.coins * world.mult, r.xp * world.mult), GREEN)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
updateStats(player)
|
||||
sendInventory(player)
|
||||
@@ -450,7 +491,7 @@ end
|
||||
|
||||
---------------------------------------------------------------- удочка, сумка, VIP на персонаже
|
||||
|
||||
local REST_ANGLE = 30
|
||||
local REST_ANGLE = 42 -- удочка в покое: рукоять под ~42° вверх-вперёд, кончик провисает до ~30°
|
||||
local function gripCF(angle)
|
||||
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
|
||||
end
|
||||
@@ -504,6 +545,7 @@ local function giveRodTool(player)
|
||||
local tool = Instance.new("Tool")
|
||||
tool.Name = rod.name .. (lvl > 0 and (" +" .. lvl) or "")
|
||||
tool.ToolTip = "Кликни у воды, чтобы закинуть"
|
||||
tool.TextureId = rod.icon or ""
|
||||
tool.CanBeDropped = false
|
||||
tool.Grip = gripCF(REST_ANGLE)
|
||||
tool:SetAttribute("IsRod", true)
|
||||
@@ -766,17 +808,12 @@ local function stopFishing(player, tellClient)
|
||||
end
|
||||
end
|
||||
|
||||
<<<<<<< HEAD
|
||||
-- mods: { bait = наживка из Config.Baits, maxRank = потолок редкости (автоловля) }
|
||||
local function rollFish(player, data, worldId, luckMult, mods)
|
||||
=======
|
||||
local function rollFish(player, data, worldId, luckMult)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local zone = Config.Zones[worldId]
|
||||
if not zone then
|
||||
return nil
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
mods = mods or {}
|
||||
local bait = mods.bait
|
||||
local base = totalLuck(player, data) + (bait and bait.luck or 0)
|
||||
@@ -784,9 +821,6 @@ local function rollFish(player, data, worldId, luckMult)
|
||||
base += bait.nightLuck - Config.DayNight.nightLuck -- светлячок: ночью +30% вместо обычных +10%
|
||||
end
|
||||
local luck = base * (luckMult or 1)
|
||||
=======
|
||||
local luck = totalLuck(player, data) * (luckMult or 1)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local bonus = luck - 1
|
||||
local weights, total = {}, 0
|
||||
for i, f in ipairs(zone.fish) do
|
||||
@@ -871,12 +905,9 @@ local function flyBobber(s, tool, target, dur, arc)
|
||||
end
|
||||
end
|
||||
|
||||
<<<<<<< HEAD
|
||||
local autoFishing = {} -- [player] = токен работающей автоловли
|
||||
local setAutoFish, grantFish -- объявлены ниже
|
||||
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local function onCast(player, power)
|
||||
power = math.clamp(tonumber(power) or 0.6, 0, 1)
|
||||
local data = profiles[player]
|
||||
@@ -921,12 +952,8 @@ local function onCast(player, power)
|
||||
|
||||
local stats = Config.RodStats(data.rod, rodLevel(data))
|
||||
local perfect = power >= Config.CastPerfect[1] and power <= Config.CastPerfect[2]
|
||||
<<<<<<< HEAD
|
||||
local bait = Guild.useBait(player, data) -- 1 штука наживки на заброс
|
||||
local fish = rollFish(player, data, world.id, perfect and Config.CastPerfectLuck or 1, { bait = bait })
|
||||
=======
|
||||
local fish = rollFish(player, data, world.id, perfect and Config.CastPerfectLuck or 1)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
if not fish then
|
||||
remote:FireClient(player, "CastFail")
|
||||
return
|
||||
@@ -1030,7 +1057,6 @@ local function onCatch(player, success, misses)
|
||||
grantFish(player, data, s.fish, { perfect = s.perfect, misses = misses, fromPos = fromPos })
|
||||
end
|
||||
|
||||
<<<<<<< HEAD
|
||||
-- рыба поймана (руками или автоловлей): в сумку, опыт, коллекция, задания, гильдия, босс.
|
||||
-- ctx: { perfect, misses, fromPos, auto }; у автоловли нет серии и бонусов за точность
|
||||
grantFish = function(player, data, fish, ctx)
|
||||
@@ -1044,15 +1070,6 @@ grantFish = function(player, data, fish, ctx)
|
||||
setCombo(player, streak + 1)
|
||||
end
|
||||
fish.xp = math.floor(fish.xp * Guild.xpMult(data)) -- бонус отдыха: двойной опыт
|
||||
=======
|
||||
-- серия: каждая рыба подряд дороже и даёт больше опыта
|
||||
local fish = s.fish
|
||||
local streak = combo[player] or 0
|
||||
local comboMult = math.min(Config.Combo.max, 1 + Config.Combo.step * streak)
|
||||
fish.value = math.floor(fish.value * comboMult + 0.5)
|
||||
fish.xp = math.floor(fish.xp * comboMult + 0.5)
|
||||
setCombo(player, streak + 1)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
table.insert(data.items, {
|
||||
uid = data.nextUid, id = fish.id, name = fish.name, rarity = fish.rarity,
|
||||
weight = fish.weight, value = fish.value, mutation = fish.mutation,
|
||||
@@ -1078,11 +1095,11 @@ grantFish = function(player, data, fish, ctx)
|
||||
if ctx.fromPos then
|
||||
showFishFlight(player, fish, ctx.fromPos)
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
remote:FireClient(player, "Caught", fish, { new = isNew, record = isRecord, combo = comboMult, streak = ctx.auto and 0 or streak + 1, auto = ctx.auto })
|
||||
=======
|
||||
remote:FireClient(player, "Caught", fish, { new = isNew, record = isRecord, combo = comboMult, streak = streak + 1 })
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
do
|
||||
local h = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
feedCatch(player, fish, h and Config.WorldAt(h.Position))
|
||||
end
|
||||
|
||||
local rank = Config.Rarities[fish.rarity].rank
|
||||
questProgress(player, "catch", 1)
|
||||
@@ -1092,7 +1109,6 @@ grantFish = function(player, data, fish, ctx)
|
||||
if rank >= 3 then
|
||||
questProgress(player, "rare", 1)
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
if not ctx.auto then
|
||||
if ctx.misses == 0 then
|
||||
questProgress(player, "perfect", 1)
|
||||
@@ -1246,18 +1262,7 @@ setAutoFish = function(player, on, reason)
|
||||
stopFishing(player, false)
|
||||
end
|
||||
notify(player, reason or "🎣 Автоловля выключена", Color3.fromRGB(255, 200, 120))
|
||||
=======
|
||||
if misses == 0 then
|
||||
questProgress(player, "perfect", 1)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
if s.perfect then
|
||||
questProgress(player, "perfectCast", 1)
|
||||
end
|
||||
questProgress(player, "combo", streak + 1, true)
|
||||
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
bossHit(player, hrp and Config.WorldAt(hrp.Position), rank + (misses == 0 and 1 or 0))
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- скупка
|
||||
@@ -1310,6 +1315,7 @@ local function sellItems(player, filterUid)
|
||||
end
|
||||
data.items = keep
|
||||
data.coins += total
|
||||
data.coinsEarned += total
|
||||
updateStats(player)
|
||||
sendInventory(player)
|
||||
remote:FireClient(player, "Sold", total, count)
|
||||
@@ -1336,11 +1342,7 @@ local function buy(player, kind, id)
|
||||
end
|
||||
local cost = Guild.price(data, Config.UpgradeCost(rod, lvl)) -- скидка ранга гильдии
|
||||
if data.coins < cost then
|
||||
<<<<<<< HEAD
|
||||
notify(player, "Нужно " .. cost .. " ⚪", RED)
|
||||
=======
|
||||
notify(player, "Нужно " .. cost .. " 💰", RED)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
return
|
||||
end
|
||||
data.coins -= cost
|
||||
@@ -1363,14 +1365,9 @@ local function buy(player, kind, id)
|
||||
notify(player, "🔒 Нужен ур. " .. potion.level, RED)
|
||||
return
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
local price = Guild.price(data, potion.price)
|
||||
if data.coins < price then
|
||||
notify(player, "Нужно " .. price .. " ⚪", RED)
|
||||
=======
|
||||
if data.coins < potion.price then
|
||||
notify(player, "Нужно " .. potion.price .. " 💰", RED)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
return
|
||||
end
|
||||
data.coins -= price
|
||||
@@ -1398,14 +1395,9 @@ local function buy(player, kind, id)
|
||||
notify(player, "🔒 Нужен ур. " .. item.level, RED)
|
||||
return
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
local price = Guild.price(data, item.price)
|
||||
if data.coins < price then
|
||||
notify(player, "Нужно " .. price .. " ⚪", RED)
|
||||
=======
|
||||
if data.coins < item.price then
|
||||
notify(player, "Нужно " .. item.price .. " 💰", RED)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
return
|
||||
end
|
||||
data.coins -= price
|
||||
@@ -1455,14 +1447,11 @@ local function teleportTo(player, worldId)
|
||||
end
|
||||
if data.level < world.level then
|
||||
notify(player, ("🔒 %s: ур. %d"):format(world.name, world.level), RED)
|
||||
<<<<<<< HEAD
|
||||
return
|
||||
end
|
||||
local okRank, why = Guild.canEnter(data, world.id)
|
||||
if not okRank then
|
||||
notify(player, why, RED)
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
return
|
||||
end
|
||||
markerName = world.id .. "Spawn"
|
||||
@@ -1561,21 +1550,13 @@ remote.OnServerEvent:Connect(function(player, action, a, b)
|
||||
if nearSeller(player) then
|
||||
sellItems(player, a)
|
||||
else
|
||||
<<<<<<< HEAD
|
||||
notify(player, "⚪ Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
=======
|
||||
notify(player, "💰 Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
elseif action == "SellAll" then
|
||||
if nearSeller(player) then
|
||||
sellItems(player, nil)
|
||||
else
|
||||
<<<<<<< HEAD
|
||||
notify(player, "⚪ Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
=======
|
||||
notify(player, "💰 Только у скупщика", Color3.fromRGB(255, 200, 120))
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
elseif action == "Teleport" then
|
||||
teleportTo(player, a)
|
||||
@@ -1604,22 +1585,20 @@ end)
|
||||
|
||||
---------------------------------------------------------------- донат
|
||||
|
||||
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, passId, purchased)
|
||||
if not purchased then
|
||||
return
|
||||
end
|
||||
for _, gp in ipairs(Config.GamePasses) do
|
||||
if gp.id == passId then
|
||||
passes[player] = passes[player] or {}
|
||||
passes[player][gp.key] = true
|
||||
notify(player, "✅ " .. gp.icon .. " " .. gp.name, GOLD)
|
||||
if gp.key == "VIP" then
|
||||
vipTag(player)
|
||||
end
|
||||
updateStats(player)
|
||||
-- все покупки — Developer Products: и наборы (Config.Products), и пропуска навсегда (Config.GamePasses)
|
||||
local function findProduct(productId)
|
||||
for _, p in ipairs(Config.Products) do
|
||||
if p.id == productId then
|
||||
return p, false
|
||||
end
|
||||
end
|
||||
end)
|
||||
for _, gp in ipairs(Config.GamePasses) do
|
||||
if gp.id == productId then
|
||||
return gp, true
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
MarketplaceService.ProcessReceipt = function(info)
|
||||
local player = Players:GetPlayerByUserId(info.PlayerId)
|
||||
@@ -1632,15 +1611,22 @@ MarketplaceService.ProcessReceipt = function(info)
|
||||
return Enum.ProductPurchaseDecision.PurchaseGranted
|
||||
end
|
||||
end
|
||||
local product
|
||||
for _, p in ipairs(Config.Products) do
|
||||
if p.id == info.ProductId then
|
||||
product = p
|
||||
end
|
||||
end
|
||||
local product, isPass = findProduct(info.ProductId)
|
||||
if not product then
|
||||
warn("ProcessReceipt: неизвестный товар " .. tostring(info.ProductId))
|
||||
return Enum.ProductPurchaseDecision.NotProcessedYet
|
||||
end
|
||||
data.robuxSpent += info.CurrencySpent or product.robux or 0
|
||||
feed("buy", { name = player.DisplayName, userId = player.UserId, item = product.icon .. " " .. product.name })
|
||||
if isPass then
|
||||
data.passes[product.key] = true
|
||||
passes[player] = passes[player] or {}
|
||||
passes[player][product.key] = true
|
||||
notify(player, "✅ " .. product.icon .. " " .. product.name .. " — навсегда!", GOLD)
|
||||
if product.key == "VIP" then
|
||||
vipTag(player)
|
||||
end
|
||||
end
|
||||
if product.coins then
|
||||
local coins = math.floor(product.coins * (1 + (data.level - 1) * 0.15))
|
||||
data.coins += coins
|
||||
@@ -1729,10 +1715,7 @@ local function finishBoss(won)
|
||||
if potion then
|
||||
applyPotion(data, potion.bonus, potion.duration)
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
Guild.onBossWin(p, data)
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
updateStats(p)
|
||||
remote:FireClient(p, "BossReward", coins, xp, potion and potion.name)
|
||||
end
|
||||
@@ -1787,6 +1770,9 @@ end)
|
||||
---------------------------------------------------------------- игроки
|
||||
|
||||
local function onPlayerAdded(player)
|
||||
-- камеру нельзя отвести так далеко, чтобы заглянуть за скалы и край карты
|
||||
player.CameraMinZoomDistance = Config.Camera.minZoom
|
||||
player.CameraMaxZoomDistance = Config.Camera.maxZoom
|
||||
local ls = Instance.new("Folder")
|
||||
ls.Name = "leaderstats"
|
||||
ls.Parent = player
|
||||
@@ -1800,13 +1786,10 @@ local function onPlayerAdded(player)
|
||||
if not player.Parent then
|
||||
return
|
||||
end
|
||||
loadPasses(player)
|
||||
loadPasses(player, data)
|
||||
ensureChain(data)
|
||||
<<<<<<< HEAD
|
||||
Guild.defaults(data)
|
||||
Guild.onJoin(player, data)
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
profiles[player] = data
|
||||
loadedOk[player] = ok
|
||||
local settings = type(data.settings) == "table" and data.settings or {}
|
||||
@@ -1839,13 +1822,10 @@ end
|
||||
Players.PlayerRemoving:Connect(function(player)
|
||||
stopFishing(player, false)
|
||||
combo[player], comboUntil[player] = nil, nil
|
||||
<<<<<<< HEAD
|
||||
autoFishing[player] = nil
|
||||
if profiles[player] then
|
||||
Guild.onLeave(profiles[player])
|
||||
end
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
saveData(player)
|
||||
profiles[player] = nil
|
||||
loadedOk[player] = nil
|
||||
@@ -1886,13 +1866,10 @@ task.spawn(function()
|
||||
if data and data.boostUntil > os.time() - 2 then
|
||||
updateStats(p)
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
-- бонус отдыха тратится, пока игрок рыбачит
|
||||
if data and (fishing[p] or autoFishing[p]) then
|
||||
Guild.spendRest(p, data, 1)
|
||||
end
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
-- серия сгорает, если долго нет улова (пока рыба на крючке — ждём)
|
||||
if comboUntil[p] and os.time() > comboUntil[p] and not fishing[p] then
|
||||
breakCombo(p)
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
-- Leaderboards (Script) -> ServerScriptService
|
||||
-- Доски лидеров в лобби: топ донатеров, по заработку и по улову (Config.Leaderboards).
|
||||
-- Значения берутся из атрибутов игроков (их ведёт GameServer) и раз в refresh секунд пишутся в OrderedDataStore,
|
||||
-- оттуда же читается глобальный топ. Игроки, которые сейчас на сервере, показываются со свежими значениями сразу;
|
||||
-- без доступа к DataStore (Studio без API) доски показывают только их.
|
||||
-- Доски на карте — модели с атрибутом Leaderboard = id и строками Row1…RowN (их строит WorldBuilder.leaderboard).
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local DataStoreService = game:GetService("DataStoreService")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
local L = Config.Leaderboards
|
||||
|
||||
local stores = {}
|
||||
for _, b in ipairs(L.boards) do
|
||||
pcall(function()
|
||||
stores[b.id] = DataStoreService:GetOrderedDataStore(b.store)
|
||||
end)
|
||||
end
|
||||
|
||||
local written = {} -- [userId][boardId] = последнее записанное значение (не пишем без изменений)
|
||||
local names = {} -- [userId] = имя
|
||||
|
||||
local function nameOf(userId)
|
||||
if names[userId] then
|
||||
return names[userId]
|
||||
end
|
||||
local ok, name = pcall(function()
|
||||
return Players:GetNameFromUserIdAsync(userId)
|
||||
end)
|
||||
names[userId] = ok and name or ("Игрок " .. userId)
|
||||
return names[userId]
|
||||
end
|
||||
|
||||
local function fmt(n)
|
||||
local s = tostring(math.floor(n))
|
||||
local out = s:reverse():gsub("(%d%d%d)", "%1 "):reverse()
|
||||
return (out:gsub("^ ", ""))
|
||||
end
|
||||
|
||||
local function writePlayer(player)
|
||||
for _, b in ipairs(L.boards) do
|
||||
local store = stores[b.id]
|
||||
local value = math.floor(tonumber(player:GetAttribute(b.attr)) or 0)
|
||||
written[player.UserId] = written[player.UserId] or {}
|
||||
if store and value > 0 and written[player.UserId][b.id] ~= value then
|
||||
local ok = pcall(function()
|
||||
store:SetAsync(tostring(player.UserId), value)
|
||||
end)
|
||||
if ok then
|
||||
written[player.UserId][b.id] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function readTop(b)
|
||||
local list = {}
|
||||
local store = stores[b.id]
|
||||
if store then
|
||||
pcall(function()
|
||||
local page = store:GetSortedAsync(false, L.size):GetCurrentPage()
|
||||
for _, e in ipairs(page) do
|
||||
table.insert(list, { userId = tonumber(e.key), value = e.value })
|
||||
end
|
||||
end)
|
||||
end
|
||||
-- игроки на сервере: их значения свежее записанных
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
local value = math.floor(tonumber(p:GetAttribute(b.attr)) or 0)
|
||||
if value > 0 then
|
||||
local found = false
|
||||
for _, e in ipairs(list) do
|
||||
if e.userId == p.UserId then
|
||||
e.value = math.max(e.value, value)
|
||||
found = true
|
||||
end
|
||||
end
|
||||
if not found then
|
||||
table.insert(list, { userId = p.UserId, value = value })
|
||||
end
|
||||
names[p.UserId] = p.Name
|
||||
end
|
||||
end
|
||||
table.sort(list, function(a, c) return a.value > c.value end)
|
||||
return list
|
||||
end
|
||||
|
||||
local MEDAL = { "🥇", "🥈", "🥉" }
|
||||
local function render(b, list)
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
if not map then
|
||||
return
|
||||
end
|
||||
for _, model in ipairs(map:GetDescendants()) do
|
||||
if model:GetAttribute("Leaderboard") == b.id then
|
||||
for i = 1, L.size do
|
||||
local row = model:FindFirstChild("Row" .. i, true)
|
||||
if row then
|
||||
local e = list[i]
|
||||
row.Rank.Text = MEDAL[i] or (i .. ".")
|
||||
row.PlayerName.Text = e and nameOf(e.userId) or "—"
|
||||
row.Value.Text = e and (fmt(e.value) .. " " .. b.unit) or ""
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function refresh()
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
writePlayer(p)
|
||||
end
|
||||
for _, b in ipairs(L.boards) do
|
||||
render(b, readTop(b))
|
||||
end
|
||||
end
|
||||
|
||||
Players.PlayerRemoving:Connect(function(p)
|
||||
writePlayer(p)
|
||||
written[p.UserId] = nil
|
||||
end)
|
||||
|
||||
game:BindToClose(function()
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
writePlayer(p)
|
||||
end
|
||||
end)
|
||||
|
||||
task.spawn(function()
|
||||
task.wait(5) -- дать GameServer загрузить данные игроков
|
||||
while true do
|
||||
refresh()
|
||||
task.wait(L.refresh)
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,256 @@
|
||||
-- LobbyLife (Script) -> ServerScriptService
|
||||
-- Живое лобби (общее для всех игроков): у всех NPC играет idle-анимация, по площади гуляют жители —
|
||||
-- рыбак с удочкой на плече и бабушка с корзинкой. Маршруты считает PathfindingService, поэтому
|
||||
-- жители обходят лавки, фонтан и порталы. Остальное оживление — на клиенте (LobbyLife.client.lua).
|
||||
|
||||
local PathfindingService = game:GetService("PathfindingService")
|
||||
local ServerScriptService = game:GetService("ServerScriptService")
|
||||
|
||||
local WorldBuilder = require(ServerScriptService:WaitForChild("WorldBuilder"))
|
||||
|
||||
local ANIM = {
|
||||
idle = "rbxassetid://507766666", -- стандартные R15-анимации Roblox
|
||||
walk = "rbxassetid://507777826",
|
||||
}
|
||||
local FLOOR = 1
|
||||
-- куда ходят жители (x, z на площади лобби); между точками путь ищет PathfindingService
|
||||
local POINTS = {
|
||||
{ 28, 8 }, { -28, -8 }, { 0, 32 }, { 0, -32 }, { 30, 25 }, { -30, 25 }, { 30, -24 }, { -30, -24 },
|
||||
{ 45, 12 }, { -45, -12 }, { 12, 45 }, { -22, 40 }, { 22, -42 }, { -42, 20 },
|
||||
}
|
||||
local WALKERS = {
|
||||
{ name = "Рыбак Фёдор", skin = Color3.fromRGB(226, 176, 140), shirt = Color3.fromRGB(70, 110, 150), pants = Color3.fromRGB(60, 62, 70),
|
||||
hat = Color3.fromRGB(110, 120, 70), look = nil, prop = "rod", speed = 7 },
|
||||
{ name = "Бабушка Нюра", skin = Color3.fromRGB(240, 200, 170), shirt = Color3.fromRGB(170, 70, 90), pants = Color3.fromRGB(90, 60, 80),
|
||||
hat = Color3.fromRGB(235, 220, 120), look = "Scarf", prop = "basket", speed = 5 },
|
||||
}
|
||||
|
||||
local rng = Random.new()
|
||||
|
||||
---------------------------------------------------------------- куда жителям нельзя
|
||||
-- Поиск пути Roblox забирается на низкие препятствия (чаша фонтана, скамейки, основания порталов)
|
||||
-- и ведёт жителей поверху. Поэтому вокруг всего, что стоит на площади на уровне роста, ставим невидимые
|
||||
-- «стены»: CanCollide = true, но в своей группе столкновений, которая ни с чем не сталкивается —
|
||||
-- поиск пути видит в них препятствие, а игроки, жители и лучи (CanQuery = false) проходят насквозь.
|
||||
local LOBBY_R = 76 -- зоны — только на площади лобби
|
||||
local noWalk = {} -- { center, half } по мировым осям — чтобы выкинуть точки маршрута, попавшие внутрь
|
||||
|
||||
local function inside(pos)
|
||||
for _, z in ipairs(noWalk) do
|
||||
if math.abs(pos.X - z.center.X) <= z.half.X and math.abs(pos.Z - z.center.Z) <= z.half.Z then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- габариты повёрнутой коробки по мировым осям (половины): у лежащих цилиндров и повёрнутых лавок
|
||||
-- локальные оси не совпадают с мировыми, поэтому зону строим по проекции на пол
|
||||
local function worldHalf(cf, size)
|
||||
local r, u, b = cf.RightVector, cf.UpVector, cf.LookVector
|
||||
local h = size / 2
|
||||
return Vector3.new(
|
||||
math.abs(r.X) * h.X + math.abs(u.X) * h.Y + math.abs(b.X) * h.Z,
|
||||
math.abs(r.Y) * h.X + math.abs(u.Y) * h.Y + math.abs(b.Y) * h.Z,
|
||||
math.abs(r.Z) * h.X + math.abs(u.Z) * h.Y + math.abs(b.Z) * h.Z)
|
||||
end
|
||||
|
||||
local function buildNoWalk(map)
|
||||
local PhysicsService = game:GetService("PhysicsService")
|
||||
pcall(function()
|
||||
PhysicsService:RegisterCollisionGroup("NpcNoWalk")
|
||||
end)
|
||||
for _, g in ipairs(PhysicsService:GetRegisteredCollisionGroups()) do
|
||||
PhysicsService:CollisionGroupSetCollidable("NpcNoWalk", g.name, false)
|
||||
end
|
||||
local folder = Instance.new("Folder")
|
||||
folder.Name = "NpcNoWalk"
|
||||
local function block(cf, size)
|
||||
local c, e = cf.Position, worldHalf(cf, size)
|
||||
-- только то, что стоит на полу на уровне роста и на самой площади
|
||||
if c.Y - e.Y > FLOOR + 6 or c.Y + e.Y < FLOOR + 0.6 or Vector3.new(c.X, 0, c.Z).Magnitude > LOBBY_R then
|
||||
return
|
||||
end
|
||||
local size2 = Vector3.new(e.X * 2 + 1.5, 10, e.Z * 2 + 1.5) -- небольшой запас: жители не трутся о края
|
||||
local p = Instance.new("Part")
|
||||
p.Name = "NoWalk"
|
||||
p.Anchored, p.CanCollide, p.CanQuery, p.CanTouch = true, true, false, false
|
||||
p.CollisionGroup = "NpcNoWalk" -- ни с чем не сталкивается, но поиск пути её видит
|
||||
p.Transparency = 1
|
||||
p.Size = size2
|
||||
p.CFrame = CFrame.new(c.X, FLOOR + 5, c.Z)
|
||||
p.Parent = folder
|
||||
table.insert(noWalk, { center = p.Position, half = size2 / 2 })
|
||||
end
|
||||
local skip = {
|
||||
LobbyCliffs = true, LobbyCliffDecor = true, LobbyCliffFoot = true, LobbyForest = true, LobbyTrees = true,
|
||||
LobbyRockPlants = true, LobbyHillForest = true, LobbyHaze = true, FishingZones = true, World1Map = true,
|
||||
}
|
||||
local function consider(inst)
|
||||
if inst:IsA("Model") then
|
||||
if inst:FindFirstChildOfClass("Humanoid") or inst:GetAttribute("Npc") then
|
||||
return
|
||||
end
|
||||
local cf, size = inst:GetBoundingBox()
|
||||
block(cf, size)
|
||||
elseif inst:IsA("BasePart") and inst.Transparency < 0.95 then
|
||||
block(inst.CFrame, inst.Size)
|
||||
end
|
||||
end
|
||||
for _, c in ipairs(map:GetChildren()) do
|
||||
if not skip[c.Name] and not c:IsA("Folder") then
|
||||
consider(c)
|
||||
end
|
||||
end
|
||||
-- модели, поставленные на площадь руками (фонтан, декор из Toolbox)
|
||||
for _, c in ipairs(workspace:GetChildren()) do
|
||||
if c ~= map and (c:IsA("Model") or c:IsA("BasePart")) and not c:IsA("Terrain") then
|
||||
consider(c)
|
||||
end
|
||||
end
|
||||
folder.Parent = workspace
|
||||
end
|
||||
|
||||
local function loadAnim(hum, id)
|
||||
local animator = hum:FindFirstChildOfClass("Animator")
|
||||
if not animator then
|
||||
animator = Instance.new("Animator")
|
||||
animator.Parent = hum
|
||||
end
|
||||
local a = Instance.new("Animation")
|
||||
a.AnimationId = id
|
||||
return animator:LoadAnimation(a)
|
||||
end
|
||||
|
||||
local function startIdle(rig)
|
||||
local hum = rig:FindFirstChildOfClass("Humanoid")
|
||||
if hum and not rig:GetAttribute("IdleOn") then
|
||||
rig:SetAttribute("IdleOn", true)
|
||||
local ok, track = pcall(loadAnim, hum, ANIM.idle)
|
||||
if ok then
|
||||
track.Looped = true
|
||||
track:Play(0.3, 1, rng:NextNumber(0.85, 1.1))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- реквизит в руках / за спиной: приваривается к части тела
|
||||
local function prop(rig, kind)
|
||||
local function piece(partName, size, color, offset, shape)
|
||||
local body = rig:FindFirstChild(partName)
|
||||
if not body then
|
||||
return
|
||||
end
|
||||
local p = Instance.new("Part")
|
||||
p.Shape = shape or Enum.PartType.Block
|
||||
p.Size = size
|
||||
p.Color = color
|
||||
p.Material = Enum.Material.SmoothPlastic
|
||||
p.CanCollide, p.CanQuery, p.CanTouch, p.Massless = false, false, false, true
|
||||
p.CFrame = body.CFrame * offset
|
||||
local w = Instance.new("WeldConstraint")
|
||||
w.Part0, w.Part1 = body, p
|
||||
w.Parent = p
|
||||
p.Parent = rig
|
||||
end
|
||||
if kind == "rod" then
|
||||
-- удочка на плече: длинное удилище наискосок за спиной и катушка
|
||||
piece("UpperTorso", Vector3.new(0.18, 7, 0.18), Color3.fromRGB(120, 80, 45),
|
||||
CFrame.new(0.4, 1.2, 0.65) * CFrame.Angles(math.rad(-25), 0, math.rad(-30)), Enum.PartType.Block)
|
||||
piece("UpperTorso", Vector3.new(0.5, 0.5, 0.35), Color3.fromRGB(60, 60, 66), CFrame.new(0.9, 0.2, 0.75))
|
||||
elseif kind == "basket" then
|
||||
-- корзинка в руке: короб и ручка
|
||||
piece("RightHand", Vector3.new(1.1, 0.7, 0.8), Color3.fromRGB(170, 120, 60), CFrame.new(0, -0.7, 0))
|
||||
piece("RightHand", Vector3.new(0.12, 0.6, 0.6), Color3.fromRGB(140, 95, 45), CFrame.new(0, -0.15, 0))
|
||||
piece("RightHand", Vector3.new(0.9, 0.18, 0.6), Color3.fromRGB(240, 120, 90), CFrame.new(0, -0.28, 0)) -- яблоки сверху
|
||||
end
|
||||
end
|
||||
|
||||
local function walker(def, map)
|
||||
if #POINTS < 2 then
|
||||
warn("LobbyLife: свободных точек маршрута меньше двух, жители не гуляют")
|
||||
return
|
||||
end
|
||||
local start = POINTS[rng:NextInteger(1, #POINTS)]
|
||||
local spot = Instance.new("Part")
|
||||
spot.CFrame = CFrame.new(start[1], FLOOR + 3, start[2])
|
||||
spot:SetAttribute("NpcName", def.name)
|
||||
spot:SetAttribute("SkinColor", def.skin)
|
||||
spot:SetAttribute("ShirtColor", def.shirt)
|
||||
spot:SetAttribute("PantsColor", def.pants)
|
||||
spot:SetAttribute("HatColor", def.hat)
|
||||
if def.look then
|
||||
spot:SetAttribute("Look", def.look)
|
||||
end
|
||||
local rig = WorldBuilder.spawnNpc(spot, map)
|
||||
spot:Destroy()
|
||||
if not rig then
|
||||
return
|
||||
end
|
||||
rig:SetAttribute("Walker", true)
|
||||
prop(rig, def.prop)
|
||||
local hum = rig:FindFirstChildOfClass("Humanoid")
|
||||
local root = rig:FindFirstChild("HumanoidRootPart")
|
||||
hum.WalkSpeed = def.speed
|
||||
hum.NameDisplayDistance = 35
|
||||
root.Anchored = false
|
||||
pcall(function() root:SetNetworkOwner(nil) end) -- двигает сервер, у всех одинаково
|
||||
startIdle(rig)
|
||||
local walk = loadAnim(hum, ANIM.walk)
|
||||
walk.Looped = true
|
||||
|
||||
task.spawn(function()
|
||||
while rig.Parent do
|
||||
local p = POINTS[rng:NextInteger(1, #POINTS)]
|
||||
local target = Vector3.new(p[1], FLOOR + 2, p[2])
|
||||
if (target - root.Position).Magnitude > 8 then
|
||||
local path = PathfindingService:CreatePath({ AgentRadius = 2, AgentHeight = 5, AgentCanJump = false })
|
||||
local ok = pcall(function()
|
||||
path:ComputeAsync(root.Position, target)
|
||||
end)
|
||||
if ok and path.Status == Enum.PathStatus.Success then
|
||||
walk:Play(0.25, 1, def.speed / 8)
|
||||
for _, wp in ipairs(path:GetWaypoints()) do
|
||||
if not rig.Parent then
|
||||
return
|
||||
end
|
||||
hum:MoveTo(wp.Position)
|
||||
local reached = hum.MoveToFinished:Wait()
|
||||
if not reached then
|
||||
break -- застрял: выберем другую точку
|
||||
end
|
||||
end
|
||||
walk:Stop(0.3)
|
||||
end
|
||||
end
|
||||
task.wait(rng:NextNumber(3, 8)) -- постоял, посмотрел по сторонам
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local map = workspace:WaitForChild("FishingMap")
|
||||
task.wait(2) -- MapBuilder расставляет NPC
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:IsA("Model") and d:GetAttribute("Npc") then
|
||||
startIdle(d)
|
||||
end
|
||||
end
|
||||
map.DescendantAdded:Connect(function(d)
|
||||
if d:IsA("Model") then
|
||||
task.defer(function()
|
||||
if d:GetAttribute("Npc") then
|
||||
startIdle(d)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
buildNoWalk(map)
|
||||
-- точки маршрута, оказавшиеся внутри препятствий (например, на месте передвинутой лавки), не используем
|
||||
for i = #POINTS, 1, -1 do
|
||||
if inside(Vector3.new(POINTS[i][1], FLOOR, POINTS[i][2])) then
|
||||
table.remove(POINTS, i)
|
||||
end
|
||||
end
|
||||
for _, def in ipairs(WALKERS) do
|
||||
walker(def, map)
|
||||
end
|
||||
@@ -0,0 +1,958 @@
|
||||
-- NpcLooks (ModuleScript) -> ServerScriptService
|
||||
-- Внешность NPC: средневековые колоритные образы, собранные из простых деталей (без ассетов из Toolbox).
|
||||
-- WorldBuilder.spawnNpc берёт отсюда пропорции тела и цвета (HumanoidDescription), потом «одевает» риг:
|
||||
-- одежда — отдельные детали поверх частей тела (рубаха, штаны, сапоги), сверху фартуки, пояса,
|
||||
-- головные уборы, бороды и предметы в руках. Всё приваривается к частям тела и двигается с анимацией.
|
||||
-- Образ ищется по имени NPC (атрибут NpcName места). Нет образа — NPC собирается по-старому.
|
||||
-- lines — реплики в пузыре, когда игрок подходит (NpcTalk.client.lua).
|
||||
|
||||
local NpcLooks = {}
|
||||
|
||||
-- тёплая приглушённая палитра игры
|
||||
local P = {
|
||||
linen = Color3.fromRGB(206, 190, 152),
|
||||
linenDark = Color3.fromRGB(168, 150, 116),
|
||||
leather = Color3.fromRGB(122, 80, 48),
|
||||
leatherDark = Color3.fromRGB(78, 50, 32),
|
||||
wool = Color3.fromRGB(96, 70, 50),
|
||||
wood = Color3.fromRGB(122, 84, 52),
|
||||
green = Color3.fromRGB(62, 88, 58),
|
||||
greenDark = Color3.fromRGB(44, 64, 42),
|
||||
crimson = Color3.fromRGB(132, 42, 36),
|
||||
brass = Color3.fromRGB(200, 154, 74),
|
||||
iron = Color3.fromRGB(72, 72, 76),
|
||||
ginger = Color3.fromRGB(168, 92, 52),
|
||||
gingerDark = Color3.fromRGB(132, 70, 38),
|
||||
grey = Color3.fromRGB(196, 194, 188),
|
||||
straw = Color3.fromRGB(214, 182, 110),
|
||||
fish = Color3.fromRGB(150, 162, 156),
|
||||
}
|
||||
NpcLooks.palette = P
|
||||
|
||||
---------------------------------------------------------------- помощники «одевания»
|
||||
|
||||
local function kit(rig)
|
||||
local K = {}
|
||||
K.BLOCK, K.BALL, K.CYL = Enum.PartType.Block, Enum.PartType.Ball, Enum.PartType.Cylinder
|
||||
-- ткань — тоже гладкая: шумная текстура Fabric не идёт к low-poly прилавкам и домам`n K.FABRIC, K.METAL = Enum.Material.SmoothPlastic, Enum.Material.Metal
|
||||
K.UP = CFrame.Angles(0, 0, math.rad(90)) -- цилиндр стоймя (ось цилиндра в Roblox — X)
|
||||
|
||||
-- деталь, приваренная к части тела bodyName; cf — относительно центра части тела
|
||||
function K.part(bodyName, shape, size, cf, color, material)
|
||||
local body = rig:FindFirstChild(bodyName)
|
||||
if not body then
|
||||
return nil
|
||||
end
|
||||
local p = Instance.new("Part")
|
||||
p.Name = "Look"
|
||||
p.Shape = shape or K.BLOCK
|
||||
p.Size = size
|
||||
p.Color = color
|
||||
p.Material = material or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
p.CanCollide, p.CanQuery, p.CanTouch, p.Massless = false, false, false, true
|
||||
p.CastShadow = size.Magnitude > 0.5
|
||||
p.CFrame = body.CFrame * cf
|
||||
local w = Instance.new("WeldConstraint")
|
||||
w.Part0, w.Part1 = body, p
|
||||
w.Parent = p
|
||||
p.Parent = rig
|
||||
return p
|
||||
end
|
||||
function K.size(bodyName)
|
||||
local b = rig:FindFirstChild(bodyName)
|
||||
return b and b.Size or Vector3.one
|
||||
end
|
||||
-- «надеть» часть тела: чехол чуть больше неё (рубаха, штанина, сапог); прячет саму часть тела
|
||||
function K.cover(bodyName, color, grow, yFrom, yTo, material)
|
||||
local s = K.size(bodyName)
|
||||
grow = grow or 0.12
|
||||
yFrom, yTo = yFrom or -0.5, yTo or 0.5
|
||||
local h = s.Y * (yTo - yFrom)
|
||||
return K.part(bodyName, K.BLOCK, Vector3.new(s.X + grow, h + grow * 0.5, s.Z + grow), CFrame.new(0, s.Y * (yFrom + yTo) / 2, 0), color, material)
|
||||
end
|
||||
-- спрятать часть тела (её заменяют детали одежды)
|
||||
function K.hide(bodyName)
|
||||
local b = rig:FindFirstChild(bodyName)
|
||||
if b then
|
||||
b.Transparency = 1
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- одежда
|
||||
local UT, LT, H = K.size("UpperTorso"), K.size("LowerTorso"), K.size("Head")
|
||||
local A = K.size("RightUpperArm")
|
||||
K.UT, K.LT, K.H, K.A = UT, LT, H, A
|
||||
local LEFT_RIGHT = { "Left", "Right" }
|
||||
K.SIDES = LEFT_RIGHT
|
||||
|
||||
-- наплечники: ткань от ворота до рукавов, чтобы рукав начинался от плеча, без зазора
|
||||
-- boxy = true — плечи угловатые (как у Гриши), иначе мягкие округлые, без торчащих коробок
|
||||
function K.yoke(color, material, boxy)
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X + A.X * 2 + 0.15, UT.Y * 0.3, UT.Z + 0.24), CFrame.new(0, UT.Y * 0.36, 0), color, material or K.FABRIC)
|
||||
for _, s in ipairs(LEFT_RIGHT) do
|
||||
local up = K.size(s .. "UpperArm")
|
||||
if boxy then
|
||||
K.part(s .. "UpperArm", K.BLOCK, Vector3.new(up.X + 0.3, up.Y * 0.32, up.Z + 0.3), CFrame.new(0, up.Y * 0.36, 0), color, material or K.FABRIC)
|
||||
else
|
||||
K.part(s .. "UpperArm", K.BALL, Vector3.new(up.X + 0.26, up.Y * 0.5, up.Z + 0.26), CFrame.new(0, up.Y * 0.3, 0), color, material or K.FABRIC)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- рубаха/кафтан на корпусе (+ наплечники)
|
||||
function K.shirt(color, stripe)
|
||||
K.cover("UpperTorso", color, 0.16, -0.5, 0.5, K.FABRIC)
|
||||
K.cover("LowerTorso", color, 0.16, -0.5, 0.5, K.FABRIC)
|
||||
K.yoke(color)
|
||||
if stripe then
|
||||
for i = 0, 2 do
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X + 0.18, 0.1, UT.Z + 0.18), CFrame.new(0, UT.Y * (0.22 - i * 0.28), 0), stripe, K.FABRIC)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- рукава: long — до запястья, иначе до локтя с закатанным валиком; руки ниже — цвета кожи тела
|
||||
function K.sleeves(color, long, cuff)
|
||||
for _, s in ipairs(LEFT_RIGHT) do
|
||||
-- рукав чуть шире руки и ниже плеча: сверху его закрывает округлое плечо из K.yoke
|
||||
K.cover(s .. "UpperArm", color, 0.12, -0.5, 0.3, K.FABRIC)
|
||||
if long then
|
||||
local la = K.size(s .. "LowerArm")
|
||||
K.cover(s .. "LowerArm", color, 0.18, -0.5, 0.5, K.FABRIC)
|
||||
K.part(s .. "LowerArm", K.BLOCK, Vector3.new(la.X + 0.3, 0.28, la.Z + 0.3), CFrame.new(0, -la.Y * 0.42, 0), cuff or color, K.FABRIC)
|
||||
else
|
||||
local up = K.size(s .. "UpperArm")
|
||||
K.part(s .. "UpperArm", K.CYL, Vector3.new(0.3, up.X * 1.35, up.X * 1.35), CFrame.new(0, -up.Y * 0.42, 0) * K.UP, cuff or color, K.FABRIC)
|
||||
end
|
||||
end
|
||||
end
|
||||
function K.hands(color, k)
|
||||
k = k or 1.2
|
||||
for _, s in ipairs(LEFT_RIGHT) do
|
||||
local hs = K.size(s .. "Hand")
|
||||
K.part(s .. "Hand", K.BALL, Vector3.new(hs.X * k, hs.Y * (k + 0.05), hs.Z * (k + 0.1)), CFrame.new(0, -hs.Y * 0.1, 0), color)
|
||||
end
|
||||
end
|
||||
function K.pants(color)
|
||||
for _, s in ipairs(LEFT_RIGHT) do
|
||||
K.cover(s .. "UpperLeg", color, 0.14, -0.5, 0.5, K.FABRIC)
|
||||
K.cover(s .. "LowerLeg", color, 0.14, -0.5, 0.5, K.FABRIC)
|
||||
end
|
||||
end
|
||||
-- сапоги: голенище до колена, отворот, носок и подошва
|
||||
function K.boots(color, cuffColor, low)
|
||||
for _, s in ipairs(LEFT_RIGHT) do
|
||||
local ll = K.size(s .. "LowerLeg")
|
||||
K.cover(s .. "LowerLeg", color, 0.22, -0.5, low and -0.05 or 0.42)
|
||||
K.part(s .. "LowerLeg", K.BLOCK, Vector3.new(ll.X + 0.36, 0.3, ll.Z + 0.36), CFrame.new(0, ll.Y * (low and -0.05 or 0.4), 0), cuffColor or color)
|
||||
local f = K.size(s .. "Foot")
|
||||
K.part(s .. "Foot", K.BLOCK, Vector3.new(f.X + 0.2, f.Y + 0.12, f.Z + 0.35), CFrame.new(0, 0.02, -0.12), color)
|
||||
K.part(s .. "Foot", K.BLOCK, Vector3.new(f.X + 0.24, 0.12, f.Z + 0.4), CFrame.new(0, -f.Y * 0.5, -0.12), P.leatherDark)
|
||||
end
|
||||
end
|
||||
-- длинная юбка/подол (у женщин, у длинных кафтанов и плащей): трапеция из двух блоков
|
||||
function K.skirt(color, length, hem)
|
||||
local legs = K.size("RightUpperLeg").Y + K.size("RightLowerLeg").Y + K.size("RightFoot").Y
|
||||
length = legs * (length or 0.9)
|
||||
local top = -LT.Y * 0.3
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(UT.X * 1.12, length * 0.5, UT.Z * 1.35), CFrame.new(0, top - length * 0.25, 0), color, K.FABRIC)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(UT.X * 1.4, length * 0.52, UT.Z * 1.7), CFrame.new(0, top - length * 0.74, 0), color, K.FABRIC)
|
||||
if hem then
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(UT.X * 1.44, 0.22, UT.Z * 1.74), CFrame.new(0, top - length + 0.12, 0), hem, K.FABRIC)
|
||||
end
|
||||
end
|
||||
function K.belt(color, buckle, z)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(UT.X + 0.3, 0.36, UT.Z + 0.3 + (z or 0)), CFrame.new(0, LT.Y * 0.35, -(z or 0) / 2), color or P.leatherDark)
|
||||
if buckle then
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(0.42, 0.4, 0.08), CFrame.new(0, LT.Y * 0.35, -(UT.Z + 0.3 + (z or 0) * 2) / 2 - 0.03), buckle, K.METAL)
|
||||
end
|
||||
end
|
||||
-- фартук: нагрудник, полотнище до колен, лямки
|
||||
function K.apron(color, strap)
|
||||
local z = -UT.Z * 0.5 - 0.12
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X * 0.66, UT.Y * 0.62, 0.12), CFrame.new(0, -UT.Y * 0.08, z - 0.04), color)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(UT.X * 0.92, UT.Y * 1.45, 0.14), CFrame.new(0, -UT.Y * 0.38, z - 0.06), color)
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.16, UT.Y * 0.75, 0.1), CFrame.new(x * UT.X * 0.24, UT.Y * 0.28, z + 0.02) * CFrame.Angles(math.rad(-8), 0, x * math.rad(-14)), strap or color)
|
||||
end
|
||||
end
|
||||
-- жилет: две полы спереди и спинка
|
||||
function K.vest(color, trim)
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X * 0.36, UT.Y * 1.0, 0.12), CFrame.new(x * UT.X * 0.33, -UT.Y * 0.02, -UT.Z * 0.5 - 0.14), color)
|
||||
if trim then
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.1, UT.Y * 1.0, 0.14), CFrame.new(x * UT.X * 0.15, -UT.Y * 0.02, -UT.Z * 0.5 - 0.16), trim)
|
||||
end
|
||||
end
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X + 0.26, UT.Y * 1.0, 0.12), CFrame.new(0, -UT.Y * 0.02, UT.Z * 0.5 + 0.14), color)
|
||||
end
|
||||
-- плащ за спиной (до икр) и воротник (мех или ткань)
|
||||
function K.cloak(color, collar, length)
|
||||
local legs = K.size("RightUpperLeg").Y + K.size("RightLowerLeg").Y
|
||||
length = UT.Y + LT.Y + legs * (length or 0.8)
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X + A.X * 1.6, length, 0.18), CFrame.new(0, UT.Y * 0.45 - length / 2, UT.Z * 0.5 + 0.22), color, K.FABRIC)
|
||||
if collar then
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X + A.X * 1.2, UT.Y * 0.32, UT.Z + 0.6), CFrame.new(0, UT.Y * 0.5, 0.05), collar, K.FABRIC)
|
||||
end
|
||||
end
|
||||
-- шарф/шаль на шее
|
||||
function K.scarf(color, tail)
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X * 0.85, UT.Y * 0.26, UT.Z + 0.45), CFrame.new(0, UT.Y * 0.52, 0), color, K.FABRIC)
|
||||
if tail then
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.4, UT.Y * 0.8, 0.12), CFrame.new(UT.X * 0.2, UT.Y * 0.05, -UT.Z * 0.5 - 0.2), color, K.FABRIC)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- голова
|
||||
function K.hair(color, long)
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 1.02, H.Y * (long and 0.9 or 0.45), H.Z * 0.3), CFrame.new(0, long and -H.Y * 0.05 or H.Y * 0.08, H.Z * 0.4), color)
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.12, H.Y * (long and 0.75 or 0.4), H.Z * 0.5), CFrame.new(x * H.X * 0.47, long and -H.Y * 0.05 or H.Y * 0.05, H.Z * 0.1), color)
|
||||
end
|
||||
end
|
||||
-- бороды: full (окладистая), long (до груди), goatee (клинышком), stubble (щетина)
|
||||
function K.beard(color, style, dark)
|
||||
dark = dark or color
|
||||
if style == "long" then
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 0.95, H.Y * 0.62, H.Z * 0.6), CFrame.new(0, -H.Y * 0.42, -H.Z * 0.28), color)
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.66, H.Y * 1.1, H.Z * 0.4), CFrame.new(0, -H.Y * 0.95, -H.Z * 0.34), color)
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 0.4, H.Y * 0.4, H.Z * 0.34), CFrame.new(0, -H.Y * 1.48, -H.Z * 0.36), dark)
|
||||
elseif style == "goatee" then
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.32, H.Y * 0.5, H.Z * 0.3), CFrame.new(0, -H.Y * 0.6, -H.Z * 0.38) * CFrame.Angles(math.rad(10), 0, 0), color)
|
||||
elseif style == "stubble" then
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.8, H.Y * 0.32, H.Z * 0.1), CFrame.new(0, -H.Y * 0.3, -H.Z * 0.5), color)
|
||||
else
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 0.98, H.Y * 0.7, H.Z * 0.62), CFrame.new(0, -H.Y * 0.42, -H.Z * 0.28), color)
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 0.72, H.Y * 0.6, H.Z * 0.5), CFrame.new(0, -H.Y * 0.72, -H.Z * 0.34), dark)
|
||||
end
|
||||
end
|
||||
-- усы: bushy (пышные), brush (щёткой), thin (тонкие подкрученные)
|
||||
function K.moustache(color, style)
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
if style == "brush" then
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.3, H.Y * 0.14, H.Z * 0.16), CFrame.new(x * H.X * 0.14, -H.Y * 0.14, -H.Z * 0.53), color)
|
||||
elseif style == "thin" then
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.34, H.Y * 0.06, 0.08), CFrame.new(x * H.X * 0.2, -H.Y * 0.14, -H.Z * 0.53) * CFrame.Angles(0, 0, x * math.rad(-18)), color)
|
||||
else
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 0.42, H.Y * 0.2, H.Z * 0.22), CFrame.new(x * H.X * 0.2, -H.Y * 0.14, -H.Z * 0.52) * CFrame.Angles(0, 0, x * math.rad(-12)), color)
|
||||
end
|
||||
end
|
||||
end
|
||||
function K.brows(color, angry)
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.24, H.Y * 0.07, 0.08), CFrame.new(x * H.X * 0.2, H.Y * 0.2, -H.Z * 0.5) * CFrame.Angles(0, 0, x * math.rad(angry and 14 or -8)), color)
|
||||
end
|
||||
end
|
||||
function K.nose(color)
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 0.22, H.Y * 0.2, H.Z * 0.2), CFrame.new(0, 0, -H.Z * 0.55), color)
|
||||
end
|
||||
-- очки: тонкая квадратная оправа без стёкол (глаза видно), перемычка и дужки
|
||||
function K.glasses(color)
|
||||
local s, t, z, y = H.X * 0.24, 0.045, -H.Z * 0.53, H.Y * 0.08
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
local cx = x * H.X * 0.2
|
||||
for _, dy in ipairs({ -1, 1 }) do
|
||||
K.part("Head", K.BLOCK, Vector3.new(s, t, t), CFrame.new(cx, y + dy * s / 2, z), color, K.METAL)
|
||||
K.part("Head", K.BLOCK, Vector3.new(t, s, t), CFrame.new(cx + dy * s / 2, y, z), color, K.METAL)
|
||||
end
|
||||
K.part("Head", K.BLOCK, Vector3.new(t, t, H.Z * 0.5), CFrame.new(x * H.X * 0.5, y + s / 2, -H.Z * 0.3), color, K.METAL)
|
||||
end
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.16, t, t), CFrame.new(0, y + s * 0.2, z), color, K.METAL)
|
||||
end
|
||||
function K.eyepatch()
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.28, H.Y * 0.24, 0.08), CFrame.new(H.X * 0.2, H.Y * 0.08, -H.Z * 0.53), Color3.fromRGB(22, 22, 24))
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 1.05, 0.07, H.Z * 1.05), CFrame.new(0, H.Y * 0.16, 0) * CFrame.Angles(0, 0, math.rad(-12)), Color3.fromRGB(22, 22, 24))
|
||||
end
|
||||
function K.pipe()
|
||||
K.part("Head", K.BLOCK, Vector3.new(0.08, 0.08, H.Z * 0.5), CFrame.new(H.X * 0.18, -H.Y * 0.26, -H.Z * 0.72) * CFrame.Angles(math.rad(-10), math.rad(-15), 0), P.leatherDark)
|
||||
K.part("Head", K.CYL, Vector3.new(0.3, 0.22, 0.22), CFrame.new(H.X * 0.26, -H.Y * 0.18, -H.Z * 0.98) * K.UP, P.wood)
|
||||
end
|
||||
-- серьга (у моряков и южан)
|
||||
function K.earring()
|
||||
K.part("Head", K.CYL, Vector3.new(0.05, 0.22, 0.22), CFrame.new(-H.X * 0.52, -H.Y * 0.2, 0), P.brass, K.METAL)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- головные уборы
|
||||
function K.hat(kind, c1, c2)
|
||||
if kind == "straw" then -- соломенная шляпа с широкими полями
|
||||
K.part("Head", K.CYL, Vector3.new(0.14, H.X * 2.3, H.Z * 2.3), CFrame.new(0, H.Y * 0.4, 0) * K.UP, c1)
|
||||
K.part("Head", K.CYL, Vector3.new(H.Y * 0.5, H.X * 1.08, H.Z * 1.08), CFrame.new(0, H.Y * 0.62, 0) * K.UP, c1)
|
||||
K.part("Head", K.CYL, Vector3.new(H.Y * 0.14, H.X * 1.1, H.Z * 1.1), CFrame.new(0, H.Y * 0.46, 0) * K.UP, c2 or P.crimson)
|
||||
elseif kind == "tall" then -- высокая шляпа с пером (вельможа)
|
||||
K.part("Head", K.CYL, Vector3.new(0.14, H.X * 1.7, H.Z * 1.7), CFrame.new(0, H.Y * 0.44, 0) * K.UP, c1)
|
||||
K.part("Head", K.CYL, Vector3.new(H.Y * 0.95, H.X * 1.0, H.Z * 1.0), CFrame.new(0, H.Y * 0.95, 0) * K.UP, c1)
|
||||
K.part("Head", K.CYL, Vector3.new(H.Y * 0.16, H.X * 1.03, H.Z * 1.03), CFrame.new(0, H.Y * 0.58, 0) * K.UP, c2 or P.brass, K.METAL)
|
||||
K.part("Head", K.BLOCK, Vector3.new(0.1, H.Y * 1.3, 0.35), CFrame.new(H.X * 0.48, H.Y * 1.05, 0.1) * CFrame.Angles(math.rad(-25), 0, math.rad(-15)), Color3.fromRGB(236, 230, 214))
|
||||
elseif kind == "captain" then -- капитанская треуголка
|
||||
K.part("Head", K.CYL, Vector3.new(H.Y * 0.4, H.X * 1.05, H.Z * 1.05), CFrame.new(0, H.Y * 0.6, 0) * K.UP, c1)
|
||||
for i = 0, 2 do
|
||||
local a = math.rad(i * 120)
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 1.3, H.Y * 0.42, 0.14), CFrame.new(0, H.Y * 0.62, 0) * CFrame.Angles(0, a, 0) * CFrame.new(0, 0, -H.Z * 0.56) * CFrame.Angles(math.rad(-12), 0, 0), c1)
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 1.3, 0.08, 0.16), CFrame.new(0, H.Y * 0.84, 0) * CFrame.Angles(0, a, 0) * CFrame.new(0, 0, -H.Z * 0.6) * CFrame.Angles(math.rad(-12), 0, 0), c2 or P.brass, K.METAL)
|
||||
end
|
||||
elseif kind == "ushanka" then -- шапка-ушанка с мехом
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 1.18, H.Y * 0.85, H.Z * 1.18), CFrame.new(0, H.Y * 0.48, 0.03), c1, K.FABRIC)
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 1.15, H.Y * 0.3, H.Z * 0.24), CFrame.new(0, H.Y * 0.38, -H.Z * 0.5), c2, K.FABRIC)
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.2, H.Y * 0.7, H.Z * 0.7), CFrame.new(x * H.X * 0.55, -H.Y * 0.05, 0.05), c2, K.FABRIC)
|
||||
end
|
||||
elseif kind == "scarf" then -- платок, завязанный под подбородком
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 1.14, H.Y * 0.9, H.Z * 1.16), CFrame.new(0, H.Y * 0.3, 0.06), c1, K.FABRIC)
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 1.0, H.Y * 0.9, H.Z * 0.3), CFrame.new(0, -H.Y * 0.2, H.Z * 0.45), c1, K.FABRIC)
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.3, H.Y * 0.22, H.Z * 0.2), CFrame.new(0, -H.Y * 0.58, -H.Z * 0.42), c2 or c1, K.FABRIC)
|
||||
elseif kind == "bandana" then -- бандана с хвостиками узла
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 1.1, H.Y * 0.7, H.Z * 1.1), CFrame.new(0, H.Y * 0.38, 0.03), c1, K.FABRIC)
|
||||
K.part("Head", K.BLOCK, Vector3.new(0.3, H.Y * 0.5, 0.12), CFrame.new(0.15, H.Y * 0.0, H.Z * 0.6) * CFrame.Angles(0, 0, math.rad(-20)), c2 or c1, K.FABRIC)
|
||||
elseif kind == "headband" then -- повязка на лбу
|
||||
K.part("Head", K.CYL, Vector3.new(H.Y * 0.16, H.X * 1.06, H.Z * 1.06), CFrame.new(0, H.Y * 0.32, 0) * K.UP, c1, K.FABRIC)
|
||||
K.part("Head", K.BLOCK, Vector3.new(0.2, H.Y * 0.45, 0.1), CFrame.new(0.15, H.Y * 0.1, H.Z * 0.56) * CFrame.Angles(0, 0, math.rad(-25)), c1, K.FABRIC)
|
||||
elseif kind == "kokoshnik" then -- кокошник с бусинами
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 1.05, H.Y * 0.6, H.Z * 1.05), CFrame.new(0, H.Y * 0.4, 0.05), c2, K.FABRIC)
|
||||
K.part("Head", K.CYL, Vector3.new(0.18, H.X * 1.6, H.X * 1.6), CFrame.new(0, H.Y * 0.62, -H.Z * 0.18) * CFrame.Angles(0, math.rad(90), 0), c1, K.METAL)
|
||||
K.part("Head", K.CYL, Vector3.new(0.2, H.X * 1.25, H.X * 1.25), CFrame.new(0, H.Y * 0.55, -H.Z * 0.2) * CFrame.Angles(0, math.rad(90), 0), c2, K.FABRIC)
|
||||
for i = -3, 3 do
|
||||
K.part("Head", K.BALL, Vector3.new(0.14, 0.14, 0.14), CFrame.new(i * H.X * 0.11, H.Y * 0.3 - math.abs(i) * 0.02, -H.Z * 0.5), Color3.fromRGB(240, 236, 226))
|
||||
end
|
||||
elseif kind == "hood" then -- капюшон
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 1.3, H.Y * 1.25, H.Z * 1.3), CFrame.new(0, H.Y * 0.12, H.Z * 0.2), c1, K.FABRIC)
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 1.2, H.Y * 0.2, H.Z * 0.3), CFrame.new(0, H.Y * 0.56, -H.Z * 0.4), c2 or c1, K.FABRIC)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- предметы в руках
|
||||
-- удилище из руки вверх-вперёд (или за спиной: back = true)
|
||||
function K.rod(back)
|
||||
if back then
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.16, 7, 0.16), CFrame.new(0.3, 1.0, UT.Z * 0.5 + 0.35) * CFrame.Angles(0, 0, math.rad(-28)), P.wood)
|
||||
else
|
||||
K.part("RightHand", K.BLOCK, Vector3.new(0.14, 6.5, 0.14), CFrame.new(0, 1.8, -0.9) * CFrame.Angles(math.rad(-30), 0, 0), P.wood)
|
||||
K.part("RightHand", K.CYL, Vector3.new(0.25, 0.4, 0.4), CFrame.new(0.15, -0.1, -0.15), P.iron, K.METAL)
|
||||
end
|
||||
end
|
||||
function K.staff(top)
|
||||
K.part("RightHand", K.CYL, Vector3.new(6.2, 0.26, 0.26), CFrame.new(0, 0.8, 0) * K.UP, P.wood)
|
||||
if top == "lantern" then
|
||||
K.part("RightHand", K.BLOCK, Vector3.new(0.6, 0.12, 0.12), CFrame.new(0, 3.85, -0.25), P.iron, K.METAL)
|
||||
local l = K.part("RightHand", K.BLOCK, Vector3.new(0.5, 0.65, 0.5), CFrame.new(0, 3.35, -0.5), Color3.fromRGB(255, 200, 120), Enum.Material.Neon)
|
||||
K.part("RightHand", K.BLOCK, Vector3.new(0.62, 0.12, 0.62), CFrame.new(0, 3.72, -0.5), P.iron, K.METAL)
|
||||
if l then
|
||||
local light = Instance.new("PointLight")
|
||||
light.Color = Color3.fromRGB(255, 190, 120)
|
||||
light.Range = 10
|
||||
light.Brightness = 1.2
|
||||
light.Parent = l
|
||||
end
|
||||
end
|
||||
end
|
||||
function K.fish(hand, color)
|
||||
K.part(hand or "LeftHand", K.BALL, Vector3.new(0.38, 1.4, 0.6), CFrame.new(0, -0.85, -0.12), color or P.fish)
|
||||
K.part(hand or "LeftHand", K.BLOCK, Vector3.new(0.1, 0.4, 0.66), CFrame.new(0, -1.65, -0.12), (color or P.fish):Lerp(Color3.new(0, 0, 0), 0.2))
|
||||
end
|
||||
function K.medallion(color)
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X * 0.55, 0.08, 0.08), CFrame.new(0, UT.Y * 0.35, -UT.Z * 0.6), color or P.brass, K.METAL)
|
||||
K.part("UpperTorso", K.CYL, Vector3.new(0.1, 0.55, 0.55), CFrame.new(0, UT.Y * 0.05, -UT.Z * 0.62) * CFrame.Angles(0, math.rad(90), 0), color or P.brass, K.METAL)
|
||||
end
|
||||
function K.bag(color)
|
||||
K.part("LowerTorso", K.BALL, Vector3.new(0.6, 0.7, 0.45), CFrame.new(-UT.X * 0.6, -0.2, -UT.Z * 0.2), color or P.leather)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(0.2, 0.12, 0.2), CFrame.new(-UT.X * 0.6, 0.18, -UT.Z * 0.2), P.brass, K.METAL)
|
||||
end
|
||||
return K
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- образы
|
||||
|
||||
local LOOKS = {}
|
||||
|
||||
-- Скупщик Гриша: толстый весёлый торговец рыбой. Льняная рубаха в полоску с закатанными рукавами,
|
||||
-- кожаный фартук в пятнах поверх, широкий пояс с латунной пряжкой, кошель и безмен с гирей,
|
||||
-- шерстяные штаны и высокие сапоги с отворотом, пышная рыжая борода, вязаная шапка с помпоном, рыбина в руке
|
||||
LOOKS["Скупщик Гриша"] = {
|
||||
scale = { height = 1.1, width = 1.35, depth = 1.4, head = 1.3 },
|
||||
colors = { skin = Color3.fromRGB(232, 170, 132), shirt = P.linen, pants = P.wool, arms = Color3.fromRGB(232, 170, 132) },
|
||||
lines = {
|
||||
"Свежая рыба — звонкое серебро!",
|
||||
"Неси улов, взвешу честно — безмен не врёт!",
|
||||
"Карась нынче в цене, а щука — тем паче.",
|
||||
"Эх, сам бы рыбачил, да кто ж тогда торговать будет?",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local UT, LT, H = K.size("UpperTorso"), K.size("LowerTorso"), K.size("Head")
|
||||
local SKIN = Color3.fromRGB(232, 170, 132)
|
||||
|
||||
-- рубаха: корпус с полосками, живот, ворот со шнуровкой
|
||||
K.cover("UpperTorso", P.linen, 0.16, -0.5, 0.5, K.FABRIC)
|
||||
for i = 0, 2 do
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X + 0.18, 0.1, UT.Z + 0.18), CFrame.new(0, UT.Y * (0.32 - i * 0.3), 0), P.linenDark, K.FABRIC)
|
||||
end
|
||||
K.part("LowerTorso", K.BALL, Vector3.new(UT.X * 1.02, UT.Y * 1.05, UT.Z * 1.45), CFrame.new(0, UT.Y * 0.22, -UT.Z * 0.3), P.linen, K.FABRIC) -- живот
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X * 0.5, 0.22, UT.Z * 1.12), CFrame.new(0, UT.Y * 0.47, 0), P.linenDark, K.FABRIC) -- ворот
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.34, UT.Y * 0.28, 0.06), CFrame.new(0, UT.Y * 0.3, -UT.Z * 0.58), SKIN) -- вырез
|
||||
for i = 0, 2 do
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.4, 0.05, 0.05), CFrame.new(0, UT.Y * (0.4 - i * 0.09), -UT.Z * 0.6) * CFrame.Angles(0, 0, math.rad(i % 2 == 0 and 20 or -20)), P.leatherDark)
|
||||
end
|
||||
|
||||
-- наплечники: рубаха продолжается на плечи, рукав начинается от плеча без зазора
|
||||
K.yoke(P.linen, nil, true)
|
||||
-- рукава: от плеча до локтя, закатанный валик; ниже — голые руки и крупные ладони
|
||||
for _, side in ipairs({ "Left", "Right" }) do
|
||||
local up = side .. "UpperArm"
|
||||
local A = K.size(up)
|
||||
K.cover(up, P.linen, 0.2, -0.35, 0.5, K.FABRIC)
|
||||
K.part(up, K.CYL, Vector3.new(0.3, A.X * 1.35, A.X * 1.35), CFrame.new(0, -A.Y * 0.35, 0) * K.UP, P.linenDark, K.FABRIC)
|
||||
local hand = side .. "Hand"
|
||||
local Hs = K.size(hand)
|
||||
K.part(hand, K.BALL, Vector3.new(Hs.X * 1.2, Hs.Y * 1.25, Hs.Z * 1.3), CFrame.new(0, -Hs.Y * 0.1, 0), SKIN)
|
||||
end
|
||||
|
||||
-- штаны и сапоги с отворотом
|
||||
for _, side in ipairs({ "Left", "Right" }) do
|
||||
K.cover(side .. "UpperLeg", P.wool, 0.14, -0.5, 0.5, K.FABRIC)
|
||||
local LL = K.size(side .. "LowerLeg")
|
||||
K.cover(side .. "LowerLeg", P.leather, 0.2, -0.5, 0.42)
|
||||
K.part(side .. "LowerLeg", K.BLOCK, Vector3.new(LL.X + 0.34, 0.32, LL.Z + 0.34), CFrame.new(0, LL.Y * 0.4, 0), P.leatherDark) -- отворот
|
||||
local F = K.size(side .. "Foot")
|
||||
K.part(side .. "Foot", K.BLOCK, Vector3.new(F.X + 0.2, F.Y + 0.12, F.Z + 0.35), CFrame.new(0, 0.02, -0.12), P.leather)
|
||||
K.part(side .. "Foot", K.BLOCK, Vector3.new(F.X + 0.24, 0.12, F.Z + 0.4), CFrame.new(0, -F.Y * 0.5, -0.12), P.leatherDark) -- подошва
|
||||
end
|
||||
|
||||
-- кожаный фартук: нагрудник, полотнище, лямки на шею, завязки, пятна
|
||||
local bibZ = -UT.Z * 0.5 - 0.12
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X * 0.66, UT.Y * 0.62, 0.12), CFrame.new(0, -UT.Y * 0.08, bibZ - 0.04), P.leather)
|
||||
local apronZ = -UT.Z * 1.02
|
||||
local apron = K.part("LowerTorso", K.BLOCK, Vector3.new(UT.X * 0.92, UT.Y * 1.55, 0.14),
|
||||
CFrame.new(0, -UT.Y * 0.4, apronZ) * CFrame.Angles(math.rad(5), 0, 0), P.leather)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(UT.X * 0.92, 0.1, 0.16), CFrame.new(0, -UT.Y * 1.16, apronZ + 0.07) * CFrame.Angles(math.rad(5), 0, 0), P.leatherDark) -- подшитый край
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.16, UT.Y * 0.75, 0.1), CFrame.new(x * UT.X * 0.24, UT.Y * 0.28, bibZ + 0.02) * CFrame.Angles(math.rad(-8), 0, x * math.rad(-14)), P.leatherDark)
|
||||
end
|
||||
if apron then
|
||||
local stains = { { -0.22, 0.18, 0.34, 1 }, { 0.22, -0.05, 0.26, 2 }, { -0.04, -0.3, 0.24, 1 }, { 0.28, 0.3, 0.18, 2 }, { -0.3, -0.12, 0.16, 2 } }
|
||||
for i, d in ipairs(stains) do
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(d[3], d[3] * 0.75, 0.03),
|
||||
CFrame.new(apron.Size.X * d[1], -UT.Y * 0.4 + apron.Size.Y * d[2], apronZ - 0.08) * CFrame.Angles(math.rad(5), 0, math.rad(i * 33)),
|
||||
d[4] == 1 and Color3.fromRGB(96, 46, 36) or Color3.fromRGB(170, 172, 160))
|
||||
end
|
||||
end
|
||||
-- карман на фартуке с ножом
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(UT.X * 0.36, 0.45, 0.05), CFrame.new(-UT.X * 0.16, -UT.Y * 0.18, apronZ - 0.09) * CFrame.Angles(math.rad(5), 0, 0), P.leatherDark)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(0.1, 0.5, 0.06), CFrame.new(-UT.X * 0.08, -UT.Y * 0.02, apronZ - 0.12), Color3.fromRGB(90, 60, 38)) -- рукоять
|
||||
|
||||
-- широкий пояс, крупная латунная пряжка, кошель и безмен
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(UT.X * 1.12, 0.42, UT.Z * 1.75), CFrame.new(0, LT.Y * 0.35, -UT.Z * 0.24), P.leatherDark)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(0.5, 0.46, 0.08), CFrame.new(0, LT.Y * 0.35, -UT.Z * 1.12), P.brass, K.METAL)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(0.28, 0.24, 0.1), CFrame.new(0, LT.Y * 0.35, -UT.Z * 1.15), P.leatherDark)
|
||||
K.part("LowerTorso", K.BALL, Vector3.new(0.6, 0.7, 0.45), CFrame.new(-UT.X * 0.58, -0.2, -UT.Z * 0.2), P.leather) -- кошель
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(0.2, 0.12, 0.2), CFrame.new(-UT.X * 0.58, 0.18, -UT.Z * 0.2), P.brass, K.METAL)
|
||||
local side = CFrame.new(UT.X * 0.6, LT.Y * 0.1, -UT.Z * 0.1)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(0.1, 1.7, 0.1), side * CFrame.new(0, -0.8, 0) * CFrame.Angles(0, 0, math.rad(8)), P.brass, K.METAL) -- коромысло
|
||||
K.part("LowerTorso", K.BALL, Vector3.new(0.45, 0.45, 0.45), side * CFrame.new(0.12, -1.65, 0), P.iron, K.METAL) -- гиря
|
||||
K.part("LowerTorso", K.CYL, Vector3.new(0.08, 0.3, 0.3), side * CFrame.new(-0.02, -0.1, 0), P.iron, K.METAL) -- кольцо
|
||||
|
||||
-- голова: пышная рыжая борода, усы, брови, бакенбарды, нос картошкой
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 0.98, H.Y * 0.7, H.Z * 0.62), CFrame.new(0, -H.Y * 0.42, -H.Z * 0.28), P.ginger)
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 0.72, H.Y * 0.6, H.Z * 0.5), CFrame.new(0, -H.Y * 0.72, -H.Z * 0.34), P.ginger)
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 0.4, H.Y * 0.36, H.Z * 0.32), CFrame.new(0, -H.Y * 0.98, -H.Z * 0.36), P.gingerDark)
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 0.42, H.Y * 0.2, H.Z * 0.22), CFrame.new(x * H.X * 0.2, -H.Y * 0.14, -H.Z * 0.52) * CFrame.Angles(0, 0, x * math.rad(-12)), P.gingerDark) -- усы
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.24, H.Y * 0.07, 0.08), CFrame.new(x * H.X * 0.2, H.Y * 0.2, -H.Z * 0.5) * CFrame.Angles(0, 0, x * math.rad(-8)), P.gingerDark) -- брови
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.14, H.Y * 0.5, H.Z * 0.46), CFrame.new(x * H.X * 0.47, -H.Y * 0.06, -H.Z * 0.08), P.ginger) -- бакенбарды
|
||||
end
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 0.24, H.Y * 0.22, H.Z * 0.2), CFrame.new(0, -H.Y * 0.0, -H.Z * 0.55), Color3.fromRGB(214, 146, 118)) -- нос
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 1.0, H.Y * 0.34, H.Z * 0.26), CFrame.new(0, H.Y * 0.04, H.Z * 0.42), P.ginger) -- волосы сзади
|
||||
|
||||
-- вязаная шапка: колпак в полоску, отворот, помпон
|
||||
K.part("Head", K.BALL, Vector3.new(H.X * 1.1, H.Y * 0.8, H.Z * 1.1), CFrame.new(0, H.Y * 0.55, 0.04), P.green, K.FABRIC)
|
||||
K.part("Head", K.CYL, Vector3.new(0.12, H.X * 1.0, H.Z * 1.0), CFrame.new(0, H.Y * 0.7, 0.04) * K.UP, P.crimson, K.FABRIC)
|
||||
K.part("Head", K.CYL, Vector3.new(H.Y * 0.22, H.X * 1.12, H.Z * 1.12), CFrame.new(0, H.Y * 0.38, 0.04) * K.UP, P.greenDark, K.FABRIC)
|
||||
K.part("Head", K.BALL, Vector3.new(0.48, 0.48, 0.48), CFrame.new(0, H.Y * 0.98, 0.08), P.crimson, K.FABRIC)
|
||||
|
||||
-- рыбина в левой руке
|
||||
K.part("LeftHand", K.BALL, Vector3.new(0.38, 1.5, 0.62), CFrame.new(0, -0.9, -0.12), P.fish)
|
||||
K.part("LeftHand", K.BLOCK, Vector3.new(0.1, 0.4, 0.7), CFrame.new(0, -1.75, -0.12), Color3.fromRGB(120, 132, 126))
|
||||
K.part("LeftHand", K.BLOCK, Vector3.new(0.4, 0.06, 0.06), CFrame.new(0, -0.35, -0.42), P.iron) -- крюк, на котором висит
|
||||
end,
|
||||
}
|
||||
|
||||
local C = Color3.fromRGB
|
||||
local FUR = C(214, 206, 190)
|
||||
local FUR_DARK = C(120, 92, 66)
|
||||
|
||||
---------------------------------------------------------------- лобби
|
||||
|
||||
-- Продавец Михалыч: худой мастер удочек. Очки, усы щёткой, лысина с венчиком седых волос,
|
||||
-- тёмно-зелёная рубаха с длинными рукавами, кожаный фартук с инструментами, удочка в руке
|
||||
LOOKS["Продавец Михалыч"] = {
|
||||
scale = { height = 1.05, width = 0.95, depth = 0.95, head = 1.25 },
|
||||
colors = { skin = C(226, 174, 138), shirt = P.green, pants = C(84, 70, 56) },
|
||||
lines = {
|
||||
"Удочку не выбирают — удочка выбирает рыбака.",
|
||||
"Бамбук лёгкий, карбон звонкий, а золото… золото для тех, кто знает толк!",
|
||||
"Сам выстругал, сам лаком покрыл. Сорок лет мастерю!",
|
||||
"Улучши удочку — рыба сама на крючок полезет.",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local H, UT = K.H, K.UT
|
||||
K.shirt(P.green)
|
||||
K.sleeves(P.green, true, P.greenDark)
|
||||
K.hands(C(226, 174, 138))
|
||||
K.pants(C(84, 70, 56))
|
||||
K.boots(P.leatherDark, P.leather, true)
|
||||
K.apron(P.leather, P.leatherDark)
|
||||
K.belt(P.leatherDark, P.brass)
|
||||
-- инструменты в кармане фартука: молоток, стамеска, катушка ниток
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(UT.X * 0.6, 0.45, 0.06), CFrame.new(0, -UT.Y * 0.15, -UT.Z * 0.5 - 0.26), P.leatherDark)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(0.12, 0.7, 0.08), CFrame.new(-UT.X * 0.18, 0.05, -UT.Z * 0.5 - 0.3), P.wood)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(0.35, 0.16, 0.16), CFrame.new(-UT.X * 0.18, 0.4, -UT.Z * 0.5 - 0.3), P.iron, K.METAL)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(0.08, 0.6, 0.08), CFrame.new(UT.X * 0.05, 0.02, -UT.Z * 0.5 - 0.3), P.iron, K.METAL)
|
||||
K.part("LowerTorso", K.CYL, Vector3.new(0.2, 0.3, 0.3), CFrame.new(UT.X * 0.2, -0.05, -UT.Z * 0.5 - 0.32), P.crimson)
|
||||
-- лысина с венчиком седых волос, очки, усы щёткой
|
||||
local GREY = C(176, 172, 164)
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 1.02, H.Y * 0.36, H.Z * 0.3), CFrame.new(0, H.Y * 0.0, H.Z * 0.4), GREY)
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.14, H.Y * 0.36, H.Z * 0.6), CFrame.new(x * H.X * 0.48, H.Y * 0.02, H.Z * 0.12), GREY)
|
||||
end
|
||||
K.glasses(P.brass)
|
||||
K.moustache(C(150, 140, 128), "brush")
|
||||
K.brows(GREY)
|
||||
K.nose(C(214, 158, 124))
|
||||
K.rod(false)
|
||||
end,
|
||||
}
|
||||
|
||||
-- Скупщица Зина: бойкая торговка. Синий платок, коса, льняная блуза, синяя юбка с белым фартуком,
|
||||
-- корзина рыбы в руке
|
||||
LOOKS["Скупщица Зина"] = {
|
||||
scale = { height = 1.0, width = 1.05, depth = 1.05, head = 1.25 },
|
||||
colors = { skin = C(240, 196, 162), shirt = P.linen, pants = C(52, 74, 112) },
|
||||
lines = {
|
||||
"Рыбка-то какая! Беру, не торгуюсь… почти.",
|
||||
"Неси всё, что поймал, — сумка не резиновая!",
|
||||
"У Гриши в Тихом озере цены не хуже, но я улыбаюсь чаще!",
|
||||
"Ой, щучку бы мне, на уху!",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local H = K.H
|
||||
local BLUE = C(52, 74, 112)
|
||||
K.shirt(P.linen)
|
||||
K.sleeves(P.linen, false, P.linenDark)
|
||||
K.hands(C(240, 196, 162))
|
||||
K.skirt(BLUE, 0.92, C(36, 54, 84))
|
||||
K.apron(C(226, 220, 204), C(200, 192, 172))
|
||||
K.belt(P.crimson)
|
||||
K.boots(P.leatherDark, nil, true)
|
||||
K.hat("scarf", C(70, 100, 150), C(52, 74, 112))
|
||||
-- коса из-под платка
|
||||
K.part("Head", K.BLOCK, Vector3.new(0.34, H.Y * 1.3, 0.34), CFrame.new(0, -H.Y * 0.75, H.Z * 0.55), C(150, 96, 52))
|
||||
K.part("Head", K.BALL, Vector3.new(0.3, 0.3, 0.3), CFrame.new(0, -H.Y * 1.42, H.Z * 0.55), P.crimson)
|
||||
K.nose(C(232, 176, 146))
|
||||
-- щёки-румянец
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.16, H.Y * 0.1, 0.05), CFrame.new(x * H.X * 0.3, -H.Y * 0.12, -H.Z * 0.5), C(236, 150, 140))
|
||||
end
|
||||
-- корзина с рыбой в левой руке
|
||||
K.part("LeftHand", K.BLOCK, Vector3.new(1.2, 0.75, 0.85), CFrame.new(0, -0.75, 0), C(170, 124, 66))
|
||||
K.part("LeftHand", K.BLOCK, Vector3.new(0.1, 0.7, 0.75), CFrame.new(0, -0.15, 0), C(140, 98, 50))
|
||||
K.part("LeftHand", K.BALL, Vector3.new(1.0, 0.3, 0.32), CFrame.new(0, -0.32, 0.1) * CFrame.Angles(0, math.rad(20), 0), P.fish)
|
||||
end,
|
||||
}
|
||||
|
||||
-- Барон Злотов: важный богач (пропуска за робуксы). Фиолетовый бархатный камзол с золотом,
|
||||
-- багровый плащ с меховым воротом, высокая шляпа с пером, остроконечная бородка, золотая цепь, кошель с золотом
|
||||
LOOKS["Барон Злотов"] = {
|
||||
scale = { height = 1.15, width = 1.1, depth = 1.15, head = 1.2 },
|
||||
colors = { skin = C(232, 188, 152), shirt = C(92, 46, 112), pants = C(36, 30, 40) },
|
||||
lines = {
|
||||
"Истинный рыбак не жалеет золота на удачу!",
|
||||
"VIP? Да-да, корона идёт к любому лицу.",
|
||||
"Моя золотая рыбка исполняет только одно желание — ещё золота.",
|
||||
"Подойди, мил человек, у меня для тебя особое предложение…",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local H, UT = K.H, K.UT
|
||||
local VELVET, GOLD = C(92, 46, 112), C(214, 168, 72)
|
||||
K.shirt(VELVET)
|
||||
K.sleeves(VELVET, true, GOLD)
|
||||
K.hands(C(232, 188, 152))
|
||||
K.pants(C(36, 30, 40))
|
||||
K.boots(C(40, 30, 26), GOLD)
|
||||
K.belt(C(40, 30, 26), GOLD)
|
||||
-- золотая тесьма по камзолу и пуговицы
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.16, UT.Y * 1.0, 0.06), CFrame.new(0, 0, -UT.Z * 0.5 - 0.11), GOLD, K.METAL)
|
||||
for i = 0, 3 do
|
||||
K.part("UpperTorso", K.BALL, Vector3.new(0.16, 0.16, 0.1), CFrame.new(0.2, UT.Y * (0.3 - i * 0.2), -UT.Z * 0.5 - 0.12), GOLD, K.METAL)
|
||||
end
|
||||
K.cloak(C(122, 34, 36), FUR, 0.85)
|
||||
K.medallion(GOLD)
|
||||
K.hat("tall", C(40, 30, 36), GOLD)
|
||||
K.beard(C(70, 46, 30), "goatee")
|
||||
K.moustache(C(70, 46, 30), "thin")
|
||||
K.brows(C(70, 46, 30))
|
||||
K.nose(C(222, 170, 136))
|
||||
K.hair(C(70, 46, 30), false)
|
||||
-- тугой кошель с золотом
|
||||
K.part("LeftHand", K.BALL, Vector3.new(0.85, 0.95, 0.85), CFrame.new(0, -0.7, -0.1), C(110, 40, 40))
|
||||
K.part("LeftHand", K.BALL, Vector3.new(0.5, 0.25, 0.5), CFrame.new(0, -0.2, -0.1), GOLD, K.METAL)
|
||||
end,
|
||||
}
|
||||
|
||||
-- Купчиха Злата: дородная купчиха (наборы монет). Кокошник с жемчугом, шуба-душегрея с мехом,
|
||||
-- длинный багрово-золотой сарафан, бусы, ларец с монетами
|
||||
LOOKS["Купчиха Злата"] = {
|
||||
scale = { height = 1.05, width = 1.25, depth = 1.25, head = 1.25 },
|
||||
colors = { skin = C(242, 202, 170), shirt = C(160, 46, 40), pants = C(160, 46, 40) },
|
||||
lines = {
|
||||
"Серебро к серебру — копейка к копейке!",
|
||||
"Ларцы полны, а ты всё с пустыми карманами?",
|
||||
"Торговать — не рыбу ловить, тут смекалка нужна.",
|
||||
"Бери набор побольше — потом спасибо скажешь!",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local H, UT = K.H, K.UT
|
||||
local RED, GOLD = C(160, 46, 40), C(214, 168, 72)
|
||||
K.shirt(RED)
|
||||
K.sleeves(C(230, 222, 204), true, GOLD)
|
||||
K.hands(C(242, 202, 170))
|
||||
K.skirt(RED, 0.95, GOLD)
|
||||
K.boots(C(120, 40, 34), nil, true)
|
||||
-- душегрея: меховая оторочка по краю и воротник
|
||||
K.vest(C(196, 150, 70), FUR)
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X * 1.05, UT.Y * 0.28, UT.Z + 0.5), CFrame.new(0, UT.Y * 0.5, 0), FUR, K.FABRIC)
|
||||
-- бусы
|
||||
for i = -3, 3 do
|
||||
K.part("UpperTorso", K.BALL, Vector3.new(0.18, 0.18, 0.18), CFrame.new(i * UT.X * 0.07, UT.Y * 0.28 - math.abs(i) * 0.05, -UT.Z * 0.6), (i % 2 == 0) and C(240, 236, 226) or P.crimson)
|
||||
end
|
||||
K.hat("kokoshnik", GOLD, RED)
|
||||
K.hair(C(110, 70, 40), true)
|
||||
K.nose(C(234, 182, 150))
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.16, H.Y * 0.1, 0.05), CFrame.new(x * H.X * 0.3, -H.Y * 0.12, -H.Z * 0.5), C(236, 150, 140))
|
||||
end
|
||||
-- ларец с монетами в руках
|
||||
K.part("LeftHand", K.BLOCK, Vector3.new(1.0, 0.65, 0.7), CFrame.new(0.3, -0.45, -0.35), C(110, 66, 40))
|
||||
K.part("LeftHand", K.BLOCK, Vector3.new(1.04, 0.12, 0.74), CFrame.new(0.3, -0.12, -0.35), GOLD, K.METAL)
|
||||
K.part("LeftHand", K.BLOCK, Vector3.new(0.8, 0.12, 0.5), CFrame.new(0.3, -0.02, -0.35), C(230, 232, 236), K.METAL)
|
||||
end,
|
||||
}
|
||||
|
||||
-- Старейшина Ворон: глава гильдии. Седой, повязка на глазу, длинная седая борода, тёмный плащ
|
||||
-- с капюшоном и меховым воротом, посох с фонарём, медальон гильдии
|
||||
LOOKS["Старейшина Ворон"] = {
|
||||
scale = { height = 1.15, width = 1.0, depth = 1.0, head = 1.2 },
|
||||
colors = { skin = C(222, 176, 140), shirt = C(58, 46, 70), pants = C(48, 40, 34) },
|
||||
lines = {
|
||||
"Ранг не дарят — его выуживают, печать за печатью.",
|
||||
"Я видел рыбу, что глотает лодки. Глазом поплатился.",
|
||||
"Доска заказов ждёт. Гильдия помнит тех, кто держит слово.",
|
||||
"Терпение, юнец. Озеро любит тихих.",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local GREY, ROBE = C(206, 204, 198), C(58, 46, 70)
|
||||
K.shirt(ROBE)
|
||||
K.sleeves(ROBE, true, C(44, 34, 54))
|
||||
K.hands(C(222, 176, 140))
|
||||
K.skirt(C(48, 38, 58), 0.9, C(36, 28, 44)) -- длинная ряса
|
||||
K.boots(P.leatherDark, nil, true)
|
||||
K.belt(P.leatherDark, P.brass)
|
||||
K.cloak(C(36, 32, 40), FUR_DARK, 0.95)
|
||||
K.hat("hood", C(36, 32, 40), FUR_DARK)
|
||||
K.hair(GREY, true)
|
||||
K.beard(GREY, "long", C(176, 174, 168))
|
||||
K.moustache(GREY)
|
||||
K.brows(GREY, true)
|
||||
K.eyepatch()
|
||||
K.nose(C(206, 156, 124))
|
||||
K.medallion(P.brass)
|
||||
K.staff("lantern")
|
||||
end,
|
||||
}
|
||||
|
||||
-- Рыбак Фёдор: молодой крепкий рыбак, гуляет по площади (удочку ему даёт LobbyLife).
|
||||
-- Красная повязка на голове, кожаный жилет поверх льняной рубахи, высокие сапоги, сеть через плечо
|
||||
LOOKS["Рыбак Фёдор"] = {
|
||||
scale = { height = 1.08, width = 1.15, depth = 1.05, head = 1.15 },
|
||||
colors = { skin = C(226, 176, 140), shirt = P.linen, pants = C(70, 84, 102) },
|
||||
lines = {
|
||||
"Утро! Клёв сегодня — сказка!",
|
||||
"Иду на Тихое озеро. Говорят, там осётр хрустальный…",
|
||||
"Сеть залатал, удочку наточил — что ещё рыбаку надо?",
|
||||
"Не стой столбом, айда рыбачить!",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local UT = K.UT
|
||||
K.shirt(P.linen)
|
||||
K.sleeves(P.linen, false, P.linenDark)
|
||||
K.hands(C(226, 176, 140))
|
||||
K.pants(C(70, 84, 102))
|
||||
K.boots(P.leather, P.leatherDark)
|
||||
K.vest(P.leather, P.leatherDark)
|
||||
K.belt(P.leatherDark, P.brass)
|
||||
K.hat("headband", P.crimson)
|
||||
K.hair(C(120, 78, 44), false)
|
||||
K.beard(C(120, 78, 44), "stubble")
|
||||
K.brows(C(100, 64, 36))
|
||||
K.nose(C(214, 160, 126))
|
||||
-- сеть через плечо: перевязь крест-накрест и свёрток сети на бедре
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.3, UT.Y * 1.6, UT.Z + 0.4), CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, math.rad(35)), C(150, 120, 80), K.FABRIC)
|
||||
for i = 0, 3 do
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.06, UT.Y * 1.5, 0.06), CFrame.new(-0.12 + i * 0.08, 0, -UT.Z * 0.5 - 0.22) * CFrame.Angles(0, 0, math.rad(35)), C(110, 86, 56))
|
||||
end
|
||||
K.part("LowerTorso", K.BALL, Vector3.new(0.9, 0.8, 0.7), CFrame.new(UT.X * 0.6, -0.4, 0), C(150, 120, 80), K.FABRIC)
|
||||
K.bag(P.leather)
|
||||
end,
|
||||
}
|
||||
|
||||
-- Бабушка Нюра: милая деревенская старушка, гуляет по площади (корзинку ей даёт LobbyLife).
|
||||
-- Три приглушённых цвета: тёмно-синий платок и шаль, коричневое платье до земли, льняной передник.
|
||||
-- Седые волосы из-под платка, румянец, клюка
|
||||
LOOKS["Бабушка Нюра"] = {
|
||||
scale = { height = 0.9, width = 1.1, depth = 1.1, head = 1.25 },
|
||||
colors = { skin = C(228, 176, 146), shirt = C(104, 76, 58), pants = C(104, 76, 58) },
|
||||
lines = {
|
||||
"Внучок, пирожков с рыбкой не хочешь?",
|
||||
"В мои годы удочки из орешника делали — и ничего, ловили!",
|
||||
"Шапку надень, у озера-то ветрено.",
|
||||
"Ох, кот опять за тобой увязался…",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local H, UT = K.H, K.UT
|
||||
local BLUE, DRESS, LINEN = C(54, 64, 92), C(104, 76, 58), C(206, 192, 160)
|
||||
K.shirt(DRESS)
|
||||
K.sleeves(DRESS, true, C(86, 62, 46))
|
||||
K.hands(C(228, 176, 146))
|
||||
K.skirt(DRESS, 1.0, C(86, 62, 46)) -- до земли
|
||||
K.apron(LINEN, C(184, 170, 140))
|
||||
-- шаль: на плечах и треугольником на спине, концы спереди
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X + K.A.X * 1.5, UT.Y * 0.42, UT.Z + 0.42), CFrame.new(0, UT.Y * 0.32, 0), BLUE, K.FABRIC)
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X * 0.75, UT.X * 0.75, 0.12), CFrame.new(0, -UT.Y * 0.05, UT.Z * 0.5 + 0.22) * CFrame.Angles(0, 0, math.rad(45)), BLUE, K.FABRIC)
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.3, UT.Y * 0.6, 0.12), CFrame.new(x * UT.X * 0.2, -UT.Y * 0.05, -UT.Z * 0.5 - 0.22) * CFrame.Angles(0, 0, x * math.rad(12)), BLUE, K.FABRIC)
|
||||
end
|
||||
-- платок, седая прядь из-под него, седые волосы сзади
|
||||
K.hat("scarf", BLUE, C(44, 52, 76))
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.8, H.Y * 0.08, H.Z * 0.1), CFrame.new(0, H.Y * 0.43, -H.Z * 0.52), C(214, 212, 206))
|
||||
K.nose(C(216, 160, 130))
|
||||
-- румянец
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.14, H.Y * 0.08, 0.04), CFrame.new(x * H.X * 0.3, -H.Y * 0.14, -H.Z * 0.5), C(218, 140, 128))
|
||||
end
|
||||
-- клюка в левой руке
|
||||
K.part("LeftHand", K.CYL, Vector3.new(3.4, 0.2, 0.2), CFrame.new(0, -1.5, -0.2) * K.UP, P.wood)
|
||||
K.part("LeftHand", K.CYL, Vector3.new(0.7, 0.22, 0.22), CFrame.new(0.2, 0.2, -0.2), P.wood)
|
||||
end,
|
||||
}
|
||||
|
||||
-- Дед Петрович: старый рыбак у причала. Соломенная шляпа, длинная седая борода, латаная рубаха,
|
||||
-- подвёрнутые штаны, трубка, удочка за спиной
|
||||
LOOKS["Дед Петрович"] = {
|
||||
scale = { height = 0.98, width = 1.05, depth = 1.05, head = 1.25 },
|
||||
colors = { skin = C(224, 172, 136), shirt = C(110, 120, 80), pants = C(84, 70, 54) },
|
||||
lines = {
|
||||
"Рыба клюёт быстрее на хорошую удочку. Это я тебе как дед говорю!",
|
||||
"Хрустальный осётр… Видал я его тень. Один раз. В тумане.",
|
||||
"Наживку бери у меня — червячок свежий, сам копал.",
|
||||
"Эх, трубочку покурю, пока поплавок молчит.",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local UT = K.UT
|
||||
local SHIRT = C(110, 120, 80)
|
||||
K.shirt(SHIRT)
|
||||
K.sleeves(SHIRT, false, C(90, 100, 66))
|
||||
K.hands(C(224, 172, 136))
|
||||
K.pants(C(84, 70, 54))
|
||||
-- подвёрнутые штанины и лапти-обмотки
|
||||
for _, s in ipairs(K.SIDES) do
|
||||
local ll = K.size(s .. "LowerLeg")
|
||||
K.part(s .. "LowerLeg", K.BLOCK, Vector3.new(ll.X + 0.32, 0.3, ll.Z + 0.32), CFrame.new(0, ll.Y * 0.05, 0), C(66, 54, 42), K.FABRIC)
|
||||
K.cover(s .. "LowerLeg", P.linen, 0.16, -0.5, -0.1, K.FABRIC)
|
||||
local f = K.size(s .. "Foot")
|
||||
K.part(s .. "Foot", K.BLOCK, Vector3.new(f.X + 0.16, f.Y + 0.1, f.Z + 0.3), CFrame.new(0, 0, -0.1), P.straw)
|
||||
end
|
||||
-- заплатки на рубахе
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.5, 0.45, 0.04), CFrame.new(UT.X * 0.25, -UT.Y * 0.15, -UT.Z * 0.5 - 0.1) * CFrame.Angles(0, 0, math.rad(8)), C(150, 110, 70))
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.4, 0.35, 0.04), CFrame.new(-UT.X * 0.28, UT.Y * 0.15, -UT.Z * 0.5 - 0.1) * CFrame.Angles(0, 0, math.rad(-6)), C(120, 60, 50))
|
||||
K.belt(C(140, 110, 70)) -- верёвочный пояс
|
||||
K.hat("straw", P.straw, C(110, 70, 40))
|
||||
K.hair(P.grey, false)
|
||||
K.beard(P.grey, "long", C(170, 168, 162))
|
||||
K.moustache(P.grey)
|
||||
K.brows(P.grey)
|
||||
K.nose(C(212, 150, 120))
|
||||
K.pipe()
|
||||
K.rod(true)
|
||||
end,
|
||||
}
|
||||
|
||||
---------------------------------------------------------------- Мир 2: тропический остров
|
||||
|
||||
-- Скупщик Мигель: загорелый южный торговец. Оранжевая бандана, золотая серьга, чёрные усы,
|
||||
-- белая рубаха с короткими рукавами, расстёгнутый жилет, красный кушак, кокос в руке
|
||||
LOOKS["Скупщик Мигель"] = {
|
||||
scale = { height = 1.05, width = 1.1, depth = 1.05, head = 1.2 },
|
||||
colors = { skin = C(190, 136, 96), shirt = C(236, 226, 206), pants = C(214, 190, 140) },
|
||||
lines = {
|
||||
"¡Hola, amigo! Рыба-клоун нынче в моде!",
|
||||
"Солнце жарит, а цены у меня — прохладные.",
|
||||
"Акулу принесёшь — угощу кокосом. Целым!",
|
||||
"На острове всё неторопливо… кроме моих весов.",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local UT = K.UT
|
||||
K.shirt(C(236, 226, 206))
|
||||
K.sleeves(C(236, 226, 206), false, C(214, 204, 184))
|
||||
K.hands(C(190, 136, 96))
|
||||
K.pants(C(214, 190, 140))
|
||||
K.boots(C(120, 80, 48), nil, true)
|
||||
K.vest(C(70, 110, 120), C(214, 168, 72))
|
||||
-- кушак с концами
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(UT.X + 0.34, 0.5, UT.Z + 0.34), CFrame.new(0, K.LT.Y * 0.3, 0), C(176, 54, 44), K.FABRIC)
|
||||
K.part("LowerTorso", K.BLOCK, Vector3.new(0.3, 0.9, 0.12), CFrame.new(UT.X * 0.35, -0.5, -UT.Z * 0.5 - 0.18), C(176, 54, 44), K.FABRIC)
|
||||
K.hat("bandana", C(230, 130, 50), C(200, 100, 40))
|
||||
K.hair(C(40, 30, 26), false)
|
||||
K.moustache(C(40, 30, 26), "bushy")
|
||||
K.brows(C(40, 30, 26))
|
||||
K.nose(C(176, 118, 84))
|
||||
K.earring()
|
||||
-- кокос
|
||||
K.part("LeftHand", K.BALL, Vector3.new(0.85, 0.85, 0.85), CFrame.new(0, -0.6, -0.1), C(110, 72, 44))
|
||||
end,
|
||||
}
|
||||
|
||||
-- Капитан Боря: бывалый морской волк. Треуголка с золотом, тёмно-синий камзол с латунными пуговицами,
|
||||
-- седая окладистая борода, трубка, подзорная труба
|
||||
LOOKS["Капитан Боря"] = {
|
||||
scale = { height = 1.1, width = 1.25, depth = 1.2, head = 1.25 },
|
||||
colors = { skin = C(224, 172, 136), shirt = C(36, 46, 82), pants = C(232, 228, 216) },
|
||||
lines = {
|
||||
"Свистать всех наверх! А, это ты… Ну, здравствуй.",
|
||||
"Скаты любят мелководье, а акулы — глубину за причалом.",
|
||||
"Тридцать лет в море — и ни одной рыбы, что я бы не узнал.",
|
||||
"Солнечная медуза светится по ночам. Смотри в оба!",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local UT = K.UT
|
||||
local NAVY = C(36, 46, 82)
|
||||
K.shirt(NAVY)
|
||||
K.sleeves(NAVY, true, C(214, 168, 72))
|
||||
K.hands(C(224, 172, 136))
|
||||
K.pants(C(232, 228, 216))
|
||||
K.boots(C(30, 26, 24), C(60, 50, 44))
|
||||
K.belt(C(30, 26, 24), P.brass)
|
||||
K.skirt(NAVY, 0.45) -- полы камзола
|
||||
for i = 0, 3 do
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("UpperTorso", K.BALL, Vector3.new(0.18, 0.18, 0.1), CFrame.new(x * 0.32, UT.Y * (0.3 - i * 0.2), -UT.Z * 0.5 - 0.12), P.brass, K.METAL)
|
||||
end
|
||||
end
|
||||
-- эполеты
|
||||
for _, s in ipairs(K.SIDES) do
|
||||
local up = K.size(s .. "UpperArm")
|
||||
K.part(s .. "UpperArm", K.BLOCK, Vector3.new(up.X + 0.4, 0.18, up.Z + 0.4), CFrame.new(0, up.Y * 0.52, 0), C(214, 168, 72), K.METAL)
|
||||
end
|
||||
K.hat("captain", C(26, 30, 50), C(214, 168, 72))
|
||||
K.hair(P.grey, false)
|
||||
K.beard(P.grey, "full", C(176, 174, 168))
|
||||
K.moustache(P.grey)
|
||||
K.brows(P.grey, true)
|
||||
K.nose(C(210, 150, 120))
|
||||
K.pipe()
|
||||
-- подзорная труба
|
||||
K.part("LeftHand", K.CYL, Vector3.new(1.4, 0.32, 0.32), CFrame.new(0, -0.3, -0.4) * CFrame.Angles(0, math.rad(90), 0), P.brass, K.METAL)
|
||||
K.part("LeftHand", K.CYL, Vector3.new(0.5, 0.4, 0.4), CFrame.new(0, -0.3, -1.05) * CFrame.Angles(0, math.rad(90), 0), P.leatherDark)
|
||||
end,
|
||||
}
|
||||
|
||||
---------------------------------------------------------------- Мир 3: ледяной фьорд
|
||||
|
||||
-- Скупщица Нина: румяная северянка. Белая меховая ушанка, багровый тулуп с мехом, полосатый шарф,
|
||||
-- варежки, валенки, мороженая рыбина
|
||||
LOOKS["Скупщица Нина"] = {
|
||||
scale = { height = 1.0, width = 1.2, depth = 1.2, head = 1.25 },
|
||||
colors = { skin = C(244, 210, 190), shirt = C(150, 40, 44), pants = C(150, 40, 44) },
|
||||
lines = {
|
||||
"Брр! Рыбка мороженая — дольше хранится!",
|
||||
"Треску беру, сельдь беру, а левиафана — с поклоном!",
|
||||
"Варежки сними, а то монеты уронишь.",
|
||||
"Чай с брусникой будешь? Горячий, с самовара!",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local H, UT = K.H, K.UT
|
||||
local COAT = C(150, 40, 44)
|
||||
K.shirt(COAT)
|
||||
K.sleeves(COAT, true, FUR)
|
||||
K.skirt(COAT, 0.75, FUR) -- тулуп ниже колен
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(0.3, UT.Y * 1.0, 0.08), CFrame.new(0, 0, -UT.Z * 0.5 - 0.12), FUR, K.FABRIC) -- меховая планка
|
||||
K.belt(C(60, 40, 30))
|
||||
-- варежки и валенки
|
||||
for _, s in ipairs(K.SIDES) do
|
||||
local hs = K.size(s .. "Hand")
|
||||
K.part(s .. "Hand", K.BALL, Vector3.new(hs.X * 1.4, hs.Y * 1.4, hs.Z * 1.5), CFrame.new(0, -hs.Y * 0.1, 0), C(70, 100, 150), K.FABRIC)
|
||||
K.cover(s .. "LowerLeg", C(150, 146, 140), 0.24, -0.5, 0.4, K.FABRIC)
|
||||
local f = K.size(s .. "Foot")
|
||||
K.part(s .. "Foot", K.BLOCK, Vector3.new(f.X + 0.24, f.Y + 0.14, f.Z + 0.36), CFrame.new(0, 0, -0.1), C(150, 146, 140), K.FABRIC)
|
||||
end
|
||||
-- полосатый шарф
|
||||
K.scarf(C(70, 100, 150), true)
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X * 0.87, 0.1, UT.Z + 0.47), CFrame.new(0, UT.Y * 0.52, 0), C(236, 230, 220), K.FABRIC)
|
||||
K.hat("ushanka", C(230, 226, 218), C(214, 206, 190))
|
||||
K.hair(C(200, 160, 90), true)
|
||||
K.nose(C(240, 170, 160))
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 0.18, H.Y * 0.12, 0.05), CFrame.new(x * H.X * 0.3, -H.Y * 0.12, -H.Z * 0.5), C(240, 140, 140))
|
||||
end
|
||||
K.fish("RightHand", C(180, 210, 230))
|
||||
end,
|
||||
}
|
||||
|
||||
-- Полярник Саша: бородатый полярник. Коричневая ушанка с очками-консервами, оранжевая парка с мехом,
|
||||
-- инеем в бороде, ледобур в руках
|
||||
LOOKS["Полярник Саша"] = {
|
||||
scale = { height = 1.12, width = 1.3, depth = 1.3, head = 1.2 },
|
||||
colors = { skin = C(230, 186, 160), shirt = C(214, 110, 40), pants = C(52, 58, 72) },
|
||||
lines = {
|
||||
"Ищи лунки во льду — только там рыба.",
|
||||
"Ледяной левиафан… Видел тень подо льдом. Больше не хочу.",
|
||||
"Удильщик светится в темноте. Красиво и жутко!",
|
||||
"Минус сорок — это ещё тепло. Бери бур!",
|
||||
},
|
||||
dress = function(rig, K)
|
||||
local H, UT = K.H, K.UT
|
||||
local PARKA = C(214, 110, 40)
|
||||
K.shirt(PARKA)
|
||||
K.sleeves(PARKA, true, FUR_DARK)
|
||||
K.hands(C(80, 60, 44)) -- перчатки
|
||||
K.pants(C(52, 58, 72))
|
||||
K.boots(C(60, 44, 34), FUR)
|
||||
K.skirt(PARKA, 0.35, FUR_DARK) -- низ парки
|
||||
K.belt(C(40, 40, 44), P.iron)
|
||||
K.part("UpperTorso", K.BLOCK, Vector3.new(UT.X * 1.05, UT.Y * 0.3, UT.Z + 0.6), CFrame.new(0, UT.Y * 0.5, 0.05), FUR_DARK, K.FABRIC) -- меховой воротник
|
||||
K.hat("ushanka", C(110, 80, 56), FUR_DARK)
|
||||
-- очки-консервы на шапке
|
||||
for _, x in ipairs({ -1, 1 }) do
|
||||
K.part("Head", K.CYL, Vector3.new(0.14, H.X * 0.3, H.X * 0.3), CFrame.new(x * H.X * 0.18, H.Y * 0.52, -H.Z * 0.6) * CFrame.Angles(0, math.rad(90), 0), C(120, 180, 210), K.METAL)
|
||||
end
|
||||
K.part("Head", K.BLOCK, Vector3.new(H.X * 1.15, 0.12, H.Z * 1.15), CFrame.new(0, H.Y * 0.52, 0), C(40, 40, 44))
|
||||
K.beard(C(150, 100, 60), "full", C(220, 230, 236)) -- иней в бороде
|
||||
K.moustache(C(150, 100, 60))
|
||||
K.brows(C(220, 230, 236))
|
||||
K.nose(C(232, 150, 140))
|
||||
-- ледобур
|
||||
K.part("RightHand", K.CYL, Vector3.new(4.2, 0.2, 0.2), CFrame.new(0, -0.6, 0) * K.UP, P.iron, K.METAL)
|
||||
K.part("RightHand", K.BLOCK, Vector3.new(1.2, 0.18, 0.18), CFrame.new(0, 1.3, 0), C(170, 40, 34))
|
||||
K.part("RightHand", K.CYL, Vector3.new(0.6, 0.55, 0.55), CFrame.new(0, -2.6, 0) * K.UP, C(170, 176, 182), K.METAL)
|
||||
end,
|
||||
}
|
||||
|
||||
---------------------------------------------------------------- доступ
|
||||
|
||||
function NpcLooks.get(name)
|
||||
return LOOKS[name]
|
||||
end
|
||||
|
||||
-- одеть уже созданный риг
|
||||
function NpcLooks.dress(rig, look)
|
||||
look.dress(rig, kit(rig))
|
||||
if look.lines then
|
||||
rig:SetAttribute("NpcLines", table.concat(look.lines, "|"))
|
||||
end
|
||||
end
|
||||
|
||||
return NpcLooks
|
||||
@@ -40,6 +40,8 @@ end
|
||||
local Config = load(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
local Models = load(ReplicatedStorage:WaitForChild("GameModels"))
|
||||
local World1Builder = load(ServerScriptService:WaitForChild("World1Builder"))
|
||||
-- образы NPC (если модуля нет — NPC собираются по-старому)
|
||||
local NpcLooks = ServerScriptService:FindFirstChild("NpcLooks") and load(ServerScriptService.NpcLooks) or { get = function() return nil end }
|
||||
|
||||
local V = Vector3.new
|
||||
local terrain = Workspace.Terrain
|
||||
@@ -700,6 +702,125 @@ function Builder.stallParts(cf, parent)
|
||||
return list
|
||||
end
|
||||
|
||||
-- Доска лидеров (low poly): два столба, двускатная крыша, табличка с названием, фонарики и экран на rows строк.
|
||||
-- cf стоит на полу и смотрит LookVector на зрителей. Строки Row1…RowN заполняет Leaderboards.server.lua.
|
||||
function Builder.leaderboard(cf, board, rows, parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "Leaderboard_" .. board.id
|
||||
model:SetAttribute("Leaderboard", board.id)
|
||||
local function part(props)
|
||||
local p = Instance.new(props.Class or "Part")
|
||||
p.Anchored = true
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
p.Material = Enum.Material.SmoothPlastic
|
||||
for k, v in pairs(props) do
|
||||
if k ~= "Class" and k ~= "At" then
|
||||
p[k] = v
|
||||
end
|
||||
end
|
||||
p.CFrame = cf * props.At
|
||||
p.Parent = model
|
||||
return p
|
||||
end
|
||||
local WOOD, DARK, TRIM = Color3.fromRGB(122, 82, 50), Color3.fromRGB(58, 38, 26), Color3.fromRGB(176, 122, 66)
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
part({ Name = "Foot", Size = V(2.2, 1, 2.2), At = CFrame.new(s * 6.6, 0.5, 0), Color = Color3.fromRGB(128, 118, 122) })
|
||||
part({ Name = "Post", Size = V(1.3, 16.5, 1.3), At = CFrame.new(s * 6.6, 8.25, 0), Color = WOOD })
|
||||
-- фонарик на столбе
|
||||
local lamp = part({ Name = "Lantern", Size = V(0.9, 1.2, 0.9), At = CFrame.new(s * 6.6, 14.2, -0.95),
|
||||
Material = Enum.Material.Neon, Color = Color3.fromRGB(255, 196, 110), CanCollide = false })
|
||||
part({ Name = "LanternCap", Size = V(1.2, 0.3, 1.2), At = CFrame.new(s * 6.6, 14.95, -0.95), Color = DARK, CanCollide = false })
|
||||
local light = Instance.new("PointLight")
|
||||
light.Range, light.Brightness, light.Color = 12, 0.9, Color3.fromRGB(255, 190, 110)
|
||||
light.Parent = lamp
|
||||
end
|
||||
local screen = part({ Name = "Screen", Size = V(12, 9.6, 0.5), At = CFrame.new(0, 9.4, 0), Color = DARK })
|
||||
part({ Name = "Trim", Size = V(13.4, 0.6, 0.8), At = CFrame.new(0, 14.5, 0), Color = TRIM })
|
||||
part({ Name = "Trim", Size = V(13.4, 0.6, 0.8), At = CFrame.new(0, 4.3, 0), Color = TRIM })
|
||||
local plaque = part({ Name = "Plaque", Size = V(11, 2.3, 0.7), At = CFrame.new(0, 16.2, -0.1), Color = WOOD })
|
||||
part({ Name = "PlaqueTrim", Size = V(11.6, 2.8, 0.5), At = CFrame.new(0, 16.2, 0.15), Color = TRIM })
|
||||
-- двускатная крыша
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
part({ Name = "Roof", Size = V(8, 0.5, 2.6), At = CFrame.new(s * 3.55, 18.35, 0) * CFrame.Angles(0, 0, math.rad(-s * 17)),
|
||||
Color = Color3.fromRGB(150, 70, 52) })
|
||||
end
|
||||
|
||||
-- заголовок
|
||||
local titleGui = Instance.new("SurfaceGui")
|
||||
titleGui.Face = Enum.NormalId.Front
|
||||
titleGui.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
|
||||
titleGui.PixelsPerStud = 40
|
||||
titleGui.LightInfluence = 0
|
||||
titleGui.Parent = plaque
|
||||
local title = Instance.new("TextLabel")
|
||||
title.Size = UDim2.new(1, -16, 1, -8)
|
||||
title.Position = UDim2.fromOffset(8, 4)
|
||||
title.BackgroundTransparency = 1
|
||||
title.Font = Enum.Font.FredokaOne
|
||||
title.TextScaled = true
|
||||
title.Text = board.title
|
||||
title.TextColor3 = board.color
|
||||
title.Parent = titleGui
|
||||
local ts = Instance.new("UIStroke")
|
||||
ts.Color, ts.Thickness = Color3.fromRGB(40, 22, 10), 3
|
||||
ts.Parent = title
|
||||
|
||||
-- строки топа
|
||||
local gui = Instance.new("SurfaceGui")
|
||||
gui.Name = "Rows"
|
||||
gui.Face = Enum.NormalId.Front
|
||||
gui.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
|
||||
gui.PixelsPerStud = 40
|
||||
gui.LightInfluence = 0.2
|
||||
gui.Parent = screen
|
||||
local list = Instance.new("Frame")
|
||||
list.Size = UDim2.new(1, -24, 1, -20)
|
||||
list.Position = UDim2.fromOffset(12, 10)
|
||||
list.BackgroundTransparency = 1
|
||||
list.Parent = gui
|
||||
local layout = Instance.new("UIListLayout")
|
||||
layout.Padding = UDim.new(0, 3)
|
||||
layout.SortOrder = Enum.SortOrder.LayoutOrder
|
||||
layout.Parent = list
|
||||
local RANK_COLOR = { Color3.fromRGB(255, 210, 80), Color3.fromRGB(215, 225, 235), Color3.fromRGB(230, 150, 90) }
|
||||
for i = 1, rows do
|
||||
local row = Instance.new("Frame")
|
||||
row.Name = "Row" .. i
|
||||
row.LayoutOrder = i
|
||||
row.Size = UDim2.new(1, 0, 1 / rows, -3)
|
||||
row.BackgroundColor3 = Color3.fromRGB(255, 240, 210)
|
||||
row.BackgroundTransparency = (i % 2 == 0) and 0.94 or 0.88
|
||||
row.BorderSizePixel = 0
|
||||
row.Parent = list
|
||||
local corner = Instance.new("UICorner")
|
||||
corner.CornerRadius = UDim.new(0, 6)
|
||||
corner.Parent = row
|
||||
local color = RANK_COLOR[i] or Color3.fromRGB(245, 232, 205)
|
||||
local function label(name, pos, size, align, text)
|
||||
local t = Instance.new("TextLabel")
|
||||
t.Name = name
|
||||
t.Position, t.Size = pos, size
|
||||
t.BackgroundTransparency = 1
|
||||
t.Font = Enum.Font.FredokaOne
|
||||
t.TextScaled = true
|
||||
t.TextXAlignment = align
|
||||
t.TextColor3 = color
|
||||
t.Text = text
|
||||
t.Parent = row
|
||||
return t
|
||||
end
|
||||
label("Rank", UDim2.new(0, 6, 0.1, 0), UDim2.new(0, 46, 0.8, 0), Enum.TextXAlignment.Center, ({ "🥇", "🥈", "🥉" })[i] or (i .. "."))
|
||||
label("PlayerName", UDim2.new(0, 58, 0.12, 0), UDim2.new(0.58, -58, 0.76, 0), Enum.TextXAlignment.Left, "—")
|
||||
label("Value", UDim2.new(0.58, 0, 0.12, 0), UDim2.new(0.42, -8, 0.76, 0), Enum.TextXAlignment.Right, "")
|
||||
end
|
||||
-- опора модели — экран, точка опоры на земле под центром доски и без наклона:
|
||||
-- иначе Studio берёт поворот случайной детали (ската крыши) и стрелки инструментов встают наискосок
|
||||
model.PrimaryPart = screen
|
||||
screen.PivotOffset = CFrame.new(0, -9.4, 0)
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
|
||||
-- лавка: cf стоит на полу, сторона -Z смотрит на покупателей
|
||||
local function stall(cf, opt)
|
||||
local function at(x, y, z)
|
||||
@@ -1016,6 +1137,12 @@ function Builder.build()
|
||||
lobbyTrees()
|
||||
lobbyRockPlants()
|
||||
lobbyHills()
|
||||
-- доски лидеров у подножия скал напротив точки появления
|
||||
for i, b in ipairs(Config.Leaderboards.boards) do
|
||||
local a = math.rad(({ 220, 270, 320 })[i] or 270)
|
||||
local p = V(math.cos(a) * 71, FLOOR, math.sin(a) * 71)
|
||||
Builder.leaderboard(CFrame.lookAt(p, V(0, FLOOR, 0)), b, Config.Leaderboards.size, map)
|
||||
end
|
||||
|
||||
-- магазин (запад) и скупка (восток)
|
||||
stall(CFrame.lookAt(V(-62, FLOOR, 0), V(0, FLOOR, 0)), {
|
||||
@@ -1152,12 +1279,31 @@ function Builder.build()
|
||||
-- сундук с ежедневной наградой
|
||||
do
|
||||
local cf = CFrame.lookAt(V(14, FLOOR, 34), V(0, FLOOR, 50))
|
||||
local base = P({ Size = V(5, 3, 3.2), CFrame = cf * CFrame.new(0, 1.5, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 90, 50) })
|
||||
P({ Shape = Enum.PartType.Cylinder, Size = V(5, 3.2, 3.2), CFrame = cf * CFrame.new(0, 3, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(160, 105, 60) })
|
||||
for _, x in ipairs({ -1.8, 1.8 }) do
|
||||
P({ Size = V(0.4, 4.9, 3.4), CFrame = cf * CFrame.new(x, 2.3, 0), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 200, 60) })
|
||||
local template = ServerStorage:FindFirstChild("DailyChestTemplate")
|
||||
local base
|
||||
if template and template:IsA("Model") then
|
||||
-- low poly сундук (Base, Lid, Coins, Lock; замок по +Z модели, опора — низ по центру);
|
||||
-- его анимирует ChestAnimation.client.lua, подсказка и подпись — на невидимой детали
|
||||
local chest = template:Clone()
|
||||
chest.Name = "DailyChest"
|
||||
chest:SetAttribute("DailyChest", true)
|
||||
chest:PivotTo(cf * CFrame.Angles(0, math.pi, 0))
|
||||
for _, p in ipairs(chest:GetDescendants()) do
|
||||
if p:IsA("BasePart") then
|
||||
p.Anchored = true
|
||||
p.CanCollide = p.Name == "Base"
|
||||
end
|
||||
end
|
||||
chest.Parent = map
|
||||
base = P({ Name = "DailyChestPrompt", Size = V(5, 3, 3.2), CFrame = cf * CFrame.new(0, 1.5, 0), Transparency = 1, CanCollide = false })
|
||||
else
|
||||
base = P({ Size = V(5, 3, 3.2), CFrame = cf * CFrame.new(0, 1.5, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 90, 50) })
|
||||
P({ Shape = Enum.PartType.Cylinder, Size = V(5, 3.2, 3.2), CFrame = cf * CFrame.new(0, 3, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(160, 105, 60) })
|
||||
for _, x in ipairs({ -1.8, 1.8 }) do
|
||||
P({ Size = V(0.4, 4.9, 3.4), CFrame = cf * CFrame.new(x, 2.3, 0), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 200, 60) })
|
||||
end
|
||||
P({ Size = V(0.9, 1.1, 0.3), CFrame = cf * CFrame.new(0, 2.8, -1.7), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 220, 90) })
|
||||
end
|
||||
P({ Size = V(0.9, 1.1, 0.3), CFrame = cf * CFrame.new(0, 2.8, -1.7), Material = Enum.Material.Metal, Color = Color3.fromRGB(255, 220, 90) })
|
||||
local sp = Instance.new("ParticleEmitter")
|
||||
sp.Texture = "rbxasset://textures/particles/sparkles_main.dds"
|
||||
sp.Rate = 8
|
||||
@@ -1779,14 +1925,28 @@ local function spawnNpc(spot, parent)
|
||||
pants = color("PantsColor", Color3.fromRGB(60, 70, 100)),
|
||||
hat = color("HatColor", Color3.fromRGB(90, 110, 60)),
|
||||
}
|
||||
-- колоритный образ из NpcLooks (если есть): свои цвета и пропорции тела
|
||||
local look = NpcLooks.get(name)
|
||||
if look and look.colors then
|
||||
for k, v in pairs(look.colors) do
|
||||
colors[k] = v
|
||||
end
|
||||
end
|
||||
local ok, rig = pcall(function()
|
||||
local d = Instance.new("HumanoidDescription")
|
||||
d.HeadColor = colors.skin
|
||||
d.LeftArmColor = colors.skin
|
||||
d.RightArmColor = colors.skin
|
||||
d.LeftArmColor = colors.arms or colors.skin
|
||||
d.RightArmColor = colors.arms or colors.skin
|
||||
d.TorsoColor = colors.shirt
|
||||
d.LeftLegColor = colors.pants
|
||||
d.RightLegColor = colors.pants
|
||||
local s = look and look.scale
|
||||
if s then
|
||||
d.HeightScale = s.height or 1
|
||||
d.WidthScale = s.width or 1
|
||||
d.DepthScale = s.depth or 1
|
||||
d.HeadScale = s.head or 1
|
||||
end
|
||||
return Players:CreateHumanoidModelFromDescription(d, Enum.HumanoidRigType.R15)
|
||||
end)
|
||||
if not ok or not rig then
|
||||
@@ -1794,6 +1954,7 @@ local function spawnNpc(spot, parent)
|
||||
return nil
|
||||
end
|
||||
rig.Name = name
|
||||
rig:SetAttribute("Npc", true) -- по нему клиент находит NPC (взгляд на игрока, приветствие), сервер — включает idle
|
||||
local hum = rig:FindFirstChildOfClass("Humanoid")
|
||||
hum.DisplayName = name
|
||||
hum.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
|
||||
@@ -1801,6 +1962,10 @@ local function spawnNpc(spot, parent)
|
||||
local root = rig:FindFirstChild("HumanoidRootPart")
|
||||
root.Anchored = true
|
||||
rig:PivotTo(spot.CFrame)
|
||||
-- место NPC — на 3 studs выше пола; у рослых и низких образов ставим ноги ровно на пол
|
||||
if look and look.scale then
|
||||
rig:PivotTo(spot.CFrame + Vector3.new(0, hum.HipHeight + root.Size.Y / 2 - 3, 0))
|
||||
end
|
||||
rig.Parent = parent
|
||||
|
||||
local head = rig:FindFirstChild("Head")
|
||||
@@ -1827,10 +1992,11 @@ local function spawnNpc(spot, parent)
|
||||
w.C0 = head.CFrame:Inverse() * p.CFrame
|
||||
w.Parent = p
|
||||
p.Parent = rig
|
||||
<<<<<<< HEAD
|
||||
return p
|
||||
end
|
||||
if spot:GetAttribute("Look") == "Elder" then
|
||||
if look then
|
||||
NpcLooks.dress(rig, look)
|
||||
elseif spot:GetAttribute("Look") == "Elder" then
|
||||
-- Старейшина Ворон: седые волосы и борода (цвет HatColor), чёрная повязка на глазу
|
||||
local function elderPart(size, offset, color, shape)
|
||||
local p = hatPart(size, offset, shape or Enum.PartType.Block)
|
||||
@@ -1841,15 +2007,16 @@ local function spawnNpc(spot, parent)
|
||||
elderPart(V(1.0, 0.75, 0.35), CFrame.new(0, -0.55, -0.5), colors.hat)
|
||||
elderPart(V(0.32, 0.3, 0.08), CFrame.new(0.22, 0.12, -0.6), Color3.fromRGB(20, 20, 22))
|
||||
elderPart(V(1.24, 0.08, 1.24), CFrame.new(0, 0.18, 0) * CFrame.Angles(0, 0, math.rad(-12)), Color3.fromRGB(20, 20, 22))
|
||||
elseif spot:GetAttribute("Look") == "Scarf" then
|
||||
-- платок (цвет HatColor): макушка и узелок сзади
|
||||
local s = hatPart(V(1.3, 0.5, 1.3), CFrame.new(0, 0.42, 0.05), Enum.PartType.Block)
|
||||
s.Material = Enum.Material.SmoothPlastic
|
||||
local k = hatPart(V(0.4, 0.4, 0.3), CFrame.new(0, 0.05, 0.62), Enum.PartType.Block)
|
||||
k.Material = Enum.Material.SmoothPlastic
|
||||
else
|
||||
hatPart(V(0.15, 2.0, 2.0), CFrame.new(0, 0.55, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
hatPart(V(0.6, 1.35, 1.35), CFrame.new(0, 0.85, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
end
|
||||
=======
|
||||
end
|
||||
hatPart(V(0.15, 2.0, 2.0), CFrame.new(0, 0.55, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
hatPart(V(0.6, 1.35, 1.35), CFrame.new(0, 0.85, 0) * CFrame.Angles(0, 0, math.rad(90)), Enum.PartType.Cylinder)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
local action = spot:GetAttribute("NpcAction")
|
||||
if action then
|
||||
@@ -1857,6 +2024,7 @@ local function spawnNpc(spot, parent)
|
||||
end
|
||||
return rig
|
||||
end
|
||||
Builder.spawnNpc = spawnNpc -- жители лобби (LobbyLife.server.lua) создаются так же
|
||||
|
||||
-- NPC встают на свои детали-места, доски «кто водится» получают актуальный список рыб
|
||||
function Builder.prepareRuntime(root)
|
||||
@@ -1874,6 +2042,23 @@ function Builder.prepareRuntime(root)
|
||||
spot.Transparency = 1
|
||||
spawnNpc(spot, root)
|
||||
end
|
||||
-- порталы лобби двигают в Studio за модель (PortalModel_WorldN); невидимый якорь с подсказкой и подписью
|
||||
-- (Portal_WorldN) и маркер стрелки обучения (GuidePortal, перед порталом в мир 1) встают к модели
|
||||
for _, model in ipairs(root:GetChildren()) do
|
||||
local id = model.Name:match("^PortalModel_(World%d)$")
|
||||
local anchor = id and root:FindFirstChild("Portal_" .. id)
|
||||
if model:IsA("Model") and anchor then
|
||||
local cf, size = model:GetBoundingBox()
|
||||
anchor.CFrame = CFrame.new(cf.Position.X, cf.Position.Y - size.Y / 2 + 10, cf.Position.Z) * (anchor.CFrame - anchor.Position)
|
||||
local marker = id == "World1" and root:FindFirstChild("GuidePortal", true)
|
||||
if marker then
|
||||
local flat = V(cf.Position.X, 0, cf.Position.Z)
|
||||
local outward = flat.Magnitude > 0.1 and flat.Unit or V(0, 0, 1)
|
||||
local p = flat + outward * 5.7
|
||||
marker.CFrame = CFrame.new(p.X, marker.Position.Y, p.Z) * (marker.CFrame - marker.Position)
|
||||
end
|
||||
end
|
||||
end
|
||||
for _, board in ipairs(boards) do
|
||||
writeBestiary(board)
|
||||
end
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
-- ActivityFeed (LocalScript) -> StarterPlayer > StarterPlayerScripts
|
||||
-- Постоянная активность на экране: лента событий игроков (уловы, уровни, покупки) и крупный баннер
|
||||
-- со звуком, когда кто-то ловит редкую или мутировавшую рыбу. События шлёт GameServer: remote "Feed".
|
||||
-- Самые редкие уловы приходят и с других серверов (помечены 🌍). Настройки — Config.Feed.
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local TweenService = game:GetService("TweenService")
|
||||
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
local Audio = require(script.Parent:WaitForChild("Audio"))
|
||||
local Theme = require(script.Parent:WaitForChild("UiTheme"))
|
||||
local C = Theme.C
|
||||
local F = Config.Feed
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
local remote = ReplicatedStorage:WaitForChild("GameEvent")
|
||||
|
||||
local function new(class, props, children)
|
||||
local o = Instance.new(class)
|
||||
for k, v in pairs(props) do
|
||||
if k ~= "Parent" then
|
||||
o[k] = v
|
||||
end
|
||||
end
|
||||
for _, c in ipairs(children or {}) do
|
||||
c.Parent = o
|
||||
end
|
||||
o.Parent = props.Parent
|
||||
return o
|
||||
end
|
||||
local function fmt(n)
|
||||
local s = tostring(math.floor(n))
|
||||
local out = s:reverse():gsub("(%d%d%d)", "%1 "):reverse()
|
||||
return (out:gsub("^ ", ""))
|
||||
end
|
||||
local function hex(c)
|
||||
return string.format("#%02X%02X%02X", c.R * 255, c.G * 255, c.B * 255)
|
||||
end
|
||||
local function esc(s)
|
||||
return (tostring(s):gsub("&", "&"):gsub("<", "<"):gsub(">", ">"))
|
||||
end
|
||||
|
||||
local gui = new("ScreenGui", { Name = "ActivityFeed", ResetOnSpawn = false, DisplayOrder = 5, Parent = player:WaitForChild("PlayerGui") })
|
||||
local root = Theme.followScale(gui)
|
||||
|
||||
---------------------------------------------------------------- лента
|
||||
|
||||
local list = new("Frame", { BackgroundTransparency = 1, Parent = root }, {
|
||||
new("UIListLayout", { Padding = UDim.new(0, 4), SortOrder = Enum.SortOrder.LayoutOrder, VerticalAlignment = Enum.VerticalAlignment.Bottom }),
|
||||
})
|
||||
local maxLines = F.lines
|
||||
Theme.onLayout(function(compact)
|
||||
if compact then
|
||||
-- телефон: справа под плашкой погоды (слева внизу — джойстик)
|
||||
list.AnchorPoint = Vector2.new(1, 0)
|
||||
list.Position = UDim2.new(1, -12, 0, 130)
|
||||
list.Size = UDim2.fromOffset(300, 4 * 30)
|
||||
maxLines = 4
|
||||
else
|
||||
list.AnchorPoint = Vector2.new(0, 1)
|
||||
list.Position = UDim2.new(0, 12, 1, -14)
|
||||
list.Size = UDim2.fromOffset(420, F.lines * 30)
|
||||
maxLines = F.lines
|
||||
end
|
||||
end)
|
||||
|
||||
local order = 0
|
||||
local function line(richText)
|
||||
order += 1
|
||||
local rows = {}
|
||||
for _, c in ipairs(list:GetChildren()) do
|
||||
if c:IsA("Frame") then
|
||||
table.insert(rows, c)
|
||||
end
|
||||
end
|
||||
table.sort(rows, function(a, b) return a.LayoutOrder < b.LayoutOrder end)
|
||||
while #rows >= maxLines do
|
||||
table.remove(rows, 1):Destroy()
|
||||
end
|
||||
local row = new("Frame", {
|
||||
Size = UDim2.fromOffset(0, 26), AutomaticSize = Enum.AutomaticSize.X, BackgroundColor3 = C.woodDark,
|
||||
BackgroundTransparency = 0.25, LayoutOrder = order, Parent = list,
|
||||
}, {
|
||||
new("UICorner", { CornerRadius = UDim.new(0, 8) }),
|
||||
new("UIStroke", { Color = C.goldDark, Thickness = 1, Transparency = 0.5 }),
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 10), PaddingRight = UDim.new(0, 10) }),
|
||||
})
|
||||
local label = new("TextLabel", {
|
||||
Size = UDim2.fromScale(0, 1), AutomaticSize = Enum.AutomaticSize.X, BackgroundTransparency = 1,
|
||||
FontFace = Theme.BODY2_FACE, TextSize = 15, TextColor3 = C.text, RichText = true, Text = richText,
|
||||
TextXAlignment = Enum.TextXAlignment.Left, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.6, Parent = row,
|
||||
})
|
||||
-- появляется плавно, через lineTime так же уходит
|
||||
row.BackgroundTransparency, label.TextTransparency = 1, 1
|
||||
TweenService:Create(row, TweenInfo.new(0.3), { BackgroundTransparency = 0.25 }):Play()
|
||||
TweenService:Create(label, TweenInfo.new(0.3), { TextTransparency = 0 }):Play()
|
||||
task.delay(F.lineTime, function()
|
||||
if row.Parent then
|
||||
TweenService:Create(row, TweenInfo.new(0.6), { BackgroundTransparency = 1 }):Play()
|
||||
TweenService:Create(label, TweenInfo.new(0.6), { TextTransparency = 1, TextStrokeTransparency = 1 }):Play()
|
||||
task.wait(0.65)
|
||||
row:Destroy()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- баннер редкого улова
|
||||
|
||||
local banner = new("Frame", {
|
||||
-- внизу над полосой подсечки (она занимает 100…224 px от низа): верх экрана — для своих уведомлений и карточки улова
|
||||
Size = UDim2.fromOffset(560, 92), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -240),
|
||||
BackgroundColor3 = Color3.new(1, 1, 1), Visible = false, ZIndex = 20, Parent = root,
|
||||
}, { new("UICorner", { CornerRadius = UDim.new(0, 12) }), Theme.woodGradient(C.wood, C.woodDark) })
|
||||
local bannerStroke = new("UIStroke", { Thickness = 3, Color = C.gold, Parent = banner })
|
||||
Theme.innerBorder(banner, 5, 8, C.gold, 0.45)
|
||||
Theme.rivets(banner, 8, 6)
|
||||
local bannerScale = new("UIScale", { Parent = banner })
|
||||
local bTop = new("TextLabel", {
|
||||
Size = UDim2.new(1, -30, 0, 20), Position = UDim2.fromOffset(15, 8), BackgroundTransparency = 1, ZIndex = 21,
|
||||
FontFace = Theme.BODY_FACE, TextSize = 15, TextColor3 = C.muted, Text = "", Parent = banner,
|
||||
})
|
||||
local bMain = new("TextLabel", {
|
||||
Size = UDim2.new(1, -30, 0, 34), Position = UDim2.fromOffset(15, 28), BackgroundTransparency = 1, ZIndex = 21,
|
||||
FontFace = Theme.TITLE_FACE, TextSize = 26, TextColor3 = C.text, RichText = true, TextScaled = true, Text = "",
|
||||
TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.4, Parent = banner,
|
||||
})
|
||||
new("UITextSizeConstraint", { MaxTextSize = 26, Parent = bMain })
|
||||
local bSub = new("TextLabel", {
|
||||
Size = UDim2.new(1, -30, 0, 20), Position = UDim2.fromOffset(15, 64), BackgroundTransparency = 1, ZIndex = 21,
|
||||
FontFace = Theme.BODY2_FACE, TextSize = 15, TextColor3 = C.text, RichText = true, Text = "", Parent = banner,
|
||||
})
|
||||
|
||||
local queue, showing = {}, false
|
||||
local function showNext()
|
||||
local info = table.remove(queue, 1)
|
||||
if not info then
|
||||
showing = false
|
||||
return
|
||||
end
|
||||
showing = true
|
||||
local r = Config.Rarities[info.rarity] or Config.Rarities.Common
|
||||
local mut = info.mutation and Config.Find(Config.Mutations, info.mutation)
|
||||
local color = mut and mut.color or r.color
|
||||
bannerStroke.Color = color
|
||||
bTop.Text = info.remote and "🌍 УЛОВ НА ДРУГОМ СЕРВЕРЕ" or "🌟 РЕДКИЙ УЛОВ"
|
||||
bTop.TextColor3 = color
|
||||
-- мутация — отдельной меткой: её название в женском роде («Золотая» рыба), а у рыбы может быть любой
|
||||
bMain.Text = ("<b>%s</b> поймал <font color=\"%s\">%s</font>%s!"):format(esc(info.name), hex(color),
|
||||
esc(info.fish), mut and (" <font color=\"%s\">✦ %s</font>"):format(hex(mut.color), mut.name) or "")
|
||||
bSub.Text = ("<font color=\"%s\">%s</font> · %s %s%s"):format(hex(r.color), r.name, fmt(info.value or 0), Theme.SILVER,
|
||||
info.world and (" · " .. info.world) or "")
|
||||
banner.Visible = true
|
||||
bannerScale.Scale = 0.4
|
||||
TweenService:Create(bannerScale, TweenInfo.new(0.45, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Scale = 1 }):Play()
|
||||
-- звук: легендарная, мифическая и радужная — фанфары, остальное — искристый звон
|
||||
local grand = r.rank >= 5 or info.mutation == "Rainbow"
|
||||
Audio.play(grand and "fanfare" or "sparkle")
|
||||
task.delay(4.2, function()
|
||||
TweenService:Create(bannerScale, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.In), { Scale = 0 }):Play()
|
||||
task.wait(0.3)
|
||||
banner.Visible = false
|
||||
showNext()
|
||||
end)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- события
|
||||
|
||||
local RANK_ICON = { "🎣", "🎣", "🐟", "✨", "🌟", "💫" }
|
||||
remote.OnClientEvent:Connect(function(action, kind, info)
|
||||
if action ~= "Feed" or type(info) ~= "table" then
|
||||
return
|
||||
end
|
||||
local who = ("<b>%s</b>"):format(esc(info.name or "?"))
|
||||
if kind == "catch" then
|
||||
local r = Config.Rarities[info.rarity] or Config.Rarities.Common
|
||||
local mut = info.mutation and Config.Find(Config.Mutations, info.mutation)
|
||||
local color = mut and mut.color or r.color
|
||||
line(("%s%s %s поймал <font color=\"%s\">%s</font>%s%s"):format(
|
||||
info.remote and "🌍 " or "", RANK_ICON[r.rank] or "🎣", who, hex(color), esc(info.fish),
|
||||
mut and (" <font color=\"%s\">✦ %s</font>"):format(hex(mut.color), mut.name) or "",
|
||||
r.rank >= 3 and (" <font color=\"%s\">· %s</font>"):format(hex(r.color), r.name) or ""))
|
||||
-- свой улов игрок и так видит крупно — баннер только про других
|
||||
if info.big and info.userId ~= player.UserId then
|
||||
table.insert(queue, info)
|
||||
if not showing then
|
||||
showNext()
|
||||
end
|
||||
end
|
||||
elseif kind == "level" then
|
||||
line(("⭐ %s достиг уровня <font color=\"%s\">%d</font>"):format(who, Theme.HEX.gold, info.level or 0))
|
||||
elseif kind == "buy" then
|
||||
line(("💎 %s купил %s"):format(who, esc(info.item or "")))
|
||||
end
|
||||
end)
|
||||
@@ -66,6 +66,7 @@ local LOOK = {
|
||||
local camera = workspace.CurrentCamera
|
||||
local weatherCC = new("ColorCorrectionEffect", { Name = "WeatherCC", Parent = camera })
|
||||
local nightCC = new("ColorCorrectionEffect", { Name = "NightCC", Parent = camera })
|
||||
-- цветокоррекция действует только на 3D-сцену, экран загрузки она не затемняет — выключать её на время загрузки не нужно
|
||||
workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
|
||||
camera = workspace.CurrentCamera
|
||||
weatherCC.Parent = camera
|
||||
@@ -282,6 +283,63 @@ local function refreshPill(clock, night, w, placeId)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- фонари: днём погашены, к ночи зажигаются
|
||||
-- лампа — небольшая неоновая деталь со светом внутри (фонари площади, лавок, досок лидеров, домиков).
|
||||
-- Днём неон и свет дают пересвет и ореолы, поэтому лампа становится матовым тёплым стеклом без света.
|
||||
-- Порталы и прочее крупное свечение не трогаем.
|
||||
|
||||
local LAMP_ON_AT = 0.3 -- с какой «ночности» (0 — день, 1 — ночь) фонари зажигаются
|
||||
local lamps, lampScanAt, lampsLit = {}, -math.huge, nil
|
||||
|
||||
local function scanLamps()
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
if not map then
|
||||
return
|
||||
end
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:IsA("Light") and d.Parent:IsA("BasePart") and not lamps[d.Parent] then
|
||||
local bulb = d.Parent
|
||||
local s = bulb.Size
|
||||
if bulb.Material == Enum.Material.Neon and math.max(s.X, s.Y, s.Z) <= 2.5 then
|
||||
lamps[bulb] = { color = bulb.Color, lights = {} }
|
||||
end
|
||||
end
|
||||
end
|
||||
for bulb, l in pairs(lamps) do
|
||||
table.clear(l.lights)
|
||||
for _, c in ipairs(bulb:GetChildren()) do
|
||||
if c:IsA("Light") then
|
||||
table.insert(l.lights, c)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function updateLamps(nightness)
|
||||
if os.clock() - lampScanAt > 10 then
|
||||
lampScanAt = os.clock()
|
||||
scanLamps()
|
||||
lampsLit = nil -- новые лампы — применить ещё раз
|
||||
end
|
||||
local lit = nightness >= LAMP_ON_AT
|
||||
if lit == lampsLit then
|
||||
return
|
||||
end
|
||||
lampsLit = lit
|
||||
for bulb, l in pairs(lamps) do
|
||||
if bulb.Parent then
|
||||
bulb.Material = lit and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
-- погашенная лампа — тёплое матовое стекло чуть темнее горящей
|
||||
bulb.Color = lit and l.color or l.color:Lerp(Color3.fromRGB(150, 120, 90), 0.35)
|
||||
for _, light in ipairs(l.lights) do
|
||||
light.Enabled = lit
|
||||
end
|
||||
else
|
||||
lamps[bulb] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- главный цикл
|
||||
|
||||
-- часы двигаются каждый кадр (плавно), остальное проверяется раз в полсекунды
|
||||
@@ -304,6 +362,7 @@ task.spawn(function()
|
||||
local clock = clockNow()
|
||||
local nightness = Config.DayNight.enabled and Config.Nightness(clock) or 0
|
||||
local night = nightness >= 0.5
|
||||
updateLamps(nightness)
|
||||
local w = currentWeather()
|
||||
local _, placeId = currentPlace()
|
||||
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
-- ChestAnimation (LocalScript) -> StarterPlayer > StarterPlayerScripts
|
||||
-- Сундук ежедневной награды (модель с атрибутом DailyChest: Base, Lid, Coins, Lock) оживает у каждого игрока:
|
||||
-- подпрыгивает, на падении крышка откидывается, после удара о землю монеты подскакивают, крышка остаётся
|
||||
-- приоткрытой, потом плавно возвращается. На ударе — глухой стук, звон монет и облачко пыли.
|
||||
-- Анимация только на клиенте: сервер сундук не двигает.
|
||||
|
||||
local RunService = game:GetService("RunService")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
local Audio = require(script.Parent:WaitForChild("Audio"))
|
||||
|
||||
local HOP = 2.1 -- высота прыжка, studs
|
||||
local LID_FALL = 32 -- на сколько градусов откидывается крышка в падении
|
||||
local LID_REST = 14 -- приоткрыта после приземления
|
||||
local COIN_HOP = 0.55 -- подскок монет
|
||||
local PERIOD = 5 -- секунд на весь цикл (прыжок + пауза)
|
||||
local VIEW_DIST = 150 -- дальше камеры не анимируем
|
||||
|
||||
-- 0..1: прыжок вверх, падение, приземление, удержание, закрытие крышки
|
||||
local T_UP, T_DOWN, T_LAND, T_HOLD, T_CLOSE = 0.34, 0.3, 0.5, 2.3, 0.7
|
||||
local T_IMPACT = T_UP + T_DOWN -- момент удара о землю
|
||||
|
||||
local function easeOut(x) return 1 - (1 - x) ^ 2 end
|
||||
local function easeIn(x) return x * x end
|
||||
local function smooth(x) return x * x * (3 - 2 * x) end
|
||||
|
||||
local chest, rest, fx
|
||||
|
||||
-- звуки идут от самого сундука (слышно рядом), громкость — по настройке «Звуки»
|
||||
local function sound(name, parent)
|
||||
local def = Config.Sounds[name]
|
||||
local s = Instance.new("Sound")
|
||||
s.Name = name
|
||||
s.SoundId = def.id
|
||||
s.Volume = def.volume or 0.5
|
||||
s.RollOffMode = Enum.RollOffMode.InverseTapered
|
||||
s.RollOffMinDistance, s.RollOffMaxDistance = 10, 70
|
||||
s.SoundGroup = Audio.groups.sfx
|
||||
s.Parent = parent
|
||||
return s, def.pitch
|
||||
end
|
||||
|
||||
local rng = Random.new()
|
||||
local function play(entry)
|
||||
local s, pitch = entry[1], entry[2]
|
||||
if pitch then
|
||||
s.PlaybackSpeed = rng:NextNumber(pitch[1], pitch[2])
|
||||
end
|
||||
s:Play()
|
||||
end
|
||||
|
||||
-- пыль от удара: низкое облачко, разлетается в стороны и быстро оседает
|
||||
local function makeDust(base)
|
||||
local att = Instance.new("Attachment")
|
||||
att.Name = "ChestDust"
|
||||
att.Position = Vector3.new(0, -base.Size.Y / 2 + 0.15, 0)
|
||||
att.Parent = base
|
||||
local pe = Instance.new("ParticleEmitter")
|
||||
pe.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||
pe.Rate = 0
|
||||
pe.Color = ColorSequence.new(Color3.fromRGB(222, 202, 168), Color3.fromRGB(196, 176, 146))
|
||||
pe.LightInfluence = 0.8
|
||||
pe.Lifetime = NumberRange.new(0.6, 1.1)
|
||||
pe.Speed = NumberRange.new(7, 11)
|
||||
pe.Drag = 6
|
||||
pe.SpreadAngle = Vector2.new(86, 86) -- почти горизонтально во все стороны
|
||||
pe.Acceleration = Vector3.new(0, 1.2, 0)
|
||||
pe.Rotation = NumberRange.new(0, 360)
|
||||
pe.RotSpeed = NumberRange.new(-60, 60)
|
||||
pe.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.7), NumberSequenceKeypoint.new(0.4, 1.8), NumberSequenceKeypoint.new(1, 2.6) })
|
||||
pe.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.35), NumberSequenceKeypoint.new(0.6, 0.7), NumberSequenceKeypoint.new(1, 1) })
|
||||
pe.EmissionDirection = Enum.NormalId.Top
|
||||
pe.Parent = att
|
||||
return pe
|
||||
end
|
||||
|
||||
local function bind(model)
|
||||
local base, lid = model:FindFirstChild("Base"), model:FindFirstChild("Lid")
|
||||
if not (base and lid) then
|
||||
return
|
||||
end
|
||||
local pivot = model:GetPivot()
|
||||
local function rel(name)
|
||||
local p = model:FindFirstChild(name)
|
||||
return p and { part = p, cf = pivot:ToObjectSpace(p.CFrame) }
|
||||
end
|
||||
-- петли крышки — задняя верхняя кромка корпуса (замок спереди, по +Z модели)
|
||||
local hinge = pivot:ToObjectSpace(base.CFrame * CFrame.new(0, base.Size.Y / 2, -base.Size.Z / 2))
|
||||
chest = model
|
||||
fx = {
|
||||
hop = { sound("chestHop", base) },
|
||||
land = { sound("chestLand", base) },
|
||||
coins = { sound("coins", base) },
|
||||
dust = makeDust(base),
|
||||
}
|
||||
rest = {
|
||||
pivot = pivot, hinge = CFrame.new(hinge.Position),
|
||||
base = rel("Base"), lid = rel("Lid"), lock = rel("Lock"), coins = rel("Coins"),
|
||||
}
|
||||
end
|
||||
|
||||
local function findChest()
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
if not map then
|
||||
return
|
||||
end
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:IsA("Model") and d:GetAttribute("DailyChest") then
|
||||
bind(d)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- поза в момент t цикла: подъём корпуса, угол крышки (градусы), подскок монет
|
||||
local function pose(t)
|
||||
local h, lid, coin = 0, 0, 0
|
||||
if t < T_UP then
|
||||
h = HOP * easeOut(t / T_UP)
|
||||
elseif t < T_UP + T_DOWN then
|
||||
local u = (t - T_UP) / T_DOWN
|
||||
h = HOP * (1 - easeIn(u))
|
||||
lid = LID_FALL * easeOut(u) -- крышку подбрасывает воздухом
|
||||
else
|
||||
local t2 = t - T_UP - T_DOWN
|
||||
if t2 < T_LAND then
|
||||
local u = t2 / T_LAND
|
||||
coin = COIN_HOP * math.sin(math.pi * u) -- монеты подскакивают от удара
|
||||
-- крышка с лёгким «отскоком» оседает в приоткрытое положение
|
||||
lid = LID_REST + (LID_FALL - LID_REST) * (1 - smooth(u)) + 4 * math.sin(math.pi * u * 2) * (1 - u)
|
||||
h = 0.12 * math.sin(math.pi * math.min(1, u * 2)) -- маленький отскок корпуса
|
||||
elseif t2 < T_LAND + T_HOLD then
|
||||
lid = LID_REST
|
||||
elseif t2 < T_LAND + T_HOLD + T_CLOSE then
|
||||
lid = LID_REST * (1 - smooth((t2 - T_LAND - T_HOLD) / T_CLOSE))
|
||||
end
|
||||
end
|
||||
return h, lid, coin
|
||||
end
|
||||
|
||||
local function apply(h, lidDeg, coin)
|
||||
local r = rest
|
||||
local p = r.pivot * CFrame.new(0, h, 0)
|
||||
r.base.part.CFrame = p * r.base.cf
|
||||
-- крышка и замок поворачиваются вокруг петель (минус — передняя кромка идёт вверх)
|
||||
local open = r.hinge * CFrame.Angles(-math.rad(lidDeg), 0, 0) * r.hinge:Inverse()
|
||||
r.lid.part.CFrame = p * open * r.lid.cf
|
||||
if r.lock then
|
||||
r.lock.part.CFrame = p * open * r.lock.cf
|
||||
end
|
||||
if r.coins then
|
||||
r.coins.part.CFrame = p * CFrame.new(0, coin, 0) * r.coins.cf
|
||||
end
|
||||
end
|
||||
|
||||
-- прыгает только для тех, кому есть что забрать: DailyNextAt (ставит сервер) — когда откроется следующая
|
||||
-- награда, 0 — уже доступна. Забрал — сундук доигрывает текущий прыжок и замирает до следующего дня.
|
||||
local player = game:GetService("Players").LocalPlayer
|
||||
local function rewardReady()
|
||||
local nextAt = player:GetAttribute("DailyNextAt")
|
||||
return nextAt ~= nil and workspace:GetServerTimeNow() >= nextAt
|
||||
end
|
||||
|
||||
local scanAt = -math.huge
|
||||
local cycleT = nil -- время внутри текущего цикла; nil — сундук стоит
|
||||
local resting = false
|
||||
RunService.RenderStepped:Connect(function(dt)
|
||||
if not chest or not chest.Parent then
|
||||
chest = nil
|
||||
if os.clock() - scanAt > 3 then
|
||||
scanAt = os.clock()
|
||||
findChest()
|
||||
end
|
||||
return
|
||||
end
|
||||
local cam = workspace.CurrentCamera
|
||||
if cam and (cam.CFrame.Position - rest.pivot.Position).Magnitude > VIEW_DIST then
|
||||
return
|
||||
end
|
||||
if not cycleT then
|
||||
if not rewardReady() then
|
||||
if not resting then
|
||||
resting = true
|
||||
apply(0, 0, 0) -- стоит закрытый, как в редакторе
|
||||
end
|
||||
return
|
||||
end
|
||||
cycleT, resting = 0, false
|
||||
play(fx.hop)
|
||||
end
|
||||
local prev = cycleT
|
||||
cycleT += dt
|
||||
-- удар о землю
|
||||
if prev < T_IMPACT and cycleT >= T_IMPACT then
|
||||
play(fx.land)
|
||||
task.delay(0.08, play, fx.coins) -- монеты звенят чуть позже удара, когда подпрыгивают
|
||||
fx.dust:Emit(26)
|
||||
end
|
||||
if cycleT >= PERIOD then
|
||||
cycleT = nil -- цикл закончен; следующий начнётся, только если награда всё ещё доступна
|
||||
apply(0, 0, 0)
|
||||
return
|
||||
end
|
||||
apply(pose(cycleT))
|
||||
end)
|
||||
@@ -195,33 +195,50 @@ H.rod = text({ Size = UDim2.new(1, 0, 0, 20), Position = UDim2.fromOffset(0, 128
|
||||
|
||||
-- баннер события (справа сверху)
|
||||
local eventBanner = new("Frame", {
|
||||
Name = "EventBanner", -- по имени его ставит под таблицу игроков HudBar.client.lua
|
||||
Size = UDim2.fromOffset(280, 58), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 10),
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = screen,
|
||||
}, { corner(14), stroke(C.gold, 2, 0.1), gradient(Color3.fromRGB(90, 60, 20), C.bg, 90) })
|
||||
local eventTitle = text({ Size = UDim2.new(1, -20, 0, 26), Position = UDim2.fromOffset(12, 4), Font = TITLE, TextSize = 19, TextColor3 = C.gold, Text = "", Parent = eventBanner })
|
||||
local eventDesc = text({ Size = UDim2.new(1, -20, 0, 20), Position = UDim2.fromOffset(12, 30), Font = BODY2, TextSize = 13, TextColor3 = C.text, Text = "", Parent = eventBanner })
|
||||
|
||||
-- кнопки слева
|
||||
-- столбик на компьютере, сетка 2×N на телефоне (раскладка — в applyLayout ниже)
|
||||
-- меню слева: деревянная панель в рамке с вкладкой «≡» сверху, внутри — широкие кнопки (значок и подпись в строку).
|
||||
-- side — сетка кнопок внутри панели H.sidePanel (раскладку для телефона и компьютера задаёт applyLayout ниже)
|
||||
H.sidePanel = new("Frame", {
|
||||
Name = "SideMenu", Size = UDim2.fromOffset(170, 0), AutomaticSize = Enum.AutomaticSize.Y, Position = UDim2.fromOffset(12, 228),
|
||||
BackgroundColor3 = WHITE, Parent = screen,
|
||||
}, { corner(10), stroke(C.goldDark, 2.5, 0), Theme.woodGradient(C.wood, C.woodDark) })
|
||||
Theme.rivets(H.sidePanel, 7, 6)
|
||||
do
|
||||
local tab = new("Frame", {
|
||||
Size = UDim2.fromOffset(48, 24), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0, 0),
|
||||
BackgroundColor3 = WHITE, ZIndex = 3, Parent = H.sidePanel,
|
||||
}, { corner(8), stroke(C.goldDark, 2, 0), Theme.woodGradient(C.woodLight, C.wood) })
|
||||
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 18, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.goldBright, Text = "≡", ZIndex = 4, Parent = tab })
|
||||
end
|
||||
local side = new("Frame", {
|
||||
Size = UDim2.fromOffset(70, 380), AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 12, 0.5, 60),
|
||||
BackgroundTransparency = 1, Parent = screen,
|
||||
}, { new("UIGridLayout", { CellSize = UDim2.fromOffset(68, 68), CellPadding = UDim2.fromOffset(8, 8), FillDirectionMaxCells = 1, SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1, Parent = H.sidePanel,
|
||||
}, {
|
||||
new("UIPadding", { PaddingTop = UDim.new(0, 18), PaddingBottom = UDim.new(0, 10), PaddingLeft = UDim.new(0, 8), PaddingRight = UDim.new(0, 8) }),
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(154, 40), CellPadding = UDim2.fromOffset(6, 6), FillDirectionMaxCells = 1, SortOrder = Enum.SortOrder.LayoutOrder }),
|
||||
})
|
||||
|
||||
local sideDots = {}
|
||||
local function sideButton(order, icon, label, key, color, onClick)
|
||||
-- деревянная плитка; цвет раздела — полоска-лента снизу
|
||||
local b = btn({ Size = UDim2.fromOffset(68, 68), BackgroundColor3 = C.woodLight, LayoutOrder = order, Parent = side }, onClick)
|
||||
-- широкая деревянная кнопка: цветной значок слева, подпись, справа — клавиша
|
||||
local b = btn({ Size = UDim2.fromOffset(154, 40), BackgroundColor3 = C.woodLight, LayoutOrder = order, Parent = side }, onClick)
|
||||
b:FindFirstChildOfClass("UIStroke").Color = C.goldDark
|
||||
b:FindFirstChildOfClass("UIStroke").Thickness = 2.5
|
||||
new("Frame", { Size = UDim2.new(1, -10, 0, 4), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -4), BackgroundColor3 = color, BorderSizePixel = 0, Parent = b }, { corner(2) })
|
||||
text({ Size = UDim2.fromScale(1, 0.5), Position = UDim2.fromScale(0, 0.06), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = icon, Parent = b })
|
||||
text({ Size = UDim2.fromScale(1, 0.24), Position = UDim2.fromScale(0, 0.6), Font = TITLE, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = label, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = b })
|
||||
b:FindFirstChildOfClass("UIStroke").Thickness = 2
|
||||
local badge = new("Frame", { Size = UDim2.new(0, 30, 1, -10), Position = UDim2.fromOffset(5, 5), BackgroundColor3 = color, Parent = b },
|
||||
{ corner(6), stroke(C.ink, 1.5, 0.3), gradient(WHITE, Color3.fromRGB(170, 170, 170), 90) })
|
||||
text({ Size = UDim2.fromScale(1, 1), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = icon, Parent = badge })
|
||||
new("UITextSizeConstraint", { MaxTextSize = 17, Parent = text({ Size = UDim2.new(1, -66, 1, 0), Position = UDim2.fromOffset(42, 0), Font = TITLE,
|
||||
TextScaled = true, Text = label, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = b }) })
|
||||
if key and not UserInputService.TouchEnabled then
|
||||
local tag = new("Frame", { Size = UDim2.fromOffset(20, 20), Position = UDim2.new(1, -14, 0, -6), BackgroundColor3 = C.bg, Parent = b }, { corner(6), stroke(C.gold, 1.5) })
|
||||
local tag = new("Frame", { Size = UDim2.fromOffset(20, 20), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -6, 0.5, 0), BackgroundColor3 = C.bg, Parent = b }, { corner(5), stroke(C.gold, 1.2) })
|
||||
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.gold, Text = key, Parent = tag })
|
||||
end
|
||||
local dot = new("Frame", { Size = UDim2.fromOffset(16, 16), Position = UDim2.new(0, -5, 0, -5), BackgroundColor3 = C.red, Visible = false, ZIndex = 3, Parent = b }, { corner(8), stroke(WHITE, 2) })
|
||||
local dot = new("Frame", { Size = UDim2.fromOffset(14, 14), Position = UDim2.new(0, -4, 0, -4), BackgroundColor3 = C.red, Visible = false, ZIndex = 3, Parent = b }, { corner(7), stroke(WHITE, 2) })
|
||||
sideDots[label] = dot
|
||||
return b
|
||||
end
|
||||
@@ -235,20 +252,12 @@ local SOFT_EDGES = NumberSequence.new({
|
||||
NumberSequenceKeypoint.new(0.82, 0.62), NumberSequenceKeypoint.new(1, 1),
|
||||
})
|
||||
-- жирный округлый шрифт с кириллицей (у FredokaOne кириллицы нет — Roblox подставляет тонкий шрифт)
|
||||
<<<<<<< HEAD
|
||||
local HINT_FONT = Theme.HINT_FACE
|
||||
-- плашка-дымка (Frame) с текстом внутри; градиент только на плашке, на текст он не действует.
|
||||
-- Цвет — тёмное дерево
|
||||
local function softPlate(props, textProps)
|
||||
local plate = new("Frame", props)
|
||||
plate.BackgroundColor3 = C.woodDark
|
||||
=======
|
||||
local HINT_FONT = Font.new("rbxasset://fonts/families/Nunito.json", Enum.FontWeight.Heavy)
|
||||
-- плашка-дымка (Frame) с текстом внутри; градиент только на плашке, на текст он не действует
|
||||
local function softPlate(props, textProps)
|
||||
local plate = new("Frame", props)
|
||||
plate.BackgroundColor3 = BLACK
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
plate.BackgroundTransparency = 0
|
||||
corner(30).Parent = plate
|
||||
new("UIGradient", { Transparency = SOFT_EDGES, Parent = plate })
|
||||
@@ -274,11 +283,7 @@ end
|
||||
-- уведомления — под подсказкой обучения, которая стоит в самом верху
|
||||
local toasts = new("Frame", {
|
||||
Size = UDim2.new(0, 900, 0, 200), AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 84),
|
||||
<<<<<<< HEAD
|
||||
BackgroundTransparency = 1, ZIndex = 30, Parent = screen,
|
||||
=======
|
||||
BackgroundTransparency = 1, Parent = gui,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
}, { new("UIListLayout", { Padding = UDim.new(0, 6), HorizontalAlignment = Enum.HorizontalAlignment.Center, SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
local toastOrder = 0
|
||||
local toastTimers = {}
|
||||
@@ -308,12 +313,8 @@ local function notify(msg, color)
|
||||
items[1]:Destroy()
|
||||
end
|
||||
local t, l = softPlate(
|
||||
{ Size = UDim2.new(0, 0, 0, 54), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = toastOrder, Parent = toasts },
|
||||
<<<<<<< HEAD
|
||||
{ TextSize = 30, TextColor3 = color or C.text, Text = msg }
|
||||
=======
|
||||
{ TextSize = 30, TextColor3 = color or WHITE, Text = msg }
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
{ Size = UDim2.new(0, 0, 0, 44), AutomaticSize = Enum.AutomaticSize.X, LayoutOrder = toastOrder, Parent = toasts },
|
||||
{ TextSize = 24, TextColor3 = color or C.text, Text = msg }
|
||||
)
|
||||
popIn(t)
|
||||
t:SetAttribute("Msg", msg)
|
||||
@@ -346,6 +347,17 @@ local catchInfo = text({ Size = UDim2.new(1, -160, 0, 20), Position = UDim2.from
|
||||
local catchValue = text({ Size = UDim2.new(1, -160, 0, 26), Position = UDim2.fromOffset(152, 90), Font = TITLE, TextSize = 21, TextColor3 = C.gold, Text = "", Parent = catchCard })
|
||||
local catchToken = 0
|
||||
|
||||
-- уведомления и карточка улова — в одной колонке сверху: пока карточка видна, уведомления уходят под неё
|
||||
H.toastBaseY = 84
|
||||
function H.placeToasts(cardShown)
|
||||
local y = H.toastBaseY
|
||||
if cardShown then
|
||||
local sc = catchCard:FindFirstChildOfClass("UIScale")
|
||||
y = 120 + catchCard.Size.Y.Offset * (sc and sc.Scale or 1) + 10
|
||||
end
|
||||
TweenService:Create(toasts, TweenInfo.new(0.3, Enum.EasingStyle.Quad), { Position = UDim2.new(0.5, 0, 0, y) }):Play()
|
||||
end
|
||||
|
||||
local function showCatch(fish, extra)
|
||||
catchToken += 1
|
||||
local my = catchToken
|
||||
@@ -361,18 +373,16 @@ local function showCatch(fish, extra)
|
||||
catchName.TextColor3 = r.color
|
||||
catchInfo.Text = ("<font color=\"%s\">%s</font>%s · %.2f кг"):format(
|
||||
hex(r.color), r.name, mut and (" · <font color=\"" .. hex(mut.color) .. "\">" .. mut.name .. " x" .. mut.mult .. "</font>") or "", fish.weight)
|
||||
<<<<<<< HEAD
|
||||
catchValue.Text = ("⚪ %s ⭐ +%d XP%s"):format(fmt(fish.value), fish.xp * ((extra and extra.new) and 2 or 1),
|
||||
=======
|
||||
catchValue.Text = ("💰 %s ⭐ +%d XP%s"):format(fmt(fish.value), fish.xp * ((extra and extra.new) and 2 or 1),
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
(extra and extra.combo and extra.combo > 1.001) and (" 🔥 x%.1f"):format(extra.combo) or "")
|
||||
catchCard.Visible = true
|
||||
H.placeToasts(true)
|
||||
TweenService:Create(catchCard, TweenInfo.new(0.45, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Position = UDim2.new(0.5, 0, 0, 120) }):Play()
|
||||
task.delay(3.4, function()
|
||||
if my == catchToken then
|
||||
local tw = TweenService:Create(catchCard, TweenInfo.new(0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.In), { Position = UDim2.new(0.5, 0, 0, -220) })
|
||||
tw:Play()
|
||||
H.placeToasts(false)
|
||||
tw.Completed:Wait()
|
||||
if my == catchToken then
|
||||
catchCard.Visible = false
|
||||
@@ -397,11 +407,7 @@ end
|
||||
|
||||
-- вверху, на месте подсказки обучения (она во время рыбалки скрыта)
|
||||
local statusLabel = softPlate(
|
||||
<<<<<<< HEAD
|
||||
{ Size = UDim2.fromOffset(0, 64), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 12), Visible = false, Parent = screen },
|
||||
=======
|
||||
{ Size = UDim2.fromOffset(0, 64), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 12), Visible = false, Parent = gui },
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
{ TextSize = 36, Text = "🎣 Ждём клёв…" }
|
||||
)
|
||||
wobble(statusLabel, 1.2, 1.4)
|
||||
@@ -426,6 +432,13 @@ local timeBar = new("Frame", { Size = UDim2.new(1, -30, 0, 5), Position = UDim2.
|
||||
---------------------------------------------------------------- окна
|
||||
|
||||
local openWindow = nil
|
||||
-- окно, открытое у ларька (сразу после нажатия на подсказку), закрывается, если отойти дальше WINDOW_CLOSE_DIST
|
||||
-- (5 м ≈ 18 studs); окна, открытые клавишами и кнопками меню, так не закрываются
|
||||
H.WINDOW_CLOSE_DIST = 18
|
||||
H.promptAt = -math.huge
|
||||
game:GetService("ProximityPromptService").PromptTriggered:Connect(function()
|
||||
H.promptAt = os.clock()
|
||||
end)
|
||||
|
||||
local function makeWindow(title, accent, tabs)
|
||||
local w = { pages = {}, tabButtons = {}, current = nil }
|
||||
@@ -437,6 +450,8 @@ local function makeWindow(title, accent, tabs)
|
||||
}, { corner(12), stroke(C.goldDark, 4, 0), Theme.woodGradient(C.wood, C.woodDark), new("UISizeConstraint", { MaxSize = Vector2.new(760, 540) }) })
|
||||
Theme.innerBorder(frame, 7, 8, C.gold, 0.2)
|
||||
Theme.rivets(frame, 12, 8)
|
||||
-- Modal: пока окно открыто, Roblox отпускает курсор и в виде от первого лица (иначе он прибит к центру экрана)
|
||||
new("TextButton", { Name = "FreeCursor", Size = UDim2.fromOffset(1, 1), BackgroundTransparency = 1, Text = "", Modal = true, Parent = frame })
|
||||
local scale = new("UIScale", { Parent = frame })
|
||||
local header = new("Frame", { Size = UDim2.new(1, 0, 0, 56), BackgroundTransparency = 1, Parent = frame })
|
||||
-- багровая лента по центру, ширина — по тексту
|
||||
@@ -495,6 +510,9 @@ local function makeWindow(title, accent, tabs)
|
||||
openWindow = w
|
||||
if not frame.Visible then
|
||||
Audio.play("open")
|
||||
-- открыли у ларька — запоминаем, где стоим; отойдёт игрок — окно закроется само
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
w.anchor = (hrp and os.clock() - H.promptAt < 2) and hrp.Position or nil
|
||||
end
|
||||
frame.Visible = true
|
||||
scale.Scale = 0.85
|
||||
@@ -503,6 +521,7 @@ local function makeWindow(title, accent, tabs)
|
||||
end
|
||||
function w.close()
|
||||
frame.Visible = false
|
||||
w.anchor = nil
|
||||
if openWindow == w then
|
||||
openWindow = nil
|
||||
end
|
||||
@@ -525,6 +544,21 @@ local function makeWindow(title, accent, tabs)
|
||||
return w
|
||||
end
|
||||
|
||||
-- отошёл от ларька — его окно закрывается
|
||||
RunService.Heartbeat:Connect(function()
|
||||
local w = openWindow
|
||||
if not (w and w.anchor) then
|
||||
return
|
||||
end
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
if hrp then
|
||||
local d = hrp.Position - w.anchor
|
||||
if Vector3.new(d.X, 0, d.Z).Magnitude > H.WINDOW_CLOSE_DIST then
|
||||
w.close()
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
local function scrollArea(parent, cell, topOffset)
|
||||
local sf = new("ScrollingFrame", {
|
||||
Size = UDim2.new(1, 0, 1, -(topOffset or 0)), Position = UDim2.fromOffset(0, topOffset or 0),
|
||||
@@ -572,6 +606,7 @@ Theme.kit = {
|
||||
makeWindow = makeWindow, scrollArea = scrollArea, itemRow = itemRow, progressBar = progressBar,
|
||||
sideButton = sideButton, notify = notify, popIn = popIn, fmt = fmt, timeStr = timeStr,
|
||||
screen = screen, hud = hud, TITLE = TITLE, BODY = BODY, BODY2 = BODY2,
|
||||
viewport = viewport, VIEW = VIEW, -- 3D-превью моделей (удочки на нижней панели — HudBar.client.lua)
|
||||
}
|
||||
|
||||
---------------------------------------------------------------- данные с сервера
|
||||
@@ -994,11 +1029,7 @@ questWin.render = function(tab)
|
||||
end
|
||||
text({
|
||||
Size = UDim2.new(1, -4, 0, 30), LayoutOrder = 0, Font = TITLE, TextSize = 22, RichText = true,
|
||||
<<<<<<< HEAD
|
||||
Text = ("%s <font color=\"#C0AC88\" size=\"15\">круг %d · награда сразу, следующее задание — тоже</font>"):format(chain.name, chain.round), Parent = questList,
|
||||
=======
|
||||
Text = ("%s <font color=\"#AAB4CD\" size=\"15\">круг %d · награда сразу, следующее задание — тоже</font>"):format(chain.name, chain.round), Parent = questList,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
})
|
||||
for i, st in ipairs(chain.steps) do
|
||||
local done, cur = i < chain.step, i == chain.step
|
||||
@@ -1011,11 +1042,7 @@ questWin.render = function(tab)
|
||||
})
|
||||
text({
|
||||
Size = UDim2.fromOffset(180, 28), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -14, 0, cur and 8 or 14), Font = TITLE, TextSize = 17,
|
||||
<<<<<<< HEAD
|
||||
TextXAlignment = Enum.TextXAlignment.Right, TextColor3 = done and C.muted or C.gold, Text = ("+%s ⚪ +%s XP"):format(fmt(st.coins), fmt(st.xp)), Parent = row,
|
||||
=======
|
||||
TextXAlignment = Enum.TextXAlignment.Right, TextColor3 = done and C.muted or C.gold, Text = ("+%s 💰 +%s XP"):format(fmt(st.coins), fmt(st.xp)), Parent = row,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
})
|
||||
if cur then
|
||||
progressBar(row, UDim2.fromOffset(16, 44), UDim2.new(1, -110, 0, 16), chain.progress / st.goal, C.gold)
|
||||
@@ -1028,11 +1055,7 @@ questWin.render = function(tab)
|
||||
{ corner(14), stroke(C.purple, 2, 0.2), gradient(Color3.fromRGB(70, 40, 100), C.panel, 90) })
|
||||
text({
|
||||
Size = UDim2.new(1, -32, 1, 0), Position = UDim2.fromOffset(16, 0), Font = TITLE, TextSize = 18, RichText = true,
|
||||
<<<<<<< HEAD
|
||||
Text = ("🎁 За всю цепочку: <font color=\"#FFD45A\">+%s ⚪ +%s XP</font>%s"):format(fmt(b.coins), fmt(b.xp), b.potion and (" + " .. b.potion) or ""), Parent = row,
|
||||
=======
|
||||
Text = ("🎁 За всю цепочку: <font color=\"#FFD45A\">+%s 💰 +%s XP</font>%s"):format(fmt(b.coins), fmt(b.xp), b.potion and (" + " .. b.potion) or ""), Parent = row,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
})
|
||||
elseif tab == "daily" then
|
||||
clear(dailyPage)
|
||||
@@ -1091,11 +1114,8 @@ robuxWin.render = function(tab)
|
||||
notify("⚙ Товар не настроен", Color3.fromRGB(255, 200, 120))
|
||||
return
|
||||
end
|
||||
if tab == "passes" then
|
||||
MarketplaceService:PromptGamePassPurchase(player, it.id)
|
||||
else
|
||||
MarketplaceService:PromptProductPurchase(player, it.id)
|
||||
end
|
||||
-- и наборы, и пропуска — Developer Products; пропуск сервер запоминает навсегда
|
||||
MarketplaceService:PromptProductPurchase(player, it.id)
|
||||
end,
|
||||
})
|
||||
end
|
||||
@@ -1165,6 +1185,7 @@ end)
|
||||
sideButton(6, "⚙", "Звук", nil, Color3.fromRGB(150, 120, 80), function()
|
||||
settingsWin.toggle()
|
||||
end)
|
||||
Theme.kit.bagWin = bagWin -- кнопка «Рюкзак» внизу справа (HudBar.client.lua)
|
||||
|
||||
-- раскладка: компьютер — как раньше; телефон — HUD и кнопки компактнее, кнопки сеткой 3×N под HUD
|
||||
-- (левый низ свободен под джойстик, правый низ — под кнопку прыжка)
|
||||
@@ -1177,15 +1198,16 @@ do
|
||||
Theme.onLayout(function(compact)
|
||||
scaleOf(hud.Parent).Scale = compact and 0.82 or 1
|
||||
hud.Parent.Position = compact and UDim2.fromOffset(8, 6) or UDim2.fromOffset(12, 10)
|
||||
grid.CellSize = compact and UDim2.fromOffset(52, 52) or UDim2.fromOffset(62, 62)
|
||||
grid.CellPadding = compact and UDim2.fromOffset(6, 6) or UDim2.fromOffset(6, 6)
|
||||
grid.FillDirectionMaxCells = compact and 3 or 1
|
||||
side.AnchorPoint = Vector2.zero
|
||||
-- меню: на компьютере — столбик широких кнопок, на телефоне — два столбика поуже
|
||||
grid.CellSize = compact and UDim2.fromOffset(112, 32) or UDim2.fromOffset(154, 40)
|
||||
grid.CellPadding = compact and UDim2.fromOffset(5, 5) or UDim2.fromOffset(6, 6)
|
||||
grid.FillDirectionMaxCells = compact and 2 or 1
|
||||
-- под HUD (он выше на строку гильдии — её добавляет GuildClient)
|
||||
side.Position = compact and UDim2.fromOffset(8, 172) or UDim2.fromOffset(12, 216)
|
||||
side.Size = compact and UDim2.fromOffset(170, 240) or UDim2.fromOffset(70, 480)
|
||||
H.sidePanel.Position = compact and UDim2.fromOffset(8, 176) or UDim2.fromOffset(12, 228)
|
||||
H.sidePanel.Size = compact and UDim2.fromOffset(2 * 112 + 5 + 16, 0) or UDim2.fromOffset(154 + 16, 0)
|
||||
toasts.Size = compact and UDim2.fromOffset(640, 200) or UDim2.fromOffset(900, 200)
|
||||
toasts.Position = compact and UDim2.new(0.5, 0, 0, 66) or UDim2.new(0.5, 0, 0, 84)
|
||||
H.toastBaseY = compact and 66 or 84
|
||||
toasts.Position = UDim2.new(0.5, 0, 0, H.toastBaseY)
|
||||
scaleOf(toasts).Scale = compact and 0.75 or 1
|
||||
scaleOf(catchCard).Scale = compact and 0.8 or 1
|
||||
scaleOf(mgFrame).Scale = compact and 0.85 or 1
|
||||
@@ -1317,7 +1339,7 @@ end
|
||||
---------------------------------------------------------------- заброс: зарядка, шкала силы, наклон удочки
|
||||
-- держишь ЛКМ — сила растёт, удочка уходит назад; отпустил — бросок на дальность по силе
|
||||
|
||||
local REST_ANGLE, BACK_ANGLE = 30, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
||||
local REST_ANGLE, BACK_ANGLE = 42, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
||||
local function gripCF(angle)
|
||||
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
|
||||
end
|
||||
@@ -1340,11 +1362,7 @@ end
|
||||
local GAUGE_R, GAUGE_DEG, GAUGE_N = 190, 110, 32
|
||||
local gauge = new("Frame", {
|
||||
Size = UDim2.fromOffset(150, 280), AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0.57, 0, 0.48, 0),
|
||||
<<<<<<< HEAD
|
||||
BackgroundTransparency = 1, Visible = false, Parent = screen,
|
||||
=======
|
||||
BackgroundTransparency = 1, Visible = false, Parent = gui,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
})
|
||||
local GAUGE_C = Vector2.new(110 - GAUGE_R, 140) -- центр окружности левее рамки: дуга выгнута вправо
|
||||
local function arcPoint(v, r)
|
||||
@@ -1627,6 +1645,24 @@ local function onActivate()
|
||||
end
|
||||
end
|
||||
|
||||
-- клик пришёлся на видимый элемент интерфейса (кнопка, панель, картинка), а не в мир
|
||||
local GuiService = game:GetService("GuiService")
|
||||
local function pointerOverGui()
|
||||
local pos = UserInputService:GetMouseLocation() - GuiService:GetGuiInset()
|
||||
for _, g in ipairs(player.PlayerGui:GetGuiObjectsAtPosition(pos.X, pos.Y)) do
|
||||
if g.Visible and (g:IsA("GuiButton") or g:IsA("TextBox") or g.BackgroundTransparency < 0.95
|
||||
or (g:IsA("ImageLabel") and g.ImageTransparency < 0.95)) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- пока открыто любое окно (сумка, магазин, настройки, гильдия...), клики по удочке не работают
|
||||
local function menuOpen()
|
||||
return openWindow ~= nil and openWindow.isOpen()
|
||||
end
|
||||
|
||||
local hooked = setmetatable({}, { __mode = "k" })
|
||||
local function hookTool(tool)
|
||||
if hooked[tool] or not tool:IsA("Tool") or not tool:GetAttribute("IsRod") then
|
||||
@@ -1634,7 +1670,13 @@ local function hookTool(tool)
|
||||
end
|
||||
hooked[tool] = true
|
||||
tool.Activated:Connect(function()
|
||||
if menuOpen() then
|
||||
return
|
||||
end
|
||||
if state == "idle" then
|
||||
if pointerOverGui() then
|
||||
return -- нажали кнопку или панель интерфейса — это не заброс
|
||||
end
|
||||
startCharge(tool)
|
||||
else
|
||||
onActivate()
|
||||
@@ -1762,7 +1804,6 @@ local function setLook(obj, goal, instant)
|
||||
end
|
||||
end
|
||||
|
||||
<<<<<<< HEAD
|
||||
-- погода сгущает дымку поверх настроек локации (туман — сильно, дождь и гроза — слегка)
|
||||
local WEATHER_ATMO = {
|
||||
Fog = { Density = 0.22, Haze = 1.5 },
|
||||
@@ -1774,8 +1815,6 @@ local function weatherAtmo(prop)
|
||||
return (add and add[prop]) or 0
|
||||
end
|
||||
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local function applyLook(world, instant)
|
||||
-- исходные значения запоминаем до первой правки; эффект мог ещё не прийти с сервера, тогда в следующий раз
|
||||
for _, w in ipairs(lookSources) do
|
||||
@@ -1799,12 +1838,9 @@ local function applyLook(world, instant)
|
||||
for prop, def in pairs(defaults) do
|
||||
local v = look[section] and look[section][prop]
|
||||
if v == nil then v = def end
|
||||
<<<<<<< HEAD
|
||||
if section == "atmosphere" and typeof(v) == "number" then
|
||||
v += weatherAtmo(prop)
|
||||
end
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
-- плавно меняются только числа и цвета; флаги и режимы (EnumItem) ставим сразу
|
||||
local kind = typeof(v)
|
||||
if kind == "number" or kind == "Color3" then goal[prop] = v else obj[prop] = v end
|
||||
@@ -1821,15 +1857,10 @@ local function applyAmbience(world, instant)
|
||||
end
|
||||
table.clear(lookTweens)
|
||||
world = world or Config.Lobby
|
||||
<<<<<<< HEAD
|
||||
-- при смене суток часы двигает Ambience; иначе у каждой локации своё время
|
||||
if not Config.DayNight.enabled then
|
||||
setLook(Lighting, { ClockTime = (world and world.clock) or 14.5 }, instant)
|
||||
end
|
||||
=======
|
||||
local clock = (world and world.clock) or 14.5
|
||||
setLook(Lighting, { ClockTime = clock }, instant)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local cc = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||
if cc then
|
||||
setLook(cc, { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }, instant)
|
||||
@@ -1933,7 +1964,6 @@ local function enterWorld(w, instant)
|
||||
end
|
||||
end
|
||||
|
||||
<<<<<<< HEAD
|
||||
-- погода сменилась: плавно пересчитываем дымку текущей локации
|
||||
workspace:GetAttributeChangedSignal("Weather"):Connect(function()
|
||||
if lastWorldId ~= "none" and not loadingVisible() then
|
||||
@@ -1953,8 +1983,6 @@ do
|
||||
end)
|
||||
end
|
||||
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
-- первое появление: ждём персонажа, ставим свет его локации сразу и отпускаем экран загрузки
|
||||
task.spawn(function()
|
||||
local char = player.Character or player.CharacterAdded:Wait()
|
||||
@@ -2032,7 +2060,6 @@ local guideStep = 0 -- шаг, отправленный на сервер (ат
|
||||
|
||||
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
|
||||
local guideHint, guideHintText = softPlate(
|
||||
<<<<<<< HEAD
|
||||
{ Size = UDim2.fromOffset(0, 70), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 10), Visible = false, Parent = screen },
|
||||
{ TextSize = 42, Text = "" }
|
||||
)
|
||||
@@ -2040,12 +2067,6 @@ wobble(guideHint, 1.2, 1.6)
|
||||
Theme.onLayout(function(compact)
|
||||
guideHintText.TextSize = compact and 30 or 42
|
||||
end)
|
||||
=======
|
||||
{ Size = UDim2.fromOffset(0, 70), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 10), Visible = false, Parent = gui },
|
||||
{ TextSize = 42, Text = "" }
|
||||
)
|
||||
wobble(guideHint, 1.2, 1.6)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local lastHint = nil
|
||||
|
||||
local guideFolder = new("Folder", { Name = "TutorialGuide", Parent = workspace })
|
||||
@@ -2149,6 +2170,11 @@ local function setInterfaceHidden(hidden)
|
||||
boardGui.Enabled = hidden
|
||||
pcall(function()
|
||||
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, not hidden)
|
||||
if not hidden then
|
||||
-- рюкзак и список игроков Roblox заменены своими (HudBar.client.lua)
|
||||
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
|
||||
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
|
||||
end
|
||||
end)
|
||||
-- надписи над объектами (порталы, лавки) тоже прячем, потом возвращаем как было
|
||||
if hidden then
|
||||
@@ -2246,11 +2272,7 @@ local function guideRoute(step, pos, world)
|
||||
elseif step == 2 and inW1 then
|
||||
return { guideMarker("GuideFishSpot") }, "🎣 Зажми ЛКМ у воды", "Pier"
|
||||
elseif step == 3 and inW1 then
|
||||
<<<<<<< HEAD
|
||||
return { sellTargetW1() }, "⚪ Продай рыбу", "Sell" -- лавка у самого причала, идём напрямую
|
||||
=======
|
||||
return { sellTargetW1() }, "💰 Продай рыбу", "Sell" -- лавка у самого причала, идём напрямую
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
return nil
|
||||
end
|
||||
@@ -2415,19 +2437,11 @@ local FIRE = Color3.fromRGB(255, 150, 60)
|
||||
|
||||
-- серия улова — справа от HUD; полоска показывает, сколько осталось до того, как серия сгорит
|
||||
local comboBox = new("Frame", {
|
||||
<<<<<<< HEAD
|
||||
Size = UDim2.fromOffset(140, 66), Position = UDim2.fromOffset(310, 10), BackgroundColor3 = WHITE, Visible = false, Parent = screen,
|
||||
}, { corner(14), stroke(FIRE, 2, 0.1), gradient(Color3.fromRGB(110, 50, 20), C.bg, 90) })
|
||||
local comboMultText = text({ Size = UDim2.new(1, 0, 0, 34), Position = UDim2.fromOffset(0, 3), Font = TITLE, TextSize = 28, TextXAlignment = CENTER, TextColor3 = Color3.fromRGB(255, 195, 95), TextStrokeTransparency = 0.5, Text = "", Parent = comboBox })
|
||||
local comboSub = text({ Size = UDim2.new(1, 0, 0, 16), Position = UDim2.fromOffset(0, 36), Font = BODY2, TextSize = 12, TextXAlignment = CENTER, TextColor3 = C.muted, Text = "", Parent = comboBox })
|
||||
local comboBack = new("Frame", { Size = UDim2.new(1, -20, 0, 5), Position = UDim2.new(0, 10, 1, -10), BackgroundColor3 = C.dark, Parent = comboBox }, { corner(3) })
|
||||
=======
|
||||
Size = UDim2.fromOffset(140, 66), Position = UDim2.fromOffset(310, 10), BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
}, { corner(14), stroke(FIRE, 2, 0.1), gradient(Color3.fromRGB(110, 50, 20), C.bg, 90) })
|
||||
local comboMultText = text({ Size = UDim2.new(1, 0, 0, 34), Position = UDim2.fromOffset(0, 3), Font = TITLE, TextSize = 28, TextXAlignment = CENTER, TextColor3 = Color3.fromRGB(255, 195, 95), TextStrokeTransparency = 0.5, Text = "", Parent = comboBox })
|
||||
local comboSub = text({ Size = UDim2.new(1, 0, 0, 16), Position = UDim2.fromOffset(0, 36), Font = BODY2, TextSize = 12, TextXAlignment = CENTER, TextColor3 = C.muted, Text = "", Parent = comboBox })
|
||||
local comboBack = new("Frame", { Size = UDim2.new(1, -20, 0, 5), Position = UDim2.new(0, 10, 1, -10), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = comboBox }, { corner(3) })
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local comboFill = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = FIRE, BorderSizePixel = 0, Parent = comboBack }, { corner(3) })
|
||||
|
||||
local function refreshCombo(pop)
|
||||
@@ -2450,7 +2464,6 @@ refreshCombo(false)
|
||||
-- правая колонка: босс и цели
|
||||
local rightCol = new("Frame", {
|
||||
Size = UDim2.fromOffset(300, 0), AutomaticSize = Enum.AutomaticSize.Y, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -12, 0.5, 10),
|
||||
<<<<<<< HEAD
|
||||
BackgroundTransparency = 1, Parent = screen,
|
||||
}, { new("UIListLayout", { Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
|
||||
@@ -2463,20 +2476,11 @@ Theme.onLayout(function(compact)
|
||||
comboBox.Position = compact and UDim2.fromOffset(254, 6) or UDim2.fromOffset(310, 10)
|
||||
end)
|
||||
|
||||
=======
|
||||
BackgroundTransparency = 1, Parent = gui,
|
||||
}, { new("UIListLayout", { Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local bossBox = new("Frame", { Size = UDim2.fromOffset(300, 78), BackgroundColor3 = WHITE, Visible = false, LayoutOrder = 1, Parent = rightCol },
|
||||
{ corner(14), stroke(C.red, 2.5, 0.05), gradient(Color3.fromRGB(110, 30, 40), C.bg, 90) })
|
||||
local bossTitle = text({ Size = UDim2.new(1, -80, 0, 24), Position = UDim2.fromOffset(12, 5), Font = TITLE, TextSize = 18, TextColor3 = Color3.fromRGB(255, 205, 120), TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = bossBox })
|
||||
local bossTime = text({ Size = UDim2.fromOffset(60, 24), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 5), Font = TITLE, TextSize = 17, TextXAlignment = RIGHT, Text = "", Parent = bossBox })
|
||||
<<<<<<< HEAD
|
||||
local bossBack = new("Frame", { Size = UDim2.new(1, -24, 0, 18), Position = UDim2.fromOffset(12, 32), BackgroundColor3 = C.dark, Parent = bossBox }, { corner(9) })
|
||||
=======
|
||||
local bossBack = new("Frame", { Size = UDim2.new(1, -24, 0, 18), Position = UDim2.fromOffset(12, 32), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = bossBox }, { corner(9) })
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local bossFill = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = WHITE, Parent = bossBack }, { corner(9), gradient(Color3.fromRGB(255, 120, 90), Color3.fromRGB(190, 30, 50), 0) })
|
||||
local bossHpText = text({ Size = UDim2.fromScale(1, 1), TextSize = 12, TextXAlignment = CENTER, ZIndex = 2, TextStrokeTransparency = 0.5, Text = "", Parent = bossBack })
|
||||
local bossHint = text({ Size = UDim2.new(1, -24, 0, 18), Position = UDim2.fromOffset(12, 54), Font = BODY2, TextSize = 12, TextColor3 = C.muted, Text = "", Parent = bossBox })
|
||||
@@ -2491,11 +2495,7 @@ text({ Size = UDim2.new(1, 0, 0, 20), LayoutOrder = 0, Font = TITLE, TextSize =
|
||||
local function trackerLine(order, onClick)
|
||||
local root = new("TextButton", { Size = UDim2.new(1, 0, 0, 38), BackgroundTransparency = 1, AutoButtonColor = false, Text = "", LayoutOrder = order, Parent = tracker })
|
||||
local label = text({ Size = UDim2.new(1, 0, 0, 22), Font = BODY, TextSize = 14, RichText = true, TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = root })
|
||||
<<<<<<< HEAD
|
||||
local back = new("Frame", { Size = UDim2.new(1, 0, 0, 8), Position = UDim2.fromOffset(0, 26), BackgroundColor3 = C.dark, Parent = root }, { corner(4) })
|
||||
=======
|
||||
local back = new("Frame", { Size = UDim2.new(1, 0, 0, 8), Position = UDim2.fromOffset(0, 26), BackgroundColor3 = Color3.fromRGB(14, 18, 30), Parent = root }, { corner(4) })
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
local fill = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = C.gold, BorderSizePixel = 0, Parent = back }, { corner(4) })
|
||||
if onClick then
|
||||
root.MouseButton1Click:Connect(onClick)
|
||||
@@ -2550,11 +2550,7 @@ local function buyGoal()
|
||||
elseif coins >= r.price then
|
||||
return ("🎣 <b>%s</b> — можно купить!"):format(r.name), 1, C.green
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
return ("🎣 До «%s»: ещё <b>%s</b> ⚪"):format(r.name, fmt(r.price - coins)), coins / r.price, C.gold
|
||||
=======
|
||||
return ("🎣 До «%s»: ещё <b>%s</b> 💰"):format(r.name, fmt(r.price - coins)), coins / r.price, C.gold
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
end
|
||||
local rod = Config.Find(Config.Rods, player:GetAttribute("Rod") or "Basic")
|
||||
@@ -2564,11 +2560,7 @@ local function buyGoal()
|
||||
if coins >= cost then
|
||||
return ("✨ Улучшение до +%d — можно купить!"):format(rl + 1), 1, C.green
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
return ("✨ До улучшения +%d: ещё <b>%s</b> ⚪"):format(rl + 1, fmt(cost - coins)), coins / cost, C.gold
|
||||
=======
|
||||
return ("✨ До улучшения +%d: ещё <b>%s</b> 💰"):format(rl + 1, fmt(cost - coins)), coins / cost, C.gold
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
end
|
||||
return nil
|
||||
end
|
||||
@@ -2712,11 +2704,7 @@ end)
|
||||
-- у скупщика после продажи: предложение купить то, на что уже хватает
|
||||
local offerCard = new("Frame", {
|
||||
Size = UDim2.fromOffset(440, 96), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -110),
|
||||
<<<<<<< HEAD
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = screen,
|
||||
=======
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = gui,
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
}, { corner(16), stroke(C.green, 2.5, 0.05), gradient(Color3.fromRGB(30, 85, 55), C.bg, 90) })
|
||||
local offerIcon = text({ Size = UDim2.fromOffset(70, 70), Position = UDim2.fromOffset(12, 13), TextSize = 46, TextXAlignment = CENTER, Text = "", Parent = offerCard })
|
||||
local offerTitle = text({ Size = UDim2.new(1, -250, 0, 26), Position = UDim2.fromOffset(90, 12), Font = TITLE, TextSize = 19, TextTruncate = Enum.TextTruncate.AtEnd, Text = "", Parent = offerCard })
|
||||
@@ -2729,19 +2717,11 @@ end
|
||||
local offerBuy = btn({ Size = UDim2.fromOffset(146, 52), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -14, 0.5, 0), BackgroundColor3 = C.green, TextSize = 18, Text = "", Parent = offerCard }, function()
|
||||
if offerItem then
|
||||
remote:FireServer("Buy", offerItem.kind, offerItem.id)
|
||||
<<<<<<< HEAD
|
||||
Audio.play("coins")
|
||||
end
|
||||
hideOffer()
|
||||
end)
|
||||
btn({ Size = UDim2.fromOffset(26, 26), Position = UDim2.new(1, -18, 0, -8), BackgroundColor3 = C.red, Text = "×", TextSize = 22, Parent = offerCard }, hideOffer)
|
||||
=======
|
||||
playUiSound(DING, 0.5)
|
||||
end
|
||||
hideOffer()
|
||||
end)
|
||||
btn({ Size = UDim2.fromOffset(26, 26), Position = UDim2.new(1, -18, 0, -8), BackgroundColor3 = C.red, Text = "✕", TextSize = 14, Parent = offerCard }, hideOffer)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
|
||||
bestOffer = function(bagWasFull)
|
||||
local coins, lvl = player:GetAttribute("Coins") or 0, player:GetAttribute("Level") or 1
|
||||
@@ -2793,11 +2773,7 @@ showOffer = function(o)
|
||||
offerIcon.Text = o.icon
|
||||
offerTitle.Text = o.title
|
||||
offerDesc.Text = o.desc
|
||||
<<<<<<< HEAD
|
||||
offerBuy.Text = ("Купить · %s ⚪"):format(fmt(o.price))
|
||||
=======
|
||||
offerBuy.Text = ("Купить · %s 💰"):format(fmt(o.price))
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
offerCard.Visible = true
|
||||
popIn(offerCard, 0.6)
|
||||
task.delay(9, function()
|
||||
@@ -2826,12 +2802,9 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
setState("waiting")
|
||||
startCastCam(a, b)
|
||||
elseif action == "CastFail" or action == "Cancel" or action == "Escaped" then
|
||||
<<<<<<< HEAD
|
||||
if action == "Escaped" then
|
||||
Audio.play("escape")
|
||||
end
|
||||
=======
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
if action == "CastFail" and castTool and castTool.Parent then
|
||||
castTool.Grip = gripCF(REST_ANGLE) -- сервер удочку не трогал, а у нас она в замахе
|
||||
end
|
||||
@@ -2860,20 +2833,12 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
Audio.play("sparkle")
|
||||
end
|
||||
elseif action == "Sold" then
|
||||
<<<<<<< HEAD
|
||||
Audio.play("coins")
|
||||
if tutorialStep() == 3 then
|
||||
advanceTutorial(Config.TutorialDone)
|
||||
end
|
||||
floatText("+" .. fmt(a) .. " ⚪", C.gold)
|
||||
notify(("⚪ +%s"):format(fmt(a)), Color3.fromRGB(120, 255, 140))
|
||||
=======
|
||||
if tutorialStep() == 3 then
|
||||
advanceTutorial(Config.TutorialDone)
|
||||
end
|
||||
floatText("+" .. fmt(a) .. " 💰", C.gold)
|
||||
notify(("💰 +%s"):format(fmt(a)), Color3.fromRGB(120, 255, 140))
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
-- монеты приходят атрибутом чуть позже события, поэтому предложение — с задержкой
|
||||
local wasFull = offerState.bagWasFull
|
||||
offerState.bagWasFull = false
|
||||
@@ -2902,30 +2867,17 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
refreshDots()
|
||||
refreshTracker()
|
||||
elseif action == "QuestDone" then
|
||||
<<<<<<< HEAD
|
||||
notify(("✅ %s +%s ⚪ +%s XP"):format(questText(a, b), fmt(c), fmt(d or 0)), Color3.fromRGB(120, 255, 140))
|
||||
Audio.play("quest")
|
||||
elseif action == "ChainDone" then
|
||||
floatText("🏆 Цепочка пройдена!", C.gold)
|
||||
notify(("🎁 %s: +%s ⚪ +%s XP%s"):format(a, fmt(b), fmt(c), d and (" + " .. d) or ""), C.gold)
|
||||
Audio.play("fanfare")
|
||||
=======
|
||||
notify(("✅ %s +%s 💰 +%s XP"):format(questText(a, b), fmt(c), fmt(d or 0)), Color3.fromRGB(120, 255, 140))
|
||||
playUiSound(DING, 0.6)
|
||||
elseif action == "ChainDone" then
|
||||
floatText("🏆 Цепочка пройдена!", C.gold)
|
||||
notify(("🎁 %s: +%s 💰 +%s XP%s"):format(a, fmt(b), fmt(c), d and (" + " .. d) or ""), C.gold)
|
||||
playUiSound(DING, 0.8)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
elseif action == "ComboLost" then
|
||||
notify(("💔 Серия из %d прервана"):format(a), Color3.fromRGB(255, 130, 110))
|
||||
elseif action == "BossStart" then
|
||||
notify(("👑 %s в мире «%s»! Ловите всем сервером"):format(a, b), C.gold)
|
||||
<<<<<<< HEAD
|
||||
Audio.play("quest")
|
||||
=======
|
||||
playUiSound(DING, 0.8)
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
elseif action == "BossHit" then
|
||||
floatText(("⚔ -%d боссу"):format(a), Color3.fromRGB(255, 130, 100))
|
||||
elseif action == "BossDone" then
|
||||
@@ -2935,11 +2887,7 @@ remote.OnClientEvent:Connect(function(action, a, b, c, d)
|
||||
notify(("🌊 %s ушёл на глубину…"):format(b), C.muted)
|
||||
end
|
||||
elseif action == "BossReward" then
|
||||
<<<<<<< HEAD
|
||||
notify(("🎁 За босса: +%s ⚪ +%s XP%s"):format(fmt(a), fmt(b), c and (" + " .. c) or ""), Color3.fromRGB(120, 255, 140))
|
||||
=======
|
||||
notify(("🎁 За босса: +%s 💰 +%s XP%s"):format(fmt(a), fmt(b), c and (" + " .. c) or ""), Color3.fromRGB(120, 255, 140))
|
||||
>>>>>>> 1ff7ef7e83a97a0e100d5c3805ebc4ad762a2806
|
||||
elseif action == "OpenShop" then
|
||||
shopWin.open("rods")
|
||||
elseif action == "OpenQuests" then
|
||||
|
||||
@@ -302,15 +302,19 @@ 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()
|
||||
-- наживка теперь — карточка на нижней панели (HudBar.client.lua); старая кнопка скрыта, вкладку открывает K.openBait
|
||||
local baitBtn = btn({ Size = UDim2.fromOffset(110, 52), BackgroundColor3 = C.woodLight, Text = "", TextSize = 16, LayoutOrder = 1, Visible = false, Parent = bar }, function()
|
||||
openGuild("bait")
|
||||
end)
|
||||
K.openBait = 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)
|
||||
-- над кнопкой «Рюкзак» (правый низ): на телефоне — левее кнопки прыжка
|
||||
bar.Position = compact and UDim2.new(1, -140, 1, -66) or UDim2.new(1, -12, 1, -92)
|
||||
end)
|
||||
|
||||
local function refreshBar()
|
||||
|
||||
@@ -0,0 +1,405 @@
|
||||
-- HudBar (LocalScript) -> StarterPlayer > StarterPlayerScripts
|
||||
-- Нижняя панель и правый верх в стиле игры (вместо стандартных панелей Roblox):
|
||||
-- слоты удочек со стрелками (клик / клавиши 1–3 — выбрать удочку и взять её в руки),
|
||||
-- карточка удочки в руке (клик — взять или убрать), карточка наживки (⇄ — вкладка наживки гильдии),
|
||||
-- кнопка «Рюкзак» с заполненностью сумки, таблица игроков (уровень, серебро, улов) справа сверху —
|
||||
-- под ней встают плашка погоды и баннер события.
|
||||
-- Стиль и помощники — из FishingClient (Theme.kit), всё лежит в его холсте и прячется вместе с ним.
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local StarterGui = game:GetService("StarterGui")
|
||||
local UserInputService = game:GetService("UserInputService")
|
||||
local TweenService = game:GetService("TweenService")
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
local Models = require(ReplicatedStorage:WaitForChild("GameModels"))
|
||||
local Theme = require(script.Parent:WaitForChild("UiTheme"))
|
||||
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, fmt = K.new, K.text, K.btn, K.corner, K.stroke, K.gradient, K.fmt
|
||||
local TITLE, BODY2 = K.TITLE, K.BODY2
|
||||
local CENTER = Enum.TextXAlignment.Center
|
||||
local WHITE = Color3.new(1, 1, 1)
|
||||
|
||||
-- стандартные рюкзак и список игроков Roblox заменены своими
|
||||
local function hideCore()
|
||||
for _ = 1, 20 do
|
||||
local ok = pcall(function()
|
||||
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
|
||||
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
|
||||
end)
|
||||
if ok then
|
||||
return
|
||||
end
|
||||
task.wait(0.5)
|
||||
end
|
||||
end
|
||||
task.spawn(hideCore)
|
||||
|
||||
-- деревянная панель в стиле HUD
|
||||
local function woodPanel(props)
|
||||
local f = new("Frame", props, { corner(10), stroke(C.goldDark, 2.5, 0), Theme.woodGradient(C.wood, C.woodDark) })
|
||||
Theme.innerBorder(f, 4, 7, C.gold, 0.55)
|
||||
return f
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- удочки и наживка (низ по центру)
|
||||
|
||||
local SLOTS = 3
|
||||
local bar = woodPanel({
|
||||
Name = "HotBar", Size = UDim2.fromOffset(0, 74), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 1),
|
||||
Position = UDim2.new(0.5, 0, 1, -10), BackgroundColor3 = WHITE, Parent = K.screen,
|
||||
})
|
||||
Theme.rivets(bar, 7, 6)
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 12), PaddingRight = UDim.new(0, 12), Parent = bar })
|
||||
local row = new("Frame", { Size = UDim2.fromScale(0, 1), AutomaticSize = Enum.AutomaticSize.X, BackgroundTransparency = 1, Parent = bar }, {
|
||||
new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, VerticalAlignment = Enum.VerticalAlignment.Center, Padding = UDim.new(0, 6), SortOrder = Enum.SortOrder.LayoutOrder }),
|
||||
})
|
||||
-- ярлычок над слотами
|
||||
do
|
||||
local tag = new("Frame", {
|
||||
Size = UDim2.fromOffset(0, 24), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0, 1), Position = UDim2.new(0, 34, 0, 6),
|
||||
BackgroundColor3 = WHITE, ZIndex = 3, Parent = bar,
|
||||
}, { corner(8), stroke(C.goldDark, 2, 0), Theme.woodGradient(C.woodLight, C.wood), new("UIPadding", { PaddingLeft = UDim.new(0, 10), PaddingRight = UDim.new(0, 10) }) })
|
||||
text({ Size = UDim2.fromScale(0, 1), AutomaticSize = Enum.AutomaticSize.X, Font = BODY2, TextSize = 13, TextColor3 = C.parchment, Text = "Выбрать удочку", ZIndex = 4, Parent = tag })
|
||||
end
|
||||
|
||||
local page = 0 -- какие удочки видны в слотах: page*SLOTS + 1 …
|
||||
local refresh -- обновление панели, объявлена ниже
|
||||
local function ownedRods()
|
||||
local set = {}
|
||||
for id in string.gmatch(player:GetAttribute("OwnedRods") or "Basic", "[^,]+") do
|
||||
set[id] = true
|
||||
end
|
||||
local list = {}
|
||||
for _, r in ipairs(Config.Rods) do
|
||||
if set[r.id] then
|
||||
table.insert(list, r)
|
||||
end
|
||||
end
|
||||
return list
|
||||
end
|
||||
local function rodLevel(id)
|
||||
for pair in string.gmatch(player:GetAttribute("RodLevels") or "", "[^,]+") do
|
||||
local k, v = pair:match("^(%w+):(%d+)$")
|
||||
if k == id then
|
||||
return tonumber(v)
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
local function rodTool()
|
||||
for _, container in ipairs({ player.Character, player:FindFirstChild("Backpack") }) do
|
||||
if container then
|
||||
for _, t in ipairs(container:GetChildren()) do
|
||||
if t:IsA("Tool") and t:GetAttribute("IsRod") then
|
||||
return t
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local function inHand()
|
||||
local t = rodTool()
|
||||
return t ~= nil and t.Parent == player.Character
|
||||
end
|
||||
local function equip(on)
|
||||
local hum = player.Character and player.Character:FindFirstChildOfClass("Humanoid")
|
||||
if not hum then
|
||||
return
|
||||
end
|
||||
if on then
|
||||
local t = rodTool()
|
||||
if t then
|
||||
hum:EquipTool(t)
|
||||
end
|
||||
else
|
||||
hum:UnequipTools()
|
||||
end
|
||||
end
|
||||
|
||||
-- 3D-модель удочки (как в магазине): картинки-иконки удочек могут быть недоступны (права на ассет),
|
||||
-- модель строится из деталей и видна всегда. В квадрате удочка наклонена по диагонали, иначе она — тонкая черта
|
||||
local function rodView(holder, rodId, lvl)
|
||||
local key = rodId and (rodId .. ":" .. lvl) or ""
|
||||
if holder:GetAttribute("Shown") == key then
|
||||
return
|
||||
end
|
||||
holder:SetAttribute("Shown", key)
|
||||
for _, c in ipairs(holder:GetChildren()) do
|
||||
if c:IsA("ViewportFrame") then
|
||||
c:Destroy()
|
||||
end
|
||||
end
|
||||
if rodId and K.viewport then
|
||||
local ok, model = pcall(Models.buildRod, rodId, lvl, true)
|
||||
if ok and model then
|
||||
local p = model:GetPivot()
|
||||
model:PivotTo(CFrame.new(p.Position) * CFrame.Angles(math.rad(42), 0, 0) * (p - p.Position))
|
||||
K.viewport(holder, model, K.VIEW.rod, 0.62)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function arrow(order, label, dir)
|
||||
local b = btn({ Size = UDim2.fromOffset(26, 56), BackgroundColor3 = C.woodLight, Text = label, TextSize = 18, LayoutOrder = order, Parent = row }, function()
|
||||
local count = #ownedRods()
|
||||
local pages = math.max(1, math.ceil(count / SLOTS))
|
||||
page = (page + dir) % pages
|
||||
refresh()
|
||||
end)
|
||||
return b
|
||||
end
|
||||
|
||||
arrow(1, "‹", -1)
|
||||
local slots = {}
|
||||
for i = 1, SLOTS do
|
||||
local s = btn({ Size = UDim2.fromOffset(56, 56), BackgroundColor3 = C.wood, Text = "", LayoutOrder = 1 + i, Parent = row }, function()
|
||||
local rod = slots[i].rod
|
||||
if rod then
|
||||
if rod.id ~= player:GetAttribute("Rod") then
|
||||
remote:FireServer("Buy", "Rod", rod.id) -- своя удочка — бесплатно, сервер выдаёт её в руки
|
||||
task.delay(0.4, equip, true)
|
||||
else
|
||||
equip(not inHand())
|
||||
end
|
||||
end
|
||||
end)
|
||||
local icon = new("Frame", { Size = UDim2.new(1, -6, 1, -6), Position = UDim2.fromOffset(3, 3), BackgroundTransparency = 1, Parent = s })
|
||||
local num = new("Frame", { Size = UDim2.fromOffset(18, 18), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, 6), BackgroundColor3 = C.bg, ZIndex = 3, Parent = s },
|
||||
{ corner(9), stroke(C.gold, 1.2) })
|
||||
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 11, TextXAlignment = CENTER, TextColor3 = C.goldBright, Text = tostring(i), ZIndex = 4, Parent = num })
|
||||
slots[i] = { button = s, icon = icon, stroke = s:FindFirstChildOfClass("UIStroke") }
|
||||
end
|
||||
arrow(10, "›", 1)
|
||||
|
||||
-- разделитель
|
||||
new("Frame", { Size = UDim2.fromOffset(2, 52), BackgroundColor3 = C.goldDark, BorderSizePixel = 0, LayoutOrder = 11, Parent = row })
|
||||
|
||||
-- удочка в руке
|
||||
local rodCard = btn({ Size = UDim2.fromOffset(196, 60), BackgroundColor3 = C.woodLight, Text = "", LayoutOrder = 12, Parent = row }, function()
|
||||
equip(not inHand())
|
||||
end)
|
||||
local rodIcon = new("Frame", { Size = UDim2.fromOffset(52, 52), Position = UDim2.fromOffset(4, 4), BackgroundTransparency = 1, Parent = rodCard })
|
||||
local rodName = text({ Size = UDim2.new(1, -66, 1, -8), Position = UDim2.fromOffset(58, 4), Font = TITLE, TextScaled = true, TextWrapped = true, Text = "", Parent = rodCard })
|
||||
new("UITextSizeConstraint", { MaxTextSize = 17, Parent = rodName })
|
||||
local rodCheck = new("Frame", { Size = UDim2.fromOffset(22, 22), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(1, -4, 0, 4), BackgroundColor3 = C.forest, ZIndex = 3, Parent = rodCard },
|
||||
{ corner(11), stroke(WHITE, 2) })
|
||||
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 13, TextXAlignment = CENTER, Text = "✓", ZIndex = 4, Parent = rodCheck })
|
||||
|
||||
-- наживка
|
||||
local baitCard = new("Frame", { Size = UDim2.fromOffset(190, 60), BackgroundColor3 = WHITE, LayoutOrder = 13, Parent = row },
|
||||
{ corner(8), stroke(C.gold, 1.5, 0.15), Theme.woodGradient(C.woodLight, C.wood) })
|
||||
local baitIcon = text({ Size = UDim2.fromOffset(44, 44), Position = UDim2.fromOffset(6, 8), TextScaled = true, TextXAlignment = CENTER, Text = "🐛", Parent = baitCard })
|
||||
local baitName = text({ Size = UDim2.new(1, -104, 0, 24), Position = UDim2.fromOffset(54, 6), Font = TITLE, TextScaled = true, Text = "", Parent = baitCard })
|
||||
new("UITextSizeConstraint", { MaxTextSize = 17, Parent = baitName })
|
||||
local baitCount = text({ Size = UDim2.new(1, -104, 0, 20), Position = UDim2.fromOffset(54, 32), Font = BODY2, TextSize = 14, TextColor3 = C.muted, Text = "", Parent = baitCard })
|
||||
btn({ Size = UDim2.fromOffset(40, 40), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -8, 0.5, 0), BackgroundColor3 = C.wood, Text = "⇄", TextSize = 20, Parent = baitCard }, function()
|
||||
if K.openBait then
|
||||
K.openBait()
|
||||
end
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- рюкзак (правый низ)
|
||||
|
||||
local pack = btn({
|
||||
Name = "BackpackButton", Size = UDim2.fromOffset(170, 70), AnchorPoint = Vector2.new(1, 1), Position = UDim2.new(1, -12, 1, -12),
|
||||
BackgroundColor3 = C.woodLight, Text = "", Parent = K.screen,
|
||||
}, function()
|
||||
if K.bagWin then
|
||||
K.bagWin.toggle("fish")
|
||||
end
|
||||
end)
|
||||
pack:FindFirstChildOfClass("UIStroke").Color = C.goldDark
|
||||
pack:FindFirstChildOfClass("UIStroke").Thickness = 2.5
|
||||
text({ Size = UDim2.fromOffset(52, 52), Position = UDim2.fromOffset(8, 9), TextScaled = true, TextXAlignment = CENTER, Text = "🎒", Parent = pack })
|
||||
text({ Size = UDim2.new(1, -70, 0, 30), Position = UDim2.fromOffset(64, 8), Font = TITLE, TextSize = 22, Text = "Рюкзак", TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = pack })
|
||||
local packCount = text({ Size = UDim2.new(1, -70, 0, 22), Position = UDim2.fromOffset(64, 38), Font = BODY2, TextSize = 15, Text = "", Parent = pack })
|
||||
|
||||
---------------------------------------------------------------- таблица игроков (правый верх)
|
||||
|
||||
local ROW_H, MAX_ROWS = 26, 6
|
||||
local board = woodPanel({
|
||||
Name = "PlayersBoard", Size = UDim2.fromOffset(310, 34), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 8),
|
||||
BackgroundColor3 = WHITE, Parent = K.screen,
|
||||
})
|
||||
local function cols(parent, y, a, b, c, d, color, font)
|
||||
local function cell(x, w, t, align)
|
||||
text({ Size = UDim2.fromOffset(w, ROW_H), Position = UDim2.fromOffset(x, y), Font = font or BODY2, TextSize = 13, TextColor3 = color,
|
||||
TextXAlignment = align or CENTER, TextTruncate = Enum.TextTruncate.AtEnd, Text = t, Parent = parent })
|
||||
end
|
||||
cell(12, 130, a, Enum.TextXAlignment.Left)
|
||||
cell(142, 46, b)
|
||||
cell(188, 62, c)
|
||||
cell(250, 50, d)
|
||||
end
|
||||
local header = new("Frame", { Size = UDim2.new(1, 0, 0, 30), BackgroundTransparency = 1, Parent = board })
|
||||
cols(header, 3, "👥 Игроки", "Уровень", "Серебро", "Улов", C.muted)
|
||||
local rowsFrame = new("Frame", { Size = UDim2.new(1, 0, 1, -32), Position = UDim2.fromOffset(0, 30), BackgroundTransparency = 1, Parent = board })
|
||||
local collapsed = false
|
||||
|
||||
local function stat(p, name)
|
||||
local ls = p:FindFirstChild("leaderstats")
|
||||
local v = ls and ls:FindFirstChild(name)
|
||||
return v and v.Value or 0
|
||||
end
|
||||
|
||||
local function placeBelowBoard()
|
||||
-- плашку погоды (Ambience) и баннер события (FishingClient) ставим под таблицей
|
||||
local y = 8 + board.Size.Y.Offset + 8
|
||||
local weather = player.PlayerGui:FindFirstChild("WeatherHud")
|
||||
local pill = weather and weather:FindFirstChild("Root") and weather.Root:FindFirstChildOfClass("Frame")
|
||||
if pill then
|
||||
pill.Position = UDim2.new(1, -12, 0, y)
|
||||
y += pill.Size.Y.Offset + 8
|
||||
end
|
||||
local ev = K.screen:FindFirstChild("EventBanner")
|
||||
if ev then
|
||||
ev.Position = UDim2.new(1, -12, 0, y)
|
||||
end
|
||||
end
|
||||
|
||||
local function refreshBoard()
|
||||
for _, c in ipairs(rowsFrame:GetChildren()) do
|
||||
c:Destroy()
|
||||
end
|
||||
local list = Players:GetPlayers()
|
||||
table.sort(list, function(a, b)
|
||||
local la, lb = stat(a, "Уровень"), stat(b, "Уровень")
|
||||
if la ~= lb then
|
||||
return la > lb
|
||||
end
|
||||
return stat(a, "Серебро") > stat(b, "Серебро")
|
||||
end)
|
||||
local shown = collapsed and 0 or math.min(#list, MAX_ROWS)
|
||||
for i = 1, shown do
|
||||
local p = list[i]
|
||||
local me = p == player
|
||||
local r = new("Frame", { Size = UDim2.new(1, -12, 0, ROW_H - 2), Position = UDim2.fromOffset(6, (i - 1) * ROW_H), BackgroundColor3 = me and C.goldDark or C.woodDark,
|
||||
BackgroundTransparency = me and 0.55 or 0.6, Parent = rowsFrame }, { corner(5) })
|
||||
cols(r, -1, p.DisplayName, fmt(stat(p, "Уровень")), fmt(stat(p, "Серебро")), fmt(stat(p, "Улов")), me and C.goldBright or C.parchment, me and TITLE or BODY2)
|
||||
end
|
||||
board.Size = UDim2.fromOffset(310, 34 + shown * ROW_H + (shown > 0 and 6 or 0))
|
||||
placeBelowBoard()
|
||||
end
|
||||
|
||||
-- Tab — свернуть/развернуть, как стандартный список
|
||||
UserInputService.InputBegan:Connect(function(input, processed)
|
||||
if not processed and input.KeyCode == Enum.KeyCode.Tab then
|
||||
collapsed = not collapsed
|
||||
refreshBoard()
|
||||
end
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- обновление
|
||||
|
||||
refresh = function()
|
||||
-- слоты удочек
|
||||
local rods = ownedRods()
|
||||
local pages = math.max(1, math.ceil(#rods / SLOTS))
|
||||
page = math.clamp(page, 0, pages - 1)
|
||||
local current = player:GetAttribute("Rod") or "Basic"
|
||||
local hand = inHand()
|
||||
for i, s in ipairs(slots) do
|
||||
local rod = rods[page * SLOTS + i]
|
||||
s.rod = rod
|
||||
rodView(s.icon, rod and rod.id, rod and rodLevel(rod.id) or 0)
|
||||
s.button.BackgroundColor3 = rod and C.woodLight or C.woodDark
|
||||
s.button.AutoButtonColor = rod ~= nil
|
||||
local on = rod and rod.id == current
|
||||
s.stroke.Color = on and Color3.fromRGB(120, 230, 255) or C.goldDark
|
||||
s.stroke.Thickness = on and 3 or 1.5
|
||||
end
|
||||
-- удочка в руке
|
||||
local rod = Config.Find(Config.Rods, current) or Config.Rods[1]
|
||||
local lvl = rodLevel(rod.id)
|
||||
rodView(rodIcon, rod.id, lvl)
|
||||
rodName.Text = rod.name .. (lvl > 0 and (" +" .. lvl) or "")
|
||||
rodCheck.Visible = hand
|
||||
rodCard:FindFirstChildOfClass("UIStroke").Color = hand and Color3.fromRGB(120, 230, 255) or C.gold
|
||||
-- наживка
|
||||
local id = player:GetAttribute("Bait")
|
||||
local b = id and id ~= "" and Config.Find(Config.Baits, id)
|
||||
baitIcon.Text = b and b.icon or "🐛"
|
||||
baitName.Text = b and b.name or "Наживка"
|
||||
baitCount.Text = b and ("×%d"):format(player:GetAttribute("BaitCount") or 0) or "не выбрана"
|
||||
-- рюкзак
|
||||
local count, cap = player:GetAttribute("BagCount") or 0, player:GetAttribute("BagCap") or 10
|
||||
packCount.Text = ("📦 %d / %d"):format(count, cap)
|
||||
packCount.TextColor3 = count >= cap and Color3.fromRGB(255, 130, 120) or C.parchment
|
||||
end
|
||||
|
||||
-- клавиши 1–3: удочка из слота (взять в руки; повторно — убрать)
|
||||
UserInputService.InputBegan:Connect(function(input, processed)
|
||||
if processed then
|
||||
return
|
||||
end
|
||||
local n = ({ [Enum.KeyCode.One] = 1, [Enum.KeyCode.Two] = 2, [Enum.KeyCode.Three] = 3 })[input.KeyCode]
|
||||
local rod = n and slots[n].rod
|
||||
if rod then
|
||||
if rod.id ~= player:GetAttribute("Rod") then
|
||||
remote:FireServer("Buy", "Rod", rod.id)
|
||||
task.delay(0.4, equip, true)
|
||||
else
|
||||
equip(not inHand())
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Theme.onLayout(function(compact)
|
||||
local function scale(obj, s)
|
||||
local sc = obj:FindFirstChild("LayoutScale") or new("UIScale", { Name = "LayoutScale", Parent = obj })
|
||||
sc.Scale = s
|
||||
end
|
||||
-- телефон: всё мельче; рюкзак левее кнопки прыжка, таблица игроков — компактнее
|
||||
scale(bar, compact and 0.62 or 1)
|
||||
bar.Position = compact and UDim2.new(0.5, 0, 1, -4) or UDim2.new(0.5, 0, 1, -10)
|
||||
scale(pack, compact and 0.7 or 1)
|
||||
pack.Position = compact and UDim2.new(1, -140, 1, -6) or UDim2.new(1, -12, 1, -12)
|
||||
scale(board, compact and 0.75 or 1)
|
||||
MAX_ROWS = compact and 4 or 6
|
||||
refreshBoard()
|
||||
end)
|
||||
|
||||
player.AttributeChanged:Connect(refresh)
|
||||
local function watchChar(char)
|
||||
char.ChildAdded:Connect(refresh)
|
||||
char.ChildRemoved:Connect(refresh)
|
||||
end
|
||||
if player.Character then
|
||||
watchChar(player.Character)
|
||||
end
|
||||
player.CharacterAdded:Connect(watchChar)
|
||||
refresh()
|
||||
|
||||
-- таблица: игроки приходят и уходят, значения меняются
|
||||
local function watchPlayer(p)
|
||||
local ls = p:WaitForChild("leaderstats", 30)
|
||||
if ls then
|
||||
for _, v in ipairs(ls:GetChildren()) do
|
||||
v.Changed:Connect(refreshBoard)
|
||||
end
|
||||
ls.ChildAdded:Connect(function(v)
|
||||
v.Changed:Connect(refreshBoard)
|
||||
end)
|
||||
end
|
||||
refreshBoard()
|
||||
end
|
||||
for _, p in ipairs(Players:GetPlayers()) do
|
||||
task.spawn(watchPlayer, p)
|
||||
end
|
||||
Players.PlayerAdded:Connect(function(p)
|
||||
task.spawn(watchPlayer, p)
|
||||
end)
|
||||
Players.PlayerRemoving:Connect(function()
|
||||
task.defer(refreshBoard)
|
||||
end)
|
||||
refreshBoard()
|
||||
-- плашка погоды создаётся другим скриптом — подождать её
|
||||
task.delay(3, placeBelowBoard)
|
||||
@@ -0,0 +1,479 @@
|
||||
-- LobbyLife (LocalScript) -> StarterPlayer > StarterPlayerScripts
|
||||
-- Живое лобби у этого игрока (всё — на клиенте, сервер не нагружается):
|
||||
-- NPC поворачивают голову к игроку и машут, когда он подходит;
|
||||
-- кот ходит за игроком по площади, а один — ложится у фонтана;
|
||||
-- чайки над скалами, бабочки у цветов, ночью — светлячки у фонарей и клумб;
|
||||
-- деревья, трава, цветы и кусты колышутся от ветра (только рядом с камерой), с деревьев падают листья.
|
||||
-- Общие для всех вещи (idle NPC, гуляющие жители) — в LobbyLife.server.lua.
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local RunService = game:GetService("RunService")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
local V = Vector3.new
|
||||
local rng = Random.new()
|
||||
local LOBBY = V(0, 1, 0) -- центр лобби, пол на высоте 1
|
||||
local LOBBY_VIEW = 170 -- дальше камеры от центра лобби — ничего не анимируем
|
||||
local WAVE_ANIM = "rbxassetid://507770239"
|
||||
local LEAF_TEXTURE = "rbxassetid://138319345672122"
|
||||
|
||||
local map = workspace:WaitForChild("FishingMap")
|
||||
local fx = Instance.new("Folder")
|
||||
fx.Name = "LobbyLifeFX"
|
||||
fx.Parent = workspace
|
||||
|
||||
local function part(props)
|
||||
local p = Instance.new(props.Class or "Part")
|
||||
p.Anchored = true
|
||||
p.CanCollide, p.CanQuery, p.CanTouch, p.CastShadow = false, false, false, false
|
||||
p.Material = Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
for k, v in pairs(props) do
|
||||
if k ~= "Class" then
|
||||
p[k] = v
|
||||
end
|
||||
end
|
||||
p.Parent = props.Parent or fx
|
||||
return p
|
||||
end
|
||||
|
||||
local function camPos()
|
||||
local cam = workspace.CurrentCamera
|
||||
return cam and cam.CFrame.Position or LOBBY
|
||||
end
|
||||
local function myRoot()
|
||||
return player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- NPC: взгляд и приветствие
|
||||
|
||||
local npcs = {}
|
||||
local function scanNpcs()
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:IsA("Model") and d:GetAttribute("Npc") and not npcs[d] then
|
||||
local head = d:FindFirstChild("Head")
|
||||
local neck = head and head:FindFirstChild("Neck")
|
||||
local torso = d:FindFirstChild("UpperTorso")
|
||||
if neck and neck:IsA("Motor6D") and torso then
|
||||
npcs[d] = { neck = neck, c0 = neck.C0, torso = torso, head = head, yaw = 0, pitch = 0, waveAt = -math.huge }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function wave(rig, info)
|
||||
local hum = rig:FindFirstChildOfClass("Humanoid")
|
||||
local animator = hum and hum:FindFirstChildOfClass("Animator")
|
||||
if not animator then
|
||||
return
|
||||
end
|
||||
if not info.waveTrack then
|
||||
local a = Instance.new("Animation")
|
||||
a.AnimationId = WAVE_ANIM
|
||||
local ok, track = pcall(function() return animator:LoadAnimation(a) end)
|
||||
info.waveTrack = ok and track or false
|
||||
end
|
||||
if info.waveTrack then
|
||||
info.waveTrack.Priority = Enum.AnimationPriority.Action
|
||||
info.waveTrack:Play(0.2)
|
||||
end
|
||||
end
|
||||
|
||||
local function updateNpcs(dt)
|
||||
local root = myRoot()
|
||||
local myHead = player.Character and player.Character:FindFirstChild("Head")
|
||||
local now = os.clock()
|
||||
for rig, n in pairs(npcs) do
|
||||
if not rig.Parent then
|
||||
npcs[rig] = nil
|
||||
else
|
||||
local wantYaw, wantPitch = 0, 0
|
||||
local dist = root and (root.Position - n.head.Position).Magnitude or math.huge
|
||||
if myHead and dist < 24 then
|
||||
-- куда смотреть: в системе координат торса, лицо — по -Z
|
||||
local rel = n.torso.CFrame:PointToObjectSpace(myHead.Position)
|
||||
local headRel = n.torso.CFrame:PointToObjectSpace(n.head.Position)
|
||||
local d = rel - headRel
|
||||
wantYaw = math.clamp(math.atan2(-d.X, -d.Z), math.rad(-70), math.rad(70))
|
||||
wantPitch = math.clamp(math.atan2(d.Y, math.sqrt(d.X * d.X + d.Z * d.Z)), math.rad(-20), math.rad(30))
|
||||
-- голову к игроку, только если он перед NPC, а не за спиной
|
||||
if math.abs(math.atan2(-d.X, -d.Z)) > math.rad(110) then
|
||||
wantYaw, wantPitch = 0, 0
|
||||
end
|
||||
-- подошёл близко — помахать (не чаще раза в 25 секунд)
|
||||
if dist < 11 and now - n.waveAt > 25 then
|
||||
n.waveAt = now
|
||||
wave(rig, n)
|
||||
end
|
||||
end
|
||||
local k = math.min(1, dt * 4)
|
||||
n.yaw += (wantYaw - n.yaw) * k
|
||||
n.pitch += (wantPitch - n.pitch) * k
|
||||
n.neck.C0 = n.c0 * CFrame.Angles(0, n.yaw, 0) * CFrame.Angles(n.pitch, 0, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- кот
|
||||
|
||||
local cat = {}
|
||||
do
|
||||
local GINGER, WHITE, PINK = Color3.fromRGB(232, 150, 70), Color3.fromRGB(245, 238, 228), Color3.fromRGB(240, 150, 160)
|
||||
cat.body = part({ Size = V(1.3, 1.0, 2.3), Color = GINGER })
|
||||
cat.belly = part({ Size = V(1.0, 0.3, 1.9), Color = WHITE })
|
||||
cat.head = part({ Size = V(1.15, 1.0, 1.0), Color = GINGER })
|
||||
cat.muzzle = part({ Size = V(0.6, 0.35, 0.25), Color = WHITE })
|
||||
cat.nose = part({ Size = V(0.18, 0.12, 0.08), Color = PINK })
|
||||
cat.eyes = {
|
||||
part({ Size = V(0.16, 0.2, 0.05), Color = Color3.fromRGB(40, 40, 30) }),
|
||||
part({ Size = V(0.16, 0.2, 0.05), Color = Color3.fromRGB(40, 40, 30) }),
|
||||
}
|
||||
cat.ears = {
|
||||
part({ Class = "WedgePart", Size = V(0.3, 0.45, 0.35), Color = GINGER }),
|
||||
part({ Class = "WedgePart", Size = V(0.3, 0.45, 0.35), Color = GINGER }),
|
||||
}
|
||||
cat.legs = {}
|
||||
for i = 1, 4 do
|
||||
cat.legs[i] = part({ Size = V(0.32, 0.7, 0.32), Color = (i <= 2) and WHITE or GINGER })
|
||||
end
|
||||
cat.tail = {}
|
||||
for i = 1, 5 do
|
||||
cat.tail[i] = part({ Size = V(0.24, 0.24, 0.42), Color = (i == 5) and WHITE or GINGER })
|
||||
end
|
||||
cat.pos = LOBBY + V(10, 0, 12)
|
||||
cat.dir = V(0, 0, -1)
|
||||
cat.speed = 0
|
||||
cat.lying = 0 -- 0 стоит … 1 лежит
|
||||
cat.walk = 0 -- фаза шага
|
||||
cat.home = LOBBY + V(-9, 0, 13) -- лежанка у фонтана
|
||||
end
|
||||
|
||||
local function catTarget(root)
|
||||
if root and (root.Position - LOBBY).Magnitude < 70 and (root.Position - cat.pos).Magnitude < 40 then
|
||||
-- за игроком: держится чуть сбоку и позади
|
||||
local look = root.CFrame.LookVector
|
||||
local side = root.CFrame.RightVector
|
||||
return V(root.Position.X, LOBBY.Y, root.Position.Z) - look * 3 + side * 2.2, 3.5, true
|
||||
end
|
||||
return cat.home, 0.5, false
|
||||
end
|
||||
|
||||
local function updateCat(dt, t)
|
||||
local root = myRoot()
|
||||
local target, stopDist, following = catTarget(root)
|
||||
local flat = V(target.X - cat.pos.X, 0, target.Z - cat.pos.Z)
|
||||
local dist = flat.Magnitude
|
||||
local want = 0
|
||||
if dist > stopDist then
|
||||
want = math.clamp(dist * 1.2, 4, following and 15 or 6) -- догоняет бегом, домой идёт шагом
|
||||
end
|
||||
cat.speed += (want - cat.speed) * math.min(1, dt * 5)
|
||||
if dist > 0.05 and cat.speed > 0.2 then
|
||||
cat.dir = cat.dir:Lerp(flat.Unit, math.min(1, dt * 6)).Unit
|
||||
local step = math.min(dist, cat.speed * dt)
|
||||
cat.pos += cat.dir * step
|
||||
end
|
||||
-- не заходим в чашу фонтана и на прилавки
|
||||
local r = V(cat.pos.X, 0, cat.pos.Z).Magnitude
|
||||
if r < 14 then
|
||||
cat.pos = LOBBY + V(cat.pos.X, 0, cat.pos.Z).Unit * 14
|
||||
elseif r > 54 then
|
||||
cat.pos = LOBBY + V(cat.pos.X, 0, cat.pos.Z).Unit * 54
|
||||
end
|
||||
local resting = not following and dist <= 0.6 and cat.speed < 0.5
|
||||
cat.lying += ((resting and 1 or 0) - cat.lying) * math.min(1, dt * 2)
|
||||
cat.walk += cat.speed * dt * 2.2
|
||||
|
||||
local L = cat.lying
|
||||
local base = CFrame.lookAt(cat.pos, cat.pos + cat.dir) -- -Z — нос
|
||||
local bob = math.abs(math.sin(cat.walk)) * 0.08 * math.min(1, cat.speed / 4)
|
||||
local bodyY = 1.05 - 0.55 * L + bob
|
||||
local body = base * CFrame.new(0, bodyY, 0)
|
||||
cat.body.CFrame = body
|
||||
cat.belly.CFrame = body * CFrame.new(0, -0.4, 0)
|
||||
local headTurn = L > 0.5 and math.sin(t * 0.4) * 0.3 or 0
|
||||
local head = body * CFrame.new(0, 0.55 - 0.25 * L, -1.35) * CFrame.Angles(0, headTurn, 0)
|
||||
cat.head.CFrame = head
|
||||
cat.muzzle.CFrame = head * CFrame.new(0, -0.18, -0.55)
|
||||
cat.nose.CFrame = head * CFrame.new(0, -0.02, -0.66)
|
||||
cat.eyes[1].CFrame = head * CFrame.new(-0.25, 0.12, -0.51)
|
||||
cat.eyes[2].CFrame = head * CFrame.new(0.25, 0.12, -0.51)
|
||||
cat.ears[1].CFrame = head * CFrame.new(-0.35, 0.68, 0.05) * CFrame.Angles(0, math.pi, 0)
|
||||
cat.ears[2].CFrame = head * CFrame.new(0.35, 0.68, 0.05) * CFrame.Angles(0, math.pi, 0)
|
||||
-- лапы: шагают попеременно, лёжа прячутся под корпус
|
||||
local swing = math.sin(cat.walk) * 0.6 * math.min(1, cat.speed / 3)
|
||||
local legPos = { { -0.42, -0.85 }, { 0.42, -0.85 }, { -0.42, 0.85 }, { 0.42, 0.85 } }
|
||||
for i, lp in ipairs(legPos) do
|
||||
local s = ((i == 1 or i == 4) and swing or -swing)
|
||||
cat.legs[i].CFrame = body * CFrame.new(lp[1], -0.5 - 0.15 * (1 - L) + 0.25 * L, lp[2]) * CFrame.Angles(s, 0, 0)
|
||||
* CFrame.new(0, -0.25 * (1 - L), 0)
|
||||
end
|
||||
-- хвост: цепочка сегментов, кончик покачивается
|
||||
local tcf = body * CFrame.new(0, 0.3, 1.15) * CFrame.Angles(math.rad(35 - 25 * L), 0, 0)
|
||||
for i, seg in ipairs(cat.tail) do
|
||||
local sway = math.sin(t * 2.2 - i * 0.6) * (0.18 + 0.05 * i)
|
||||
tcf = tcf * CFrame.Angles(math.rad(10), sway, 0) * CFrame.new(0, 0, 0.38)
|
||||
seg.CFrame = tcf
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- чайки
|
||||
|
||||
local gulls = {}
|
||||
for i = 1, 4 do
|
||||
local g = {
|
||||
body = part({ Size = V(0.7, 0.6, 1.9), Color = Color3.fromRGB(245, 245, 248) }),
|
||||
head = part({ Size = V(0.5, 0.5, 0.55), Color = Color3.fromRGB(250, 250, 252) }),
|
||||
beak = part({ Size = V(0.15, 0.15, 0.45), Color = Color3.fromRGB(245, 180, 60) }),
|
||||
wings = { part({ Size = V(2.4, 0.1, 0.9), Color = Color3.fromRGB(205, 210, 220) }), part({ Size = V(2.4, 0.1, 0.9), Color = Color3.fromRGB(205, 210, 220) }) },
|
||||
tips = { part({ Size = V(0.8, 0.1, 0.7), Color = Color3.fromRGB(60, 62, 70) }), part({ Size = V(0.8, 0.1, 0.7), Color = Color3.fromRGB(60, 62, 70) }) },
|
||||
r = rng:NextNumber(70, 115), h = rng:NextNumber(52, 78), w = rng:NextNumber(0.1, 0.17) * (i % 2 == 0 and 1 or -1),
|
||||
a = rng:NextNumber(0, math.pi * 2), flap = rng:NextNumber(0, 10),
|
||||
}
|
||||
gulls[i] = g
|
||||
end
|
||||
|
||||
local function updateGulls(dt, t)
|
||||
for _, g in ipairs(gulls) do
|
||||
g.a += g.w * dt
|
||||
local r = g.r + math.sin(t * 0.13 + g.a) * 12
|
||||
local pos = V(math.cos(g.a) * r, g.h + math.sin(t * 0.4 + g.r) * 4, math.sin(g.a) * r)
|
||||
local ahead = V(math.cos(g.a + 0.05 * math.sign(g.w)) * r, pos.Y, math.sin(g.a + 0.05 * math.sign(g.w)) * r)
|
||||
local bank = -math.sign(g.w) * math.rad(18)
|
||||
local cf = CFrame.lookAt(pos, ahead) * CFrame.Angles(0, 0, bank)
|
||||
-- машет крыльями урывками, потом планирует
|
||||
local flapping = math.sin(t * 0.5 + g.flap) > 0.2
|
||||
local wing = flapping and math.sin(t * 9 + g.flap) * math.rad(35) or math.rad(4)
|
||||
g.body.CFrame = cf
|
||||
g.head.CFrame = cf * CFrame.new(0, 0.25, -1.05)
|
||||
g.beak.CFrame = cf * CFrame.new(0, 0.2, -1.5)
|
||||
for s = 1, 2 do
|
||||
local side = (s == 1) and -1 or 1
|
||||
local hinge = cf * CFrame.new(side * 0.35, 0.15, -0.1) * CFrame.Angles(0, 0, side * wing)
|
||||
g.wings[s].CFrame = hinge * CFrame.new(side * 1.2, 0, 0)
|
||||
g.tips[s].CFrame = hinge * CFrame.new(side * 2.4, 0, 0.05) * CFrame.Angles(0, 0, side * wing * 0.5) * CFrame.new(side * 0.35, 0, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- бабочки и светлячки
|
||||
|
||||
local butterflies = {}
|
||||
local fireflyEmitters = {}
|
||||
local function setupFlowersFX()
|
||||
local anchors = {}
|
||||
local foot = map:FindFirstChild("LobbyCliffFoot")
|
||||
local flowers = foot and foot:FindFirstChild("Flowers")
|
||||
if flowers then
|
||||
for _, f in ipairs(flowers:GetChildren()) do
|
||||
table.insert(anchors, f:GetPivot().Position)
|
||||
end
|
||||
end
|
||||
if #anchors == 0 then
|
||||
for i = 1, 12 do
|
||||
local a = i / 12 * math.pi * 2
|
||||
table.insert(anchors, LOBBY + V(math.cos(a) * 70, 0, math.sin(a) * 70))
|
||||
end
|
||||
end
|
||||
local COLORS = { Color3.fromRGB(255, 200, 80), Color3.fromRGB(255, 255, 255), Color3.fromRGB(150, 200, 255), Color3.fromRGB(255, 150, 200), Color3.fromRGB(255, 160, 70) }
|
||||
for i = 1, 16 do
|
||||
local anchor = anchors[rng:NextInteger(1, #anchors)]
|
||||
local c = COLORS[rng:NextInteger(1, #COLORS)]
|
||||
table.insert(butterflies, {
|
||||
anchor = V(anchor.X, LOBBY.Y, anchor.Z), seed = rng:NextNumber(0, 100),
|
||||
body = part({ Size = V(0.08, 0.08, 0.4), Color = Color3.fromRGB(50, 40, 35) }),
|
||||
wings = { part({ Size = V(0.45, 0.04, 0.4), Color = c }), part({ Size = V(0.45, 0.04, 0.4), Color = c }) },
|
||||
})
|
||||
end
|
||||
-- светлячки: у фонарей лобби и у клумб, светятся только ночью
|
||||
local spots = {}
|
||||
for _, d in ipairs(map:GetDescendants()) do
|
||||
if d:IsA("PointLight") and d.Parent:IsA("BasePart") then
|
||||
local p = d.Parent.Position
|
||||
if (V(p.X, 0, p.Z)).Magnitude < 80 and p.Y < 20 then
|
||||
table.insert(spots, p - V(0, 3, 0))
|
||||
end
|
||||
end
|
||||
end
|
||||
for i = 1, math.min(10, #anchors) do
|
||||
table.insert(spots, anchors[rng:NextInteger(1, #anchors)] + V(0, 1.5, 0))
|
||||
end
|
||||
for _, p in ipairs(spots) do
|
||||
local box = part({ Size = V(6, 3, 6), Transparency = 1, CFrame = CFrame.new(p) })
|
||||
local pe = Instance.new("ParticleEmitter")
|
||||
pe.Texture = "rbxasset://textures/particles/sparkles_main.dds"
|
||||
pe.Color = ColorSequence.new(Color3.fromRGB(220, 255, 120))
|
||||
pe.LightEmission = 1
|
||||
pe.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(0.2, 0.22), NumberSequenceKeypoint.new(0.8, 0.22), NumberSequenceKeypoint.new(1, 0) })
|
||||
pe.Lifetime = NumberRange.new(3, 5)
|
||||
pe.Rate = 1.5
|
||||
pe.Speed = NumberRange.new(0.3, 0.8)
|
||||
pe.SpreadAngle = Vector2.new(180, 180)
|
||||
pe.Acceleration = V(0, 0.15, 0)
|
||||
pe.Shape = Enum.ParticleEmitterShape.Box
|
||||
pe.Enabled = false
|
||||
pe.Parent = box
|
||||
table.insert(fireflyEmitters, pe)
|
||||
end
|
||||
end
|
||||
|
||||
local function updateButterflies(dt, t)
|
||||
for _, b in ipairs(butterflies) do
|
||||
local s = b.seed
|
||||
local off = V(math.sin(t * 0.37 + s) * 2.6 + math.sin(t * 0.9 + s * 2) * 0.8, 1.6 + math.sin(t * 0.7 + s) * 0.9 + 0.5,
|
||||
math.cos(t * 0.31 + s) * 2.6 + math.cos(t * 1.1 + s) * 0.8)
|
||||
local pos = b.anchor + off
|
||||
local vel = V(math.cos(t * 0.37 + s) * 0.37 * 2.6, 0, -math.sin(t * 0.31 + s) * 0.31 * 2.6)
|
||||
local cf = CFrame.lookAt(pos, pos + (vel.Magnitude > 0.01 and vel or V(0, 0, -1)))
|
||||
local flap = math.sin(t * 17 + s) * math.rad(60) + math.rad(15)
|
||||
b.body.CFrame = cf
|
||||
b.wings[1].CFrame = cf * CFrame.Angles(0, 0, flap) * CFrame.new(-0.24, 0, 0)
|
||||
b.wings[2].CFrame = cf * CFrame.Angles(0, 0, -flap) * CFrame.new(0.24, 0, 0)
|
||||
end
|
||||
end
|
||||
|
||||
local nightCheckAt = 0
|
||||
local function updateFireflies(t)
|
||||
if t - nightCheckAt < 1 then
|
||||
return
|
||||
end
|
||||
nightCheckAt = t
|
||||
local night = false
|
||||
if Config.DayNight and Config.DayNight.enabled and Config.Nightness and Config.ClockAt then
|
||||
local clock = Config.ClockAt(workspace:GetServerTimeNow(), workspace:GetAttribute("DayStart"))
|
||||
night = Config.Nightness(clock) > 0.4
|
||||
end
|
||||
for _, pe in ipairs(fireflyEmitters) do
|
||||
pe.Enabled = night
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- ветер: деревья, трава, цветы, кусты
|
||||
|
||||
local swayers = {}
|
||||
local function addSway(model, amp, freq, range)
|
||||
local parts, rel = {}, {}
|
||||
local cf, size = model:GetBoundingBox()
|
||||
local base = CFrame.new(cf.Position.X, cf.Position.Y - size.Y / 2, cf.Position.Z)
|
||||
for _, p in ipairs(model:GetDescendants()) do
|
||||
if p:IsA("BasePart") then
|
||||
table.insert(parts, p)
|
||||
table.insert(rel, base:ToObjectSpace(p.CFrame))
|
||||
end
|
||||
end
|
||||
if #parts > 0 then
|
||||
table.insert(swayers, {
|
||||
parts = parts, rel = rel, base = base, amp = math.rad(amp) * rng:NextNumber(0.8, 1.2),
|
||||
freq = freq * rng:NextNumber(0.85, 1.15), phase = rng:NextNumber(0, math.pi * 2), range = range,
|
||||
height = size.Y,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
local leafTrees = {}
|
||||
local function setupSway()
|
||||
local function each(folder, amp, freq, range, leaves)
|
||||
if not folder then
|
||||
return
|
||||
end
|
||||
for _, m in ipairs(folder:GetChildren()) do
|
||||
if m:IsA("Model") then
|
||||
addSway(m, amp, freq, range)
|
||||
if leaves then
|
||||
table.insert(leafTrees, m)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- амплитуда (градусы) и частота (качаний в секунду): деревья — чуть заметно и медленно, трава — живее
|
||||
each(map:FindFirstChild("LobbyTrees"), 0.6, 0.32, 130, true)
|
||||
each(map:FindFirstChild("LobbyForest"), 0.6, 0.32, 130, true)
|
||||
local foot = map:FindFirstChild("LobbyCliffFoot")
|
||||
if foot then
|
||||
each(foot:FindFirstChild("Grass"), 2.8, 0.8, 50)
|
||||
each(foot:FindFirstChild("Flowers"), 3.2, 0.85, 50)
|
||||
each(foot:FindFirstChild("Bushes"), 1, 0.5, 60)
|
||||
end
|
||||
-- падающие листья: у ближайших к площади деревьев, из объёма кроны
|
||||
table.sort(leafTrees, function(a, b)
|
||||
return V(a:GetPivot().Position.X, 0, a:GetPivot().Position.Z).Magnitude < V(b:GetPivot().Position.X, 0, b:GetPivot().Position.Z).Magnitude
|
||||
end)
|
||||
for i = 1, math.min(24, #leafTrees) do
|
||||
local cf, size = leafTrees[i]:GetBoundingBox()
|
||||
local crown = part({ Size = V(size.X * 0.8, size.Y * 0.35, size.Z * 0.8), Transparency = 1, CFrame = cf * CFrame.new(0, size.Y * 0.2, 0) })
|
||||
local pe = Instance.new("ParticleEmitter")
|
||||
pe.Texture = LEAF_TEXTURE
|
||||
pe.Color = ColorSequence.new(Color3.fromRGB(255, 255, 255), Color3.fromRGB(255, 235, 170))
|
||||
pe.Size = NumberSequence.new(0.45)
|
||||
pe.Lifetime = NumberRange.new(6, 9)
|
||||
pe.Rate = 0.15
|
||||
pe.Speed = NumberRange.new(0.2, 0.6)
|
||||
pe.Acceleration = V(0.6, -1.1, 0.2)
|
||||
pe.Drag = 0.6
|
||||
pe.Rotation = NumberRange.new(0, 360)
|
||||
pe.RotSpeed = NumberRange.new(-140, 140)
|
||||
pe.Orientation = Enum.ParticleOrientation.VelocityPerpendicular
|
||||
pe.Shape = Enum.ParticleEmitterShape.Box
|
||||
pe.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.08, 0), NumberSequenceKeypoint.new(0.85, 0), NumberSequenceKeypoint.new(1, 1) })
|
||||
pe.LightInfluence = 1
|
||||
pe.Parent = crown
|
||||
end
|
||||
end
|
||||
|
||||
local swayAcc = 0
|
||||
local bulkParts, bulkCFrames = {}, {}
|
||||
local function updateSway(dt, t)
|
||||
swayAcc += dt
|
||||
if swayAcc < 1 / 30 then
|
||||
return
|
||||
end
|
||||
swayAcc = 0
|
||||
local cam = camPos()
|
||||
-- порывы: ветер то стихает, то усиливается
|
||||
local gust = 0.75 + 0.2 * math.sin(t * 0.23) + 0.08 * math.sin(t * 0.71)
|
||||
table.clear(bulkParts)
|
||||
table.clear(bulkCFrames)
|
||||
for _, s in ipairs(swayers) do
|
||||
if (s.base.Position - cam).Magnitude < s.range then
|
||||
local a = s.amp * gust
|
||||
local ax = a * math.sin(t * s.freq * math.pi * 2 + s.phase)
|
||||
local az = a * 0.6 * math.sin(t * s.freq * math.pi * 1.3 + s.phase * 1.7) + a * 0.2 -- лёгкий наклон по ветру
|
||||
local pose = s.base * CFrame.Angles(ax, 0, az)
|
||||
for i, p in ipairs(s.parts) do
|
||||
table.insert(bulkParts, p)
|
||||
table.insert(bulkCFrames, pose * s.rel[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
if #bulkParts > 0 then
|
||||
workspace:BulkMoveTo(bulkParts, bulkCFrames, Enum.BulkMoveMode.FireCFrameChanged)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- запуск
|
||||
|
||||
task.wait(3) -- карта и NPC успевают появиться
|
||||
scanNpcs()
|
||||
setupFlowersFX()
|
||||
setupSway()
|
||||
local scanAt = os.clock()
|
||||
local t0 = os.clock()
|
||||
RunService.RenderStepped:Connect(function(dt)
|
||||
local t = os.clock() - t0
|
||||
if os.clock() - scanAt > 5 then
|
||||
scanAt = os.clock()
|
||||
scanNpcs()
|
||||
end
|
||||
updateNpcs(dt)
|
||||
if (camPos() - LOBBY).Magnitude > LOBBY_VIEW then
|
||||
return -- игрок в другом мире: лобби не анимируем
|
||||
end
|
||||
updateCat(dt, t)
|
||||
updateGulls(dt, t)
|
||||
updateButterflies(dt, t)
|
||||
updateFireflies(t)
|
||||
updateSway(dt, t)
|
||||
end)
|
||||
@@ -0,0 +1,45 @@
|
||||
-- NpcTalk (LocalScript) -> StarterPlayer > StarterPlayerScripts
|
||||
-- Реплики NPC в пузыре над головой, когда игрок подходит (только у этого игрока).
|
||||
-- Реплики задаёт NpcLooks (атрибут рига NpcLines: строки через «|»). Взгляд, idle и взмах рукой — LobbyLife.
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local TextChatService = game:GetService("TextChatService")
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
local NEAR, COOLDOWN = 12, 30 -- studs; секунд между репликами одного NPC
|
||||
|
||||
local lastAt, lastLine = {}, {}
|
||||
|
||||
local function say(head, text)
|
||||
local ok = pcall(function()
|
||||
TextChatService:DisplayBubble(head, text)
|
||||
end)
|
||||
if not ok then
|
||||
pcall(function()
|
||||
game:GetService("Chat"):Chat(head, text)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
while true do
|
||||
task.wait(0.5)
|
||||
local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
if root and map then
|
||||
local now = os.clock()
|
||||
for _, rig in ipairs(map:GetChildren()) do
|
||||
local lines = rig:IsA("Model") and rig:GetAttribute("NpcLines")
|
||||
local head = lines and rig:FindFirstChild("Head")
|
||||
if head and (head.Position - root.Position).Magnitude < NEAR and now - (lastAt[rig] or -math.huge) > COOLDOWN then
|
||||
lastAt[rig] = now
|
||||
local list = string.split(lines, "|")
|
||||
local i = math.random(1, #list)
|
||||
if #list > 1 and i == lastLine[rig] then
|
||||
i = i % #list + 1
|
||||
end
|
||||
lastLine[rig] = i
|
||||
say(head, list[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user