bios:338: [string "TreeCut4"]:3: '=' expected

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

CaptiveCreeper

New Member
Jul 29, 2019
8
0
0
I am making a program to cut down a 2 by 2 tree and when i run it i get this error
Here is the Code
Code:
turtle.dig()
turtle.forward
turtle.turnRight(1)
local TreeHeight == 0
turtle.digUp()
while turtle.detectUp() do
turtle.dig()
turtle.forward()
turtle.turnLeft(1)
turtle.dig()
turtle.forward()
turtle.turnLeft(1)
turtle.dig()
turtle.forward()
turtle.turnLeft(1)
turtle.forward()
turtle.turnLeft(1)
turtle.digUp()
turtle.Up
TreeHeight = TreeHeight + 1
end
i = 0
for i = 0 , TreeHeight , 1 do
turtle.down()
end
I do not know why it is not working and am starting to get frustrated. Please Help
 
You're missing parentheses after the first call to turtle.forward() (second line of your code).
 
I Changed that and now it gives me the error TreeCut4 : 18: attempt to call nill.t
I Tryed to put parentheses infront of it but still gives the error
Thanks for the help though
 
Take out the 1 in between the parenthesis on your turnLeft() and turnRight() calls. Those don't take arguments. Also, your fourth line should use a single '=' instead of the double '=='. Single '=' is assignment, double '==' is comparison.
 
  • Like
Reactions: Pokefenn