• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[request]How to make a NPC check the if the player has pz/battle before talking?

christiandb

Member
Joined
Feb 5, 2008
Messages
2,469
Reaction score
5
Location
010
As the title says, how to make a NPC check the pz/battle sign of a player before talking to him? I really need this because there are people abusing the boat NPC's.

Thanks in advance,

Chris
 
data/npc/lib/npcsystem/modules.lua
Change this (starting form line 160):
Code:
			if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then
				npcHandler:say('You must reach level ' .. parameters.level .. ' before I can let you go there.', cid)
			elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
				npcHandler:say('You do not have enough money!', cid)
			else
				doTeleportThing(cid, parameters.destination, 0)
				doSendMagicEffect(parameters.destination, 10)
			end
to
Code:
			if(parameters.level ~= nil and getPlayerLevel(cid) < parameters.level) then
				npcHandler:say('You must reach level ' .. parameters.level .. ' before I can let you go there.', cid)
			elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
				npcHandler:say('You do not have enough money!', cid)
			elseif(isPlayerPzLocked(cid) ~= FALSE) then
				npcHandler:say('You are pz-locked, come back later!', cid)
			else
				doTeleportThing(cid, parameters.destination, 0)
				doSendMagicEffect(parameters.destination, 10)
			end
 
[21/12/2008 17:53:19] Lua Script Error: [Npc interface]
[21/12/2008 17:53:19] data/npc/scripts/boat_ankrahmun.lua:onCreatureSay

[21/12/2008 17:53:19] data/npc/lib/npcsystem/modules.lua:164: attempt to call global 'isPlayerPzLocked' (a nil value)
[21/12/2008 17:53:19] stack traceback:
[21/12/2008 17:53:19] data/npc/lib/npcsystem/modules.lua:164: in function 'callback'
[21/12/2008 17:53:19] data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
[21/12/2008 17:53:19] data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
[21/12/2008 17:53:19] data/npc/lib/npcsystem/keywordhandler.lua:122: in function 'processMessage'
[21/12/2008 17:53:19] data/npc/lib/npcsystem/npchandler.lua:371: in function 'onCreatureSay'
[21/12/2008 17:53:19] data/npc/scripts/boat_ankrahmun.lua:10: in function <data/npc/scripts/boat_ankrahmun
help :(? im using tfs 0.2 patch 21 :]
 
Back
Top