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

Sound isn't playing?

Asked by 9 years ago
function Tick ()
    Seconds = 0
    sound = Instance.new("Sound")
    sound.SoundId = ("151715959")
    sound.Parent = game.Workspace
    for i = 1,math.huge do
        game.StarterGui.ScreenGui.TextBox.Text = (Seconds + 1)
        Seconds = (Seconds + 1)
        sound:Play()
        wait (0.457)
    end
end

Tick ()

This is just a basic script that ticks whenever the number value goes up and the textbox displays that value but the sound isn't playing and the output says there is no error and also the script works fine and continues running.

2 answers

Log in to vote
2
Answered by 9 years ago

Don't worry, your in luck. This is a VERY simple fix. Tick() is actually a built in Roblox function that gives you the time in seconds.

function Timer() --Name whatever you want except Tick
    local seconds = 0;
    local sound = Instance.new("Sound", workspace);
    sound.SoundId = ("http://www.roblox.com/asset/?id=151715959");
    while true do --Infinite loop
        game.StarterGui.ScreenGui.TextBox.Text =  seconds + 1;
        sound:Play();
        wait(0.45);
        seconds = seconds + 1;
    end
end
0
Thank you ghostbeater12 25 — 9y
Ad
Log in to vote
-2
Answered by
Mowblow 117
9 years ago

You need to make the sound ID an Asset ID!

local SoundID = 123456789
local ID = "http://www.roblox.com/asset/?id="..SoundID - 1
0
When it states "- 1" it subtracts 1 from the sound ID to find the AssetID of the sound, if it still does not work, you may need to keep subracting one, example: ..SoundID - 2, because sometimes, things are uploaded at the same time and their asset ids, which are usually one less than the normal ID, re mixed up. Mowblow 117 — 9y

Answer this question