Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago
Edited 3 years ago

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. :)

0
ps. i know how to put text on a text label and make a text button and text box work.  D3vBhavesh 2 — 3y
0
i dont think it's possible to take outputs from dev console WINDOWS10XPRO 438 — 3y
0
Contact the Discord in my Bio, I'll help you through this. Ziffixture 6913 — 3y

2 answers

Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
3 years ago

You can use LogService's .MessageOut RBXScriptSignal:

game:GetService("LogService").MessageOut:Connect(print)
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. D3vBhavesh 2 — 3y
0
Mhm Ziffixture 6913 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

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.

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. D3vBhavesh 2 — 3y

Answer this question