PS: spelling will be bad because i have dyslexia
Im making this code where its a system for dialogue but ive made the start of the code i just dont know what to put to continue the dialogue
Need help with DialougeSystemContinue Function
local Dial = script.Parent.Text
local Person = script.Parent.Person
local TweenService = game:GetService("TweenService")
local folder = game.ReplicatedStorage:WaitForChild("Dialouges")
local event = folder:WaitForChild("Events"):WaitForChild("TellDialougePart")
local plrr = game:GetService("Players").LocalPlayer
local R1 = script.Parent.R1
local R2 = script.Parent.R2
local R3 = script.Parent.R3
local function TextAnim(Text)
local TextLegth = string.len(Text.Text)
local Grapene = Text.MaxVisibleGraphemes
local Wool = true
Grapene = 0
for i = 1, TextLegth do
Text.MaxVisibleGraphemes = i
task.wait(0.1)
end
end
local function QSize(Bool)
if Bool == true then
Dial.Size = UDim2.new(0.332, 0,0.093, 0)
Dial.Position = UDim2.new(0.23, 0,0.832, 0)
Person.Position = UDim2.new(0.23, 0,0.791, 0)
Person.Size = UDim2.new(0.332, 0,0.042, 0)
else
Dial.Size = UDim2.new(0.538, 0,0.069, 0)
Dial.Position = UDim2.new(0.23, 0,0.832, 0)
Person.Position = UDim2.new(0.23, 0,0.791, 0)
Person.Size = UDim2.new(0.538, 0,0.042, 0)
R1.Visible = false
R2.Visible = false
R3.Visible = false
end
end
local function DialougeSystemStart(PersonVal)
local ammount = folder.Speach:WaitForChild(PersonVal).Head:GetChildren()
local FolderPe = folder.Speach:WaitForChild(PersonVal)
Person.Text = PersonVal
Dial.Text = FolderPe:WaitForChild("Head").Value
if folder.Speach:WaitForChild(PersonVal).Head.R1 then
QSize(true)
print(#ammount)
for i = 1, #ammount do
local Responce = folder.Speach:WaitForChild(PersonVal).Head:WaitForChild("R"..i)
local ResponceUi = script.Parent:WaitForChild("R"..i)
ResponceUi.Visible = true
ResponceUi.Text = Responce.Value
print(i)
end
else
QSize(false)
end
end
local function DialougeSystemContinue(PersonVal,Quest)
local ammount = folder.Speach:WaitForChild(PersonVal).Quest:GetChildren()
local FolderPe = folder.Speach:WaitForChild(PersonVal)
Person.Text = PersonVal
Dial.Text = FolderPe:WaitForChild("Head").Value
if folder.Speach:WaitForChild(PersonVal).Head.R1 then
QSize(true)
print(#ammount)
for i = 1, #ammount do
local Responce = folder.Speach:WaitForChild(PersonVal).Head:WaitForChild("R"..i)
local ResponceUi = script.Parent:WaitForChild("R"..i)
ResponceUi.Visible = true
ResponceUi.Text = Responce.Value
print(i)
end
else
QSize(false)
end
end
DialougeSystemStart("Billy")
R1.MouseButton1Click:Connect(function()
end)
R2.MouseButton1Click:Connect(function()
end)
R3.MouseButton1Click:Connect(function()
end)
event.OnClientEvent:Connect(function(TalkToPerson)
folder.Speach:WaitForChild(TalkToPerson)
Person.Text = TalkToPerson
end)