• 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 Prevent from error

Strack

Member
Joined
May 15, 2009
Messages
199
Reaction score
14
I just have some doubts.

1. There's any way to prevent from having error in console if u check for a player in an Event and he's dead when the event gets activated (prevent error with a function like... isAlive or something like this)?
ex: addEvent(getCreatureHealth, 5000, cid) -> if cid is dead before 5 seconds it gives error in console.

2. Errors in console give lag, bug,... or they are just a message to the hoster? Im not sure and I wanna be sure.

Strack
 
Last edited:
its a creature, dead, but stills being a creature, so it doesnt runs. I want prevent get error in console
 
well, this will depend of the error, i guess you mean the errors that appear when loading a script, that errors are just and advice of bad syntax in your code, just for advice you that what you have done it won't work, in that case it won't cause lag because that piece of code it's not working.
 
nop Jetro, i know enough lua to avoid such syntax error... I wanna know if errors like 1. makes server lag or they are just info messages (just a doubt).
 
oh my...I did, and as I said, it checks if it's a creature, and it is, but its loged out. I've tested many ways im not just a random lua scripter >.<, mock's tool works so 1. is Solved.
 
What is your problem now?
Whether an error causes lagg depends on the type of error.
Some just tell you that a tile could not be found and others will cause minor delays.

About isCreature/isPlayer etc you are totally wrong.
If the creature is dead it no longer returns true on isCreature check. Neither if it is a player who logged out. It will only count as a creature if it is alive.
 
oh my...I did, and as I said, it checks if it's a creature, and it is, but its loged out. I've tested many ways im not just a random lua scripter >.<, mock's tool works so 1. is Solved.

Well its hard to understand your broken English as well as the fact that you're refusing to show us the script so it's hard to even help you. If you want more help I suggest showing the script because there's probably a different way to do it.
 
What is your problem now?
About isCreature/isPlayer etc you are totally wrong.
If the creature is dead it no longer returns true on isCreature check. Neither if it is a player who logged out. It will only count as a creature if it is alive.

I've tested many times and it returns true even if the creature is dead, that's the first thing I tried
-----------

@up
for example the error that should appear if the creature is not found (because it logged out, f.ex.), will make server lag?
 
as i said you first, that's only an advice, that piece of code couldn't work at all because the creature was not found, it shouldn't cause lag
 
Back
Top