#Dialogue System Help

1 messages · Page 1 of 1 (latest)

elder perch
#

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)
amber cloud
#

dude

#

use a module script to hold all the dialogue

elder perch
#

itll be easier to do if i use string values

#

like to adjust the nodes

amber cloud
#

gng

elder perch
#

and like its my third time redoing the script i couldnt be stuffed

#

i mean itll be my third time

#

i fixed it

#

Thank you tho KarTon TV for the help

buoyant sigil
#

anything but a table

opaque quiver
#

if they're all string values, it's not just text the server has to send, it's instances, what type, their properties, attributes, values, their instance id which is already at least 30 bytes, i'm not gonna count it right now

#

if it's in a simple modulescript, that's just one thing the server sends over, once

#

and the text in the module