The LocalScript is in a GUI Button. It reads the value of a stat (in this case "BuzzleStage") and then alters the button. If the value is zero, the image disappears and the other script remains disabled. If the value is one, it changes the image of the button and should enable the script.
As far as changing the image on the button, it actually works. I've had no issues with that part. However, I can't get the localscript to un-disable the other script. (The other script has to be a normal script to work btw.) I'm sure this is probably due to the limits of what a LocalScript is allowed to do, so is there a workaround for this or a way to fix it?
Thanks in advance! Here is the localscript in block code.
local player = game.Players.LocalPlayer
local stats = player:WaitForChild("leaderstats")
local BuzzStats = stats["BuzzleStage"]
local tl = script.Parent
BuzzStats.Changed:Connect(function()
if BuzzStats.Value == 0 then
tl.Image = "rbxassetid://0"
tl.Buzzle.Disabled = true
else if BuzzStats.Value == 1 then
tl.Image = "rbxassetid://6556591249"
tl.Buzzle.Disabled = false
end
end
end)

3 comments
I agree with this but I'd use ModuleScripts instead of enabling scripts to run code. Although you're already using an event so that likely cuts out the need all-together.
Hey, I'm not the one who decided to use this technique. Only trying to help him :P
Ah, thank you for the info! I'm still relatively new to scripting, so I wasn't aware of the constraints of serverside vs clientside stuff.