Why is NPC Chat not updating?
Hello!
I'm making a story game, which features NPC Chat, and a tram. The script below opens a door, and the most important part is that it also.. How do I say it: Makes the message for the NPC? (The location of the script is: game.StarterGuI.Chat.Frame.script)
Script:
01 | local chat = game.Players.LocalPlayer.PlayerGui.Chat.Frame |
02 | local text = chat:WaitForChild( "TextLabel" ) |
03 | local name = chat.NpcName |
05 | local conveyor = workspace.ConveyorStop |
06 | local vault = workspace.VaultDoor 1 |
07 | local door 1 = vault.OpemDoor 1 |
08 | local door 2 = vault.OpenDoor 2 |
09 | local tram = workspace.Tram |
11 | function message(speech) |
13 | text.Text = string.sub(speech, 1 , i) |
18 | conveyor.Touched:Connect( function () |
21 | conveyor.CFrame = conveyor.CFrame.LookVector * 30 |
25 | message( "Hello there! My name is Walter, let me open the door for you." ) |
28 | door 1. CFrame = door 1. CFrame:Lerp(vault.Door 2. CFrame, i) |
31 | message( "So your a new employee, huh? Your name is... Alex- Wait, no last name? Unusual." ) |
33 | door 2. CFrame = door 2. CFrame:Lerp(vault.Door 1. CFrame, i) |
37 | message( "So- Holy! You're 5 minutes late! You better get going..." ) |
39 | message( "Well, it's nice meeting you! Let me start the rail." ) |
43 | conveyor.CFrame = conveyor.CFrame.LookVector * 30 |
44 | tram:MoveTo(Vector 3. new(- 233.519 , 8.008 , - 816.172 )) |
Any help would be grateful!