saaawdust
(sawdust)
April 12, 2023, 2:56pm
#1
I’ve looked on the creator documents: SoundService | Roblox Creator Documentation
But nothing i try seems to work.
local SoundService= game:GetService("SoundService")
SoundService:PlayLocalSound(workspace.SpawnLocation.Sound)
This is an example. Is there somethin i’m doing wrong?
To add more clarity, this isnt when the player is in the game. this is when their in studio
1 Like
vf9r
(vf9r)
April 12, 2023, 3:06pm
#2
is this a local or server script?
1 Like
Xonax12
(Xonax12)
April 12, 2023, 3:33pm
#4
Try using this:
local sound = "your sound"
sound:Play()
use this script in a localscript
DasKairo
(Cairo)
April 12, 2023, 3:34pm
#5
I dont think you can use PlayLocalSound
on a LocalScript
, but could be wrong.
1 Like
saaawdust
(sawdust)
April 12, 2023, 3:34pm
#6
This doesnt seem to work either
saaawdust
(sawdust)
April 12, 2023, 3:35pm
#7
Well i tried it through the command prompt too and i believe thats serversided
Xonax12
(Xonax12)
April 12, 2023, 3:37pm
#8
Does it give a error?
Where did you place the localscript?
saaawdust
(sawdust)
April 12, 2023, 3:38pm
#9
No error. I tried the command bar but that doesnt work. the localscript was in StarterGUI
Xonax12
(Xonax12)
April 12, 2023, 3:39pm
#10
Can you give me more context of what you’re trying to do?
saaawdust
(sawdust)
April 12, 2023, 3:39pm
#11
I’m trying to play a sound within a plugin
Xonax12
(Xonax12)
April 12, 2023, 3:41pm
#12
I’m going to need more then that
saaawdust
(sawdust)
April 12, 2023, 3:41pm
#13
What do you mean? For example you press a button and it has a sound
Xonax12
(Xonax12)
April 12, 2023, 3:42pm
#14
Make a screenshot of the Explorer where the script is and paste whats in the script
saaawdust
(sawdust)
April 12, 2023, 3:44pm
#15
local SoundService = game:GetService("SoundService")
local function playLocalSound(soundId)
local sound = Instance.new("Sound")
sound.SoundId = soundId
SoundService:PlayLocalSound(sound)
sound.Ended:Wait()
sound:Destroy()
end
playLocalSound("rbxassetid://4645365277")
1 Like
Xonax12
(Xonax12)
April 12, 2023, 3:45pm
#16
When do you want the sound to play?
saaawdust
(sawdust)
April 12, 2023, 3:45pm
#17
For now i’m trying to get it so it just plays
Xonax12
(Xonax12)
April 12, 2023, 3:46pm
#18
try using this: sound:Play()
Xonax12
(Xonax12)
April 12, 2023, 3:50pm
#20
It does for me and I don’t know what you’re doing wrong.