#The "Dialog Index" or I don't know how to call it isn't reseting.

103 messages · Page 1 of 1 (latest)

broken blade
#

aight

#

lets see

broken blade
#

not sure

#

I didn't look at it yet

#

wait

#

i will check it out

#

@still torrent so the problem is

#

that

#

it plays repeatedly?

urban fjordBOT
#

studio** You are now Level 3! **studio

broken blade
#

ok

#

ah

#

so

#

each time

#

you play it

#

it just doesnt fit together?

#

why did you have to make it so hard for yourself

#

you could have made it simple

#

if you want to store the dialogue in a table

#

you can

#

then

#

you can use

#

for i,v in pairs

#

to play it

#

or

#

since

#

your using a button

#

you could have just

#

done

#

ok like

#

make a

#

Page variable

#

local Page == 0

#

if it starts

#

if Page == 1 then
Text = Table[1]

#

elseif Page == 2 then

#

Text = Table[2]

#

and it keeps on going

#

until the last text

#

and the last text

#

make the Page variable

#

set back to 0

#

or if you

#

wanna make a

#

return button

#

for people who dont wanna listen to the quest

#

u can make it close the gui

#

AND

#

return Page variable to 0

#

its simple

#

ig you could do that

#

ah

#

yeah

#

its possible

#

np

#

if it doesnt work

#

send the script here

#

alr

#

hm

#

its multiplying

#

by 2

#

each time

#

hm

#

huh

#

hm

#

task.wait?

#

ok

#

ah

#

hm

#

since you already

#

tried

#

task.wait

#

@still torrent ah

#

make a variable

#

local IsOpen = false

#

and add

#

if IsOpen == false then

broken blade
#

did u try this

#

local IsOpen = false

#

make a new variable

#

and for chatting and when joining the game

#

make it so that

#

above chatting

#

on line 43

#

if IsOpen == false then

#

and then

#

inside

#

make

#

IsOpen = true

#

no

#

if IsOpen == false then
plr.Chatted:Connect(function()
IsOpen = true
Dialog();
end)

#

and after the dialog is over

#

make IsOpen false again

#

do the same for when you join the game now

#
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DialogRemote = ReplicatedStorage:WaitForChild("Dialog");
local DialogFrame = script.Parent;
local Texts = {"Hello!", "This is an test.", "This is another test!"};
local Page = 1;
local Result = nil;
local IsOpen = false;

local function Dialog()
    if IsOpen == false then
    DialogFrame.Visible = true;
    Page = 1;
    Result = nil;
    DialogFrame.OtherDialog.Label.Text = "Next Dialog"

    if Page == #Texts - 1 then
            DialogFrame.OtherDialog.Label.Text = "Close"
            
        else
            print("IsOpen is not false!")
        end
    end

    local function DialogThingymajig()
        for i = 1, #Texts do
            if i == Page then
                DialogFrame.TextLabel.Text = Texts[Page]
            end
        end
    end;

    DialogThingymajig()

    DialogFrame.OtherDialog.MouseButton1Click:Connect(function()
        if Page == #Texts then
            IsOpen = false;
            DialogFrame.Visible = false;
        end;
        Page += 1;
        DialogThingymajig()
    end);

    DialogFrame.Cancel.MouseButton1Click:Connect(function()
        Result = false;
        Page = 1;
        DialogFrame.Visible = false;
        IsOpen = false;
    end);
end;
Dialog();

local plr = game:GetService("Players").LocalPlayer;

if IsOpen == false then
    plr.Chatted:Connect(function()
        IsOpen = true;
        Dialog();
    end)
end

else
print("Is Open is false!")
#

try this

#

a

urban fjordBOT
#

studio** You are now Level 4! **studio

broken blade
#

hm

#

@still torrent sure it sets IsOpen to false?

#
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DialogRemote = ReplicatedStorage:WaitForChild("Dialog");
local DialogFrame = script.Parent;
local Texts = {"Hello!", "This is an test.", "This is another test!"};
local Page = 1;
local Result = nil;
local IsOpen = false;

local function Dialog()
    if IsOpen == false then
    DialogFrame.Visible = true;
    Page = 1;
    Result = nil;
    DialogFrame.OtherDialog.Label.Text = "Next Dialog"

    if Page == #Texts - 1 then
            DialogFrame.OtherDialog.Label.Text = "Close"
            
        else
            print("IsOpen is not false!")
        end
    end

    local function DialogThingymajig()
        for i = 1, #Texts do
            if i == Page then
                DialogFrame.TextLabel.Text = Texts[Page]
            end
        end
    end;

    DialogThingymajig()

    DialogFrame.OtherDialog.MouseButton1Click:Connect(function()
        if Page == #Texts then
            IsOpen = false;
            DialogFrame.Visible = false;
        end;
        Page += 1;
        DialogThingymajig()
    end);

    DialogFrame.Cancel.MouseButton1Click:Connect(function()
        Result = false;
        Page = 1;
        DialogFrame.Visible = false;
        IsOpen = false;
    end);
end;
Dialog();

local plr = game:GetService("Players").LocalPlayer;

if IsOpen == false then
    plr.Chatted:Connect(function()
        IsOpen = true;
        Dialog();
    end)
end

else
print("Is Open is false!")
#

try this