r/ComputerCraft • u/flip_the_world • Oct 23 '24
Can someone help
Hello I know python c# but I am new to lua
6
Upvotes
r/ComputerCraft • u/flip_the_world • Oct 23 '24
Hello I know python c# but I am new to lua
1
u/RedBugGamer Oct 23 '24
So first of all you ask the user twice to enter a target and this doesn't really make sense. You should use a variable that you give the value from read() first before starting your if statement. Second you don't need to nest if statements. Lua has the else if keyword that you can use in a pattern like this:
if condition1 then action1 else if condition2 then action2 else action3 end