Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this SoundId changing script not working?

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago
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?

0
That method did not work, but I tried a different method, and it worked fine. CoolJohnnyboy 121 — 8y
0
oh ok thehybrid576 294 — 8y
Ad

Answer this question