Can I send a net message to an Entity instead of player?
2 replies, posted
I made a sent that stores some information in a table and this information need to be synced between server and client, so I decided to use net messages whenever I the table gets updated, so that I could the updated table to client whenever it changes. The problem shows up when the player spawns more then one entity, because the data is the same on both of them. So I have being thinking can I send net messages to Entities instead of Players as a Player object is also an Entity, or there is a better alternative to keep a table stored in a specific entity?
If you're using ENT.MyTable inside your SENT, then that is why you're having this issue. You should be using the entity object when it spawns.
For example in the initialize hook of the entity you can do self.MyTable and it will stick to that table only.
Check this out: [url]http://facepunch.com/showthread.php?t=1383088[/url]
Works great and might simplify what you're looking to do.
Sorry, you need to Log In to post a reply to this thread.