• 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!

Solved Need help with some NPCS

Johnpugh1990

New Member
Joined
May 21, 2013
Messages
4
Reaction score
0
I need help with some NPCS i can see my banker in game on my ot and he works fine except when i try and deposit gold i get this error on my server..

[23/05/2013 17:45:06] [Warning - NpcScript::NpcScript] Can not load script: default.lua

and i also get this [23/05/2013 17:45:06] [Warning - NpcScript::NpcScript] Can not load script: default.lua

when i talk to my bank NPC in game and ask him deposit gold he ask how much id like to deposit and i tell him the amount and nothing happens then i look at my server log and i get this

[23/05/2013 17:46:52] Lua Script Error: [Npc interface]
[23/05/2013 17:46:52] data/npc/scripts/bank.lua:eek:nCreatureSay
[23/05/2013 17:46:52] data/npc/scripts/bank.lua:162: attempt to call global 'doPlayerDepositMoney' (a nil value)
[23/05/2013 17:46:52] stack traceback:
[23/05/2013 17:46:52] [C]: in function 'doPlayerDepositMoney'
[23/05/2013 17:46:52] data/npc/scripts/bank.lua:162: in function 'callback'
[23/05/2013 17:46:52] data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
[23/05/2013 17:46:52] data/npc/scripts/bank.lua:15: in function <data/npc/scripts/bank.lua:15>


and also i was looking around for a NPC that buys all loot i cant seem to find one though, if someone could please help me with this i would be forever grateful and give some repp++

oh also i am running TFS 9.6 using remers ME not sure which version.. thank you so much in advance
 
About the default.lua, look in the xml of the npc and make the directory like this.
XML:
script="data/npc/scripts/default.lua"
instead of this
XML:
script="default.lua"

Add this to global.lua for the missings functions of the bank.lua.
Lua:
function doPlayerWithdrawMoney(cid, amount)
	local balance = getPlayerBalance(cid)
	if(amount > balance or not doPlayerAddMoney(cid, amount)) then
		return false
	end
 
	doPlayerSetBalance(cid, balance - amount)
	return true
end
 
function doPlayerDepositMoney(cid, amount)
	if(not doPlayerRemoveMoney(cid, amount)) then
		return false
	end
 
	doPlayerSetBalance(cid, getPlayerBalance(cid) + amount)
	return true
end
 
Last edited:
Back
Top