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.
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.
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)