How would I make an information panel?

I’ve been trying to make an admin panel/information UI where a person of a certain rank can access the panel and change the information across all players.

Admin script:

local box = script.Parent
local txt = box.Parent.Label

function change()
    txt.Text = box.Text
end

box.Changed:Connect(change)

I’m not very good at scripting these things, so could someone help out? TIA.

Assuming the “box” is a textbox, this would not work if it is a server script. A TextBox’s text is changed locally and only on that player’s client.

The script I used is a local script.

Is the box a TextBox and if it is, is the text changed by a different player?

Yes, it’s a text box. Also, it is changed by a different player.

Alright, that solves it then. I’m assuming you are trying to change the text of another player’s gui with another player’s local script. You can change the text with a local script, but it would not show for that player due to it being on another player’s client, therefore only changing it for that player.

What if I were trying to change everyone’s gui with a script?

if you were trying to change everyone’s gui, you would need to use a server script. But, to get the text in the TextBox, you would need to use a local script and a Remote Event. So, here’s the setup.
Local Script:

local box = script.Parent
local txt = box.Parent.Label
local event = script.Parent.Event --make a remote event named "Event"


function change() --I just changed the function a bit.
    event:FireServer(box.Text)
end

box.Changed:Connect(change)

Script:

local event = script.Parent.Event

event.OnServerEvent:Connect(function(plr, text)
    --you should probably do a security check here so no hacker can use this event.
    for i,v in pairs(game.Players:GetChildren) do --this is to do this for everyone.
        v.PlayerGui.--[[the path]].Text = text
    end
end)
1 Like