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

Why is the sound in this script not working?

Asked by 9 years ago

The sound in this script dosen't seem to work.

local Lightning = script.Parent.PointLight
while true do
    script.NumberValue.Value = math.random(1, 2)
    if script.NumberValue.Value == 1 then
        script.Parent.Thunder.SoundId = "http://www.roblox.com/loud-thunder-item?id=130818249"--50
        else script.Parent.Thunder.SoundId = "http://www.roblox.com/Thunder-1-item?id=131300620"--21
        end
    wait(7)
    Lightning.Range = 60
    wait(0.7)
    Lightning.Range = 50
    wait(0.1)
    Lightning.Range = 40
    script.Parent.Thunder:Play()
    wait(0.1)
    Lightning.Range = 30
    wait(0.1)
    Lightning.Range = 20
    wait(0.1)
    Lightning.Range = 10
    wait(0.1)
    Lightning.Range = 0
    wait(0.1)
    wait(math.random(1,5))
    end

1 answer

Log in to vote
2
Answered by 9 years ago

When doing Ids for roblox for like models, audios, or clothing, or even decals you can't just copy the Roblox URL. You have to include the following

.SoundId = "http://www.roblox.com/asset/?id=IDNUMBERHERE" -- Roblox uses an Asset service type thing, If you just type in a regular URL it won't work, You have to do what i did but with your ID for the sound to work.
0
Ohhhhh. The reason I could get it to work manually was because it automatically did the RBXasset bit. Thanks again! Naughtyrobot 0 — 9y
Ad

Answer this question