Putting two of the same if statements (in simple terms) confuses the script on which one to choose. A very basic way to solve this is to use if statements. So on key press, if the text is already “of course ye may - have a gander…” then change to “template text”.
local function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.F and path1activated == true then
if frame.Dialog.Text == "Ofcourse ye may - have a gander..." then
frame.Dialog.Text = "template text"
end
end
end
Of course, this is the simplest way to solve the problem. More complicated ways involve the use of tables where you put the text in sequence and add one to the index to get the next text.
TableofDialogue = {"Ofcourse ye may - have a gander...", "template text"}
local NumberofFKeyPressed = 0 -- Set to zero at the start since you have not pressed at all
local function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.F and path1activated == true then
NumberofFKeyPressed = NumberofFKeyPressed + 1 -- On F key press, count increases by 1
frame.Dialog.Text = TableofDialogue[NumberofFKeyPressed] -- table[index] gets the text in the place that you want
end
end