|
| 06 Apr 2013 01:23 AM |
My game is working perfectly fine during solo mode testing, but when I try it on multiplayer mode, it just doesn't work at all. I tried using the remote error monitoring script, but it didn't report any errors. I'm so confused.
========== Sound = script.Parent.Sound Status = script.Parent.Status newSoundID = "" Looped = true Volume = 100
script.Parent.Play.MouseButton1Click:connect(function() Sound = script.Parent:FindFirstChild("Sound") SoundID = script.Parent.SoundID.Text if SoundID ~= "" then --Manipulate ID string if string.find(SoundID,"/?id=") ~= nil then InvalidID = false elseif string.len(SoundID) <= 8 and string.len(SoundID) >= 7 and not (SoundID):match("%a") and not (SoundID):match("%p") then if tonumber(SoundID) >= 1000000 and tonumber(SoundID) <= 99999999 then SoundID = "http://www.roblox.com/asset/?id=" .. SoundID Invalid = false else InvalidID = true end else SoundID = "" InvalidID = true end --Play function if not InvalidID then if not newSoundID or newSoundID == "" then Sound:Play() elseif newSoundID and newSoundID ~= "" then CreateSound(newSoundID) newSoundID = "" Sound = script.Parent:FindFirstChild("Sound") wait(.5) Sound:Play() end end end end)
script.Parent.Pause.MouseButton1Click:connect(function() Sound = script.Parent:FindFirstChild("Sound") Sound:Pause() end)
script.Parent.Stop.MouseButton1Click:connect(function() Sound = script.Parent:FindFirstChild("Sound") Sound:Stop() end)
script.Parent.VolumeUp.MouseButton1Click:connect(function() Sound = script.Parent:FindFirstChild("Sound") if Sound.Volume < 1 then Sound.Volume = Sound.Volume + .1 Volume = Volume + 10 end end)
script.Parent.VolumeDown.MouseButton1Click:connect(function() Sound = script.Parent:FindFirstChild("Sound") if Sound.Volume > 0 then Sound.Volume = Sound.Volume - .1 Volume = Volume - 10 end end)
script.Parent.Loop.MouseButton1Click:connect(function() Sound = script.Parent:FindFirstChild("Sound") Button = script.Parent.Loop if Looped then Looped = false if Sound then Sound.Looped = false end Button.BackgroundColor3 = Color3.new(170/255,0,0) Button.BorderColor3 = Color3.new(1,0,0) else Looped = true if Sound then Sound.Looped = true end Button.BackgroundColor3 = Color3.new(0,170/255,0) Button.BorderColor3 = Color3.new(0,1,0) end end)
script.Parent.SoundID.Changed:connect(function() newSoundID = script.Parent.SoundID.Text if newSoundID ~= "" then if string.find(newSoundID,"/?id=") ~= nil then InvalidID = false elseif string.len(newSoundID) <= 8 and string.len(newSoundID) >= 7 and not (newSoundID):match("%a") and not (newSoundID):match("%p") then if tonumber(newSoundID) >= 1000000 and tonumber(newSoundID) <= 99999999 then newSoundID = "http://www.roblox.com/asset/?id=" .. newSoundID InvalidID = false else InvalidID = true end else newSoundID = "" InvalidID = true end end end)
function CreateSound(SoundID) oldSound = script.Parent:FindFirstChild("Sound") if oldSound then oldSound:Destroy() end newSound = Instance.new("Sound",script.Parent) newSound.Name = "Sound" newSound.Archivable = false newSound.Looped = Looped newSound.Pitch = 1 newSound.Volume = 1 newSound.SoundId = SoundID end
--Status screen while true do --Sound text if InvalidID then Status.SoundID.Text = "Sound: Invalid sound!" else Status.SoundID.Text = "Sound: " .. Sound.SoundId end --Status text if Sound.IsPlaying then Status.Status.Text = "Status: Playing" elseif Sound.IsPaused then Status.Status.Text = "Status: Paused" elseif not InvalidID then Status.Status.Text = "Status: Stopped" end --Volume text Status.Volume.Text = "Volume: " .. Volume .. "%" --Loop text if Looped then Status.Loop.Text = "Loop: On" else Status.Loop.Text = "Loop: Off" end wait(.1) end ========== |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 01:26 AM |
| That is a local script within a ScreenGui I made in StarterGui. Everything defined in the script are present and working. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 02:18 AM |
Try adding a Wait() at the top of the script.
(╯°□°)> KMXD |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 02:27 AM |
| That didn't help. Oh, and somehow more functions broke. I don't even know what the heck is going in here. It's driving me nuts. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 02:33 PM |
| I'm still having the problem. It's just really weird because it works fine in solo mode. |
|
|
| Report Abuse |
|
|
wow75
|
  |
| Joined: 16 Jan 2009 |
| Total Posts: 951 |
|
| |
|
|
| 06 Apr 2013 02:44 PM |
Add this.
script.plz.work.k.omgz |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 02:45 PM |
| Ok, I'm going to act serious now, I'm going to try to figure it out... |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 02:51 PM |
| Yes, it is a local script. Is it not suppose to be? |
|
|
| Report Abuse |
|
|
wow75
|
  |
| Joined: 16 Jan 2009 |
| Total Posts: 951 |
|
|
| 06 Apr 2013 02:59 PM |
| I dont know, just ussually when big scripts break and give no output(At least in my case) It's in the wrong type of script. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 03:21 PM |
| Okay so I put it in a regular script, and some parts of it work now, but music won't play. |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 03:49 PM |
I fixed it, yay! Try it out here: http://www.roblox.com/Sound-Music-Testing-place?id=111823192 Here's a list of sounds you can test it with: http://www.roblox.com/Forum/ShowPost.aspx?PostID=63389771
The only bug is that if loop is off, the pause function will break and it will stop the music instead. |
|
|
| Report Abuse |
|
|