Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this not stopping the sound? :/

Asked by 8 years ago

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

0
IsPlaying is a roperty of a sound, it is not an individual Bool value. Remove the '.Value' TheDeadlyPanther 2460 — 8y
0
OK - thanks, I changed that but it still doesn't work :/ jjwood1600 215 — 8y

1 answer

Log in to vote
1
Answered by
L43Q 48
8 years ago

Not sure if this world effect it or not, but ~~~~~~~~~~~~~~~~~ if (humanoid~=nil) then ~~~~~~~~~~~~~~~~~ Doesn't need brackets.

0
OK - thanks, I changed that but it still doesn't work :/ jjwood1600 215 — 8y
Ad

Answer this question