Turtle.attack

From ComputerCraft Wiki
Revision as of 12:30, 24 September 2012 by 82.42.78.200 (Talk)

Jump to: navigation, search
This page is a stub.
Please help us by expanding it.

This page is currently unfinished.


{{Function |name=turtle.attack |api=turtle |returns=boolean whether the turtle succeeded in attacking |addon=ComputerCraft |desc=Attempts to attack the block in front. |examples=

Grid paper.png  Example
Tries to attack a mob/player in front and outputs whether it worked or not.
Code
if turtle.attack() then
 print ("Turtle attacked in Front.")
else
 print ("Turtle Could not attack.")
end
Output Turtle attacked in Front. or Turtle Could not attack.