• 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 Don't show accept message

RaikND

facebook.xenoria.org
Joined
May 12, 2010
Messages
942
Reaction score
10
Location
Spain
Hello, iam newbie on luascript, i don't know how to fix it, any can help me?
Lua:
--Addon Only Click By: Raikon (RaikND)--
function onUse(cid, item, frompos, item2, topos)
  
   -- First Citizen Addon
   if item.actionid == 33751 then
       if doPlayerRemoveItem(cid,5878,100) == 1 then
	       doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You Found a First Citizen Addon")
           doPlayerAddOutfit(cid, 136, 1)
           doPlayerAddOutfit(cid, 128, 1)
      else
           doPlayerSendCancel(cid,"You need 100 minotaur leathers.")
       end

    -- Second Citizen Addon
   elseif item.actionid == 33752 then
       if doPlayerRemoveItem(cid,5890,100) and doPlayerRemoveItem(cid,5902,50) and doPlayerRemoveItem(cid,2480,1) == 1 then
	       doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You Found a First Citizen Addon")
           doPlayerAddOutfit(cid, 136, 2)
           doPlayerAddOutfit(cid, 128, 2)
      else
           doPlayerSendCancel(cid,"You need 100 chiken feathers, 50 honeycombs, 1 legion helmet.")
     end
   end
  return false
end
 
Try this one:

Lua:
--Addon Only Click By: Raikon (RaikND), fixed by Kito--
function onUse(cid, item, frompos, item2, topos)
 
   -- First Citizen Addon
   if item.actionid == 33751 then
		if doPlayerRemoveItem(cid,5878,100) then
	       doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You have found the first citizen addon!")
           doPlayerAddOutfit(cid, 136, 1)
           doPlayerAddOutfit(cid, 128, 1)
		else
           doPlayerSendCancel(cid,"You need 100 minotaur leathers.")
		end
 
    -- Second Citizen Addon
   elseif item.actionid == 33752 then
        if doPlayerRemoveItem(cid,5890,100) and doPlayerRemoveItem(cid,5902,50) and doPlayerRemoveItem(cid,2480,1) then
	       doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You have found the second citizen addon!")
           doPlayerAddOutfit(cid, 136, 2)
           doPlayerAddOutfit(cid, 128, 2)
		else
           doPlayerSendCancel(cid,"You need 100 chiken feathers, 50 honeycombs, 1 legion helmet.")
		end
   end
  return true
end
 
I THINK that the problem is that you should give a storage value to any addon.

Lua:
--Addon Only Click By: Raikon (RaikND)--
function onUse(cid, item, frompos, item2, topos)
 
   -- First Citizen Addon
    if item.actionid == 33751 then
        if (getPlayerStorageValue(cid,12021) == -1) then
            if doPlayerRemoveItem(cid,5878,100) == 1 then
                doPlayerAddOutfit(cid, 136, 1)
                doPlayerAddOutfit(cid, 128, 1)
		setPlayerStorageValue(cid,12021,1)
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You Found a First Citizen Addon")
            else
                doPlayerSendCancel(cid,"You need 100 minotaur leathers.")
            end
	else
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You Already have the First Citizen Outfit.")
	end
	-- Second citizen addon
    elseif item.actionid == 33752 then
	if (getPlayerStorageValue(cid,12021) == 1) then
            if doPlayerRemoveItem(cid,5890,100) and doPlayerRemoveItem(cid,5902,50) and doPlayerRemoveItem(cid,2480,1) == 1 then
                doPlayerAddOutfit(cid, 136, 2)
                doPlayerAddOutfit(cid, 128, 2)
		setPlayerStorageValue(cid,12021,2)
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You Found a First Citizen Addon")
            else
                doPlayerSendCancel(cid,"You need 100 chiken feathers, 50 honeycombs, 1 legion helmet.")
            end
	elseif (getPlayerStorageValue(cid,12021) == 0) then
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Go get the first citizen addon.")
	elseif (getPlayerStorageValue(cid,12021) == 2) then
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"You already have the second citizen outfit.")
	end
    end
  return true
end

I don't know if it works but test it and tell me if it works.
Efren.
 
Back
Top