OK, so here's what I wanna do.
Issue: on line 9, I have no idea how to get the current local player, and get a label called "Music Credit Label" in the player's screen GUI
So it's easy to access all the GUI of your player if your script is in ScreenGui because you can simply write:
local label = script.Parent["Music Credit Label"]
aaannddd - DONE. We can use that label and credit the name of each music when it starts!
-- Table that stores every sound local playlist = game.Workspace["Music Playlist"]:GetChildren() -- Service that loads music before it starts so it doesn't lag or anything. local contentProvider = game:GetService("ContentProvider") -- his is where I get the problem. I simply want to get the player GUI and store it in this variable. local credit = "I WANT TO GET PLAYERS SCREENGUI" -- Function that shows the name of the music that just started. local function CREDIT(music) print("Showing credit..") credit.Visible = true credit.Text = 'Now playing: '..'"'..music.Name..'"' wait(4) credit.Visible = false print("Hiding credit...") end -- For loop that loops the music. for index, music in pairs(playlist) do contentProvider:PreloadAsync({music}) music:Play() CREDIT(music) print("Now Playing: ".. music.Name) wait(music.TimeLength) end
ANY help would be great. It's ok if u can't help.
``local credit = game.Players.LocalPlayer.PlayerGui
To get a specific player, You can use game.Players.LocalPlayer
For Example:
1.Getting Player Name
local Player = game.Players.LocalPlayer while true do script.Parent.Text = Player.Name end
2.Getting Player GUI
local Player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() Player.PlayerGui:FindFirstChild("GUI NAME HERE") --Detecting for Specific GUI end)
Hope It Help!