Supposed to loop constantly changing the part's transparency:
a = game.Workspace:waitForChild("Part1")
Trans = a.Transparency
while true do
wait(1)
Trans = 1
wait(1)
Trans = 0
end
Supposed to loop constantly changing the part's transparency:
a = game.Workspace:waitForChild("Part1")
Trans = a.Transparency
while true do
wait(1)
Trans = 1
wait(1)
Trans = 0
end
waitForChild() doesn't exist. 'trans' is equal to the value of transparency.
a = game.Workspace:WaitForChild("Part1")
while wait(1) do
for i=0,1,.1 do
a.Transparency = i
end
wait(1)
for i=1,0,-.1 do
a.Transparency = i
end
end
When you assign a number to a variable it clones the original number and any changes dont reflect.
When you assign an object to a variable it gives a reference to the number and any changes do reflect.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
I was using a While Loop to show a friend the inefficiency of them at times