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

Destroying crates = give player storage values

SamX

VoltageOT Developer
Joined
Aug 27, 2010
Messages
557
Reaction score
151
Location
Canada
I'm pretty bad at scripting actions, was hoping someone could help me out with a basic script for a quest.

Basically you will need to use an item to break 5 different crates. Once you have all five crates broken you should be given a storage value that can be used to "hand in" your mission at an NPC.

If someone could help me out or atleast point me in the right direction that would be much appreciated :)
 
I'm pretty bad at scripting actions, was hoping someone could help me out with a basic script for a quest.

Basically you will need to use an item to break 5 different crates. Once you have all five crates broken you should be given a storage value that can be used to "hand in" your mission at an NPC.

If someone could help me out or atleast point me in the right direction that would be much appreciated :)
8.6
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
1.0
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey)
1.1-1.2
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)

Things to remember when creating scripts which use an item on an item.

1. The item parameter is the item you are using.
2. The itemEx or target parameter is the thing you are applying the item you are using to.
3. The fromPosition parameter is the position of the item you are using came from, e.g. your backpack, an equipment slot etc..
4. The toPosition parameter is the position of itemEx
5. The isHotkey I never used so I don't know how this is applied :p
 
Last edited:
In what should the crates transform into, should they transform back after a certain time? You can add actionids to the crates, then check for the actionids in the action script and add the script with the itemid of the item you destroy the crates with in actions.xml. Every time a crate is destroyed, you can set a storagevalue + 1 and with storagevalue 4 (since it starts with -1) you can check this in the NPC.
You can post your server version and IDs of items so I can write an example.
 
Back
Top