Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need a client side sound player, can someone fix this for me please?

I want to make a client sided sound script, the script works perfectly like this:

local s = Instance.new("Sound")
s.Parent = game.Workspace
s:Play()
--Settings
-- Looped:
s.Looped = true
--Pitch:
s.Pitch = 1
--Sound ID:
s.SoundId = "http://www.roblox.com/asset/?id=138093919"
--Volume:
s.Volume = 0.4
--Time Position
s.TimePosition = 0

But not like this (This is the one i need fixed, thanks.)

for i,v in pairs(game.Players:GetChildren()) do
local s = Instance.new("Sound")
s.Parent = v.PlayerGui 
s:Play()
--Settings
-- Looped:
s.Looped = true
--Pitch:
s.Pitch = 1
--Sound ID:
s.SoundId = "http://www.roblox.com/asset/?id=138093919"
--Volume:
s.Volume = 0.4
--Time Position
s.TimePosition = 0


end


1 answer

✓ Accepted answer

You're playing it before its loaded the sound

for i,v in pairs(game.Players:GetChildren()) do
local s = Instance.new("Sound")
s.Parent = v.PlayerGui 
--Settings
-- Looped:
s.Looped = true
--Pitch:
s.Pitch = 1
--Sound ID:
s.SoundId = "http://www.roblox.com/asset/?id=138093919"
--Volume:
s.Volume = 0.4
--Time Position
s.TimePosition = 0

s:Play()

end

1 comment

0

Wow, thank you so much!

This discussion is preserved as it was. New answers, comments, and votes are closed.