PewN Posted August 26, 2012 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
goddameit Posted August 26, 2012 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
PewN Posted August 27, 2012 Author Posted August 27, 2012 yup. but my script is correct when i check it on mapserver. that's my error hmmm Quote
Peopleperson49 Posted August 27, 2012 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
Question
PewN
Help map server says player not attached HELP!
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.