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

Why doesn't this deactivate it?

Asked by 9 years ago

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







0
Any output or errors? parkderp1 105 — 9y
0
Is there another object in Workspace that has the name of part? parkderp1 105 — 9y
0
No errors, and yes their is. UnleashedGamers 257 — 9y
0
Still have no clue why its not working. UnleashedGamers 257 — 9y
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. parkderp1 105 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago
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)
0
Still isn't deactivating it. UnleashedGamers 257 — 9y
0
any output? FutureWebsiteOwner 270 — 9y
Ad

Answer this question