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

Tired


scholastic
 Share

Recommended Posts

I know what scripting is
I don not know how to do it
How do i script a specific npc to do something such as a shopkeeper-I called him a blacksmith but he wont sell,buy,repair or do any of that…Do i need a script?Please help-even if i did have the script where does it go....
THE POINT-How can i find a script for my npc's That tell them how to act in my game?Once i do,Where do i use the script..how do i use it and activate it?
i basically need a script for my blacksmith as a shopkeeper whom sells/buys/and reapirs things specifically...SORRY POST SO LONG FORGIVE ME.The tutorials aren't getting to the point it does good at first then it tuns into a book this is why i ask im tryin
Link to comment
Share on other sites

Open up the file in your scripts folder called Main.txt
Ok, now press CTL F
and type in Sub ScriptedNPC(Index, Script)
and u should get this:
```
Sub ScriptedNPC(Index, Script)
Select Case Script
Case 0
Call PlayerMsg(Index, "This scripted NPC has no apparent use.", WHITE)
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

```ok, now, this part is a little tricky, but highlight the whole thing, and replace it with this:
```
Sub ScriptedNPC(Index, Script)
Select Case Script
Case 0
Call Goshopping(index, 10)
Call PlayerMsg(index, "welcome to my shop!", BRIGHTBLUE)
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

```Once that is done, go back to the server's main folder and open up a file called DATA.ini. Open this, and find where it says Scripting=0 and change it to Scripting=1
Once ALL of that is done, go onto your server and press reload scripts (might just be reload) and then go onto your game. open up the shop editor and make shop 10 into the shop u want the NPC to open when u talk to him. Now open up the NPC editor, and make an NPC and change it's behavior to scripted. Finally, open up your mapeditor and go onto properties and go onto NPC and "spawn" it on the map. (to talk to him, press ctrl while facing it)
I sure hope this is what u were looking for
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...