hello! im trying to make an announcement system. i think the problem may be the fact that a specific team has different guis (king has king gui and civilian has civilian gui). the king has a message typer and the civilian has the announcement show up when the king hits send. here are my two scripts:
script when leader hits send:
print(script.Parent.Parent.TextBox.Text)
game.ReplicatedStorage.Announced.Value = script.Parent.Parent.TextBox.Text
script.Parent.Parent.TextBox.Text = ""
script.Parent.Parent.TextBox.PlaceholderText = "Sent."
wait(0.75)
script.Parent.Parent.TextBox.PlaceholderText = "Type announcement here"
end)```
script for civilian that runs when the "Announced" value changes:
```local player = game.Players.LocalPlayer
local gui = player.PlayerGui.CitizenGui.framed.announcements.output
game.ReplicatedStorage:FindFirstChild("Announced").Changed:Connect(function()
local announcement = game.ReplicatedStorage.Announced.Value
local thetext = gui.TextLabel
thetext.Text = announcement
gui.Visible = true
wait(8)
gui.Visible = false
end)```
any help would be greatly appreciated!