• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Lotery Ticket with Achievement 100%

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
XML:
	<action itemid="5957" event="script" value="loteryticket.lua"/>

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)

        if getPlayerStorageValue(cid,21026) == 500 then
        doPlayerSendTextMessage(cid,22,"Congratulations! You earned the achievement \"Jinx\".")
        setPlayerStorageValue(cid, 20026)
        end


local rand = math.random(0, 10)
local lotteryid = 5957

  if item.itemid == lotteryid then
    if rand < 1 then
  		doCreatureSay(cid, "You have a winning lottery ticket!", TALKTYPE_ORANGE_1)
      doTransformItem(item.uid, item.itemid + 1)
   	setPlayerStorageValue(cid, 21026, getCreatureStorage(cid, 21026) + 1)
doSendMagicEffect(fromPosition,12)
    elseif rand > 2 then
      doCreatureSay(cid, "Sorry, This is not a winning lottery ticket.", TALKTYPE_ORANGE_1)
      doTransformItem(item.uid, item.itemid - 1)
   	setPlayerStorageValue(cid, 21026, getCreatureStorage(cid, 21026) + 1)
    end
  end
return TRUE
end

-------------------------
repp++
 
Back
Top