npc script help

Mu online season 21 - grand opening

mississ1

Dedicated Member
Dedicated Member
Mar 23, 2007
81
0
32
i have been searching the whole site, but i cnt find any npc scripting that cn help me. i wish to make an npc that can giv pets to characters but only 1 per character. im not gud at scripting atm nd cnt find a guide so has any1 got the script for this please
 

Snowman

Golden Oldie
Golden Oldie
May 30, 2005
729
3
155
[@main]
#SAY
i can give u a pet, but only one! want it?\

<yes plz/@yes>
<no thanks/@exit>

[@yes]
#If
checkmarry 0
#ACT
marry mob BlackMaggot
#SAY
there you go, treat it well.
#ELSESAY
sorry, only one pet for now.\

very basic script, change the BlackMaggot to the mob you want to give them... not tested so duno if it works :P
 
Upvote 0

transporter

LOMCN Veteran
Veteran
Jul 12, 2008
608
8
105
Darlington
[@main]
Hello <$USERNAME>, i`m the pet summoner of <$SERVERNAME>.\
I can help you on your journey by summoning a pet for you.\
Would you like your free pet?\ \
<Yes/@Next>\
<No Thanks/@exit>\

[@Next]
#IF
CHECKSLAVECOUNT = 0
#ACT
RECALLMOB WoomaTaurus 1 ( 1 = level of mob you can use 1 - 9)
sendmsg 6 "I have summoned you a WoomaTaurus <$USERNAME>."
#ELSEACT
sendmsg 6 "You already have a pet i`m afraid <$USERNAME>."
Close
 
  • Like
Reactions: mississ1
Upvote 0

Snowman

Golden Oldie
Golden Oldie
May 30, 2005
729
3
155
[@main]
Hello <$USERNAME>, i`m the pet summoner of <$SERVERNAME>.\
I can help you on your journey by summoning a pet for you.\
Would you like your free pet?\ \
<Yes/@Next>\
<No Thanks/@exit>\

[@Next]
#IF
CHECKSLAVECOUNT = 0
#ACT
RECALLMOB WoomaTaurus 1 ( 1 = level of mob you can use 1 - 9)
sendmsg 6 "I have summoned you a WoomaTaurus <$USERNAME>."
#ELSEACT
sendmsg 6 "You already have a pet i`m afraid <$USERNAME>."
Close

recallmob is a gm command not a npc command
 
Upvote 0

mazz

Dedicated Member
Dedicated Member
Aug 6, 2008
193
2
45
Yeah it is both acutally as long as the permission is correctly set
 
Upvote 0

mazz

Dedicated Member
Dedicated Member
Aug 6, 2008
193
2
45
isnt this only allowing 1 pet then ? CHECKSLAVECOUNT = 0
wouldnt it instead be something like this CHECKSLAVECOUNT =<4 (equals less then 4)
if you were allowing more then 1 pet to be bought ect
because 0 actually counts as 1?
 
Last edited:
Upvote 0

mazz

Dedicated Member
Dedicated Member
Aug 6, 2008
193
2
45
another question does it matter if we use a break after a if act statement if there is an else afterward anyway?

Most act statement like killmonect(not real comand) require you to end with a break ?
is this a form of error handling im just curious
 
Upvote 0

mazz

Dedicated Member
Dedicated Member
Aug 6, 2008
193
2
45
Yeah im aware of that but if you were allowing 5 pets instead you would check for it like that instead
 
Last edited:
Upvote 0

mazz

Dedicated Member
Dedicated Member
Aug 6, 2008
193
2
45
because if its checking that it is 0 instead of 1 then if it is 1 it will do the else instead
 
Upvote 0

mazz

Dedicated Member
Dedicated Member
Aug 6, 2008
193
2
45
what i was saying is if CHECKSLAVECOUNT = <4 the number of slaves is equal to or less then give the player a mob
sorry actually allows 4 pet for 4 not 5
 
Last edited:
Upvote 0

mazz

Dedicated Member
Dedicated Member
Aug 6, 2008
193
2
45
I was just adding on but at the same time unsure as I just know more about vb then C format
 
Upvote 0

transporter

LOMCN Veteran
Veteran
Jul 12, 2008
608
8
105
Darlington
another question does it matter if we use a break after a if act statement if there is an else afterward anyway?

Most act statement like killmonect(not real comand) require you to end with a break ?
is this a form of error handling im just curious

Yeah im aware of that but if you were allowing 5 pets instead you would check for it like that instead

because if its checking that it is 0 instead of 1 then if it is 1 it will do the else instead

what i was saying is if CHECKSLAVECOUNT = <4 the number of slaves is equal to or less then give the player a mob
sorry actually allows 4 pet for 4 not 5

I was just adding on but at the same time unsure as I just know more about vb then C format

Mate you need to learn how to use the edit button lol.
 
Upvote 0