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

Use item - get premium points, use item - get random item from sms shop. Rep+

beybus

New Member
Joined
Oct 2, 2010
Messages
110
Reaction score
2
As topic said.
Need someone to make scripts like this for me.
U loot for ex. some kind of jewellery, use it, it dissappears, and u get 100 premium points, u loot other item, use it, it dissappears - u get item from id ex. '2222-2225' randomly.
I will be grateful and rep+.
 
do you mean you want the players to loot itemid=x count=x if they got that they use on itemid that have count=x and they get 100 premium points?
 
Yea, thats exactly this.
Let's take for example life crystal. They loot life crystal, use it (crystal disappears) and they get 100 premium points.
Second thing, they loot for ex. small ruby, use it, it disappears and change to random item from sms shop. (random item from few id's)
 
anyway ok im going to post the first script of life crystal which will give you 100 premium points when you click on it or use it
1) go to actions\actions.xml add
XML:
<action itemid="7315" event="script" value="lifecrystalpoints.lua"/>
2)go to actions\scripts and create file lifecrystalpoints.lua
Code:
local cfg = 
{
    points = 100,
    effect = 27
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) == FALSE then
		return FALSE
	end
 
    db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. cfg.points .. " WHERE `name` = '" .. getAccountByName(getCreatureName(itemEx.uid)) .. "' LIMIT 1;")
    doCreatureSay(cid, "You have received " .. cfg.points .. " premium points!", TALKTYPE_ORANGE_1, false, nil, toPosition)
    doSendMagicEffect(toPosition, cfg.effect)
    doRemoveItem(item.uid,1)
    return true
end
 
Lua:
local ids = {123,1234,12345}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doPlayerAddItem(cid, ids[math.random(#ids)], 1)
	doCreatureSay(cid, "????????", TALKTYPE_ORANGE_1, cid)
	doRemoveItem(item.uid, 1)
	return true
end
 
Back
Top