I want to enable a script in the workspace when music plays and when it stops I want to disable the script again. Can someone help me?
It can be something like this -
local script = workspace.script
local music = workspace.music
if music.Playing = true then
script.Enabled = true
elseif
music.Playing = false then
script.Enabled = false
(My script doesn’t work)
baseparts
(baseparts)
September 28, 2021, 5:12pm
#2
use a .Changed function
local script = workspace.script
local music = workspace.music
music.Changed:Connect(function()
if music.Playing == true then
script.Enabled = true
else
script.Enabled = false
end
end)
1 Like
T0ny
(Tophat)
September 28, 2021, 5:20pm
#3
I believe someone else already asked a similar question. This may be of help to you.
i making guess the anime game and i have music system. my mute button act weird when i change the volume of the sound the mute button doesnt work. i dont know why please help me.
mute script(local script):
local RP = game:GetService("ReplicatedStorage")
local music = RP:WaitForChild("CurrentMusic")
script.Parent.MouseButton1Click:Connect(function()
if music.Volume == 0.5 then
music.Volume = 0
else
music.Volume = 0.5
end
end)
music system model: Music System - Roblox
I’d recommend using the search feature before posting a question just to see if perhaps someone had a similar question that’s already been answered.
2 Likes