ToiletMaster Posted January 16, 2013 Group: Members Topic Count: 76 Topics Per Day: 0.02 Content Count: 276 Reputation: 7 Joined: 08/11/12 Last Seen: January 26, 2018 Share Posted January 16, 2013 Hi there, Currently what i'm trying to do is enable a npc once the map users is 0. i've set to the last sentence of my npc to be disablenpc strnpcinfo(0); close; And on the top i'm placing this sm_pri,11,10,4 script Grandma 2339,{ if (getmapusers("sm_pri") == 0) { enablenpc strnpcinfo(0); } However once the map doesn't have any users left. it still remains disabled. i'm trying to make it once the map becomes 0 people it'll automatically enable the npc. What am i doing wrong here? (On a side note: Awesome map syouji ! thanks!) Quote Link to comment Share on other sites More sharing options...
goddameit Posted January 16, 2013 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Share Posted January 16, 2013 (edited) if you can click that npc (''Grandma'') that's mean you're standing on sm_pri so getmapusers("sm_pri") will not be 0. or if you disable npc, then you can't click that npc to make it enable. or if that npc disable by itself, then it can't enable itself cause its status is disable. Edited January 16, 2013 by goddameit Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted January 16, 2013 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted January 16, 2013 - script sdflsdflksjdfldj -1,{ OnInit: while (1) { if ( getmapusers("guild_vs2") ) disablenpc "test_warp"; else enablenpc "test_warp"; sleep 5000; } end; // shouldn't reach } prontera,155,180,5 script test_warp 45,1,1,{ warp "guild_vs2", 0,0; disablenpc strnpcinfo(0); end; } Quote Link to comment Share on other sites More sharing options...
ToiletMaster Posted January 18, 2013 Group: Members Topic Count: 76 Topics Per Day: 0.02 Content Count: 276 Reputation: 7 Joined: 08/11/12 Last Seen: January 26, 2018 Author Share Posted January 18, 2013 (edited) if you can click that npc (''Grandma'') that's mean you're standing on sm_pri so getmapusers("sm_pri") will not be 0. or if you disable npc, then you can't click that npc to make it enable. or if that npc disable by itself, then it can't enable itself cause its status is disable. Thanks for the information. However what i was trying to do was once the npc is disabled, then once the player leaves the map for another person to enter, the npc enables back. The player itself won't interact with that npc anymore once it's disabled. Because in one part of my script someone actually dies, so i need to disable him and once he leaves, it'll enable back by itself. Once he finishes up in there (about another 2-3 minutes) he'll be warped out of the map. That map can only have 1 person so why i'm thinking this is possible - script sdflsdflksjdfldj -1,{ OnInit: while (1) { if ( getmapusers("guild_vs2") ) disablenpc "test_warp"; else enablenpc "test_warp"; sleep 5000; } end; // shouldn't reach } prontera,155,180,5 script test_warp 45,1,1,{ warp "guild_vs2", 0,0; disablenpc strnpcinfo(0); end; } Thanks annie! This is one part of what i wanted it to be thanks! However i can't seem to get it to work on my end. Once my npc becomes disabled and i warp out of the map it doesn't enable itself. I kinda edited to make it look like this - script sdflsdflksjdfldj -1,{ OnInit: if ( getmapusers("sm_pri") ) enablenpc "Grandma"; } end; // shouldn't reach Since my 1st NPC is gonna disable itself, i just need it to enable itself once the map gets filled with 1 person. but it still doesn't work. Appreciate the help thanks alot! Edited January 18, 2013 by ToiletMaster Quote Link to comment Share on other sites More sharing options...
Question
ToiletMaster
Hi there,
Currently what i'm trying to do is enable a npc once the map users is 0.
i've set to the last sentence of my npc to be
And on the top i'm placing this
However once the map doesn't have any users left. it still remains disabled. i'm trying to make it once the map becomes 0 people it'll automatically enable the npc.
What am i doing wrong here?
(On a side note: Awesome map syouji ! thanks!)
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.