first, you need to make a leaderboard,
make a script in serverscriptservice
type this in
01 | local function onPlayerJoin(player) |
02 | local leaderstats = Instance.new( "Folder" ) |
03 | leaderstats.Name = "leaderstats" |
04 | leaderstats.Parent = player |
07 | local coins = Instance.new( "IntValue" ) |
10 | coins.Parent = leaderstats |
14 | game.Players.PlayerAdded:Connect(onPlayerJoin) |
now to make it increase, I am not going to type out everything because I don't know what you want to call this, but anyways write this under your leaderstats code
1 | if game.Workspace.WhateveryourmonsterNameis.Humanoid.Health = = 0 then |
2 | player.leaderstats.coins.Value = 10 + player.leaderstats.coins.Value |
I probably have a lot of errors so you might want to proofread it, but other than that It's got the correct logic