feat: 50 игр на Lua + импорт Roblox для всех + поддержка Lua в плеере #39
@ -2308,9 +2308,28 @@ export function registerRobloxShim(lua, opts) {
|
||||
playerMouse.Hit.p = playerMouse.Hit.Position;
|
||||
}
|
||||
try { playerMouse.Button1Down.Fire(); } catch (_) {}
|
||||
// Также фейерим UserInputService.InputBegan с UserInputType.MouseButton1
|
||||
try {
|
||||
const uitEnum = global.get('Enum')?.UserInputType || {};
|
||||
const inputObj = {
|
||||
UserInputType: uitEnum.MouseButton1
|
||||
|| { Name: 'MouseButton1', Value: 'MouseButton1' },
|
||||
KeyCode: { Name: 'Unknown', Value: 'Unknown' },
|
||||
};
|
||||
uis.InputBegan.Fire(inputObj, false);
|
||||
} catch (_) {}
|
||||
}
|
||||
if (p.type === 'mouseButton1Up') {
|
||||
try { playerMouse.Button1Up.Fire(); } catch (_) {}
|
||||
try {
|
||||
const uitEnum = global.get('Enum')?.UserInputType || {};
|
||||
const inputObj = {
|
||||
UserInputType: uitEnum.MouseButton1
|
||||
|| { Name: 'MouseButton1', Value: 'MouseButton1' },
|
||||
KeyCode: { Name: 'Unknown', Value: 'Unknown' },
|
||||
};
|
||||
uis.InputEnded.Fire(inputObj, false);
|
||||
} catch (_) {}
|
||||
}
|
||||
if (p.type === 'keyDown' || p.type === 'keydown') {
|
||||
const k = String(p.key || '').toLowerCase();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user