Hello! This is a little function I am making to notify the player, but it's not working. Does anyone know why? Script:
local player = game:GetService("Players").iiDkOffical -- will be replaced
local NotificationFrame = Instance.new("TextLabel")
local CmdBlurEffect = Instance.new("BlurEffect")
local Main = Instance.new("Folder")
local ScreenGui = Instance.new("ScreenGui",player.PlayerGui)
NotificationFrame.Name = "NotificationFrame"
NotificationFrame.Parent = ScreenGui
NotificationFrame.AnchorPoint = Vector2.new(0.5, 0)
NotificationFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
NotificationFrame.BackgroundTransparency = 1.000
NotificationFrame.BorderSizePixel = 0
NotificationFrame.Position = UDim2.new(0.5, 0, -0.5, 0) -- UDim2.new(0.5, 0, 0.0250000004, 0)
NotificationFrame.Size = UDim2.new(0.5, 0, 0, 20)
NotificationFrame.Visible = false
NotificationFrame.Font = Enum.Font.SourceSans
NotificationFrame.Text = ""
NotificationFrame.TextColor3 = Color3.fromRGB(255, 255, 255)
NotificationFrame.TextSize = 20.000
NotificationFrame.TextStrokeTransparency = 0.800
NotificationFrame.TextWrapped = true
NotificationFrame.TextYAlignment = Enum.TextYAlignment.Top
function Notify(message, possibletimer)
spawn(function()
local Notification = NotificationFrame:Clone()
Notification.Name = "-NewNotification"
Notification.Parent = Main
Notification.Visible = true
Notification.Text = tostring(message)
game:GetService("TweenService"):Create(Notification, TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {TextTransparency = 0, TextStrokeTransparency = 0.8, Position = UDim2.new(0.5, 0, 0.0250000004, 0)}):Play()
local NotificationRemove = false
local Timer = 1
if typeof(possibletimer) == "table" and typeof(possibletimer[1]) == "number" and typeof(possibletimer[2]) == "number" and typeof(possibletimer[3]) == "number" then
spawn(function()
for i = possibletimer[1], possibletimer[2], -possibletimer[3] do
Timer = i
if NotificationRemove == false and Timer > 0 then
wait(possibletimer[3])
else
break
end
end
if NotificationRemove == false then
NotificationRemove = true
end
end)
end
repeat
if typeof(possibletimer) == "table" and typeof(possibletimer[1]) == "number" and typeof(possibletimer[2]) == "number" and typeof(possibletimer[3]) == "number" then
Notification.Text = tostring(message) .. "\n(" .. Timer .. ")"
else
Notification.Text = tostring(message)
end
Notification.Size = UDim2.new(0.5, 0, 9e9, 0)
Notification.Size = UDim2.new(0.5, 0, Notification.TextBounds.Y, 0)
wait()
until Timer <= 0
game:GetService("TweenService"):Create(Notification, TweenInfo.new(0.25, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {TextTransparency = 1, TextStrokeTransparency = 1, Position = UDim2.new(0.5, 0, -0.5, 0)}):Play()
wait(0.25)
Notification:Destroy()
end)
end
Notify("hii kevin :)", {10, 1, 1})
