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

How To Click For A GUI To Appear?

My question is how do you make it to where you click on a part and a GUI in your ServerStorage will appear on the players screen?

1 answer

It's kind of simple, though can be tricky. You need to use a ClickDetector on a part, and then clone the Gui. Here is the Simple Script.

local part = Instance.new("Part", workspace)
local clickDetector = Instance.new("ClickDetector", part)
 
local function onMouseClick(player)
	local clone = game.ServerStorage.<GUINAME(Remove<>s)>:Clone()
	local clone.parent = player.PlayerGui
end
clickDetector.MouseClick:connect(onMouseClick)

Here is my resources.

http://wiki.roblox.com/index.php?title=API:Class/ClickDetector http://wiki.roblox.com/index.php?title=API:Class/Instance/Clone

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