So I do know how one can play a sound for the entire server, but is there any way you can locally play a sound with either a button press or touched event? Thanks In Advance.
5 Likes
Can’t you just play the sound from a local script?
2 Likes
For some reason my sound just mutes itself from a local script
Have you tried testing in an actual game, not studio?
1 Like
Yes I have tried testing it that way
Use a LocalScript
, put it inside StarterPlayerScripts
& try this?
local Part = workspace.Part
local Sound = game.SoundService.Part
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local DB = false
Part.Touched:Connect(function(Hit)
if not DB and Character == Hit.Parent then
DB = true
Sound:Play()
Sound.Ended:Wait()
DB = false
end
end)
13 Likes
Thanks so much, I probably should have defined that character like that in my touched event.
2 Likes