Jump to content

[Help] Drawing text on element(s)


Kazafka

Recommended Posts

This, don't work. Idk why. Look:

addEventHandler("onClientRender", resourceRoot, function()
	dxDrawTextOnElement(localPlayer, "P L A Y E R", 1, 20, 0, 0, 255, 255, 1, "pricedown")
end)

Ofcourse, I have dxDrawTextOnElement() function in my script and script is in type client.

Edited by VaporZ
Link to comment
  • Moderators
2 hours ago, VaporZ said:

:(

ur right

:(

Why imma so dumb to not think about it and dont test it out.

PS.: I have 3rd grade from maths, thats why I guess

It has nothing to do with maths.

But with breaking down the instructions (for the computer) in to pieces and debug every piece individually.

 

When running this code you gave the computer 4 instructions.

1. Load the file

Runs a debug line if added.

2. Attach the eventhandler (returns true if attached, which is a value you can debug)

3. The event is fired, which calls the function you have attached.

If you did add a debug line here, you would have noticed that the code didn't run. (If the debug line is not visible, then there must have been something with the addEventHandler)

Hmmmmaybe compare the code to something similar that does work?

 

4. Call your custom function.

Check which value it returns.

 

This is something that takes time to learn. So maybe put some more time in debug your code in details. This will save you a lot of time in the long run.

 

 

 

Edited by IIYAMA
  • Like 1
  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...