Message
Message
local Info = {}
Info.Dialog = {
[1] = {
Text = "Hello, how are you?";
Choices = {
[1] = { Text = "Bad"; };
[2] = { Text = "Good, how are you?"; Next = 3 };
[3] = { Text = "Im alright"; Next = 4 };
}
};
[2] = { Text = "Im sorry to hear that"; };
[3] = {
Text = "Im great, thanks for asking";
Choices = {
[1] = { Text = "What's your name?"; Next = 5; Follow = true };
[2] = { Text = "Where are you from?"; Next = 6; Follow = true };
[4] = { Text = "Nice weather, right?"; Next = 7; Follow = true };
}
};
[4] = {
Text = "I feel the same way"; };
[5] = {
Text = "My name is NPC 1";
Choices = {}
};
[6] = {
Text = "I'm from the Baseplate";
Choices = {}
};
[7] = {
Text = "Mmmmmmh definitely";
Choices = {}
};
}
return Info
for i, v in pairs(script.Parent:GetChildren()) do
if v:IsA("Model") and v:FindFirstChild("Humanoid") then
local hrp = v:WaitForChild("HumanoidRootPart")
local head = v:WaitForChild("Head")
prompt.Triggered:Connect(function(player)
if module.CameraDistance then
event:FireClient(player, v, module, CFrame.new(head.Position +
head.CFrame.LookVector * module.CameraDistance, head.Position))
else
event:FireClient(player, v, module)
end
end)
end
end
for i, v in text:split("") do
label.Text = label.Text .. v
task.wait(0.05)
end
end
typeWrite(info.LeaveMessage, dialogLabel)
task.wait(0.5)
currentNpc.HumanoidRootPart.ProximityPrompt.Enabled = true
camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = game.Players.LocalPlayer.Character
main:TweenPosition(UDim2.new(0,0,1,0))
task.wait(1)
main.Visible = false
nameLabel.Text = ""
dialogLabel.Text = ""
storedChoices = {}
currentNpc = nil
end
local dialog
if lastChoice then
if lastChoice.Next then
dialog = info.Dialog[lastChoice.Next]
else
endDialog(info)
end
else
dialog = info.Dialog[1]
end
typeWrite(dialog.Text, dialogLabel)
clone.MouseButton1Click:Connect(function()
storedChoices[i] = nil
nextDialog(info, choice)
end)
end
clone.MouseButton1Click:Connect(function()
storedChoices[i] = nil
nextDialog(info, choice)
end)
end
leave.MouseButton1Click:Connect(function()
endDialog(info)
end)
else
task.wait(1)
if dialog.Next then
nextDialog(info, dialog)
else
endDialog(info)
end
end
end
nameLabel.Text = npc.Name
dialogLabel.Text = ""
storedChoices = {}
if cameraCF then
npc.HumanoidRootPart.ProximityPrompt.Enabled = false
camera.CameraType = Enum.CameraType.Scriptable
tweenService:Create(workspace.CurrentCamera, TweenInfo.new(2,
Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {CFrame = cameraCF}):Play()
end
main.Position = UDim2.new(0,0,1,0)
main.Visible = true
main:TweenPosition(UDim2.new(0,0,0,0))
task.wait(1)
nextDialog(info, nil)
end
end)