I am creating a notification menu, and I want every notification that pops up also make a message in the chat. I am doing this using RemoteEvent:FireClient(), but the module is used on both the server AND client. Is there any way I could make this so that it still fires on the client? Any help would be greatly appreciated.
Here is the script:
local module = {}
local NotifyTemplate = script:WaitForChild("NotificationTemplate")
function module:NotifyPlayer(player, text)
local PlayerGui = player:WaitForChild("PlayerGui")
local NotificationsGui = PlayerGui.Main:WaitForChild("Popups")
local newNotify = NotifyTemplate:Clone()
newNotify.Text = text
newNotify.Parent = NotificationsGui
newNotify.BackgroundColor3 = Color3.fromRGB(34, 87, 168)
local text_new_ = "[" .. text .. "]"
--HERE is the BUG:
game.ReplicatedStorage.Otherremotes.ChatMakeSystemMesage:FireClient(player ,text_new_)
newNotify:TweenSize(UDim2.new(0, 380,0, 28), Enum.EasingDirection.Out, Enum.EasingStyle.Back,0.15)
coroutine.wrap(function()
wait(3)
for t = 0,1,0.1 do
newNotify.BackgroundTransparency = t
newNotify.TextTransparency = t
wait()
end
wait(0.05)
newNotify:Destroy()
end)()
end
return module