• 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 and woodcutting problem

Zolax

New Member
Joined
Feb 16, 2011
Messages
97
Reaction score
1
Hello im using avesta 7.6 distro and when im trying to use mining:
Code:
--By:Cykotitan   Improvised Version--
local config = {
	stones = {1285, 1356, 1357, 1358, 1359, 3608, 3615, 3607, 3609, 3616, 3666, 3667, 3668, 3670, 1295, 1290},
	level = 20,
	skill = SKILL_CLUB,
	skillReq = 15,
	effect = CONST_ME_BLOCKHIT,
	addTries = 3,
	debris = 1336,
	msgType = 11,
	soul = 5
}
local t = {
	[{1, 100}] = {msg = "Oh no, you missed and picked a hole in the ground and a rat came out of it!", summon = "Rat"},
	[{101, 200}] = {msg = "You found %A %N.", item = 2157, amountmax = 5},
	[{201, 300}] = {msg = "You found %A %N.", item = 2145, amountmax = 5},
	[{301, 400}] = {msg = "You found %A %N.", item = 2225},
	[{401, 500}] = {msg = "You found %A %N.", item = 2148, amountmax = 100},
	[{501, 600}] = {msg = "You found %A %N.", item = 2146, amountmax = 5},
	[{601, 700}] = {msg = "You found %A %N.", item = 2149, amountmax = 5},
	[{701, 800}] = {msg = "You found %A %N.", item = 2150, amountmax = 3},
	[{1001, 1100}] = {msg = "You found %A %N.", item = 2147, amountmax = 2},
	[{1101, 1200}] = {msg = "You found %A %N.", item = 2143, amountmax = 4},
	[{1201, 1300}] = {msg = "You found %A %N.", item = 2144, amountmax = 5},
	[{1301, 1400}] = {msg = "An angry dwarf came out of the rock piles!", summon = "Dwarf"},
	[{1401, 1500}] = {msg = "A badger got unstuck and it looks angry!", summon = "Badger"},
	[{1501, 1600}] = {msg = "A rotworm came from a hole you made on the ground!", summon = "Rotworm"},
	[{1701, 1800}] = {msg = "A weak troll has appeared from the pile of rocks!", summon = "Troll"},
	[{1801, 1900}] = {msg = "Woah! A skeleton just appeared from the pile of rocks!", summon = "Skeleton"},
	[{1901, 2000}] = {msg = "Your pick has been heavily damaged and it broke...", destroy = true}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray(config.stones, itemEx.itemid) and config.level <= getPlayerLevel(cid) and config.skillReq <= getPlayerSkill(cid, config.skill) and config.soul <= getPlayerSoul(cid) then
		local v, amount, damage = math.random(2000), 1, nil
		for i, k in pairs(t) do
			if v >= i[1] and v <= i[2] then
				if k.destroy then
					doRemoveItem(item.uid)
				end
				if k.summon then
					doSummonCreature(k.summon, toPosition)
				end
				if k.item then
					if k.amountmax then
						amount = math.random(k.amountmax)
					end
					doPlayerAddItem(cid, k.item, amount)
				end
				if k.msg then
					local msg = k.msg
					if msg:find("%%") then
						if msg:find("%%A") and k.item then
							msg = msg:gsub("%%A", amount > 1 and amount or getItemDescriptions(k.item))
						end
						if msg:find("%%N") and k.item then
							msg = msg:gsub("%%N", amount > 1 and getItemDescriptions(k.item).plural or getItemName(k.item))
						end
						if msg:find("%%D") and damage then
							msg = msg:gsub("%%D", damage)
						end
					end
					doPlayerSendTextMessage(cid, config.msgType, msg)
				end
				doTransformItem(itemEx.uid, config.debris)
				doPlayerAddSoul(cid, -config.soul)
				doSendMagicEffect(toPosition,config.effect)
				doPlayerAddSkillTry(cid, config.skill, config.addTries)
				return true
			end
		end
		
	end
	
	return	doPlayerSendCancel(cid, "You either aren't experienced, skilled or don't have enough soul, or this isn't a breakable rock.")
	
end
and woodcutting scripts:
Code:
local config = {
	trees = {2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2712,2717,2718,2720,2722},
	t = {
		[{1, 100}] = {tree = 2701},
		[{101, 200}] = {tree = 2702},
		[{201, 300}] = {tree = 2703},
		[{301, 400}] = {tree = 2704},
		[{401, 500}] = {tree = 2705},
		[{501, 600}] = {tree = 2706},
		[{601, 700}] = {tree = 2707},
		[{701, 800}] = {tree = 2708},
		[{801, 900}] = {tree = 2709},
		[{901, 1000}] = {tree = 2710},
		[{1001, 1100}] = {tree = 2712},
		[{1101, 1200}] = {tree = 2717},
		[{1201, 1300}] = {tree = 2718},
		[{1301, 1400}] = {tree = 2720},
		[{1401, 1500}] = {tree = 2722}
		},
	level = 15,
	skill = SKILL_AXE,
	skillReq = 10,
	effect = CONST_ME_BLOCKHIT,
	addTries = 100,
	branches = 2767,
	msgType = MESSAGE_EVENT_ADVANCE,
	soul = 3,
	minutes = 1
}
 
local t = {
	[{1, 500}] = {msg = "You choped the tree and got some wood", item = 2149, amountmax = 3},
	[{501, 750}] = {msg = "You have damaged your axe and it broke!", destroy = true},
	[{751, 1550}] = {msg = "You choped the tree down, but the the wood was not good."},
	[{1551, 1650}] = {msg = "oh no the tree had a Wasps nest in it!", summon = "Wasp"},
	[{1751, 2000}] = {msg = "You choped the tree and got some wood", item = 2148, amountmax = 5},
	[{2001, 2250}] = {msg = "A Spider that was stuck jumped from the choped tree", summon = "Spider"},
	[{2251, 2500}] = {msg = "There was a bird's nest in the tree and you took some eggs from the nest", item = 2695, amountmax = 5},
	[{2501, 2750}] = {msg = "Hahaa! You found a sack with coins in it!", item = 2148, amountmax = 50},
	[{2751, 3000}] = {msg = "A rat jumped at you!", summon = "Rat"}
	}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isInArray(config.trees, itemEx.itemid) and config.level <= getPlayerLevel(cid) and config.skillReq <= getPlayerSkill(cid, config.skill) and config.soul <= getPlayerSoul(cid) then
		local v, amount, damage = math.random(3000), 1, nil
		for i, k in pairs(t) do
			if v >= i[1] and v <= i[2] then
				if k.destroy then
					doRemoveItem(item.uid)
				end
				if k.summon then
					doSummonCreature(k.summon, toPosition)
				end
				if k.item then
					if k.amountmax then
						amount = math.random(k.amountmax)
					end
					doPlayerAddItem(cid, k.item, amount)
				end
				if k.msg then
					local msg = k.msg
					doPlayerSendTextMessage(cid, config.msgType, msg)
				end
 

			local function regen(parameter)
				doCreatureAddHealth(cid, 20)
				addEvent(regen, 10*1000, {cid = cid})
			end
			local function stopRegen(parameter)
				stopEvent(regen)
			end
			addEvent(stopRegen, 61*1000, {cid = cid})
			doCreatureAddHealth(cid, 20)
			addEvent(regen, 10*1000, {cid = cid})
			doRemoveItem(item.uid)
				doTransformItem(itemEx.uid, config.branches)
				doPlayerAddSoul(cid, -config.soul)
				doSendMagicEffect(toPosition, k.destroy and CONST_ME_HITAREA or config.effect)	
				return doPlayerAddSkillTry(cid, config.skill, config.addTries)
			end			
		end
  end	
	return doPlayerSendCancel(cid, "Either this tree can't be choped or you don't have enough experience, skill or soul to chop this tree.")
end
but when im using axe or pick i have an errors: Bez tytułu.jpg i cant find error, plz help.
 
Last edited:
All I know is that most of the scripts u will find here won't be working with avesta and so on I don't know where is the problem too.

Sorry :( hope someone can help u
 
Back
Top