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

Need help with timed scripts sub


Syner
 Share

Recommended Posts

I don't like the regeneration rates that come automatically with the game and I'm tryign to develop my own but I can't get it to work, basically I have it so if server seconds are equal to or more than 0 it would increase the person's HP and MP by 1% but I can't get it to start …here is the script.

Sub TimedEvent(Hours, Minutes, Seconds)
Dim HPRegen
Dim MPRegen
HPRegen = (GetPlayerMaxHP(index) / 10)
MPRegen = (GetPlayerMaxMP(index) / 10)
If Seconds => 0 Then
Call SetPlayerHP(index, GetPlayerHP(index) + HPRegen)
Call SetPlayerMP(index, GetPlayerMP(index) + MPRegen)
End If
Loop
End Sub
Link to comment
Share on other sites

It's been said before, but Index isn't a variable in Sub TimedEvents.  If you want to get everyone to regenerate, you have to Dim Index, and add For Index = 1 To MAX_PLAYERS. 

Also, if it's the time between regenerations you have problems with, you can change it in data.ini…
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...