Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local openNameInput = ReplicatedStorage:WaitForChild("OpenNameInput")
- local gui = script.Parent
- local frame = gui:WaitForChild("Frame")
- local npcName = frame:WaitForChild("NPCName")
- local dialogueText = frame:WaitForChild("DialogueText")
- local continueButton = frame:WaitForChild("ContinueButton")
- gui.Enabled = false
- local currentResponse = nil
- --------------------------------------------------
- -- Получение ответа от сервера
- --------------------------------------------------
- openNameInput.OnClientEvent:Connect(function(responseText)
- -- Если сервер передал готовый ответ NPC,
- -- показываем продолжение диалога.
- if typeof(responseText) ~= "string" then
- return
- end
- currentResponse = responseText
- npcName.Text = "NPC"
- dialogueText.Text = responseText
- gui.Enabled = true
- end)
- --------------------------------------------------
- -- Продолжить
- --------------------------------------------------
- continueButton.Activated:Connect(function()
- gui.Enabled = false
- currentResponse = nil
- end)
Advertisement
Add Comment
Please, Sign In to add comment