How to send a notification?

Hi everyone, I have this function that reset player’s stats when they want to, and that works fine, although I would like a notification to be sent to them to confirm that their stats have indeed been reset. I tried the code bellow although it didn’t work. How can I fix this? This script is located in ServerScriptService and happens when a RemoteEvent is fired. Reseting the stats work but sending the notification doesn’t.

local StarterGui = game:GetService("StarterGui")

game.ReplicatedStorage.ResetStats.OnServerEvent:Connect(function(player)
	player.leaderstats.Points.Value = 0
	player.leaderstats.Deaths.Value = 0
	player.leaderstats.Activations.Value = 0
	player.leaderstats.Wins.Value = 0
	StarterGui:SetCore("SendNotification", {
		Title = "Stats Reset";
		Text = "Your stats have succesfully been reset"
	})
end)
10 Likes

:SetCore has to be executed locally.

15 Likes