Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Find a specific character?

Asked by 8 years ago

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.

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. OneTruePain 191 — 8y
0
I edited it for you. Conmmander 479 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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

Ad

Answer this question