#TouchEnded event won't work for some reason?

1 messages · Page 1 of 1 (latest)

modern nacelle
#

Made a script where it plays a sound when you are touching a part and stops playing it when you stop touching it but for some reason the touchEnded won't work.

local part = script.Parent
local sound = part.ambience

local function soundPlay()
    sound:Play()
end

local function soundStop()
    sound:Stop()
end

part.Touched:Connect(soundPlay)
part.TouchEnded:Connect(soundStop)
abstract spruce
#

.Touch works with all physics objects touching it, so there is a possibility that something else is touching it