Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[ANSWERED] Why won't notification pop up, when a player joins the sever/game?

I have used an RemoteEvent for it, but it not working.

Here what it looks like.

https://prntscr.com/mo8p9r

Code in the script.

local player = game:GetService("Players")
local ReplicatedStorage = game.GetService("ReplicatedStorage")
local Notification = ReplicatedStorage:WaitForChild("Notification")

Notification:FireAllClients("Test","Test")

Code in the LocalScript.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")
local Notification = ReplicatedStorage:WaitForChild("Notification")

Notification.OnClientEvent:Connect(function(Title, Description)
	if Title and Description then
		StarterGui:SetCore("SendNotification", {
			Title = Title;
			Text = Description;
		}}
	end
end)

Could someone help me please.

5 comments

0

nice syntax in your first script on line 2

0

Most likely because the event is fired before the player joins and listens for it.

0

If you want something to happen upon players joining use Players.PlayerAdded

0

'game.GetService' 

0

that is definitely his problem: a syntax error

1 answer

✓ Accepted answer

Server Script

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Notification = ReplicatedStorage:WaitForChild("Notification")

game.Players.PlayerAdded:Connect(function(player)
	Notification:FireAllClients("Test", "Test")
end)

ISSUE: To use :GetService() correctly, you must have a Colon before it, instead of a Period

Local Script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")
local Notification = ReplicatedStorage:WaitForChild("Notification")

Notification.OnClientEvent:Connect(function(Title, Description)
	if Title and Description then
		StarterGui:SetCore("SendNotification", {
			Title = Title;
			Text = Description;
        })
    end
end)

ISSUE: Your second parenthesis was a bracket "}" when it should be ")"

I also added the game.Players.PlayerAdded Function since you want this to fire every time a player joins the game, since otherwise, you would be firing to nil clients.

1 comment

0

Thank you^

This discussion is preserved as it was. New answers, comments, and votes are closed.