• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Chest giving 100 arrows :(

Cris2387

Member
Joined
Dec 30, 2013
Messages
177
Reaction score
9
hello im kind of new and when a player clicks on the chest they get 100 arrows and i only want them to just get 1 so how can i fix it?
 
First find out how the chest has been scripted.
Is it a script in actions.xml?
If it is find the script and change the amount given to 1 within the script.
You can check quickly by opening your map editor and finding the actionID or uniqueID used on the chest, then find that ID in actions.xml
If the quest was made within the map.. change the items inside the chest to 1 arrow.
 
First find out how the chest has been scripted.
Is it a script in actions.xml?
If it is find the script and change the amount given to 1 within the script.
You can check quickly by opening your map editor and finding the actionID or uniqueID used on the chest, then find that ID in actions.xml
If the quest was made within the map.. change the items inside the chest to 1 arrow.
well im not using a script all im doing is putting the id of the arrows on both the action and unique id of the chest and it works but it gives the player 100 arrows :( i dont want it to do that i only want them to receive one
 
well im not using a script all im doing is putting the id of the arrows on both the action and unique id of the chest and it works but it gives the player 100 arrows :( i dont want it to do that i only want them to receive one

Check your map editor and take a look into the chest if there is something inside, if not check the unique id and go to your actions.xml and search for the unique id if you found it, it will say something like script="......lua" go for that script and post it here
 
Just make a lua script. When he clicks on a chest with aid x it gives him x arrow and tells him x msg. U can find similar scripts on otland
 
Just make a lua script. When he clicks on a chest with aid x it gives him x arrow and tells him x msg. U can find similar scripts on otland
ok ill find one and put it here and you or someone please tell me if its okay thank you i think this is the answer i was looking for
 
well im not using a script all im doing is putting the id of the arrows on both the action and unique id of the chest and it works but it gives the player 100 arrows :( i dont want it to do that i only want them to receive one
As Danger II posted, the script is added in actions. Look for the id you use in Remere and look for the Lua script with that id in actions.xml, it's either added with the actionid or the chests itemids in actions.xml.
Post the script. Also post your server version.
 
As Danger II posted, the script is added in actions. Look for the id you use in Remere and look for the Lua script in actions.xml, it's either added with the actionid or the chest ids in actions.xml.
Post the script. Also post your server version.
Code:
function onUse(cid, item, frompos, item2, topos)

local config = {
UID = 4321 ----------Any UID here
ITEM = {1294,1} ---- itemid and itemcount In this sample 5 crystal coins
}-- config end --

if item.uid == config.UID then
if getPlayerStorageValue(cid,config.UID) == -1 then
doPlayerAddItem(cid, config.ITEM)
setPlayerStorageValue(cid,config.UID,1)
else
doPlayerSendTextMessage(cid,25,"The chest is empty.")
end

end
return TRUE
end
this is the script im going to try and use, what do i add in actions? i already added the 4321 to the chest in rme my server version is 8.6
 
I ment the script you were already using. There is no need to add different scripts for the quest chests.

To see which server versiobn you are using: https://otland.net/threads/how-to-see-which-server-you-are-using.230892/
oops ok this is the server im using [16/5/2015 11:51:19] The OTX Server Version: (2.51 - SE - 1549) - Codename: (Necron)
and this is the code for the chest im using
Code:
  -- simple quests based on uniqueId
-- to make quest create chest on map and set its uniqueId to id of quest item

function onUse(cid, item, frompos, item2, topos)
  prize = item.uid
  count = item.actionid

  if prize > 0 and prize < 9000 then
  queststatus = getPlayerStorageValue(cid,prize)

  if queststatus == -1 then
  if count > 1 then
  doPlayerSendTextMessage(cid,22,'You have found '.. count ..' of ' .. getItemName(prize) .. '.')
  doPlayerAddItem(cid,prize,count)
  setPlayerStorageValue(cid,prize,1)   
  else
  doPlayerSendTextMessage(cid,22,'You have found a ' .. getItemName(prize) .. '.')
  doPlayerAddItem(cid,prize,1)
  setPlayerStorageValue(cid,prize,1)
  addPlayerRep(cid, 5, TEXTCOLOR_LIGHTBLUE)   
  end
  else
  doPlayerSendTextMessage(cid,22,"It is empty.")
  end

  return 1
  else
  return 0
  end
end
 
Code:
count = item.actionid
This means the actionid will be the count, so all you have to do is just don't add an actionid.
Although I assume it's supposed to be item.actionid - 100, since the minimum of actionids is 100.
 
Code:
count = item.actionid
This means the actionid will be the count, so all you have to do is just don't add an actionid.
Although I assume it's supposed to be item.actionid - 100, since the minimum of actionids is 100.
understood haha thank you i think this is going to do it thank you
 
Back
Top