|
| 09 Sep 2012 06:05 PM |
This a .PlayerEntered function that is supposed to make a GUI's transparency fade using a for loop. However, it does nothing. I check the value of x's backgroundtransparency after entering and it has not changed. Yes, the script is a localscript. "BlackScreenAbove" is a text label. Help?
(No output)
function gamestartup(player) x = player.PlayerGui.ScreenGui.BlackScreenAbove
for i=1, 100, 1 do x.BackgroundTransparency = x.BackgroundTransparency + 0.01 wait(0.02) end end
game.Players.PlayerAdded:connect(gamestartup) |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:07 PM |
are you sure there's no output? you can do a few things to check:
a). run the script in a normal script in Play Solo b). check your output logs in your Roblox appdata folder
¬ Scripter Tier-2, LuaLearners Elite ♣ scripting teacher/freelance worker ♣ send me trade requests! |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:08 PM |
function gamestartup(player) wait(0.1) x = player.PlayerGui.ScreenGui.BlackScreenAbove
for i=1, 100, 1 do x.BackgroundTransparency = x.BackgroundTransparency + 0.01 wait(0.02) end end
game.Players.PlayerAdded:connect(gamestartup)
------------------------- ~thedestroyer115, nice and helpful posts- sometimes~ |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:10 PM |
Application Log Start: Sun Sep 09 18:03:21 2012
_____________________________________________________
### Shutdown ###
Closing log file -----------------------------
Was this the log you are looking for?
(It's empty)
I tried it before in a normal script and it resulted in some output error like "LocalPlayer is not a valid member" or something like that. |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:10 PM |
Did you try to do what I did?
------------------------- ~thedestroyer115, nice and helpful posts- sometimes~ |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:11 PM |
or a better way to do it:
function gamestartup(player) repeat until player.ChildAdded:wait().Name == "PlayerGui" x = player.PlayerGui.ScreenGui.BlackScreenAbove
for i=1, 100, 1 do x.BackgroundTransparency = x.BackgroundTransparency + 0.01 wait(0.02) end end
game.Players.PlayerAdded:connect(gamestartup)
MAY not work, but it's still p. cool.
¬ Scripter Tier-2, LuaLearners Elite ♣ scripting teacher/freelance worker ♣ send me trade requests! |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:11 PM |
@thedestroyer I added the wait
It didn't do anything. |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:11 PM |
Also, that needs to be in a script in workspace.
------------------------- ~thedestroyer115, nice and helpful posts- sometimes~ |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:13 PM |
@doombringer Interesting method But It did not work
(Still no output)
I'm concerned that the solution is either A) A complete syntax error that the system can't pick up on B) Blatantly obvious |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:14 PM |
It is in Workspace.
It's a local script. Let me try the scripts posted above in normal scripts instead. |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:15 PM |
oh yeah.... why is it in a localscript? that never struck me lol.
¬ Scripter Tier-2, LuaLearners Elite ♣ scripting teacher/freelance worker ♣ send me trade requests! |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:15 PM |
OGM IT WON'T WORK IN LOCALSCRIPT!!!! LOCALSCRIPTS ARE CLIENT SIDE ONLY!
------------------------- ~thedestroyer115, nice and helpful posts- sometimes~ |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:19 PM |
Sorry for causing you to raig I was told to put it in a localscript
Besides
I want this function to be local
Anyway I put it in a normal script I was getting the error "ScreenGUI is not a valid member of PlayerGui" So I added a wait BEFORE the function even starts
Cause I deduced that the game had not even created ScreenGui yet So It fixed that error But now It's still not doing anything It's in a normal script
wait(1) function gamestartup(player) x = player.PlayerGui.ScreenGui.BlackScreenAbove
for i=1, 100, 1 do x.BackgroundTransparency = x.BackgroundTransparency + 0.01 wait(0.02) end end
game.Players.PlayerAdded:connect(gamestartup) |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:23 PM |
function gamestartup(player)
local con con = player.CharacterAdded:connect(function() x = player.PlayerGui.ScreenGui.BlackScreenAbove
for i=1, 100, 1 do x.BackgroundTransparency = x.BackgroundTransparency + 0.01 wait(0.02) end con:disconnect()
end)
end
game.Players.PlayerAdded:connect(gamestartup) |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:28 PM |
@AgentFirefox Wow Uh It suddenly worked
THANKS A MILLION EVERYONE! -MrIntutive |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:30 PM |
function gamestartup(player)
repeat until player.CharacterAdded:wait() x = player.PlayerGui.ScreenGui.BlackScreenAbove
for i=1, 100, 1 do x.BackgroundTransparency = x.BackgroundTransparency + 0.01 wait(0.02) end con:disconnect()
end)
end
game.Players.PlayerAdded:connect(gamestartup)
mine is better :O
¬ Scripter Tier-2, LuaLearners Elite ♣ scripting teacher/freelance worker ♣ send me trade requests! |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:31 PM |
function gamestartup(player)
repeat until player.CharacterAdded:wait() x = player.PlayerGui.ScreenGui.BlackScreenAbove
for i=1, 100, 1 do x.BackgroundTransparency = x.BackgroundTransparency + 0.01 wait(0.02) end end
game.Players.PlayerAdded:connect(gamestartup)
oops, here's a better version.
¬ Scripter Tier-2, LuaLearners Elite ♣ scripting teacher/freelance worker ♣ send me trade requests! |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:31 PM |
"mine is better :O"
.... Shoot. |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:33 PM |
function gamestartup(player)
player.CharacterAdded:wait() x = player.PlayerGui.ScreenGui.BlackScreenAbove
for i=1, 100, 1 do x.BackgroundTransparency = x.BackgroundTransparency + 0.01 wait(0.02) end end
game.Players.PlayerAdded:connect(gamestartup)
Now mine is better. :) |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:35 PM |
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:wait() for i=1, 100, 1 do player.PlayerGui.ScreenGui.BlackScreenAbove.BackgroundTransparency = player.PlayerGui.ScreenGui.BlackScreenAbove.BackgroundTransparency + 0.01 wait(0.02) end end)
now my script will finish some tiny fraction of a second before yours :P
¬ Scripter Tier-2, LuaLearners Elite ♣ scripting teacher/freelance worker ♣ send me trade requests! |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:36 PM |
Will it? I'm not so sure since I saved the location of his frame in a variable. You repeatedly index to the frame. We should time it to see. :3 |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2012 06:39 PM |
well you see lua passes complex data types by reference, so by creating a variable, you actually increase the length of the chain of references, thus adding an operation or two to the processor's stack. theoretically my script would run faster since there are no variables.
¬ Scripter Tier-2, LuaLearners Elite ♣ scripting teacher/freelance worker ♣ send me trade requests! |
|
|
| Report Abuse |
|
|