Server Message isnt showing to all the server

Hello everyone, today I made a gui that lets you send a message to the whole server, the problem is, that only the person who send it can see it, the rest of the server can’t, I think I know why, its maybe because its a Local Script, but I dont know how to fix it, if anyone could help, Id be very greatful, thank you!

Here are the scripts:

1st (Announce Script [Local Script])

   local frame = script.Parent.Frame
local button = script.Parent

button.MouseButton1Click:Connect(function()
	if frame.Visible == true then
		frame.Visible = false
	else
		frame.Visible = true
	end
end)

frame.Cancel.MouseButton1Click:Connect(function()
	frame.Visible = false
end)

frame.Announce.MouseButton1Click:Connect(function()
	local message = script.Parent.Frame.Announcement.Text
	game.ReplicatedStorage.Announce:FireServer(message)
end)

2nd (Announcement Script [Local Script])

game.ReplicatedStorage.Announce.OnClientEvent:Connect(function(message, plr)

wait(0.5)

script.Parent.Frame.Message.Text = message

script.Parent:TweenPosition(UDim2.new(-0.004, 0,-0.506, 0), "Out", "Back", 0.75)

wait(5)

script.Parent:TweenPosition(UDim2.new(-0.004, 0,-1.5, 0), "In", "Back", 0.75)

end)
3 Likes

Can we see the serverscript that receives the remote event?

Sure, here you go:

game.ReplicatedStorage.Announce.OnServerEvent:Connect(function(plr, meessage)

game.ReplicatedStorage.Announce:FireAllClients(meessage, plr)

end)

It worked fine for me when I added :WaitForChild() for Announce remote event in all 3 scripts, maybe that’s your problem?

The scripts itself are looking pretty great. Isn’t the issue that the script.Parent.Frame or script.Parent.Frame.Message is not getting visible? If this is the issue, then this edited version of the 2nd LocalScript might fix the issue.

game.ReplicatedStorage.Announce.OnClientEvent:Connect(function(message, plr)

    wait(0.5)
    
    script.Parent.Frame.Visible = true
    script.Parent.Frame.Message.Visible = true
    script.Parent.Frame.Message.Text = message

    script.Parent:TweenPosition(UDim2.new(-0.004, 0,-0.506, 0), "Out", "Back", 0.75)

    wait(5)

    script.Parent:TweenPosition(UDim2.new(-0.004, 0,-1.5, 0), "In", "Back", 0.75)

end)

In this case you might have to turn the visibility back off afterwards.

The frame with the message is visible, it works fine, the issue is that only the person who sent the message can see it, the rest of the server can’t. And I want to all the server to see it, like a “Server Message”, but ill try your script anyway

Let me try it, ill tell you if it works

Doesn’t work, the rest of the server still can’t see it

I modified the scripts with what you said, and I am still the only one to see the message, the rest of the server can’t, here are the scripts, in case you see an error.

Announcement Script

    game.ReplicatedStorage:WaitForChild("Announce").OnClientEvent:Connect(function(message, plr)

    wait(0.5)

    script.Parent.Frame.Message.Text = message

    script.Parent:TweenPosition(UDim2.new(-0.004, 0,-0.506, 0), "Out", "Back", 0.75)

    wait(5)

    script.Parent:TweenPosition(UDim2.new(-0.004, 0,-1.5, 0), "In", "Back", 0.75)

    end)

SSS Script

game.ReplicatedStorage:WaitForChild("Announce").OnServerEvent:Connect(function(plr, meessage)

game.ReplicatedStorage.Announce:FireAllClients(meessage, plr)

end)

Announce Script

local frame = script.Parent.Frame

local button = script.Parent

button.MouseButton1Click:Connect(function()

if frame.Visible == true then

frame.Visible = false

else

frame.Visible = true

end

end)

frame.Cancel.MouseButton1Click:Connect(function()

frame.Visible = false

end)

frame.Announce.MouseButton1Click:Connect(function()

local message = script.Parent.Frame.Announcement.Text

game.ReplicatedStorage:WaitForChild("Announce"):FireServer(message)

end)

Yet, looking at the script personally, I see no errors :confused:
I will do some tests in the studio

Maybe because the script is a Local Script? I think that if it was a Script everybody could see the message, but I don’t know I ain’t a scripter

no, it’s good to using fireAllClient()

1 Like

Okay so it’s working for me


I don’t know why is don’t work for you

SSS Script

game.ReplicatedStorage:WaitForChild("Announce").OnServerEvent:Connect(function(plr, meessage)

	game.ReplicatedStorage.Announce:FireAllClients(meessage, plr)

end)

Local Script (StarterPack not the best place i know)

game.ReplicatedStorage:WaitForChild("Announce").OnClientEvent:Connect(function(message, plr)

print(message..":"..plr.Name)

end)

Run game.ReplicatedStorage:WaitForChild("Announce"):FireServer("this is a test") in the console

Okay, let me try it, and ill tell you

It doesnt work, I think i forgot to tell you guys something, I dont know if this will be useful. But this is an admin panel, which only the admin team have acces. Its from there that the messages are sent.

And this is the Gui that appears when you send a meesage or announcement:

Well, if this is a admin panel all exploiter can currently call the remote because is not having any security in the server side . The rule one with the events Never trust the client
Here is a sample example of security

local users = { -- using the user id
-1, -- Player1
39842, -- Random number
}

function isAdmin(userID)
 for i, currID in pairs(users) do
  if userID == currID then
   return true
  end
 return false
end
end

Otherwise I can’t help you, the script works, it probably has something wrong with your code / gui but for me everything works

Should I make a separate button that appears if you are an admin? That button would activate the frame (admin panel)

No, exploiter can call directly the remoteEvent (running custom local script) you need to add the security in the remoteEvent (Server Side)

Okay, ill do it right now, and ill reply if something doesnt work