Well I deleted my scripts and am re-writing them.
So my script that is supposed to change the text is here:
TextTable = {"Welcome to Vaccine Simulator!","Buy and sell vaccines to save the world","blah blah 3"}
TutorialStep = 1
script.Parent.Parent.TutorialText.Text = TextTable[TutorialStep]
script.Parent.MouseButton1Click:Connect(function()
TutorialStep = TutorialStep + 1
script.Parent.Parent.TutorialText.Text = TextTable[TutorialStep]
end)
and my script that opens the tutorial is here:
script.Parent.MouseButton1Down:Connect(function()
script.Parent.Parent.TutorialFrame.TutorialText.Text = "Hello, welcome to Vaccine Simulator!"
script.Parent.Parent.TutorialFrame.Visible = true
end)
Everything is working but now I am still stuck at the point that when I close it then re-open it its still at the last frame. I cannot make it so TutorialStep = 1 in another script because they are two different scripts and only one defines TutorialStep.
And I might just make it all in the same script if this cannot work.
I would honestly just make it all into one script. It would take like 30 seconds to combine them, and it would solve a bunch of your issues.
Alright, when I am done I will reply what the result is, happy scripting!
I am a bit confused (Because I am a rookie scripter) On what to do
edit: I think I figured it out
Is something wrong here?
script.Parent.MouseButton1Down:Connect(function()
TutorialStep = 1
script.Parent.Parent.TutorialFrame.TutorialText.Text = "Hello, welcome to Vaccine Simulator!"
script.Parent.Parent.TutorialFrame.Visible = true
end)
TextTable = {"Welcome to Vaccine Simulator!","Buy and sell vaccines to save the world","blah blah 3"}
TutorialStep = 1
script.Parent.Parent.TutorialText.Text = TextTable[TutorialStep]
script.Parent.Parent.TutorialFrame.Next.MouseButton1Click:Connect(function()
TutorialStep = TutorialStep + 1
script.Parent.Parent.TutorialText.Text = TextTable[TutorialStep]
end)
edit: No errors
edit2: Fixed, Happy scripting
Glad we were able to figure it out! Nice job combining the scripts .
Thanks, I have learned a lot from you!
(I sent you a friend request incase you wanna be friends, feel free to accept it)