Admin Commands Problem

I’m making some admin commands but whenever I use my sendNotification(title, content, theme, player), it’s just won’t send it.

Function Code:

function Core.SendNotification(title, content, theme, player)
	local UI = game:GetService("ServerScriptService").ModerationPackageV1.UserInterface.ModerationPackageV1
	local notifUI
	if theme == "Light" then
		notifUI = UI.LightNotif:Clone()
		notifUI.Name = "LightNotifRequest"
	elseif theme == "Dark" then
		notifUI = UI.DarkNotif:Clone()
		notifUI.Name = "DarkNotifRequest"
		return warn("[ModerationPackageV1>Modules>Core>SendNotification] Invalid theme provided in settings.")
	notifUI.Title.Text = title
	notifUI.Content.Text = content
	notifUI.Parent = game:GetService("Players")[player].PlayerGui
	game:GetService("Players")[player].PlayerGui[notifUI.Name].Visible = true
1 Like

Im no Genius or nothing but Im pretty sure you would put “Core.SendNotification(title,content,theme,player)” below the function

If I do that right below it, I’m calling it again, which will cause a loop.