What's new

Solved XP per Time?

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

Gundalf313

Newbie
Messages
2
Reaction score
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
 
A

Andrew74

Enthusiast
Messages
824
Reaction score
219
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();
}
 
G

Gundalf313

Newbie
Messages
2
Reaction score
0
It doesnt work, I dont get the XP and nobody can join because he gets a "Security Problem".
 
A

Andrew74

Enthusiast
Messages
824
Reaction score
219
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.
 
X

xChEmIcAl

Newbie
Messages
15
Reaction score
0
if u do this it will be awesome
 
R

ReFLexX IV

Enthusiast
Messages
1,001
Reaction score
140
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.
 
Z

zy0n

Enthusiast
Messages
900
Reaction score
449
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:
 
Status
Not open for further replies.
Top Bottom