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

Looking for some nice guide on making "table?(not sure how to call it)" in luascripts.

MalyFanek

New Member
Joined
Oct 10, 2019
Messages
37
Reaction score
2
Hello guys, thats me again... :D
Im looking for some nice guide/or help in understanding how to make script works on few monsters/items etc than making triliards of almost same lua scripts.

Like example, i have this saga script:
Code:
 local monster = {
 {'Raditz Saga'},
 }
 local stor = 8000

 
 function onKill ( cid , target )
 if isMonster ( target ) and
 getCreatureName ( target ) == 'Raditz saga' and
 getPlayerStorageValue ( cid ,stor) == 1 then
setPlayerStorageValue ( cid ,8000 , 2 )
 end
 return true
 end
Its working fine etc but as u all know, its like task system.... making 50? sagamonster.lua to load is pretty useless if its possible to make a "table (thats how its called?)"
So any guide/help/explantationts? ;]


Btw its tfs 0,4 rev 3777
and if its important too, source compiled by this guide: C++ - How to make monster attack only player with storage (https://otland.net/threads/how-to-make-monster-attack-only-player-with-storage.254403)


Thanks.
 
8. Removing Solved Content:
  • If you solved your problem, post the solution, do not remove the content in your posts. Instead write the solution you found. This can help other users with the same problem.
  • Threads with removed content are useless and are seen as spam.
  • If you were able to solve the issue yourself, post the solution and report your own post so a moderator can tag it as the "Best Answer".
 
Uhm sry, well i did it but not by table i just changed from last 3 lines from:
Code:
 end
 return true
 end
to:
Code:
 return true
 end
And added as many monsters as possible
and on last monster the code is
Code:
 end
 return true
 end
But it still stops on some sagas, now i get to 25~? and again after NPC talk it doesnt want to add saga ;x On freeza sagas i did wrong Cuz i think the problem were too long names, now im stuck on C19 etc, too short? no idea, tried to do longer and still doesnt add storage, and ofc again after an NPC adds storage ;/
 

Similar threads

Back
Top