Scriptz7
(Scriptz)
July 23, 2023, 1:12am
#1
Hello! My module is a tweening module so when the player presses a prompt, a notification pops up. I am currently getting the error of
ReplicatedStorage.NotificationClient:5: attempt to index nil with 'WaitForChild' - Server - NotificationClient:5
Here is my playerGUI localization code
local player = players.LocalPlayer
local playerGui = game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui')
local notifications = playerGui:WaitForChild('Notifications')
local container = notifications:WaitForChild("Container")
I will pay 50 robux to the first person to fix the problem
16 Likes
Scriptz7
(Scriptz)
July 23, 2023, 1:14am
#2
If you need more info, let me know
5 Likes
Is the notifications UI located in StarterGUI?
2 Likes
Scriptz7
(Scriptz)
July 23, 2023, 1:17am
#4
No in replicated storage. It is a child of my module
2 Likes
Scriptz7
(Scriptz)
July 23, 2023, 1:17am
#5
The script moves it to the PlayerGui
2 Likes
ZINTICK
(ZILLY)
July 23, 2023, 1:18am
#6
maybe get a wait before geting the gui?
2 Likes
can i see your workspace?
(chars)
2 Likes
Is the name for the notifications UI correctly spelled?
2 Likes
You’re using the module on the server. The server can’t use LocalPlayer
3 Likes
ZINTICK
(ZILLY)
July 23, 2023, 1:19am
#10
bruh i love how so many people cause of the 50 robux
6 Likes
maybe
wait(game:IsLoaded())
before the script
3 Likes
real
(chars limit is so annoying soooo)
2 Likes
i dont even care about that sweet 50 robux prize but when you make a player variables please use it
local player = players.LocalPlayer
local playerGui = player:WaitForChild('PlayerGui')
i just wanted to get that out of the way
3 Likes
Use the module outside of the server
then it should work
2 Likes
You have to use the module on the client (as in local scripts instead of server scripts), not on the server otherwise its unable to get the player
2 Likes
Scriptz7
(Scriptz)
July 23, 2023, 1:21am
#16
I knew that is the best way to get fast replies
3 Likes
Scriptz7
(Scriptz)
July 23, 2023, 1:21am
#17
Ohhhh I will try that now. Give me two seconds
2 Likes
I really hope i win that prize
3 Likes
Man you guys really want that 50 Robux
8 Likes
ZINTICK
(ZILLY)
July 23, 2023, 1:21am
#20
replicated storage if for client, so put ur module in a client based catagorie like replicated storage or starter player, Gui, or character
2 Likes