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

Advanced Lottery Item

Zarabustor

Human Being
Joined
Sep 10, 2009
Messages
186
Reaction score
0
Location
Cancun, Mexico
Code:
local PRESENT_RED = {7417, 7423, 7388, 7865, 7880, 11296, 11295, 6433, 11298, 11297, 9653, 8907, 8878, 7730, 7892, 9662, 2196, 8300,2275,2300,11257,5785,2663,8854,7365}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local count = 1
	if(item.itemid == 9003) then
		local randomChance = math.random(1, #PRESENT_RED)
		if(randomChance == 1) then
			count = 10
		elseif(randomChance == 2) then
			count = 3
				end
    doBroadcastMessage("" .. getCreatureName(cid) .. " is very lucky he won a ", MESSAGE_EVENT_ADVANCE)
		doPlayerAddItem(cid, PRESENT_RED[randomChance], count)
end
	doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
	doRemoveItem(item.uid, 1)
	return true
end

Help me with this script please i want that when you use the item your name get broadcast like "Cykotitan is very lucky to win a "forever aol" from lottery bird.

if is a good item it will be boradcast,(will be about 8 good items) ONLY IF IS ONE OF THE 8 GOOD ITEMS IT WILL BE BROADCAST!

Ty I hope you help me
ILL REP++
 
Code:
local PRESENT_RED = {7417, 7423, 7388, 7865, 7880, 11296, 11295, 6433, 11298, 11297, 9653, 8907, 8878, 7730, 7892, 9662, 2196, 8300,2275,2300,11257,5785,2663,8854,7365}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local count = 1
	if(item.itemid == 9003) then
		local randomChance = math.random(1, #PRESENT_RED)
		if(randomChance == 1) then
			count = 10
		elseif(randomChance == 2) then
			count = 3
		end
		doBroadcastMessage("" .. getCreatureName(cid) .. " is very lucky he won a ", MESSAGE_EVENT_ADVANCE)
		doPlayerAddItem(cid, PRESENT_RED[randomChance], count)
		doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
		doRemoveItem(item.uid, 1)
	end
	return true
end
 
Code:
local ITEMS = {7417, 7423, 7388, 7865, 7880, 11296, 11295, 6433, 11298, 11297, 9653, 8907, 8878, 7730, 7892, 9662, 2196, 8300,2275,2300,11257,5785,2663,8854,7365}
local GOOD_ITEMS = {}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local rand = math.random(1, #ITEMS)
	if isInArray(GOOD_ITEMS, ITEMS[rand]) then
		doBroadcastMessage(getCreatureName(cid) .. " is very lucky to win " .. getItemInfo(ITEMS[rand]).article .. " " .. getItemInfo(ITEMS[rand]).name .. " from a lottery bird.", MESSAGE_EVENT_ADVANCE)
	end
	doPlayerAddItem(cid, ITEMS[rand], rand == 1 and 10 or rand == 2 and 3 or 1)
	doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
	doRemoveItem(item.uid)
	return true
end
 
Code:
local PRESENT_RED = {7417, 7423, 7388, 7865, 7880, 11296, 11295, 6433, 11298, 11297, 9653, 8907, 8878, 7730, 7892, 9662, 2196, 8300,2275,2300,11257,5785,2663,8854,7365}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local count = 1
	if(item.itemid == 9003) then
		local randomChance = math.random(1, #PRESENT_RED)
		if(randomChance == 1) then
			count = 10
		elseif(randomChance == 2) then
			count = 3
		end
		doBroadcastMessage("" .. getCreatureName(cid) .. " is very lucky he won a ", MESSAGE_EVENT_ADVANCE)
		doPlayerAddItem(cid, PRESENT_RED[randomChance], count)
		doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
		doRemoveItem(item.uid, 1)
	end
	return true
end

Is that the same script i posted? :/
 
Back
Top