Why doesn't this work? Here is how the GUI is setup; http://gyazo.com/064225118cd9ddbffe6fd573d6a61fe8
playerNameforPTS = script.Parent.Parent.TextBox.Text -- Takes the value from the TextBox function Click(mouse) -- leave this playerNameforPTS = script.Parent.Parent.TextBox.Text -- Updates the value print(playerNameforPTS) -- Prints it if game.Players:FindFirstChild(playerNameforPTS) then game.Players.playerNameforPTS.leaderstats.Points.Value = game.Players.playerNameforPTS.leaderstats.Points.Value+1 end end script.Parent.MouseButton1Down:connect(Click)
playerNameforPTS = script.Parent.Parent.TextBox.Text -- Takes the value from the TextBox function Click(mouse) -- leave this playerNameforPTS = script.Parent.Parent.TextBox.Text -- Updates the value print(playerNameforPTS) -- Prints it if game.Players:FindFirstChild(playerNameforPTS) then game.Players:findfirstchild(playerNameforPTS).leaderstats.Points.Value = game.Players:findfirstchild(playerNameforPTS).leaderstats.Points.Value+1 end end script.Parent.MouseButton1Down:connect(Click)
You need the "FindFirstChild" command to be able to find the playerNameforPTS. All you did wrong was finding the value. This should work...Leave a comment if not, and i'll see what I can do.
playerNameforPTS = script.Parent.TextBox -- Takes the value from the TextBox 02 03 04 05 06 function Click(mouse) -- leave this 07 playerNameforPTS = script.Parent.TextBox -- Updates the value 08 print(playerNameforPTS) -- Prints it 09 if game.Players:FindFirstChild(playerNameforPTS) then 10 game.Players.playerNameforPTS.leaderstats.Points.Value = game.Players.playerNameforPTS.leaderstats.Points.Value+1 11 end 12 end 13 14 script.Parent.MouseButton1Down:connect(Click)