Skip to content

Instantly share code, notes, and snippets.

@PilzAdam
Last active January 1, 2016 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PilzAdam/8136915 to your computer and use it in GitHub Desktop.
Save PilzAdam/8136915 to your computer and use it in GitHub Desktop.
towny = {}
local function make_registration()
local t = {}
local registerfunc = function(func) table.insert(t, func) end
return t, registerfunc
end
towny.registered_on_town_join, towny.register_on_town_join = make_registration()
-- wenn dann ein player einer town joined: (also wenn der spielre den button drückt oder so)
for _,func in ipairs(towny.registered_on_town_join) do
func()
end
-- neue funktionen registrieren mit: (auch in anderen mods die towny in depends.txt haben)
towny.register_on_town_join(func)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment