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

Npc Add Storage Line Problem

Angel Of Death

Rise Of Tibia ServerOwner
Joined
Mar 12, 2012
Messages
91
Reaction score
0
LUA:
	elseif msgcontains(msg, "learn skill") then
		if(doPlayerRemoveMoney(cid, 5000) == true) then
		if getPlayerStorageValue(cid,storage) < 0 then
		doPlayersetPlayerStorageValue(cid, 60010, 1)

how do i do this properly
 
LUA:
	elseif msgcontains(msg, "learn skill") then
		if(doPlayerRemoveMoney(cid, 5000) == true) then
		if getPlayerStorageValue(cid,storage) < 0 then
		doPlayersetPlayerStorageValue(cid, 60010, 1)

how do i do this properly

Change that code to this one:
LUA:
 elseif msgcontains(msg, "learn skill") then
		if(doPlayerRemoveMoney(cid, 5000) == true) then
		if getPlayerStorageValue(cid,storage) < 0 then
		setPlayerStorageValue(cid, 60010, 1)

Hope it helps :D

---EDIT

BTW, I would even change it to this:
LUA:
 elseif msgcontains(msg, "learn skill") then
		if(doPlayerRemoveMoney(cid, 5000) == true) and  getPlayerStorageValue(cid,storage) < 0 then
		setPlayerStorageValue(cid, 60010, 1)
because of 2 reasons:
1- Remove "if's"
2- The way the script was written, the NPC would remove the player money even if he had the storage value, and this way it will not happen =p
 
Back
Top