Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is this not stopping the sound? :/

Any ideas? Thanks!

function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
local p = game.Players:FindFirstChild(part.Parent.Name)
if p ~=nil and p.PlayerGui.RecordRoomMusic.IsPlaying.Value == true then
p.PlayerGui.RecordRoomMusic:Stop()
end
end
end

script.Parent.Touched:connect(onTouch)

Note - the music is definitely playing when I step on the brick and there are no errors in the output

2 comments

0

IsPlaying is a roperty of a sound, it is not an individual Bool value. Remove the '.Value'

0

OK - thanks, I changed that but it still doesn't work :/

1 answer

Not sure if this world effect it or not, but ~~~~~~~~~~~~~~~~~ if (humanoid~=nil) then

 Doesn't need brackets.

1 comment

0

OK - thanks, I changed that but it still doesn't work :/

This discussion is preserved as it was. New answers, comments, and votes are closed.