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

i cant make my script run forever . How do i make a script run forever?

Im trying to make this script fun forever. so far this is what i tried and i doesn't work

while true do

wait(0.1) script.Parent.Transparency = 0.9 wait(0.1) script.Parent.Transparency = 0.8 wait(0.1) script.Parent.Transparency = 0.7 wait(0.1) script.Parent.Transparency = 0.6 wait(0.1) script.Parent.Transparency = 0.5 wait(0.1) script.Parent.Transparency = 0.4 wait(0.1) script.Parent.Transparency = 0.3 wait(0.1) script.Parent.Transparency = 0.2 wait(0.1) script.Parent.Transparency = 0.1 wait(0.1) script.Parent.Transparency = 1

until false

3 comments

0

You are confusing a while do loop an a do until loop. replace the 'until false' with end

0

If SuperAndresZ_YT's answer was good enough then please accept it. You and him/her/it both will get a point for it.

0

If SuperAndresZ_YT's answer was good enough then please accept it. You and him/her/it both will get a point for it.

4 answers

This should work, I hope.

while true do
	for i = 1, 0, -.1 do
		wait(0.1)
		script.Parent.Transparency  = i --'i' is a changing number value
	end

	for i = 0, .1, .1 do
		wait(0.1)
		script.Parent.Transparency  = i
	end
end

You're trying to 'disappear' a block, right? The 'Until False' that you're using it's incorrect, it'll never go false. Try this instead:

while true do
	for i = 1, 10 do
		wait(0.1)
		script.Parent.Transparency = script.Parent.Transparency - 0.1
	end
end

...It should work. ;)

If you want an eisier to understand kinda one then try this

while true do
	if <var>  ==  false then
		wait(0.1) 
		script.Parent.Transparency = 0.9 wait(0.1) script.Parent.Transparency = 0.8 
		wait(0.1) 	
		script.Parent.Transparency = 0.7 wait(0.1) script.Parent.Transparency = 0.6
		wait(0.1) 
		script.Parent.Transparency = 0.7 wait(0.1) script.Parent.Transparency = 0.4 
		wait(0.1) 
		script.Parent.Transparency = 0.7 wait(0.1) script.Parent.Transparency = 0.2
		wait(0.1) 
		script.Parent.Transparency = 0.7 wait(0.1) script.Parent.Transparency = 0	
	else
		return end
	end
end	   			

idk if this is what u want but ok...

If you want the loop to stop when the part is completely invisible then you can make a simple change to SuperAndresZ_YT's loop. Just remove the while loop and the for loop will do it's job and stop after 10 loops.

For example:

for i = 1, 10 do
	 wait(0.1)
	 script.Parent.Transparency = script.Parent.Transparency - 0.1
	end
end

wait(1)
script.Parent.Transparency = 1

Another way to do the same thing:

while script.Parent.Transparency > 1 do
	wait()
	script.Parent.Transparency = script.Parent.Transparency - 0.1
end

wait(1)
script.Parent.Transparency = 1

1 comment

0

Just reviewing some of my old answers, at this point I can't believe I would post this. It's wrong.

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