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

Why doesn't this deactivate it?

It should, but it doesn't..?

local s = game.Workspace.Part.Sound
local b = script.Parent.Parent.Song2.Script.Disabled
function Clicked()
	s.SoundId = "rbxassetid://148321914"
	s:Play()
end
script.Parent.MouseButton1Down:connect(Clicked)

if s.IsPlaying == true then
	b = true
end







5 comments

0

Any output or errors?

0

Is there another object in Workspace that has the name of part?

0

No errors, and yes their is.

0

Still have no clue why its not working.

0

That's your problem rename the part to something like Radio or something, because Roblox doesn't know which part you are referring to since there are multiple instances with the same name.

1 answer

local s = game.Workspace.Part.Sound
local b = script.Parent.Parent.Song2.Script --.Disabled returns a boolean, changing the boolean wont change the Disabled property further into the script
function Clicked()
    s.SoundId = "rbxassetid://148321914"
    s:Play()
	b.Disabled = true --set .Disabled to true to disable the script when it is played
end
script.Parent.MouseButton1Down:connect(Clicked)

2 comments

0

Still isn't deactivating it.

0

any output?

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