Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

(Answered) How to make a script that runs when a player joins a game?

Asked by 9 years ago

I want to create a code that runs and only a specific player can here it. Almost like a intro script but instead when a player joins they here a specific music peice and then maybe it runs through a playlist of songs. I know how to run songs via scripts by the way.

0
i edited my answer to your situation koolkid8099 705 — 9y
0
If someone answers your question, mark it as accepted by pressing the Check Mark next to their answer. Don't update the title of your question. BlueTaslem 18071 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

All you have to do is make a server script that says the following

game.Players.PlayerAdded:connect(function(player)
local sound = Instance.new("Sound")
sound.SoundId = "SOUND HERE"
sound.Parent = player.PlayerGui
sound:Play()
end)

this will fire when a player joins the game. this should only play the sound to the player that joined the game

0
It seems this script does not play the sound. I have made sure to enter the sound id which is http://www.roblox.com/asset/?id=300733201. Also When I normally run sound scripts the local would usally be above the script though i tried that and it didn't make a difference. Conmmander 479 — 9y
0
what is in output. Did you take the 1 off the end of the sound? koolkid8099 705 — 9y
0
The output says nothing about the sound. When I look in the player section with the player GUI a sound instance is their but its setting is paused. As well as the fact that I cannot here the sound at all. The script has all the apropriate numbers as well Conmmander 479 — 9y
0
try adding a wait before it plays koolkid8099 705 — 9y
0
Thankyou! It works! Conmmander 479 — 9y
Ad

Answer this question