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

Solved Set Storage on a new character - TFS 0.4 - 8.6

hanzoha

New Member
Joined
May 8, 2016
Messages
87
Reaction score
2
Hello guys, I've been trying to add a storage value on a new character but I cant figure it out.

Something like
$char_to_copy->setLastIP

But $char_to_copy->setStorage doesn't work

Can you help me? Thanks!
 
Storage to what? You are using PHP values. If you want to set storage in-game you should use TFS command: setPlayerStorageValue in creaturescripts/login.lua
 
I understand!

I see my login.lua... can you give me a more elaborate example? I want them to start with an storage for a task value 1300, 1.
How should I write it in order to work?

Thanks!
 
In login.lua add
Local storage = 1300
if getPlayerStorageValue(cid,storage) < 0 then
doPlayerSetStorageValue(cid,storage,1)

Exacly like that :)
If you dont want you dont need to use local values, you can just use: doPlayerSetStorageValue(cid,1300,1)
 
Back
Top