feat: 50 игр на Lua + импорт Roblox для всех + поддержка Lua в плеере #39

Merged
min merged 215 commits from feat/lua-50-games-bundle into main 2026-06-09 21:59:25 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 4320c6adeb - Show all commits

View File

@ -1743,7 +1743,7 @@ local won = false
-- Спавним всех врагов и метки над ними
for i, e in ipairs(enemies) do
e.ref = __rbxl_spawn_npc("character-b", e.x, 1, e.z, e.name, e.hp, 0)
__rbxl_set_label(e.ref, e.name .. " HP: " .. e.hp, "#ff5555", 4)
__rbxl_set_label(e.ref, e.name .. " HP: " .. e.hp, "#ff5555", 0.3)
-- Callback на смерть NPC
__rbxl_npc_on_death(e.ref, function()
if e._dead then return end
@ -1773,7 +1773,7 @@ for _, e in ipairs(enemies) do
enemy.hp = enemy.hp - 30
if enemy.hp < 0 then enemy.hp = 0 end
__rbxl_npc_damage(enemy.ref, 30)
__rbxl_set_label(enemy.ref, enemy.name .. " HP: " .. enemy.hp, "#ff5555", 4)
__rbxl_set_label(enemy.ref, enemy.name .. " HP: " .. enemy.hp, "#ff5555", 0.3)
__rbxl_spawn_particles("sparks", enemy.x, 2, enemy.z, 0.4, 1)
hitSound:Play()
end)

View File

@ -470,7 +470,7 @@ export class NpcManager {
const show = npc.hp < npc.maxHp;
hb.anchor.setEnabled(show);
if (show) {
hb.anchor.position.set(npc.x, npc.y + 2.4, npc.z);
hb.anchor.position.set(npc.x, npc.y + 1.9, npc.z);
const pct = Math.max(0, Math.min(1, npc.hp / npc.maxHp));
hb.fill.scaling.x = pct;
hb.fill.position.x = -(1 - pct) * hb.barWidth / 2;