Hello!
So I'm trying to make a progress system, and basically the system works as this:
1- The user touches the brick 2- The script adds a value to a progressbar 3- The script is either disabled or the brick is deleted entirely so the same brick can't add more to the progressbar.
This should happen for the localplayer only.
Here's the code I tried, in a localscript:
function addProgress()
print("a")
game.Players.LocalPlayer.StarterGUI.ScreenGUI.ProgressBar.Config.Progress.Value = game.Players.LocalPlayer.StarterGUI.ScreenGUI.ProgressBar.Config.Progress.Value + 0.54
script.Disabled = true
end
script.Parent.Touched:Connect(addProgress)
The prime issue here is that the script isn't executing at all, as "a" isn't being outputted.

7 comments
Thanks! I'll test this out.
I tested it to no avail. I think the issue is that it isn't executing as "a" is not printed into the output.
I believe the function executes but any part it touches will register the function which since you are disabling the script the moment that happens is likely the cause of your problem. I will fix the answer and re-edit.
I edited my answer, this should fix it now for you.
I'm gonna look over it now. Thanks!
I have a question regarding the first part: Should I just remove the function entirely and replace it with the if statement or should I put the if statement into the function?
I think you should just add the if statement, remove the script.Disabled part and just destroy the script instead. While you can definitely use the .Disabled if you want, I'd recommend Destroy as per what I explained in the answer.