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

My NPC script…. im confused


Darkshot
 Share

Recommended Posts

Hi. I was tryna make my first npc so i made a scripted tile that runs this:
```
sub Welcome(index)
If GetVar("FLAGS.ini", GetPlayerName(index), "Flag5") = 0 Then
Call BattleMsg(index,"Master Wercrof: Hello and welcome to the land of Resius where you shall level all the way to level 50! I am Wercrof, I live in the barn to the right.", 4, 0)
Call BattleMsg(index,"Master Wercrof: You must be a certain class to use certain weapons.                  ", 4, 0)
Call BattleMsg(index,"Master Wercrof: Knights: Swords", 4, 0)
Call BattleMsg(index,"Master Wercrof: Rouges: Knifes", 4, 0)
Call BattleMsg(index,"Master Wercrof: Archers: Bows", 4, 0)
Call BattleMsg(index,"Master Wercrof: Druidic: Some of different", 4, 0)
Call BattleMsg(index,"Master Wercrof: Magi: Staff", 4, 0)
Call BattleMsg(index,"Master Wercrof: Clef: Mace", 4, 0)
Call BattleMsg(index,"Master Wercrof: The controls are easy. Use the arrow keys or WASD to move. To attack, use Cntrl and to pick up things and interact with people use ENTER or Cntrl.", 4, 0)
Call BattleMsg(index,"Master Wercrof: To make money defeat monsters, sell items and complete quests.", 4, 0)
Call GiveItem(index, 1, 650)
Call BattleMsg(index,": (You got 650 gold)", 4, 0)
Call BattleMsg(index,"Master Wercrof: You can train your level in my house", 4, 0)
End Sub

```So when i make a scripted tile i thought that setting it as "Flag5" would make it script 5 but when i step on the tile nothing happens…....... so i KNOW im doing something wrong but what?
BTW im new and the index text is for the game so lol yeh i know its bad. PLEASE help :icon_crap:
Link to comment
Share on other sites

> ' Executes when a player steps onto a scripted tile.
> Sub ScriptedTile(Index, Script)
> Select Case Script
> Case 0
> Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE)
>
> Exit Sub
>
> Case 5
> Call Welcome(Index)
>
> Exit Sub
>
> Case Else
> Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE)
>
> Exit Sub
> End Select
> End Sub

> Sub Welcome(Index)
> Call BattleMsg(Index, "Master Wercrof: Hello and welcome to the land of Resius where you shall level all the way to level 50! I am Wercrof, I live in the barn to the right.", 4, 0)
> Call BattleMsg(Index, "Master Wercrof: You must be a certain class to use certain weapons.", 4, 0)
> Call BattleMsg(Index, "Master Wercrof: Knights: Swords", 4, 0)
> Call BattleMsg(Index, "Master Wercrof: Rouges: Knifes", 4, 0)
> Call BattleMsg(Index, "Master Wercrof: Archers: Bows", 4, 0)
> Call BattleMsg(Index, "Master Wercrof: Druidic: Some of different", 4, 0)
> Call BattleMsg(Index, "Master Wercrof: Magi: Staff", 4, 0)
> Call BattleMsg(Index, "Master Wercrof: Clef: Mace", 4, 0)
> Call BattleMsg(Index, "Master Wercrof: The controls are easy. Use the arrow keys or WASD to move. To attack, use Ctrl and to pick up things and interact with people use ENTER or Ctrl.", 4, 0)
> Call BattleMsg(Index, "Master Wercrof: To make money defeat monsters, sell items and complete quests.", 4, 0)
> Call GiveItem(Index, 1, 650)
> Call BattleMsg(Index, ": (You got 650 gold)", 4, 0)
> Call BattleMsg(Index, "Master Wercrof: You can train your level in my house", 4, 0)
> End Sub

Regards,
  Godlord.
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...