Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I print things from the output onto GUIs on Roblox?

konichiwa, im D3vBhavesh. so i have a quick question with coding on roblox today. how can i have things printed out into GUIs on roblox? to be more precise here's a script:

local m = 5
local c = 2

print(m+c)

this is just a small example. im going for something a bit more difficult and more structured than this, but this is just a quick example of a block of code. now, i want m+c to be printed onto a textLabel on a frame in a screen GUI on Roblox.

i would like to know how i can do this. what exact library do I need to use? if anyone has like a... bit of api reference to share with me for this so i can do this or a block of code to test out myself and tweak, that would be awesome. thank you for your time.

arigato & sayonara. :)

3 comments

0

ps. i know how to put text on a text label and make a text button and text box work. 

0

i dont think it's possible to take outputs from dev console

0

Contact the Discord in my Bio, I'll help you through this.

2 answers

✓ Accepted answer

You can use LogService's .MessageOut RBXScriptSignal:

game:GetService("LogService").MessageOut:Connect(print)

2 comments

0

oh.. i never knew about this service, thank you. so even if i did something like math.random in the script, it would print out on my text label, text button, etc, once i put another part or two of the script together, right? thanks again.

0

Mhm

You would have it formatted like

local m = 5
local c = 2

script.Parent.Text = m+c

assuming you're doing this inside a textlabel, textbutton, etc.

1 comment

0

this is exactly what I was thinking after like 5 minutes of posting this lmao. thank you. now, what if I wanted random number to pop up on the textLabel, textButton, etc, and then type my answer into text box? I'd only like to know the math.random bit cuz it says that it won't allow me to do this because NumberValue isn't valid. thanks again.

This discussion is preserved as it was. New answers, comments, and votes are closed.