What solutions have you tried so far?
I didn’t find any solutions.
local function OnEventFired(filteredannouncemsg, name)
print(filteredannouncemsg)
print(name)
local ui = ReplicatedStorage.ScreenUis.Announcement:Clone()
ui.Parent = game.Players.LocalPlayer.PlayerGui
game.Players.LocalPlayer:WaitForChild("Announcement")
wait(.5)
ui.Frame.Announcement.Desc.Text = filteredannouncemsg
ui.Frame.Announcement.Name.Text = name
end
local function OnEventFired(announcementmessage, name)
for i, v in pairs(game:GetService("Players") do
local UI = game.ReplicatedStorage.ScreenUis.Announcement:Clone(v.PlayerGui)
ui.Frame.Announcement.Desc.Text = announcementmessage
ui.Frame.Announcement.Name.Text = name
end
end
local function OnEventFired(filteredannouncemsg, name)
print(filteredannouncemsg)
print(name)
local ui = game:GetService("ReplicatedStorage").ScreenUis.Announcement:Clone()
local guis = game:GetService("Players").LocalPlayer.PlayerGui
ui.Parent = guis
guis:WaitForChild("Announcement")
wait(.5)
guis:WaitForChild("Announcement").Desc.Text = filteredannouncemsg
guis:WaitForChild("Announcement").Name.Text = name
end
This should work, you wrote game.Players.LocalPlayer:WaitForChild(“Announcement”) while Announcement is inside the PlayerGui and not the localplayer itself!
i fixed alot of errors in your code, but the clone doesn’t seem to be working.
No errors, just the waitforchild warnings.
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
if player:GetRankInGroup(11704424) >= 248 then
local args = message:split(" ") -- Splits arguments.
if args[1]:lower() == "!announce" then -- Checks if the command was used.
local announcemsg = message:sub(args[1]:len() + 2,-1) -- Announce message in a variable.
local filteredannouncemsg = ChatService:FilterStringForBroadcast(announcemsg, player) -- Filters the message with the chat filter system. (Required by Roblox!)
wait(1) -- Waits 1 second so that the announce message is not sent to everyone before your command message.
for i, v in pairs(game:GetService("Players"):GetPlayers()) do
local UI = game.ReplicatedStorage.ScreenUis.Announcement:Clone(v.PlayerGui)
v.PlayerGui:WaitForChild("Announcement")
wait(.5)
UI:WaitForChild("Frame").Announcement.Desc.Text = filteredannouncemsg
UI:WaitForChild("Frame").Announcement.Name.Text = player.Name
end
end
end
end)
end)
The main error was from roblox not finding the text value in a name value, so I made a waitforchild function so roblox knows that i am looking for a child. But the solution post helped me out the most! Thanks