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

My second script, is it ok?


omegas7
 Share

Recommended Posts

Hello.
This is my second script, still training.
This time I made a Npc that will give you 1 free level if you have defeated 10 or more players.

I got a question about this script, the question is in the script  :lol:.

```
Call Playermsg (Index, "Only true player hunters could get the benefit of my magic.", 15)
Dim Pk
Dim Lvl
Pk= GetPlayerPK(Index)

If Pk < 10 then
Call Playermsg (Index, "Sorry, you don't seem to be very skillful for this benefit.", 15)

Else

Call Playermsg (Index, "Very good, you seem to be pretty skillful, I will let you feel my power, the power of 1 free level!", 15)

Lvl= GetPlayerLevel(Index) + 1

'After this part I wasn't sure of what code to use:
'This...

SetPlayerLevel(Index, Lvl)

'Or this...

SetPlayerLevel(Index, 1) + Lvl - 1
End if

'I think it is the first one.
```
That's it, I wanted to know if it was ok.

Will I be a good Sadscripter someday?

By the way, how do I do for when this script already gave the level to the player, only 1 time, then it changes to another script saying "I already gave you a level".

And, in the Prompt command, in the part I have to select the script to be run if yes, it asks me for the number of the script, but I don't really understand it, there are so many scripts, separated in different subs… From where do I get that number? I wanted to try this command in this skill.

Have a good day.
Omegas7.
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...