Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How many kills in Profile (Kill Counter) ES


Toucher1
 Share

Recommended Posts

It counts how many kills the players have and display it in their profile. Only works with ES. Here one picuture:

![](http://www.freemmorpgmaker.com/files/imagehost/pics/a314a5fb35a8f24f6f12d1b6c7021261.JPG)

First make a new Folder 'charextras' in the folder Scripts.

Add this in OnDeath.ess:

```
Sub OnNPCDeath(Index, Map, NPCNum, NPCIndex)

killamount = (GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "KillCounter", "Kills") + 1)
Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "KillCounter", "Kills", (killamount))

```
and add this at the bottom infront of End Sub in Profil.ess:

```

Call CustomMenuLabel(Index, ElementIndex, "Kills: " & GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "KillCounter", "Kills"), 20, 100 + (ElementIndex - 1) * 20, 10, WHITE, LEFT, 400, 20)
ElementIndex = ElementIndex + 1

```
Add this in OnNewChar.ess:

```

Sub OnNewChar(Index, CharNum)

Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "KillCounter", "Kills", "0")

```
Link to comment
Share on other sites

> I think you'll get errors if you open the profile and the player didnt died before, the file doesnt exists then

Also Add
In the "Sub JoinGame(Index)"
```
If GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "KillCounter", "Kills") = "" Then
Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "KillCounter", "Kills", "0")
End If

```
Link to comment
Share on other sites

I fixed again a mistake.

Put this at the bottom, infront of End Sub in Profil.ess: (It must be at the end!)

```

Call CustomMenuLabel(Index, ElementIndex, "Kills: " & GetVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "KillCounter", "Kills"), 20, 100 + (ElementIndex - 1) * 20, 10, WHITE, LEFT, 400, 20)
ElementIndex = ElementIndex + 1

```
Link to comment
Share on other sites

  • 3 weeks later...
If this is one of your first scripts bravo because I started the same but if this is the opposite well…  Thats failure as a scripter/coder...  You can also have a death counter...  All very simple...  Oh well good job!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...