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

Level VIP

Stewie

Family Guy # ;3
Joined
May 3, 2010
Messages
786
Reaction score
12
Location
TV
I wanted to pull a lever and buy an item with coins VIP, so it would be 10 coins is the price of VIP sword,is simple but im not scripter.
I REP ++
 
so I do not know, I did everything right, most do not remove the coins do not purchase the item, but showed that he bought
 
found the error.
should work now.

Lua:
local t = {
	[1500] = {name='VIP Sword', count=1, itemid=8932, cost=7},
	[1501] = {name='VIP Axe', count=1, itemid=7435, cost=7},
	[1502] = {name='VIP Club', count=1, itemid=7450, cost=7},
	[1503] = {name='VIP Spear', count=1, itemid=2426, cost=7},
	[1504] = {name='VIP Wand', count=1, itemid=7958, cost=7},
	[1505] = {name='VIP Shield', count=1, itemid=7460, cost=7},
	[1506] = {name='VIP Helmet', count=1, itemid=7458, cost=7},
	[1507] = {name='VIP Armor', count=1, itemid=7463, cost=7},
	[1508] = {name='VIP Shorts', count=1, itemid=7464, cost=7},
	[1509] = {name='VIP Boots', count=1, itemid=7457, cost=7},
	[1510] = {name='Super Refinador', count=1, itemid=8300, cost=1}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i, r = 6527, t[item.uid]
	if r and (item.itemid == 1945 or item.itemid == 1946) then
		if getPlayerItemCount(cid, i) > r.cost then
			doPlayerGiveItem(cid, r.itemid, r.count)
			doPlayerRemoveItem(cid, i, r.count)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Voce comprou '.. r.name .. ' por '.. r.cost .. ' VIP coins.')
			return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
		else
			return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Voce n?o tem moedas VIP suficiente!')
		end
	end
end
 
OKOK, works now.
Aff,, stupit mistakes :s

Lua:
local t = {
	[1500] = {name='VIP Sword', count=1, itemid=8932, cost=7},
	[1501] = {name='VIP Axe', count=1, itemid=7435, cost=7},
	[1502] = {name='VIP Club', count=1, itemid=7450, cost=7},
	[1503] = {name='VIP Spear', count=1, itemid=2426, cost=7},
	[1504] = {name='VIP Wand', count=1, itemid=7958, cost=7},
	[1505] = {name='VIP Shield', count=1, itemid=7460, cost=7},
	[1506] = {name='VIP Helmet', count=1, itemid=7458, cost=7},
	[1507] = {name='VIP Armor', count=1, itemid=7463, cost=7},
	[1508] = {name='VIP Shorts', count=1, itemid=7464, cost=7},
	[1509] = {name='VIP Boots', count=1, itemid=7457, cost=7},
	[1510] = {name='Super Refinador', count=1, itemid=8300, cost=1}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i, r = 6527, t[item.uid]
	if r and (item.itemid == 1945 or item.itemid == 1946) then
		if getPlayerItemCount(cid, i) > r.cost then
			doPlayerGiveItem(cid, r.itemid, r.count)
			doPlayerRemoveItem(cid, i, r.cost)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Voce comprou '.. r.name .. ' por '.. r.cost .. ' VIP coins.')
			return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
		else
			return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Voce n?o tem moedas VIP suficiente!')
		end
	end
end
 
Code:
local t =  {
	[1500] = {name='VIP Sword', count=1, itemid=8932, cost=7},
	[1501] = {name='VIP Axe', count=1, itemid=7435, cost=7},
	[1502] = {name='VIP Club', count=1, itemid=7450, cost=7},
	[1503] = {name='VIP Spear', count=1, itemid=2426, cost=7},
	[1504] = {name='VIP Wand', count=1, itemid=7958, cost=7},
	[1505] = {name='VIP Shield', count=1, itemid=7460, cost=7},
	[1506] = {name='VIP Helmet', count=1, itemid=7458, cost=7},
	[1507] = {name='VIP Armor', count=1, itemid=7463, cost=7},
	[1508] = {name='VIP Shorts', count=1, itemid=7464, cost=7},
	[1509] = {name='VIP Boots', count=1, itemid=7457, cost=7},
	[1510] = {name='Super Refinador', count=1, itemid=8300, cost=1}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i, r = 6527, t[item.uid]
	if doPlayerRemoveItem(cid, i, r.cost) then
		doPlayerAddItem(cid, r.itemid, r.count)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você comprou '.. r.name .. ' por '.. r.cost .. ' VIP coins.')
		return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
	else
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você não tem moedas VIP suficiente!')
	end
end
ffs
 
Code:
local t =  {
	[1500] = {name='VIP Sword', count=1, itemid=8932, cost=7},
	[1501] = {name='VIP Axe', count=1, itemid=7435, cost=7},
	[1502] = {name='VIP Club', count=1, itemid=7450, cost=7},
	[1503] = {name='VIP Spear', count=1, itemid=2426, cost=7},
	[1504] = {name='VIP Wand', count=1, itemid=7958, cost=7},
	[1505] = {name='VIP Shield', count=1, itemid=7460, cost=7},
	[1506] = {name='VIP Helmet', count=1, itemid=7458, cost=7},
	[1507] = {name='VIP Armor', count=1, itemid=7463, cost=7},
	[1508] = {name='VIP Shorts', count=1, itemid=7464, cost=7},
	[1509] = {name='VIP Boots', count=1, itemid=7457, cost=7},
	[1510] = {name='Super Refinador', count=1, itemid=8300, cost=1}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i, r = 6527, t[item.uid]
	if doPlayerRemoveItem(cid, i, r.cost) then
		doPlayerAddItem(cid, r.itemid, r.count)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você comprou '.. r.name .. ' por '.. r.cost .. ' VIP coins.')
		return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
	else
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Você não tem moedas VIP suficiente!')
	end
end
ffs

same fix ;<
 
Last edited:
I actually fixed it before cyko
GoddomotFronk.jpg


NO, you edited your post
 
Back
Top