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 all players in the server to be in textbuttons and how to notify them?

I don't have any idea how to put all the players in a server into textbuttons then when they are clicked by the textbutton with their name they get notified i am still trying to figure out but i don't have a clue of how i would start it if i am not clear then i will make it more clear Also if you want to know i am trying to make a phone where you can call people through it.

I have this

script.parent.Text = "whatever "..game.Players.LocalPlayer.." whatever"

and it works but i am not sure if it will put the other player's name on it if you know if that will happen then please tell me

3 comments

0

game.Players.LocalPlayer.Name

0

ok thanks

0

is that also for the one player to be able to see all the players in the textbuttons or no?

2 answers

I do have an idea. You can use the PlayerAdded event to add people to a table. Then, you’d just have to make the table show up on a text button. As for the notifying thing, you’d have to use a remote. Not sure what you would do there though

2 comments

0

ok i will try

0

ok idk how to make the players in the table go into a textbutton

For making players go into a text button you can try this. (Sorry if this doesnt work)

game.Players.PlayerAdded:Connect(function(plr)
	local Button = Instance.new("TextButton")
	local ClickScript = [the script to detect a click]:Clone()
	ClickScript.Parent = Button
	Button.Name = plr.Name
	Button.Text = plr.Name
	Button.Parent = [the gui]
end)

game.Players.PlayerRemoving:Connect(function(plr)
	for _, e in pairs([the gui]:GetChildren()) do
		if e.Name = plr.Name then
		e:Destroy()
	end
end)

This script is just for adding the buttons. This does not handle clicking the buttons, sending remote events to the client side, or making the buttons look nice/sorting them. It just creates them and puts them into the gui.

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