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

How to print the object's name with a GUI?

Hello, I've been testing, but it wouldn't work.

I've been trying to script with a GUI, that once you click something it will print the objects name. But it wouldn't work. I was trying it with a GUI and only that. I didn't want to use any tools.

Can you help me? The idea is: You can click a object with a GUI, without any tools equiped.

Please help me, It would help if you left a script for me.

1 comment

0

The point of ScriptingHelpers is for you to provide your code. We don't do all the work for you.

1 answer

✓ Accepted answer
mouse.Button1Down:connect(function() --mouse clicked
	--mouse.Target is the part it touches
	gui.TextLabel.Text = tostring(mouse.Target) --set the gui text to its name
end)

3 comments

0

Don't just post code; explain the reasoning behind your answer, otherwise the OP will not understand the reasoning behind your answer; your answer is very, very vague.

0

You're being elitist and exaggerating, but okay.

0

I found it. I had to define mouse with mouse = plr:GetMouse(), tnx.

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