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

Why Wont This Wind Sound Script Work?

Asked by 9 years ago

So I made a wind script and it wont work! Any help?

local sound = Instance.new("Sound")
sound.SoundId = "http://www.roblox.com/Wind-Howl-item?id=138161072"
sound.Looped = true
sound.Parent = game.Workspace.MusicBlock

sound:Play(138161072)
    end
end

2 answers

Log in to vote
1
Answered by 9 years ago

You don't need to define any parameters in the Play method, you don't need any ends in your current code and you need to define the SoundId as an asset . Try something like this:

local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://138161072" --The "rbxassetid://" part represents the asset id link, and the numbers represent the sound Id. This is equivalent to "http://www.roblox.com/asset/?id=138161072"
sound.Looped = true
sound.Parent = game.Workspace.MusicBlock

sound:Play()

I would also suggest to look at the Wiki tutorials to gain a better understanding of scripting. You can visit the Wiki here.

Ad
Log in to vote
1
Answered by 9 years ago

Those ends aren't needed. Before you go any farther in coding, I suggest getting at least a basic understanding of how to code. Roblox has a variety of tutorials available on the wiki here.

Answer this question