Jump to content
  • 0

Help Player not attached!


PewN

Question


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

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;


Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   219
  • Joined:  11/22/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

yup. but my script is correct when i check it on mapserver. that's my error hmmm

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

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.

  • Upvote 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...