• 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 [SQLite] -=[TFS]=- 0.4 8.60 Is not working command !desbug and buy item free condition VIP LVL 717217 and Premium

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
Lua:
function onSay(cid, words, param)

    if getPlayerLevel(cid) == 717217 and getPlayerStorageValue(cid, 13545) == 1 and isPremium(cid) then

        if doPlayerRemoveMoney(cid, 0) == TRUE then

            local bp = doPlayerAddItem(cid, 5805, 1)

            doCreatureSay(cid, "Você comprou um item para desbugar a CAP.", TALKTYPE_ORANGE_1)

        else

            doCreatureSay(cid, "Item grátis", TALKTYPE_ORANGE_1)

            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)

        end

    else

        doCreatureSay(cid, "Você não atende aos requisitos para comprar o item.", TALKTYPE_ORANGE_1)

        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)

    end

end
 
Lua:
local gold_cost = 0

function onSay(cid, words, param)
  if getPlayerLevel(cid) >= 717217 and getPlayerStorageValue(cid, 13545) == 1 and isPremium(cid) then
    if doPlayerRemoveMoney(cid, gold_cost) then
      doPlayerAddItem(cid, 5805, 1)
      doCreatureSay(cid, "Você comprou um item para desbugar a CAP.", TALKTYPE_ORANGE_1)
    else
      doCreatureSay(cid, "Você não tem dinheiro suficiente", TALKTYPE_ORANGE_1)
      doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
  else
    doCreatureSay(cid, "Você não atende aos requisitos para comprar o item.", TALKTYPE_ORANGE_1)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  end
end
 
@Paulix

Lua:
[20/08/2023 17:15:14] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/desbug.lua:14: 'end' expected (to close 'if' at line 4) near '<eof>'
[20/08/2023 17:15:14] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/desbug.lua)
[20/08/2023 17:15:14] data/talkactions/scripts/desbug.lua:14: 'end' expected (to close 'if' at line 4) near '<eof>'
 
Lua:
local gold_cost = 0

function onSay(cid, words, param)
  if getPlayerLevel(cid) >= 717217 and getPlayerStorageValue(cid, 13545) == 1 and isPremium(cid) then
    if doPlayerRemoveMoney(cid, gold_cost) then
      doPlayerAddItem(cid, 5805, 1)
      doCreatureSay(cid, "Você comprou um item para desbugar a CAP.", TALKTYPE_ORANGE_1)
    else
      doCreatureSay(cid, "Você não tem dinheiro suficiente", TALKTYPE_ORANGE_1)
      doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
  else
    doCreatureSay(cid, "Você não atende aos requisitos para comprar o item.", TALKTYPE_ORANGE_1)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  end
end

You were missing 3 lines at the end
 
your script is missing the end in the file, copy again this
Lua:
local gold_cost = 0

function onSay(cid, words, param)
  if getPlayerLevel(cid) >= 717217 and getPlayerStorageValue(cid, 13545) == 1 and isPremium(cid) then
    if doPlayerRemoveMoney(cid, gold_cost) then
      doPlayerAddItem(cid, 5805, 1)
      doCreatureSay(cid, "Você comprou um item para desbugar a CAP.", TALKTYPE_ORANGE_1)
    else
      doCreatureSay(cid, "Você não tem dinheiro suficiente", TALKTYPE_ORANGE_1)
      doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
  else
    doCreatureSay(cid, "Você não atende aos requisitos para comprar o item.", TALKTYPE_ORANGE_1)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  end
end
 
you're failing to meet one of this requirements

Lua:
if getPlayerLevel(cid) >= 717217 and getPlayerStorageValue(cid, 13545) == 1 and isPremium(cid) then

probably one of these isn't true:
you are level below 717218
your storagevalue 13545 isn't 1
you aren't premium

try this script to see which one is failing...

Lua:
local gold_cost = 0

function onSay(cid, words, param)
  if getPlayerLevel(cid) >= 717217 and getPlayerStorageValue(cid, 13545) == 1 and isPremium(cid) then
    if doPlayerRemoveMoney(cid, gold_cost) then
      doPlayerAddItem(cid, 5805, 1)
      doCreatureSay(cid, "Você comprou um item para desbugar a CAP.", TALKTYPE_ORANGE_1)
    else
      doCreatureSay(cid, "Você não tem dinheiro suficiente", TALKTYPE_ORANGE_1)
      doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
  else
    if getPlayerLevel(cid) < 717217 then
      doCreatureSay(cid, "Você não tem nível suficiente.", TALKTYPE_ORANGE_1)
    elseif getPlayerStorageValue(cid, 13545) ~= 1 then
      doCreatureSay(cid, "Você não é VIP.", TALKTYPE_ORANGE_1)
    else
      doCreatureSay(cid, "Você não é premium", TALKTYPE_ORANGE_1)
    end
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  end
end
 
just change the value from 1 to 0 to allow values other than 1 to be considered as VIP.

elseif getPlayerStorageValue(cid, 13545) <= 1 then
for
elseif getPlayerStorageValue(cid, 13545) <= 0 then


Lua:
local gold_cost = 0

function onSay(cid, words, param)
  if getPlayerLevel(cid) >= 717217 and (getPlayerStorageValue(cid, 13545) > 0) and isPremium(cid) then
    if doPlayerRemoveMoney(cid, gold_cost) then
      doPlayerAddItem(cid, 5805, 1)
      doCreatureSay(cid, "Você comprou um item para desbugar a CAP.", TALKTYPE_ORANGE_1)
    else
      doCreatureSay(cid, "Você não tem dinheiro suficiente", TALKTYPE_ORANGE_1)
      doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
  else
    if getPlayerLevel(cid) < 717217 then
      doCreatureSay(cid, "Você não tem nível suficiente.", TALKTYPE_ORANGE_1)
    elseif getPlayerStorageValue(cid, 13545) <= 0 then
      doCreatureSay(cid, "Você não é VIP.", TALKTYPE_ORANGE_1)
    else
      doCreatureSay(cid, "Você não é premium", TALKTYPE_ORANGE_1)
    end
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  end
end
 

Similar threads

Back
Top