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
I don't know if this will work, but I saw that you called the coins levels, so I solved it
local function onPlayerJoin(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local coins = Instance.new("IntValue") coins.Name = "Coins" coins.Value = 0 coins.Parent = leaderstats local levels = Instance.new("IntValue") levels.Name = "Levels" levels.Value = 0 levels.Parent = leaderstats end game.Players.PlayerAdded:Connect(onPlayerJoin)
And you got the character of the player, and not the player, because the leaderstats values is in the player, and not the character, so I solved it as well
local humanoid = workspace.Dummy:FindFirstChild("Humanoid") humanoid.Died:Connect(function() game.Players.PlayerAdded:Connect(function(player) player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 10 player.leaderstats.Levels.Value = player.leaderstats.Levels.Value + 1 end) end)
I can't confirm if it works because I don't have the dummy, and make sure that both of the Normal Scripts are in ServerScriptService.