✓ Accepted answer
Well for this, there are multiple ways,
Now the first one is pretty self explanatory but I should explain the second one.
Now like @Mokiros said, You could use touch events, For this we should put the sound in the player gui, so...
game.Players.PlayerAdded:connect(function(plr)
local audio = Instance.new("Sound")
audio.Parent = game.Workspace[plr.Name]
end)
Now that we've set up where the audio is, We can now change it with an touched event,
game.Players.PlayerAdded:connect(function(plr)
local audio = Instance.new("Sound")
audio.Parent = game.Workspace[plr.Name]
audio.Name = "LocalAudio"
game.Workspace.'Partname here'.Touched:connect(function()
game.Players[plr.Name].PlayerGui.LocalAudio.SoundId = "Sound id here"
game.Players[plr.Name].PlayerGui.LocalAudio:Play()
end)
end)
4 comments
You can use .Touched and .TouchEnded events
Thanks! But how do I keep the sound file individual for each player?
You can put it in Player instance
Thanks for the help!