I made a code for a dialogue system for someone, but after I finished I realized I set up the script on a TextLabel, rather than an interactive part. I'm trying to set up the script so that it will run via the interactive part, and it does appear to be doing code, however I am unable to see it. I'm focusing on lines 12 through 14 right now, and checking the properties of each element I can see that they have been updated, but I just cannot see any of it. I'm definitely making a silly mistake and would really appreciate it if anyone knew how I could correct this!! ^^
local triggerpart = script.Parent.QwilProximityPrompt
local dialogueText = {"Example text", "More than one example"} -- Add all dialogue here, separate each by commas
local noise = game.ReplicatedStorage.Sounds.QwilSound
local image = game.ReplicatedStorage.DialogueProfiles.QwilProfile
local dialogue = game.StarterGui.ScreenGui.Frame:FindFirstChild("Dialogue")
local index = 1
local connection
triggerpart.Triggered:Connect(function()
triggerpart.Enabled = false
dialogue.Visible = true
dialogue.CharacterName.Text = "QWIL" -- Sets the name of the character speaking
dialogue.CharacterProfile.Image = image.Image -- Sets the image of the character speaking
for i = 1, #dialogueText[index] do
noise:Play()
dialogue.Text = dialogueText[index]:sub(1,i)
wait(0.01)
end
wait(0.5)
dialogue.Next.Visible = true
if connection then
connection:Disconnect()
end
connection = dialogue.Next.MouseButton1Click:Connect(function()
index = index + 1
if index <= #dialogueText then
for i = 1, #dialogueText[index] do
dialogue.Next.Visible = false
noise:Play()
script.Parent.Text = dialogueText[index]:sub(1,i)
wait(0.01)
end
wait(0.5)
dialogue.Next.Visible = true
else
dialogue.Visible = false
triggerpart.Enabled = true
index = 1
end
end)
end)
** You are now Level 1! **