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

Script won't work D:?

Asked by
KenzaXI 166
9 years ago
local Stoper = script.Parent
local Sound = game.Workspace.Sound
function onClick()
    Sound.Volume = 0
    Sound:Remove()
end
Stoper.ClickDetector.MouseClick:connect(onClick)

It worked be4 the recent update today D:

0
I don't see anything wrong with the coding but maybe unless the paths are incorrect. UserOnly20Characters 890 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

:Remove() only sets the parent to nil, use Destroy() to remove it, if you want the sound to stop you have to destroy it.

local Stoper = script.Parent
local Sound = game.Workspace.Sound
function onClick()
    Sound.Volume = 0
    Sound:Destroy() -- we are using the Destroy() method instead of the Remove() method here
end
Stoper.ClickDetector.MouseClick:connect(onClick)

0
It won't work D:, I think robloxs Recent update fked most things up, Because the BodyVelocity is ruined too! KenzaXI 166 — 9y
Ad

Answer this question