• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

MainItem

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
The random part of my script don't are working:
Code:
			---by BomBa---
			--------------

function onStepOut(cid, item, position, fromPosition)
	if getPlayerStorageValue(cid, 60010) == -1 then
	if getPlayerVocation(cid) == 1 then
	   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Wand of Vortex.")
	   doPlayerAddItem(cid, 2190, 1)
	   setPlayerStorageValue(cid, 60010, 1)
	 elseif getPlayerVocation(cid) == 2 then
	   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Snakebite rod.")
	   doPlayerAddItem(cid, 2182, 1)
	   setPlayerStorageValue(cid, 60010, 1)
	 elseif getPlayerVocation(cid) == 3 then
	   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Spear.")
	   doPlayerAddItem(cid, 2389, 3)
	   setPlayerStorageValue(cid, 60010, 1)
	 elseif getPlayerVocation(cid) == 4 then
	if math.random(1, 3) == 1 then
	   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Steel Axe.")
	   doPlayerAddItem(cid, 8601, 1)
	   setPlayerStorageValue(cid, 60010, 1)
	 elseif math.random(1, 3) == 2 then
	   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Jagged Sword.")
	   doPlayerAddItem(cid, 8602, 1)
	   setPlayerStorageValue(cid, 60010, 1)
	 elseif math.random(1, 3) == 3 then
	   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Daramanian Mace.")
	   doPlayerAddItem(cid, 2439, 1)
	   setPlayerStorageValue(cid, 60010, 1)
   end
  end
 end
   return TRUE
end
 
Code:
    local rand = math.random(1, 3)
    if rand == 1 then
        --oi
    elseif rand == 2 then
        --xau
    elseif rand == 3 then
        --pqp
    else
        --q
    end
 
The random part of my script don't are working:
Code:
            ---by BomBa---
            --------------

function onStepOut(cid, item, position, fromPosition)
    if getPlayerStorageValue(cid, 60010) == -1 then
    if getPlayerVocation(cid) == 1 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Wand of Vortex.")
       doPlayerAddItem(cid, 2190, 1)
       setPlayerStorageValue(cid, 60010, 1)
     elseif getPlayerVocation(cid) == 2 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Snakebite rod.")
       doPlayerAddItem(cid, 2182, 1)
       setPlayerStorageValue(cid, 60010, 1)
     elseif getPlayerVocation(cid) == 3 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Spear.")
       doPlayerAddItem(cid, 2389, 3)
       setPlayerStorageValue(cid, 60010, 1)
     elseif getPlayerVocation(cid) == 4 then
    if math.random(1, 3) == 1 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Steel Axe.")
       doPlayerAddItem(cid, 8601, 1)
       setPlayerStorageValue(cid, 60010, 1)
     elseif math.random(1, 3) == 2 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Jagged Sword.")
       doPlayerAddItem(cid, 8602, 1)
       setPlayerStorageValue(cid, 60010, 1)
     elseif math.random(1, 3) == 3 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Daramanian Mace.")
       doPlayerAddItem(cid, 2439, 1)
       setPlayerStorageValue(cid, 60010, 1)
   end
  end
 end
   return TRUE
end

Code:
 if math.random(1, 3) == 1 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Steel Axe.")
       doPlayerAddItem(cid, 8601, 1)
       setPlayerStorageValue(cid, 60010, 1)
     elseif math.random(1, 3) == 2 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Jagged Sword.")
       doPlayerAddItem(cid, 8602, 1)
       setPlayerStorageValue(cid, 60010, 1)
     elseif math.random(1, 3) == 3 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Daramanian Mace.")
       doPlayerAddItem(cid, 2439, 1)
       setPlayerStorageValue(cid, 60010, 1)
   end
change this part to
Code:
local random = math.random(1, 3)
 if random == 1 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Steel Axe.")
        doPlayerAddItem(cid, 8601, 1)
        setPlayerStorageValue(cid, 60010, 1)
      elseif random == 2 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Jagged Sword.")
        doPlayerAddItem(cid, 8602, 1)
        setPlayerStorageValue(cid, 60010, 1)
      elseif radom == 3 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Daramanian Mace.")
        doPlayerAddItem(cid, 2439, 1)
        setPlayerStorageValue(cid, 60010, 1)
    end
not tested..
 
Back
Top