If you are trying to set the text to display the value of a StringValue, you should be using tostring(line1.Value), instead of tostring(line1), because currently you are turning the instance (not the value) into a string.
Also there’s no need for the tostring() part. A value inside a stringvalue is already a string.
And also a little tip for inserting code into a post:
Put three backticks on each end of the code (```) to turn it into a formatted lua box like this:
Are you getting any errors in the output (View > Output )?
And make sure you change all the tostring(line1,line2,line3…) to tostring(line1.Value,line2.Value…)
Oh i see now, the skip button (when clicked) is firing all 3 events changing the text at the same time.
Try something like:
skip = script.Parent
text1 = skip.Parent.text1
line1 = skip.Line1
line2 = skip.Line2
line3 = skip.Line3
line = 0
skip.MouseButton1Click:Connect(function()
line += 1 -- Increases the line variable by 1
if line == 1 then -- If its the first line
text1.Text = tostring(line1.Value) -- Set text to line1
end
if line == 2 then -- If its the second line
text1.Text = tostring(line2.Value) -- Set text to line2
end
if line == 3 then -- If its the third line
text1.Text = tostring(line3.Value) -- Set text to line3
end
--[[ add more if needed, or end it by changing the parent frame's "Visible"
property to false on line == 4 ]]
end)
Yeah forgot about that.
If you wanted to get real messy though you could use a ton of conditional statements (but thats just confusing)
skip.MouseButton1Click:Connect(function()
line += 1 -- Increases the line variable by 1
text1.Text = (line == 1 and line1.Value or (line == 2 and line2.Value or (line == 3 and line3.Value or "")))
end)
Anyway here’s the elseif code if needed:
skip.MouseButton1Click:Connect(function()
line += 1 -- Increases the line variable by 1
if line == 1 then -- If its the first line
text1.Text = tostring(line1.Value) -- Set text to line1
elseif line == 2 then -- If its the second line
text1.Text = tostring(line2.Value) -- Set text to line2
elseif line == 3 then -- If its the third line
text1.Text = tostring(line3.Value) -- Set text to line3
end
--[[ add more if needed, or end it by changing the parent frame's "Visible"
property to false on line == 4 ]]
end)