generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Script won't work ONLINE

Previous Thread :: Next Thread 
Zerio920 is not online. 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
DhatBoiiPapi is not online. DhatBoiiPapi
Joined: 27 May 2013
Total Posts: 701
19 Jun 2014 10:13 PM
I have to ask, Is it in a Localscript?
Report Abuse
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
19 Jun 2014 10:13 PM
Regular. In a brick that you touch.
Report Abuse
DhatBoiiPapi is not online. DhatBoiiPapi
Joined: 27 May 2013
Total Posts: 701
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
robertjh12 is not online. robertjh12
Joined: 24 Feb 2008
Total Posts: 601
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 is not online. 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
DhatBoiiPapi is not online. DhatBoiiPapi
Joined: 27 May 2013
Total Posts: 701
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image