r/GLua • u/unknownperson0197 • Jul 10 '20
net.Start drawing 3d2d text on a entity
Need help when starting a net message and receiving it on the client it runs a function that draws text on the player, that all nearby players can see.
Basically im making a leveling system and one of the skills is a 10% of dodging attacks and when they successfully dodge a bullet, i want it to draw the word "Dodged!" next to the player so the attacker knows that they dodged it. Any help is appreciated!
1
Upvotes
1
u/Dak_Meme Jul 10 '20
What part is giving you trouble?
1
u/AdamNejm Jul 10 '20
Registered (pool) your net message.
Write all the needed data aka which player has dodged.
Use 'net' hook or 'net.Receive' to catch the message on the client.
In that you will probably want to check if the current player matches with the player you sent, if so you probably wanna do something else than drawing 3d2d text, otherwise run an appropriate render hook and in it start the 2d3d camera with coordinates offset from the received player (mb above his head or something, up to u). Draw the text, end the camera. You also want to save CurTime or similar when players receive the message, then compare it to the CurTime in the rendering hook, if it passes let's say 5 seconds, you call hook.Remove inside of the currently running render hook.
Sorry for formatting and lack of links, phone.