Jump to content
  • 0

How to fix this Script


Question

Posted (edited)
// This script causes monsters to drop a red potion when they are killed.

function onMonsterDeath(monster, killer) {
    // Check if the killer is a player.
    if (killer.isPlayer()) {
        // Drop a red potion.
        monster.dropItem(501, 1);
    }
}

module.exports = {
    onMonsterDeath: onMonsterDeath
};

Thank you to help me

JY5XNq.png

 

 

Edited by GubA

4 answers to this question

Recommended Posts

  • 0
Posted

show the error at your console so anyone here can help you much better.

3 hours ago, GubA said:
// This script causes monsters to drop a red potion when they are killed.

function onMonsterDeath(monster, killer) {
    // Check if the killer is a player.
    if (killer.isPlayer()) {
        // Drop a red potion.
        monster.dropItem(501, 1);
    }
}

module.exports = {
    onMonsterDeath: onMonsterDeath
};

Thank you to help me

 

  • 0
Posted
On 12/19/2022 at 1:26 AM, Singe Horizontal said:

Which script language is this

when write script , what language i must use?

 

On 12/19/2022 at 7:14 AM, GubA said:

when write script , what language i must use?

Sorry i don't know.

i see other script and write think is right.

 

On 12/17/2022 at 4:27 PM, lelouchxv said:

show the error at your console so anyone here can help you much better.

 

JY5XNq.png

This mt error

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...