local Value = script.Parent.ClickValue local Button = script.Parent local Player = game.Players.LocalPlayer --get the local player local Mouse = Player:GetMouse() --get the mouse function ChangeValue() Mouse.Button1Down:connect(function() Value.Value = 1 end) end Mouse.Button1Down: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.
local Value = script.Parent.ClickValue local Button = script.Parent local Player = game.Players.LocalPlayer --get the local player local Mouse = Player:GetMouse() --get the mouse function ChangeValue() Value.Value = 1 end Mouse.Button1Down: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