> call( "ent_" .. name, args) -- ERROR Try call( getglobal("ent_" .. name), args) But perhaps it's simpler to do ent = {} function ent.wall() ... end function ent.door() ... end function entity_spawn(name) ent[name]() end --lhf