How to play a sound when a part is touched in Roblox Studio
Hello guys welcome to my new tutorial.
Today i explain how to play a sound when a part is touched in Roblox Studio.
If this video helped please like and subscribe for more tutorials.
Also remember to follow me on Roblox!
heres the script:
--Change sound id to the id you want to play
debounce = false
script.Parent.Touched:connect(function(hit)
if not debounce then
debounce = true
if(hit.Parent:FindFirstChild("Humanoid")~=nil)then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local sound = script.Parent.Sound:Clone()
sound.Parent = player.PlayerGui
sound:Play()
wait(10)--change to how long before the sound plays again after retouching it
end
debounce = false
end
end)
#roblox #robloxstudio #robloxstudio2023 #viral #robloxnoob #viral
#viral2023 #tutorial #videogames #videogametutorials #videogames2023
#roblox2023 #robloxtutorials #robloxtutorials2023 #videogame
Other Videos By Videogames and tutorials
Other Statistics
Roblox Statistics For Videogames and tutorials
At present, Videogames and tutorials has 115,142 views spread across 48 videos for Roblox, with his channel currently having around 3 hours worth of content for Roblox. This is 43.23% of the total watchable video on Videogames and tutorials's YouTube channel.