How do I check to see if something is in workspace? Like if a specific part is in workspace, play a specific audio/sound.
✓ ANSWER ACCEPTED
How do I check to see if something specific is in workspace?
1 answer
✓ Accepted answer
Use :FindFirstChild(). Like this
if workspace:FindFirstChild("Part") then
print("A part exists in the workspace!")
end
To play a specific audio for only a client, do this in a localscript.
local AudioId = 1234567 --Insert audio id here
game:GetService("ContentProvider"):Preload(AudioId) --This preloads the audio, so the player can always hear it.
game:GetService("SoundService"):PlayLocalSound(AudioId)
Otherwise, to play a sound everyone can hear, put the script in the startergui. Also, I'd like to see you provide a script that you need help with next time.
This discussion is preserved as it was. New answers, comments, and votes are closed.
