I am trying to find a way other than while true do loop to find the change in the textbox text and update the integer value accordingly, textbox and IntValue and localscript all are in StarterGUI
I tried to find the solution on the dev forum but didn’t find anything for what I needed…
local RunService = game:GetService("RunService")
--This seems to be a TextBox? Is it a string?
local MainValue = game.Players.LocalPlayer.PlayerGui:WaitForChild("ATM_Gui").MainFrame.HolderFrame.Withdraw.Input.Text
local OldValue
local NewValue
--Initialization
NewValue = MainValue.Value
OldValue = NewValue.Value
--Prevent lag
RunService.RenderStepped:Connect(function()
OldValue = NewValue
NewValue = MainValue.Value
if (OldValue.Value ~= NewValue.Value) then
--Value changed
end
end)
Is it for localscript?, I tried your code too but it is not updating the value, I updated the post please check it again so you can get more idea about my problem
local RunService = game:GetService("RunService")
local Source = game.Players.LocalPlayer.PlayerGui:WaitForChild("ATM_Gui").MainFrame.HolderFrame.Withdraw.Input
local OldValue
local NewValue
--Initialization
NewValue = Source.Text
OldValue = NewValue
--Prevent lag
RunService.RenderStepped:Connect(function()
OldValue = NewValue
NewValue = MainValue
if (OldValue ~= NewValue) then
--Value changed
end
end)