I just started scripting and want to learn how to make an Image change if a TextLabel says a certain thing.
This is a LocalScript in my ImageLabel, which I thought would turn the Image into a random screenshot I had if the Text below it said 1
if script.Parent.Parent.Display.Text == 1 then
script.Parent.Image = "https://www.roblox.com/library/11452628830/Images-actual-car-no-texture"
end
This is a LocalScript inside the ScreenGUI
local number = script.Parent.Number
local button = script.Parent.Roll
local Display = script.parent.Display
button.MouseButton1Click:Connect(function()
number.Value = math.random(1, 2)
end)
number.Changed:Connect(function()
script.Parent.Display.Text = number.Value
end)
Not sure what's wrong, anything helps!

2 comments
Thanks!
Happy to help!!