• 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 Need help with a script

jona21

Member
Joined
Jan 19, 2010
Messages
38
Reaction score
5
Well i made a script but didnt work
here it is

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerStorageValue(uid, 1) == 1001 then
    doPlayerAddItem(uid, 2650)
    doPlayerAddItem(uid, 2512)
    doPlayerSetStorageValue(uid, 1, 1002)
    doSendMagicEffect(pos, 36)
    doPlayerSendTextMessage(cid,21,"You found something usefull !")
    
elseif getPlayerStorageValue(uid, 1) == 1002 then
    doPlayerSendTextMessage(cid,21,"There is nothing here")

    return true
end
end

and the error i get

1.JPG
 
Last edited by a moderator:
Try this:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerStorageValue(uid, 1) == 1001 then
    doPlayerAddItem(uid, 2650)
    doPlayerAddItem(uid, 2512)
    doPlayerSetStorageValue(uid, 1, 1002)
    doSendMagicEffect(getPlayerPosition(cid), 36)
    doPlayerSendTextMessage(cid,21,"You found something usefull !")
    
elseif getPlayerStorageValue(uid, 1) == 1002 then
    doPlayerSendTextMessage(cid,21,"There is nothing here")

    return true
end
end

or this:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerStorageValue(cid,1001) == -1 then
    doPlayerAddItem(uid, 2650)
    doPlayerAddItem(uid, 2512)
    setPlayerStorageValue(cid,1002,1)
    doSendMagicEffect(getPlayerPosition(cid),36)
    doPlayerSendTextMessage(cid,21,"You found something usefull !")
    
elseif getPlayerStorageValue(uid, 1) == 1002 then
    doPlayerSendTextMessage(cid,21,"There is nothing here")

    return true
end
end
 
Back
Top