Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

Limit on Text changing?

Asked by
daricr 0
8 years ago

This script IS FUNCTIONAL, however, it only changes the text of the identifier on the first song, why?

Here's the script;

print 'Loading Playlist'
identifyer = game.StarterGui.header.textframe.musicidentifyer
------------------------------------[[PLAYLIST]---------------------------------------------------------------------------------------------------------------------

song1 = "http://www.roblox.com/asset/?id=243372213" --insert the ID number after the "/?id="
song2 = "http://www.roblox.com/asset/?id=378820974"
song3 = "http://www.roblox.com/asset/?id=349828735"
song4 = "http://www.roblox.com/asset/?id=131261480"
song5 = "http://www.roblox.com/asset/?id=155319906"
song6 = "http://www.roblox.com/asset/?id=313144336"
song7 = "http://www.roblox.com/asset/?id=300622704"
song8 = "http://www.roblox.com/asset/?id=376020601"
song9 = "http://www.roblox.com/asset/?id=379496294"
song10 = "http://www.roblox.com/asset/?id=313694441"
song11 = "http://www.roblox.com/asset/?id=262092295"
song12 = "http://www.roblox.com/asset/?id=254702000"


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
print 'Creating a Source of Audio'
local music = Instance.new("Sound") -- This creates the sound. Since this is an Independent Variable, You should not change it at all.
music.Archivable = true -- This MUST be true or you may have some problems.
print 'Inspecting the Configurable Variables'

------------------------------------------CONFIGURABLE VARIABLES]]------------------------------------------------------------------------------

music.Parent = script.Parent -- This is where the sound will be placed. If you want the sound to be heard everywhere, don't change it or put it into Workspace.
--                                       If you want the sound to be heard in one spot, put it in a brick
--
music.Pitch = 1 -- Pitch manages the Pitch and Speed of the Sound. Pitch 1 is the normal sound, although some sounds have a problem that they are slow, increase this
--                 value so you can hear the original. There is a list of official pitches for songs named "Official Pitches".
--                 Adding multiple Pitches will require a bit of work, so if your a beginner, just stick with one pitch for now.
--
music.Volume = .8 -- This determines how loud the music will be. If this is being heard in one spot, this can configure how far you can hear the sound.
--                    The maximum is 1. Volumes set above 1 will be unaffected. 
--                    For music heard across the game, if you have other sounds, put this to 0.9 or 1, otherwise you won't hear your music because of the other sounds
--
music.Looped = false -- This determines if the sound will repeat forever. If you have more than one sound, you MUST set this to false, otherwise you will be able to
--                     have problems with pausing and playing
--
music.Name = "Player" -- This determines the name of the source of Audio. Name it whatever you want.
--
--

print 'Loading RMP 1.0'
while (true) do
    print 'Playing Sound 1'
music.SoundId = song1 
music:play()
identifyer.Text = "Twenty One Pilots - Stressed Out"
wait(130) 
    --2--
    print 'Playing Sound 2'
music.SoundId = song2
music:play() 
identifyer.Text = "Flo Rida - My House"
wait(130)
    --3--
    print 'Playing Sound 3'
music.SoundId = song3
music:play() 
identifyer.Text = "Major Lazer - Light it Up"
wait(130)
    --4--
    print 'Playing Sound 4'
music.SoundId = song4
music:play() 
identifyer.Text = "Imagine Dragons - Demons"
wait(130)
    --5--
        print 'Playing Sound 5'
music.SoundId = song5
music:play() 
identifyer.Text = "Ariana Grande - Problem"
wait(130)
    --6--
    print 'Playing Sound 6'
music.SoundId = song6
music:play() 
identifyer.Text = "DNCE - Cake by the Ocean"
wait(130)
    --7--
    print 'Playing Sound 7'
music.SoundId = song7
music:play() 
identifyer.Text = "Drake - Jumpman"
wait(130)
    --8--
    print 'Playing Sound 8'
music.SoundId = song8
music:play() 
identifyer.Text ="Lukas Graham - 7 Years"
wait(130)
    --9--
    print 'Playing Sound 9'
music.SoundId = song9
music:play() 
identifyer.Text = "Mike Posner - I Took A Pill In Ibiza"
wait(130)
    --10--
    print 'Playing Sound 10'
music.SoundId = song10
music:play() 
identifyer.Text = "Adele - Hello"
wait(130)
    --11--
    print 'Playing Sound 11'
music.SoundId = song11
music:play() 
identifyer.Text = "Fetty Wap - My Way"
wait(130)
--12--
    print 'Playing Sound 12'
music.SoundId = song12
music:play() 
identifyer.Text = "Nightcore - Everytime We Touch"
wait(130)


end

1 answer

Log in to vote
2
Answered by 8 years ago

StarterGui

You have made the unfortunate mistake of using the StarterGui instead of the PlayerGui. Repeat after me: "I will not change things in StarterGui"
Good boy.

If you need to change something in the StarterGui, you want to instead make sure that you're checking inside the PlayerGui (Which is obviously found in Player.PlayerGui incase you didn't know). Anything found under StarterGui can be found the same way under PlayerGui.


In your case, you can probably look at where you've put the script.

  • Is the Script in Workspace? Take it out of Workspace, it doesn't make sense.
  • Is the Script in StarterGui? Congratulations, your script is now in PlayerGui.
  • Is the Script anywhere else? Nobody should be hearing your sounds, and you need to put it somewhere different.

Given these details, you can now know how to access the TextLabel inside of PlayerGui instead of StarterGui.

0
Thank you! I made this into a Local Script in a separate script for text change and put it into Starter GUI! daricr 0 — 8y
Ad

Answer this question