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

TextLabel not changing properly, how to fix?

Text not changing from 'Current Song: Desiigner- Panda' to 'Current Song: Future- Where Ya At ft. Drake' pls halp

	--1--
	print 'Playing Sound 1'
	game.StarterGui.Song.Frame.SongName.Text = 'Current Song: Desiigner- Panda' 
	wait(.5)
music.SoundId = song1 
music:play()
wait(120.137)
	--2--
	print 'Playing Sound 2'
	game.StarterGui.Song.Frame.SongName.Text = 'Current Song: Future- Where Ya At ft. Drake'
	wait(.5)
music.SoundId = song2
music:play() 
wait(120.084)

2 answers

✓ Accepted answer

The active gui is inside the player. StarterGui is just like StarterGear, you start with it. The startergear is inside the backpack, just like startergui is inside the PlayerGui.

Put this script inside a local script

    --1--
    print 'Playing Sound 1'
    game.Players.LocalPlayer.PlayerGui.Song.Frame.SongName.Text = 'Current Song: Desiigner- Panda' 
    wait(.5)
music.SoundId = song1 
music:play()
wait(120.137)
    --2--
    print 'Playing Sound 2'
    game.Players.LocalPlayer.PlayerGui.Song.Frame.SongName.Text = 'Current Song: Future- Where Ya At ft. Drake'
    wait(.5)
music.SoundId = song2
music:play() 
wait(120.084)

StarterGui

I swear I need to start writing these down to copy-paste.
You should never be changing stuff in StarterGui, as the players will not see the changes until they respawn. You should instead be changing everything in Player.PlayerGui, because it will be seen immediately by the player.

It's also worth noting that unless you have a special reason to change stuff on the server, it's advised to change PlayerGui on the client through a LocalScript.

4 comments

0

Got me thinking about making a blog article, "StarterGuis to PlayerGuis; StarterPacks to Backpacks - How to Use Them". These types of questions are posted all the time and I think it would help that the different Player Objects be explained.

0

@M39a9am3R Do it, and when posting questions, make sure that they read it!

0

so would I change it to "game.Players.Player.PlayerGui.Song.Frame.SongName.Text"?

0

No.

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