01 | local Value = script.Parent.ClickValue |
02 | local Button = script.Parent |
03 | local Player = game.Players.LocalPlayer --get the local player |
04 | local Mouse = Player:GetMouse() --get the mouse |
05 |
06 | function ChangeValue() |
07 | Mouse.Button 1 Down:connect( function () |
08 | Value.Value = 1 |
09 | end ) |
10 | end |
11 | Mouse.Button 1 Down:connect(ChangeValue) |
The problem is when i click the button it does not change the value at all to 1. Not sure what i have done wrong here.
1 | local Value = script.Parent.ClickValue |
2 | local Button = script.Parent |
3 | local Player = game.Players.LocalPlayer --get the local player |
4 | local Mouse = Player:GetMouse() --get the mouse |
5 |
6 | function ChangeValue() |
7 | Value.Value = 1 |
8 | end |
9 | Mouse.Button 1 Down:connect(ChangeValue) |
You've already told the code that when you click it, it should change it now :). You can check for errors by opening the output in the studio, it helps me a lot when finding errors :3