I want that when a player types another player's name that is in the server and types the value of what they want to give, then submits it, it will add the amount of what the player typed to the other player's leaderstats value.
local PlrName = script.Parent.Parent.PlrName
local moneytogive = tonumber(script.Parent.Parent.Value.Text) -- "Value" is a TextBox
local ting = 0 -- debounce
function check()
if ting == 0 then
ting = 1
local target = game.Players:FindFirstChild(PlrName)
if target ~= nil then
local stats = target.leaderstats
if stats ~= nil then
local points = stats.Points
points.Value = points.Value + moneytogive
wait()
end
end
ting = 0
end
script.Parent.Parent.PlrName.Text = "Insert Name Here"
script.Parent.Parent.Value.Text = "Insert Value Here"
end
script.Parent.MouseButton1Click:connect(check)
That is what I have done, someone tell me why it won't work and how I can fix it.

1 comment
If Value is the name of a textbox, you get its contents with Value.Text