Hello Programmers,
Could someone possible help me figure out why this error occurred and how I can fix it?
Error Message:
Script grabbing the object.
function module:create_Basic_Frame(player : Player, gui : ScreenGui, Title : string, Info : string)
local Frame = nil
local created, err = pcall(function()
if player and gui and Title and Info then
Frame = script:WaitForChild("Frame_Folder"):WaitForChild("Basic_Notif"):Clone()
Frame:WaitForChild("Title").Text = Title
Frame:WaitForChild("Info").Text = Info
Frame.Parent = gui:WaitForChild("List")
Frame.Notification_Sound:Play()
Animate_Gui(gui, Frame)
end
end)
if created then
warn("Succesfully created Frame!")
return Frame
else
error("An error occured creating Frame: ", err)
end
end
Script receiving Object
function Notif_Mod.Basic_Notification(player : Player, Title : string, Info : string)
if player and Title and Info then
if player:IsA("Player") then -- Checks if player is valid
if not player.PlayerGui:FindFirstChild("NotifGui") then Notif_Mod.Add_NotifGui(player) end
local gui = player.PlayerGui:FindFirstChild("NotifGui")
local Frame = Frame_Creator.create_Basic_Frame(player, gui, Title, Info)
Add_Table(player, Title, Frame)
task.delay(7.5, function()
game:GetService("TweenService"):Create(Frame, TweenInfo.new(0.5), {Position = UDim2.new(0, Frame.Position.X.Offset, Frame.Position.Y.Scale, Frame.Position.Y.Offset)}):Play()
task.wait(1)
Frame:Remove()
end)
else
error("Player is either invalid or not a player!") -- Error Message
end
else
warn("One of the values are missing or nil!")
end
end