Hasli4

Untitled

Aug 30th, 2026
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2.  
  3. local openNameInput = ReplicatedStorage:WaitForChild("OpenNameInput")
  4.  
  5. local gui = script.Parent
  6. local frame = gui:WaitForChild("Frame")
  7.  
  8. local npcName = frame:WaitForChild("NPCName")
  9. local dialogueText = frame:WaitForChild("DialogueText")
  10. local continueButton = frame:WaitForChild("ContinueButton")
  11.  
  12. gui.Enabled = false
  13.  
  14. local currentResponse = nil
  15.  
  16.  
  17. --------------------------------------------------
  18. -- Получение ответа от сервера
  19. --------------------------------------------------
  20.  
  21. openNameInput.OnClientEvent:Connect(function(responseText)
  22.  
  23. -- Если сервер передал готовый ответ NPC,
  24. -- показываем продолжение диалога.
  25.  
  26. if typeof(responseText) ~= "string" then
  27. return
  28. end
  29.  
  30. currentResponse = responseText
  31.  
  32. npcName.Text = "NPC"
  33. dialogueText.Text = responseText
  34.  
  35. gui.Enabled = true
  36. end)
  37.  
  38.  
  39. --------------------------------------------------
  40. -- Продолжить
  41. --------------------------------------------------
  42.  
  43. continueButton.Activated:Connect(function()
  44.  
  45. gui.Enabled = false
  46.  
  47. currentResponse = nil
  48. end)
Advertisement
Add Comment
Please, Sign In to add comment