local humanoid = workspace.Dummy:FindFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(script.Parent)
humanoid.Died:Connect(function()
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 10
player.leaderstats.Levels.Value = player.leaderstats.Levels.Value + 1
end)
why is it not working
local function onPlayerJoin(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local coins = Instance.new("IntValue")
coins.Name = "Levels"
coins.Value = 0
coins.Parent = leaderstats
end
game.Players.PlayerAdded:Connect(onPlayerJoin)
Same for coins but it's coins

4 comments
What type of script is the first script?
normal script in an r15 dummy
bottom is a normal script in serverscriptservice
Can you explain what you are trying to do