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

Singed

New Member
Joined
Apr 20, 2009
Messages
112
Solutions
1
Reaction score
2
what does the lua function getPlayerStorageValue(cid, key) mean/used for/ or how is it used?

I see it in a lot of scripts but i haven't been able to figure out how to work it, or why.

Also if anyone has a link of the description of the lua functions other than the ones already in the server folder, it would be greatly appreciated.
 
It is information which can be read or saved in player.
I you do quest you recieve a storage with number xxxx.
If you want do it again, script checks storage. If you have already it, you wont do a quest

btw read some lua tutorials
 
i have, just haven't found anything on that one. I would consider myself a pretty good scripter i guess just kinda always skipped that one
 
it's like a counter, it's mostly used in quests.

example

let's use the anihilator quests chests, you can pick ONLY 1 item out of 4
so we make an "IF"

PHP:
if(getPlayerStorageValue (cid, 50001)) then
   	doPlayerSendTextMessage(cid, 19, "the chest is empty.")
else
        doPlayerAddItem(cid,ITEMID,1)
        doPlayerSetStorageValue(cid, 50001)
end

so, if the player DIDN'T get any item, he WONT have the storage value 50001, else if the player already picked up an item, the chest sets his storagevalue to 50001 so the other chests will know that he already picked up an item, and wont allow him to pick another one.

is that clear? :)

Here's a tutorial: http://otland.net/f139/beginner-tutorial-15400/


Please Rep+ me if I helped you ^^
 
Back
Top