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 » Scripters
Home Search
 

Re: Will this work correctly?

Previous Thread :: Next Thread 
AnimatedDannyo is not online. AnimatedDannyo
Joined: 28 Mar 2011
Total Posts: 18336
21 Nov 2015 12:13 AM
What I'm going for is that when ThePerson joins the game, it will play SoundNameHere. Will this work correctly?

ThePerson = "Player's Name Here"
game.Players.PlayerAdded:connect(function(p)
if p.Name == ThePerson then
script.Parent.SoundNameHere.IsPlaying = true
end

ᗩᘉᓰᗰᗩ☂ᕮↁᗪᗩᘉᘉϒ〇
Report Abuse
Dogejia is not online. Dogejia
Joined: 08 Feb 2012
Total Posts: 1873
21 Nov 2015 12:14 AM
IsPlaying is a read value, do

sound:Play()

Instead


Dogemon, gotta pet them all!
Report Abuse
DrHaximus is not online. DrHaximus
Joined: 22 Nov 2011
Total Posts: 8410
21 Nov 2015 12:15 AM
you should use the Play() method instead otherwise it won't work.


script.Parent.SoundNameHere:Play()
Report Abuse
AnimatedDannyo is not online. AnimatedDannyo
Joined: 28 Mar 2011
Total Posts: 18336
21 Nov 2015 12:15 AM
so

script.Parent.SoundNameHere.sound:Play()

right?

ᗩᘉᓰᗰᗩ☂ᕮↁᗪᗩᘉᘉϒ〇
Report Abuse
AnimatedDannyo is not online. AnimatedDannyo
Joined: 28 Mar 2011
Total Posts: 18336
21 Nov 2015 12:16 AM
script.Parent.SoundNameHere:Play()

ok

ᗩᘉᓰᗰᗩ☂ᕮↁᗪᗩᘉᘉϒ〇
Report Abuse
DrHaximus is not online. DrHaximus
Joined: 22 Nov 2011
Total Posts: 8410
21 Nov 2015 12:16 AM
yup, assuming you have the path correct (script.Parent.SoundNameHere or whatever it's called) it should work fine.
Report Abuse
AnimatedDannyo is not online. AnimatedDannyo
Joined: 28 Mar 2011
Total Posts: 18336
21 Nov 2015 12:17 AM
Red line under 'end'. What's wrong w/ it?

ᗩᘉᓰᗰᗩ☂ᕮↁᗪᗩᘉᘉϒ〇
Report Abuse
DrHaximus is not online. DrHaximus
Joined: 22 Nov 2011
Total Posts: 8410
21 Nov 2015 12:17 AM
actually you forgot an end..

ThePerson = "Player's Name Here"
game.Players.PlayerAdded:connect(function(p)
if p.Name == ThePerson then
script.Parent.SoundNameHere:Play()
end
end)
Report Abuse
AnimatedDannyo is not online. AnimatedDannyo
Joined: 28 Mar 2011
Total Posts: 18336
21 Nov 2015 12:18 AM
ah thank you

ᗩᘉᓰᗰᗩ☂ᕮↁᗪᗩᘉᘉϒ〇
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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