1. Does anyone know if this was changed/broken in the most recent update?

    I'm using this code: if not entity:ToPlayer() then return end
    (it's on OnEntityTakeDamage) and it is now always returning, even though I'm certain the damage being taken is from a player, this was working fine just a few days ago, but is now seemingly broken. Any ideas?
     
  2. Wulf

    Wulf Community Admin

    It works fine, many plugins use it, I use it in quite a few even. Make sure you are checking for null as well.
     
  3. Yes, I'm aware many plugins use it. m-Teleportation uses it, and it appears to broken in this plugin as well. And as I said before, I've changed literally nothing since the last update, in which it was working fine. Are you sure nothing has changed?
     
  4. Wulf

    Wulf Community Admin

    You can check in Rust's DLL, but the ToPlayer() method is still there. I've used it numerous times today as well, no issues from what I can tell.
     
  5. Hmm, ok. I'll try restarting my server, don't know what would've caused this. Thanks for replying, will post back if a restart fixed it.
     
  6. Wulf

    Wulf Community Admin

    Thinking about it though, I haven't tried it in Lua in awhile, but that shouldn't make any difference.
     
  7. Thanks for your help, a server restart *did* fix it, it was also not working with Godmode. Not sure why this happened, I wish I could figure out how/why this happened, though.
     
  8. Wulf

    Wulf Community Admin

    Likely a plugin set the entity globally to something invalid. You should always use local variables. ;)