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: Music script

Previous Thread :: Next Thread 
firegosse is not online. firegosse
Joined: 07 Nov 2010
Total Posts: 37
09 Feb 2016 10:15 AM
Hey. I need your help with a script. I want that if you buy a game pass that you can turn on music. But only music for the player itself! If you dont know how for only the player itself then i would like to know how to do it for everyone if 1 person buys the gamepass. THANKS!
Report Abuse
DoNotReadThisNamePlz is not online. DoNotReadThisNamePlz
Joined: 01 Aug 2014
Total Posts: 679
09 Feb 2016 10:27 AM
So, will only the player that buys it be able to hear the music, or will everyone hear it, but the player be able to chose..?
Report Abuse
firegosse is not online. firegosse
Joined: 07 Nov 2010
Total Posts: 37
09 Feb 2016 10:47 AM
yes the 1 that it is for only himself and another script for 1 that can choose for everyone else
Report Abuse
DoNotReadThisNamePlz is not online. DoNotReadThisNamePlz
Joined: 01 Aug 2014
Total Posts: 679
09 Feb 2016 10:51 AM
Placing music in the player's PlayerGui (either by StarterGui or by cloning) makes the music play only for the player. You could then add a script that checks they have a game pass, and if they do, then they can play it.
Report Abuse
firegosse is not online. firegosse
Joined: 07 Nov 2010
Total Posts: 37
09 Feb 2016 11:26 AM
Im not good at scripting can you please tell me the script??
Report Abuse
DoNotReadThisNamePlz is not online. DoNotReadThisNamePlz
Joined: 01 Aug 2014
Total Posts: 679
09 Feb 2016 11:39 AM
Okay, but don't expect to always get one made for you. Try to learn from scripts too. It's worth it in the end, trust me.

local gpID = [gamepassid]
local soundID = "rbxassetid://[soundid]"

game.Players.PlayerAdded:connect(function(player)
if Game:GetService("GamePassService"):PlayerHasPass(player, gpID) then
local soundHolder = Instance.new("ScreenGui")
local sound1 = Instance.new("Sound")
sound1.SoundId = soundID
soundHolder.Parent = player:WaitForChild("PlayerGui")
sound1.Parent = soundHolder
sound1:Play()
end
end)

Replace the areas marked with the ids. Remove the [] of course.
It should work. Hopefully. Tell me if it doesn't and I'll fix it.
Report Abuse
firegosse is not online. firegosse
Joined: 07 Nov 2010
Total Posts: 37
09 Feb 2016 12:05 PM
Thank you so much :)
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