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

How Do I Get This Button To Turn Off This Local Script?

I have a Gui with a button that has this script in it:

function onButtonClicked()
 game.StarterPlayer.StarterPlayerScripts.AudioVisualizer.Disabled = false
 end

 script.Parent.MouseButton1Click:connect(onButtonClicked)

The code looks good to me and there are no errors, yet every time I click the button on test mode in studio or in an actual server it has no effect. The script i'm trying to enable is a LocalScript and YES it is meant to be Disabled = false not true.

1 answer

✓ Accepted answer

the script goes to game.Players.LocalPlayer.PlayerScripts when you play. You are just toggling the script in game.StarterPlayer.StarterPlayerScripts but not in the actual Player.

This script should be a LocalScript in the Button The script :

local Player = game.Players.LocalPlayer
function onButtonClicked()
 	Player.PlayerScripts.AudioVisualizer.Disabled = false --You asked it to be false
end
 script.Parent.MouseButton1Click:connect(onButtonClicked)

1 comment

2

Thank you.

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