Jump to content
  • 0

How to fix this Script


GubA

Question


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  06/16/14
  • Last Seen:  

// 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
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  120
  • Reputation:   8
  • Joined:  09/16/18
  • Last Seen:  

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

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   35
  • Joined:  03/26/20
  • Last Seen:  

Which script language is this

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  24
  • Reputation:   0
  • Joined:  06/16/14
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

I am not sure what coding language you normally use, but you have a wrong idea about NPC scripts are written 

https://github.com/rathena/rathena/wiki/Basic-Scripting

all the script command 

doc/script_commands.txt

all the npc script sample

npc

doc/sample

Link to comment
Share on other sites

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.

×
×
  • Create New...