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

Lua Adding effects when buying!

Majeski20

New Member
Joined
Apr 21, 2008
Messages
602
Reaction score
4
Location
Sweden
Hi guys.
I got this script and wondering if somone could add some effect when buying, and maybe a text will come up so u see that u bought the item.
And dont give me another script, just the same as i got but changed , cuz this is the only script that are working :p

Thanks!

Code:
local Cost = 6000
local RuneId = 2268
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, Cost) == 1 then
backpack = doPlayerAddItem(cid, 2003, 1)
for i = 1, 20 do
doAddContainerItem(backpack, RuneId, 1)
end
else
doPlayerSendCancel(cid, 'You don\'t have enough money.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return 1
end
 
Code:
local t = {
	cost = 6000,
	backpack = 2003,
	itemid = 2268,
	charges = 3,
	effect = CONST_ME_GIFT_WRAPS
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doPlayerRemoveMoney(cid, t.cost) then
		local backpack = doPlayerAddItem(cid, t.backpack, 1)
		for i = 1, 20 do
			doAddContainerItem(backpack, t.itemid, t.charges)
		end
		doCreatureSay(cid, "You bought a backpack of " .. getItemInfo(t.itemid).plural .. " for " .. t.cost .. " gold", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
		doSendMagicEffect(getThingPos(cid), t.effect)
	else
		doPlayerSendCancel(cid, "You don't have enough money.")
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	end
	return true
end
 
Code:
local t = {
	cost = 6000,
	backpack = 2003,
	itemid = 2268,
	charges = 3,
	effect = CONST_ME_GIFT_WRAPS
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doPlayerRemoveMoney(cid, t.cost) then
		local backpack = doPlayerAddItem(cid, t.backpack, 1)
		for i = 1, 20 do
			doAddContainerItem(backpack, t.itemid, t.charges)
		end
		doCreatureSay(cid, "You bought a backpack of " .. getItemInfo(t.itemid).plural .. " for " .. t.cost .. " gold", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
		doSendMagicEffect(getThingPos(cid), t.effect)
	else
		doPlayerSendCancel(cid, "You don't have enough money.")
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	end
	return true
end
I just got the bp with sds, no effects, im using aries 0.4.0 8.1 so maybe make it more simple idk :p
 
Back
Top