diff options
| author | rebecca <ubq323@ubq323.website> | 2026-02-28 20:54:05 +0000 |
|---|---|---|
| committer | rebecca <ubq323@ubq323.website> | 2026-02-28 20:54:05 +0000 |
| commit | 930aaf6ac5e6f12a45e0327ca912df5b8274c24a (patch) | |
| tree | 9ef831c02e19c7bd87367b5c152796f88bb874d8 /forward.lua | |
| parent | f6ad5740e65758b4b92860b35db75a27c079d5ad (diff) | |
forward
Diffstat (limited to 'forward.lua')
| -rw-r--r-- | forward.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/forward.lua b/forward.lua index 0242205..af60f3f 100644 --- a/forward.lua +++ b/forward.lua @@ -1,15 +1,14 @@ local p = peripheral.wrap"back" for i,mod in ipairs{"kinetic","sensor","keyboard"} do - assert(p.hasModule("plethora:"..mod, "need "..mod.."!") + assert(p.hasModule("plethora:"..mod), "need "..mod.."!") end local pitch, yaw = 0,0 local function detector() while true do - local ents = p.sense() local player for i,e in ipairs(p.sense()) do - if e.key == "minecraft:player" and x.name == "ubq323" then - player = x break + if e.key == "minecraft:player" and e.name == "ubq323" then + player = e break end end assert(player, "couldn't find player??") @@ -22,7 +21,7 @@ local function launcher() while true do if not isheld and key == 67 then -- six seve n p.launch(pitch, yaw, 4) end -end +end end print"go" parallel.waitForAny(detector, launcher) |
