Skip to main content

Problem in functions in Python

Comments

2 comments

  • chika vladimir

    Hello, I think problem is in makecode core. When we define function call in event player.on_chat it has 3 hidden parameters (num1, num2, num3).

    But in Your code on_chat function is called directly without parapmeters and compiler don't know what call is right and what to do with parameters

    0
  • chika vladimir
    def on_chat(num1, num2, num3):
        player.tell(mobs.target(LOCAL_PLAYER), "This is a method of player")

    on_chat(0, 0, 0)

    player.on_chat("jump", on_chat)

    def example():
        player.tell(mobs.target(LOCAL_PLAYER), "This is a real funtion")
    0

Please sign in to leave a comment.