• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua How can i add 50% to this script?

1268995

Member
Joined
Sep 9, 2010
Messages
422
Reaction score
13
Hello, i have a very simple (noob) question.

In this script:

Code:
rate = 1.05
doPlayerSetExperienceRate(cid, rate)

Will make receive more 5% of exp.

How can i put to player receive 5% + 50% of xp?

I ask that because i have on my server a function that gives 50% more exp to player who are premium account.

Then, when when script gives more 5% exp, the script take off the 50% premium account receive...

So i want that player receive 50% because he is premium + 5% for using a item that gives him +5% exp.

Thanks for all!
 
@Codex NG , As i said, premium player win 50% more exp for being premium, then they must win 50% exp when log in.
@Xikini , i will see what i can do, thanks for u repply!

Well then you need to learn to program in lua and the framework of the server you are using, there is nothing wrong with asking questions but if all your going to do is asking for people to make you scripts and they are not what you expected then the problem is with your explanation of things.

Please don't try to insult our intelligence telling us you made x y z script when all you have been doing is copy and pasting what everyone else has made, that method of development will get you absolutely no where.
 
Well then you need to learn to program in lua and the framework of the server you are using, there is nothing wrong with asking questions but if all your going to do is asking for people to make you scripts and they are not what you expected then the problem is with your explanation of things.

Please don't try to insult our intelligence telling us you made x y z script when all you have been doing is copy and pasting what everyone else has made, that method of development will get you absolutely no where.

Why are u telling me this bulshits? U already said u wouldnt help me anymore, and i do not ask u to help me anymore, u appeared here only to say shits.

I am not a programmer, so i do not understand enought about script to make my own script by my own. I asked for help, u gaved me codes and i try to put them the way i like. And i tried to change the codes, i spent days make that (see the date of this post). U said: "but if all your going to do is asking for people to make you scripts and they are not what you expected then the problem is with your explanation of things".
FUCK OFF! I am not asking for u make script to me! I AM trying to make the scripts with the code u sent to me. U do not sent the full code, since i need function ON LOGIN and u passed FUNCTION on creature script (ring script).

"Please don't try to insult our intelligence telling us you made x y z script when all you have been doing is copy and pasting what everyone else has made, that method of development will get you absolutely no where".
Again, FUCK OFF, i am copying and pasting the codes because, as i said, i am not a programmer to make my own code from notthing, i need a base to start. Please, leave my post and stop sayin shits to me. I will try what @Xikini suggested me.

U said i have problem with explanation, but U HAVE READING PROBLEMS MORON!

Maybe something like:

1- Onlogin gives 50% more exp to premium; <------------- IDIOT
2- When equip ring and are premium, return experience to normal and give 55% exp;
3- When dequip ring and are premium, return experience to normal and just after that add 50% experience.
4- When equip ring again, return experience to normal + add 55%

What u guys think? If i am correct, ideas for the code?

EDIT: but u guys think it will bug if log in using the ring?
 
1268995, don't get so riled up over a post.
Codex is a pretty great scripter and you should heed his words.
I agree the ring script should be placed in movements.
A couple of reasons why.
The character only logins, once. If the player removed the ring for another ring he would obtain increased experience and the benefit of whatever other ring he is now using. This is not a bug, as thats how login scripts are intended.
If the ring is in movements then the script only needs to check when the player removes and adds the ring.

Now for the fun part.
You will actually want both the login And movement script and additionally a onAdvance function. If you only have a movement script the player will have to remove and add their ring on every login. Which is fine.. but not ideal for the player. And using your other script will require the onAdvance function to ensure as they get higher levels they wont get extra experience for a couple of levels if they powergrind.

And Codex, You don't need to rile people up in every thread. ;p
We are all just trying to learn, whether or not we are learning effectively is another matter, but if someone has a passion for something and is just starting out on their adventure, most likely they aren't aware of the nuances between the different options available to them.

Good luck!

Xikini
 
1268995, don't get so riled up over a post.
Codex is a pretty great scripter and you should heed his words.
I agree the ring script should be placed in movements.
A couple of reasons why.
The character only logins, once. If the player removed the ring for another ring he would obtain increased experience and the benefit of whatever other ring he is now using. This is not a bug, as thats how login scripts are intended.
If the ring is in movements then the script only needs to check when the player removes and adds the ring.

Now for the fun part.
You will actually want both the login And movement script and additionally a onAdvance function. If you only have a movement script the player will have to remove and add their ring on every login. Which is fine.. but not ideal for the player. And using your other script will require the onAdvance function to ensure as they get higher levels they wont get extra experience for a couple of levels if they powergrind.

And Codex, You don't need to rile people up in every thread. ;p
We are all just trying to learn, whether or not we are learning effectively is another matter, but if someone has a passion for something and is just starting out on their adventure, most likely they aren't aware of the nuances between the different options available to them.

Good luck!

Xikini

Thanks for ur words!

I know that a function onlogin alone will not make it work.
That's why i posted this on ur thread free script service:

Code:
So i putted this way on CREATURESCRIPT (ring script):

If Player equip the exp ring + are free account -> get 10% more exp.
If player equip the exp ring + are premium account -> get 60% more exp (50% for being premium + 10% from exp ring) + player get storage X

If player dequip exp ring + are free account -> exp back to normal
If player dequip exp ring + are premium account -> set experience 50% (for being premium account) + remove storage X

Adding the storage are used to know if player were using the exp ring when log out.

If he were using the exp ring when he log out (then he have X storage), the FUNCTION ONLOGIN will:
If player have storage X and are premium then: Add 60% experience (50% experience for benig premium + 10% experience for using the ring);
If player have storage X and are not premium then: Add 10% experience for using exp ring.
If player do not have storage X and are premium then: Add 50% exp experience for being premium account
If player do not have storage X and are not premium account then: do not add any experience.

So we have function on login and on creature script.

I will try to figure it out! thank ya
 
Back
Top