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

Windows Quest Help [INGAME]

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
when i loot a box/quest box i dont get the item and i get a error in console .. ?
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/quests/quests.lua:onUse

luaGetItemWeight(). Item not found

Lua Script Error: [Action Interface]
data/actions/scripts/quests/quests.lua:onUse

data/actions/scripts/quests/quests.lua:24: attempt to compare boolean with numbe
r
stack traceback:
        data/actions/scripts/quests/quests.lua:24: in function <data/actions/scr
ipts/quests/quests.lua:2>

Quest.lua

Code:
local annihilatorReward = {1990, 2400, 2431, 2494}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.uid > 1000 and item.uid < 10000 then
		local itemWeight = getItemWeight(item.uid, 1, FALSE)
		local playerCap = getPlayerFreeCap(cid)
		if isInArray(annihilatorReward, item.uid) == TRUE then
			if getPlayerStorageValue(cid, 30015) == -1 then
				if playerCap >= itemWeight then
					if item.uid == 1990 then
						local container = doPlayerAddItem(cid, 1990, 1)
						doAddContainerItem(container, 2326, 1)
					else
						doPlayerAddItem(cid, item.uid, 1)
					end
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNamebyid(item.uid) .. '.')
					setPlayerStorageValue(cid, 30015, 1)
				else
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNamebyid(iem.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
				end
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
			end
		elseif getPlayerStorageValue(cid, item.uid) == -1 then
			if playerCap >= itemWeight then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNamebyid(item.uid) .. '.')
				doPlayerAddItem(cid, item.uid, 1)
				setPlayerStorageValue(cid, item.uid, 1)
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNamebyid(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		end
	else
		return FALSE
	end
	return TRUE
end
 
Bumpzor rly need help
psycho_hardstyler.gif

can some post a working quest/system ?
psycho_hardstyler.gif
 
Try this script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
  if item.uid > 1000 and item.uid < 10000 then
    local itemweight = getItemWeightById(item.uid, 1)
    local playerCap = getPlayerFreeCap(cid)
    if getPlayerStorageValue(cid, item.uid) == -1 then
      if playerCap >= itemweight then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
        doPlayerAddItem(cid, item.uid ,1)
        setPlayerStorageValue(cid, item.uid, 1)
      else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemweight .. ' oz it\'s too heavy.')
      end
    else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
  else
    return FALSE
  end
  return TRUE
end
It's from 0.2 i think but it works on 0.3.4 ;)
 
Try this script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
  if item.uid > 1000 and item.uid < 10000 then
    local itemweight = getItemWeightById(item.uid, 1)
    local playerCap = getPlayerFreeCap(cid)
    if getPlayerStorageValue(cid, item.uid) == -1 then
      if playerCap >= itemweight then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
        doPlayerAddItem(cid, item.uid ,1)
        setPlayerStorageValue(cid, item.uid, 1)
      else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemweight .. ' oz it\'s too heavy.')
      end
    else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
  else
    return FALSE
  end
  return TRUE
end
It's from 0.2 i think but it works on 0.3.4 ;)

rep to you
 
Back
Top