Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- --------------------------------------------------
- -- RemoteEvents
- --------------------------------------------------
- local showEscapeNotice =
- ReplicatedStorage:WaitForChild("ShowEscapeNotice")
- local startEscapeTimer =
- ReplicatedStorage:WaitForChild("StartEscapeTimer")
- --------------------------------------------------
- -- GUI
- --------------------------------------------------
- local gui = script.Parent
- local frame = gui:WaitForChild("Frame")
- local messageText =
- frame:WaitForChild("MessageText")
- local acknowledgeButton =
- frame:WaitForChild("AcknowledgeButton")
- local buttonText =
- acknowledgeButton:WaitForChild("ButtonText")
- --------------------------------------------------
- -- Состояние
- --------------------------------------------------
- local noticeOpened = false
- --------------------------------------------------
- -- Скрываем табличку при запуске
- --------------------------------------------------
- gui.Enabled = false
- --------------------------------------------------
- -- Показываем табличку
- --------------------------------------------------
- showEscapeNotice.OnClientEvent:Connect(function()
- print("[ESCAPE NOTICE] Табличка показана")
- messageText.Text = "Вы можете сбежать"
- buttonText.Text = "Понятно"
- gui.Enabled = true
- noticeOpened = true
- end)
- --------------------------------------------------
- -- Кнопка «Понятно»
- --------------------------------------------------
- acknowledgeButton.Activated:Connect(function()
- if not noticeOpened then
- return
- end
- noticeOpened = false
- print("[ESCAPE NOTICE] Нажато «Понятно»")
- --------------------------------------------------
- -- Убираем табличку
- --------------------------------------------------
- gui.Enabled = false
- --------------------------------------------------
- -- Запускаем таймер
- --------------------------------------------------
- startEscapeTimer:FireServer()
- end)
Advertisement
Add Comment
Please, Sign In to add comment