|
For some reason I just can't go "sCurrent.TimeLength"... Anyone know the reason for this? :'(
sCurrent = Instance.new("Sound")
sCurrent.Name = "PlayingSong"
sCurrent.Parent = game.Workspace.Baseplate
sCurrent.SoundId = "http://www.roblox.com/asset/?id=357049989"
sCurrent:Play()
wait(sCurrent.TimeLength)
And does anyone know a way that works? Without me making record of the length of every track e.e
Ty for anyone that can help.
~CrayBray |
|
marfitJoin Date: 2013-01-10 Post Count: 2539 |
Just keep the sound paused, stopped, and just type the length yourself. It is rbxassetid://357049989 |
|
|
C_SharperJoin Date: 2011-10-03 Post Count: 9405 |
Usually when you put an ID in a sound, the TimeLength property changes to the length of the sound ID you put in. |
|
|
That's what I thought e.e I view the Sound object in test mode and the data is in there... Doesn't seem to work though... Just skips right on to the next track e.e
~CrayBray |
|
|
Or you could use a while do code block. Each sound has a Property called "IsPlaying", if it is playing then do whatever, if not the break. Here is a example.
sCurrent = Instance.new("Sound")
sCurrent.Name = "PlayingSong"
sCurrent.Parent = game.Workspace.Baseplate
sCurrent.SoundId = "http://www.roblox.com/asset/?id=357049989"
sCurrent:Play()
while wait(0.0001) do
if sCurrent.IsPlaying == true then
print("Sound still playing")
else
break
end
end
If this helps, support by buying this shirt. It would be appreciated.
http://www.roblox.com/my/Item.aspx?id=212878035
|
|
|
Ty man :D That's ingenius.
~CrayBray |
|
|
Your very welcome. I always like when I can help others.
|
|
|
@Binary
Please don't do wait(0.0001), the minimum wait time, wait() on its own, is 1/30 a second.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
@Power Oh, I did not know this. Thanks for the info.
while true do the do |
|
|
@powerhotmail123 That is of minimum importance. It is definitely not so important to make a post about. There is literally no difference. |
|
|
it unnecessarily takes up memory in your game.
y-y-you too |
|
|
@fishguy100
1/30 = 0.03~ (Repeating)
and it's waiting 0.0001
No difference? |
|
|
However doe anyone know why TimeLength isn't readable? :s
~CrayBray |
|
|
Yes it's readonly, not sure why it won't work though.
while true do the do |
|
|
"@fishguy100
1/30 = 0.03~ (Repeating)
and it's waiting 0.0001
No difference?
"
It still defaults to 1/30th of a second when inputted anything under. |
|
|
@fishguy100
You actually know something :O
(Yes I know it defaults to 1/30) |
|
|
I've seen others experiencing the same problem with TimeLength. Try wait() before you wait the length of .TimeLength?
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
@NovusTheory I've learned a lot after my "noob days"
So please, don't make fun of me |
|
|
What does "wait()" do. Does that wait 1/30th of a second too? Ty I shall try this.
~CrayBray |
|
|
When you input nothing for wait, it also defaults to 1/30th of a second |
|
|
|
wait() yields the script for the time passed onto its only parameter, defaulting to 1/30 if the time passed is smaller than 1/30 or nothing is provided.
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
Do we all have ROBLOX+?
while true do the do |
|
|
That or these people are no-lifing it refreshing MyForums over and over
y-y-you too |
|