Message notification GUI

I need help with my message GUI for some reason it shows the message 1 time but after that it doesn’t repeat. Its supposed to show a message through a list of GUI’s…

Script
In game message showing

Please add your script here instead of having it in an external site using ```lua

Does adding a while true do do anything?

Use the code function for the code, not the screenshot.

```lua

[your code here]

```

My bad didn’t know how to do it before

wait(math.random(40,60))
randomitem = math.random(1,10)
if(randomitem == 1 or randomitem == 3 or randomitem == 5 or randomitem == 7 or randomitem == 9) then
script.Parent.Warning1.Visible = true
end
if(randomitem == 2 or randomitem == 4 or randomitem == 6 or randomitem == 8 or randomitem == 10) then
script.Parent.Warning2.Visible = true
end
script.Parent:TweenSizeAndPosition(UDim2.new(0.3,0,0.1,0), UDim2.new(0.8,0,0.895,0))
wait(5)
script.Parent:TweenSizeAndPosition(UDim2.new(0.01,0,0.1,0), UDim2.new(1,0,0.895,0))

Wrap your code in an infinite loop if you want it to loop indefinitely.

while true do
    wait(math.random(40,60))
    randomitem = math.random(1,10)
    if(randomitem == 1 or randomitem == 3 or randomitem == 5 or randomitem == 7 or randomitem == 9) then
        script.Parent.Warning1.Visible = true
    end
    if(randomitem == 2 or randomitem == 4 or randomitem == 6 or randomitem == 8 or randomitem == 10) then
        script.Parent.Warning2.Visible = true
    end
    script.Parent:TweenSizeAndPosition(UDim2.new(0.3,0,0.1,0), UDim2.new(0.8,0,0.895,0))
    wait(5)
    script.Parent:TweenSizeAndPosition(UDim2.new(0.01,0,0.1,0), UDim2.new(1,0,0.895,0))
end

Perfect thanks a lot! Appreciate the help

1 Like