I'm making a music playlist that can shuffle for a friend. I'm trying to figure out how to use a variable from another script, like global variables. I don't know how it works since I'm not that good at scripting. One of the scripts is local, the local script is the script I'm trying to use the variable from the other script. (* if that makes sense.* )
SCRIPT:
---------------------------------------------------------
-- MUSIC
---------------------------------------------------------
while true do
local table = {
s1,
s2,
s3,
s4,
s5 -- the table of the sounds
}
local Randomizer = math.random(1,#table) -- the function that randomizes the items in the table
local Randomed = table[Randomizer] -- this is the value that was chosen from the randomizer
print(tostring(Randomed).." is currently playing.") -- prints which song is playing
Sound.SoundId = Randomed.SoundId -- transfers the song to the musicplayer
Sound:Play() -- plays the sound
wait(130) -- waits untill the song is over
Sound:Stop() -- stops the sound
Sound.SoundId = "http://www.roblox.com/asset/?id=" -- takes out the sound id
end
LOCAL SCRIPT:
--------------------------------------------------------
-- SONG NAME
--------------------------------------------------------
if music.IsPlaying then
name = Randomed.SOUND_NAME -- me trying to use the variable from the other script
end
I found out an easier way to do it! Thank you for the help but I don't need any more help with this question.

3 comments
You can make use of a "RemoteEvent" if you want to send information to a local script.
I'm not really good at scripting and I don't know how a RemoteEvent works but I'll try!
the main thing you want. is FireAllClients