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

Why does the transparency of the parts not change?

for count = 1, 54, 1 do
					print(count)
					for i,v in pairs(workspace.Line:GetChildren()) do					
					if v.Name == count then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					end
					wait(0.5)
end

2 comments

0

I named all the parts under the model "Line" by numbers

0

It prints count every 0.5 seconds, but it never goes into the if v.Name == count then part

2 answers

You should've just done

local stringName = tostring(count)

if workspace[stringName] then
	workspace[stringName].Transparency = 0
end

that way you'd be able to get the count as a string. A name cannot be a number and is always a string.

Nevermind  I just typed code for each one like  AND SO ON

if v.Name == "1 then
	if v.Name == "29" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "30" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "31" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "32" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "33" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "34" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "35" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "36" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "37" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "38" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "39" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "40" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "21" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "22" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "23" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "24" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "25" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "26" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "27" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end
					wait(0.5)
					if v.Name == "28" then
						print(v.Transparency)
						v.Transparency = 0
						print("Transparafied")
					end

1 comment

0

Thats really inefficent not gonna lie

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