Need some help with the basics #1258
-
so, my issue is that i cannot seem to figure out how to control a motor. my motor is the electric motor from the mod "Create Crafts & additions". my program is suppoed to check if a redstone wire connected to the computer's left side is turned on according to my own googling, this should be fairly simple, but i could never get it to work, the usual errors about expecting end or = near something. my code looks like this: help would be really appriciated |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
while true do
if redstone.getInput("Left") = 1 then
motor = peripheral.wrap("left")
motor.setSpeed(256)
else
motor.stop
end
Also, you need one more |
Beta Was this translation helpful? Give feedback.
motor.stop
is missing (), so lua thinks you are trying to assign something tomotor.stop
but forgot to actually do= something
motor.stop()
is what you want.Also, you need one more
end
.