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

RevScripts help with crystal extraction scripts (Revscripts tfs 1.3)

hiela korn

New Member
Joined
Oct 21, 2017
Messages
4
Reaction score
1
they gave me this script, when extracting the crystal with the pick it disappears but the crystal does not appear after a while can someone add that part
Lua:
local rocking = Action()

function rocking.onUse(player, item, fromPosition, target, toPosition, isHotkey)

    if item.itemid == 37546 then
        if target.itemid == 8637 then
            local chance = math.random(1, 10000)
            target:getPosition():sendMagicEffect(CONST_ME_HITAREA)
            target:remove(1)
            if chance <= 9556 then
                player:addItem(2146, 1)
            else
                player:addItem(2146, 1)
            end
        end
    end

end

rocking:id(37546)
rocking:register()
 
they gave me this script, when extracting the crystal with the pick it disappears but the crystal does not appear after a while can someone add that part
Lua:
local rocking = Action()

function rocking.onUse(player, item, fromPosition, target, toPosition, isHotkey)

    if item.itemid == 37546 then
        if target.itemid == 8637 then
            local chance = math.random(1, 10000)
            target:getPosition():sendMagicEffect(CONST_ME_HITAREA)
            target:remove(1)
            if chance <= 9556 then
                player:addItem(2146, 1)
            else
                player:addItem(2146, 1)
            end
        end
    end

end

rocking:id(37546)
rocking:register()
You mean, a crystal appears again on map ?
Use 2 Crystals, example Big Crystal, Small Crystal.
On items.xml add attribute on the small crystal:
<attribute key="decayTo" value="8888" /> <attribute key="duration" value="60" />

Then 8888, will be the item ID of the Big Crystal.
After 60 seconds, the crystal appears again on map.

Then on your script
if target.itemid == 8637 then
8637 > Will be the item ID of Big crystal.
 
Back
Top