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

How to make it so when you press an object a ui is visible for that player only?

Ive been stuck :/ read the title please. Any help?

3 comments

0

Like a screen gui? Billboard gui? Info please

0

Oh jus realised its not a gui, Its and actual ui. thought you mispelled, Not sure

0

yes it is a screen gui I would like to make it so when I press a locker a screen gui

1 answer

-not a request site :/-

But, this is easy anyways.

local plr = game.Players.LocalPlayer --gets the player
local ui = plr.PlayerGui.ScreenGui.Frame --gets your ui

script.Parent.ClickDetector.MouseClick:Connect(function(player) --detects a click function
	if player == plr then -- if the player parameter equals the given variable...
		ui.Visible = true --then it will turn on
else
		ui.Visible = false --or else, it will not be
	end
end)

I was in a rush to write this, so idk if it's fully correct, but I'm pretty sure it is. Hope it helps!

1 comment

0

Accept this answer if it was right jsyk

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