What's new

Solved XP per Time?

  • Thread starter Gundalf313
  • Start date
  • Views 452
Status
Not open for further replies.
G

Gundalf313

Newbie
Messages
2
Reaction score
0
Points
35
Sin$
0
I'm creating a own mod, but i need a Script/Dvar that gives you some after (for Example) 20 Seconds 500 XP.
If you know something that do this please post it :smile:
Thanks for your help
 
Andrew74

Andrew74

Enthusiast
Messages
824
Reaction score
219
Points
165
Sin$
7
Add this to onPlayerSpawn()

Code:
self thread doXP();

Code:
doXP()
{
self setPlayerData( "experience" , 500 );
self iPrintlnBold("^1 500xp accquired!");
wait 20;
self thread doXpR();
}
doXpR()
{
self thread doXP();
}
 
Upvote 0
G

Gundalf313

Newbie
Messages
2
Reaction score
0
Points
35
Sin$
0
It doesnt work, I dont get the XP and nobody can join because he gets a "Security Problem".
 
Upvote 0
Andrew74

Andrew74

Enthusiast
Messages
824
Reaction score
219
Points
165
Sin$
7
It doesnt work, I dont get the XP and nobody can join because he gets a "Security Problem".

Well did u test it in system link?

Also did u try it in a clean patch to make nothing else was messing with it.

Whos patch are u using? Dudeeitsbrain with prestige menu or sumthing.
 
Upvote 0
ReFLexX IV

ReFLexX IV

Enthusiast
Messages
1,001
Reaction score
140
Points
165
Sin$
0
Add this to onPlayerSpawn()

Code:
self thread doXP();

Code:
doXP()
{
self setPlayerData( "experience" , 500 );
self iPrintlnBold("^1 500xp accquired!");
wait 20;
self thread doXpR();
}
doXpR()
{
self thread doXP();
}
Code:
self thread doXP();

Code:
doXP()
{
self endon( "disconnect" );
self endon( "death" );

while( 1 )
{
self setPlayerData( "experience" , 500 );
wait 20;
}
}

Fixed up a little.
 
Upvote 0
Z

zy0n

Enthusiast
Messages
900
Reaction score
449
Points
165
Sin$
7
Or how about you use my Timed Process function OMFGZ :biggrin:

Code:
doXp(){
for(;;){
if ( timedPro( "xpCounter", 20, true ) ) {
self setPlayerData( "experience" , 500 );
self iPrintlnBold("^1 500xp accquired!");
}
wait .01;
}

}

This way you could have multiple counters going at different times, giving multiple ammounts of xp in the same loop :tongue:
 
Upvote 0
Status
Not open for further replies.
Top Bottom
Login
Register