Jump to content




[LUA][Error] attempt to call boolean?


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

#1 Mackan90096

  • Signature Abuser
  • 518 posts
  • LocationIn my basement.

Posted 03 June 2013 - 01:19 PM

Alright, so I'm trying to make a game (Again).

So far, I had no errors until I tried implement shops.

Error:

AsciiRPG:204: attempt to call boolean

I know that a boolean is true or false.

But it only happends if I press the shop key wich I defined as 'p' twice.

Why?
How do I fix it?

Thanks for help //Mackan90096 (The Duck)

code:

Spoiler


#2 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 03 June 2013 - 01:25 PM

Well
elseif p1 == p then
        if shop == false then
          shop = true
          shop()
you define shop to be true and then call it as a function... Hence attempt to call boolean...

#3 Mackan90096

  • Signature Abuser
  • 518 posts
  • LocationIn my basement.

Posted 03 June 2013 - 01:33 PM

Oh.. DERP!
Thanks .. :D

#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 03 June 2013 - 10:28 PM

Tip for the future: whenever you get an `attempt to call` error check your variables on the line number, check where you're overriding it etc.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users