TextBox Value Not Updating to Main Script

I was trying to update a value in my script using a textbox for a min and max id, this an example of the min id. In the output it only prints the inital value of the textbox and not the updated value. Is there any way for this value to update correctly to the main script?

image

LocalScript:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent3 = ReplicatedStorage:WaitForChild("RemoteEvent3")
local text = script.Parent:WaitForChild("Frame2"):WaitForChild("MINID")

text:GetPropertyChangedSignal("Text"):Connect(function()
	remoteEvent3:FireServer()
end)

Script:

local startamount = 1

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent3 = ReplicatedStorage:WaitForChild("RemoteEvent3")

remoteEvent3.OnServerEvent:Connect(function(player)

	local gui2 = player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui"):WaitForChild("Frame2")
	startamount = gui2:WaitForChild("MINID").Text
	print("bro")
	print(startamount)
end)

It’s likely because textbox changes are only replicated locally, try sending the text as an argument through the remote event.

text:GetPropertyChangedSignal("Text"):Connect(function()
	remoteEvent3:FireServer(text.Text)
end)
remoteEvent3.OnServerEvent:Connect(function(player, startAmount)
	print(startAmount)
end)
1 Like