but, thats not even how modules work, whats the point than of using a module?
Because modules stop you from having to re type the functions every time you make a script
Didnt fix it, I ran the module in a local script and didnt change anything
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â)
21:39:02.689 ReplicatedStorage.NotificationClient:5: attempt to index nil with ânameâ - Server - NotificationClient:5 This is the error
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")
Nope, If anyone wants a copy of the game to try and fix it, Ill pay 50 robux to the person who fixes it
Give it to me, please! i accept the challenge!
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
I wonât leak it because leaking and stealing is wrong
Yes thank you very much. Let me know if you get the fix
Did you download it? If so, I will delete the post
Yes i did download it! you can delete it now
the problem is modulescripts and server scripts cant access the LocalPlayer unless the module was required from a localscript
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.
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
You were saying the opposite before
Is the notification supposed to say something like, âYou gave this customer a 0$ dollar haircutâ?
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
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