play LUA (i only try make this)

Discussion in 'Plugin Development' started by repeat, Jul 23, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    repeat

    Hi, I'm not real coder but i know some principal of coding. It's only toy but maybe somewhere it will be good plugin :)

    now i make my own plugin with lua wrapper.
    register few function:
    messageTo("playername" ,"text")
    broadcast("text")

    command (in-game):
    /test - :)
    /plua <filename> - run filename.lua at plug directory

    event for test PLAYER_MOVE (in plug directory onPlayerMove.lua run each time by event)
    and onEnable (runs onEnable.lua)
    this files can be run /plua onPlayerMove or /plua onEnable

    in onPlayerMove.lua you can use 'player' variable containing all from "Player player = event.getPlayer();"
    it mean you can manipulate with
    player:getName()
    player:getHealth()
    player:getLocation()
    player:getLocation():getY()
    player:setDisplayName("asdasd")
    player:getDisplayName()

    '--' when line start with two minus this is mean comment
    uncomment in onPlayerMove.lua

    before
    --plua.broadcast(player:getName())

    after uncomment
    plua.broadcast(player:getName())
     

    Attached Files:

    • plua.zip
      File size:
      139.1 KB
      Views:
      13
  2. Offline

    captainawesome7

    Looks good.
     
  3. Offline

    repeat

Thread Status:
Not open for further replies.

Share This Page