AlacritySJoin Date: 2012-06-16 Post Count: 27349 |
I put the music into the intro because then only that person can hear the music right?
If not fix it so only that person can hear the music
Right now it doesnt work at all
I have a screen gui named "Intro"
And i have a button and inside that button this script
I want it to be able to play music for only that one player and then make it go away when u click "play"
Currently:
The gui goes away
Music doesnt play at all
local music = Instance.new("Sound",Workspace)
music.SoundId = "http://www.roblox.com/asset/?id=155319906"
music:Play()
local Intro = game.StarterGui.Intro
music.Parent = Intro
function Click()
game.Players.LocalPlayer.PlayerGui.Intro:Destroy()
end
script.Parent.MouseButton1Down:connect(Click)
Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$781 / 90,000 |
|
AlacritySJoin Date: 2012-06-16 Post Count: 27349 |
hm
Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$781 / 90,000 |
|
AlacritySJoin Date: 2012-06-16 Post Count: 27349 |
Wow
Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$781 / 90,000 |
|
aaron0vJoin Date: 2010-06-08 Post Count: 1264 |
Parent the Music to PlayerGui Instead of workspace. |
|
AlacritySJoin Date: 2012-06-16 Post Count: 27349 |
@aa
If i put it in the PlayerGui
Like ("Sound",PlayerGui)
There is another part when it goes music.Parent = Intro
Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$781 / 90,000 |
|
AlacritySJoin Date: 2012-06-16 Post Count: 27349 |
Its still the same
local music = Instance.new("Sound",PlayerGui)
music.SoundId = "http://www.roblox.com/asset/?id=155319906"
music:Play()
local Intro = game.StarterGui.Intro
music.Parent = Intro
function Click()
game.Players.LocalPlayer.PlayerGui.Intro:Destroy()
end
script.Parent.MouseButton1Down:connect(Click)
Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$781 / 90,000 |
|
aaron0vJoin Date: 2010-06-08 Post Count: 1264 |
Have you tested the music outside of the script? |
|
AlacritySJoin Date: 2012-06-16 Post Count: 27349 |
Yep
Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$781 / 90,000 |
|
aaron0vJoin Date: 2010-06-08 Post Count: 1264 |
repeat
wait()
until game.Players.LocalPlayer.Character~=nil
Put that at the top of your script. |
|
AlacritySJoin Date: 2012-06-16 Post Count: 27349 |
Added it
Still nothing
Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$781 / 90,000 |
|
blockooJoin Date: 2007-11-08 Post Count: 17202 |
I believe that if you put the sound in the player's character, it'll work. Not completely sure though, since it's been a while since I've messed with this stuff. |
|
AlacritySJoin Date: 2012-06-16 Post Count: 27349 |
Whats the path to insert it into the player and not the PlayerGui?
Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$781 / 90,000 |
|
|
blockooJoin Date: 2007-11-08 Post Count: 17202 |
The path to get to a player's character from their actual player (that contains the PlayerGui) is:
game.Players.Person.Character |
|
aaron0vJoin Date: 2010-06-08 Post Count: 1264 |
repeat
wait()
until game.Players.LocalPlayer.Character~=nil
music = Instance.new("Sound",game.Players.LocalPlayer)
music.SoundId = "http://www.roblox.com/asset/?id=155319906"
music:Play()
function Click()
music:Destroy()
script.Parent.Parent:Destroy()
end
script.Parent.MouseButton1Down:connect(Click)
plr=game.Players.LocalPlayer
plr.Character.Humanoid.Died:connect(function()
pcall(function()
Click()
end)
end) |
|
AlacritySJoin Date: 2012-06-16 Post Count: 27349 |
@aa,
It worked
Just had to fix it because the stop part didnt work
Instead of music:Destroy()
Try music:Pause()
Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$781 / 90,000 |
|
AlacritySJoin Date: 2012-06-16 Post Count: 27349 |
I just hope that it only plays for that character and no one else
Swimmin' in the ocean. Causin' a commotion. ~//Was InternalFrost\\~ R$781 / 90,000 |
|