Script randomly broke without modification?

i was working on a notification system, it worked fine yesterday i opened studio and kept getting the error “attempt to index nil with Type”

-- Client -- StarterPlayerScripts

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ReplicatedFirst = game:GetService("ReplicatedFirst")

local StarterGui = game:GetService("StarterGui")

local Event = ReplicatedStorage:WaitForChild("Event")

Event.OnClientEvent:Connect(function(Player, Args)
	local s,e = pcall(function()
		if Args.Type == "sendNotification" then
			StarterGui:SetCore("sendNotification", Args.Info)
		end
	end)
	
	if not s then
		warn(e)
	end
end)

and

-- ReplicatedStorage

local Network = {}

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage:WaitForChild("Event")

function Network.send(Player, Args)
	Event:FireClient(Player, Args)
end

return Network

i have no clue what happens i require the module and type

Network.send(Player, {Type = "sendNotification", Info = {
   Title = "Test";
   Text =  "Test";
   Duration = 5;
   Button1 = "Test";
}})

-- Client -- StarterPlayerScripts

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ReplicatedFirst = game:GetService("ReplicatedFirst")

local StarterGui = game:GetService("StarterGui")

local Event = ReplicatedStorage:WaitForChild("Event")

Event.OnClientEvent:Connect(function(Args)
	local s,e = pcall(function()
		if Args.Type == "sendNotification" then
			StarterGui:SetCore("sendNotification", Args.Info)
		end
	end)
	
	if not s then
		warn(e)
	end
end)

Client event does not take an argument of player

i. am. stupid – 30. . . . . .

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.