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

How to make a GUI show up to a specific player?

I have a GUi currently named "BannedGUI" and what I want is, if you enter anyone's name into the script (like an admin script) the GUI will show up.

1 answer

✓ Accepted answer

A way how you could do it and easiest way would probably to already have the Gui made and put it in StarterGui, but change the Visible property of it to false. Then run a code to see if it's the person it's looking for, and then change the Visible to true. Such as:

game.Players.PlayerAdded:connect(function(player)
	if player.Name == "BannedNameHere" then
		player.PlayerGui.BannedGUI.Visible = true
	end
end)

Or if you had a string of players who are banned, you could put them in a table and then run through it:

bannedList = {"1x1x1x1", "Telamon", "BannedName"}

game.Players.PlayerAdded:connect(function(player)
	for i, v in pairs(bannedList) do
		if player.Name == v then
			player.PlayerGui.BannedGUI.Visible = true
		end
	end
end)

If this wasn't specific enough, let me know!

5 comments

0

Alright thank you. This might also help me with tables, too!

0

Good to know!

0

One problem: in the GUI object, there's no "Visible" property to it. Do I put it in the frame?

0

Yes, if there is no Visible property, then put it into a frame, and change the frame's Visibility. It will do virtually the same thing

0

I have the frame's visiblity set to false. This is a little confusing.

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