View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-19-2022 , 18:34   Re: Request Deathmsg event to include
Reply With Quote #2

You've written the code such that the code is only executed if the player is alive in an event that signifies that the player is dead. Therefore, no code will even be executed.

As for general advice, I'd say that unless you have a whole bunch of conditions that would cause you to return from a function before the main code executes, you should simply put the main code in the if statement with the conditional negated. I.e. instead of saying if the user is not connected then return do if the user is connected then execute the code. It makes the code easier to understand and can help prevent introducing bugs like this one.

Also, I'm not really sure what your question is about. If you are asking about a specific line of code, you need to call that out somehow. Probably the simplest is to add another code block to your post with just the code you're referencing so that we can be sure we're looking for the correct spot in the larger code.
__________________
fysiks is offline