hpasus8
Пользователь
- Регистрация
- Фев 15, 2025
- Сообщения
- 11
- Тема Автор
- #1
ПРОБЛЕМА РЕШЕНА
Всех приветствую!
Как видите, в картинке ниже Text в Properties поменялся, а в игре как остался Now playing:, так и остаётся Now playing:.
Скрипт:
LUA:
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()
Заранее спасибо за помощь!
Последнее редактирование: