So, I've been experimenting with _G and I think it's broken for a reason: when I first tried to print some object's name, it printed it; I don't know why but it doesn't print that anymore but instead prints 'nil'. I also can't understand why it doesn't work for adding points to a player's leaderstats. Here's my code in the first script:
game.Players.PlayerAdded:Connect(function(player)
local LS = Instance.new("Folder", player)
LS.Name = "leaderstats"
local T = Instance.new("IntValue", LS)
T.Name = "Test"
_G.Test = T.Value
end)
Here's the second:
script.Parent.MouseClick:Connect(function()
_G.Test = _G.Test + 25
end)
They both are in different locations: the first one is in the ServerScriptService, the second is in a part in the workspace. Please explain why won't it work.

4 comments
This script appears to work fine for me, also, I'm not too sure if you really even need a global value, you could just read from the leaderstat
I know I could, but when I do so, nothing happens and I'm trying to use something like this. If it works fine for you, I will try again.
Are you trying to set the leaderstat to the global value? That isn't in the script is thats the case, also my setup was the same I put the 1st script in serverscriptservice and made two parts, one to print the global value and one to add, and I was able to confirm it did add to the global value.
What script doesnt work?