Jump to content




Help with enchanting turtle


  • You cannot reply to this topic
2 replies to this topic

#1 mphillips43

  • New Members
  • 1 posts

Posted 13 May 2013 - 08:36 PM

I have a T5 skeleton spawner feeding an enchanting turtle with plenty of xp. I am wanting to make a system that works like a password program. I have it setup so that when I run the program it displays the current xp level and then asks how many levels you want it to use for an enchant. It looks like this:

My Current Level is: "m.getLevel() goes here"
Enchantment Level: requested level entered here

in my code I have it set so that m.enchant(read()), but when I enter a number i get this:

enchant:15: bad argument #1 (expected number)

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 14 May 2013 - 01:43 PM

Split into new topic.

read() returns a string. Use tonumber(read()) instead.

#3 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 14 May 2013 - 01:45 PM

you have to convert the string from read() to a number using:
m.enchant(tonumber(read()))






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users