vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 03 Jul 2014 04:17 AM |
Unexpected symbol near ')'
for _, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") then coroutine.resume(coroutine.create(function(a) for i = 0, 1, 0.01 do v.Transparency = i wait(0.01) end))) end end
Easier formatted:
for _, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") then coroutine.resume( coroutine.create(function() for i = 0, 1, 0.01 do v.Transparency = i wait(0.01) end) )) end end |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 03 Jul 2014 04:21 AM |
that means there are an incorrect number of )s
in this case, iirc, you have too many. |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 03 Jul 2014 04:22 AM |
this fixes a bit more i think
for _, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") then coroutine.create(coroutine.resume(function() for i = 0, 1, 0.01 do v.Transparency = i wait() end end) end) end) end end
Error in script: ')' expected near 'end' |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 03 Jul 2014 04:22 AM |
| a ) is in the incorrect place |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 03 Jul 2014 04:23 AM |
for _, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") then coroutine.create(coroutine.resume(function() for i = 0, 1, 0.01 do v.Transparency = i wait() end -- FOR i LOOP end) -- FUNCTION end) -- RESUME end) -- CREATE end -- IF STATMENT end -- FOR LOOP |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 03 Jul 2014 04:28 AM |
for _, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") then coroutine.create(coroutine.resume(function() for i = 0, 1, 0.01 do v.Transparency = i wait() end -- FOR i LOOP end)) -- FUNCTION right here end) -- RESUME end) -- CREATE end -- IF STATMENT end -- FOR LOOP
|
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 03 Jul 2014 04:32 AM |
for _, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") then coroutine.create(coroutine.resume(function() for i = 0, 1, 0.01 do v.Transparency = i wait() end end)) end) end) end end
unexpected symbol near ')' |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 03 Jul 2014 04:35 AM |
sorry it's late
for _, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") then coroutine.create(coroutine.resume(function() for i = 0, 1, 0.01 do v.Transparency = i wait() end end)) end end end end
the last two were not needed (they already had (s |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 03 Jul 2014 04:35 AM |
| also coroutine.create does not require an end |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 03 Jul 2014 04:43 AM |
Final ( working ):
for _, v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") then coroutine.resume(coroutine.create(function() for i = 0, 1, 0.01 do v.Transparency = i wait() end end)) end end
Thanks! :D |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 04:45 AM |
You could do that without a coroutine...
Good practice, though (although I recommend you avoid coroutines if possible) |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 03 Jul 2014 04:46 AM |
How so?
It will wait constantly. |
|
|
| Report Abuse |
|
|
WishNite
|
  |
| Joined: 11 Feb 2009 |
| Total Posts: 15828 |
|
|
| 03 Jul 2014 04:51 AM |
| you could technically use the Spawn() function but it's basically the same thing as a coroutine |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 04:52 AM |
local c = workspace:GetChildren()
for v = 1, 100 do for k = 1, #c do if c[k]:IsA"BasePart" then c[k].Transparency = v/100 end end end |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 04:53 AM |
| Forgot a wait, but you can manage to add one yourself just before the last end, |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 03 Jul 2014 04:58 AM |
-- no output, not even making transparent and dont know how to make it wait on RenderStepped.
for _, Gui in pairs(LoadingFrame:GetChildren()) do if Gui:IsA("GuiObject") then coroutine.resume(coroutine.create(function() for i = 0, 1, 0.01 do Gui.BackgroundTranparency = i if Gui:IsA("TextLabel") then Gui.TextTransparency = i end -- RenderStepped here. end end)) end end |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 05:01 AM |
| Add some prints and tell us what you get. |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 03 Jul 2014 05:01 AM |
Frame ( LoadingFrame ) -Another Frame -Another Frame -TextLabel |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 03 Jul 2014 05:03 AM |
Called a function too, didnt wait till it was finished - just continued the script.
Anyway,
A B C D E B C D E B C D E
function FadeLoadingFrame() print("A") for _, Gui in pairs(LoadingFrame:GetChildren()) do print("B") if Gui:IsA("GuiObject") then print("C") coroutine.resume(coroutine.create(function() print("D") for i = 0, 1, 0.01 do print("E") Gui.BackgroundTranparency = i if Gui:IsA("TextLabel") then print("F") Gui.TextTransparency = i end end end)) end end end
|
|
|
| Report Abuse |
|
|
|
| 03 Jul 2014 05:04 AM |
| And the transparency won't become 1? |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
| |
|
| |
|