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

Action

rafaelclaumann

New Member
Joined
Jul 7, 2011
Messages
13
Reaction score
0
I need one script, lets use shovel on item X, and X item goto X cords.

Royalrescue15.png


here he use shovel on coal and, coal goto the wagon on x,y,z position, please help mee


+like
 
Hope this is what you're looking for:

Lua:
local t = {
	minedCoal = ITEM_ID, -- The coal you use the shovel on.
	cartCoal = ITEM_ID, -- The coal that is created on the cart.
	cartPos = {x = 100, y = 100, z = 7}, -- Where the cart is.
	chance = 25 -- 25% chance to mine it.
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local id = t.minedCoal == itemEx.itemid
	if id then
		if t.chance <= math.random(1, 100) then
			doRemoveItem(itemEx.uid, 1)
			doCreateItem(t.cartCoal, 1, t.cartPos)
			doCreatureSay(cid, "COAL!", TALKTYPE_MONSTER, nil, nil, toPosition)
			doSendMagicEffect(toPosition, CONST_ME_SMOKE)
		else
			doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
		end
	end
	
	return true
end

You might have to add it to shovel.lua.

Lua:
local t = {
	minedCoal = ITEM_ID,
	cartCoal = ITEM_ID,
	cartPos = {x = 100, y = 100, z = 7},
	chance = 25 -- 25% chance to mine it.
}

local id = t.minedCoal == itemEx.itemid
if id then
	if t.chance <= math.random(1, 100) then
		doRemoveItem(itemEx.uid, 1)
		doCreateItem(t.cartCoal, 1, t.cartPos)
		doCreatureSay(cid, "COAL!", TALKTYPE_MONSTER, nil, nil, toPosition)
		doSendMagicEffect(toPosition, CONST_ME_SMOKE)
	else
		doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
	end
end
 
hoho, thanks man,

you can help me another time?

"example: the item are on position, player need moves the item to other position to can use the teleport,door,window or other passage"

thanks for help and your atenction
 
Back
Top