This is a LocalScript in a TextButton
script.Parent.MouseButton1Click:Connect(function(plr) local generate = math.random(1,3) local Image = script.Parent.Parent.Object.Image local Display = script.Parent.Parent.Display.Text local Suggestor = script.Parent.Parent.Suggestor.Text if generate == 1 then script.Parent.Parent.Object.Image = "http://www.roblox.com/asset/?id=10292846756" --change id script.Parent.Parent.Display.Text = "Headless Horseman Roblox Avatar" script.Parent.Parent.Suggestor.Text = "theking66hayday (thx for help)" end if generate == 2 then Image = "http://www.roblox.com/asset/?id=6258759752" Display = "Apple" Suggestor = "Owner" end if generate == 3 then Image = "http://www.roblox.com/asset/?id=500109536" Display = "Banana" Suggestor = "Owner" end end)
It clearly chooses 2 and 3 because I can click the button and a print function says it chose 2/3, but if it chooses 1 it changes the text and image but won't change text or image if pressed again.
Don't know for sure, but maybe try using the variables in generate == 1 as well, as the variable is already set on the image, or change generate = 2 and generate == 3 from Image =; Display =; and Suggestor =; to writing out the full line (script.Parent.Parent.Suggestor.Text; ...)