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

How do I make these GUI functions?

Good afternoon.

I have two queries.

a) How do I make an in-game player search system? For example: player1 and player2 are in game. I search player2 and player2 comes up in a textbox.

b) How do I make a send GUI system? For example, after I search the user and locate him/her, I send a GUI and only he/she may view it.

Thanks in advance.

1 answer

The search system is easy to make:

Players = game:GetService("Players")

label = "player1"

for i, player in pairs(Players:GetPlayers()) do
	if player.Name == label then
		print("Player "..label.." found!")
	end
end

In case of the send GUI system, you may need to use RemoteEvents:

https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events

You could make a function where the player LocalScript fires an event after finding the player, and then the server reacts to that event by firing another one to the target player. The event parameters, would be, of course, the target player and the message string.

1 comment

0

Hi! I tried it, but it never finds the player.

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