woh to make a sound play wenn a part is Toched (Roblox Studio tutorial)

preview_player
Показать описание
The script:
local soundId = "rbxassetid://1510219102"--Put her your soundId

function onTouch()
sound.SoundId = soundId
sound:Play()
wait(0.1)
script.Parent.CanTouch = false
wait(2)
script.Parent.CanTouch = true
wait(1000)
sound:Destroy()
end

script.Parent.Touched:Connect(onTouch)
Рекомендации по теме
Комментарии
Автор

the script

local soundId = her your soundId

function onTouch()
local sound = Instance.new("Sound", game.Workspace)
sound.SoundId = soundId
sound:Play()
wait(0.1)
script.Parent.CanTouch = false
wait(2)
script.Parent.CanTouch = true
wait(1000)
sound:Destroy()
end


Tim_schlim-cwek
Автор

When I hear another part, I want that music to be turned off, how do we do it?

serhatreyiz
Автор

its keep adding that sound again and again, how to fix that

Mihitsinha
Автор

once I done all of it it keep's on looping in the backround.but when i touch it it got louder.

troll-zm
Автор

I want to use it in my tycoon and i want it to be a buying sound but do you know what to do if player dont have enough money and i want to play then other sound?

Ckie_Dughh
Автор

How can you stop it when you get off the part

NewbiusSupreme