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

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

Asked by 7 years ago

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.

0
The point of ScriptingHelpers is for you to provide your code. We don't do all the work for you. Smaltin 46 — 7y

1 answer

Log in to vote
-1
Answered by
cabbler 1942 Moderation Voter
7 years ago
Edited 7 years ago
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)
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. TheeDeathCaster 2368 — 7y
0
You're being elitist and exaggerating, but okay. cabbler 1942 — 7y
0
I found it. I had to define mouse with mouse = plr:GetMouse(), tnx. Difined_Person 61 — 7y
Ad

Answer this question