|
| 22 Jun 2013 07:32 PM |
I tried actually pausing it before, and that didn't work, so I took a stab at setting the pitch to 0, and it doesn't work either. I am sure it should work, but what is wrong with this?:
local play = script.Parent.Play local pause = script.Parent.Pause local stop = script.Parent.Stop local playtime = script.Parent.TextLabel local sec = 00 local minute = 00 local hour = 00 pitchplus = script.Parent.PitchEditor.Plus1 pitchminus = script.Parent.PitchEditor.Minus1 pitch = script.Parent.PitchEditor.Pitch volumeplus = script.Parent.VolumeEditor.Plus1 volumeminus = script.Parent.VolumeEditor.Minus1 volume = script.Parent.VolumeEditor.Volume
play.MouseButton1Down:connect(function() local check = game.Soundscape:FindFirstChild("Sound") if not check then local id = script.Parent.idholder.Text s = Instance.new("Sound", game.Soundscape) s.SoundId = "http://roblox.com/asset/?id="..id s:Play() repeat wait(1) sec = sec + 1 if sec == 60 then sec = sec - 60 minute = minute + 1 if minute == 60 then minute = minute - 60 hour = hour + 1 end end playtime.Text = hour..":"..minute..":"..sec until s.Pitch == 0 else check.Pitch = pitch repeat wait(1) sec = sec + 1 if sec == 60 then sec = sec - 60 minute = minute + 1 if minute == 60 then minute = minute - 60 hour = hour + 1 end end playtime.Text = hour..":"..minute..":"..sec until s.Pitch == 0 end end) pause.MouseButton1Down:connect(function() if s then s.Pitch = 0 end end) stop.MouseButton1Down:connect(function() if s then s:Stop() s:Destroy() s = nil playtime.Text = "0:0:0" sec = 00 minute = 00 hour = 00 end end) script.Parent.Pitch.MouseEnter:connect(function() script.Parent.Pitch.BackgroundColor3 = Color3.new(0,0,0) end) script.Parent.Pitch.MouseLeave:connect(function() script.Parent.Pitch.BackgroundColor3 = Color3.new(255,255,255) end) script.Parent.Pitch.MouseButton1Down:connect(function() script.Parent.Pitch.Visible = false script.Parent.PitchEditor.Visible = true end) script.Parent.Volume.MouseEnter:connect(function() script.Parent.Volume.BackgroundColor3 = Color3.new(0,0,0) end) script.Parent.Volume.MouseLeave:connect(function() script.Parent.Volume.BackgroundColor3 = Color3.new(255,255,255) end) script.Parent.Volume.MouseButton1Down:connect(function() script.Parent.Volume.Visible = false script.Parent.VolumeEditor.Visible = true end) script.Parent.LoopBool.MouseEnter:connect(function() script.Parent.LoopBool.BackgroundColor3 = Color3.new(0,0,0) end) script.Parent.LoopBool.MouseLeave:connect(function() script.Parent.LoopBool.BackgroundColor3 = Color3.new(255,255,255) end) script.Parent.LoopBool.MouseButton1Down:connect(function() script.Parent.LoopBool.Visible = false script.Parent.LoopBoolEditor.Visible = true end) pitchplus.MouseButton1Down:connect(function() s.Pitch = s.Pitch + .01 pitch.Text = s.Pitch end) pitchminus.MouseButton1Down:connect(function() local pitchcheck = s.Pitch if pitchcheck == .01 then s.Pitch = .01 elseif pitchcheck >= .2 then s.Pitch = s.Pitch - .01 end pitch.Text = s.Pitch end) script.Parent.PitchEditor.closepitch.MouseButton1Down:connect(function() script.Parent.PitchEditor.closepitch.Parent.Visible = false script.Parent.Pitch.Visible = true end) volumeplus.MouseButton1Down:connect(function() local volumecheck = s.Volume if volumecheck == 1 then s.Volume = 1 volume.Text = s.Volume elseif volumecheck < 1 then s.Volume = s.Volume + .01 volume.Text = s.Volume end end) volumeminus.MouseButton1Down:connect(function() local volumecheck2 = s.Volume if volumecheck2 >= .01 then s.Volume = s.Volume - .01 volume.Text = s.Volume elseif volumecheck2 == .01 then s.Volume = .01 volume.Text = s.Volume end end) script.Parent.VolumeEditor.closevolume.MouseButton1Down:connect(function() script.Parent.VolumeEditor.Visible = false script.Parent.Volume.Visible = true end) script.Parent.LoopBoolEditor.nocheck.MouseButton1Down:connect(function() script.Parent.LoopBoolEditor.nocheck.Visible = false script.Parent.LoopBoolEditor.check.Visible = true s.Looped = true end) script.Parent.LoopBoolEditor.check.MouseButton1Down:connect(function() script.Parent.LoopBoolEditor.check.Visible = false script.Parent.LoopBoolEditor.nocheck.Visible = true s.Looped = false end) script.Parent.LoopBoolEditor.closeloopbooleditor.MouseButton1Down:connect(function() script.Parent.LoopBoolEditor.Visible = false script.Parent.LoopBool.Visible = true end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Jun 2013 08:03 PM |
If there is an output, it would help. I skimmed through the code, and I may be wrong on this, but try to use the sound's :Pause() method. |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2013 08:06 PM |
| sadly there is no output, but I will try what you said, because before I was using the IsPaused = true |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2013 08:15 PM |
The changed script is this but it still won't play the sound when I hit play, however it does create the sound and start the timer. See the output below the script.
local play = script.Parent.Play local pause = script.Parent.Pause local stop = script.Parent.Stop local playtime = script.Parent.TextLabel local sec = 00 local minute = 00 local hour = 00 pitchplus = script.Parent.PitchEditor.Plus1 pitchminus = script.Parent.PitchEditor.Minus1 pitch = script.Parent.PitchEditor.Pitch volumeplus = script.Parent.VolumeEditor.Plus1 volumeminus = script.Parent.VolumeEditor.Minus1 volume = script.Parent.VolumeEditor.Volume
play.MouseButton1Down:connect(function() local check = game.Soundscape:FindFirstChild("Sound") if not check then local id = script.Parent.idholder.Text s = Instance.new("Sound", game.Soundscape) s.SoundId = "http://roblox.com/asset/?id="..id s:Play() repeat wait(1) sec = sec + 1 if sec == 60 then sec = sec - 60 minute = minute + 1 if minute == 60 then minute = minute - 60 hour = hour + 1 end end playtime.Text = hour..":"..minute..":"..sec until s:Pause() else check.IsPaused = false repeat wait(1) sec = sec + 1 if sec == 60 then sec = sec - 60 minute = minute + 1 if minute == 60 then minute = minute - 60 hour = hour + 1 end end playtime.Text = hour..":"..minute..":"..sec until s.Pitch == 0 end end) pause.MouseButton1Down:connect(function() if s then s:Pause() end end) stop.MouseButton1Down:connect(function() if s then s:Stop() s:Destroy() s = nil playtime.Text = "0:0:0" sec = 00 minute = 00 hour = 00 end end) script.Parent.Pitch.MouseEnter:connect(function() script.Parent.Pitch.BackgroundColor3 = Color3.new(0,0,0) end) script.Parent.Pitch.MouseLeave:connect(function() script.Parent.Pitch.BackgroundColor3 = Color3.new(255,255,255) end) script.Parent.Pitch.MouseButton1Down:connect(function() script.Parent.Pitch.Visible = false script.Parent.PitchEditor.Visible = true end) script.Parent.Volume.MouseEnter:connect(function() script.Parent.Volume.BackgroundColor3 = Color3.new(0,0,0) end) script.Parent.Volume.MouseLeave:connect(function() script.Parent.Volume.BackgroundColor3 = Color3.new(255,255,255) end) script.Parent.Volume.MouseButton1Down:connect(function() script.Parent.Volume.Visible = false script.Parent.VolumeEditor.Visible = true end) script.Parent.LoopBool.MouseEnter:connect(function() script.Parent.LoopBool.BackgroundColor3 = Color3.new(0,0,0) end) script.Parent.LoopBool.MouseLeave:connect(function() script.Parent.LoopBool.BackgroundColor3 = Color3.new(255,255,255) end) script.Parent.LoopBool.MouseButton1Down:connect(function() script.Parent.LoopBool.Visible = false script.Parent.LoopBoolEditor.Visible = true end) pitchplus.MouseButton1Down:connect(function() s.Pitch = s.Pitch + .01 pitch.Text = s.Pitch end) pitchminus.MouseButton1Down:connect(function() local pitchcheck = s.Pitch if pitchcheck == .01 then s.Pitch = .01 elseif pitchcheck >= .2 then s.Pitch = s.Pitch - .01 end pitch.Text = s.Pitch end) script.Parent.PitchEditor.closepitch.MouseButton1Down:connect(function() script.Parent.PitchEditor.closepitch.Parent.Visible = false script.Parent.Pitch.Visible = true end) volumeplus.MouseButton1Down:connect(function() local volumecheck = s.Volume if volumecheck == 1 then s.Volume = 1 volume.Text = s.Volume elseif volumecheck < 1 then s.Volume = s.Volume + .01 volume.Text = s.Volume end end) volumeminus.MouseButton1Down:connect(function() local volumecheck2 = s.Volume if volumecheck2 >= .01 then s.Volume = s.Volume - .01 volume.Text = s.Volume elseif volumecheck2 == .01 then s.Volume = .01 volume.Text = s.Volume end end) script.Parent.VolumeEditor.closevolume.MouseButton1Down:connect(function() script.Parent.VolumeEditor.Visible = false script.Parent.Volume.Visible = true end) script.Parent.LoopBoolEditor.nocheck.MouseButton1Down:connect(function() script.Parent.LoopBoolEditor.nocheck.Visible = false script.Parent.LoopBoolEditor.check.Visible = true s.Looped = true end) script.Parent.LoopBoolEditor.check.MouseButton1Down:connect(function() script.Parent.LoopBoolEditor.check.Visible = false script.Parent.LoopBoolEditor.nocheck.Visible = true s.Looped = false end) script.Parent.LoopBoolEditor.closeloopbooleditor.MouseButton1Down:connect(function() script.Parent.LoopBoolEditor.Visible = false script.Parent.LoopBool.Visible = true end) ---------------------------------------------------------------------------------- Output:
19:09:55.255 - can't set value |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Jun 2013 08:52 PM |
| bump, why doesn't anyone look at this? |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Jun 2013 09:32 PM |
| too big. Find the part you need help with and show us that o; |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2013 10:51 PM |
local play = script.Parent.Play local pause = script.Parent.Pause local stop = script.Parent.Stop local playtime = script.Parent.TextLabel local sec = 00 local minute = 00 local hour = 00 pitchplus = script.Parent.PitchEditor.Plus1 pitchminus = script.Parent.PitchEditor.Minus1 pitch = script.Parent.PitchEditor.Pitch volumeplus = script.Parent.VolumeEditor.Plus1 volumeminus = script.Parent.VolumeEditor.Minus1 volume = script.Parent.VolumeEditor.Volume
play.MouseButton1Down:connect(function() local check = game.Soundscape:FindFirstChild("Sound") if not check then local id = script.Parent.idholder.Text s = Instance.new("Sound", game.Soundscape) s.SoundId = "http://roblox.com/asset/?id="..id s:Play() repeat wait(1) sec = sec + 1 if sec == 60 then sec = sec - 60 minute = minute + 1 if minute == 60 then minute = minute - 60 hour = hour + 1 end end playtime.Text = hour..":"..minute..":"..sec until s:Pause() else check.IsPaused = false repeat wait(1) sec = sec + 1 if sec == 60 then sec = sec - 60 minute = minute + 1 if minute == 60 then minute = minute - 60 hour = hour + 1 end end playtime.Text = hour..":"..minute..":"..sec until s.Pitch == 0 end end) pause.MouseButton1Down:connect(function() if s then s:Pause() end end) stop.MouseButton1Down:connect(function() if s then s:Stop() s:Destroy() s = nil playtime.Text = "0:0:0" sec = 00 minute = 00 hour = 00 end end)
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 23 Jun 2013 01:32 PM |
| bump this is the ninth time I've had to bump this thread and barely anyone has replied :( |
|
|
| Report Abuse |
|
|
|
| 23 Jun 2013 02:22 PM |
| bump, why does everyone just ignore this... |
|
|
| Report Abuse |
|
|
| |
|
| |
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 23 Jun 2013 03:04 PM |
| The script is very long that is why. |
|
|
| Report Abuse |
|
|
| |
|