diff --git a/src/community/docsGamesBuildersLua.js b/src/community/docsGamesBuildersLua.js index 5e776f9..400e659 100644 --- a/src/community/docsGamesBuildersLua.js +++ b/src/community/docsGamesBuildersLua.js @@ -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) diff --git a/src/editor/engine/lua/RobloxShim.js b/src/editor/engine/lua/RobloxShim.js index e148a77..72d05a5 100644 --- a/src/editor/engine/lua/RobloxShim.js +++ b/src/editor/engine/lua/RobloxShim.js @@ -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).