• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action realy need [request]

yhom

New Member
Joined
Jan 27, 2009
Messages
6
Reaction score
0
i need help making a action that when i use a rune -
deletes the corps X and gives me a item Y.
and i want to add more corps and items on the same script and a chance to fail.
can anyone please help me?
 
you can use this script:
explain:

[2830] = {25000, 5878}

2830 = Item
25000, 5878 = corps

Code:
<action itemid="XXXX" script="XXXX.lua"/>


local SKINS = {
-- Corps 1
[2830] = {25000, 5878},
[2871] = {25000, 5878},
[2866] = {25000, 5878},
[2876] = {25000, 5878},
[3090] = {25000, 5878},

-- Corps 2
[4259] = {25000, 5876},
[4262] = {25000, 5876},
[4256] = {25000, 5876},

-- Corps 3
[3104] = {25000, 5877},
[2844] = {25000, 5877},

-- Corps 4
[2881] = {25000, 5948},

-- Corps 5
[2931] = {25000, 5930, 90000, 5893},

-- Corps 6
[3031] = {25000, 5925}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerLevel(cid) <= 1) then
doPlayerSendCancel(cid, "You have to be at least Level 2 to use this tool.")
return TRUE
end

local skin = SKINS[itemEx.itemid]
if(skin == nil) then
doPlayerSendCancel(cid, "Sorry, not possible.")
return TRUE
end

local random = math.random(1, 100000)
if(random <= skin[1]) then
doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
doPlayerAddItem(cid, skin[2], 1)
elseif(skin[3] and random >= skin[3]) then
doSendMagicEffect(toPosition, CONST_ME_GROUNDSHAKER)
doPlayerAddItem(cid, skin[4], 1)
else
doSendMagicEffect(toPosition, CONST_ME_POFF)
end

doTransformItem(itemEx.uid, itemEx.itemid + 1)
return TRUE
end
 
100000 = 100%?
and if i want to add more corps and skins?
-- Corps 7
[xxxx] = {yyyy, yyyy}
?

hmmm, and if i want to... like... every time i use item xxxx i lose it
 
Last edited:
Back
Top