• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

NPC wont spawn

Omen

New Member
Joined
Sep 11, 2008
Messages
70
Reaction score
0
I added my NPC to the map, to the npc.xml just like ive done with tons of other NPCs ive made. but this one wont spawn, what do I do?

PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Orc Prison Guard" floorchange="0" walkinterval="0">
	<health now="150" max="150" /> 
	<look type="5" head="0" body="0" legs="0" feet="0" addons="0" />
	<voices interval="5000" chance="50">
		<voice sentence="I left the door unlocked! Run!" /> 
		<voice sentence="Ill be killed if your caught.." /> 
		<voice sentence="Do not forget the knife ive left for you!" /> 
	</voices>
</npc>

Replys with 'make sure its added here' are ignored thanks for help
 
tfs 8.22 - Its in the spawn file in the data/world folder - it says he spawns there, but i restart the server and log in and voila! nothing is there!
 
PHP:
 <spawn centerx="27" centery="51" centerz="10" radius="2">
  <npc name="Orc Prison Guard" x="0" y="-1" z="10" spawntime="60" /> 
  </spawn>

sure im sure.
 
the coords are correct, as we did it in the map editor and checked it in-game. i dont know how to use the file name for the npc spawn.
 
hmmm. found your error. Usually, npcs should load a script file.
example
Code:
<npc name="example npc" script="data/npc/scripts/example.lua"

Try to fix a default script that every npc can use. Then make that npc load from that script. Try this and then tell me your results.
 
PHP:
- <npc name="Jacks Friend" floorchange="0" walkinterval="2000">
  <health now="1" max="1" /> 
  <look type="131" head="114" body="114" legs="95" feet="58" addons="2" /> 
- <interaction range="3" idletime="30">
  local pos = 0 setPlayerStorageValue(cid, 2379, 1) 
- <interact keywords="hi" focus="1">
  <keywords>hello</keywords> 
  <keywords>greet</keywords> 
- <response>
- <action name="script">
- <![CDATA[ 	
							if(getPlayerStorageValue(cid, 2379))  == 2 then
								selfSay("You have already given me the knife!")
							elseif(getPlayerItemCount(cid,2379)) == 1 then
								selfSay("You have escaped! And you have my friends knife! Thank you so much for bringing it to me.")
								doPlayerTakeItem(cid,2379,1)
								doPlayerAddExp(cid,4200)
								setPlayerStorageValue(cid, 2379, 2)
							else
								selfSay("Wheres my friends knife?")
								_state.isidle = true
								pos = {x=26, y=56, z=10}
								doTeleportThing(cid, pos)
								doSendMagicEffect(newPos, 10)
							end
						
  ]]> 
  </action>
  </response>
  </interact>
- <interact keywords="bye" focus="0">
  <keywords>farewell</keywords> 
  <response text="Good bye. Safe journey to you." /> 
  </interact>
- <interact event="onBusy">
- <response text="Please give me a moment!">
  <action name="addqueue" value="|PLAYER|" /> 
  </response>
  </interact>
- <interact event="onPlayerLeave" focus="0">
  <response text="Thanks for your help!" /> 
  </interact>
  </interaction>
  </npc>

This npc works 100%
 
Basicly, npc doesn't need a script. But:
Code:
    <voices interval="5000" chance="50">
        <voice sentence="I left the door unlocked! Run!" /> 
        <voice sentence="Ill be killed if your caught.." /> 
        <voice sentence="Do not forget the knife ive left for you!" /> 
    </voices>
Isn't supported by NPC.
 
Back
Top