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

[Actions] request lever script.

YugiNao

Banned User
Joined
Nov 22, 2008
Messages
211
Reaction score
3
Need a lever shop script, when player pull lever example: You bought 5 pirate voodoo doll, 5 voodoo doll, 1 mandraken and i want that with all all addons items as exact the recipe is from the Addon npc, i assume you know the recipes for all addons? Else request me to post the addon recipes.
 
Try this

Code:
local t = {
	[100] = {id=1,price=1,count=1}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local l,lt = 1945,1946
	local r = t[item.actionid]
	if item.itemid == l then
		if t then
			if doPlayerRemoveMoney(cid,t.price) then
				doPlayerGiveItem(cid,t.id,t.count)
				doPlayerSendTextMessage(cid,19,'You have bought '..getItemNameById(t.id)..'for '..t.price..'gold.')
				doTransformItem(item.uid,lever+1)
			else
				doPlayerSendTextMessage(cid,19,'You don\'t have enough money!')
			end
		end
	elseif item.itemid == lt then
		doTransformItem(item.uid,l)
	end
	return true
end
 
Try this

Code:
[B][COLOR="Red"]local t = {
	[100] = {id=1,price=1,count=1}
}[/COLOR][/B]

function onUse(cid, item, fromPosition, itemEx, toPosition)
local l,lt = 1945,1946
	[B][COLOR="Blue"]local r = t[item.actionid][/COLOR][/B]
	if item.itemid == l then
		[B][COLOR="Red"]if t then[/COLOR][/B]
			if doPlayerRemoveMoney(cid,t.price) then
				doPlayerGiveItem(cid,t.id,t.count)
				doPlayerSendTextMessage(cid,19,'You have bought '..getItemNameById(t.id)..'for '..t.price..'gold.')
				doTransformItem(item.uid,lever+1)
			else
				doPlayerSendTextMessage(cid,19,'You don\'t have enough money!')
			end
		end
	elseif item.itemid == lt then
		doTransformItem(item.uid,l)
	end
	return true
end
bugas :S
 
easy fix, lol

Code:
local t = {
	[100] = {id=1,price=1,count=1}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local l,lt = 1945,1946
	local r = t[item.actionid]
	if item.itemid == l then
		if r then
			if doPlayerRemoveMoney(cid,r.price) then
				doPlayerGiveItem(cid,r.id,r.count)
				doPlayerSendTextMessage(cid,19,'You have bought '..getItemNameById(r.id)..'for '..r.price..'gold.')
				doTransformItem(item.uid,lt)
			else
				doPlayerSendTextMessage(cid,19,'You don\'t have enough money!')
			end
		end
	elseif item.itemid == lt then
		doTransformItem(item.uid,l)
	end
	return true
end

btw, where are you from, existance?
 
Back
Top