|
I'm trying to have a music toggle it works the problem is when the character resets whether or not the toggle was on or off the music plays and you would have to go back into the settings menu and click the toggle....
Here's the script if you could tell me what i did wrong i would love it also if you could simplify it so that there's less lines of code that would be a big help no need to though...
script.Parent.Music:Play()
V = 0
L = 0
script.Parent.MouseButton1Down:connect (function()
game.Players.LocalPlayer.PlayerGui.Click:Play()
if V == 0 then
script.Parent.ImageTransparency = V
script.Parent.Music.Volume = L
V = 1
L = 1
else
script.Parent.ImageTransparency = V
script.Parent.Music.Volume = L
game.Players.LocalPlayer.PlayerGui.Click:Play()
V = 0
L = 0
end
end)
-God Of Technology |
|
|
|
|
|
Check out my music library. You can adapt this logic in mine. |
|
SmeersJoin Date: 2013-02-14 Post Count: 797 |
You could go the easy way out and simply toggle ResetPlayerGuiOnSpawn to False (under StarterGui's properties) or you can make a script to save the setting and transfer it over to the next life.
Otherwise, you could even just make the sound in the player's Camera, thus preventing it from resetting/restarting when they reset. |
|
|
Do you mean putting the music object into the camera in workspace then playing it like
game.Workspace.CurrentCamera.Music:Play()
V = 0
script.Parent.MouseButton1Down:connect (function()
game.Players.LocalPlayer.PlayerGui.Click:Play()
if V == 0 then
script.Parent.ImageTransparency = V
game.Workspace.CurrentCamera.Music:Stop()
V = 1
else
script.Parent.ImageTransparency = V
game.Players.LocalPlayer.PlayerGui.Click:Play()
game.Workspace.CurrentCamera.Music:Play()
V = 0
end
end)
If i do it like this the music still plays again when they reset... i don't under stand what you mean by the other ways of doing it.
|
|
|
|
|
|
This is the hardest it's ever been to get help -_-
-God Of Technology |
|
|
BUMP BUMP BUMP
-God Of Technology |
|
|
I figured out a way using a Bool value but the problem is it won't change the value my script is
if
script.Parent.Parent.Settings.Value.Value == true then
game.Workspace.CurrentCamera.Music:Play()
end
V = 0
script.Parent.MouseButton1Down:connect (function()
game.Players.LocalPlayer.PlayerGui.Click:Play()
if V == 0 then
script.Parent.ImageTransparency = V
game.Workspace.CurrentCamera.Music:Stop()
V = 1
else
script.Parent.ImageTransparency = V
game.Players.LocalPlayer.PlayerGui.Click:Play()
game.Workspace.CurrentCamera.Music:Resume()
V = 0
end
end)
-God Of Technology |
|
|
oops wrong script
if
script.Parent.Parent.Settings.Value.Value == true then
game.Workspace.CurrentCamera.Music:Play()
end
V = 0
script.Parent.MouseButton1Down:connect (function()
game.Players.LocalPlayer.PlayerGui.Click:Play()
if V == 0 then
script.Parent.ImageTransparency = V
game.Workspace.CurrentCamera.Music:Stop()
V = 1
else
script.Parent.ImageTransparency = V
game.Players.LocalPlayer.PlayerGui.Click:Play()
game.Workspace.CurrentCamera.Music:Resume()
script.Parent.Parent.Settings.Value.Value = false
V = 0
end
end)
-God Of Technology |
|