Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Find a specific character?

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.

2 comments

0

Could you be a little more specific? I'm not sure if you're trying to get the player from the character, but I do know that areSurfaceGuis  inside the PlayerGui so it knows what player is interacting with it.

0

I edited it for you.

1 answer

✓ Accepted answer

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().

This discussion is preserved as it was. New answers, comments, and votes are closed.