I just want the frame to fade from opaque to transparent. I've tried 3 different variations:
playerGui = game.Players.LocalPlayer.PlayerGui for i=1,10 do wait(1) playerGui.ScreenGui.Frame.BackgroundTransparency = playerGui.ScreenGui.Frame.BackgroundTransparency + .1 end
playerGui = game.Players.LocalPlayer.PlayerGui for i=0, 1,0.1 do playerGui.ScreenGui.Frame.BackgroundTransparency = i end
playerGui = game.Players.LocalPlayer.PlayerGui for i=0, 1,0.1 do playerGui.ScreenGui.Frame.BackgroundTransparency = i + playerGui.ScreenGui.Frame.BackgroundTransparency end
When I test the game, nothing happens! Where am I going wrong?
The second script works perfectly. While this is true, I've made a few adjustments of my own so that the payer will be able to actually see the GUI fade.
timeWait = 1 --Change to whatever you'd like it to be playerGui = game.Players.LocalPlayer.PlayerGui for i=0, 1,0.1 do wait(timeWait) playerGui:WaitForChild'ScreenGui'.Frame.BackgroundTransparency = i end
Note: make sure this is in a LocalScript
, and that it is in a child where LocalScripts
can be used, such as StarterGui