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

Where does a Gui need to be put to appear only to the player that activates it?

Such as a player pressing a button, a Gui pops up for them. Does it go to PlayerGui?

3 comments

0

yes, you should clone/ instance a gui into the PlayerGui

0

Ok, appreciate it.

0

the playergui should only be used on the client, as other people(in game) can't see your screen nor your screen guis

1 answer

✓ Accepted answer

Alright so first you need to know that your game consists of server and client.

So, when the players (clients) join your game, their client copyies data from server and it becames their world. So, every player has a Instance PlayerGui for User Interface (UI).

You need to know that Normal Scripts will work in Workspace and ServerScriptService, Local Scripts will work in StarterGui, StarterGear.

So, make a part in Workspace and put Instance called ClickDetector inside it.

Now, we need to connect a GUI and a part together.

Make an GUI and put it in StarterGui, also put this LocalScript inside GUI!

Local Script:

local part = game.Workspace:WaitForChild("Block Name") -- Defines a PART inside WORKSPACE

local OpenTime = 0 -- Time for GUI to open when PART is pressed

local ClickDetector = part:WaitForChild("ClickDetector") -- Defines a CLICKDETECTOR instance you put in PART.


function Click()

wait(OpenTime) -- Time before GUI opens.

if script.Parent.Enabled == false then
   script.Parent.Enabled = true
end

end

-- Script Logic
ClickDetector.MouseClicked:Connect(Click)

Make sure to disable GUI's visibility when you finish by DISABLING Option called "Enabled" inside a properties of GUI.

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