Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

why doesnt ReportSpammers become invisible???

I made a script that shows guis and hides them and to stop it from being annoying i added truns and turn to stop after some loops but ReportSpammers (d) is always visible after 2 loops can someone help me?

-- Author: Louponius

local a = script.Parent.ReportTrollers
local b = script.Parent.Reportbugs
local c = script.Parent.ReportExploiters
local d = script.Parent.ReportSpammers

turn = 0 --DONT CHANGE THIS.

turns = 2 --How many loops there should be before disabling this script

sec = 2 --How many seconds before going to the next notification

while true do
	if turn == turns then
		a:Destroy()
		b:Destroy()
		c:Destroy()
		d:Destroy()
		script.Disabled = true
	else
		a.Visible = true
		wait(sec)
		a.Visible = false
		b.Visible = true
		wait(sec)
		b.Visible = false
		c.Visible = true
		wait(sec)
		c.Visible = false
		d.Visible = true
		wait(sec)
		d.Visible = false
		d.Visible = false
		d.Visible = false
		turn = turn +1
	end
end

1 answer

✓ Accepted answer
-- Author: Louponius

local a = script.Parent.ReportTrollers
local b = script.Parent.Reportbugs
local c = script.Parent.ReportExploiters
local d = script.Parent.ReportSpammers

turn = 0 --DONT CHANGE THIS.

turns = 2 --How many loops there should be before disabling this script

sec = 2 --How many seconds before going to the next notification

while true do
    if turn == turns then
	script.Parent:Destroy() --If you're planning on destroying all the guis eventually, it would probably be more efficient to just destroy everything with it.
    else
        a.Visible = true
        wait(sec)
        a.Visible = false
        b.Visible = true
        wait(sec)
        b.Visible = false
        c.Visible = true
        wait(sec)
        c.Visible = false
        d.Visible = true
        wait(sec)
        d.Visible = false
        turn = turn +1
    end
end

This discussion is preserved as it was. New answers, comments, and votes are closed.