This script is supposed to change the soundid of a sound as values in the game change.
However, the script doesn't work, and I have no idea why, as output gave me nothing.
Can someone please help me?
Here's the script:
local Map = game.ServerScriptService.MainGame:WaitForChild("Map") local Game = game.ServerScriptService.MainGame:WaitForChild("Playing") while wait(0.1) do if Game.Value == true then if Map.Value == "Map1" then script.Parent.SoundId = "id here" elseif Map.Value == "Map2" then script.Parent.SoundId = "id here" end end end
serverscriptservice = game:GetService("ServerScriptService") local Map = serverscriptservice.MainGame:WaitForChild("Map") local Game = serverscriptservice.MainGame:WaitForChild("Playing") while wait(0.1) do if Game.Value == true then if Map.Value == "Map1" then script.Parent.SoundId = "http://www.roblox.com/asset/?id=" .. "id here" elseif Map.Value == "Map2" then script.Parent.SoundId = "http://www.roblox.com/asset/?id=" .. "id here" end end end
Try this? Although I am kinda sure this isn't the problem, it might be?