Andrekkzie
New Member
- Joined
- Sep 12, 2010
- Messages
- 64
- Reaction score
- 2
I need a script for mines for example there are small stones and i can use a pick on them and when i use the pick on the stone i receive gold or somethings.
local t = {
chance = 25 -- 25%
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if itemEx.itemid == 1294 then
if t.chance <= math.random(1, 100) then
doPlayerAddItem(cid, 2148, math.random(1, 10))
doRemoveItem(itemEx.uid, 1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
else
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You can\'t mine this.')
end
return true
end
local t = {
chance = 25 -- 25%
}
if itemEx.itemid == 1294 then
if t.chance <= math.random(1, 100) then
doPlayerAddItem(cid, 2148, math.random(1, 10))
doRemoveItem(itemEx.uid, 1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
else
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
end
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You can\'t mine this.')
end