Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 19 Jun 2014 10:05 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) repeat wait() until player:FindFirstChild("PlayerGui") children = player.PlayerGui:GetChildren() for _,v in pairs(children) do if v:IsA("Sound") then if v.SoundId == ("http://www.roblox.com/asset/?id=142840797") then v:Stop() v:Destroy() end end end end end)
This is in a brick, and when you touch the brick, it stops and removes all sounds in your playergui with the asset id above. It works during testing offline, however for some reason online not all of the sounds are removed. How do I make this work online? |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 10:13 PM |
| I have to ask, Is it in a Localscript? |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 19 Jun 2014 10:13 PM |
| Regular. In a brick that you touch. |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 10:14 PM |
| Well Idk, I'm also fed up with how some scripts work on offline template but not Online mode. |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 10:21 PM |
| How about making a localscript version of that, and clone it to the player on touch? Server/Client issues shouldn't be an issue for player then. |
|
|
| Report Abuse |
|
|
Zerio920
|
  |
| Joined: 06 Apr 2012 |
| Total Posts: 3311 |
|
|
| 19 Jun 2014 10:24 PM |
Nvm, got it.
The original sound was stuck in a while true loop, so I just removed that and for some reason this script was able to work. It doesn't seem like ROBLOX's servers enjoy while true loops. |
|
|
| Report Abuse |
|
|
|
| 19 Jun 2014 10:28 PM |
No, they really don't. I avoid using while true do. If used improper can lag and crash Such as; while true do end
|
|
|
| Report Abuse |
|
|