External Publication
Visit Post

Unable To Detect Follower Type in LUA

SRB2 Message Board [Unofficial] March 28, 2026
Source

Lua:


addHook("PlayerSpawn", function()
    for player in players.iterate do
        chatprint(#player)
        chatprint(followers[#player].name)
        chatprint(player.follower.name)
        chatprint("----")
    end
end)

__

When I run the mod that this code is in, I get "attempt to index field 'follower' (a nil value)" on the line with chatprint(player.follower.name), and chatprint(followers[#player].name) just prints a pre-defined list of 16 followers no matter who has what...

Read more

Discussion in the ATmosphere

Loading comments...