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

Whats wrong with this?


Kainan54
 Share

Recommended Posts

yea When atk the npc or click ctrl when next to it nothing happens. it worked with the default main.txt with godlords inventory stuff added. so yea here is the script thingy:
' Executes whenever a scripted NPC does an action.
Sub ScriptedNPC(Index, Script)
Select Case Script
Case 0
Call PlayerMsg(index, "you look weak…go get me 10 flowers and I might not hurt ya!?", 12)
If CanTake(Index, 1, 10) = false Then
    Call PlayerMsg(index, "You runt go kill those fur things for the flowers! I bet even you can beat em!", 12)
Else
    Call TakeItem(index, 1, 10)
    Call GiveItem(index, 2, 1)
    Call GiveItem(index, 3, 1)
    Call GiveItem(index, 4, 1)
      Call GiveItem(index, 5, 1)
    Call PlayerMsg(index, "ok here is some armor and a port potion to the outer world!", 12)
End If
Exit Sub

Case 1
Call PlayerMsg(index, "I need 15 roots. Um erm can you help me??", 12)
If CanTake(Index, 7, 15) = false Then
    Call PlayerMsg(index, "go kill some elites they took them so they should them.!", 12)
Else
    Call TakeItem(index, 7, 15)
    Call GiveItem(index, 8, 1)
    Call GiveItem(index, 9, 1)
    Call GiveItem(index, 10, 1)
    Call PlayerMsg(index, "ha those roots were never mine!", 12)
End If
Exit Sub

Case 2
Call PlayerMsg(index, "hey get me 30 dragon wings…I will pay you well with real fighting gear”,12)
If CanTake(Index, 15, 30) = false Then
    Call PlayerMsg(index, the dragon’s are south of here now get me the wings", 12)
Else
    Call TakeItem(index, 15, 30)
    Call GiveItem(index, 12, 1)
    Call GiveItem(index, 13, 1)
    Call GiveItem(index, 14, 1)
    Call GiveItem(index 16,1
    Call PlayerMsg(index, "well done enjoy!12)
End If
Exit Sub

Case 3
Call PlayerMsg(index, "give me 60 gems for a great reward.", 12)
If CanTake(Index, 17, 60) = false Then
    Call PlayerMsg(index, " the cave dwellers have the jewls from there mines", 12)
Else
    Call TakeItem(index, 17, 60)
    Call GiveItem(index, 18, 1)
    Call GiveItem(index, 19, 1)
    Call GiveItem(index, 20, 1)
    Call GiveItem(index, 21, 1)
    Call PlayerMsg(index, "hmm these are fine!", 12)
End If
Exit Sub

Case 4
Call PlayerMsg(index, "kill the boss for a epic armor set and the freedom from the arena", 12)
If CanTake(Index, 22, 1) = false Then
    Call PlayerMsg(index, " the kinar have the jewls.", 12)
Else
    Call TakeItem(index, 22, 1)
    Call GiveItem(index, 23, 1)
    Call GiveItem(index, 24, 1)
    Call GiveItem(index, 25, 1)
    Call GiveItem(index, 26, 1)
Call GiveItem(index, 27, 1)
    Call PlayerMsg(index, "use the port potion to leave", 12)
End If
Exit Sub

End Select
End Sub

i checked npc has stats and scripts are on so yea…
Link to comment
Share on other sites

Okay, yea, you have quite afew more errors here with ending the strings (it looks like you used Microsoft word or something like that for some of these scripts).
Line 32,
Call PlayerMsg(index, "hey get me 30 dragon wings…I will pay you well with real fighting gear”,12)
Should be:
Call PlayerMsg(index, "hey get me 30 dragon wings…I will pay you well with real fighting gear",12)

Line 34,
Call PlayerMsg(index, the dragon’s are south of here now Get Me the wings", 12)
Should be:
Call PlayerMsg(index, "the dragon’s are south of here now Get Me the wings", 12)

Line 40,
Call GiveItem(index 16,1
Should be:
Call GiveItem(index 16,1)

Also, you might have a logical error, if you set it so the item it needs to give/take, is stackable, so make sure it's not.
Link to comment
Share on other sites

@Kainan54:

> hmm still no luck is there any other info i may provide for a soultion(btw thx for all the help so far I needed it even if the npc was working :) )

Please post your up-to-date version of the sub (this time though, please usetags this time though.

Also, just making sure, you have scripting turned on (the Server's Control Panel Tab)
Link to comment
Share on other sites

ok```
'Executes whenever a scripted NPC does an action.
Sub ScriptedNPC(Index, Script)
  Select Case Script
      Case 0
Call PlayerMsg(index, "you look weak…go get me 10 flowers and I might not hurt ya!?", 12)
If CanTake(Index, 1, 10) = false Then
    Call PlayerMsg(index, "You runt go kill those fur things for the flowers! I bet even you can beat em!", 12)
Else
    Call TakeItem(index, 1, 10)
    Call GiveItem(index, 2, 1)
    Call GiveItem(index, 3, 1)
    Call GiveItem(index, 4, 1)
      Call GiveItem(index, 5, 1)
    Call PlayerMsg(index, "ok here is some armor and a port potion to the outer world!", 12)
End If
Exit Sub

Case 1
Call PlayerMsg(index, "I need 15 roots. Um erm can you help me??", 12)
If CanTake(Index, 7, 15) = false Then
    Call PlayerMsg(index, "go kill some elites they took them so they should them.!", 12)
Else
    Call TakeItem(index, 7, 15)
    Call GiveItem(index, 8, 1)
    Call GiveItem(index, 9, 1)
    Call GiveItem(index, 10, 1)
    Call PlayerMsg(index, "ha those roots were never mine!", 12)
End If
Exit Sub

Case 2
Call PlayerMsg(index, "hey get me 30 dragon wings…I will pay you well with real fighting gear",12)
If CanTake(Index, 15, 30) = false Then
    Call PlayerMsg(index, "the dragon’s are south of here now Get Me the wings", 12)
Else
    Call TakeItem(index, 15, 30)
    Call GiveItem(index, 12, 1)
    Call GiveItem(index, 13, 1)
    Call GiveItem(index, 14, 1)
    Call GiveItem(index 16,1)
    Call PlayerMsg(index, "well done enjoy!", 12)
End If
Exit Sub

Case 3
Call PlayerMsg(index, "give me 60 gems for a great reward.", 12)
If CanTake(Index, 17, 60) = false Then
    Call PlayerMsg(index, " the cave dwellers have the jewls from there mines", 12)
Else
    Call TakeItem(index, 17, 60)
    Call GiveItem(index, 18, 1)
    Call GiveItem(index, 19, 1)
    Call GiveItem(index, 20, 1)
    Call GiveItem(index, 21, 1)
    Call PlayerMsg(index, "hmm these are fine!", 12)
End If
Exit Sub

Case 4
Call PlayerMsg(index, "kill the boss for a epic armor set and the freedom from the arena", 12)
If CanTake(Index, 22, 1) = false Then
    Call PlayerMsg(index, " the kinar have the jewls.", 12)
Else
    Call TakeItem(index, 22, 1)
    Call GiveItem(index, 23, 1)
    Call GiveItem(index, 24, 1)
    Call GiveItem(index, 25, 1)
    Call GiveItem(index, 26, 1)
Call GiveItem(index, 27, 1)
    Call PlayerMsg(index, "use the port potion to leave", 12)
End If
Exit Sub

  End Select
End Sub

```and scripts are on in sever
Link to comment
Share on other sites

well yea they were stackable(btw do i need to make give currency or somthing for stack?) but the problem still persisted when i un stacked them so im very confused…i noticed i deleted this case else thing when i put scripts in..do i need the case else?
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...