How would I go about with a graph that takes value from IntValue continuously?

Hi! I’m trying to make a graph that continuously records and shows the value and history of IntValue over time, and I’d like to ask if it is possible to be done without any extremely difficult concepts? I would just like to get some exposure in these kind of stuff.

1 Like

From what I could understand, you are wanting to record the value of an IntValue repeatedly. This could be done with a discord server and by using a webhook to post the information on the server page. This would record the values and post them on your discord server for you to review.

Sorry, I meant making a GUI graph from the IntValue

Can you specify what graph you are looking for? (e.g line graph, bar graph, pie chart)

A line graph would do, something like this image

You can use IntValue | Roblox Creator Documentation to listen for changes to the value

You can use tick() to record a timestamp when it changes.

Store the list of times and values in a table, maybe two. They might look at this during the game:

times = {173663.2, 173664.2, ...} -- got with tick()
values = {7, 4, ...} -- got with .Value

Then render the graph. The simplest way is to delete it and redraw it every frame.

Do this by looping from 1 to #times (or #values, they should always be the same length). Then calculate what position each data point should be on your GUI. This isn’t too hard to do. You basically want to map the range of the times and values (your X and Y axes) to ranges of pixel positions. Something like this.

Once you’ve turned your two data lists into a list of GUI positions, draw a line between consecutive points. There are many posts on the devforum for how to draw a line between two positions with a GUI.

1 Like