So I am creating a gui for a player and I want it to be cloned onto the players screen when the player clicks the button. Essantially it targets the player that clicked the button and clones the gui into the player. heres some code I started
script.Parent.SurfaceGui.TextButton.MouseButton1Down:connect(function() --This is where the screen gui for the person who clicked the button would be cloned from serverstorage end)
I basicly want to clone the gui inside the Character not the player. That way the gui shows up on only their screen.
If you want to clone anything from ServerStorage, the script that does the cloning has to be server-side, that is, in a Script rather than a LocalScript.
if you want to make a gui visible to only one player, you put it into the player's PlayerGui. It's always a child of the Player object.
Finally, to clone an object, use the method Instance:clone().