Example script: AreaProtection

  • Hello folks,


    here is an example Lua script, useful for defining areas. An area can be defined by typing "/selectarea" in the chat, then selecting the area, and finally typing "/createarea name" (you can choose a custom name of course) in the chat.


    This script offers some basic things (see updated post below) and serves only as an example, now it's your turn to do something useful with it ;)


    To load the script, simply extract the content of the zip-archive to your "scripts" folder of the game (with other words: the "AreaProtection" folder inside the zip must be inside "scripts" of your Rising World folder). The script will be automatically loaded then.
    If there is no "scripts" folder in your game directory, simply create it.


    Have fun! :)


    IMPORTANT: If you want to update your existing script, make sure you don't delete or overwrite the file "scriptDatabase.db" inside the "AreaProtection" folder. This file contains all saved areas, so if you delete it, all existing areas are gone :!:

  • There is a typo in the listener.commandListener.lua on line 59. It should read as follows:


    Code
    local insertID = database:getLastInsertID();


    The original code had this:


    Code
    local insertID = database:getLastInstertID();


    The result of the original code created a nil insertID which causes the client to disconnect and a nil error to be reported in the server console.

  • Thanks for letting us know!
    I fixed this error in the script, and re- attached to my first post.
    But the area protection script is really old, we will rework it anyway. we also give the multiplayer features, LUA and the wiki a much higher priority now (before steam release there were not many players playing multiplayer, so we concentrated more on other things).

  • I'm currently modifying it for my server to allow players to create 1 protected area of a specific limited size. The admin will still be able to create an unlimited number and size of protected areas.

  • The /showareas command will display the the areas highlighted in a color. Once I have completed the script to allow players to use it on my server, you will be able to use it.

  • Hi
    here is the commandlist


    1. /selectarea
    2. /createarea
    3. /showareas
    4. /hideareas
    5. /removearea
    6. /addplayertoarea
    7. /removeplayerfromarea
    8. /reloadgroups


    1. /selectarea make a Startpoint then a Endpoint
    2. /createarea "areaname"
    3. /addplayertoarea "Group" "Playername"
    3. /addplayertoarea Admin Lichti


    finish

  • Hallo,


    ich hab das Skript auf meinem Server eingefügt...


    Wenn ich aber z.b. den Befehl /createarea eingebe, kommt immer die Fehlermeldung command not found?


    Gibt's ne Art Anleitung, oder woran könnte das liegen?


    Gruß
    Florian

  • 1. /selectarea ----> breich auswählen
    2. Start und Endpunkt mit Linksklick festlegen
    3. Auswahl verändern mit: Pfeiltasten, Shift Pfeiltasten, + or - und Shif + or -
    4. /createarea "NAME" -----> wie der bereich heisen soll
    5. /addplayertoarea Admin "USER" -----> Welcher Spieler da bauen darf
    Admin ist kein Server RANK der ist für die Bauberichtigung für den bereich den du abstecktst.


    Wichtig immer im Bereich stehen sonst wirst du gekickt.
    Aso glaube es ist besser, fragen dazu ins Deutsche Hilfe Forum zuschreiben... ach KP XD.


    Wer fehler findet darf sie behalten


    lg Diesel

  • Oh sry, hab gar net drauf geachtet das hier alles in Englisch steht^^


    Hab's jetzt soweit hinbekommen... Es werden aber bloß gesetzte Blöcke geschützt, oder? Das Terrain an sich kann man mit dem Skript nicht schützen?


    Gruß
    Florian

  • Nur blöcke, aber Gestern bzw spätestens Heute sollte die überarbeitet version rauskommen.
    Wo dann auch kisten, Türen und objekte gesichert sind.
    Ob da dann auch Terrain bei ist weis ich nicht.


    lg Diesel

  • I am running this script on my server and I can see the areas that i created with the command. But when random users connect they can still destroy the blocks and objects in the area. Do the colors of the areas mean any thing. I have some red, blue, and yellow areas.

  • After a restart of the server the areas still there but i always must add the Players again to the admin group of the defined area. Otherwise they can not build in their own area...?


    Is that normal?

  • A new version of the AreaProtection script is available! It now protects changes to blocks, terrain, objects, constructions, vegetations and grass. Apart from that, only the owner of the area can open doors and take items from chests. Depending on the group permissions, other users can put items into the chest (maybe useful for gifts, which can still be placed in protected areas, but this can be changed of course).
    Please note that only new chests are protected, which are placed after you've installed the updated ProtectionScript.


    Another important change: Permissions are now saved after a restart. Have fun with the new script!

  • Look at the errors generated in the console. If you can't get the whole console output, change your batch file that you use to launch the jar. Add this to the end of the jar command " > log.txt 2>&1" without the quotes. That will redirect stdout and error output to the log.txt. Then you can examine the log and determine exactly why it is crashing immediately.


    example:
    java -jar server.jar > log.txt 2>&1

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!