How can I make 2 text Buttons that increase a and decrease a Value?

I want to make 2 text Buttons that increase and decrease a value, and that have an increase and decrease limit, but the problem is that I don’t know how to do it and how to combine it to brightness

Do you want to do it only for the client or for the full server?

For the client, you will just have to set the value by defining the int/string value. For the server, you will have to use Remote Events and pass any required data to achieve that. Be careful with vulnerable remote events though, as they may be exposed to exploiters.

upButton.MouseButton1Click:Connect(function()
--brightness code here
end)
downButton.MouseButton1Click:Connect(function()
--brightness code here
end)

EDIT I did not mean to reply to AgridFights1, apologies.

An easy way to understand:

local TestValue = game.ReplicatedStorage:WaitForChild("TestValue")
local DecreaseButton = script.Parent.DecreaseButton
local IncreaseButton = script.Parent.IncreaseButton
local DisplayLabel = script.Parent.DisplayLabel

function updateText()
    DisplayLabel.Text = TestValue.Value
end

updateText()

TestValue:GetPropertyChangedSignal("Value"):Connect(updateText)

IncreaseButton.MouseButton1Click:Connect(function()
    TestValue.Value = TestValue.Value + 1
end)

DecreaseButton.MouseButton1Click:Connect(function()
    TestValue.Value = TestValue.Value - 1
end)

Hopefully it helped :slight_smile:

1 Like