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

Lua Can somebody quickly edit this for me please

Shockah

Member
Joined
Aug 31, 2010
Messages
625
Reaction score
17
Location
England
Could somebody please add this:
Code:
	if itemEx.actionid == XXXX then -- ACTION ID OF THE GROUND
		local new = {x = 100, y = 100, z = 7}
		doTeleportThing(cid, new, true)
		doSendMagicEffect(new, CONST_ME_TELEPORT)
	end

to my pick script:
Code:
		1285, 1357, 3608, 3632, 3666, 6999, 7003
	},
	[2147] = {
		1290, 1358, 3609, 3633, 3667, 7000
	},
	[2149] = {
		1335, 1359, 3615,3534, 3668, 7001
	},
	[2150] = {
		1356, 3607, 3616, 3635, 3670, 7002
	}
}
 
function onUse(cid, item, frompos, item2, topos)
	if math.random(1, 20) > 15 then
		for item, itemList in pairs(items) do
			if isInArray(itemList, item2.itemid) == TRUE then
				doSendMagicEffect(topos,34)
				doTransformItem(item2.uid,4997)
				doPlayerAddItem(cid, item, 1)
				doDecayItem(item2.uid)
				return 1
			end
		end
	else
		doSendMagicEffect(topos,2)
	end
	return 1
end

I know it's probably pretty simple stuff but I can't seem to get it to work :/
 
Lua:
local items = {
	[2146] = {
		1285, 1357, 3608, 3632, 3666, 6999, 7003
	},
	[2147] = {
		1290, 1358, 3609, 3633, 3667, 7000
	},
	[2149] = {
		1335, 1359, 3615,3534, 3668, 7001
	},
	[2150] = {
		1356, 3607, 3616, 3635, 3670, 7002
	}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	for _item, itemList in pairs(items) do
		if isInArray(itemList, itemEx.itemid) then
			if math.random(120) > 15 then
				doSendMagicEffect(toPosition, 34)
				doTransformItem(itemEx.uid, 4997)
				doPlayerAddItem(cid, _item, 1)
				doDecayItem(itemEx.uid)
			end
			return true
		end
	end
	if itemEx.actionid == XXXX then -- ACTION ID OF THE GROUND
		local new = {x = 100, y = 100, z = 7}
		doTeleportThing(cid, new)
		doSendMagicEffect(new, CONST_ME_TELEPORT)
	elseif not isInArray({0, 65535}, toPosition.x) then
		doSendMagicEffect(toPosition, 2)
	end
	return true
end
Don't forget to change 'XXXX', and the position 'new'
 
Back
Top