local rand = math.random(2)
if rand == 1 then
doPlayerAddItem(cid, 2684, 1, true)
else
doCreateMonster("rabbit", toPosition)
end
Normally I'd ask for your shovel script..
Normally I'd also ask if you need an ActionID on the tile..
Normally I'd wait..
But today my good sir, I'm not going to create a script.
Today, my good sir, I'm going to give you a small piece of code that will work.
Today, you could have a script that works, but only if you use the small peices of information that I have provided for you.
Today you get to solve your very own puzzle.
Today you get to see how annoyed I get when people don't give enough information to do their requests.
Today, I want you to look at the first two lines I wrote.
They will be the 100% require clues to finish your request.
Lua:local rand = math.random(2) if rand == 1 then doPlayerAddItem(cid, 2684, 1, true) else doCreateMonster("rabbit", toPosition) end
A good comeback.How about tomorrow?
Today, I want you to look at the first two lines I wrote.
They will be the 100% require clues to finish your request.
Normally I'd ask for your shovel script..
Normally I'd also ask if you need an ActionID on the tile..
A good comeback.
I'm not singling you out.
It's just frustrating seeing a lot of threads without the proper information.
On that note though..
local holes = {468, 481, 483, 7932, 8579}
local sand = {231, 9059}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(isInArray(holes, itemEx.itemid)) then
local newId = itemEx.itemid + 1
if(itemEx.itemid == 8579) then
newId = 8585
end
doTransformItem(itemEx.uid, newId)
doDecayItem(itemEx.uid)
elseif(isInArray(sand, itemEx.itemid)) then
local rand = math.random(1, 10000)
if(itemEx.actionid == 100 and rand <= 2) then
doTransformItem(itemEx.uid, 489)
doDecayItem(itemEx.uid)
elseif(rand <= 1000) then
doCreateItem(2152, 1, toPosition)
elseif(rand <= 2000) then
doCreateMonster("Scarab", toPosition, false)
elseif(rand <= 200) then
doCreateMonster("Ancient Scarab", toPosition, false)
elseif(rand <= 100) then
doCreateMonster("Ancient Mummy", toPosition, false)
elseif(rand <= 40) then
doCreateMonster("Desert Scorpion", toPosition, false)
elseif(rand <= 10) then
doCreateMonster("Pro Banshee", toPosition, false)
end
doSendMagicEffect(toPosition, CONST_ME_POFF)
end
return true
end
Why don't you make the script yourself? Just take first scarab coin / scarab digging script, change item and monster, then associate it with ground ID. Simple, isn't it? In case only specific tiles should work this way, adda a check for actionID (and assign the action ID on your map of course)
Its a laugh
Yeah you can put what ever action id dont have one. I was just wondering if its possible.
Shovel script is :
--lua
local holes = {468, 481, 483, 7932, 8579}
local sand = {231, 9059}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(isInArray(holes, itemEx.itemid)) then
local newId = itemEx.itemid + 1
if(itemEx.itemid == 8579) then
newId = 8585
end
doTransformItem(itemEx.uid, newId)
doDecayItem(itemEx.uid)
elseif(isInArray(sand, itemEx.itemid)) then
local rand = math.random(1, 10000)
if(itemEx.actionid == 100 and rand <= 2) then
doTransformItem(itemEx.uid, 489)
doDecayItem(itemEx.uid)
elseif(rand <= 1000) then
doCreateItem(2152, 1, toPosition)
elseif(rand <= 2000) then
doCreateMonster("Scarab", toPosition, false)
elseif(rand <= 200) then
doCreateMonster("Ancient Scarab", toPosition, false)
elseif(rand <= 100) then
doCreateMonster("Ancient Mummy", toPosition, false)
elseif(rand <= 40) then
doCreateMonster("Desert Scorpion", toPosition, false)
elseif(rand <= 10) then
doCreateMonster("Pro Banshee", toPosition, false)
end
doSendMagicEffect(toPosition, CONST_ME_POFF)
end
return true
end
--lua
Its a laugh
Yeah you can put what ever action id dont have one. I was just wondering if its possible.
Shovel script is :
Lua:local holes = {468, 481, 483, 7932, 8579} local sand = {231, 9059} function onUse(cid, item, fromPosition, itemEx, toPosition) if(isInArray(holes, itemEx.itemid)) then local newId = itemEx.itemid + 1 if(itemEx.itemid == 8579) then newId = 8585 end doTransformItem(itemEx.uid, newId) doDecayItem(itemEx.uid) elseif(isInArray(sand, itemEx.itemid)) then local rand = math.random(1, 10000) if(itemEx.actionid == 100 and rand <= 2) then doTransformItem(itemEx.uid, 489) doDecayItem(itemEx.uid) elseif(rand <= 1000) then doCreateItem(2152, 1, toPosition) elseif(rand <= 2000) then doCreateMonster("Scarab", toPosition, false) elseif(rand <= 200) then doCreateMonster("Ancient Scarab", toPosition, false) elseif(rand <= 100) then doCreateMonster("Ancient Mummy", toPosition, false) elseif(rand <= 40) then doCreateMonster("Desert Scorpion", toPosition, false) elseif(rand <= 10) then doCreateMonster("Pro Banshee", toPosition, false) end doSendMagicEffect(toPosition, CONST_ME_POFF) end return true end
local holes = {468, 481, 483, 7932, 8579}
local sand = {231, 9059}
local carrot_dirt = {103}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(isInArray(holes, itemEx.itemid)) then
local newId = itemEx.itemid + 1
if(itemEx.itemid == 8579) then
newId = 8585
end
doTransformItem(itemEx.uid, newId)
doDecayItem(itemEx.uid)
elseif(isInArray(sand, itemEx.itemid)) then
local rand = math.random(1, 10000)
if(itemEx.actionid == 100 and rand <= 2) then
doTransformItem(itemEx.uid, 489)
doDecayItem(itemEx.uid)
elseif(rand <= 1000) then
doCreateItem(2152, 1, toPosition)
elseif(rand <= 2000) then
doCreateMonster("Scarab", toPosition, false)
elseif(rand <= 200) then
doCreateMonster("Ancient Scarab", toPosition, false)
elseif(rand <= 100) then
doCreateMonster("Ancient Mummy", toPosition, false)
elseif(rand <= 40) then
doCreateMonster("Desert Scorpion", toPosition, false)
elseif(rand <= 10) then
doCreateMonster("Pro Banshee", toPosition, false)
end
doSendMagicEffect(toPosition, CONST_ME_POFF)
elseif isInArray(carrot_dirt, itemEx.itemid) then
local rand = math.random(2)
if rand == 1 then
doCreateItem(2684, 1, toPosition)
else
doCreateMonster("rabbit", toPosition)
end
end
return true
end
Its a laugh
Yeah you can put what ever action id dont have one. I was just wondering if its possible.
Shovel script is :
Lua:local holes = {468, 481, 483, 7932, 8579} local sand = {231, 9059} function onUse(cid, item, fromPosition, itemEx, toPosition) if(isInArray(holes, itemEx.itemid)) then local newId = itemEx.itemid + 1 if(itemEx.itemid == 8579) then newId = 8585 end doTransformItem(itemEx.uid, newId) doDecayItem(itemEx.uid) elseif(isInArray(sand, itemEx.itemid)) then local rand = math.random(1, 10000) if(itemEx.actionid == 100 and rand <= 2) then doTransformItem(itemEx.uid, 489) doDecayItem(itemEx.uid) elseif(rand <= 1000) then doCreateItem(2152, 1, toPosition) elseif(rand <= 2000) then doCreateMonster("Scarab", toPosition, false) elseif(rand <= 200) then doCreateMonster("Ancient Scarab", toPosition, false) elseif(rand <= 100) then doCreateMonster("Ancient Mummy", toPosition, false) elseif(rand <= 40) then doCreateMonster("Desert Scorpion", toPosition, false) elseif(rand <= 10) then doCreateMonster("Pro Banshee", toPosition, false) end doSendMagicEffect(toPosition, CONST_ME_POFF) end return true end
Lua:local holes = {468, 481, 483, 7932, 8579} local sand = {231, 9059} local carrot_dirt = {103} function onUse(cid, item, fromPosition, itemEx, toPosition) if(isInArray(holes, itemEx.itemid)) then local newId = itemEx.itemid + 1 if(itemEx.itemid == 8579) then newId = 8585 end doTransformItem(itemEx.uid, newId) doDecayItem(itemEx.uid) elseif(isInArray(sand, itemEx.itemid)) then local rand = math.random(1, 10000) if(itemEx.actionid == 100 and rand <= 2) then doTransformItem(itemEx.uid, 489) doDecayItem(itemEx.uid) elseif(rand <= 1000) then doCreateItem(2152, 1, toPosition) elseif(rand <= 2000) then doCreateMonster("Scarab", toPosition, false) elseif(rand <= 200) then doCreateMonster("Ancient Scarab", toPosition, false) elseif(rand <= 100) then doCreateMonster("Ancient Mummy", toPosition, false) elseif(rand <= 40) then doCreateMonster("Desert Scorpion", toPosition, false) elseif(rand <= 10) then doCreateMonster("Pro Banshee", toPosition, false) end doSendMagicEffect(toPosition, CONST_ME_POFF) elseif isInArray(carrot_dirt, itemEx.itemid) then local rand = math.random(2) if rand == 1 then doCreateItem(2684, 1, toPosition) else doCreateMonster("rabbit", toPosition) end end return true end