Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is this SoundId changing script not working?

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

1 answer

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?

2 comments

0

That method did not work, but I tried a different method, and it worked fine.

0

oh ok

This discussion is preserved as it was. New answers, comments, and votes are closed.