MyNoobScriptz Posted March 8 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 75 Reputation: 3 Joined: 05/01/15 Last Seen: 7 hours ago Share Posted March 8 //REDUCE HP PLAYER OUT OF ZONE prontera,1,1,1 script AutoReduceHP HIDDEN_NPC,{ end; OnTimer2000: .@percent = -30; .@size = getareaunits(BL_PC,"prontera",145,83,164,69,.@aid); if (.@size > 0) { for (.@i = 0; .@i < .@size; .@i++) { if (attachrid(.@aid[.@i])) { if (Hp <= MaxHp) { specialeffect2 107; percentheal .@percent, .@percent; if (Hp < 5) { warp "SavePoint",0,0; } } detachrid; } } } initnpctimer; end; OnInit: initnpctimer; end; } hi rathena i have script from rathena, but i need to convert script if player out of area hp - 30 % every 2 second can anyone help me please Quote Link to comment Share on other sites More sharing options...
0 Racaae Posted March 14 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 132 Reputation: 53 Joined: 06/02/12 Last Seen: Friday at 12:41 AM Share Posted March 14 (edited) On 3/8/2024 at 12:46 PM, MyNoobScriptz said: can you share some example script like you comment, please Hello. Use getareaunits to get everyone who is in the "safe zone". Then use getmapunits to get everyone on the map. Compare the two lists and attach the players who aren't on both arrays since this means they are out the area. //REDUCE HP PLAYER OUT OF ZONE prontera,1,1,1 script AutoReduceHP HIDDEN_NPC,{ end; OnTimer2000: .@percent = -30; .@SafeArea = getareaunits(BL_PC,"prontera",145,83,164,69,.@safe_aid); .@size = getmapunits(BL_PC,"prontera",.@aid); if (.@size > 0) { for (.@i = 0; .@i < .@size; .@i++) { if (inarray(.@safe_aid, .@aid[.@i]) < 0) { if (attachrid(.@aid[.@i])) { if (Hp <= MaxHp) { specialeffect2 107; percentheal .@percent, .@percent; if (Hp < 5) { warp "SavePoint",0,0; } } detachrid; } } } } initnpctimer; end; OnInit: initnpctimer; end; } Edited March 14 by Racaae Added script 1 Quote Link to comment Share on other sites More sharing options...
0 Rynbef Posted March 8 Group: Forum Moderator Topic Count: 44 Topics Per Day: 0.01 Content Count: 896 Reputation: 117 Joined: 05/23/12 Last Seen: 5 hours ago Share Posted March 8 Add a getmapxy and check for the range by if statements. If Player ist out of the zone reduce HP and sp. Rynbef~ Quote Link to comment Share on other sites More sharing options...
0 MyNoobScriptz Posted March 8 Group: Members Topic Count: 34 Topics Per Day: 0.01 Content Count: 75 Reputation: 3 Joined: 05/01/15 Last Seen: 7 hours ago Author Share Posted March 8 3 hours ago, Rynbef said: Add a getmapxy and check for the range by if statements. If Player ist out of the zone reduce HP and sp. Rynbef~ can you share some example script like you comment, please Quote Link to comment Share on other sites More sharing options...
Question
MyNoobScriptz
//REDUCE HP PLAYER OUT OF ZONE prontera,1,1,1 script AutoReduceHP HIDDEN_NPC,{ end; OnTimer2000: .@percent = -30; .@size = getareaunits(BL_PC,"prontera",145,83,164,69,.@aid); if (.@size > 0) { for (.@i = 0; .@i < .@size; .@i++) { if (attachrid(.@aid[.@i])) { if (Hp <= MaxHp) { specialeffect2 107; percentheal .@percent, .@percent; if (Hp < 5) { warp "SavePoint",0,0; } } detachrid; } } } initnpctimer; end; OnInit: initnpctimer; end; }
hi rathena i have script from rathena, but i need to convert script if player out of area hp - 30 % every 2 second
can anyone help me please
Link to comment
Share on other sites
3 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.