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

Why isn't this script working in StarterPlayerScripts even when working in StarterCharacterScripts?

playerGui = game.Players.LocalPlayer.PlayerGui

for i=0,1,0.1 do
	wait()
	playerGui:WaitForChild('ScreenGui').Frame.BackgroundTransparency = i
end

The script should a GUI frame from opaque to transparent. The thing is that this script for some reason works in StarterCharacterScripts but not StarterPlayerScripts. There is no error message, no nothing and it's driving me crazy.

4 comments

0

I put scripts like this in StarterPack, or maybe ReplicatedFirst. There are a lot a places you could put a script like this though. If it doesn't work, put the script where it does work :P

1

Scripts in StarterPlayerScripts only run once. Scripts in StarterCharacterScripts run each time the character respawns.

0

^Didn't know that =3

1

Just to add to Uglypoe comment the script is copied into the player character then run so you do not need to wait for the character loading.

1 answer

✓ Accepted answer

" Scripts in StarterPlayerScripts only run once. Scripts in StarterCharacterScripts run each time the character respawns." - @Uglypoe

That is your problem.

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