game^StarterGui^ScreenGui^Frame^Textbutton - where here do i put it?
✓ ANSWER ACCEPTED
On a GUI, do i put the local script in the gui or frame or text button?
2 answers
✓ Accepted answer
You can put it in either the Frame or the Textbutton. If it's a button script, I recommend you put it in the TextButton, so it's a bit organized.
It's all a personal preference as long as the LocalScript is a descendant of StarterGui. Just remember you may have to change some things in the script depending on where you place it, i.e.
local Button = script.Parent -- Inside the TextButton
local Button = script.Parent.TextButton -- Inside the Frame
2 comments
0
ok, they both target the button right?
0
Correct
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
well it is gonna make the button diappear...(destroy it)
So, I recommend putting it in the button so the script goes away as well. Reduces lag on your part.