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: nil objects?

Previous Thread :: Next Thread 
crazywafflez is not online. crazywafflez
Joined: 06 Jan 2007
Total Posts: 411
28 Aug 2012 06:37 PM
I am having an issue with a sound script, calling a nil value even though it is not nil. The script is local and it changes the volume of the sound, then parents a local script into each player that plays the sound that had the volume changed. For some reason the local script that is parented into the players says that the sound object is nil. By the way it does not get any output errors in solo, but it does get errors in output in online.

local Camera = Workspace.CurrentCamera
local Sound = Fire

script.Parent = Camera

Sound:Play()

game.Debris:AddItem(Sound, 0.2)
game.Debris:AddItem(script, 0.3)
Report Abuse
crazywafflez is not online. crazywafflez
Joined: 06 Jan 2007
Total Posts: 411
28 Aug 2012 06:38 PM
Opps, it should be

local Camera = Workspace.CurrentCamera
local Sound = script.Fire

script.Parent = Camera

Sound:Play()

game.Debris:AddItem(Sound, 0.2)
game.Debris:AddItem(script, 0.3)

I was trying to debug it so I posted the wrong one.
Report Abuse
crazyman32 is online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
28 Aug 2012 06:41 PM
script.Parent = Camera

That's probably your problem. Scripts don't like to work (and usually never do) in the Camera object.
Report Abuse
crazywafflez is not online. crazywafflez
Joined: 06 Jan 2007
Total Posts: 411
28 Aug 2012 06:43 PM
Is there any other way to localize the sound then?
Report Abuse
crazyman32 is online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
28 Aug 2012 06:46 PM
Put sounds in the PlayerGui. That's how I do it. Works great
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
28 Aug 2012 07:10 PM
You can also make messages and hints local by putting them in PlayerGui, as well.
Report Abuse
crazywafflez is not online. crazywafflez
Joined: 06 Jan 2007
Total Posts: 411
29 Aug 2012 07:14 PM
I am having trouble playing the sound once it is in player gui. I have tried parented it into each players player gui then playing it, and that did not work. I then tried using a local script that parented into their player gui to play the sound, that also did not work, but both of these only were heard by one player. Am I doing something wrong?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
29 Aug 2012 07:45 PM
StarterGui?
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