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

Lamp_Djinns

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
PHP:
local itemPos = {x = 1707, y = 1534, z = 7}
local creaturePos = {x = 1718, y = 1532, z = 6}
local playerPos = {x = 1707, y = 1535, z = 7}

function onUse(cid, item, frompos, item2, topos)
  ran = math.random(1, 4)
        
	if ran == 1 then
		doSummonCreature("daemon", creaturePos)
		doSendMagicEffect(playerPos,CONST_ME_MORTAREA)
		doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY)
		doRemoveItem(item.uid, itemPos, 1)

        elseif ran == 2 then
		doSummonCreature("fridy", creaturePos)
		doSendMagicEffect(playerPos,CONST_ME_MORTAREA)
		doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY)
		doRemoveItem(item.uid, itemPos, 1)

        elseif ran == 3 then
		doSummonCreature("geniuns", creaturePos)
		doSendMagicEffect(playerPos,CONST_ME_MORTAREA)
		doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY)
		doRemoveItem(item.uid, itemPos, 1)

        elseif ran == 4 then
		doSummonCreature("simsalabim", creaturePos)
		doSendMagicEffect(playerPos,CONST_ME_MORTAREA)
		doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY)
		doRemoveItem(item.uid, itemPos, 1)
         end
return 1
end

Don't are working.
 
Edit:
PHP:
local itemPos = {x = 1707, y = 1534, z = 7}
local creaturePos = {x = 1718, y = 1532, z = 6}
local playerPos = getPlayerPosition(cid, {x = 1707, y = 1535, z = 7})

function onUse(cid, item, frompos, item2, topos)
  ran = math.random(1, 4)
        
	if ran == 1 then
		doSummonCreature("daemon", creaturePos)
		doSendMagicEffect(playerPos,CONST_ME_MORTAREA)
		doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY)
		doRemoveItem(item.uid, itemPos, 1)

        elseif ran == 2 then
		doSummonCreature("fridy", creaturePos)
		doSendMagicEffect(playerPos,CONST_ME_MORTAREA)
		doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY)
		doRemoveItem(item.uid, itemPos, 1)

        elseif ran == 3 then
		doSummonCreature("geniuns", creaturePos)
		doSendMagicEffect(playerPos,CONST_ME_MORTAREA)
		doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY)
		doRemoveItem(item.uid, itemPos, 1)

        elseif ran == 4 then
		doSummonCreature("simsalabim", creaturePos)
		doSendMagicEffect(playerPos,CONST_ME_MORTAREA)
		doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY)
		doRemoveItem(item.uid, itemPos, 1)
         end
return 1
end
 
PHP:
local itemPos = {x = 1707, y = 1534, z = 7} 
local creaturePos = {x = 1718, y = 1532, z = 6} 
function onUse(cid, item, frompos, item2, topos) 
    local ran = math.random(1, 4) 
    local playerPos = getPlayerPosition(cid)
    if ran == 1 then 
        doSummonCreature("daemon", creaturePos) 
        doSendMagicEffect(playerPos,CONST_ME_MORTAREA) 
        doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY) 
        doRemoveItem(item.uid, itemPos, 1) 

        elseif ran == 2 then 
        doSummonCreature("fridy", creaturePos) 
        doSendMagicEffect(playerPos,CONST_ME_MORTAREA) 
        doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY) 
        doRemoveItem(item.uid, itemPos, 1) 

        elseif ran == 3 then 
        doSummonCreature("geniuns", creaturePos) 
        doSendMagicEffect(playerPos,CONST_ME_MORTAREA) 
        doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY) 
        doRemoveItem(item.uid, itemPos, 1) 

        elseif ran == 4 then 
        doSummonCreature("simsalabim", creaturePos) 
        doSendMagicEffect(playerPos,CONST_ME_MORTAREA) 
        doSendMagicEffect(creaturePos,CONST_ME_LOSEENERGY) 
        doRemoveItem(item.uid, itemPos, 1) 
         end 
return 1 
end
 
Back
Top