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

The first loop works fine but why isnt the second loop starting?

So for some reason the 2nd loop will not begin after the first one does. I've tried several ways that I could think of to figure it out. The 2nd loop just doesnt seem to do anything when it should. Am I doing something wrong here?

for p = 1, 10, 0.1 do --First loop
	presents.TextTransparency = presents.TextTransparency - 0.1
	wait(0.1)
	if presents.TextTransparency <= 0.2 then
		tew.TextTransparency = tew.TextTransparency + 0.1
	end
end
	
wait(0.2)
	
for t = 1, 10, 0.1 do --Second Loop
	presents.TextTransparency = presents.TextTransparency + 0.1
	wait(0.1)
end

2 comments

0

why not use the 'p' and  't'?

0

Because it's the same exact numbers

1 answer

✓ Accepted answer

###The reason it looks like it did nothing is because the numbers in lines 1 and 11 are the exact same. Simply flip the numbers on one of them and problem solved. You should also use the p and t variables, as it makes the code cleaner to avoid TextTransparency = TextTransprency + 0.1

for p = 0, 1, 0.1 do --First loop, I changed it to 0, 1, .1
    presents.TextTransparency = p
    wait(0.1)
end

wait(0.2)

for t = 1, 0, -.1 do --Second Loop, made it go down by -.1
    presents.TextTransparency = t
    wait(0.1)
end

1 comment

1

I keep letting these little things slip by, thank you!

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