Jump to content

Welcome to the Forum!

The best place to exchange builds and ideas! Vote for the best ideas and suggestions here.

Join the Avorion Discord!

Connect with other passionate players and talk about the latest news.
Discord

DLC Avorion Into the Rift Out Now!

Now available on Steam!
Steam

Mail script problem


Adamus
 Share

Recommended Posts

I am working on a mod and trying to execute the following function:

Quote

function createDeathMail()
    local player = Player()
    local mail = Mail()
    x, y = Sector():getCoordinates()
    mail.text = Format("Sector %1%:%2% will be destroyed by the Xsotan. You must immediately evacuate.\n\nBest wishes, Space Association"%_t, x, y)
    mail.header = "Xsotan Report"%_T
    mail.sender = "Space Association"%_T
    mail.receiver = player.id
    mail.id = "Xsotan"
    player:addMail(mail)
end

I get a error in logs: attempt to index local 'player' (a nil value).  I'd really appreciate any advice on this.

Edited by Adamus
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...