Hey Modcraft
Some time earlier this year a serverowner asked me to make a script. The server went down the day after though (very poor server, and I was just desperate for ideas for something to make), so I've just had this on my harddrive ever since. And I thought I'd share it with you guys, considering well... Its just rotting on my harddisk, so why not share it?
Its basically a Lua script, which makes a gossip menu and allows the options to be controlled from the database. Pretty straight forward, and rather simple, yet somewhat useful, considering there's no need to reload the Lua scripts, should you want to change it.
Lua (LuaHypArc) Code:
http://pastebin.com/s6YgFRcgSQL Code:
http://pastebin.com/RagiYHm7Columns explained:
Entry: Just an entry ID
MenuId: The ID of the menu which that option should belong to.
Name: The name of the option.
IconId: The icon on the start of the option.
NextMenuId: The ID of the menu it should lead to.
To make specific things to happen at one specific option, you're going to have to edit the Lua script.
Like so:
Make the NextMenuId some unused number, and go into the Lua script. Between the first "if (intid == 0) then" and the 'else' for that if statement, you're gonna want to add another "elseif (intid == NumberOfTheUnusedMenuId) then" and then whatever code you want. Quite simple.
Note: It has to be an ElseIf statement. Not just another If statement. Lots of people does that in Lua scripting, and its rather horrible, really.
Well, I guess that's all there is to say about this script. Enjoy!
Thanks
Keta
PS. Yes, I made it myself.