Hi, noob programmer here
I’m making an 8ball script as one of my first projects
So it works… kind of.
The script is supposed to change a TextLabel’s property, which is the text.
After it changes the first text, it’s supposed to change the text again, but for some reason, it’s stuck in the first text.
game.Players.LocalPlayer.PlayerGui.Eightball.AnswerDisplay.TextLabel.Text = ". . ."
--Works/Changes text
wait(2)
local Number = math.random(1,10)
if Number == 1 then game.Players.LocalPlayer.PlayerGui.Eightball.AnswerDisplay.TextLabel.Text
= ("It is certain")
--Doesn't work/stays in the "..." text
Are you looping through the script or is this the entire script?
If the script runs once then it starts with Text = “…”, then produces a random number. If that Number == 1 it’s going to try to change the Text, but if it isn’t the Text won’t change, and the script ends and doesn’t run again.
Is there 10 answers?
You don’t show enough of the script to let us know what is actually happening.
From the script section you posted it only chooses 1 random number between 1 and 10, then the script stops.
if Number == 1 then game.Players.LocalPlayer.PlayerGui.Eightball.AnswerDisplay.TextLabel.Text
= ("It is certain")
--Doesn't work/stays in the "..." text
end
if Number == 1 then
game.Players.LocalPlayer.PlayerGui.Eightball.AnswerDisplay.TextLabel.Text
= ("It is certain")
--Doesn't work/stays in the "..." text
end