It is supposed to add a point to the leaderstats everytime it gets clicked Hierarchy: https://gyazo.com/67616593038e127a56fb83fd48698230 script:

script.Parent.MouseButton1Down:Connect(function(player)
	
	player.leaderstats.Points.Value = player.leaderstats.Points.Value + 1
	
	
end)

and for the main one (in workspace)

game.Players.PlayerAdded:Connect(function(player)
	
 local leaderstats = Instance.new("Folder") 
    leaderstats.Name = "leaderstats" 
    leaderstats.Parent = player 
   
    local Value = Instance.new("IntValue")
    Value.Name = " Won: "
    Value.Parent = leaderstats
    Value.Value = 0
   
	
	
end)

Two different scripts used here btw.

5 comments

0

GuiButton.MouseButton1Down does not return player.

0

Also why are you using regular scripts inside of a screen gui?

1

DevKing (from the video I saw) used a "ClickDectector" while you're using a "TextButton". The reason your script doesn't work is because the Server can't detect when a Client has clicked any buttons, except for ClickDetectors. The way you should go at giving the player points is putting the first script into a LocalScript and connecting it with a RemoteEvent, then adding onto the points.

0

Link me to the tutorial you're using, there might be a lot more going wrong than you have shown here.

0

I would recommend watching the whole video, then trying this out!