Yaziid91 Posted June 12, 2024 Posted June 12, 2024 Good evening, I would like to know how to do so that when we kill a person on a certain map I steal the number of points they have? example if she has 10 kafra points and I have 0, by killing her I go to 10 and she has 0 thank you for your help Quote
0 Z3R0 Posted June 12, 2024 Posted June 12, 2024 I won't explain exactly how to do this, but you could simply use the following information OnPCKillEvent: This special label triggers when a player kills another player. The variable 'killedrid' is set to the ID of the player killed. *getmapxy("<variable for map name>",<variable for x>,<variable for y>{,<type>,"<search value>"}) *getcharid(<type>{,"<character name>"}) // Type = 3 (for Account ID) #KAFRAPOINTS *attachrid(<account_id>); - Attaches Script to Account ID (reads information from attached account) Using the information here, we can determine the following: When the Trigger Runs, we can use getmapxy to determine the location of the user and check the map that they are on, the NPC should be hidden with a -1 and placed on the map... I believe it will only trigger if ON that map, but I could be mistaken, hence the reason to use getmapxy and check... Once you determined if they are on that map, the next thing to do, would be to set a variable called origrid = getcharid(3); // this will allow you to go "back" to this user, once we go to the killed user to get their information... So, then using attachrid(killedrid); you can attach the script to the killed player, and then store a variable (npc variable) to store the #KAFRAPOINTS they had, and no you can set those to ZERO... Then reattach the script back to the origrid and add that npc variable with the #KAFRAPOINTS to the original killer's #KAFRAPOINTS Quote
0 Poring King Posted June 13, 2024 Posted June 13, 2024 3 hours ago, Z3R0 said: I won't explain exactly how to do this, but you could simply use the following information OnPCKillEvent: This special label triggers when a player kills another player. The variable 'killedrid' is set to the ID of the player killed. *getmapxy("<variable for map name>",<variable for x>,<variable for y>{,<type>,"<search value>"}) *getcharid(<type>{,"<character name>"}) // Type = 3 (for Account ID) #KAFRAPOINTS *attachrid(<account_id>); - Attaches Script to Account ID (reads information from attached account) Using the information here, we can determine the following: When the Trigger Runs, we can use getmapxy to determine the location of the user and check the map that they are on, the NPC should be hidden with a -1 and placed on the map... I believe it will only trigger if ON that map, but I could be mistaken, hence the reason to use getmapxy and check... Once you determined if they are on that map, the next thing to do, would be to set a variable called origrid = getcharid(3); // this will allow you to go "back" to this user, once we go to the killed user to get their information... So, then using attachrid(killedrid); you can attach the script to the killed player, and then store a variable (npc variable) to store the #KAFRAPOINTS they had, and no you can set those to ZERO... Then reattach the script back to the origrid and add that npc variable with the #KAFRAPOINTS to the original killer's #KAFRAPOINTS Seems like from Chat GPT Quote
0 Z3R0 Posted June 14, 2024 Posted June 14, 2024 BWA HA HA HA Absolutely not, it's actually copy and pasted from the rathena script_commands.txt https://github.com/rathena/rathena/blob/master/doc/script_commands.txt Quote
0 Z3R0 Posted June 14, 2024 Posted June 14, 2024 Personally, if someone was asking this in Request, then I would help write the script, but when asking for support, I gave a more broad example of how to actually write the script yourself and all the things you should look for and focus on. Quote
Question
Yaziid91
Good evening, I would like to know how to do so that when we kill a person on a certain map I steal the number of points they have? example if she has 10 kafra points and I have 0, by killing her I go to 10 and she has 0 thank you for your help
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.