Modding Tutorial Book (new: Code architecture, unit testing)

User avatar
rubenwardy
Moderator
Posts: 6424
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Modding Tutorial Book (new: Code architecture, unit testing)

by rubenwardy » Post

It's register_on_joinplayer, and you're missing the function(player)

Code: Select all

minetest.register_on_joinplayer(function(player)
  local idx = player:hud_add({
      hud_elem_type = "text",
      position      = {x = 0.5, y = 0.5},
      offset        = {x = 0,   y = 0},
      text          = "Hello world!",
      alignment     = {x = 0, y = 0},  -- center aligned
      scale         = {x = 100, y = 100}, -- covered later
    })
end)

User avatar
debiankaios
Member
Posts: 303
Joined: Thu Dec 03, 2020 12:48
In-game: debiankaios Nowe
Location: germany
Contact:

Re: Modding Tutorial Book (new: Code architecture, unit testing)

by debiankaios » Post

Now it work, thank you!

Post Reply

Who is online

Users browsing this forum: Ghaydn, Hariox and 2 guests