you don't need the conditional if you don't actually have a condition lol.
i mean, what is the condition that must have the value TRUE in order to create that item?
I've written a short explanation if you want to read, if not, skip it:
to ilustrate that situation better, let me use an example:
this script represents a quest:
function onUse(cid,item)
if getPlayerStorageValue(cid,1000)~=1 then
doPlayerAddItem(cid,ITEM_ID,COUNT)
setPlayerStorageValue(cid,1000,1)
else
doPlayerSendCancel(cid,"You have already done this quest.")
end
end
Following the collors i've used to make it better:
RED: Obviously, the normal quests on tibia can only be done once. we use the storage values to see if a player has done a quest already or not. the default value for storages is -1, and this particular script uses 1 representing that the player has already done it.
I wanted to put some enphasis on the IF. You can make scripts without ifs, i'll show another example later.
The red line checks the truth value of a statement. the statement is (getPlayerStorageValue() ~= 1) and ~= means different. The computer processes this string, and, let's say the value is -1 (default).
The string now is (-1 ~= 1). it's true, so the truth value of this string is true. the if command will do the 'then' part if the statement is true. now let's say the player has already done this quest, the value would be 1. (1 ~= 1) is a false statement, so the computer breaks the if and go to the elseifs or the else.
BLUE: the blue part is the control variable being updated. if the storage wasn't 1 when the player used the chest, now it is.
now, an example of how you could make a simmilar code:
function onUse(cid,item)
doPlayerAddHealth(cid,100)
doTeleportThing(cid,{x=13,y=13,z=13})
end
there is no condition to see what part of the code will be processed, so it is done in the order the commands are written.
In this example, the 'control' that the scripter uses to avoid abuse (clicking repeatedly) is teleporting the player away, i don't know any good examples of the use of this code, but you got it.
--------------------------------------------------------------------------------------------------------------
Now you have to think, what must happen in order to have this function to be processed? maybe you need 'cid' to be a player, maybe you need a timer or a storage value, it's totally up to you. Also, it can be nothing, so no if will be used.