I wrote a script for my camping game, i wrote the text talking and i was done with the script. It was fine until it started repeating everytime and i didn't know how to make it stop.
while true do script.Parent.Text = "Hello and welcome to The Forest!" wait(5) script.Parent.Text = "We are gonna have the most amazing night ever here! Right guys?" wait(5) script.Parent.Text = "Anyways, lets start our big journey!" end
It repeats because you have your code within an infinite loop (while true do), to make it not repeat just remove the loop
script.Parent.Text = "Hello and welcome to The Forest!" wait(5) script.Parent.Text = "We are gonna have the most amazing night ever here! Right guys?" wait(5) script.Parent.Text = "Anyways, lets start our big journey!"
Such a simple question to answer, simply remove the 'while true do' while true do makes the script below it repeat itself over and over and over... Unless you place a 'break'
while true do script.Parent.Text = "Hello and welcome to The Forest!" wait(5) script.Parent.Text = "We are gonna have the most amazing night ever here! Right guys?" wait(5) script.Parent.Text = "Anyways, lets start our big journey! break end
the break will end the loop:
break
But a easy solution to make it only play once is to just put your code usually:
script.Parent.Text = "Hello and welcome to The Forest!" wait(5) script.Parent.Text = "We are gonna have the most amazing night ever here! Right guys?" wait(5) script.Parent.Text = "Anyways, lets start our big journey!
you could also put a if player joins script to make it happen every time, but i wont put that here.