Send message to all online players

  • Hey,
    i am new in Lua scripting and trying to figure out how to send a message to all online players but it doesn't work :/
    [lua]
    list = getServer:getPlayers();

    for index, player in pairs(list) do
    player:sendTextMessage(event.player:getPlayerName() + " died.");
    end
    [/lua]

  • What messages/errors do you get? What happens if you run this code?


    Just 'it doesn't work' is really not lot of information


    Lua doesn't support + by attaching strings together as far as i know. Try .. instead

Participate now!

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