PewN Posted August 26, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.05 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Share Posted August 26, 2012 Help map server says player not attached HELP! - script mythmoz -1,{ OnMobInvasion: monster "myth_dun01",0,0,"Valkyrie",2621,3,strnpcinfo(1)+"::OnMobDeadx"; monster "myth_dun01",0,0,"Apocalypse",2622,3,strnpcinfo(1)+"::OnMobDeadx"; monster "myth_dun01",0,0,"Bomb Poring",2623,3,strnpcinfo(1)+"::OnMobDeadx"; monster "myth_dun01",0,0,"Gloom",2624,3,strnpcinfo(1)+"::OnMobDeadx"; monster "myth_dun01",0,0,"Atroce",2627,3,strnpcinfo(1)+"::OnMobDeadx"; monster "myth_dun01",0,0,"Baphomet",2629,3,strnpcinfo(1)+"::OnMobDeadx"; end; OnMobDeadx: if (mobcount("myth_dun01","mythmoz::OnMobDeadx") > 0) { announce "Defeat all monster!",0; end; } else { donpcevent "mythmoz::OnBossInvasion"; end; } OnBossInvasion: announce "The Boss has appeared!",bc_map,0x008000; sleep2 1000; monster "myth_dun01",0,0,"Bakonawa",2632,1,strnpcinfo(0)+"::OnBossDead"; end; Quote Link to comment Share on other sites More sharing options...
goddameit Posted August 26, 2012 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: October 19, 2017 Share Posted August 26, 2012 donpcevent "mythmoz::OnBossInvasion"; donpcevent ---> NPC do specify event so OnBossInvasion: announce "The Boss has appeared!",bc_map,0x008000; sleep2 1000; monster "myth_dun01",0,0,"Bakonawa",2632,1,strnpcinfo(0)+"::OnBossDead"; end; strnpcinfo(0) <--- No player attached. Quote Link to comment Share on other sites More sharing options...
PewN Posted August 27, 2012 Group: Members Topic Count: 209 Topics Per Day: 0.05 Content Count: 892 Reputation: 27 Joined: 12/09/11 Last Seen: April 16, 2016 Author Share Posted August 27, 2012 yup. but my script is correct when i check it on mapserver. that's my error hmmm Quote Link to comment Share on other sites More sharing options...
Peopleperson49 Posted August 27, 2012 Group: Members Topic Count: 218 Topics Per Day: 0.05 Content Count: 1180 Reputation: 141 Joined: 01/27/12 Last Seen: January 24, 2023 Share Posted August 27, 2012 You can use playerattached() to check if a players is attached before it runs anymore script or a piece of script. By using something like if(playerattached()==0) { end; } you can prevent a script for running with no player attached. Or another version is if(playerattached()!=0) { announce "Your really did it!",bc_self,0x008000; }. Peopleperson49 *playerattached() Returns the ID of the player currently attached to the script. It will return 0 if no one is attached, or if the attached player no longer exists on the map server. It is wise to check for the attached player in script functions that deal with timers as there's no guarantee the player will still be logged on when the timer triggers. Note that the ID of a player is actually their account ID. 2 Quote Link to comment Share on other sites More sharing options...
Question
PewN
Help map server says player not attached HELP!
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.