I’m trying to make a dialogue UI and it types, but as soon as it’s done typing it resets the texts to its original text.
On top of this, it’s not reparenting the NPC?
LocalScript:
local Start = game:GetService("ReplicatedStorage"):WaitForChild("StartTutorial")
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Label = script.Parent.TextLabel
local Sound = script.Parent.Sound
local Camera = workspace.CurrentCamera
local Cameras = workspace.TutorialCameras
local Guide = script:WaitForChild("Tour Guide")
local function Type(Text)
for i = 1, #Text do
task.wait(0.05)
Label.Text = string.sub(Text, 1, i)
Sound:Play()
end
end
local function SetCameraHumanoid()
Camera.CameraType = 'Custom'
Camera.CameraSubject = Humanoid
end
local function SetCameraPos(Position)
Camera.CameraType = 'Scriptable'
Camera.CFrame = Position
end
Start.OnClientEvent:Connect(function()
SetCameraPos(Cameras.Cam1.CFrame)
Type("HEY!")
Guide.Parent = Camera
Guide.Humanoid:MoveTo(Vector3.new(111.5, 2.5, 157))
end)