I am trying to make a server Notify button but I don't know what to do about this error :/
The Notify Remote event is in the replicated storage
this script is in the GUI that recieves the server event (local script)
local Notify = RepStorage:WaitForChild("Notify") local GameTitle = Minigames:WaitForChild("Game") local GameDescription = Minigames:WaitForChild("Description") Notify.OnServerEvent:connect(function() GameTitle.Text = ("Title")--Sets notifications game title GameDescription.Text = ("game description")--sets notifications description end)
this script is in the other GUI that fires the event (local script)
local RepStorage = game:WaitForChild("ReplicatedStorage") local Notify = RepStorage:WaitForChild("Notify") local NotifyB = SRMenu:WaitForChild("Notify")-button local Wait = false NotifyB.MouseButton1Click:Connect(function() if Wait == false then Wait = true SRNotify:FireServer() SRNotifyB.Text = ("Notify Players...") wait(1) NotifyB.Text = ("Notify Players") Wait = false end end)
thanks for helping
The problem is that the mothed OnServerEvent
can only be called on the server and not the client (which is that local script you have)
You must Fire the Client on a Script (From the Server)
Since its a "Notification" meaning that you want the local players only and not the server to see it
I recommend to fire the client using the method FireClient
and also use the OnClientEvent
method too.
Remember :RemoteEvent = Server to Client or Client to Server (when you fire from the client)