I've made a Gui which is kept in game.Lighting area. This Gui kills the player once they get given it, soo I don't want to put it in startergui. I'm trying to make a Gui which will have a textbox to type a players name, and a box to give that player the Gui. So it's a bit like a hand tool to player gui but instead it is a clone Gui from lighting and give to player Gui. One thing I'm stuck on is actually making the script to give the player the gui once I entered their name and pressed the button. Could anyone help?
SOLVED: Trying to make a Gui to give a player a gui from lighting, Anyone can help?
2 answers
I got what you want to do. Here's what you should do: (Script)
local textbox = 'TEXTBOX HERE!! with script.Parent blah blah'
local button = 'BUTTON HERE... Same thing like textbox'
local gui = 'GUI PATH HERE'
button.MouseButton1Click:Connect(function()
local clone = gui:Clone()
clone.Parent = game.Players:WaitForChild(textbox.Text).PlayerGui
end)
Try this and answer with the result.
Hello!
Note: Tested this and it works. If there is something you'd like me to change please comment and if this helps please accept this answer as correct because I put in quite some effort making this nice. The script is long because I use a lot of comments to explain what each line does. Thanks!
This script will check the text in the textbox, then will clone the gui from Lighting into the player with the name in the textbox's gui then disable the old one. On with the script and explanation:
First of all, it used to be a habit of mine too, but you shouldn't use Lighting to store things, just so you know. You can use it for this though if you'd like. For this, you will need to use a localscript (in a button) to bring in the other gui. This goes in the local script:
--VARIABLES--
local OtherGui = ... --choose your directory, change this to whatever it actually is
local CurrentGui = ... --same thing, this is the frame that the button is in right now
local textbox = ... --the text box
local playerToCloneTo = game.Players:WaitForChild(textbox.Text)
--FUNCTION--
function leftClick()
print("Button clicked!")
local OtherGuiClone = OtherGui:Clone()
OtherGuiClone.Parent = playerToCloneTo.PlayerGui --put in the player's gui
CurrentGui.Visible = false -- disable current gui, (optional or change however you want)
end
script.Parent.MouseButton1Click:Connect(leftClick)
Hope this helps! Happy holidays :D
2 comments
Hey, This script also worked! Thank you for the help, I'll try and start using other stuff to store things, thanks for the advice! Happy Holidays!
Pro tip: mark you problem as solved in the title so that people know this is closed and solved.
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
That's not going to work...
It does work. Try it yourself. Made a small fix about it cloning inside the player instead of playergui.
Yep, you fixed it. Mine works too by the way.
Hey, Thank you for the help! The script worked perfectly and is easy to understand how it works. Thank you!
No problem. Come to me if you have any problems again by just replying to this comment with the link to your question.
Hey I've found a problem which I need help with, https://scriptinghelpers.org/questions/91996/need-help-with-fixing-a-gui-giver-which-is-only-working-on-one-player