Hello Roblox Developers and Scripters!
What do you want to achieve?
I want to be able to make an NPC dialogue and then have the player choose something to continue the conversation.
What is the issue?
I am sending the dialogue AND choices in two or one parameters in a Remote Event, I don’t know how to include an entire timeline of dilemmas into one table lol. If there is an easier way, please tell me!
What solutions have you tried so far?
I’ve tried making tables in tables in tables in tables in ta-- you get it, but that will take WAY to long.
--[[
Vocabulary (because I'm trying to get used to comments lol):
PP: Proximity Prompt
Ev: Event
waitText: "Wait Text" is just like tips and tricks or fun facts
trans: transition
char: character (the player's character)
HumanoidRootPart: the core part of the player; unaffected by animations (X and Z axis are always the same)
CFrame: Direction and position of a part
Vector3: 3 dimensional space (size, position)
]]
local PP = script.Parent
local talkEv = game.ReplicatedStorage.Talk
local transScreenEv = game.ReplicatedStorage.TransScreen
local moveCameraEv = game.ReplicatedStorage.MoveCamera
PP.Triggered:Connect(function(plr)
local char = plr.Character
talkEv:FireClient(plr, --[[dialogue and choices here]])
transScreenEv:FireClient(plr, '') -- Parameter 2 is the Wait Text (Basically visual elevator music lol)
char.EnabledPP.Value = false
char.Frozen.Value = true
char.HumanoidRootPart.CFrame = PP.Parent.Camera.CFrame - Vector3.new(3, 0, 0) -- Teleports player behind the camera
moveCameraEv:FireClient(plr, workspace.NPC.Torso.Camera, true)
end)
Is there any way to put multiple lines of speech (for the NPC) and multiple choices/responses (for the Player)? If you need any further information, just tell me!
Thank you! Have a blessed and great day/night!