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

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

Asked by 7 years ago

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

Log in to vote
0
Answered by
oilkas 364 Moderation Voter
7 years ago
Edited 7 years ago

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)
2
Thank you. OVOFinessinq 21 — 7y
Ad

Answer this question