Replace coins broken

hi robloxians,
i made replace coins to another currency system and there is a problem with the scripts here is the scripts:
give coins script:

game.ReplicatedStorage.ChangeCoinsEvents.GiveCoins.OnServerEvent:Connect(function(plr)
	script.Configuration.CoinsToChange.Value = plr:WaitForChild("PlayerGui").ScreenGui.Frame.TextBox.Text
	wait(1)
	if plr:FindFirstChild("leaderstats").Change.Value >= script.Configuration.CoinsToChange.Value then
		plr:FindFirstChild("leaderstats").Coins.Value = plr:FindFirstChild("leaderstats").Coins.Value + script.Configuration.CoinsToChange.Value
		plr:FindFirstChild("leaderstats").Change.Value = plr:FindFirstChild("leaderstats").Change.Value - script.Configuration.CoinsToChange.Value
		plr:WaitForChild("PlayerGui"):WaitForChild("ScreenGui").Frame.TextBox.Text = ""
	else
		print("You need more Coins.")
	end
end)

Text button script:

script.Parent.TextButton.MouseButton1Click:Connect(function()

game.ReplicatedStorage.ChangeCoinsEvents.GiveCoins:FireServer()

end)

thanks for help.

Are you getting any errors? I can’t tell what type of value CoinsToChange is, but if it is a num/int value, you need to use a tonumber, so it is like this. script.Configuration.CoinsToChange.Value = tonumber(plr:WaitForChild("PlayerGui").ScreenGui.Frame.TextBox.Text)

i did that and is still the same

Can you either go in studio and look at the output, or hit F9, so that I can see if there are any errors.

Where are the script and remote located?

remote inside folder that i put at replicated storage and script one inside ui and one inside serverscriptservice

there is no error

Is the script inside the UI a local script?

yes is a local script. [30 char]