bury
Active Member
- Joined
- Jul 27, 2008
- Messages
- 421
- Solutions
- 7
- Reaction score
- 25
Hello I just want this tool to use it like pick, rope, shovel and machete unlimited. Not broken, not jammed. Only this, I dont mind the pink or red others, or having the three in the same way.
These are the scripts it is using I think:
Actions/scripts/tools/squeeze.lua
Actions/scripts/tools/squeezings.lua
These are the scripts it is using I think:
Actions/scripts/tools/squeeze.lua
LUA:
local config = {
functions = {
[10511] = { -- squeezing gear of girlpower
TOOLS.ROPE,
TOOLS.SHOVEL,
TOOLS.PICK,
TOOLS.MACHETE,
TOOLS.SCYTHE
},
[10513] = { -- sneaky stabber of eliteness
TOOLS.ROPE,
TOOLS.SHOVEL,
TOOLS.PICK,
TOOLS.MACHETE,
TOOLS.KNIFE
},
[10515] = { -- whacking driller of fate
TOOLS.ROPE,
TOOLS.SHOVEL,
TOOLS.PICK,
TOOLS.MACHETE,
TOOLS.KNIFE
}
},
jamChance = 10
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local funcs = config.functions[item.itemid]
if(funcs == nil) then
return false
end
local result = false
for _, func in ipairs(funcs) do
if(func(cid, item, fromPosition, itemEx, toPosition)) then
result = true
break
end
end
if(not result) then
return false
end
if(math.random(1, 100) <= config.jamChance) then
doTransformItem(item.uid, item.itemid + 1)
doDecayItem(item.uid)
end
return true
end
Actions/scripts/tools/squeezings.lua
LUA:
if(value ~= -1 and os.clock()-value < 60)then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The tool jammed. Please wait " .. 60-math.floor(os.clock()-value) .. " seconds before using it again.")
return TRUE
end
if(math.random(1, 10) == 1)then
setPlayerStorageValue(cid, 10, os.clock())
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The tool jammed. Please wait 60 seconds before using it again.")
return TRUE
end
-- Shovel
if isInArray(holes, itemEx.itemid) == TRUE then
doTransformItem(itemEx.uid, itemEx.itemid + 1)
doDecayItem(itemEx.uid)
return FALSE
-- Rope
elseif toPosition.x == CONTAINER_POSITION or toPosition.x == 0 and toPosition.y == 0 and toPosition.z == 0 then
return FALSE
end
local groundTile = getThingfromPos(toPosition)
if groundTile.itemid == 384 or groundTile.itemid == 418 or groundTile.itemid == 8278 then
doTeleportThing(cid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z - 1}, FALSE)
elseif isInArray(holeId, itemEx.itemid) == TRUE then
local hole = getThingfromPos({x = toPosition.x, y = toPosition.y, z = toPosition.z + 1, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
if hole.itemid > 0 then
doTeleportThing(hole.uid, {x = toPosition.x, y = toPosition.y + 1, z = toPosition.z}, FALSE)
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end
return FALSE
-- Pick
elseif (itemEx.uid <= 65535 or itemEx.actionid > 0) and (itemEx.itemid == 354 or itemEx.itemid == 355 or itemEx.itemid == 9024 or itemEx.itemid == 9025) then
doTransformItem(itemEx.uid, 392)
doDecayItem(itemEx.uid)
return TRUE
elseif itemEx.uid == 60001 then
doTeleportThing(cid, {x=329, y=772, z=10})
doSendMagicEffect({x=329, y=772, z=10},10)
return TRUE
-- Machete
elseif itemEx.itemid == 2782 then
doTransformItem(itemEx.uid, 2781)
doDecayItem(itemEx.uid)
return TRUE
elseif itemEx.itemid == 1499 then
doRemoveItem(itemEx.uid)
return TRUE
-- Scythe
elseif itemEx.itemid == 2739 then
doTransformItem(itemEx.uid, 2737)
doCreateItem(2694, 1, toPosition)
doDecayItem(itemEx.uid)
return TRUE
end
return destroyItem(cid, itemEx, toPosition)
end