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

Music on entered - Weird problem?

Asked by 9 years ago

Hello everyone,

I was having so slight trouble with this "easy" script. It works perfectly fine in studio, but it refused to work in the normal player. I've already tried putting it in a LocalScript in workspace, but that doesn't seem to do anything neither. Help would be appreciated!

local s = Instance.new("Sound")

s.Name = "Sound"
s.SoundId = "http://www.roblox.com/asset?id=149730036"
s.Volume = 0.2
s.Pitch = 1
s.Looped = true
s.archivable = true

s.Parent = game.Workspace.Camera

wait(1)

s:play()

1 answer

Log in to vote
1
Answered by 9 years ago
local s = Instance.new("Sound")

s.Name = "Sound"
s.SoundId = "http://www.roblox.com/asset?id=175376701"
s.Volume = 0.2
s.Pitch = 1
s.Looped = true
s.archivable = true

s.Parent = script.Parent.Parent

wait(1)

s:play()

Trying to put the script into a studio's camera is not the best idea

0
That would work indeed, but I was trying to let that sound play local, so how could I put it in the camera of the LocalPlayer? LegoChronicle 5 — 9y
0
You do not need to put it into the camera for it to play local ITSolarWinds 25 — 9y
0
ALSO, localscripts do NOT run in workspace. OR anywhere that is not the player. iaz3 190 — 9y
0
@lego If you want the sound to play local, put it in the player's PlayerGui. Spongocardo 1991 — 9y
Ad

Answer this question