Hey guys. I’m trying to make a camera system that the player’s face will be shown, then a dialog line will change the text, character-by-character.
My Button Press Script:
script.Parent.Parent.Continue.MouseButton1Click:Connect(function()
print("Continue")
script.Parent.Parent.Page.Value = script.Parent.Parent.Page.Value + 1
end)
And my Text Changer script:
game:GetService("StarterGui").RecordingEvents.ShowDialog.Event:Connect(function()
script.Parent.Parent.Enabled = true
local dialog = math.random(1)
--table--
script.Parent.Parent.Value.Changed:Connect(function()
if dialog == 1 then
local dialog1 = "Hey guys. I hope you enjoy watching Alone on RTV!"
local dialog2 = "Anyways, this is difficult to win! There's a lot of struggles I've went through."
local dialog3 = "It's way different out here! For example, having to boil water is much different than just drinking from the fridge..."
local dialog4 = "The only thoughts you get out here are either thinking how many people are still in the game, or what's going on with your family."
local dialog5 = "I really miss my family. I've gotta go chop some trees and do some more work. Alright, bye guys, and hi mom!"
if script.Parent.Parent.Page.Value == 1 then
print("1")
for i=1,#dialog1 do
script.Parent.TextLabel.Text = string.sub(dialog1, 1, i)
wait(.25)
end
elseif script.Parent.Parent.Page.Value == 2 then
print("2")
for i=1,#dialog2 do
script.Parent.TextLabel.Text = string.sub(dialog2, 1, i)
wait(.25)
end
elseif script.Parent.Parent.Page.Value == 3 then
print("3")
for i=1,#dialog3 do
script.Parent.TextLabel.Text = string.sub(dialog3, 1, i)
wait(.25)
end
elseif script.Parent.Parent.Page.Value == 4 then
print("4")
for i=1,#dialog4 do
script.Parent.TextLabel.Text = string.sub(dialog4, 1, i)
wait(.25)
end
elseif script.Parent.Parent.Page.Value == 5 then
print("5")
for i=1,#dialog5 do
script.Parent.TextLabel.Text = string.sub(dialog5, 1, i)
wait(.25)
end
else
script.Parent.TextLabel.Visible = false
end
end
end)
end)
My text will not change, but the print("Continue") line will print.
Thanks for any help!
