• 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 [LUA] Help about doplayerAddItem

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hello, I want help with a function in lua. I got this line on my script:

LUA:
return v and getPlayerStorageValue(cid, v[3]) == -1 and doPlayerAddItem(cid, v[1], v[2] or 1) and setPlayerStorageValue(cid, v[3], 4)

Will add item v[1], v[2] or 1 in his backpack - I want remove this function doPlayerAddItem and transfer to a function that send the item v[1], v[2] or 1 to player balance.

Thanks, I hope you can understand my bad english, xd.
 
what is v[1] and v[2] and what do you mean with balance?

LUA:
local items = {
	[20] = {
		{2160, 2, 1234}
	},
	[45] = {
		{2160, 5, 12245}
	},
	[100] = {
		{2160, 10, 12245}
	},
	[150] = {
		{2160, 15, 12245}
	},
	[200] = {
		{2160, 200, 12245}
	}
}

function onAdvance(cid, skill, oldLevel, newLevel)
	local v = items[newLevel]
	return v and getPlayerStorageValue(cid, v[3]) == -1 and doPlayerAddItem(cid, v[1], v[2] or 1) and setPlayerStorageValue(cid, v[3], 4)
end

Fully script, I want make this script to deposit the money in his player balance and not get the money in his backpack, o.O
 
LUA:
return v and getPlayerStorageValue(cid, v[3]) == -1 and doPlayerSetBalance(cid, getPlayerBalance(cid)+((v[2] or 1)*10000)) and setPlayerStorageValue(cid, v[3], 4)

you're tightwad
 
Back
Top