Hello everyone! So I’m making this story thing that you can read but somethings not working in my LocalScript. You can check it here:
local button = script.Parent
local storyText = script.Parent.Parent.StoryText
local page = 1
button.MouseButton1Up:Connect(function()
if page == 1 then
storyText.Text = "One day, Nooblet decided to watch the news on his TV."
page += 1
elseif page == 2 then
storyText.Text = "He saw that Robloxia was being invaded by hackers!"
page += 1
elseif page == 3 then
storyText.Text = "He didn't mind and went to guy buy some chips."
page += 1
elseif page == 4 then
storyText.Text = "All of a sudden, a shady figure comes and says, 'want some robux kid?'"
page += 1
elseif page == 5 then
storyText.Text = "Little did Nooblet know, that was David Baszucki! He was trying to lure people to join the Robloxia war with the hackers."
page += 1
else
storyText.Text = "Nooblet of course says yes to the free robux. This is where your story begins. You will fight for the freedom of Robloxia!"
button.Visible = false
end
end)
For some reason, the pages wont change whenever I click it. Please let me know if I did anything wrong. Thanks for reading!
Why don’t you do page = 2, page = 3 etc?
I think it would be better done that way rather than page += 1
Also, shouldn’t it be MouseButtonDown rather than up?
Make sure your script is enabled, and you might want to use WaitForChild as the local script is probably not picking up on it (on the button and storytext label).
Not sure if this will help your issue, but perhaps you do Page = 2, Page = 3, Page = 4 rather than Page += 1. It is more clean and makes things simple and I doubt it will help your issue, since it seems to be alright, but sometimes you can never be sure and it doesn’t hurt to try. It might be a GUI issue, as @ItzPlanes is suggesting.