Hasli4

CaughtMessage

Aug 3rd, 2026
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.77 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3.  
  4. local player = Players.LocalPlayer
  5. local caughtEvent = ReplicatedStorage:WaitForChild("CaughtEvent")
  6.  
  7. -- Создаём интерфейс
  8. local screenGui = Instance.new("ScreenGui")
  9. screenGui.Name = "CaughtGui"
  10. screenGui.ResetOnSpawn = false
  11. screenGui.IgnoreGuiInset = true
  12. screenGui.Parent = player:WaitForChild("PlayerGui")
  13.  
  14. -- Создаём надпись
  15. local messageLabel = Instance.new("TextLabel")
  16. messageLabel.Name = "MessageLabel"
  17.  
  18. messageLabel.AnchorPoint = Vector2.new(0.5, 0.5)
  19. messageLabel.Position = UDim2.fromScale(0.5, 0.2)
  20. messageLabel.Size = UDim2.fromScale(0.6, 0.12)
  21.  
  22. messageLabel.BackgroundColor3 = Color3.fromRGB(35, 25, 10)
  23. messageLabel.BackgroundTransparency = 0.15
  24.  
  25. messageLabel.TextColor3 = Color3.fromRGB(255, 220, 60)
  26. messageLabel.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
  27. messageLabel.TextStrokeTransparency = 0.3
  28.  
  29. messageLabel.Font = Enum.Font.GothamBold
  30. messageLabel.TextScaled = true
  31. messageLabel.TextWrapped = true
  32.  
  33. messageLabel.Visible = false
  34. messageLabel.Parent = screenGui
  35.  
  36. -- Закругляем углы
  37. local corner = Instance.new("UICorner")
  38. corner.CornerRadius = UDim.new(0, 14)
  39. corner.Parent = messageLabel
  40.  
  41. -- Добавляем обводку
  42. local stroke = Instance.new("UIStroke")
  43. stroke.Color = Color3.fromRGB(255, 210, 50)
  44. stroke.Thickness = 2
  45. stroke.Parent = messageLabel
  46.  
  47. -- Показываем сообщение после сигнала с сервера
  48. caughtEvent.OnClientEvent:Connect(function(messageText)
  49.     messageLabel.Text = messageText or "Вы попались, попробуйте ещё раз"
  50.     messageLabel.Visible = true
  51.  
  52.     task.wait(2.5)
  53.  
  54.     messageLabel.Visible = false
  55. end)
  56.  
Advertisement
Add Comment
Please, Sign In to add comment