[50 ROBUX FOR FIX] Module can't locate PlayerGui

but, thats not even how modules work, whats the point than of using a module?

1 Like

Because modules stop you from having to re type the functions every time you make a script

1 Like

Didnt fix it, I ran the module in a local script and didnt change anything

2 Likes

local player = players.LocalPlayer
print(player.name)
local playerGui = game:GetService(‘Players’).LocalPlayer:WaitForChild(‘PlayerGui’)
print(playergui.parent)
local notifications = playerGui:WaitForChild(‘Notifications’)
local container = notifications:WaitForChild(“Container”)

1 Like

21:39:02.689 ReplicatedStorage.NotificationClient:5: attempt to index nil with ‘name’ - Server - NotificationClient:5 This is the error

1 Like

try this
idk why i didnt see it before

local player = game.players.LocalPlayer
local playerGui = game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui')
print(playergui.parent)
local notifications = playerGui:WaitForChild('Notifications')
local container = notifications:WaitForChild("Container")
1 Like

Nope, If anyone wants a copy of the game to try and fix it, Ill pay 50 robux to the person who fixes it

1 Like

Give it to me, please! i accept the challenge!

1 Like

sir ive just realized that local player can not be taken from a module script lol and i there is other parts of the scripts post them so maybe i can transfer it to a local script @Scriptz7

1 Like

I won’t leak it because leaking and stealing is wrong

1 Like

Yes thank you very much. Let me know if you get the fix

1 Like

Did you download it? If so, I will delete the post

1 Like

Yes i did download it! you can delete it now

1 Like

the problem is modulescripts and server scripts cant access the LocalPlayer unless the module was required from a localscript

2 Likes

All of this seems pointless you should just be requiring the module on the client, if you do not want to do that, then I suggest you fire a remote from the client (after you have required the module on the server on start of runtime) and then add a listener event (remote event) on the ModuleScript and you can fetch the player parameter from there.

3 Likes

there you go, finally, module scripts purpose is to make retyping code a no problemo, so do what ever your doing, make it into a function, than require it from a local script, and than put the parameters as the local player, and than pass the parametes in the local script and than done! @Scriptz7

1 Like

You were saying the opposite before

1 Like

Is the notification supposed to say something like, “You gave this customer a 0$ dollar haircut”?

1 Like

sorry man I truly didnt understand you but now I realize i should’ve never doubted a green skinned cow lol jk u were right lol just didnt understand u lol, u fr should get the robux @ATotallyRandomAlt ,

this is the answer here @Scriptz7

1 Like

Because if so, I the ui pops up. And works perfectly fine. The code is:

local tweenService = game:GetService("TweenService")
local players = game:GetService("Players")

local player = players.LocalPlayer or players.PlayerAdded:Wait()

print(player.name)
local playerGui = player:WaitForChild("PlayerGui")
print(playerGui.Parent)

local notifications = playerGui:WaitForChild("Notifications")
local container = notifications:WaitForChild("Container")


local notificationTemplate = script:WaitForChild("NotificationTemplate")
local orginalTemplateSize = notificationTemplate.Size

local module = {}

function module.Notify(Text, TextBG, duration)
	local newNotification = notificationTemplate:Clone()
	newNotification.Size = UDim2.fromScale(0, 0)
	
	newNotification.ImageTransparency = 1
	newNotification.NotificationText.Transparency = 1
	newNotification.NotificationText.Text = Text
	newNotification.NotificationTextBG.Text = TextBG
	newNotification.NotificationTextBG.TextColor3 = Color3.new(0, 0, 0)
	
	newNotification.Parent = container
	
	tweenService:Create(newNotification, TweenInfo.new(0.3), {ImageTransparency = 0}):Play()
	tweenService:Create(newNotification.NotificationText, TweenInfo.new(0.3), {BackgroundTransparency = 1}):Play()
	tweenService:Create(newNotification.NotificationTextBG, TweenInfo.new(0.3), {BackgroundTransparency = 1}):Play()
	tweenService:Create(newNotification.NotificationText, TweenInfo.new(0.3), {TextTransparency = 0}):Play()
	tweenService:Create(newNotification.NotificationTextBG, TweenInfo.new(0.3), {TextTransparency = 0}):Play()
	
	tweenService:Create(newNotification, TweenInfo.new(0.8 , Enum.EasingStyle.Elastic, Enum.EasingDirection.Out), {Size = orginalTemplateSize}):Play()
	print("TweenedIN")
	
	task.wait(duration)
	
	tweenService:Create(newNotification, TweenInfo.new(0.2), {ImageTransparency = 1}):Play()
	tweenService:Create(newNotification.NotificationText, TweenInfo.new(0.3), {BackgroundTransparency = 1}):Play()
	tweenService:Create(newNotification.NotificationTextBG, TweenInfo.new(0.3), {BackgroundTransparency = 1}):Play()
	tweenService:Create(newNotification.NotificationText, TweenInfo.new(0.3), {TextTransparency = 1}):Play()
	tweenService:Create(newNotification.NotificationTextBG, TweenInfo.new(0.3), {TextTransparency = 1}):Play()

	tweenService:Create(newNotification, TweenInfo.new(0.4 , Enum.EasingStyle.Elastic, Enum.EasingDirection.Out), {Size = UDim2.fromScale(0,0)}):Play()

	task.wait(1)
	print("TweenedOut")
	newNotification:Destroy()
end

return module
1 Like