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

Mining System

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.
 
just like there is a mine of dwarfs and there are like 6 sames small stones and with a pick i can use on the rock and get money
 
Lua:
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

If you have other stuff within your pick.lua, you should add this somewhere:

Lua:
	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
 
Last edited:
Back
Top