Starship/example/example.lua

19 lines
610 B
Lua
Raw Normal View History

2025-03-11 21:16:30 -06:00
require("test.lua")
function OnPlayUpdate(ev)
2025-03-11 21:16:30 -06:00
PrintTest()
2025-03-12 16:02:00 -06:00
if((Game.gInputPress().button & N64Buttons.BTN_L) ~= 0) then
local reticlePos = Game.D_display_801613E0(0)
local actorId = math.random(176, 291)
local actor = Game_SpawnActor(actorId);
2025-03-12 16:02:00 -06:00
if (actor ~= nil) then
actor.obj.pos.x = reticlePos.x * 1.7
actor.obj.pos.y = 200.0
actor.obj.pos.z = Game.gPlayer().pos.z - 1500.0 - (reticlePos.y * 1.7)
actor.state = 0
end
end
end
RegisterListener(Events.PlayerPreUpdateEvent, OnPlayUpdate, EventPriority.NORMAL)