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: Something with sound that doesn't work everytime...

Previous Thread :: Next Thread 
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
26 Feb 2012 05:59 AM
So my problem is that it sometimes works for me only and sometimes for everyone. It's just confusing. Actually, a sound should get on if I join the game or a player joins the game when I'm in-game. The sound should also turn off when I leave the game. So here's the script:



sound = game.Workspace.Sound.Music
game.Players.PlayerAdded:connect(function(p)
if game.Players:findFirstChild("Cheater") then
sound:Stop()
sound.Volume = 0
wait(1)
sound:Play()
while sound.Volume < 1 do
sound.Volume = sound.Volume + 0.01
wait(0.1)
end
end
end)

game.Players.PlayerAdded:connect(function(p)
if p.Name == "Cheater" then
sound:Stop()
sound.Volume = 0
wait(1)
sound:Play()
while sound.Volume < 1 do
sound.Volume = sound.Volume + 0.01
wait(0.1)
end
end
end)

game.Players.PlayerRemoving:connect(function(p)
if p.Name == "Cheater" then
sound:Stop()
end
end)
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
26 Feb 2012 07:00 AM
I think nobody can answer me that question. -.-
Report Abuse
TINISH0TZ is online. TINISH0TZ
Joined: 20 Nov 2009
Total Posts: 2549
26 Feb 2012 07:06 AM
Is it just you going in the game? Or are there already players in that game?
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
26 Feb 2012 07:11 AM
Also other players. Like I said, for me, I can see the script working fine almost everytime. And as I can hear the sound, some people don't. Also sometimes I can't hear the sound but some people do.
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
26 Feb 2012 07:36 AM
[ Content Deleted ]
Report Abuse
LightedRoblox is not online. LightedRoblox
Joined: 16 Apr 2010
Total Posts: 6235
26 Feb 2012 08:20 AM
I was about to say what Trioxide said. :/
Report Abuse
Cheater is not online. Cheater
Joined: 29 Jun 2007
Total Posts: 5258
26 Feb 2012 09:37 AM
rioxide how do you mean with the i,v in pairs function? (I know what it is) Just don0t get it why to use that.
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