colochosgt3
(eeeeeeeeeeeeeeeeeeee)
December 27, 2020, 1:34am
#1
I want when you click a button a TextBox will have the button text
This looks like a easy question but it dont works
i created a test that prints “click” when you click the button
function Click()
print("click")
end
script.Parent.MouseButton1Click:Connect(Click)
but i click the button and nothing happens
1 Like
script.Parent.MouseButton1Click:Connect(function()
print('click')
end)
colochosgt3
(eeeeeeeeeeeeeeeeeeee)
December 27, 2020, 1:36am
#3
i arleady tried these but still dont works
the image script are another test
@colochosgt3 Where is this script located?
@ExabyteDev His code and your code are the same.
1 Like
Is script.Parent
a button?
Hanfian
(Hanfian)
December 27, 2020, 1:38am
#6
local TextBox = script.Parent.TextBox -- or wherever the textbox is
function Click(Text)
TextBox.Text = Text
end
script.Parent.MouseButton1Click:Connect(function()
Click("Text to set")
end)
colochosgt3
(eeeeeeeeeeeeeeeeeeee)
December 27, 2020, 1:40am
#8
these still dont works
the Connection is that glitches
Ice_sound
(Ice_sound)
December 27, 2020, 1:44am
#9
So I tried your code at my game and it works so I think, that the problem is not in the code but at your output (Maybe you dont ticked “all messages”)
I hope that it was helpful.
colochosgt3
(eeeeeeeeeeeeeeeeeeee)
December 27, 2020, 1:44am
#10
Also the other buttons connection works
But this button connection dont works
Hanfian
(Hanfian)
December 27, 2020, 1:48am
#11
Your LocalScript might be under the wrong Parent. Shouldn’t it be under SendMessage button?
colochosgt3
(eeeeeeeeeeeeeeeeeeee)
December 27, 2020, 1:50am
#12
no i want in the all button
Tom_atoes
(Tom_atoes)
December 27, 2020, 1:51am
#13
TextBoxes don’t have a MouseButton1Click event, use a TextButton.
3 Likes
colochosgt3
(eeeeeeeeeeeeeeeeeeee)
December 27, 2020, 1:52am
#14
now i tried this script
script.Parent.MouseButton1Click:Connect(function()
script.Parent:Destroy()
end)
and this happens
colochosgt3
(eeeeeeeeeeeeeeeeeeee)
December 27, 2020, 1:53am
#15
These is not a TextBox its a TextButton
Ice_sound
(Ice_sound)
December 27, 2020, 1:54am
#16
In a roblox game, you cant get an output, a output is only active in roblox studio, so you cant get a message like “print(”…“)”
You can; it is called the Developer Console .
Ice_sound
(Ice_sound)
December 27, 2020, 1:57am
#19
Oh thanks, I´m kind of new and I didn´t know that so thx
colochosgt3
(eeeeeeeeeeeeeeeeeeee)
December 27, 2020, 2:02am
#20
umm i see a weird thing
when i put the button on another parent these works