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

I tried making a fading GUI, and doesn't work?

for loop = 1, 10 do
game.StarterGui.ScreenGui.Fade2.BackgroundTransparency = loop/10
game:GetService("RunService").Stepped:Wait()
end

Tried that^ didn't work.

2 comments

0

use tweenservice

0

I did, local player = game.Players.LocalPlayer local pgui = player:WaitForChild('PlayerGui') for loop = 5, 500 do pgui.ScreenGui.Fade2.BackgroundTransparency = loop/500 game:GetService("RunService").Stepped:Wait() end

2 answers

You’re trying to change the GUI in StarterGui, that’s why. You need to change it in a player’s PlayerGui for it to work.

Here’s a fixed version (Assuming you’re using a localscript) :

for loop = 1, 10 do
game.Players.LocalPlayer.PlayerGui.ScreenGui.Fade2.BackgroundTransparency = loop/10
game:GetService("RunService").Stepped:Wait()
end

This is for a simple script:

wait(10) -- Use any numbers 
script.Parent.Transparency = 0.5
wait(10) 
script.Parent.Transparency = 1

2 comments

0

this is not for local script

0

you can figure it out yourself ;D

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