Advertisement
LocalWendyLOL

通知函数

Jan 25th, 2025 (edited)
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. local a = {}
  2. local TweenService = game:GetService("TweenService") local RunService = game:GetService("RunService") function a:now(name, text, img, time)
  3. local gui = Instance.new("ScreenGui")
  4. gui.Parent = game.CoreGui
  5. local frame = Instance.new("Frame")
  6. frame.BackgroundTransparency = 0.3
  7. frame.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
  8. frame.Size = UDim2.new(0, 220, 0, 130)
  9. frame.AnchorPoint = Vector2.new(0, 1)
  10. frame.Position = UDim2.new(0, -250, 1, -20)
  11. frame.Parent = gui
  12. local uiCorner = Instance.new("UICorner")
  13. uiCorner.CornerRadius = UDim.new(0, 12)
  14. uiCorner.Parent = frame
  15. local uiStroke = Instance.new("UIStroke")
  16. uiStroke.Thickness = 2
  17. uiStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  18. uiStroke.LineJoinMode = Enum.LineJoinMode.Round
  19. uiStroke.Parent = frame
  20. local nameLabel = Instance.new("TextLabel")
  21. nameLabel.Text = name
  22. nameLabel.Font = Enum.Font.GothamBold
  23. nameLabel.TextSize = 16
  24. nameLabel.TextColor3 = Color3.new(1, 1, 1)
  25. nameLabel.BackgroundTransparency = 1
  26. nameLabel.Position = UDim2.new(1, -110, 0, 10)
  27. nameLabel.Size = UDim2.new(0, 100, 0, 20)
  28. nameLabel.TextXAlignment = Enum.TextXAlignment.Right
  29. nameLabel.Parent = frame
  30. local textLabel = Instance.new("TextLabel")
  31. textLabel.Text = text
  32. textLabel.Font = Enum.Font.Gotham
  33. textLabel.TextSize = 14
  34. textLabel.TextColor3 = Color3.new(1, 1, 1) textLabel.BackgroundTransparency = 1
  35. textLabel.Position = UDim2.new(0, 15, 0, 35)
  36. textLabel.Size = UDim2.new(1, -30, 0, 50)
  37. textLabel.TextWrapped = true
  38. textLabel.TextXAlignment = Enum.TextXAlignment.Left
  39. textLabel.TextYAlignment = Enum.TextYAlignment.Top
  40. textLabel.Parent = frame
  41. local imageContainer
  42. if img ~= "" then
  43. imageContainer = Instance.new("Frame")
  44. imageContainer.Size = UDim2.new(0, 60, 0, 60)
  45. imageContainer.Position = UDim2.new(0, 15, 1, -65)
  46. imageContainer.BackgroundTransparency = 1
  47. imageContainer.Parent = frame
  48. local imageLabel = Instance.new("ImageLabel")
  49. imageLabel.Image = img
  50. imageLabel.Size = UDim2.new(1, -8, 1, -8)
  51. imageLabel.Position = UDim2.new(0.5, 0, 0.5, 0)
  52. imageLabel.AnchorPoint = Vector2.new(0.5, 0.5)
  53. imageLabel.BackgroundTransparency = 1
  54. imageLabel.Parent = imageContainer
  55. local imageCorner = Instance.new("UICorner")
  56. imageCorner.CornerRadius = UDim.new(0, 8)
  57. imageCorner.Parent = imageLabel
  58. local imageStroke = Instance.new("UIStroke")
  59. imageStroke.Thickness = 1
  60. imageStroke.Color = Color3.new(0, 0, 0)
  61. imageStroke.Parent = imageLabel
  62. end
  63. local tween = TweenService:Create(frame, TweenInfo.new(
  64. time,
  65. Enum.EasingStyle.Quint,
  66. Enum.EasingDirection.Out
  67. ), {
  68. Position = UDim2.new(0, 20, 1, -20)
  69. })
  70. tween:Play()
  71. local hue = 0
  72. local connection
  73. connection = RunService.Heartbeat:Connect(function(deltaTime)
  74. hue = (hue + deltaTime * 0.6) % 1
  75. uiStroke.Color = Color3.fromHSV(hue, 0.8, 1)
  76. end)
  77. tween.Completed:Connect(function()
  78. connection:Disconnect()
  79. if imageContainer then
  80. imageContainer.Visible = false
  81. end
  82. local fadeTween = TweenService:Create(frame, TweenInfo.new(0.2), {
  83. BackgroundTransparency = 1
  84. })
  85. local strokeTween = TweenService:Create(uiStroke, TweenInfo.new(0.2), {
  86. Transparency = 1
  87. })
  88. local shrinkTween = TweenService:Create(frame, TweenInfo.new(0.3, Enum.EasingStyle.Quad), {
  89. Size = UDim2.new(0, 0, 0, 0),
  90. Position = UDim2.new(0, frame.AbsolutePosition.X, 1, -20)
  91. })
  92. fadeTween:Play()
  93. strokeTween:Play()
  94. shrinkTween:Play()
  95. task.wait(0.3)
  96. gui:Destroy()
  97. end)
  98. end
  99.  
  100. return a
  101. --[[
  102. 示例:
  103. a = loadstring(game:HttpGet("https://pastebin.com/raw/bUgHf3iT"))()
  104. a:now(" 通知 ", " 示例通知!.", "http://www.roblox.com/asset/?id=1764960410", 3)
  105. --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement