Всех приветствую!
В моей игре есть скрипт, который меняет название текста в textButton.Как видите, в картинке ниже Text в Properties поменялся, а в игре как остался Now playing:, так и остаётся Now playing:.

Скрипт:
local SoundService = game:GetService("SoundService")
local currentMusic = SoundService:FindFirstChild("BackgroundMusic")
local nowPlays = script.Parent:WaitForChild('nowPlaysText') -- тот самый textButton
local function updateNowPlaying()
local currentMusic = SoundService:FindFirstChildOfClass("Sound")
if currentMusic and currentMusic.IsPlaying then
nowPlays.Text = "Now Playing: " .. currentMusic.Name
end
end
SoundService.ChildAdded:Connect(updateNowPlaying)
SoundService.ChildRemoved:Connect(updateNowPlaying)
updateNowPlaying()
Заранее спасибо за помощь!