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

Why isn't this gui working?

Okay I have this really long script. But I only need help with one part. This script chooses your name based on what button you choose, boy or girl. What I need help with is the bottom part of the script.

FirstNameMale = {"John", "Andrew", "Steven", "Bob", "Joseph", "Sebastian", "Noah", "Jordan", "Eric", "Liam", "Owen", "James", "Jason", "Kyle", "Mario", "Paul", "Rick", "Martin", "Mike", "Michael", "Jack"}
FirstNameFemale = {"Jane", "Barbra", "Andrea", "Ann", "Annie", "Juno", "Audrey", "Mary", "Chloe", "Emily", "Maya", "Sarah", "Isabelle", "Kate", "Megan", "Brook", "Ashley", "Lucy", "Katy", "Abby", "Christina"}
LastName = {"Doe", "Johnson", "Johnston", "McDonald", "Anderson", "Parker", "Stevenson", "McGee", "Davis", "Smith", "Brown", "Jones", "Hooper", "Duke", "Rich", "Michael", "Martin", "King", "Sullivan", "Marley", "Shedletsky"}

--This part down.
		local gui = script.Parent.TextLabel
		local textbox = script.Parent.Girl.TextTransparency and script.Parent.Boy
for i = 1,0,.1 do
	wait(.25)
	gui.TextTransparency = i
	gui.TextStrokeTransparency = i
	guibox.BackgroundTransparency = i
	guibox.TextTransparency = i
	guibox.TextStrokeTransparency = i
end

It changes the transparency too fast or something because I can't notice it doing anything. It immediately turns invisible.

1 answer

✓ Accepted answer

Your problem is this line:

for i = 1,0,.1 do

Remember that increment is added to i each time the loop...loops. If you do 1 + 0.1 you're not going to get any closer to 0.

To get closer to your goal, 0, you must subtract 0.1 from i every time.

There is no way to make for loops subtract the increment, but basic arithmetic tells use that a - b = a + (-b)

Therefore you just need to make 0.1 negative.

for i = 1,0,-0.1 do

1 comment

0

Herp Derp me.

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