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

Sound isn't playing?

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

✓ Accepted answer

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

1 comment

0

Thank you

You need to make the sound ID an Asset ID!

local SoundID = 123456789
local ID = "http://www.roblox.com/asset/?id="..SoundID - 1

1 comment

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.

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