Notification Isn't Working

This is the error:

  14:09:02.083  SetCore is not a valid member of PlayerGui "Players.NubblyFry.PlayerGui"  -  Client - BaconHairGUIManager:20
  14:09:02.083  Stack Begin  -  Studio
  14:09:02.083  Script 'Players.NubblyFry.PlayerGui.BaconHairGUIManager', Line 20  -  Studio - BaconHairGUIManager:20
  14:09:02.083  Stack End  -  Studio
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event1 = ReplicatedStorage:WaitForChild("BaconHairQuest1")
local BaconHairText = script.Parent.BaconGui.DialogeFrame:WaitForChild("TextLabel")

local function typewrite(object, text)
	for i = 1,#text,1 do
		object.Text = string.sub(text,1,i)
		wait(0.05)
	end
end

Event1.OnClientEvent:Connect(function()
	script.Parent.BaconGui.DialogeFrame.Visible = true
	typewrite(BaconHairText, "Hello! Im Bacon, Do you need something?")
	wait(2)
	typewrite(BaconHairText, "Oh! You want to learn how to keep your ROBLOX Account Safe?")
	wait(4)
	typewrite(BaconHairText, "Ok! Try looking for Hackeres and scammers! Here is a Wacky Tacky that you can use!")
	
	script.Parent:SetCore("SendNotification", {
		Title = "Item Obtained!";
		Text = "You Have Obtained a Wacky Tacky!";
		Icon = nil;
		Duration = 5
	})
	
	wait(6)
	typewrite(BaconHairText, "I will help you if you encounter one ok?")
	wait(3)
	typewrite(BaconHairText, "You will be notified at the bottom of your screen if I say something")
	wait(4)
	typewrite(BaconHairText, "Goodluck!")
	
	while true do
		wait(3)
		script.Parent:SetCore("SendNotification", {
			Title = "Wacky Tacky";
			Text = math.random("Make Sure To Give Scammers no Infromation!", "Report The Scammers and Hackers!", "Avoid Free Robux Games!", "Dont enter your password into anything exept for the Official Roblox Website https://www.roblox.com");
			Icon = nil;
			Duration = 5
		})
	end
end)

This is a ServerScript or a Regular Script if you may ask.

1 Like

math.random is used for numbers. You’d want to do

local list = {} --insert phrases here
...
Text = list[math.random(1,#list)]
2 Likes

Try to use game.StarterGui:SetCore() instead of script.Parent:SetCore()

2 Likes

so wait, thats just for all strings?

For an e.g like this

local Strings = {"Cool", "Epic", "Idk", "Stop Reading this >:("}

print(math.random(1,#Strings) also does #Thing mean Table?
1 Like

print(math.random(Strings[1,#Strings]))

1 Like

Why starterGUI? Im trying to only do it for the players GUI

SetCore is a member of StarterGUI, not PlayerGUI.

2 Likes

14:09:02.083 SetCore is not a valid member of PlayerGui “Players.NubblyFry.PlayerGui” - Client - BaconHairGUIManager:20
14:09:02.083 Stack Begin - Studio
14:09:02.083 Script ‘Players.NubblyFry.PlayerGui.BaconHairGUIManager’, Line 20 - Studio - BaconHairGUIManager:20
14:09:02.083 Stack End - Studio

Only StarterGui has function :SetCore().

1 Like
  14:35:15.775  Players.NubblyFry.PlayerGui.BaconHairGUIManager:39: invalid argument #2 to 'random' (interval is empty)  -  Client - BaconHairGUIManager:39
  14:35:15.776  Stack Begin  -  Studio
  14:35:15.777  Script 'Players.NubblyFry.PlayerGui.BaconHairGUIManager', Line 39  -  Studio - BaconHairGUIManager:39
  14:35:15.777  Stack End  -  Studio

The script didn’t work at this point:

	while true do
		wait(3)
		game.StarterGui:SetCore("SendNotification", {
			Title = "Wacky Tacky";
			Text = RandomizedWTText[math.random(1,#RandomizedWTText)];
			Icon = nil;
			Duration = 5
		})
	end
end)

is RandomizedWTText = {"Make Sure To Give Scammers no Infromation!", "Report The Scammers and Hackers!", "Avoid Free Robux Games!", "Dont enter your password into anything exept for the Official Roblox Website https://www.roblox.com"} ?

1 Like

NO NOT AT ALL LOL, I FROGOT TO INSERT THE STUFF IN THEIR

Im dumb lol