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

Need some good scripter to help on script

Luciano

Member
Joined
Feb 18, 2010
Messages
998
Reaction score
24
I have this script:
Lua:
donationsword_id = 10016 -- Item to be sold
      custodonationsword_id = 5 -- Value
 
local name = getItemNameById(donationsword_id)
----- End Config -----
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if doPlayerRemoveItem(cid, 9970, 5) == TRUE then ------ change the 6527 to the id of the item you want to be removed from player and 200 = how many of this items the player will get removed
                local bag = doPlayerAddItem(cid, donationsword_id, 1)
                        doSendAnimatedText(fromPosition, "Wasted 5!", TEXTCOLOR_YELLOW)
                        doSendMagicEffect(fromPosition, math.random(10, 10) )
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have purchased a ".. name .." for ".. custodonationsword_id .." Buffary Coins.")
                  for i=1,1 do
                end
                else
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need ".. custodonationsword_id .." Buffary Coins for a ".. name ..".")
                end
        return FALSE
end
it is one switch, that when the player use it remove 5 items of id 9970, and add item X, and send player a message .
If player no have 5 items of id 9970, it says "You need 5 items of id 9970 to buy "itemname".
Actualy i need do over 20 switchs.
With this method, i need do 1 script for every one .
I need help to make those things, config idk,
like
[1] price = 5, prize = itemid, uniqueid = 1313
[2] price = 10, prize = itemid2, uniqueid 1314....
so on actions i put
itemid: switchid - script X
OH! and if possible put to "transform" the switch to its original position....

THanks on advance,
sincerely,
Luciano
 
Lua:
local t = {
-- [UID] = {item, cost}
	[1313] = {10016, 5},
	[1314] = {10016, 10},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k = t[item.uid]
	if doPlayerRemoveItem(cid, 9770, k[2]) then
		doPlayerAddItem(cid, k[1], 1)
		doSendAnimatedText(fromPosition, 'Wasted ' .. k[2] .. '!', TEXTCOLOR_YELLOW)
		doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
		doCreatureSay(cid, MESSAGE_INFO_DESCR, 'You have purchased ' .. getItemInfo(k[1]).article .. ' ' .. getItemInfo(k[1]).name .. ' for ' .. k[2] .. ' Buffary Coins.', TALKTYPE_ORANGE_1, false, cid)
	else
		doCreatureSay(cid, 'You need ' .. k[2] .. ' Buffary Coins for ' .. getItemInfo(k[1]).article .. ' ' .. getItemInfo(k[1]).name .. '.', TALKTYPE_ORANGE_1, false, cid)
		doSendMagicEffect(fromPosition, CONST_ME_POFF)
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
Lua:
local t = {
-- [UID] = {item, cost}
	[1313] = {10016, 5},
	[1314] = {10016, 10},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local k = t[item.uid]
	if doPlayerRemoveItem(cid, 9770, k[2]) then
		doPlayerAddItem(cid, k[1], 1)
		doSendAnimatedText(fromPosition, 'Wasted ' .. k[2] .. '!', TEXTCOLOR_YELLOW)
		doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
		doCreatureSay(cid, MESSAGE_INFO_DESCR, 'You have purchased ' .. getItemInfo(k[1]).article .. ' ' .. getItemInfo(k[1]).name .. ' for ' .. k[2] .. ' Buffary Coins.', TALKTYPE_ORANGE_1, false, cid)
	else
		doCreatureSay(cid, 'You need ' .. k[2] .. ' Buffary Coins for ' .. getItemInfo(k[1]).article .. ' ' .. getItemInfo(k[1]).name .. '.', TALKTYPE_ORANGE_1, false, cid)
		doSendMagicEffect(fromPosition, CONST_ME_POFF)
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end

thanks so much honey :)
i cant test it right now, im map tracking + searching for a stable 8.6 :f
Rep+++
 
Back
Top