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

Bug in the swapping script

adrianokk

New Member
Joined
Jan 22, 2019
Messages
43
Reaction score
1
I made some changes to the script to do what I wanted.
and it was working normally, but out of nowhere it stopped working.
and I do not know what could be.
the script has a life of its own kkkkkkk

Lua:
function onSay(cid, words, param)

if getPlayerItemCount(cid, 17156) < 100 and getPlayerItemCount(cid, 17174) < 100 then
return doPlayerSendTextMessage(cid, 20, "Precisa de 100 Apricorns vermelhos e 100 Ferros.") and true
end
if getPlayerItemCount(cid, 17156) >= 100 and getPlayerItemCount(cid, 17174) >= 100 then
doPlayerAddItem(cid, 15677, 100)
doPlayerRemoveItem(cid, 17156, 100)
doPlayerRemoveItem(cid, 17174, 100)
doPlayerSendTextMessage(cid, 20, "Voce Craftou 100 Magu Ball")
return true
end
end
 
This is the most disgusting script i ever seen.
Try like this:
Code:
function onSay(cid, words, param)
    if (getPlayerItemCount(cid, 17156) < 100 and getPlayerItemCount(cid, 17174) < 100) then
        doPlayerSendTextMessage(cid, 20, "Precisa de 100 Apricorns vermelhos e 100 Ferros.")
    else
        doPlayerAddItem(cid, 15677, 100)
        doPlayerRemoveItem(cid, 17156, 100)
        doPlayerRemoveItem(cid, 17174, 100)
        doPlayerSendTextMessage(cid, 20, "Voce Craftou 100 Magu Ball")
    end
    return true
end
 
Code:
if (getPlayerItemCount(cid, 17156) < 100 and getPlayerItemCount(cid, 17174) < 100) then
Should use or here instead of and.
 

Similar threads

Back
Top