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

Porblem with ScriptedNPC


Nahchito
 Share

Recommended Posts

Hi guys, I've started again my project and now after a few source edits any scriptednpc gives me this error

> Wrong number of arguments or property assignment not valid

![](http://bb.xieke.com/files/error%201.bmp)
I've tried opening the server with the vb6 and bumping the error tu debug it, but it doesnt hightlight anysection, it only gives the error.
Any ideas?
I can send you the server source..

thanks
Link to comment
Share on other sites

I'll point out that posting .bmp images is against the forum rules.

Also, the GUI you're using is breaking the ToS which were agreed to when it was downloaded. It was in fact something I released for educational purposes. I suggest you revert back to the default GUI or create your own.
Link to comment
Share on other sites

This is my Sub

```
' Executes whenever a scripted NPC does an action.
Sub ScriptedNPC(Index, Script)
Select Case Script
Case 1
If GetPlayerLevel(index) > 24 then
Call PlayerMsg(Index, "Adm.: Todavia no tengo la lista para crear Gremios!", WHITE)
Else
Call PlayerMsg(Index, "Adm.: Solo los guerreros con suficiente experiencia pueden hacer un Gremio!", WHITE)
End if
Exit Sub

Case Else
Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE)
Exit Sub
End Select
End Sub
```
Link to comment
Share on other sites

Sorry, where is [ Case 0 ] ??
In my own [ Select Case blabla ] I always count from 0.

Try to change [ Case 1 ] in [ Case 0 ] ..
So, remember also to update the NPC "profile" ingame.

Lemme know please. :)
I hope to have helped you.

> @Nacho wrote: "Bump"

People have also a social life, I guess. :)
No problem, nevermind.
Link to comment
Share on other sites

mmm Strange, very strange.
There're only a thing I can suggest you: overwrite [ If GetPlayerLevel(index) > 24 then ] with [ If GetPlayerLevel(Index) > 24 Then ] ; and [ End if ] with [ End If ] . Maybe case-sentitive? I dunno..

Again, have you already tried to use [ BattleMsg ] instead of [ PlayerMsg ] ?

Except these things, personally I don't see any error in that part of the code. I can only report you an alternative code:

```
Sub ScriptedNPC(Index, Script)
Select Case Script
Case 0
Call BattleMsg(Index, "This scripted NPC has no apparent use.", WHITE)
Exit Sub

Case 1
Dim LevelPC
LevelPC = 0 + GetPlayerLevel(Index)
If LevelPC > 24 Then
Call PlayerMsg(Index, "MAJOR_24", WHITE)
Else
Call PlayerMsg(Index, "MINOR_24", WHITE)
End If
Exit Sub

Case Else
Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE)
Exit Sub
End Select
End Sub
```
That code runs for me, so if you get errors .. again .. there's only a reason - as other users (here) suggest you: control your "Main.txt", and look for errors … It's long, I know but it's the only way to be sure at 100%.

Which version of Eclipse are you usign? Origins or 2.7?
Link to comment
Share on other sites

What did you change when you edited the server and client, go over those edits and if you find anything related to npc's that you changed, double check the code, you may have made a mistake somewhere.

Did you make a call to scriptednpc in your source code? If so, check that you supplied all the values the function call needs.
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...