I am making a script for my friends obby. It instantly loads the player's character and adds a death (?) to their ? leaderstat. It wont work though.
In the ServerScriptService:
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder", plr)
leaderstats.Name = "leaderstats"
local deaths = Instance.new("IntValue", leaderstats)
deaths.Name = "?"
end)
In StarterCharacterScripts:
script.Parent.Humanoid.Died:Connect(function()
local plr = game.Players:GetPlayerFromCharacter(script.Parent)
plr:LoadCharacter()
local deaths = plr.leaderstats:FindFirstChild("?").Value
deaths = deaths + 1
print(deaths) -- it won't even print the value of ?
end)
EDIT: The "?" is a skull-and-crossbones symbol.

6 comments
By the way, you should always use names that make it easy to understand what you are working with.
If I say ? how is anyone supposed to have any idea that I am talking about deaths.
Especially if other people are going to be reading your code.
FilterScript Enabled?
I said: "EDIT: The "?" is a skull-and-crossbones symbol."
it is just not showing up in ScriptingHelpers