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

Cloning a GUI into PlayerGui from a SurfaceGui click?

As the title suggests, what I'm trying do is when a button upon a SurfaceGui is clicked, a Gui inside the SurfaceGui is cloned into the Player's PlayerGui.

script.Parent.MouseButton1Click:connect(function(player)
	clone=script.Parent.CheckIn:Clone()
	clone.Parent=player.PlayerGui
	if game:GetService("MarketplaceService"):PlayerOwnsAsset(player,311514562) then
		clone.Frame.Pro.Value=true
		print("Owns Pro")
	elseif game:GetService("MarketplaceService"):PlayerOwnsAsset(player,311513602) then
		clone.Frame.Eco.Value=true
	end
end)

1 answer

✓ Accepted answer

The SurfaceGui needs to be in PlayerGui

It's a small detail of how the SurfaceGuis work meaning that in order to get the Player that interacted with it, it needs to be in the PlayerGui. I'm sure you can work it out from there.

If you're not sure, you need to use the Adornee property to stick it on the Part.

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