Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make all players in the server to be in textbuttons and how to notify them?

Asked by 3 years ago
Edited 3 years ago

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

0
game.Players.LocalPlayer.Name valk_3D 140 — 3y
0
ok thanks starmarine642523 2 — 3y
0
is that also for the one player to be able to see all the players in the textbuttons or no? starmarine642523 2 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

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

0
ok i will try starmarine642523 2 — 3y
0
ok idk how to make the players in the table go into a textbutton starmarine642523 2 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

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.

Answer this question