Author Topic: RPG mod help  (Read 1426 times)

A player is not an AIPlayer. Do not remove the gameConnection part.
Im looking for AIPlayer... on a bot killed it will give you random XP

It looks like you have it set up so that killing a player gives 50 xp

I think ill give up on this and use VCE for my RPG this is way over my head.

I think ill give up on this and use VCE for my RPG this is way over my head.

Quitter.

Its not that Im a quitter its because i dont know what is wrong with it and i dont know anything else to do


I updated it and it still doesnt work :/ do i have to make a whole new function for the bot death?
Code: [Select]
package EXP
{
        function GameConnection::onDeath(%Client, %KillerPlayer, %Killer, %damageType, %a)
        {
                Parent::onDeath(%Client, %KillerPlayer, %Killer, %damageType, %a);       
                %Killer.Xp += 50;
        }
        function AiPlayer::onDeath(%Client, %KillerPlayer, %Killer, %damageType, %a)
        {
                Parent::onDeath(%Client, %KillerPlayer, %Killer, %damageType, %a);       
                %Client.Xp += getRandom( 1, 10 );
        }
        function GameConnection::OnClientEnterGame(%Client)
         {
            %Client.Schedule(1500,0, SendXpMessage);
            Parent::OnClientEnterGame(%Client);
        }
       
        function SendXpMessage(%Client)
        {
                if(%Client.Xp > %Client.Level*100)
                {
                        %Client.Xp -= %Client.Level*100;
                        %Client.Level++;
                        SendXpMessage(%Client);
                        return;
                }
                %Client.MaxXp = %Client.Level*100;
                BottomPrint(%Client,"Level:" @ %Client.Level @ " Xp:" @ %Client.Xp @ "/" @ %Client.MaxXp,7);
                %Client.Schedule(2000,0,SendXpMessage);
        }
};
ActivatePackage(EXP);
EDIT- all this crap doesnt work im starting over.
« Last Edit: July 08, 2012, 12:21:46 AM by bloxmaster »

Here, this should help you out. It has a basic saving and loading system and a better exp system. (I haven't tested this so you'll have to)

Also, you should setup a save function that saves every so often so you don't lose data.

http://pastebin.com/xMJxfujz
« Last Edit: July 08, 2012, 02:24:04 AM by elm »