• 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 Elemental machine not working

Gsp

RP
Joined
Jan 3, 2008
Messages
250
Solutions
1
Reaction score
4
Code:
function onUse (cid ,item, frompos, itemEx, topos)
local config = {
machUID = 1400 ,
machStorage = 1400 ,
PallyPos = { x = 33262 , y = 32201 , z = 13 },
SorcerPos = { x = 33180 , y = 32198 , z = 13 },
DruidPos = { x = 33329 , y = 32075 , z = 13 },
KninaPos = { x = 33086 , y = 32094 , z = 13 },
messNotGem = "You can't have enchanted gem for you profession." ,
messNotArk = "You can't proceed, go back and talk with Arkulius." ,
effect = 11
}
local machUSE = getPlayerStorageValue (cid, config.machStorage)
if itemEx.uid == config.machUID and machUSE == -1 then
doPlayerSendCancel (cid, config.messNotArk)
elseif itemEx.uid == config.machUID and machUSE >= 1 then
if isPaladin(cid) and item.itemid == 7759 then
doRemoveItem (item.uid, 1)
doSendMagicEffect (fromPosition, config.effect)
setPlayerStorageValue (cid ,config.machStorage, machUSE + 1)
elseif isSorcerer (cid) and item.itemid == 7760 then
doRemoveItem (item.uid, 1)
doSendMagicEffect (fromPosition, config.effect)
setPlayerStorageValue (cid, config.machStorage, machUSE + 1)
elseif isDruid (cid) and item.itemid == 7761 then
doRemoveItem (item.uid, 1)
doSendMagicEffect (fromPosition, config.effect)
setPlayerStorageValue (cid, config.machStorage, machUSE + 1)
elseif isKnight (cid) and item.itemid == 7762 then
doRemoveItem (item.uid, 1)
doSendMagicEffect (fromPosition, config.effect)
setPlayerStorageValue (cid, config.machStorage, machUSE + 1)
end
elseif itemEx.uid == config.machUID and machUSE == 21 then
if isPaladin (cid) then
doTeleportThing (cid, config.PallyPos)
setPlayerStorageValue (cid, config.machStorage, machUSE - 20)
elseif isSorcerer (cid) then
doTeleportThing (cid, config.SorcerPos)
setPlayerStorageValue (cid, config.machStorage, machUSE - 20)
elseif isDruid (cid) then
doTeleportThing (cid, config.DruidPos)
setPlayerStorageValue (cid, config.machStorage, machUSE - 20)
elseif isKnight (cid) then
doTeleportThing (cid, config.KninaPos)
setPlayerStorageValue (cid ,config.machStorage ,machUSE - 20)
else
doPlayerSendCancel (cid ,config.messNotGem)
end

end
end


It gives no errors but nothing happens when I try to use items on the machine. Please help! using 3884
 
Is the itemEx parameters correct? Is the action.xml parameters correct? Try adding a print("randomString") just below the function on..(...) and see if it even loads the scripts or if its just getting cought in some if statment.
 
Back
Top