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 25 additions and 32 deletions
Showing only changes of commit b7b3c1eb81 - Show all commits

View File

@ -1117,21 +1117,6 @@ local RunService = game:GetService("RunService")
local part = script.Parent
local hintVisible = false
local hintGui = Instance.new("BillboardGui", part)
hintGui.Size = UDim2.new(5, 0, 1, 0)
hintGui.StudsOffset = Vector3.new(0, 2.5, 0)
hintGui.AlwaysOnTop = true
local label = Instance.new("TextLabel", hintGui)
label.Size = UDim2.new(0, 320, 0, 50)
label.Position = UDim2.new(0.5, -160, 0.6, 0) -- ниже центра, над хотбаром
label.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
label.BackgroundTransparency = 0.4
label.TextColor3 = Color3.fromRGB(255, 255, 255)
label.TextStrokeTransparency = 0
label.TextScaled = true
label.Text = "[E] Поговорить с торговцем"
label.Visible = false
RunService.Heartbeat:Connect(function()
local px = __rbxl_player_x()
local pz = __rbxl_player_z()
@ -1141,7 +1126,11 @@ RunService.Heartbeat:Connect(function()
local near = dist <= 4
if near ~= hintVisible then
hintVisible = near
label.Visible = near
if near then
__rbxl_hud_set("g13_counter_hint", "[E] Поговорить с торговцем", 50, 75, "#ffe44a", 20)
else
__rbxl_hud_set("g13_counter_hint", nil)
end
end
end)
@ -1160,21 +1149,6 @@ local RunService = game:GetService("RunService")
local part = script.Parent
local hintVisible = false
local hintGui = Instance.new("BillboardGui", part)
hintGui.Size = UDim2.new(4, 0, 1, 0)
hintGui.StudsOffset = Vector3.new(0, 3.5, 0)
hintGui.AlwaysOnTop = true
local label = Instance.new("TextLabel", hintGui)
label.Size = UDim2.new(0, 280, 0, 50)
label.Position = UDim2.new(0.5, -140, 0.6, 0) -- ниже центра, над хотбаром
label.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
label.BackgroundTransparency = 0.4
label.TextColor3 = Color3.fromRGB(255, 255, 255)
label.TextStrokeTransparency = 0
label.TextScaled = true
label.Text = "[E] Открыть дверь"
label.Visible = false
RunService.Heartbeat:Connect(function()
local px = __rbxl_player_x()
local pz = __rbxl_player_z()
@ -1184,7 +1158,11 @@ RunService.Heartbeat:Connect(function()
local near = dist <= 4
if near ~= hintVisible then
hintVisible = near
label.Visible = near
if near then
__rbxl_hud_set("g13_door_hint", "[E] Открыть дверь", 50, 75, "#ffe44a", 20)
else
__rbxl_hud_set("g13_door_hint", nil)
end
end
end)

View File

@ -1816,6 +1816,21 @@ export function registerRobloxShim(lua, opts) {
color: color || '#ffffff',
});
});
// Установка/удаление HUD-плашки в фиксированной позиции — паритет с
// JS game.ui.set / game.ui.showInteractHint и аналогами.
// opts = {x, y, color, size} (x,y в процентах 0-100; color — hex)
global.set('__rbxl_hud_set', (id, text, x, y, color, size) => {
const payload = { id: String(id || ''), text: text || null };
if (text != null) {
payload.opts = {
x: Number(x) || 50,
y: Number(y) || 75,
color: color || '#ffe44a',
size: Number(size) || 20,
};
}
send('ui.set', payload);
});
// Спавн NPC — паритет с JS game.scene.spawnNpc(modelType, opts).
// Возвращает локальный ref (строку 'npc_lua_N'), который можно передавать
// в __rbxl_npc_say(ref, text, duration).